@ndwnu/design-system 9.1.0 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/fesm2022/ndwnu-design-system.mjs +2344 -2252
  2. package/fesm2022/ndwnu-design-system.mjs.map +1 -1
  3. package/lib/components/accordion/accordion.component.d.ts +3 -3
  4. package/lib/components/collapsible/collapsible.component.d.ts +3 -1
  5. package/lib/components/dropdown/dropdown.component.d.ts +1 -1
  6. package/lib/components/form-field/autosuggest/autosuggest-option/base-autosuggest-option.component.d.ts +1 -1
  7. package/lib/components/form-field/month-input/date-validators.d.ts +3 -0
  8. package/lib/components/form-field/month-input/month-input-utils.d.ts +2 -1
  9. package/lib/components/form-field/month-input/month-input.component.d.ts +4 -1
  10. package/lib/components/form-field/option-group/option.component.d.ts +2 -1
  11. package/lib/components/index.d.ts +2 -0
  12. package/lib/components/list/index.d.ts +1 -0
  13. package/lib/components/list/list.component.d.ts +6 -0
  14. package/lib/components/list-item/index.d.ts +1 -0
  15. package/lib/components/list-item/list-item.component.d.ts +28 -0
  16. package/lib/components/main-navigation/main-navigation-header/main-navigation-header.component.d.ts +1 -1
  17. package/lib/components/multi-select/checkbox-data.interface.d.ts +3 -0
  18. package/lib/models/image.model.d.ts +4 -0
  19. package/lib/models/index.d.ts +1 -0
  20. package/package.json +2 -2
  21. package/styles/base/_colors.scss +1 -1
  22. package/styles/base/colors.stories.model.ts +28 -92
  23. package/styles/base/colors.stories.ts +13 -3
  24. package/styles/base/typography.stories.ts +4 -9
  25. package/styles/components/_divider.scss +1 -1
  26. package/styles/components/_input.scss +0 -4
  27. package/styles/base/colors.stories.utils.ts +0 -58
@@ -1,11 +1,11 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { CollapsibleComponent } from '../collapsible';
3
+ import { ListComponent } from '../list';
3
4
  import * as i0 from "@angular/core";
