@nldd/design-system 0.8.96 → 0.8.97

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 (177) hide show
  1. package/README.md +14 -10
  2. package/custom-elements.json +494 -92
  3. package/dist/components/components.js +609 -177
  4. package/dist/components/content/icon/icon-aliases.js +1 -1
  5. package/dist/components/content/icon/icon-aliases.js.map +1 -1
  6. package/dist/components/content/icon/icon-gallery-status.d.ts.map +1 -1
  7. package/dist/components/content/icon/icon-gallery-status.js +15 -4
  8. package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
  9. package/dist/components/content/icon/icon-registry.js +12 -12
  10. package/dist/components/content/icon/icon-registry.js.map +1 -1
  11. package/dist/components/content/image/image.d.ts +19 -3
  12. package/dist/components/content/image/image.d.ts.map +1 -1
  13. package/dist/components/content/image/image.js +25 -4
  14. package/dist/components/content/image/image.js.map +1 -1
  15. package/dist/components/content/image/image.styles.d.ts.map +1 -1
  16. package/dist/components/content/image/image.styles.js +36 -0
  17. package/dist/components/content/image/image.styles.js.map +1 -1
  18. package/dist/components/content/image/image.template.d.ts.map +1 -1
  19. package/dist/components/content/image/image.template.js +13 -1
  20. package/dist/components/content/image/image.template.js.map +1 -1
  21. package/dist/components/content/rich-text/rich-text.d.ts +25 -12
  22. package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
  23. package/dist/components/content/rich-text/rich-text.js +25 -12
  24. package/dist/components/content/rich-text/rich-text.js.map +1 -1
  25. package/dist/components/{icon-DQHT2C7z.js → icon-D_ZGezHx.js} +13 -13
  26. package/dist/components/{icon-button-mevRsl4C.js → icon-button-NN0SrgS3.js} +1 -1
  27. package/dist/components/index.d.ts +1 -1
  28. package/dist/components/index.d.ts.map +1 -1
  29. package/dist/components/index.js +1 -1
  30. package/dist/components/index.js.map +1 -1
  31. package/dist/components/layout/box/box.d.ts +1 -1
  32. package/dist/components/layout/box/box.js +1 -1
  33. package/dist/components/layout/container/container.d.ts.map +1 -1
  34. package/dist/components/layout/container/container.js +2 -1
  35. package/dist/components/layout/container/container.js.map +1 -1
  36. package/dist/components/layout/page/page.d.ts +9 -3
  37. package/dist/components/layout/page/page.d.ts.map +1 -1
  38. package/dist/components/layout/page/page.js +36 -13
  39. package/dist/components/layout/page/page.js.map +1 -1
  40. package/dist/components/layout/page/page.styles.js +1 -1
  41. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +2 -0
  42. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
  43. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +3 -1
  44. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
  45. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.d.ts.map +1 -1
  46. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js +5 -0
  47. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js.map +1 -1
  48. package/dist/components/layout/page-sections/hero/hero.d.ts +57 -11
  49. package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
  50. package/dist/components/layout/page-sections/hero/hero.js +158 -15
  51. package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
  52. package/dist/components/layout/page-sections/hero/hero.styles.d.ts.map +1 -1
  53. package/dist/components/layout/page-sections/hero/hero.styles.js +95 -41
  54. package/dist/components/layout/page-sections/hero/hero.styles.js.map +1 -1
  55. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +4 -0
  56. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
  57. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js +8 -1
  58. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js.map +1 -1
  59. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.d.ts.map +1 -1
  60. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js +13 -0
  61. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js.map +1 -1
  62. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +4 -0
  63. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
  64. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +8 -1
  65. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js.map +1 -1
  66. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.d.ts.map +1 -1
  67. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js +17 -0
  68. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js.map +1 -1
  69. package/dist/components/layout/page-sections/page-section-controls.d.ts +11 -1
  70. package/dist/components/layout/page-sections/page-section-controls.d.ts.map +1 -1
  71. package/dist/components/layout/page-sections/page-section-controls.js +11 -2
  72. package/dist/components/layout/page-sections/page-section-controls.js.map +1 -1
  73. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +5 -1
  74. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
  75. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +6 -2
  76. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
  77. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -1
  78. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +11 -10
  79. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -1
  80. package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +2 -0
  81. package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
  82. package/dist/components/layout/page-sections/simple-section/simple-section.js +3 -2
  83. package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
  84. package/dist/components/layout/page-sections/simple-section/simple-section.styles.js +2 -2
  85. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +4 -0
  86. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
  87. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +8 -1
  88. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
  89. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.d.ts.map +1 -1
  90. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js +17 -0
  91. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js.map +1 -1
  92. package/dist/components/layout/sheet/sheet.js +1 -1
  93. package/dist/components/layout/sheet/sheet.js.map +1 -1
  94. package/dist/components/layout/{app-view/app-view.d.ts → shell/shell.d.ts} +11 -11
  95. package/dist/components/layout/shell/shell.d.ts.map +1 -0
  96. package/dist/components/layout/{app-view/app-view.js → shell/shell.js} +24 -24
  97. package/dist/components/layout/shell/shell.js.map +1 -0
  98. package/dist/components/layout/shell/shell.styles.d.ts +2 -0
  99. package/dist/components/layout/shell/shell.styles.d.ts.map +1 -0
  100. package/dist/components/layout/{app-view/app-view.styles.js → shell/shell.styles.js} +8 -8
  101. package/dist/components/layout/shell/shell.styles.js.map +1 -0
  102. package/dist/components/layout/shell/shell.template.d.ts +4 -0
  103. package/dist/components/layout/shell/shell.template.d.ts.map +1 -0
  104. package/dist/components/layout/shell/shell.template.js +9 -0
  105. package/dist/components/layout/shell/shell.template.js.map +1 -0
  106. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +1 -1
  107. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
  108. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +1 -1
  109. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +1 -1
  110. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +1 -1
  111. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +1 -1
  112. package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.d.ts.map +1 -1
  113. package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +2 -0
  114. package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js.map +1 -1
  115. package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.d.ts.map +1 -1
  116. package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +2 -0
  117. package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js.map +1 -1
  118. package/dist/components/lists-and-tables/list-item/list-item.d.ts +15 -5
  119. package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
  120. package/dist/components/lists-and-tables/list-item/list-item.js +20 -7
  121. package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
  122. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +4 -1
  123. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
  124. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +8 -2
  125. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
  126. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
  127. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
  128. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +1 -1
  129. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
  130. package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +5 -0
  131. package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
  132. package/dist/components/navigation/menu-bar-item/menu-bar-item.js +13 -1
  133. package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
  134. package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.d.ts.map +1 -1
  135. package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js +12 -2
  136. package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js.map +1 -1
  137. package/dist/components/navigation/menu-bar-item/menu-bar-item.template.d.ts.map +1 -1
  138. package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js +11 -10
  139. package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js.map +1 -1
  140. package/dist/components/navigation/top-title-bar/top-title-bar.js +1 -1
  141. package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
  142. package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +10 -0
  143. package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
  144. package/dist/components/status-and-feedback/status-bar/status-bar.js +21 -0
  145. package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
  146. package/dist/css/document-reset.css +3 -3
  147. package/dist/css/rich-text.css +36 -90
  148. package/dist/nldd.min.js +506 -349
  149. package/dist/types/vue.d.ts +67 -24
  150. package/dist/utilities/page-section-mixin.d.ts +5 -0
  151. package/dist/utilities/page-section-mixin.d.ts.map +1 -1
  152. package/dist/utilities/page-section-mixin.js +10 -1
  153. package/dist/utilities/page-section-mixin.js.map +1 -1
  154. package/dist/utilities/scroll-mode-controller.d.ts +29 -13
  155. package/dist/utilities/scroll-mode-controller.d.ts.map +1 -1
  156. package/dist/utilities/scroll-mode-controller.js +48 -13
  157. package/dist/utilities/scroll-mode-controller.js.map +1 -1
  158. package/package.json +4 -4
  159. package/dist/components/layout/app-view/app-view.d.ts.map +0 -1
  160. package/dist/components/layout/app-view/app-view.js.map +0 -1
  161. package/dist/components/layout/app-view/app-view.styles.d.ts +0 -2
  162. package/dist/components/layout/app-view/app-view.styles.d.ts.map +0 -1
  163. package/dist/components/layout/app-view/app-view.styles.js.map +0 -1
  164. package/dist/components/layout/app-view/app-view.template.d.ts +0 -4
  165. package/dist/components/layout/app-view/app-view.template.d.ts.map +0 -1
  166. package/dist/components/layout/app-view/app-view.template.js +0 -9
  167. package/dist/components/layout/app-view/app-view.template.js.map +0 -1
  168. package/dist/components/palettes.html +0 -245
  169. package/dist/components/sample-images/butterfly-1200.jpg +0 -0
  170. package/dist/components/sample-images/butterfly-1600.jpg +0 -0
  171. package/dist/components/sample-images/butterfly-480.jpg +0 -0
  172. package/dist/components/sample-images/butterfly-960.jpg +0 -0
  173. package/dist/palettes.html +0 -245
  174. package/dist/sample-images/butterfly-1200.jpg +0 -0
  175. package/dist/sample-images/butterfly-1600.jpg +0 -0
  176. package/dist/sample-images/butterfly-480.jpg +0 -0
  177. package/dist/sample-images/butterfly-960.jpg +0 -0
