@ndwnu/design-system 11.1.1 → 12.1.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 (206) hide show
  1. package/assets/images/logos/ndw-logo-short.svg +3 -3
  2. package/assets/images/logos/ndw-logo.svg +3 -3
  3. package/assets/images/logos/nwb-logo-short.svg +10 -10
  4. package/assets/images/logos/nwb-logo.svg +4 -4
  5. package/assets/images/map-button-icons.svg +91 -87
  6. package/fesm2022/ndwnu-design-system.mjs +1381 -1032
  7. package/fesm2022/ndwnu-design-system.mjs.map +1 -1
  8. package/index.d.ts +1335 -2
  9. package/package.json +9 -11
  10. package/styles/base/_material.scss +17 -0
  11. package/styles/base/index.scss +1 -0
  12. package/styles/components/_datepicker.scss +68 -21
  13. package/styles/components/_divider.scss +1 -1
  14. package/styles/components/_input.scss +2 -1
  15. package/styles/components/divider.stories.ts +1 -1
  16. package/styles/layout/_grid.scss +64 -0
  17. package/styles/layout/grid.stories.ts +69 -40
  18. package/lib/components/accordion/accordion.component.d.ts +0 -12
  19. package/lib/components/accordion/accordion.service.d.ts +0 -8
  20. package/lib/components/accordion/index.d.ts +0 -2
  21. package/lib/components/alert/alert.component.d.ts +0 -26
  22. package/lib/components/alert/alert.model.d.ts +0 -1
  23. package/lib/components/alert/index.d.ts +0 -2
  24. package/lib/components/avatar/avatar.component.d.ts +0 -9
  25. package/lib/components/avatar/avatar.model.d.ts +0 -2
  26. package/lib/components/avatar/index.d.ts +0 -2
  27. package/lib/components/badge/badge.component.d.ts +0 -18
  28. package/lib/components/badge/index.d.ts +0 -1
  29. package/lib/components/banner/banner.component.d.ts +0 -38
  30. package/lib/components/banner/banner.model.d.ts +0 -1
  31. package/lib/components/banner/index.d.ts +0 -2
  32. package/lib/components/breadcrumb/breadcrumb.component.d.ts +0 -6
  33. package/lib/components/breadcrumb/index.d.ts +0 -1
  34. package/lib/components/breadcrumb-group/breadcrumb-group.component.d.ts +0 -8
  35. package/lib/components/breadcrumb-group/index.d.ts +0 -1
  36. package/lib/components/button/button.directive.d.ts +0 -9
  37. package/lib/components/button/index.d.ts +0 -1
  38. package/lib/components/card/card-content/card-content.component.d.ts +0 -5
  39. package/lib/components/card/card-content/index.d.ts +0 -1
  40. package/lib/components/card/card-footer/card-footer.component.d.ts +0 -5
  41. package/lib/components/card/card-footer/index.d.ts +0 -1
  42. package/lib/components/card/card-header/card-header.component.d.ts +0 -11
  43. package/lib/components/card/card-header/index.d.ts +0 -1
  44. package/lib/components/card/card.animation.d.ts +0 -1
  45. package/lib/components/card/card.component.d.ts +0 -19
  46. package/lib/components/card/index.d.ts +0 -6
  47. package/lib/components/collapsible/collapsible.animation.d.ts +0 -1
  48. package/lib/components/collapsible/collapsible.component.d.ts +0 -17
  49. package/lib/components/collapsible/index.d.ts +0 -1
  50. package/lib/components/dashboard-card/dashboard-card.component.d.ts +0 -22
  51. package/lib/components/dashboard-card/index.d.ts +0 -1
  52. package/lib/components/dropdown/dropdown.component.d.ts +0 -22
  53. package/lib/components/dropdown/index.d.ts +0 -1
  54. package/lib/components/edit-bar/edit-bar-actions/edit-bar-actions.component.d.ts +0 -5
  55. package/lib/components/edit-bar/edit-bar-message/edit-bar-message.component.d.ts +0 -5
  56. package/lib/components/edit-bar/edit-bar.component.d.ts +0 -15
  57. package/lib/components/edit-bar/edit-bar.model.d.ts +0 -2
  58. package/lib/components/edit-bar/index.d.ts +0 -4
  59. package/lib/components/favorite/favorite.component.d.ts +0 -7
  60. package/lib/components/favorite/index.d.ts +0 -1
  61. package/lib/components/form-field/autosuggest/autosuggest-add-option/autosuggest-add-option.component.d.ts +0 -6
  62. package/lib/components/form-field/autosuggest/autosuggest-add-option/index.d.ts +0 -1
  63. package/lib/components/form-field/autosuggest/autosuggest-option/autosuggest-option.component.d.ts +0 -8
  64. package/lib/components/form-field/autosuggest/autosuggest-option/index.d.ts +0 -1
  65. package/lib/components/form-field/autosuggest/autosuggest-panel/autosuggest-panel.component.d.ts +0 -6
  66. package/lib/components/form-field/autosuggest/autosuggest-panel/index.d.ts +0 -1
  67. package/lib/components/form-field/autosuggest/autosuggest.directive.d.ts +0 -9
  68. package/lib/components/form-field/autosuggest/index.d.ts +0 -5
  69. package/lib/components/form-field/checkbox/checkbox.component.d.ts +0 -21
  70. package/lib/components/form-field/checkbox/index.d.ts +0 -1
  71. package/lib/components/form-field/checkbox-group/checkbox-group.component.d.ts +0 -7
  72. package/lib/components/form-field/checkbox-group/index.d.ts +0 -1
  73. package/lib/components/form-field/clear-search-button/clear-search-button.component.d.ts +0 -16
  74. package/lib/components/form-field/clear-search-button/index.d.ts +0 -1
  75. package/lib/components/form-field/datepicker/datepicker.component.d.ts +0 -7
  76. package/lib/components/form-field/datepicker/index.d.ts +0 -1
  77. package/lib/components/form-field/error/error.component.d.ts +0 -5
  78. package/lib/components/form-field/error/index.d.ts +0 -1
  79. package/lib/components/form-field/file-upload/file-upload-text.interface.d.ts +0 -4
  80. package/lib/components/form-field/file-upload/file-upload.component.d.ts +0 -47
  81. package/lib/components/form-field/file-upload/index.d.ts +0 -2
  82. package/lib/components/form-field/form-field.component.d.ts +0 -32
  83. package/lib/components/form-field/form-field.constant.d.ts +0 -1
  84. package/lib/components/form-field/form-field.model.d.ts +0 -7
  85. package/lib/components/form-field/index.d.ts +0 -17
  86. package/lib/components/form-field/info/index.d.ts +0 -1
  87. package/lib/components/form-field/info/info.component.d.ts +0 -5
  88. package/lib/components/form-field/input/index.d.ts +0 -1
  89. package/lib/components/form-field/input/input.directive.d.ts +0 -22
  90. package/lib/components/form-field/input-button/index.d.ts +0 -1
  91. package/lib/components/form-field/input-button/input-button.component.d.ts +0 -12
  92. package/lib/components/form-field/input-icon/index.d.ts +0 -1
  93. package/lib/components/form-field/input-icon/input-icon.component.d.ts +0 -5
  94. package/lib/components/form-field/month-input/date-validators.d.ts +0 -3
  95. package/lib/components/form-field/month-input/index.d.ts +0 -1
  96. package/lib/components/form-field/month-input/month-input-utils.d.ts +0 -6
  97. package/lib/components/form-field/month-input/month-input.component.d.ts +0 -47
  98. package/lib/components/form-field/option-group/index.d.ts +0 -3
  99. package/lib/components/form-field/option-group/option-group.component.d.ts +0 -29
  100. package/lib/components/form-field/option-group/option-group.model.d.ts +0 -1
  101. package/lib/components/form-field/option-group/option.component.d.ts +0 -10
  102. package/lib/components/form-field/picker-button/index.d.ts +0 -1
  103. package/lib/components/form-field/picker-button/picker-button.component.d.ts +0 -15
  104. package/lib/components/form-field/radio-button/index.d.ts +0 -1
  105. package/lib/components/form-field/radio-button/radio-button.component.d.ts +0 -20
  106. package/lib/components/form-field/radio-group/index.d.ts +0 -1
  107. package/lib/components/form-field/radio-group/radio-group.component.d.ts +0 -16
  108. package/lib/components/form-field/success/index.d.ts +0 -1
  109. package/lib/components/form-field/success/success.component.d.ts +0 -5
  110. package/lib/components/form-field/textarea/auto-grow.directive.d.ts +0 -22
  111. package/lib/components/form-field/textarea/index.d.ts +0 -2
  112. package/lib/components/form-field/textarea/max-char.directive.d.ts +0 -27
  113. package/lib/components/hoverable-list-item/hoverable-list-item.component.d.ts +0 -18
  114. package/lib/components/hoverable-list-item/hoverable-list-item.model.d.ts +0 -9
  115. package/lib/components/hoverable-list-item/index.d.ts +0 -2
  116. package/lib/components/icon/action-icon/action-icon.component.d.ts +0 -33
  117. package/lib/components/icon/action-icon/index.d.ts +0 -1
  118. package/lib/components/icon/icon.component.d.ts +0 -6
  119. package/lib/components/icon/index.d.ts +0 -2
  120. package/lib/components/index.d.ts +0 -42
  121. package/lib/components/key-value-list/index.d.ts +0 -1
  122. package/lib/components/key-value-list/key-value-list.component.d.ts +0 -6
  123. package/lib/components/layout/index.d.ts +0 -1
  124. package/lib/components/layout/layout.component.d.ts +0 -14
  125. package/lib/components/layout-banners/index.d.ts +0 -1
  126. package/lib/components/layout-banners/layout-banners.component.d.ts +0 -5
  127. package/lib/components/list/index.d.ts +0 -1
  128. package/lib/components/list/list.component.d.ts +0 -11
  129. package/lib/components/list-item/index.d.ts +0 -1
  130. package/lib/components/list-item/list-item.component.d.ts +0 -33
  131. package/lib/components/loader/index.d.ts +0 -1
  132. package/lib/components/loader/loader.component.d.ts +0 -5
  133. package/lib/components/main-navigation/index.d.ts +0 -2
  134. package/lib/components/main-navigation/main-navigation-header/index.d.ts +0 -1
  135. package/lib/components/main-navigation/main-navigation-header/main-navigation-header.component.d.ts +0 -15
  136. package/lib/components/main-navigation/main-navigation-menu/index.d.ts +0 -1
  137. package/lib/components/main-navigation/main-navigation-menu/main-navigation-menu.component.d.ts +0 -16
  138. package/lib/components/main-navigation/main-navigation.component.d.ts +0 -25
  139. package/lib/components/main-navigation/main-navigation.model.d.ts +0 -15
  140. package/lib/components/map-button/index.d.ts +0 -2
  141. package/lib/components/map-button/map-button.component.d.ts +0 -14
  142. package/lib/components/map-button/map-button.model.d.ts +0 -4
  143. package/lib/components/map-display/backgrounds.d.ts +0 -21
  144. package/lib/components/map-display/index.d.ts +0 -3
  145. package/lib/components/map-display/layers.d.ts +0 -10
  146. package/lib/components/map-display/map-display-option/index.d.ts +0 -2
  147. package/lib/components/map-display/map-display-option/map-display-option.component.d.ts +0 -11
  148. package/lib/components/map-display/map-display-option/map-display-option.model.d.ts +0 -14
  149. package/lib/components/map-display/map-display.component.d.ts +0 -30
  150. package/lib/components/map-legend/index.d.ts +0 -2
  151. package/lib/components/map-legend/map-legend-group/map-legend-group.component.d.ts +0 -9
  152. package/lib/components/map-legend/map-legend-option/map-legend-option.component.d.ts +0 -7
  153. package/lib/components/map-legend/map-legend.component.d.ts +0 -17
  154. package/lib/components/map-legend/map-legend.model.d.ts +0 -33
  155. package/lib/components/modal/index.d.ts +0 -7
  156. package/lib/components/modal/modal-content/index.d.ts +0 -1
  157. package/lib/components/modal/modal-content/modal-content.component.d.ts +0 -5
  158. package/lib/components/modal/modal-footer/index.d.ts +0 -1
  159. package/lib/components/modal/modal-footer/modal-footer.component.d.ts +0 -5
  160. package/lib/components/modal/modal-header/index.d.ts +0 -1
  161. package/lib/components/modal/modal-header/modal-header.component.d.ts +0 -7
  162. package/lib/components/modal/modal-ref.d.ts +0 -3
  163. package/lib/components/modal/modal.component.d.ts +0 -7
  164. package/lib/components/modal/modal.service.d.ts +0 -17
  165. package/lib/components/multi-select/checkbox-data.interface.d.ts +0 -8
  166. package/lib/components/multi-select/index.d.ts +0 -3
  167. package/lib/components/multi-select/multi-select.component.d.ts +0 -29
  168. package/lib/components/multi-select/select-all-text.interface.d.ts +0 -4
  169. package/lib/components/pill/index.d.ts +0 -1
  170. package/lib/components/pill/pill.component.d.ts +0 -6
  171. package/lib/components/popover/index.d.ts +0 -1
  172. package/lib/components/popover/popover-trigger.directive.d.ts +0 -29
  173. package/lib/components/router-breadcrumbs/index.d.ts +0 -1
  174. package/lib/components/router-breadcrumbs/router-breadcrumbs.component.d.ts +0 -6
  175. package/lib/components/splitter/index.d.ts +0 -1
  176. package/lib/components/splitter/splitter.component.d.ts +0 -69
  177. package/lib/components/summary-card/index.d.ts +0 -9
  178. package/lib/components/summary-card/summary-card-action/summary-card-action.component.d.ts +0 -11
  179. package/lib/components/summary-card/summary-card-actions/summary-card-actions.component.d.ts +0 -9
  180. package/lib/components/summary-card/summary-card-content/summary-card-content.component.d.ts +0 -5
  181. package/lib/components/summary-card/summary-card-header/summary-card-header.component.d.ts +0 -5
  182. package/lib/components/summary-card/summary-card-subtitle/summary-card-subtitle.component.d.ts +0 -5
  183. package/lib/components/summary-card/summary-card-tag/summary-card-tag.component.d.ts +0 -5
  184. package/lib/components/summary-card/summary-card-tags/summary-card-tags.component.d.ts +0 -5
  185. package/lib/components/summary-card/summary-card.component.d.ts +0 -5
  186. package/lib/components/summary-card/summary-card.model.d.ts +0 -1
  187. package/lib/components/switcher/index.d.ts +0 -2
  188. package/lib/components/switcher/model.d.ts +0 -6
  189. package/lib/components/switcher/switcher.component.d.ts +0 -26
  190. package/lib/components/tab/index.d.ts +0 -1
  191. package/lib/components/tab/tab.component.d.ts +0 -18
  192. package/lib/components/tab-group/index.d.ts +0 -1
  193. package/lib/components/tab-group/tab-group.component.d.ts +0 -16
  194. package/lib/components/table/ag-grid-theme.d.ts +0 -2
  195. package/lib/components/table/index.d.ts +0 -1
  196. package/lib/components/tag/index.d.ts +0 -1
  197. package/lib/components/tag/tag.component.d.ts +0 -18
  198. package/lib/components/toast/index.d.ts +0 -2
  199. package/lib/components/toast/toast-list/toast-list.component.d.ts +0 -17
  200. package/lib/components/toast/toast.component.d.ts +0 -20
  201. package/lib/components/toast/toast.service.d.ts +0 -32
  202. package/lib/components/tooltip/index.d.ts +0 -2
  203. package/lib/components/tooltip/tooltip.component.d.ts +0 -6
  204. package/lib/components/tooltip/tooltip.directive.d.ts +0 -19
  205. package/lib/models/aria.model.d.ts +0 -1
  206. package/lib/models/index.d.ts +0 -2