4
- export declare class AccordionComponent implements OnInit {
5
+ export declare class AccordionComponent extends ListComponent implements OnInit {
6
+ #private;
5
7
  collapseOthers: import("@angular/core").InputSignal<boolean>;
6
8
  collapsibles: import("@angular/core").Signal<readonly CollapsibleComponent[]>;
7
- private readonly accordionService;
8
- private readonly destroyRef;
9
9
  ngOnInit(): void;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<AccordionComponent, never>;
11
11
  static ɵcmp: i0.ɵɵComponentDeclaration<AccordionComponent, "ndw-accordion", never, { "collapseOthers": { "alias": "collapseOthers"; "required": false; "isSignal": true; }; }, {}, ["collapsibles"], ["*"], true, never>;
@@ -2,6 +2,8 @@ import * as i0 from "@angular/core";
2
2
  export declare class CollapsibleComponent {
3
3
  index: import("@angular/core").InputSignal<number>;
4
4
  title: import("@angular/core").InputSignal<string>;
5
+ checkable: import("@angular/core").InputSignal<boolean>;
6
+ subtitle: import("@angular/core").InputSignal<string | undefined>;
5
7
  value: import("@angular/core").InputSignal<number | undefined>;
6
8
  expanded: import("@angular/core").ModelSignal<boolean>;
7
9
  private readonly accordionService;
@@ -11,5 +13,5 @@ export declare class CollapsibleComponent {
11
13
  animationState: import("@angular/core").Signal<"open" | "closed">;
12
14
  toggle(): void;
13
15
  static ɵfac: i0.ɵɵFactoryDeclaration<CollapsibleComponent, never>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<CollapsibleComponent, "ndw-collapsible", never, { "index": { "alias": "index"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, ["*"], true, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<CollapsibleComponent, "ndw-collapsible", never, { "index": { "alias": "index"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": true; "isSignal": true; }; "checkable": { "alias": "checkable"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, ["custom-header-content", "*"], true, never>;
15
17
  }
@@ -11,7 +11,7 @@ export declare class DropdownComponent {
11
11
  readonly isOpenChange: import("@angular/core").OutputEmitterRef<boolean>;
12
12
  readonly popoverTrigger: import("@angular/core").Signal<PopoverTriggerDirective>;
13
13
  readonly dropdownButton: import("@angular/core").Signal<ElementRef<any>>;
14
- readonly buttonIcon: import("@angular/core").Signal<"keyboard_arrow_up" | "keyboard_arrow_down">;
14
+ readonly buttonIcon: import("@angular/core").Signal<"keyboard_arrow_down" | "keyboard_arrow_up">;
15
15
  onTagClicked($event: Event): void;
16
16
  onKeyDown(event: KeyboardEvent): void;
17
17
  closeDropdown(): void;
@@ -22,5 +22,5 @@ export declare abstract class BaseAutosuggestOptionComponent<T> implements Focus
22
22
  ngOnDestroy(): void;
23
23
  protected getHostElement(): HTMLElement;
24
24
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseAutosuggestOptionComponent<any>, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<BaseAutosuggestOptionComponent<any>, "ng-component", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
25
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaseAutosuggestOptionComponent<any>, never, never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
26
26
  }
@@ -0,0 +1,3 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ export declare const minDateValidator: (min: Date) => ValidatorFn;
3
+ export declare const maxDateValidator: (max: Date) => ValidatorFn;
@@ -1,5 +1,6 @@
1
1
  export declare function createYearRange(minDate: Date, maxDate: Date): number[];
2
- export declare function createMonthOptions(monthLabels: string[]): {
2
+ export declare function createMonthOptions(monthLabels: string[], year: number, minDate: Date, maxDate: Date): {
3
3
  label: string;
4
4
  value: number;
5
+ disabled: boolean;
5
6
  }[];
@@ -12,6 +12,7 @@ export declare class MonthInputComponent implements ControlValueAccessor, OnInit
12
12
  readonly minDate: import("@angular/core").InputSignal<Date>;
13
13
  readonly maxDate: import("@angular/core").InputSignal<Date>;
14
14
  readonly monthLabels: import("@angular/core").InputSignal<string[]>;
15
+ readonly addValidators: import("@angular/core").InputSignal<boolean>;
15
16
  readonly disabled: import("@angular/core").ModelSignal<boolean>;
16
17
  readonly readonly: import("@angular/core").InputSignal<boolean>;
17
18
  protected readonly selectedYear: import("@angular/core").ModelSignal<number>;
@@ -23,7 +24,9 @@ export declare class MonthInputComponent implements ControlValueAccessor, OnInit
23
24
  protected readonly months: import("@angular/core").Signal<{
24
25
  label: string;
25
26
  value: number;
27
+ disabled: boolean;
26
28
  }[]>;
29
+ protected readonly isYearValid: import("@angular/core").Signal<boolean>;
27
30
  readonly input: import("@angular/core").Signal<InputDirective | undefined>;
28
31
  protected showMonthPicker: boolean;
29
32
  private onChange;
@@ -40,5 +43,5 @@ export declare class MonthInputComponent implements ControlValueAccessor, OnInit
40
43
  protected onKeyDown(event: KeyboardEvent): void;
41
44
  private adjustMonth;
42
45
  static ɵfac: i0.ɵɵFactoryDeclaration<MonthInputComponent, never>;
43
- static ɵcmp: i0.ɵɵComponentDeclaration<MonthInputComponent, "ndw-month-input", never, { "required": { "alias": "required"; "required": false; "isSignal": true; }; "showMonthPickerLabel": { "alias": "showMonthPickerLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "yearPlaceholder": { "alias": "yearPlaceholder"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "monthLabels": { "alias": "monthLabels"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "selectedYear": { "alias": "selectedYear"; "required": false; "isSignal": true; }; "selectedMonth": { "alias": "selectedMonth"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "selectedYear": "selectedYearChange"; "selectedMonth": "selectedMonthChange"; }, never, never, true, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<MonthInputComponent, "ndw-month-input", never, { "required": { "alias": "required"; "required": false; "isSignal": true; }; "showMonthPickerLabel": { "alias": "showMonthPickerLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "yearPlaceholder": { "alias": "yearPlaceholder"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "monthLabels": { "alias": "monthLabels"; "required": false; "isSignal": true; }; "addValidators": { "alias": "addValidators"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "selectedYear": { "alias": "selectedYear"; "required": false; "isSignal": true; }; "selectedMonth": { "alias": "selectedMonth"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "selectedYear": "selectedYearChange"; "selectedMonth": "selectedMonthChange"; }, never, never, true, never>;
44
47
  }
@@ -4,6 +4,7 @@ export declare class OptionComponent {
4
4
  label: import("@angular/core").InputSignal<string>;
5
5
  description: import("@angular/core").InputSignal<string | undefined>;
6
6
  required: import("@angular/core").InputSignal<boolean>;
7
+ disabled: import("@angular/core").InputSignal<boolean>;
7
8
  static ɵfac: i0.ɵɵFactoryDeclaration<OptionComponent, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<OptionComponent, "ndw-option", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<OptionComponent, "ndw-option", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
9
10
  }
@@ -16,6 +16,8 @@ export * from './form-field';
16
16
  export * from './icon';
17
17
  export * from './layout';
18
18
  export * from './layout-banners';
19
+ export * from './list';
20
+ export * from './list-item';
19
21
  export * from './loader';
20
22
  export * from './main-navigation';
21
23
  export * from './map-button';
@@ -0,0 +1 @@
1
+ export * from './list.component';
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class ListComponent {
3
+ elevated: import("@angular/core").InputSignal<boolean>;
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListComponent, never>;
5
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListComponent, "ndw-list", never, { "elevated": { "alias": "elevated"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './list-item.component';
@@ -0,0 +1,28 @@
1
+ import { PillColor } from '../pill';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ListItemComponent {
4
+ #private;
5
+ active: import("@angular/core").ModelSignal<boolean>;
6
+ badgeValue: import("@angular/core").InputSignal<number | undefined>;
7
+ buttonIcon: import("@angular/core").InputSignal<string | undefined>;
8
+ buttonLabel: import("@angular/core").InputSignal<string | undefined>;
9
+ checkable: import("@angular/core").InputSignal<boolean>;
10
+ collapsible: import("@angular/core").InputSignal<boolean>;
11
+ disabled: import("@angular/core").InputSignal<boolean>;
12
+ indented: import("@angular/core").InputSignal<boolean>;
13
+ pillColor: import("@angular/core").InputSignal<PillColor>;
14
+ pillLabel: import("@angular/core").InputSignal<string | undefined>;
15
+ prefixIcon: import("@angular/core").InputSignal<string | undefined>;
16
+ showButton: import("@angular/core").InputSignal<boolean>;
17
+ subtitle: import("@angular/core").InputSignal<string | undefined>;
18
+ title: import("@angular/core").InputSignal<string | undefined>;
19
+ buttonClicked: import("@angular/core").OutputEmitterRef<void>;
20
+ checked: import("@angular/core").ModelSignal<boolean>;
21
+ expanded: import("@angular/core").ModelSignal<boolean>;
22
+ actionable: import("@angular/core").Signal<boolean>;
23
+ onButtonClick(event: Event): void;
24
+ onCheckboxClick(event: Event): void;
25
+ onListItemSelect(): void;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListItemComponent, never>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListItemComponent, "ndw-list-item", never, { "active": { "alias": "active"; "required": false; "isSignal": true; }; "badgeValue": { "alias": "badgeValue"; "required": false; "isSignal": true; }; "buttonIcon": { "alias": "buttonIcon"; "required": false; "isSignal": true; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; "isSignal": true; }; "checkable": { "alias": "checkable"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "indented": { "alias": "indented"; "required": false; "isSignal": true; }; "pillColor": { "alias": "pillColor"; "required": false; "isSignal": true; }; "pillLabel": { "alias": "pillLabel"; "required": false; "isSignal": true; }; "prefixIcon": { "alias": "prefixIcon"; "required": false; "isSignal": true; }; "showButton": { "alias": "showButton"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "active": "activeChange"; "buttonClicked": "buttonClicked"; "checked": "checkedChange"; "expanded": "expandedChange"; }, never, ["*"], true, never>;
28
+ }
@@ -10,7 +10,7 @@ export declare class MainNavigationHeaderComponent {
10
10
  themeImagePath: import("@angular/core").InputSignal<string>;
11
11
  environment: import("@angular/core").InputSignal<Environment | undefined>;
12
12
  isMobileMenuOpen: import("@angular/core").ModelSignal<boolean>;
13
- environmentColor: import("@angular/core").Signal<"blue" | "green" | "yellow" | "gray">;
13
+ environmentColor: import("@angular/core").Signal<"blue" | "gray" | "green" | "yellow">;
14
14
  toggleMobileMenu(): void;
15
15
  static ɵfac: i0.ɵɵFactoryDeclaration<MainNavigationHeaderComponent, never>;
16
16
  static ɵcmp: i0.ɵɵComponentDeclaration<MainNavigationHeaderComponent, "ndw-main-navigation-header", never, { "applicationName": { "alias": "applicationName"; "required": true; "isSignal": true; }; "closeButtonLabel": { "alias": "closeButtonLabel"; "required": true; "isSignal": true; }; "isExpanded": { "alias": "isExpanded"; "required": true; "isSignal": true; }; "isMobile": { "alias": "isMobile"; "required": true; "isSignal": true; }; "menuButtonLabel": { "alias": "menuButtonLabel"; "required": true; "isSignal": true; }; "theme": { "alias": "theme"; "required": true; "isSignal": true; }; "themeImagePath": { "alias": "themeImagePath"; "required": true; "isSignal": true; }; "environment": { "alias": "environment"; "required": false; "isSignal": true; }; "isMobileMenuOpen": { "alias": "isMobileMenuOpen"; "required": true; "isSignal": true; }; }, { "isMobileMenuOpen": "isMobileMenuOpenChange"; }, never, never, true, never>;
@@ -1,5 +1,8 @@
1
+ import { Image } from '../../models';
1
2
  export interface CheckboxData {
2
3
  id: string | number;
3
4
  label: string;
4
5
  value: boolean;
6
+ icon?: string;
7
+ image?: Image;
5
8
  }
@@ -0,0 +1,4 @@
1
+ export interface Image {
2
+ src: string;
3
+ alt: string;
4
+ }
@@ -1 +1,2 @@
1
1
  export * from './aria.model';
2
+ export * from './image.model';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndwnu/design-system",
3
- "version": "9.1.0",
3
+ "version": "9.2.0",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^19.0.0",
6
6
  "@angular/cdk": "^19.0.0",
@@ -8,7 +8,7 @@
8
8
  "@angular/core": "^19.0.0",
9
9
  "@angular/forms": "^19.0.0",
10
10
  "@angular/router": "^19.0.0",
11
- "@ndwnu/core": "0.0.2-beta.1",
11
+ "@ndwnu/core": "0.0.3-beta.1",
12
12
  "@storybook/addon-actions": "8.6.12",
13
13
  "@storybook/angular": "8.6.12",
14
14
  "rxjs": "^7.8.0"
@@ -187,7 +187,7 @@
187
187
  --_primary-200: 176, 44%, 73%;
188
188
  --_primary-300: 176, 50%, 60%;
189
189
  --_primary-400: 176, 55%, 48%;
190
- --_primary-500: 176, 58%, 41%;
190
+ --_primary-500: 176, 53%, 33%;
191
191
  --_primary-600: 176, 60%, 34%;
192
192
  --_primary-700: 176, 68%, 21%;
193
193
  --_primary-800: 176, 68%, 13%;
@@ -1,16 +1,6 @@
1
- import { alphas, colors, header } from './colors.stories.utils';
1
+ import { ColorGroup } from '@ndwnu/core';
2
2
 
3
- interface ColorValue {
4
- value?: number;
5
- subName?: string;
6
- }
7
-
8
- export interface ColorGroup {
9
- name: string;
10
- colors: ColorValue[];
11
- }
12
-
13
- const primary: ColorGroup = {
3
+ export const PRIMARY: ColorGroup = {
14
4
  name: 'Primary',
15
5
  colors: [
16
6
  { value: 50 },
@@ -25,7 +15,7 @@ const primary: ColorGroup = {
25
15
  ],
26
16
  };
27
17
 
28
- const secondary: ColorGroup = {
18
+ export const SECONDARY: ColorGroup = {
29
19
  name: 'Secondary',
30
20
  colors: [
31
21
  { value: 50 },
@@ -39,14 +29,15 @@ const secondary: ColorGroup = {
39
29
  ],
40
30
  };
41
31
 
42
- const tertiary: ColorGroup = {
32
+ export const TERTIARY: ColorGroup = {
43
33
  name: 'Tertiary',
44
34
  colors: [{ value: 400 }, { value: 500 }],
45
35
  };
46
36
 
47
- const grey: ColorGroup = {
37
+ export const GREY: ColorGroup = {
48
38
  name: 'Grey',
49
39
  colors: [
40
+ { value: undefined, altName: 'White' },
50
41
  { value: 100 },
51
42
  { value: 200 },
52
43
  { value: 300 },
@@ -57,87 +48,32 @@ const grey: ColorGroup = {
57
48
  ],
58
49
  };
59
50
 
60
- const white: ColorGroup = {
61
- name: 'White',
62
- colors: [{ value: undefined }],
63
- };
64
-
65
- const links: ColorGroup = {
51
+ export const LINK: ColorGroup = {
66
52
  name: 'Link',
67
53
  colors: [{ value: 400 }, { value: 500 }],
68
54
  };
69
55
 
70
- const positive: ColorGroup = {
71
- name: 'Positive',
72
- colors: [{ value: 100 }, { value: 500 }, { value: 600 }],
73
- };
74
-
75
- const warning: ColorGroup = {
76
- name: 'Warning',
77
- colors: [{ value: 100 }, { value: 500 }, { value: 600 }],
78
- };
79
-
80
- const info: ColorGroup = {
81
- name: 'Info',
82
- colors: [{ value: 100 }, { value: 500 }],
83
- };
84
-
85
- const alternative: ColorGroup = {
86
- name: 'Alternative',
87
- colors: [{ value: 100 }, { value: 500 }],
56
+ export const NOTIFICATIONS: ColorGroup = {
57
+ name: 'Notifications',
58
+ colors: [
59
+ { value: 100, altName: 'Positive' },
60
+ { value: 500, altName: 'Positive' },
61
+ { value: 600, altName: 'Positive' },
62
+ { value: 100, altName: 'Warning' },
63
+ { value: 500, altName: 'Warning' },
64
+ { value: 600, altName: 'Warning' },
65
+ { value: 100, altName: 'Critical' },
66
+ { value: 200, altName: 'Critical' },
67
+ { value: 300, altName: 'Critical' },
68
+ { value: 500, altName: 'Critical' },
69
+ { value: 100, altName: 'Info' },
70
+ { value: 500, altName: 'Info' },
71
+ { value: 100, altName: 'Alternative' },
72
+ { value: 500, altName: 'Alternative' },
73
+ ],
88
74
  };
89
75
 
90
- const critical: ColorGroup = {
91
- name: 'Critical',
92
- colors: [{ value: 100 }, { value: 200 }, { value: 300 }, { value: 500 }],
76
+ export const ALPHAS: ColorGroup = {
77
+ name: 'Alphas',
78
+ alphas: ['Black-007', 'Black-015', 'Black-040', 'Primary-007', 'Primary-015'],
93
79
  };
94
-
95
- const alphaValues = ['Black-007', 'Black-015', 'Black-040', 'Primary-007', 'Primary-015'];
96
-
97
- // Todo - Update color values when switching between themes
98
- export const template = `
99
- <div class="sb">
100
- <div class="sb_content overview colors">
101
- <section>
102
- <h2 class="ndw-heading-md">Primary</h2>
103
- ${header(['Color', 'Name', 'Value', 'Variable'])}
104
- ${colors(primary)}
105
- </section>
106
- <section>
107
- <h2 class="ndw-heading-md">Secondary</h2>
108
- ${header(['Color', 'Name', 'Value', 'Variable'])}
109
- ${colors(secondary)}
110
- </section>
111
- <section>
112
- <h2 class="ndw-heading-md">Tertiary</h2>
113
- ${header(['Color', 'Name', 'Value', 'Variable'])}
114
- ${colors(tertiary)}
115
- </section>
116
- <section>
117
- <h2 class="ndw-heading-md">Grey</h2>
118
- ${header(['Color', 'Name', 'Value', 'Variable'])}
119
- ${colors(white)}
120
- ${colors(grey)}
121
- </section>
122
- <section>
123
- <h2 class="ndw-heading-md">Links</h2>
124
- ${header(['Color', 'Name', 'Value', 'Variable'])}
125
- ${colors(links)}
126
- </section>
127
- <section>
128
- <h2 class="ndw-heading-md">Notifications</h2>
129
- ${header(['Color', 'Name', 'Value', 'Variable'])}
130
- ${colors(positive)}
131
- ${colors(info)}
132
- ${colors(warning)}
133
- ${colors(critical)}
134
- ${colors(alternative)}
135
- </section>
136
- <section>
137
- <h2 class="ndw-heading-md">Alpha</h2>
138
- ${header(['Alpha', 'Name', 'Value', 'Variable'])}
139
- ${alphas(alphaValues)}
140
- </section>
141
- </div>
142
- </div>
143
- `;
@@ -1,11 +1,21 @@
1
+ import { template } from '@ndwnu/core';
1
2
  import { type Meta, type StoryObj } from '@storybook/angular';
2
3
 
3
- import { template } from './colors.stories.model';
4
+ import {
5
+ ALPHAS,
6
+ GREY,
7
+ LINK,
8
+ NOTIFICATIONS,
9
+ PRIMARY,
10
+ SECONDARY,
11
+ TERTIARY,
12
+ } from './colors.stories.model';
4
13
 
5
14
  const meta: Meta = {
6
15
  title: 'Core/Colors',
7
- tags: ['autodocs', 'ndw', 'nwb', 'ntm'],
8
- render: () => ({ template }),
16
+ render: () => ({
17
+ template: template([PRIMARY, SECONDARY, TERTIARY, GREY, LINK, NOTIFICATIONS, ALPHAS]),
18
+ }),
9
19
  } as Meta;
10
20
 
11
21
  export default meta;
@@ -1,16 +1,11 @@
1
+ import { TypographyVariant } from '@ndwnu/core';
1
2
  import { type Meta, type StoryObj } from '@storybook/angular';
2
3
 
3
4
  interface StoryArgs {
4
- typographyList: Typography[];
5
+ typographyList: TypographyVariant[];
5
6
  }
6
7
 
7
- interface Typography {
8
- fontSize: string;
9
- fontSizeInRem: string;
10
- class: string;
11
- }
12
-
13
- const typographyList: Typography[] = [
8
+ const typographyList: TypographyVariant[] = [
14
9
  {
15
10
  fontSize: '40px',
16
11
  fontSizeInRem: '2.5rem',
@@ -92,7 +87,7 @@ const meta: Meta<StoryArgs> = {
92
87
  </div>
93
88
  ${typographyList
94
89
  .map(
95
- (typography: Typography) => `
90
+ (typography: TypographyVariant) => `
96
91
  <div class="content ${typography.class}">
97
92
  <span>${typography.fontSize} / ${typography.fontSizeInRem}</span>
98
93
  <span>150%</span>
@@ -1,5 +1,5 @@
1
1
  hr[ndwDivider] {
2
- background-color: var(--ndw-color-grey-300);
2
+ background-color: var(--ndw-color-grey-200);
3
3
  border: none;
4
4
  height: var(--ndw-border-size-sm);
5
5
  margin: var(--ndw-spacing-xs) 0;
@@ -100,10 +100,6 @@
100
100
  padding-inline-end: var(--ndw-spacing-xs);
101
101
  }
102
102
 
103
- .input-container[error]:has(> [ndwInput]:is(:active, :focus, :focus-visible)) {
104
- background-color: var(--ndw-color-white);
105
- }
106
-
107
103
  .input-container[error]:has(> [ndwInput]:is(:active, :focus, :focus-visible)) {
108
104
  background-color: var(--ndw-color-white);
109
105
  select[ndwInput] {
@@ -1,58 +0,0 @@
1
- import { ColorGroup } from './colors.stories.model';
2
-
3
- export function header(values: string[]): string {
4
- return `
5
- <div class="header">
6
- ${values.map((value) => `<p class="ndw-heading-sm">${value}</p>`).join('')}
7
- </div>
8
- `;
9
- }
10
-
11
- export function colors(type: ColorGroup): string {
12
- const style = getComputedStyle(document.body);
13
-
14
- return `${type.colors
15
- .map((color) => {
16
- const subName = color.subName ? `-${color.subName}` : '';
17
- const convertedValue = color.value && color.value < 100 ? `0${color.value}` : color.value;
18
- const value = color.value ? `-${convertedValue}` : '';
19
- const variable = `--ndw-color-${type.name}${subName}${value}`.toLowerCase();
20
-
21
- return `
22
- <div class="content">
23
- <div
24
- class="block"
25
- style="background-color: var(${variable})"
26
- ></div>
27
- <p>${type.name}${subName}${value}</p>
28
- <p>${style.getPropertyValue(variable)}</p>
29
- <p>${variable}</p>
30
- </div>
31
- `;
32
- })
33
- .join('')}`;
34
- }
35
-
36
- export function alphas(values: string[]): string {
37
- const style = getComputedStyle(document.body);
38
-
39
- return `
40
- ${values
41
- .map((alpha) => {
42
- const variable = `--ndw-alpha-${alpha.toLowerCase()}`;
43
-
44
- return `
45
- <div class="content">
46
- <div
47
- class="block"
48
- style="background-color: var(--ndw-alpha-${alpha.toLowerCase()})"
49
- ></div>
50
- <p>${alpha}</p>
51
- <p>${style.getPropertyValue(variable)}</p>
52
- <p>${variable}</p>
53
- </div>
54
- `;
55
- })
56
- .join('')}
57
- `;
58
- }