@ndwnu/design-system 7.0.1 → 8.0.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 (37) hide show
  1. package/fesm2022/ndwnu-design-system.mjs +508 -222
  2. package/fesm2022/ndwnu-design-system.mjs.map +1 -1
  3. package/lib/components/avatar/avatar.component.d.ts +9 -0
  4. package/lib/components/avatar/avatar.model.d.ts +2 -0
  5. package/lib/components/avatar/index.d.ts +2 -0
  6. package/lib/components/edit-bar/edit-bar-actions/edit-bar-actions.component.d.ts +5 -0
  7. package/lib/components/edit-bar/edit-bar-message/edit-bar-message.component.d.ts +5 -0
  8. package/lib/components/edit-bar/edit-bar.component.d.ts +15 -0
  9. package/lib/components/edit-bar/edit-bar.model.d.ts +2 -0
  10. package/lib/components/edit-bar/index.d.ts +4 -0
  11. package/lib/components/form-field/file-upload/file-upload.component.d.ts +7 -0
  12. package/lib/components/form-field/input/input.directive.d.ts +2 -0
  13. package/lib/components/form-field/month-input/month-input.component.d.ts +1 -0
  14. package/lib/components/index.d.ts +4 -1
  15. package/lib/components/layout/layout.component.d.ts +2 -1
  16. package/lib/components/main-navigation/main-navigation.component.d.ts +4 -2
  17. package/lib/components/main-navigation/main-navigation.imports.d.ts +2 -1
  18. package/lib/components/main-navigation/main-navigation.model.d.ts +1 -0
  19. package/lib/components/splitter/index.d.ts +1 -0
  20. package/lib/components/splitter/splitter.component.d.ts +69 -0
  21. package/lib/components/summary-card/index.d.ts +0 -1
  22. package/lib/components/summary-card/summary-card.component.d.ts +1 -1
  23. package/lib/components/summary-card/summary-card.model.d.ts +0 -1
  24. package/package.json +1 -1
  25. package/styles/base/_variables.scss +7 -0
  26. package/styles/base/typography.stories.ts +1 -1
  27. package/styles/components/_divider.scss +6 -8
  28. package/styles/components/_edit-bar.scss +97 -0
  29. package/styles/components/_input.scss +25 -1
  30. package/styles/components/_link.scss +1 -0
  31. package/styles/components/_summary-card.scss +18 -66
  32. package/styles/components/index.scss +1 -0
  33. package/styles/components/link.stories.ts +1 -1
  34. package/styles/layout/_grid.scss +45 -1
  35. package/styles/layout/grid.stories.ts +50 -28
  36. package/styles/storybook/_reset.scss +1 -0
  37. package/lib/components/summary-card/summary-card-avatar/summary-card-avatar.component.d.ts +0 -8
@@ -5,6 +5,8 @@
5
5
  }
6
6
 
7
7
  .grid {
8
+ $grid-columns-2xs: 2;
9
+ $grid-columns-xs: 4;
8
10
  $grid-columns-sm: 6;
9
11
  $grid-columns-md: 12;
10
12
 
@@ -18,13 +20,55 @@
18
20
  min-width: min-content;
19
21
  max-width: $ndw-screen-md;
20
22
 
23
+ &--no-padding {
24
+ padding: 0;
25
+ }
26
+
21
27
  @for $i from 1 through $grid-columns-md {
22
28
  .column-#{$i} {
23
- // Use min to make sure we don't span more columns than available
24
29
  @include column(min($i, var(--grid-columns)));
25
30
  }
26
31
  }
27
32
 