@@ -7,15 +7,40 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  /**
8
8
  * Nederlandse Digitale Dienst Hero Component (Lit + TypeScript)
9
9
  *
10
- * A page header with a media area and a text panel (the main) that can stand in
11
- * six positions. Every area is rectangular.
10
+ * The section that says what a page is for: it names the main goal of what
11
+ * you can find there, draws the eye and is the visual welcome. It has a media
12
+ * area and a text panel (the main) that can stand in eight positions. Every
13
+ * area is rectangular. Use it on pages where a visitor first has to know where
14
+ * they are, such as a home or a topic page; where the title already does
15
+ * that, a section with a title is enough.
12
16
  *
13
- * With `main-width="full"` the media area sits as its own strip above or below
14
- * the panel rather than behind it. On mobile the media always stacks above the
15
- * full-width panel. Without media the main fills the whole area; with
17
+ * The image in a hero sets the mood and is never the main content, so the
18
+ * panel always stands on it. Over an image the panel keeps a section gap from
19
+ * its edges, so it reads as a panel on the image rather than a frame cut out of
20
+ * it; with `main-width="full"` it is a strip across the whole image, the same
21
+ * gap from the sides. On mobile the image comes first and the panel below it,
22
+ * indented by the section gap and overlapping the image by 48px. For an
23
+ * image beside text without that relation, use a section with an image beside
24
+ * text instead. Without media the main fills the whole area; with
16
25
  * `main-background="base"` that area gets a border so it stays visible on the
17
26
  * base surface.
18
27
  *
28
+ * The hero is the head of a page and sits right under the top bar, so its top
29
+ * padding is half that of the other page sections: the full distance is meant
30
+ * to separate two sections, and under the top bar it reads as a gap. The
31
+ * bottom keeps the full distance to the section below. Set `padding-top` to
32
+ * place a hero elsewhere.
33
+ *
34
+ * By default the panel falls over the bottom of the image and runs on below it
35
+ * (`layout="overlap"`), so the image keeps its height whatever the content.
36
+ * `layout="contained"` keeps the panel on the image, for a short panel or one
37
+ * that stands at the top or along a side.
38
+ *
39
+ * The height of a hero comes from its image: `media-aspect-ratio`, or a fixed
40
+ * `media-height`. The `height` of the other page sections is not used here: as
41
+ * a minimum height for the whole hero it stretched the panel once that sat
42
+ * below the image. A hero given `height` says so in development.
43
+ *
19
44
  * `main-background` gives the panel a surface color from the filled categories.
20
45
  * Those carry a pure white or black content color along, so components with
21
46
  * `color="inherit"` (title, rich-text) are guaranteed to keep their contrast.
@@ -24,17 +49,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
24
49
  *
25
50
  * @attr {'inherit'|'base'|'tinted'} background - Surface behind the hero (section API)
26
51
  * @attr {string} width - Body max-width; 'full' removes the bound (section API)
27
- * @attr {string} height - Minimum height of the section (section API)
52
+ * @attr {boolean} grow - Takes the height the page has left, so the footer sits at the bottom of a short page. Without it, nldd-page lets its last section grow.
28
53
  * @attr {string} padding-block - Block padding override, also per edge and responsive (section API)
54
+ * @attr {'contained'|'overlap'} layout - How the panel relates to the image (default: 'overlap'). 'contained' keeps it on the image, in any of the eight positions; 'overlap' lets it fall `overlap-size` over the bottom of the image and run on below as far as its content needs, so the image keeps its height whatever the content. In 'overlap' the image has a fixed height (320px on md, 400px on lg) unless `media-height` or `media-aspect-ratio` is set, and only the horizontal side of `main-position` counts. A panel shorter than `overlap-size` ends inside the image and says so in development
29
55
  * @attr {string} main-background - Surface color of the panel: 'base' (the base surface)
30
56
  * or a category color — 'accent' (default) or a Rijkshuisstijl color such as
31
57
  * 'lintblauw'|'donkerblauw'|'oranje'
32
- * @attr {'1/2'|'2/3'|'3/4'|'full'} main-width - Width of the panel (default: '1/2');
33
- * 'full' makes a full top or bottom strip and is ignored with 'left'/'right'
34
- * @attr {'top-left'|'top-right'|'bottom-left'|'bottom-right'|'left'|'right'} main-position -
58
+ * @attr {string} main-width - Width of the panel (default: 'auto'). 'auto' follows the content, between 480px and 640px and never wider than the image allows: a short title gets a narrow panel, a paragraph runs on to a readable line length. 'full' makes a strip across the whole image, at the top or the bottom, and is ignored with 'left'/'right'. Any CSS width (e.g. '560px', '60%') sets it exactly on md and lg, still never wider than the image allows; an invalid value falls back to 'auto'
59
+ * @attr {'top-left'|'top-center'|'top-right'|'bottom-left'|'bottom-center'|'bottom-right'|'left'|'right'} main-position -
35
60
  * Position of the text panel (default: 'bottom-left'); 'left'/'right' span the full height
61
+ * @attr {string} overlap-size - With layout="overlap": how far the panel falls over the bottom of the image, any CSS length (default: 160px). The overlap stays the same whatever the height of the image; a panel shorter than this ends inside the image
36
62
  * @attr {string} media-aspect-ratio - Aspect ratio of the media area (CSS form, '16/9' or '16:9');
37
63
  * default '21/9'. On md/lg it sets the height of the hero, on sm the height of the media area
64
+ * @attr {string} media-height - Fixed height of the media area, any CSS length (e.g. '320px', '40vh'); wins over media-aspect-ratio. An invalid value falls back to the ratio
38
65
  * @attr {string} media-src - Source of the media area (an alternative to the media slot);
39
66
  * ignored as soon as the media slot is filled
40
67
  * @attr {string} media-srcset - Responsive source set for media-src
@@ -52,17 +79,30 @@ import { PageSectionMixin } from '../../../../utilities/page-section-mixin.js';
52
79
  import { reflectNonDefault } from '../../../../utilities/reflect-non-default.js';
53
80
  import { heroStyles } from './hero.styles.js';
54
81
  import { heroTemplate } from './hero.template.js';
82
+ const CSS_WIDE_KEYWORDS = new Set(['inherit', 'initial', 'unset', 'revert', 'revert-layer']);
83
+ /**
84
+ * Whether `property` takes `value` as a value of its own. CSS.supports alone
85
+ * also says yes to the CSS-wide keywords, for any property; written into a
86
+ * custom property those would not fall back to the default but resolve to
87
+ * something else.
88
+ */
89
+ function takesValue(property, value) {
90
+ return !CSS_WIDE_KEYWORDS.has(value.trim().toLowerCase()) && CSS.supports(property, value);
91
+ }
55
92
  let NLDDHero = class NLDDHero extends PageSectionMixin(LitElement) {
56
93
  constructor() {
57
94
  super(...arguments);
58
95
  /** Width mode: 'full' (removes body max-width) or any CSS length. */
59
96
  this.width = '';
97
+ this.layout = 'overlap';
60
98
  this.mainBackground = 'accent';
61
- this.mainWidth = '1/2';
99
+ this.mainWidth = 'auto';
62
100
  this.mainPosition = 'bottom-left';
63
101
  /** Media aspect-ratio in CSS form ('16/9' or '16:9'); default '21/9'. Drives
64
102
  * the hero height on md/lg and the media strip height on sm. */
65
103
  this.mediaAspectRatio = '';
104
+ this.overlapSize = '';
105
+ this.mediaHeight = '';
66
106
  /** Hybrid media source: media-src renders an internal <img>, but a slotted
67
107
  * media element wins (mirrors nldd-image / nldd-identity). srcset/sizes/alt
68
108
  * feed that internal img. */
@@ -71,6 +111,11 @@ let NLDDHero = class NLDDHero extends PageSectionMixin(LitElement) {
71
111
  this.mediaSizes = '';
72
112
  this.mediaAlt = '';
73
113
  this._slotHasMedia = false;
114
+ /** DEV-only latch for the `height` warning. */
115
+ this._warnedHeight = false;
116
+ /** DEV-only: watches an overlap hero for a panel that does not reach below its image. */
117
+ this._overlapObserver = null;
118
+ this._warnedOverlap = false;
74
119
  }
75
120
  /** Media is present when the slot has content or media-src is set. */
76
121
  get _hasMedia() {
@@ -81,25 +126,79 @@ let NLDDHero = class NLDDHero extends PageSectionMixin(LitElement) {
81
126
  // The stylesheet only keys off whether media is present.
82
127
  this.toggleAttribute('data-has-media', this._hasMedia);
83
128
  }
129
+ connectedCallback() {
130
+ super.connectedCallback();
131
+ if (import.meta.env?.DEV && this.hasUpdated)
132
+ this._watchOverlap();
133
+ }
134
+ disconnectedCallback() {
135
+ super.disconnectedCallback();
136
+ this._overlapObserver?.disconnect();
137
+ this._overlapObserver = null;
138
+ // A hero that comes back is watched again, so it may warn again.
139
+ this._warnedOverlap = false;
140
+ }
84
141
  updated(changed) {
85
142
  super.updated(changed);
86
143
  if (changed.has('width')) {
87
144
  // Same contract as the other page sections: the keyword 'full' is
88
145
  // handled by CSS; CSS lengths feed --_hero-max-width inline.
89
146
  const w = this.width;
90
- if (w && w !== 'full' && CSS.supports('max-width', w)) {
147
+ if (w && w !== 'full' && takesValue('max-width', w)) {
91
148
  this.style.setProperty('--_hero-max-width', w);
92
149
  }
93
150
  else {
94
151
  this.style.removeProperty('--_hero-max-width');
95
152
  }
96
153
  }
154
+ if (import.meta.env?.DEV && changed.has('layout'))
155
+ this._watchOverlap();
156
+ if (changed.has('mainWidth')) {
157
+ const width = (this.mainWidth ?? '').trim();
158
+ const length = width !== '' && width !== 'auto' && width !== 'full';
159
+ const valid = length && takesValue('width', width);
160
+ if (valid)
161
+ this.style.setProperty('--_hero-main-width', width);
162
+ else
163
+ this.style.removeProperty('--_hero-main-width');
164
+ this.toggleAttribute('data-main-width-length', valid);
165
+ if (import.meta.env?.DEV && length && !valid) {
166
+ console.warn(`<nldd-hero>: main-width="${width}" is not "auto", "full" or a CSS width, and falls back to "auto", which follows the content between 480px and 640px.`, this);
167
+ }
168
+ }
169
+ if (changed.has('overlapSize')) {
170
+ const size = (this.overlapSize ?? '').trim();
171
+ if (size && takesValue('margin-top', size)) {
172
+ this.style.setProperty('--_hero-overlap-size', size);
173
+ }
174
+ else {
175
+ this.style.removeProperty('--_hero-overlap-size');
176
+ }
177
+ }
178
+ if (changed.has('mediaHeight')) {
179
+ const height = (this.mediaHeight ?? '').trim();
180
+ if (height && takesValue('height', height)) {
181
+ this.style.setProperty('--_hero-media-height', height);
182
+ }
183
+ else {
184
+ this.style.removeProperty('--_hero-media-height');
185
+ }
186
+ }
187
+ if (changed.has('height') && this.height) {
188
+ // The section API turns `height` into the host's min-height; a hero
189
+ // takes its height from its image instead.
190
+ this.style.removeProperty('min-height');
191
+ if (import.meta.env?.DEV && !this._warnedHeight) {
192
+ this._warnedHeight = true;
193
+ console.warn('<nldd-hero>: `height` is not used on a hero, whose height comes from its image. Use `media-height` for a fixed height, or `media-aspect-ratio`.', this);
194
+ }
195
+ }
97
196
  if (changed.has('mediaAspectRatio')) {
98
197
  // Accept '16:9' as well as '16/9' (like nldd-image). Clearing the
99
198
  // attribute makes Lit set the property to null, so guard with ?? '';
100
199
  // the empty value falls back to the stylesheet's --_hero-media-aspect-ratio.
101
200
  const ratio = (this.mediaAspectRatio ?? '').replace(':', '/').trim();
102
- if (ratio && CSS.supports('aspect-ratio', ratio)) {
201
+ if (ratio && takesValue('aspect-ratio', ratio)) {
103
202
  this.style.setProperty('--_hero-media-aspect-ratio', ratio);
104
203
  }
105
204
  else {
@@ -107,6 +206,41 @@ let NLDDHero = class NLDDHero extends PageSectionMixin(LitElement) {
107
206
  }
108
207
  }
109
208
  }
209
+ _watchOverlap() {
210
+ const watch = this.layout !== 'contained' && typeof ResizeObserver !== 'undefined';
211
+ if (!watch) {
212
+ this._overlapObserver?.disconnect();
213
+ this._overlapObserver = null;
214
+ return;
215
+ }
216
+ if (this._overlapObserver)
217
+ return;
218
+ const media = this.shadowRoot?.querySelector('.hero__media');
219
+ const main = this.shadowRoot?.querySelector('.hero__main');
220
+ if (!media || !main)
221
+ return;
222
+ this._overlapObserver = new ResizeObserver(() => this._checkOverlap(media, main));
223
+ this._overlapObserver.observe(media);
224
+ this._overlapObserver.observe(main);
225
+ }
226
+ /**
227
+ * In an overlap hero the panel is meant to run on below the image. When it
228
+ * ends inside it, the content is shorter than `overlap-size`; the consumer
229
+ * decides how far it runs on, so this only says so, in development.
230
+ */
231
+ _checkOverlap(media, main) {
232
+ if (!this._hasMedia || getComputedStyle(media).position === 'static')
233
+ return;
234
+ const falls = main.getBoundingClientRect().bottom <= media.getBoundingClientRect().bottom;
235
+ if (!falls) {
236
+ this._warnedOverlap = false;
237
+ return;
238
+ }
239
+ if (this._warnedOverlap)
240
+ return;
241
+ this._warnedOverlap = true;
242
+ console.warn('<nldd-hero>: With layout="overlap" the panel is shorter than `overlap-size` and ends inside the image. Give it more content or a smaller `overlap-size`, or set layout="contained" to keep the panel on the image.', this);
243
+ }
110
244
  /** @internal Tracks the media slot so the no-media mode can collapse it. */
111
245
  _onMediaSlotChange(e) {
112
246
  const slot = e.target;
@@ -118,20 +252,29 @@ let NLDDHero = class NLDDHero extends PageSectionMixin(LitElement) {
118
252
  };
119
253
  NLDDHero.styles = heroStyles;
120
254
  __decorate([
121
- property({ type: String, reflect: true })
255
+ property({ reflect: true, converter: reflectNonDefault('') })
122
256
  ], NLDDHero.prototype, "width", void 0);
257
+ __decorate([
258
+ property({ reflect: true, converter: reflectNonDefault('overlap') })
259
+ ], NLDDHero.prototype, "layout", void 0);
123
260
  __decorate([
124
261
  property({ reflect: true, attribute: 'main-background', converter: reflectNonDefault('accent') })
125
262
  ], NLDDHero.prototype, "mainBackground", void 0);
126
263
  __decorate([
127
- property({ reflect: true, attribute: 'main-width', converter: reflectNonDefault('1/2') })
264
+ property({ reflect: true, attribute: 'main-width', converter: reflectNonDefault('auto') })
128
265
  ], NLDDHero.prototype, "mainWidth", void 0);
129
266
  __decorate([
130
267
  property({ reflect: true, attribute: 'main-position', converter: reflectNonDefault('bottom-left') })
131
268
  ], NLDDHero.prototype, "mainPosition", void 0);
132
269
  __decorate([
133
- property({ type: String, reflect: true, attribute: 'media-aspect-ratio' })
270
+ property({ reflect: true, attribute: 'media-aspect-ratio', converter: reflectNonDefault('') })
134
271
  ], NLDDHero.prototype, "mediaAspectRatio", void 0);
272
+ __decorate([
273
+ property({ reflect: true, attribute: 'overlap-size', converter: reflectNonDefault('') })
274
+ ], NLDDHero.prototype, "overlapSize", void 0);
275
+ __decorate([
276
+ property({ reflect: true, attribute: 'media-height', converter: reflectNonDefault('') })
277
+ ], NLDDHero.prototype, "mediaHeight", void 0);
135
278
  __decorate([
136
279
  property({ type: String, attribute: 'media-src' })
137
280
  ], NLDDHero.prototype, "mediaSrc", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../../../src/components/layout/page-sections/hero/hero.ts"],"names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xE;AAGlC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,iBAAiB,CAAmB,aAAa,CAAC,EAAE,CAAC;8CACxE;AAK/C;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;kDACjF;AAGtB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;6CAChF;AAGjB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;6CAChF;AAMjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;0CACrC;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;6CACrC;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;4CACrC;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;0CACrC;AAGd;IADC,KAAK,EAAE;+CACc;AA9CV,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAuLpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"hero.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/page-sections/hero/hero.styles.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU,yBAoXtB,CAAC"}
1
+ {"version":3,"file":"hero.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/page-sections/hero/hero.styles.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU,yBA0atB,CAAC"}
@@ -28,10 +28,19 @@ export const heroStyles = css `
28
28
  --_hero-lg-padding-bottom: initial;
29
29
  --_hero-max-width: var(--semantics-page-sections-body-max-width);
30
30
  --_hero-media-aspect-ratio: 21 / 9;
31
- --_hero-main-width: 50%;
31
+ --_hero-media-height: auto;
32
+ --_hero-main-min-width: var(--primitives-area-480);
33
+ --_hero-main-max-width: var(--primitives-area-640);
34
+ --_hero-main-width: auto;
32
35
  --_hero-main-background-color: var(--semantics-categories-accent-reference-background-color);
33
36
  --_hero-main-content-color: var(--semantics-categories-accent-reference-content-color);
34
37
  --_hero-main-padding: var(--primitives-space-16);
38
+ --_hero-main-inset: var(--primitives-space-0);
39
+ --_hero-sm-main-inset: var(--semantics-page-sections-sm-gap);
40
+ --_hero-sm-main-overlap: var(--primitives-space-48);
41
+ --_hero-overlap-size: initial;
42
+ --_hero-default-overlap-size: var(--primitives-space-0);
43
+ --_hero-default-media-height: auto;
35
44
 
36
45
  ${inheritedTextReset}
37
46
  display: flex;
@@ -44,8 +53,8 @@ export const heroStyles = css `
44
53
  display: none;
45
54
  }
46
55
 
47
- :host(:last-child),
48
- :host(.is-last) {
56
+ :host([data-growing]),
57
+ :host([grow]) {
49
58
  flex-grow: 1;
50
59
  }
51
60
 
@@ -53,18 +62,6 @@ export const heroStyles = css `
53
62
  --_hero-max-width: none;
54
63
  }
55
64
 
56
- :host([main-width="2/3"]) {
57
- --_hero-main-width: 66.667%;
58
- }
59
-
60
- :host([main-width="3/4"]) {
61
- --_hero-main-width: 75%;
62
- }
63
-
64
- :host([main-width="full"]) {
65
- --_hero-main-width: 100%;
66
- }
67
-
68
65
  :host([main-background="base"]) {
69
66
  --_hero-main-background-color: var(--semantics-surfaces-base-background-color);
70
67
  --_hero-main-content-color: var(--semantics-content-color);
@@ -177,21 +174,27 @@ export const heroStyles = css `
177
174
 
178
175
  @container (max-width: ${smMax}) {
179
176
  padding-inline: var(--semantics-page-sections-sm-margin-inline);
180
- padding-top: var(--_hero-sm-padding-top, var(--_hero-padding-top, var(--semantics-page-sections-sm-margin-block)));
177
+ padding-top: var(--_hero-sm-padding-top, var(--_hero-padding-top, calc(var(--semantics-page-sections-sm-margin-block) / 2)));
181
178
  padding-bottom: var(--_hero-sm-padding-bottom, var(--_hero-padding-bottom, var(--semantics-page-sections-sm-margin-block)));
182
179
  }
183
180
 
184
181
  @container (min-width: ${mdMin}) and (max-width: ${mdMax}) {
185
182
  --_hero-main-padding: var(--primitives-space-24);
183
+ --_hero-main-inset: var(--semantics-page-sections-md-gap);
184
+ --_hero-default-overlap-size: var(--primitives-area-160);
185
+ --_hero-default-media-height: var(--primitives-area-320);
186
186
  padding-inline: var(--semantics-page-sections-md-margin-inline);
187
- padding-top: var(--_hero-md-padding-top, var(--_hero-padding-top, var(--semantics-page-sections-md-margin-block)));
187
+ padding-top: var(--_hero-md-padding-top, var(--_hero-padding-top, calc(var(--semantics-page-sections-md-margin-block) / 2)));
188
188
  padding-bottom: var(--_hero-md-padding-bottom, var(--_hero-padding-bottom, var(--semantics-page-sections-md-margin-block)));
189
189
  }
190
190
 
191
191
  @container (min-width: ${lgMin}) {
192
192
  --_hero-main-padding: var(--primitives-space-32);
193
+ --_hero-main-inset: var(--semantics-page-sections-lg-gap);
194
+ --_hero-default-overlap-size: var(--primitives-area-160);
195
+ --_hero-default-media-height: var(--primitives-area-400);
193
196
  padding-inline: var(--semantics-page-sections-lg-margin-inline);
194
- padding-top: var(--_hero-lg-padding-top, var(--_hero-padding-top, var(--semantics-page-sections-lg-margin-block)));
197
+ padding-top: var(--_hero-lg-padding-top, var(--_hero-padding-top, calc(var(--semantics-page-sections-lg-margin-block) / 2)));
195
198
  padding-bottom: var(--_hero-lg-padding-bottom, var(--_hero-padding-bottom, var(--semantics-page-sections-lg-margin-block)));
196
199
  }
197
200
  }
@@ -207,13 +210,16 @@ export const heroStyles = css `
207
210
  .hero__body {
208
211
  display: grid;
209
212
  position: relative;
210
- background-color: var(--_hero-main-background-color);
211
213
  width: 100%;
212
214
  max-width: var(--_hero-max-width);
213
215
  flex-grow: 1;
214
216
  grid-template-columns: 100%;
215
217
  }
216
218
 
219
+ :host(:not([data-has-media])) .hero__body {
220
+ background-color: var(--_hero-main-background-color);
221
+ }
222
+
217
223
  /* Without media a base-colored panel would be invisible on the base surface;
218
224
  give it a full border so the rectangle reads. */
219
225
  :host(:not([data-has-media])[main-background="base"]) .hero__body {
@@ -226,9 +232,10 @@ export const heroStyles = css `
226
232
  (instead of aspect-ratio on the body) keeps growth content-driven
227
233
  rather than rigidly tied to the width. align-self: start stops the
228
234
  stretch fit from cancelling the ratio. */
229
- :host([data-has-media]:not([main-width="full"])) .hero__body::before {
235
+ :host([data-has-media]) .hero__body::before {
230
236
  @container (min-width: ${mdMin}) {
231
237
  content: '';
238
+ height: var(--_hero-media-height);
232
239
  aspect-ratio: var(--_hero-media-aspect-ratio);
233
240
  grid-area: 1 / 1;
234
241
  align-self: start;
@@ -262,7 +269,11 @@ export const heroStyles = css `
262
269
  object-fit: cover !important;
263
270
  }
264
271
 
272
+ /* Two heights: the host fills the media area, and the variable makes the
273
+ image inside the host fill the host. Without either one it collapses. */
265
274
  .hero__media ::slotted(nldd-image) {
275
+ --context-image-height: 100%;
276
+
266
277
  display: block !important;
267
278
  width: 100% !important;
268
279
  height: 100% !important;
@@ -291,7 +302,9 @@ export const heroStyles = css `
291
302
  align-self: end;
292
303
  justify-self: start;
293
304
  background-color: var(--_hero-main-background-color);
294
- width: var(--_hero-main-width);
305
+ width: fit-content;
306
+ min-width: min(var(--_hero-main-min-width), 100% - 2 * var(--_hero-main-inset));
307
+ max-width: min(var(--_hero-main-max-width), 100% - 2 * var(--_hero-main-inset));
295
308
  padding: var(--_hero-main-padding);
296
309
  flex-direction: column;
297
310
  color: var(--_hero-main-content-color);
@@ -299,6 +312,26 @@ export const heroStyles = css `
299
312
 
300
313
  :host(:not([data-has-media])) .hero__main {
301
314
  width: 100%;
315
+ min-width: 0;
316
+ max-width: none;
317
+ }
318
+
319
+ :host([data-has-media]) .hero__main {
320
+ margin: var(--_hero-main-inset);
321
+ }
322
+
323
+ :host([data-has-media][data-main-width-length]) .hero__main {
324
+ @container (min-width: ${mdMin}) {
325
+ width: var(--_hero-main-width);
326
+ min-width: 0;
327
+ max-width: calc(100% - 2 * var(--_hero-main-inset));
328
+ }
329
+ }
330
+
331
+ :host([data-has-media][main-width="full"]) .hero__main {
332
+ width: auto;
333
+ max-width: none;
334
+ justify-self: stretch;
302
335
  }
303
336
 
304
337
  :host([main-position="top-left"]) .hero__main {
@@ -314,6 +347,15 @@ export const heroStyles = css `
314
347
  justify-self: end;
315
348
  }
316
349
 
350
+ :host([main-position="bottom-center"]) .hero__main {
351
+ justify-self: center;
352
+ }
353
+
354
+ :host([main-position="top-center"]) .hero__main {
355
+ align-self: start;
356
+ justify-self: center;
357
+ }
358
+
317
359
  :host([main-position="left"]) .hero__main {
318
360
  align-self: stretch;
319
361
  }
@@ -330,32 +372,38 @@ export const heroStyles = css `
330
372
  }
331
373
 
332
374
 
333
- /* # Full-width strip (md+)
334
- With main-width="full" the panel is a full top or bottom strip and the
335
- media stacks on the opposite side instead of sitting behind it. Switch the
336
- body to a column so the two blocks stack: a bottom panel keeps the media on
337
- top, a top panel (column-reverse) drops it below. The media keeps the
338
- overlay's 21/9 strip. Below sm every layout already stacks, so this only
339
- targets md and up. */
375
+ /* # Overlap (md+) — the media keeps a fixed height; the panel sits in the
376
+ row below it, pulled up over it by the overlap size. */
340
377
 
341
378
  @container (min-width: ${mdMin}) {
342
- :host([data-has-media][main-width="full"]) .hero__body {
343
- display: flex;
344
- flex-direction: column;
379
+ :host([data-has-media]:not([layout="contained"])) .hero__body::before {
380
+ content: none;
381
+ }
382
+
383
+ :host([data-has-media]:not([layout="contained"])) .hero__media {
384
+ position: relative;
385
+ width: 100%;
386
+ height: var(--_hero-media-height);
387
+ aspect-ratio: var(--_hero-media-aspect-ratio);
388
+ grid-area: 1 / 1;
389
+ align-self: start;
345
390
  }
346
391
 
347
- :host([data-has-media][main-width="full"]:is([main-position="top-left"], [main-position="top-right"])) .hero__body {
348
- flex-direction: column-reverse;
392
+ :host([data-has-media]:not([layout="contained"]):not([media-height], [media-aspect-ratio])) .hero__media {
393
+ height: var(--_hero-default-media-height);
349
394
  }
350
395
 
351
- :host([data-has-media][main-width="full"]) .hero__media {
352
- position: static;
353
- aspect-ratio: var(--_hero-media-aspect-ratio);
396
+ :host([data-has-media]:not([layout="contained"])) .hero__main {
397
+ margin-top: calc(-1 * var(--_hero-overlap-size, var(--_hero-default-overlap-size)));
398
+ margin-bottom: 0;
399
+ grid-area: 2 / 1;
400
+ align-self: start;
354
401
  }
355
402
  }
356
403
 
357
404
 
358
- /* # Mobile — stack media over a full-width panel. */
405
+ /* # Mobile — the media on top, the panel below it, indented and overlapping
406
+ it a little. */
359
407
 
360
408
  @container (max-width: ${smMax}) {
361
409
  .hero__body {
@@ -363,18 +411,24 @@ export const heroStyles = css `
363
411
  flex-direction: column;
364
412
  }
365
413
 
366
- :host(:is([main-position="top-left"], [main-position="top-right"])) .hero__body {
367
- flex-direction: column-reverse;
368
- }
369
-
370
414
  .hero__media {
371
415
  position: static;
416
+ width: 100%;
417
+ height: var(--_hero-media-height);
372
418
  overflow: hidden;
373
419
  aspect-ratio: var(--_hero-media-aspect-ratio);
374
420
  }
375
421
 
376
422
  .hero__main {
377
423
  width: 100%;
424
+ min-width: 0;
425
+ max-width: none;
426
+ }
427
+
428
+ :host([data-has-media]) .hero__main {
429
+ margin: calc(-1 * var(--_hero-sm-main-overlap)) var(--_hero-sm-main-inset) 0;
430
+ width: auto;
431
+ align-self: stretch;
378
432
  }
379
433
  }
380
434
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"hero.styles.js","sourceRoot":"","sources":["../../../../../src/components/layout/page-sections/hero/hero.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAA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0CAA0C,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAE9F,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqCzB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAkIK,KAAK;;;;;;2BAML,KAAK,qBAAqB,KAAK;;;;;;;;;;2BAU/B,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA6CL,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6B5B,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA2DW,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAsDN,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA8BL,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B9B,CAAC"}
@@ -10,10 +10,12 @@
10
10
  * @attr {'inherit'|'base'|'tinted'} [background] - Surface background ('inherit' default; 'base'/'tinted' paint and cascade a surface).
11
11
  * @attr {string} [width] - Body max-width: 'full' removes the constraint so the section spans the full available width. Any CSS length (e.g. '480px') overrides the default max-width.
12
12
  * @attr {string} [height] - Minimum section height (any CSS length, e.g. '400px', '100dvh') (mirrors width, which sets the body max-width).
13
+ * @attr {boolean} grow - Takes the height the page has left, so the footer sits at the bottom of a short page. Without it, nldd-page lets its last section grow.
13
14
  * @attr {string} [padding-block] - Block (top and bottom) padding override (token 0-96; '0' strips it).
14
15
  * @attr {string} [padding-top] - Top padding override.
15
16
  * @attr {string} [padding-bottom] - Bottom padding override.
16
17
  * @attr {string} [sm-padding-block] - Responsive block padding (sm/md/lg, also per edge: {sm,md,lg}-padding-{top,bottom}).
18
+ * @attr {'top'|'center'|'bottom'} [vertical-alignment] - Where the shorter column sits next to the longer one ('top' default). Only where the columns stand side by side; stacked, they follow each other.
17
19
  *
18
20
  * @slot header - Content above the columns
19
21
  * @slot - Left column (1/2), alternative for slot="left"
@@ -37,12 +39,14 @@ declare const NLDDOneHalfOneHalfSection_base: typeof LitElement & (new (...args:
37
39
  lgPaddingTop?: import("../../../../utilities/page-section-mixin.js").PageSectionPadding;
38
40
  lgPaddingBottom?: import("../../../../utilities/page-section-mixin.js").PageSectionPadding;
39
41
  height?: string;
42
+ grow: boolean;
40
43
  _onSlotChange(e: Event): void;
41
44
  });
42
45
  export declare class NLDDOneHalfOneHalfSection extends NLDDOneHalfOneHalfSection_base {
43
46
  static styles: import("lit").CSSResult;
44
47
  /** Width mode: 'full' (removes body max-width) or any CSS length. */
45
48
  width: string;
49
+ verticalAlignment: 'top' | 'center' | 'bottom';
46
50
  updated(changedProperties: Map<string, unknown>): void;
47
51
  render(): import("lit-html").TemplateResult;
48
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"one-half-one-half-section.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;;;;;;;;;;;;;;;;;;AAMjC,qBACa,yBAA0B,SAAQ,8BAA4B;IAC1E,OAAgB,MAAM,0BAA+B;IAErD,qEAAqE;IAErE,KAAK,SAAM;IAEF,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAetD,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gCAAgC,EAAE,yBAAyB,CAAC;KAC5D;CACD"}
1
+ {"version":3,"file":"one-half-one-half-section.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;;;;;;;;;;;;;;;;;;;AAOjC,qBACa,yBAA0B,SAAQ,8BAA4B;IAC1E,OAAgB,MAAM,0BAA+B;IAErD,qEAAqE;IAErE,KAAK,SAAM;IAGX,iBAAiB,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAS;IAE9C,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAetD,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gCAAgC,EAAE,yBAAyB,CAAC;KAC5D;CACD"}
@@ -16,10 +16,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
16
16
  * @attr {'inherit'|'base'|'tinted'} [background] - Surface background ('inherit' default; 'base'/'tinted' paint and cascade a surface).
17
17
  * @attr {string} [width] - Body max-width: 'full' removes the constraint so the section spans the full available width. Any CSS length (e.g. '480px') overrides the default max-width.
18
18
  * @attr {string} [height] - Minimum section height (any CSS length, e.g. '400px', '100dvh') (mirrors width, which sets the body max-width).
19
+ * @attr {boolean} grow - Takes the height the page has left, so the footer sits at the bottom of a short page. Without it, nldd-page lets its last section grow.
19
20
  * @attr {string} [padding-block] - Block (top and bottom) padding override (token 0-96; '0' strips it).
20
21
  * @attr {string} [padding-top] - Top padding override.
21
22
  * @attr {string} [padding-bottom] - Bottom padding override.
22
23
  * @attr {string} [sm-padding-block] - Responsive block padding (sm/md/lg, also per edge: {sm,md,lg}-padding-{top,bottom}).
24
+ * @attr {'top'|'center'|'bottom'} [vertical-alignment] - Where the shorter column sits next to the longer one ('top' default). Only where the columns stand side by side; stacked, they follow each other.
23
25
  *
24
26
  * @slot header - Content above the columns
25
27
  * @slot - Left column (1/2), alternative for slot="left"
@@ -29,6 +31,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
29
31
  */
30
32
  import { LitElement } from 'lit';
31
33
  import { customElement, property } from 'lit/decorators.js';
34
+ import { reflectNonDefault } from '../../../../utilities/reflect-non-default.js';
32
35
  import { PageSectionMixin } from '../../../../utilities/page-section-mixin.js';
33
36
  import { oneHalfOneHalfSectionStyles } from './one-half-one-half-section.styles.js';
34
37
  import { oneHalfOneHalfSectionTemplate } from './one-half-one-half-section.template.js';
@@ -37,6 +40,7 @@ let NLDDOneHalfOneHalfSection = class NLDDOneHalfOneHalfSection extends PageSect
37
40
  super(...arguments);
38
41
  /** Width mode: 'full' (removes body max-width) or any CSS length. */
39
42
  this.width = '';
43
+ this.verticalAlignment = 'top';
40
44
  }
41
45
  updated(changedProperties) {
42
46
  super.updated(changedProperties);
@@ -59,8 +63,11 @@ let NLDDOneHalfOneHalfSection = class NLDDOneHalfOneHalfSection extends PageSect
59
63
  };
60
64
  NLDDOneHalfOneHalfSection.styles = oneHalfOneHalfSectionStyles;
61
65
  __decorate([
62
- property({ type: String, reflect: true })
66
+ property({ reflect: true, converter: reflectNonDefault('') })
63
67
  ], NLDDOneHalfOneHalfSection.prototype, "width", void 0);
68
+ __decorate([
69
+ property({ reflect: true, attribute: 'vertical-alignment', converter: reflectNonDefault('top') })
70
+ ], NLDDOneHalfOneHalfSection.prototype, "verticalAlignment", void 0);
64
71
  NLDDOneHalfOneHalfSection = __decorate([
65
72
  customElement('nldd-one-half-one-half-section')
66
73
  ], NLDDOneHalfOneHalfSection);