@ndwnu/design-system 7.1.0 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import { AvatarStatus, AvatarColor } from './avatar.model';
2
+ import * as i0 from "@angular/core";
3
+ export declare class AvatarComponent {
4
+ status: import("@angular/core").InputSignal<AvatarStatus>;
5
+ initials: import("@angular/core").InputSignal<boolean>;
6
+ color: import("@angular/core").InputSignal<AvatarColor | undefined>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvatarComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<AvatarComponent, "ndw-avatar", never, { "status": { "alias": "status"; "required": false; "isSignal": true; }; "initials": { "alias": "initials"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
9
+ }
@@ -0,0 +1,2 @@
1
+ export type AvatarStatus = 'approved' | 'open' | 'none';
2
+ export type AvatarColor = 'default' | 'blue' | 'purple' | 'red' | 'green' | 'yellow' | 'orange';
@@ -0,0 +1,2 @@
1
+ export * from './avatar.component';
2
+ export * from './avatar.model';
@@ -8,7 +8,7 @@ export declare class CollapsibleComponent {
8
8
  private readonly uuid;
9
9
  readonly toggleUuid: string;
10
10
  readonly sectionUuid: string;
11
- animationState: import("@angular/core").Signal<"closed" | "open">;
11
+ animationState: import("@angular/core").Signal<"open" | "closed">;
12
12
  toggle(): void;
13
13
  static ɵfac: i0.ɵɵFactoryDeclaration<CollapsibleComponent, never>;
14
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>;
@@ -3,6 +3,7 @@ import { AbstractControl } from '@angular/forms';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class InputDirective implements OnInit {
5
5
  set disabled(disabled: boolean);
6
+ get error(): boolean;
6
7
  set error(error: boolean);
7
8
  set success(success: boolean);
8
9
  set id(id: string);
@@ -13,6 +14,7 @@ export declare class InputDirective implements OnInit {
13
14
  get element(): HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
14
15
  get control(): AbstractControl | null;
15
16
  ngOnInit(): void;
17
+ updateErrorAttribute(formFieldError?: boolean): void;
16
18
  private setSelectPlaceholderAttribute;
17
19
  private updateRequiredAttribute;
18
20
  static ɵfac: i0.ɵɵFactoryDeclaration<InputDirective, never>;
@@ -29,6 +29,7 @@ export declare class MonthInputComponent implements ControlValueAccessor, OnInit
29
29
  private onChange;
30
30
  constructor();
31
31
  ngOnInit(): void;
32
+ updateErrorAttribute(formFieldError?: boolean): void;
32
33
  writeValue(value: Date | null): void;
33
34
  registerOnChange(fn: (value: Date | null) => void): void;
34
35
  setDisabledState(isDisabled: boolean): void;
@@ -1,5 +1,6 @@
1
1
  export * from './accordion';
2
2
  export * from './alert';
3
+ export * from './avatar';
3
4
  export * from './badge';
4
5
  export * from './banner';
5
6
  export * from './breadcrumb';
@@ -21,9 +22,10 @@ export * from './multi-select';
21
22
  export * from './pill';
22
23
  export * from './popover';
23
24
  export * from './router-breadcrumbs';
25
+ export * from './splitter';
26
+ export * from './summary-card';
24
27
  export * from './tab';
25
28
  export * from './tab-group';
26
29
  export * from './tag';
27
30
  export * from './toast';
28
31
  export * from './tooltip';
29
- export * from './summary-card';
@@ -22,7 +22,7 @@ export declare class MainNavigationComponent implements AfterViewInit, OnDestroy
22
22
  childMenuTemplate: import("@angular/core").Signal<TemplateRef<MainNavigationMenuComponent>>;
23
23
  isMobile: import("@angular/core").WritableSignal<boolean>;
24
24
  brandImagePath: import("@angular/core").Signal<string>;
25
- environmentPillColor: import("@angular/core").Signal<"gray" | "green" | "blue" | "yellow">;
25
+ environmentPillColor: import("@angular/core").Signal<"blue" | "green" | "yellow" | "gray">;
26
26
  activeId?: number;
27
27
  protected mobilePortal?: TemplatePortal<MainNavigationMenuComponent>;
28
28
  onMouseMove(event: MouseEvent): void;
@@ -7,4 +7,4 @@ import { IconComponent } from '../icon';
7
7
  import { MainNavigationMenuComponent } from '../main-navigation-menu';
8
8
  import { TooltipDirective } from '../tooltip';
9
9
  import { PillComponent } from '../pill';
10
- export declare const MAIN_NAVIGATION_IMPORTS: (typeof NgTemplateOutlet | typeof IconComponent | typeof NgClass | typeof TooltipDirective | typeof BadgeComponent | typeof CdkPortalOutlet | typeof MainNavigationMenuComponent | typeof OverlayModule | typeof PillComponent | typeof RouterLink)[];
10
+ export declare const MAIN_NAVIGATION_IMPORTS: (typeof BadgeComponent | typeof IconComponent | typeof NgClass | typeof NgTemplateOutlet | typeof RouterLink | typeof TooltipDirective | typeof MainNavigationMenuComponent | typeof PillComponent | typeof CdkPortalOutlet | typeof OverlayModule)[];
@@ -0,0 +1 @@
1
+ export * from './splitter.component';
@@ -0,0 +1,69 @@
1
+ import { Point } from '@angular/cdk/drag-drop';
2
+ import { AfterViewInit, OnDestroy } from '@angular/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class SplitterComponent implements AfterViewInit, OnDestroy {
5
+ readonly disabled: import("@angular/core").InputSignal<boolean>;
6
+ /**
7
+ * Optional width of the first panel (in pixels) when the component is initialized.
8
+ */
9
+ readonly initialPanelWidth: import("@angular/core").InputSignal<number | undefined>;
10
+ /**
11
+ * Minimum width of both panels (in pixels).
12
+ */
13
+ readonly minimumPanelWidth: import("@angular/core").InputSignal<number>;
14
+ protected readonly firstPanelWidth: import("@angular/core").WritableSignal<number>;
15
+ protected readonly secondPanelWidth: import("@angular/core").Signal<number>;
16
+ protected readonly isDragging: import("@angular/core").WritableSignal<boolean>;
17
+ private readonly container;
18
+ private readonly splitter;
19
+ private readonly cdkDrag;
20
+ private storedFirstPanelWidth;
21
+ /**
22
+ * Flag to indicate if the mouse click event should be
23
+ * ignored because the user is dragging the splitter.
24
+ */
25
+ private ignoreMouseClick;
26
+ /**
27
+ * Reactive object to store the dimensions of the drag elements.
28
+ * Updated by a resize observer on the container.
29
+ */
30
+ private readonly dragElementDimensions;
31
+ private readonly resizeObserver;
32
+ /**
33
+ * Available width for the panels, without considering the `minimumPanelWidth` input.
34
+ */
35
+ private readonly availableWidth;
36
+ /**
37
+ * Position of the drag handle when the component is initialized.
38
+ * The drag position is always relative to this starting position.
39
+ */
40
+ private readonly dragStartPosition;
41
+ /**
42
+ * Minimum panel width that is safe to use, considering the
43
+ * available container width and the `minimumPanelWidth` input.
44
+ */
45
+ protected readonly safeMinPanelWidth: import("@angular/core").Signal<number>;
46
+ /**
47
+ * Maximum panel width that is safe to use, considering the
48
+ * available container width and the `minimumPanelWidth
49
+ */
50
+ protected readonly safeMaxPanelWidth: import("@angular/core").Signal<number>;
51
+ constructor();
52
+ ngAfterViewInit(): void;
53
+ ngOnDestroy(): void;
54
+ protected constrainPosition: (userPointerPosition: Point) => {
55
+ x: number;
56
+ y: number;
57
+ };
58
+ protected onDragStarted(): void;
59
+ protected onDragEnded(): void;
60
+ protected onDragMoved(): void;
61
+ protected onSplitterMouseDown(): void;
62
+ protected onSplitterMouseUp(): void;
63
+ protected setDragPosition(position: number): void;
64
+ protected storeFirstPanelWidth(): void;
65
+ private setFirstPanelWidth;
66
+ private clampPanelWidth;
67
+ static ɵfac: i0.ɵɵFactoryDeclaration<SplitterComponent, never>;
68
+ static ɵcmp: i0.ɵɵComponentDeclaration<SplitterComponent, "ndw-splitter", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "initialPanelWidth": { "alias": "initialPanelWidth"; "required": false; "isSignal": true; }; "minimumPanelWidth": { "alias": "minimumPanelWidth"; "required": false; "isSignal": true; }; }, {}, never, ["[first-panel]", "[second-panel]"], true, never>;
69
+ }
@@ -2,7 +2,6 @@ export * from './summary-card.model';
2
2
  export * from './summary-card.component';
3
3
  export * from './summary-card-actions/summary-card-actions.component';
4
4
  export * from './summary-card-action/summary-card-action.component';
5
- export * from './summary-card-avatar/summary-card-avatar.component';
6
5
  export * from './summary-card-content/summary-card-content.component';
7
6
  export * from './summary-card-header/summary-card-header.component';
8
7
  export * from './summary-card-tags/summary-card-tags.component';
@@ -1,5 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
2
  export declare class SummaryCardComponent {
3
3
  static ɵfac: i0.ɵɵFactoryDeclaration<SummaryCardComponent, never>;
4
- static ɵcmp: i0.ɵɵComponentDeclaration<SummaryCardComponent, "ndw-summary-card", never, {}, {}, never, ["ndw-summary-card-avatar", "ndw-summary-card-header", "ndw-summary-card-content", "ndw-summary-card-tags"], true, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<SummaryCardComponent, "ndw-summary-card", never, {}, {}, never, ["ndw-avatar", "ndw-summary-card-header", "ndw-summary-card-content", "ndw-summary-card-tags"], true, never>;
5
5
  }
@@ -1,2 +1 @@
1
- export type SummaryVariant = 'default' | 'orange' | 'blue' | 'green' | 'yellow' | 'red' | 'purple';
2
1
  export type SummaryActionsView = 'visible' | 'popover' | 'auto';
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@ndwnu/design-system",
3
- "version": "7.1.0",
3
+ "version": "8.0.1",
4
4
  "peerDependencies": {
5
- "@angular/animations": "~19.0.0",
6
- "@angular/cdk": "~19.0.0",
5
+ "@angular/animations": "^19.0.0",
6
+ "@angular/cdk": "^19.0.0",
7
7
  "@angular/common": "^19.0.0",
8
8
  "@angular/core": "^19.0.0",
9
- "@angular/forms": "~19.0.0",
10
- "@angular/router": "~19.0.0",
9
+ "@angular/forms": "^19.0.0",
10
+ "@angular/router": "^19.0.0",
11
11
  "@ndwnu/core": "0.0.1-beta.1",
12
12
  "@storybook/addon-actions": "8.5.0",
13
13
  "@storybook/angular": "8.5.0",
14
- "rxjs": "~7.8.0"
14
+ "rxjs": "^7.8.0"
15
15
  },
16
16
  "sideEffects": false,
17
17
  "module": "fesm2022/ndwnu-design-system.mjs",
@@ -98,7 +98,7 @@ const meta: Meta<StoryArgs> = {
98
98
  <span>150%</span>
99
99
  <span>.${typography.class}</span>
100
100
  </div>
101
- `
101
+ `,
102
102
  )
103
103
  .join('')}
104
104
  </section>
@@ -1,12 +1,10 @@
1
- hr {
2
- &[ndwDivider] {
3
- background-color: var(--ndw-color-grey-300);
4
- border: none;
5
- height: var(--ndw-border-size-sm);
6
- margin: var(--ndw-spacing-xs) 0;
7
- }
1
+ hr[ndwDivider] {
2
+ background-color: var(--ndw-color-grey-300);
3
+ border: none;
4
+ height: var(--ndw-border-size-sm);
5
+ margin: var(--ndw-spacing-xs) 0;
8
6
 
9
- &[noMargin] {
7
+ & [noMargin] {
10
8
  margin-block: 0;
11
9
  }
12
10
  }
@@ -47,6 +47,10 @@
47
47
  background-color: var(--ndw-color-critical-100);
48
48
  border-color: var(--ndw-color-critical-500);
49
49
 
50
+ [ndwInput] {
51
+ background-color: var(--ndw-color-critical-100);
52
+ }
53
+
50
54
  &:hover {
51
55
  border-color: var(--ndw-color-grey-300);
52
56
  }
@@ -69,17 +73,37 @@
69
73
  color: var(--ndw-color-grey-500);
70
74
  pointer-events: none;
71
75
 
76
+ [ndwInput] {
77
+ background-color: var(--ndw-color-grey-100);
78
+ }
79
+
72
80
  ndw-icon {
73
- color: var(--ndw-color-grey-300);
81
+ color: var(--ndw-color-grey-500);
74
82
  }
75
83
  }
76
84
  }
77
85
 
86
+ .input-container:has(> [ndwInput][error]) {
87
+ background-color: var(--ndw-color-critical-100);
88
+ border-color: var(--ndw-color-critical-500);
89
+ }
90
+
78
91
  // Add input container right padding when select element is used
79
92
  .input-container:has(> select[ndwInput]) {
80
93
  padding-inline-end: var(--ndw-spacing-xs);
81
94
  }
82
95
 
96
+ .input-container[error]:has(> [ndwInput]:is(:active, :focus, :focus-visible)) {
97
+ background-color: var(--ndw-color-white);
98
+ }
99
+
100
+ .input-container[error]:has(> [ndwInput]:is(:active, :focus, :focus-visible)) {
101
+ background-color: var(--ndw-color-white);
102
+ select[ndwInput] {
103
+ background-color: var(--ndw-color-white);
104
+ }
105
+ }
106
+
83
107
  // When an ndwInput is contained in an input-container hide the
84
108
  // ndwInput borders and instead put the borders on the container.
85
109
  .input-container:has(> [ndwInput]) {
@@ -6,6 +6,7 @@
6
6
  border: 0;
7
7
 
8
8
  font-size: inherit;
9
+ font-family: var(--ndw-font-family-body);
9
10
  text-decoration: underline var(--ndw-border-size-sm) transparent;
10
11
  text-underline-offset: var(--ndw-border-size-md);
11
12
 
@@ -18,15 +18,13 @@
18
18
  }
19
19
 
20
20
  &__wrapper {
21
- overflow: hidden;
22
-
23
21
  display: grid;
24
22
  gap: var(--ndw-spacing-md);
25
23
  height: 100%;
26
24
  align-items: start;
27
25
  box-sizing: border-box;
28
26
 
29
- &:has(ndw-summary-card-avatar) {
27
+ &:has(ndw-avatar) {
30
28
  grid-template-columns: max-content 1fr;
31
29
  }
32
30
 
@@ -140,63 +138,6 @@
140
138
  color: var(--ndw-color-grey-500);
141
139
  }
142
140
 
143
- .ndw-summary-card-avatar {
144
- display: grid;
145
- place-content: center;
146
- position: relative;
147
- width: 30px;
148
- aspect-ratio: 1 / 1;
149
- border-radius: 50%;
150
- font-size: var(--ndw-font-size-sm);
151
-
152
- &.ndw-summary-card-avatar--default {
153
- color: var(--ndw-color-grey-700);
154
- background-color: var(--ndw-color-grey-300);
155
- }
156
-
157
- &.ndw-summary-card-avatar--orange {
158
- color: var(--ndw-color-primary-700);
159
- background-color: var(--ndw-color-primary-050);
160
- }
161
-
162
- &.ndw-summary-card-avatar--blue {
163
- color: var(--ndw-color-info-500);
164
- background-color: var(--ndw-color-info-100);
165
- }
166
-
167
- &.ndw-summary-card-avatar--green {
168
- color: var(--ndw-color-positive-500);
169
- background-color: var(--ndw-color-positive-100);
170
- }
171
-
172
- &.ndw-summary-card-avatar--red {
173
- color: var(--ndw-color-critical-500);
174
- background-color: var(--ndw-color-critical-100);
175
- }
176
-
177
- &.ndw-summary-card-avatar--yellow {
178
- color: var(--ndw-color-warning-500);
179
- background-color: var(--ndw-color-warning-100);
180
- }
181
-
182
- &.ndw-summary-card-avatar--purple {
183
- color: var(--ndw-color-alternative-500);
184
- background-color: var(--ndw-color-alternative-100);
185
- }
186
-
187
- > img {
188
- display: block;
189
- width: 100%;
190
- height: 100%;
191
- object-fit: cover;
192
- border-radius: 50%;
193
- }
194
-
195
- ndw-icon {
196
- font-size: var(--ndw-font-size-lg);
197
- }
198
- }
199
-
200
141
  .ndw-summary-card-actions {
201
142
  flex: 1;
202
143
  display: flex;
@@ -50,7 +50,7 @@ const meta: Meta<StoryArgs> = {
50
50
  title: 'Components/Link',
51
51
  decorators: [
52
52
  componentWrapperDecorator(
53
- (story) => `<div style="font-size: var(--ndw-font-size-sm);">${story}</div>`
53
+ (story) => `<div style="font-size: var(--ndw-font-size-sm);">${story}</div>`,
54
54
  ),
55
55
  moduleMetadata({
56
56
  imports: [IconComponent],
@@ -59,7 +59,7 @@ const meta: Meta<StoryArgs> = {
59
59
  (classes, index) =>
60
60
  `<div class="${classes.join(' ')}">
61
61
  ${index + 1}
62
- </div>`
62
+ </div>`,
63
63
  )
64
64
  .join('')}
65
65
  </div>
@@ -8,6 +8,7 @@
8
8
 
9
9
  body {
10
10
  font-family: var(--ndw-font-family-body);
11
+ font-size: var(--ndw-base-font-size);
11
12
  }
12
13
 
13
14
  h1,
@@ -1,8 +0,0 @@
1
- import { SummaryVariant } from '../summary-card.model';
2
- import * as i0 from "@angular/core";
3
- export declare class SummaryCardAvatarComponent {
4
- readonly variant: import("@angular/core").InputSignal<SummaryVariant>;
5
- protected readonly variantClass: import("@angular/core").Signal<string>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<SummaryCardAvatarComponent, never>;
7
- static ɵcmp: i0.ɵɵComponentDeclaration<SummaryCardAvatarComponent, "ndw-summary-card-avatar", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
8
- }