33
+ @media screen and (max-width: $ndw-screen-2xs) {
34
+ --grid-columns: #{$grid-columns-2xs};
35
+ --grid-spacing: var(--ndw-spacing-sm);
36
+
37
+ @for $i from 1 through $grid-columns-md {
38
+ .column-xs-#{$i},
39
+ .column-sm-#{$i},
40
+ .column-md-#{$i} {
41
+ display: none;
42
+ }
43
+ }
44
+
45
+ @for $i from 1 through $grid-columns-2xs {
46
+ .column-2xs-#{$i} {
47
+ @include column($i);
48
+ display: initial;
49
+ }
50
+ }
51
+ }
52
+
53
+ @media screen and (max-width: $ndw-screen-xs) {
54
+ --grid-columns: #{$grid-columns-xs};
55
+ --grid-spacing: var(--ndw-spacing-sm);
56
+
57
+ @for $i from 1 through $grid-columns-md {
58
+ .column-sm-#{$i},
59
+ .column-md-#{$i} {
60
+ display: none;
61
+ }
62
+ }
63
+
64
+ @for $i from 1 through $grid-columns-xs {
65
+ .column-xs-#{$i} {
66
+ @include column($i);
67
+ display: initial;
68
+ }
69
+ }
70
+ }
71
+
28
72
  @media screen and (max-width: $ndw-screen-sm) {
29
73
  --grid-columns: #{$grid-columns-sm};
30
74
  --grid-spacing: var(--ndw-spacing-md);
@@ -2,29 +2,34 @@ import { type Meta, type StoryObj } from '@storybook/angular';
2
2
 
3
3
  interface StoryArgs {
4
4
  columnClasses: string[][];
5
+ disablePadding?: boolean;
5
6
  }
6
7
 
7
8
  /**
8
- * Create a grid layout with columns. There is one responsive breakpoint at 1024px
9
- * screen width;
10
- * - Above 1024px, the grid has 12 columns.
11
- * - Below 1024px, the grid has 6 columns.
12
- * - The grid has a maximum width of 1440px.
9
+ * Create a responsive grid layout with columns. There are multiple breakpoints:
10
+ * - Above 1024px (sm): 12 columns
11
+ * - 768px-1024px (xs): 6 columns
12
+ * - 480px-768px (2xs): 4 columns
13
+ * - Below 480px: 2 columns
14
+ * - Maximum width: 1440px
13
15
  *
14
- * The grid needs a container element with the class `grid` and each column element
15
- * should have a `column-{span}`, `column-sm-{span}` or `column-md-{span}`
16
- * class where `{span}` is the number of grid columns the element should span.
16
+ * The grid needs a container element with the class `grid`. Column elements
17
+ * should have classes like:
18
+ * - `column-{span}`: all screen sizes
19
+ * - `column-2xs-{span}`: below 480px
20
+ * - `column-xs-{span}`: 480px-768px
21
+ * - `column-sm-{span}`: 768px-1024px
22
+ * - `column-md-{span}`: above 1024px
17
23
  *
18
- * `column-{span}` classes set the column width for all screen sizes. Different column
19
- * widths can be set for different screen sizes using `column-sm-{span}` and
20
- * `column-md-{span}` classes. Columns with only a `column-md-{span}` class will
21
- * only be visible on screen widths above 1024px.
24
+ * Where `{span}` is the number of columns to span.
22
25
  *
23
- * When viewing a specific story, use the viewport tool to see how the grid layout
24
- * responds to different screen sizes.
26
+ * Use the viewport tool to see responsive behavior.
25
27
  *
26
- * The colors of the background and grid columns are for illustrative purposes.
28
+ * ## Disable padding
29
+ * Sometimes you may want to disable padding on the columns, for example when using a card component.
30
+ * To do this, add the class `grid--no-padding` to the `.grid` element.
27
31
  */
32
+
28
33
  const meta: Meta<StoryArgs> = {
29
34
  tags: ['autodocs', 'ndw', 'ntm', 'nwb'],
30
35
  title: 'Core/Grid',
@@ -48,13 +53,13 @@ const meta: Meta<StoryArgs> = {
48
53
  `,
49
54
  ],
50
55
  template: `
51
- <div class="grid">
56
+ <div class="grid ${props.disablePadding ? 'grid--no-padding' : ''}">
52
57
  ${props.columnClasses
53
58
  .map(
54
59
  (classes, index) =>
55
60
  `<div class="${classes.join(' ')}">
56
61
  ${index + 1}
57
- </div>`
62
+ </div>`,
58
63
  )
59
64
  .join('')}
60
65
  </div>
@@ -64,6 +69,9 @@ const meta: Meta<StoryArgs> = {
64
69
  columnClasses: {
65
70
  description: 'Array of classes to apply to each column.',
66
71
  },
72
+ disablePadding: {
73
+ description: 'Disable the inline padding on the grid.',
74
+ },
67
75
  },
68
76
  };
69
77
  export default meta;
@@ -72,10 +80,10 @@ type Story = StoryObj<StoryArgs>;
72
80
  export const Default: Story = {
73
81
  args: {
74
82
  columnClasses: [
75
- ['column-sm-1', 'column-md-1'],
76
- ['column-sm-1', 'column-md-1'],
77
- ['column-sm-1', 'column-md-1'],
78
- ['column-sm-1', 'column-md-1'],
83
+ ['column-2xs-1', 'column-xs-1', 'column-sm-1', 'column-md-1'],
84
+ ['column-2xs-1', 'column-xs-1', 'column-sm-1', 'column-md-1'],
85
+ ['column-xs-1', 'column-sm-1', 'column-md-1'],
86
+ ['column-xs-1', 'column-sm-1', 'column-md-1'],
79
87
  ['column-sm-1', 'column-md-1'],
80
88
  ['column-sm-1', 'column-md-1'],
81
89
  ['column-md-1'],
@@ -91,12 +99,12 @@ export const Default: Story = {
91
99
  /**
92
100
  * Use the viewport button to see different column sizes for different screen sizes.
93
101
  */
94
- export const ChangeOnMobile: Story = {
102
+ export const ResponsiveColumns: Story = {
95
103
  args: {
96
104
  columnClasses: [
97
- ['column-md-4', 'column-sm-3'],
98
- ['column-md-4', 'column-sm-3'],
99
- ['column-md-4', 'column-sm-6'],
105
+ ['column-12', 'column-md-4', 'column-sm-3'],
106
+ ['column-12', 'column-md-4', 'column-sm-3'],
107
+ ['column-12', 'column-md-4', 'column-sm-6'],
100
108
  ],
101
109
  },
102
110
  };
@@ -104,14 +112,28 @@ export const ChangeOnMobile: Story = {
104
112
  export const MixedColumnWidth: Story = {
105
113
  args: {
106
114
  columnClasses: [
107
- ['column-3'],
108
- ['column-3'],
115
+ ['column-6'],
116
+ ['column-2'],
109
117
  ['column-4'],
110
118
  ['column-2'],
111
119
  ['column-2'],
112
- ['column-4'],
120
+ ['column-2'],
113
121
  ['column-6'],
114
122
  ['column-12'],
115
123
  ],
116
124
  },
117
125
  };
126
+
127
+ export const NoPadding: Story = {
128
+ args: {
129
+ columnClasses: [
130
+ ['column-6'],
131
+ ['column-6'],
132
+ ['column-2'],
133
+ ['column-2'],
134
+ ['column-2'],
135
+ ['column-6'],
136
+ ],
137
+ disablePadding: true,
138
+ },
139
+ };
@@ -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
- }