package/package.json CHANGED
@@ -1,17 +1,15 @@
1
1
  {
2
2
  "name": "@ndwnu/design-system",
3
- "version": "11.1.1",
3
+ "version": "12.1.0",
4
4
  "peerDependencies": {
5
- "@angular/animations": "^19.0.0",
6
- "@angular/cdk": "^19.0.0",
7
- "@angular/common": "^19.0.0",
8
- "@angular/core": "^19.0.0",
9
- "@angular/forms": "^19.0.0",
10
- "@angular/material": "^19.0.0",
11
- "@angular/router": "^19.0.0",
12
- "@ndwnu/core": "1.1.5",
13
- "@storybook/addon-actions": "8.6.12",
14
- "@storybook/angular": "8.6.12",
5
+ "@angular/animations": "^20.0.0",
6
+ "@angular/cdk": "^20.0.0",
7
+ "@angular/common": "^20.0.0",
8
+ "@angular/core": "^20.0.0",
9
+ "@angular/forms": "^20.0.0",
10
+ "@angular/material": "^20.0.0",
11
+ "@angular/router": "^20.0.0",
12
+ "@ndwnu/core": "2.1.0",
15
13
  "ag-grid-angular": "^34.0.2",
16
14
  "ag-grid-community": "^34.0.2",
17
15
  "rxjs": "^7.8.0"
@@ -0,0 +1,17 @@
1
+ @use '@angular/material' as mat;
2
+
3
+ html {
4
+ @include mat.theme(
5
+ (
6
+ color: mat.$orange-palette,
7
+ typography: (
8
+ plain-family: var(--ndw-font-family-body),
9
+ brand-family: var(--ndw-font-family-heading),
10
+ bold-weight: var(--ndw-font-weight-bold),
11
+ medium-weight: var(--ndw-font-weight-bold),
12
+ regular-weight: var(--ndw-font-weight-regular),
13
+ ),
14
+ density: 0,
15
+ )
16
+ );
17
+ }
@@ -1,3 +1,4 @@
1
1
  @forward 'colors';
2
+ @forward 'material';
2
3
  @forward 'typography';
3
4
  @forward 'variables';
@@ -3,41 +3,88 @@
3
3
  :root {
4
4
  @include mat.datepicker-overrides(
5
5
  (
6
- calendar-body-label-text-color: var(--ndw-color-primary),
7
- calendar-date-text-color: var(--ndw-color-black),
6
+ toggle-icon-color: var(--ndw-color-primary),
7
+ calendar-container-background-color: var(--ndw-color-grey-100),
8
+ calendar-container-elevation-shadow: var(--ndw-elevation-content),
9
+ calendar-container-shape: var(--ndw-border-radius-md),
8
10
  calendar-text-font: var(--ndw-font-family-body),
9
11
  calendar-text-size: var(--ndw-font-size-sm),
10
- toggle-icon-color: var(--ndw-color-primary),
12
+ calendar-header-text-size: var(--ndw-font-size-sm),
13
+ calendar-body-label-text-size: var(--ndw-font-size-sm),
14
+ calendar-period-button-text-size: var(--ndw-font-size-sm),
15
+ calendar-date-text-color: var(--ndw-color-text),
16
+ calendar-date-today-outline-color: var(--ndw-color-secondary-200),
17
+ calendar-date-selected-state-background-color: var(--ndw-color-secondary-400),
18
+ calendar-date-today-selected-state-outline-color: var(--ndw-color-secondary-400),
19
+ calendar-date-preview-state-outline-color: var(--ndw-color-secondary-300),
20
+ calendar-date-hover-state-background-color: var(--ndw-color-secondary-300),
21
+ calendar-date-focus-state-background-color: var(--ndw-color-secondary-300),
11
22
  )
12
23
  );
13
24
 
14
- mat-calendar.ndw-calendar {
15
- background-color: var(--ndw-color-white);
16
- border-radius: var(--ndw-border-radius-sm);
17
- }
25
+ mat-calendar {
26
+ --range-preview-border: var(--ndw-border-size-sm) dashed var(--ndw-color-secondary-300);
27
+
28
+ .ndw-date-selected > :first-child {
29
+ background-color: var(--ndw-color-secondary-400) !important;
30
+ color: var(--ndw-color-white) !important;
31
+ }
32
+
33
+ .ndw-date-range-start {
34
+ background-color: var(--ndw-color-secondary-200);
35
+ border-top-left-radius: 50%;
36
+ border-bottom-left-radius: 50%;
37
+ }
18
38
 
19
- button.ndw-date {
20
- border-radius: 50%;
39
+ .ndw-date-range-end {
40
+ background-color: var(--ndw-color-secondary-200);
41
+ border-top-right-radius: 50%;
42
+ border-bottom-right-radius: 50%;
43
+ }
44
+
45
+ .ndw-date-in-range {
46
+ background-color: var(--ndw-color-secondary-200);
47
+ }
21
48
 
22
- &:hover {
23
- background: var(--ndw-color-primary-100);
49
+ .ndw-date-range-start-preview {
50
+ background-color: var(--ndw-color-secondary-100);
51
+ border-top-left-radius: 50%;
52
+ border-bottom-left-radius: 50%;
24
53
  }
25
54
 
26
- &:active {
27
- background: var(--ndw-color-primary-200);
55
+ .ndw-date-range-end-preview {
56
+ background-color: var(--ndw-color-secondary-100);
57
+ border-top-right-radius: 50%;
58
+ border-bottom-right-radius: 50%;
28
59
  }
29
60
 
30
- &.highlighted {
31
- background: var(--ndw-color-secondary-400);
32
- border-radius: 50%;
33
- color: var(--ndw-color-white);
61
+ .ndw-date-in-range-preview {
62
+ background-color: var(--ndw-color-secondary-100);
63
+ }
64
+
65
+ // Add a dot below dates with the ndw-date-indicator class
66
+ .ndw-date-indicator > :first-child {
67
+ &::after {
68
+ content: '';
69
+ background: var(--ndw-color-primary);
70
+ position: absolute;
71
+ bottom: 2px;
72
+ left: calc(50% - 4px);
73
+ width: 8px;
74
+ height: 8px;
75
+ box-sizing: border-box;
76
+ border-radius: 4px;
77
+ }
78
+ }
34
79
 
35
- &:hover {
36
- background: var(--ndw-color-secondary-500);
80
+ // Disable the month view when in 'month' mode
81
+ &.month-picker {
82
+ .mat-calendar-period-button {
83
+ pointer-events: none;
37
84
  }
38
85
 
39
- &:active {
40
- background: var(--ndw-color-secondary-600);
86
+ .mat-calendar-arrow {
87
+ display: none;
41
88
  }
42
89
  }
43
90
  }
@@ -4,7 +4,7 @@ hr[ndwDivider] {
4
4
  height: var(--ndw-border-size-sm);
5
5
  margin: var(--ndw-spacing-xs) 0;
6
6
 
7
- & [noMargin] {
7
+ &[noMargin] {
8
8
  margin-block: 0;
9
9
  }
10
10
  }
@@ -109,7 +109,8 @@
109
109
 
110
110
  // When an ndwInput is contained in an input-container hide the
111
111
  // ndwInput borders and instead put the borders on the container.
112
- .input-container:has(> [ndwInput]) {
112
+ .input-container:has(> [ndwInput]),
113
+ .input-container:has(> ndw-datepicker > [ndwInput]) {
113
114
  @include shared-style();
114
115
 
115
116
  // When input has a ndw-input-icon enable the inline padding
@@ -40,7 +40,7 @@ const meta: Meta<StoryArgs> = {
40
40
  styles: [
41
41
  `
42
42
  .content {
43
- background-color: var(--ndw-color-grey-200);
43
+ background-color: var(--ndw-color-grey-100);
44
44
  padding: var(--ndw-spacing-xs);
45
45
  }
46
46
  `,
@@ -1,5 +1,12 @@
1
1
  @use '../base/variables' as *;
2
2
 
3
+ $breakpoints: (
4
+ 2xs: $ndw-screen-2xs,
5
+ xs: $ndw-screen-xs,
6
+ sm: $ndw-screen-sm,
7
+ md: $ndw-screen-md,
8
+ );
9
+
3
10
  @mixin column($span) {
4
11
  grid-column: span $span;
5
12
  }
@@ -99,3 +106,60 @@
99
106
  }
100
107
  }
101
108
  }
109
+
110
+ .ndw-c-grid {
111
+ display: flex;
112
+ flex-wrap: wrap;
113
+ container-type: inline-size;
114
+ container-name: ndw-c-grid;
115
+
116
+ @mixin ndw-c-col-span($size, $important: false) {
117
+ $flag: if($important, '!important', '');
118
+ flex: 0 0 calc((100% / 12) * #{$size}) #{$flag};
119
+ max-width: calc((100% / 12) * #{$size}) #{$flag};
120
+ }
121
+
122
+ @mixin ndw-c-breakpoint($name, $min-width) {
123
+ @container ndw-c-grid (min-width: #{$min-width}) {
124
+ @content;
125
+ }
126
+ }
127
+
128
+ @for $i from 1 through 12 {
129
+ .ndw-c-col-#{$i} {
130
+ @include ndw-c-col-span($i, false);
131
+ }
132
+ }
133
+
134
+ @each $name, $width in $breakpoints {
135
+ @include ndw-c-breakpoint($name, $width) {
136
+ @for $i from 1 through 12 {
137
+ .ndw-c-col-#{$name}-#{$i} {
138
+ @include ndw-c-col-span($i, true);
139
+ }
140
+ }
141
+ }
142
+ }
143
+
144
+ $order-range: 0 1 2 3 4 5;
145
+
146
+ @each $i in $order-range {
147
+ .ndw-c-order-#{$i} {
148
+ order: $i !important;
149
+ }
150
+ }
151
+
152
+ @each $name, $width in $breakpoints {
153
+ @container ndw-c-grid (min-width: #{$width}) {
154
+ @each $i in $order-range {
155
+ .ndw-c-order-#{$name}-#{$i} {
156
+ order: $i !important;
157
+ }
158
+ }
159
+ }
160
+ }
161
+ }
162
+
163
+ .ndw-c-col {
164
+ flex: 1 1 100%;
165
+ }
@@ -3,17 +3,19 @@ import { type Meta, type StoryObj } from '@storybook/angular';
3
3
  interface StoryArgs {
4
4
  columnClasses: string[][];
5
5
  disablePadding?: boolean;
6
+ useContainerQueries?: boolean;
6
7
  }
7
8
 
8
9
  /**
9
- * Create a responsive grid layout with columns. There are multiple breakpoints:
10
+ * Create a responsive grid layout with columns. There are multiple breakpoints based
11
+ * on the viewport size. Each breakpoint has a specific number of columns:
10
12
  * - Above 1024px (sm): 12 columns
11
13
  * - 768px-1024px (xs): 6 columns
12
14
  * - 480px-768px (2xs): 4 columns
13
15
  * - Below 480px: 2 columns
14
16
  * - Maximum width: 1440px
15
17
  *
16
- * The grid needs a container element with the class `grid`. Column elements
18
+ * The grid needs a container element with the class `ndw-grid`. Column elements
17
19
  * should have classes like:
18
20
  * - `column-{span}`: all screen sizes
19
21
  * - `column-2xs-{span}`: below 480px
@@ -26,8 +28,22 @@ interface StoryArgs {
26
28
  * Use the viewport tool to see responsive behavior.
27
29
  *
28
30
  * ## Disable padding
31
+ *
29
32
  * Sometimes you may want to disable padding on the columns, for example when using a card component.
30
33
  * To do this, add the class `ndw-grid--no-padding` to the `.ndw-grid` element.
34
+ *
35
+ * ## Container grid
36
+ *
37
+ * It is also possible to use a container grid which uses breakpoints
38
+ * based on it's container instead of the viewport.
39
+ *
40
+ * There are a few notable differences when using a container grid:
41
+ * - Container queries are used instead of media queries.
42
+ * - The container element must have the `ndw-c-grid` class instead of `ndw-grid`.
43
+ * - The column classes are prefixed with `ndw-c-col-` instead of `column-`
44
+ * - The container grid always has 12 columns, regardless of the container size.
45
+ * - The container grid does not have padding on the outside of between columns.
46
+ * - The container grid uses flex layout instead of CSS grid.
31
47
  */
32
48
 
33
49
  const meta: Meta<StoryArgs> = {
@@ -42,22 +58,26 @@ const meta: Meta<StoryArgs> = {
42
58
  props,
43
59
  styles: [
44
60
  `
45
- .ndw-grid > div {
61
+ .ndw-grid > div,
62
+ .ndw-c-grid > div {
63
+ text-align: center;
46
64
  background-color: var(--ndw-color-grey-300);
65
+ border: 1px solid var(--ndw-color-grey-400);
47
66
  padding: var(--ndw-spacing-xs);
48
67
  }
49
- .ndw-grid {
68
+ .ndw-grid,
69
+ .ndw-c-grid {
50
70
  background-color: var(--ndw-color-grey-100);
51
71
  margin-bottom: var(--ndw-spacing-xl);
52
72
  }
53
73
  `,
54
74
  ],
55
75
  template: `
56
- <div class="ndw-grid ${props.disablePadding ? 'ndw-grid--no-padding' : ''}">
76
+ <div class="${props.useContainerQueries ? 'ndw-c-grid' : 'ndw-grid'} ${props.disablePadding ? 'ndw-grid--no-padding' : ''}">
57
77
  ${props.columnClasses
58
78
  .map(
59
79
  (classes, index) =>
60
- `<div class="${classes.join(' ')}">
80
+ `<div class="${classes.map((c) => `${props.useContainerQueries ? 'ndw-c-col-' : 'column-'}${c}`).join(' ')}">
61
81
  ${index + 1}
62
82
  </div>`,
63
83
  )
@@ -66,11 +86,23 @@ const meta: Meta<StoryArgs> = {
66
86
  `,
67
87
  }),
68
88
  argTypes: {
89
+ disablePadding: {
90
+ description: 'Disable the inline padding on the grid.',
91
+ control: { type: 'boolean' },
92
+ table: { category: 'Grid configuration' },
93
+ },
69
94
  columnClasses: {
70
95
  description: 'Array of classes to apply to each column.',
96
+ table: {
97
+ category: 'Story inputs',
98
+ },
71
99
  },
72
- disablePadding: {
73
- description: 'Disable the inline padding on the grid.',
100
+ useContainerQueries: {
101
+ description: 'Use container queries instead of media queries for the grid.',
102
+ control: { type: 'boolean' },
103
+ table: {
104
+ category: 'Story inputs',
105
+ },
74
106
  },
75
107
  },
76
108
  };
@@ -80,19 +112,21 @@ type Story = StoryObj<StoryArgs>;
80
112
  export const Default: Story = {
81
113
  args: {
82
114
  columnClasses: [
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'],
87
- ['column-sm-1', 'column-md-1'],
88
- ['column-sm-1', 'column-md-1'],
89
- ['column-md-1'],
90
- ['column-md-1'],
91
- ['column-md-1'],
92
- ['column-md-1'],
93
- ['column-md-1'],
94
- ['column-md-1'],
115
+ ['1', '2xs-4', 'xs-2', 'sm-1'],
116
+ ['1', '2xs-4', 'xs-2', 'sm-1'],
117
+ ['1', 'xs-2', 'sm-1'],
118
+ ['1', 'xs-2', 'sm-1'],
119
+ ['1', 'sm-1'],
120
+ ['1', 'sm-1'],
121
+ ['1'],
122
+ ['1'],
123
+ ['1'],
124
+ ['1'],
125
+ ['1'],
126
+ ['1'],
95
127
  ],
128
+ disablePadding: false,
129
+ useContainerQueries: false,
96
130
  },
97
131
  };
98
132
 
@@ -102,38 +136,33 @@ export const Default: Story = {
102
136
  export const ResponsiveColumns: Story = {
103
137
  args: {
104
138
  columnClasses: [
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'],
139
+ ['12', 'sm-3', 'md-4'],
140
+ ['12', 'sm-3', 'md-4'],
141
+ ['12', 'sm-6', 'md-4'],
108
142
  ],
109
143
  },
110
144
  };
111
145
 
112
146
  export const MixedColumnWidth: Story = {
113
147
  args: {
114
- columnClasses: [
115
- ['column-6'],
116
- ['column-2'],
117
- ['column-4'],
118
- ['column-2'],
119
- ['column-2'],
120
- ['column-2'],
121
- ['column-6'],
122
- ['column-12'],
123
- ],
148
+ columnClasses: [['6'], ['2'], ['4'], ['2'], ['2'], ['2'], ['6'], ['12']],
124
149
  },
125
150
  };
126
151
 
127
152
  export const NoPadding: Story = {
128
153
  args: {
154
+ columnClasses: [['6'], ['6'], ['2'], ['2'], ['2'], ['6']],
155
+ disablePadding: true,
156
+ },
157
+ };
158
+
159
+ export const ContainerQueryGrid: Story = {
160
+ args: {
161
+ useContainerQueries: true,
129
162
  columnClasses: [
130
- ['column-6'],
131
- ['column-6'],
132
- ['column-2'],
133
- ['column-2'],
134
- ['column-2'],
135
- ['column-6'],
163
+ ['12', 'sm-6', 'md-4'],
164
+ ['12', 'sm-6', 'md-4'],
165
+ ['12', 'sm-12', 'md-4'],
136
166
  ],
137
- disablePadding: true,
138
167
  },
139
168
  };
@@ -1,12 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { CollapsibleComponent } from '../collapsible';
3
- import { ListComponent } from '../list';
4
- import * as i0 from "@angular/core";
5
- export declare class AccordionComponent extends ListComponent implements OnInit {
6
- #private;
7
- collapseOthers: import("@angular/core").InputSignal<boolean>;
8
- collapsibles: import("@angular/core").Signal<readonly CollapsibleComponent[]>;
9
- ngOnInit(): void;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<AccordionComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<AccordionComponent, "ndw-accordion", never, { "collapseOthers": { "alias": "collapseOthers"; "required": false; "isSignal": true; }; }, {}, ["collapsibles"], ["*"], true, never>;
12
- }
@@ -1,8 +0,0 @@
1
- import { Subject } from 'rxjs';
2
- import * as i0 from "@angular/core";
3
- export declare class AccordionService {
4
- expanded$: Subject<number>;
5
- setExpandedCollapsible(index: number): void;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<AccordionService, never>;
7
- static ɵprov: i0.ɵɵInjectableDeclaration<AccordionService>;
8
- }
@@ -1,2 +0,0 @@
1
- export * from './accordion.component';
2
- export * from './accordion.service';
@@ -1,26 +0,0 @@
1
- import { AriaLive } from '../../models';
2
- import { AlertType } from './alert.model';
3
- import * as i0 from "@angular/core";
4
- export declare class AlertComponent {
5
- /**
6
- * Whether the alert is actionable, shows a close icon and a title.
7
- */
8
- actionable: import("@angular/core").InputSignal<boolean>;
9
- /**
10
- * The title of the alert. Only used when actionable is true.
11
- */
12
- title: import("@angular/core").InputSignal<string | undefined>;
13
- /**
14
- * Use info, info-grey, warning or critical to indicate the type of alert.
15
- */
16
- type: import("@angular/core").InputSignal<AlertType>;
17
- /**
18
- * Use polite, assertive or off to indicate whether the alert is
19
- * announced automatically by the screen reader.
20
- */
21
- ariaLive: import("@angular/core").InputSignal<AriaLive>;
22
- close: import("@angular/core").OutputEmitterRef<void>;
23
- onClose(): void;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<AlertComponent, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<AlertComponent, "ndw-alert", never, { "actionable": { "alias": "actionable"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "ariaLive": { "alias": "ariaLive"; "required": false; "isSignal": true; }; }, { "close": "close"; }, never, ["*"], true, never>;
26
- }
@@ -1 +0,0 @@
1
- export type AlertType = 'critical' | 'info' | 'info-grey' | 'warning';
@@ -1,2 +0,0 @@
1
- export * from './alert.component';
2
- export * from './alert.model';
@@ -1,9 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- export type AvatarStatus = 'approved' | 'open' | 'none';
2
- export type AvatarColor = 'default' | 'blue' | 'purple' | 'red' | 'green' | 'yellow' | 'orange';
@@ -1,2 +0,0 @@
1
- export * from './avatar.component';
2
- export * from './avatar.model';
@@ -1,18 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class BadgeComponent {
3
- /**
4
- * The value of the badge
5
- */
6
- value: import("@angular/core").InputSignal<number | undefined>;
7
- /**
8
- * The aria label, used by screen readers to give context.
9
- */
10
- ariaLabel: import("@angular/core").InputSignal<string | undefined>;
11
- /**
12
- * When true, the badge will display values above 99.
13
- * When false (default), the badge will display values above 99 as a dot
14
- */
15
- displayLargeNumbers: import("@angular/core").InputSignal<boolean>;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<BadgeComponent, never>;
17
- static ɵcmp: i0.ɵɵComponentDeclaration<BadgeComponent, "ndw-badge", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "displayLargeNumbers": { "alias": "displayLargeNumbers"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
18
- }
@@ -1 +0,0 @@
1
- export * from './badge.component';
@@ -1,38 +0,0 @@
1
- import { AfterViewInit, ElementRef } from '@angular/core';
2
- import { AriaLive } from '../../models';
3
- import { BannerType } from './banner.model';
4
- import * as i0 from "@angular/core";
5
- export declare class BannerComponent implements AfterViewInit {
6
- /**
7
- * The title of the banner.
8
- */
9
- title: import("@angular/core").InputSignal<string>;
10
- /**
11
- * The message of the banner.
12
- */
13
- message: import("@angular/core").InputSignal<string>;
14
- /**
15
- * The read more label if the message is truncated.
16
- */
17
- readMoreLabel: import("@angular/core").InputSignal<string>;
18
- /**
19
- * Use info, info-grey, warning, positive or critical to indicate the type of banner.
20
- */
21
- type: import("@angular/core").InputSignal<BannerType>;
22
- /**
23
- * Use polite, assertive or off to indicate whether the alert is
24
- * announced automatically by the screen reader.
25
- */
26
- ariaLive: import("@angular/core").InputSignal<AriaLive>;
27
- /**
28
- * Emits when the banner close button is clicked.
29
- */
30
- close: import("@angular/core").OutputEmitterRef<void>;
31
- textContent: import("@angular/core").Signal<ElementRef<any> | undefined>;
32
- showReadMore: boolean;
33
- ngAfterViewInit(): void;
34
- onClose(event: MouseEvent): void;
35
- private setReadMore;
36
- static ɵfac: i0.ɵɵFactoryDeclaration<BannerComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<BannerComponent, "ndw-banner", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "message": { "alias": "message"; "required": true; "isSignal": true; }; "readMoreLabel": { "alias": "readMoreLabel"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "ariaLive": { "alias": "ariaLive"; "required": false; "isSignal": true; }; }, { "close": "close"; }, never, never, true, never>;
38
- }
@@ -1 +0,0 @@
1
- export type BannerType = 'critical' | 'info' | 'info-grey' | 'warning' | 'positive';
@@ -1,2 +0,0 @@
1
- export * from './banner.component';
2
- export * from './banner.model';
@@ -1,6 +0,0 @@
1
- import { CoreBreadcrumbComponent } from '@ndwnu/core';
2
- import * as i0 from "@angular/core";
3
- export declare class BreadcrumbComponent extends CoreBreadcrumbComponent {
4
- static ɵfac: i0.ɵɵFactoryDeclaration<BreadcrumbComponent, never>;
5
- static ɵcmp: i0.ɵɵComponentDeclaration<BreadcrumbComponent, "ndw-breadcrumb", never, {}, {}, never, ["*"], true, never>;
6
- }
@@ -1 +0,0 @@
1
- export * from './breadcrumb.component';
@@ -1,8 +0,0 @@
1
- import { CoreBreadcrumbGroupComponent } from '@ndwnu/core';
2
- import { BreadcrumbComponent } from '../breadcrumb';
3
- import * as i0 from "@angular/core";
4
- export declare class BreadcrumbGroupComponent extends CoreBreadcrumbGroupComponent<BreadcrumbComponent> {
5
- protected breadcrumbs: import("@angular/core").Signal<readonly BreadcrumbComponent[]>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<BreadcrumbGroupComponent, never>;
7
- static ɵcmp: i0.ɵɵComponentDeclaration<BreadcrumbGroupComponent, "ndw-breadcrumb-group", never, {}, {}, ["breadcrumbs"], never, true, never>;
8
- }
@@ -1 +0,0 @@
1
- export * from './breadcrumb-group.component';
@@ -1,9 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class ButtonDirective implements OnInit {
4
- private readonly elementRef;
5
- get element(): HTMLButtonElement;
6
- ngOnInit(): void;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<ButtonDirective, never>;
8
- static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonDirective, "[ndwButton]", never, {}, {}, never, never, true, never>;
9
- }
@@ -1 +0,0 @@
1
- export * from './button.directive';
@@ -1,5 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class CardContentComponent {
3
- static ɵfac: i0.ɵɵFactoryDeclaration<CardContentComponent, never>;
4
- static ɵcmp: i0.ɵɵComponentDeclaration<CardContentComponent, "ndw-card-content", never, {}, {}, never, ["*"], true, never>;
5
- }