@nanoporetech-digital/components 4.10.0 → 5.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 (164) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/cjs/{form-control-2e900f54.js → form-control-443e90bf.js} +2 -3
  3. package/dist/cjs/form-control-443e90bf.js.map +1 -0
  4. package/dist/cjs/index-71f899a7.js +6 -2
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/nano-components.cjs.js +1 -1
  7. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +2 -2
  8. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  9. package/dist/cjs/nano-grid-item.cjs.entry.js +29 -0
  10. package/dist/cjs/nano-grid-item.cjs.entry.js.map +1 -0
  11. package/dist/cjs/nano-grid_2.cjs.entry.js +436 -0
  12. package/dist/cjs/nano-grid_2.cjs.entry.js.map +1 -0
  13. package/dist/cjs/nano-hero.cjs.entry.js +4 -10
  14. package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
  15. package/dist/cjs/nano-icon-button_2.cjs.entry.js +2 -2
  16. package/dist/cjs/nano-icon-button_2.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nano-input.cjs.entry.js +2 -2
  18. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  19. package/dist/cjs/nano-range.cjs.entry.js +1 -1
  20. package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
  21. package/dist/cjs/nano-sortable.cjs.entry.js +1 -0
  22. package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -1
  23. package/dist/cjs/{nano-table-ff33dc43.js → nano-table-11052a34.js} +37 -30
  24. package/dist/cjs/nano-table-11052a34.js.map +1 -0
  25. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  26. package/dist/cjs/{table.worker-0a6bc962.js → table.worker-83433a8b.js} +2 -2
  27. package/dist/cjs/table.worker-83433a8b.js.map +1 -0
  28. package/dist/collection/components/form-control/form-control.js +1 -2
  29. package/dist/collection/components/form-control/form-control.js.map +1 -1
  30. package/dist/collection/components/grid/grid-item.js +11 -136
  31. package/dist/collection/components/grid/grid-item.js.map +1 -1
  32. package/dist/collection/components/grid/grid.css +9 -242
  33. package/dist/collection/components/grid/grid.js +248 -240
  34. package/dist/collection/components/grid/grid.js.map +1 -1
  35. package/dist/collection/components/hero/hero.css +42 -89
  36. package/dist/collection/components/hero/hero.js +4 -11
  37. package/dist/collection/components/hero/hero.js.map +1 -1
  38. package/dist/collection/components/icon-button/icon-button.css +12 -0
  39. package/dist/collection/components/icon-button/icon-button.js +1 -1
  40. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  41. package/dist/collection/components/input/input.css +8 -9
  42. package/dist/collection/components/range/range.css +0 -3
  43. package/dist/collection/components/select/select.css +8 -9
  44. package/dist/collection/components/sortable/sortable.js +2 -1
  45. package/dist/collection/components/sortable/sortable.js.map +1 -1
  46. package/dist/collection/components/table/table.css +6 -0
  47. package/dist/collection/components/table/table.js +25 -18
  48. package/dist/collection/components/table/table.js.map +1 -1
  49. package/dist/collection/components/table/table.row.js +7 -7
  50. package/dist/collection/components/table/table.row.js.map +1 -1
  51. package/dist/collection/utils/constructible-style.js +129 -0
  52. package/dist/collection/utils/constructible-style.js.map +1 -0
  53. package/dist/components/form-control.js +1 -2
  54. package/dist/components/form-control.js.map +1 -1
  55. package/dist/components/grid.js +268 -183
  56. package/dist/components/grid.js.map +1 -1
  57. package/dist/components/icon-button.js +2 -2
  58. package/dist/components/icon-button.js.map +1 -1
  59. package/dist/components/input.js +1 -1
  60. package/dist/components/input.js.map +1 -1
  61. package/dist/components/nano-grid-item.js +33 -1
  62. package/dist/components/nano-grid-item.js.map +1 -1
  63. package/dist/components/nano-hero.js +6 -19
  64. package/dist/components/nano-hero.js.map +1 -1
  65. package/dist/components/nano-range.js +1 -1
  66. package/dist/components/nano-range.js.map +1 -1
  67. package/dist/components/nano-sortable.js +1 -0
  68. package/dist/components/nano-sortable.js.map +1 -1
  69. package/dist/components/select.js +1 -1
  70. package/dist/components/select.js.map +1 -1
  71. package/dist/components/table.js +36 -29
  72. package/dist/components/table.js.map +1 -1
  73. package/dist/esm/{form-control-269ba84f.js → form-control-e8739b2e.js} +2 -3
  74. package/dist/esm/form-control-e8739b2e.js.map +1 -0
  75. package/dist/esm/index-dad5627b.js +6 -2
  76. package/dist/esm/loader.js +1 -1
  77. package/dist/esm/nano-components.js +1 -1
  78. package/dist/esm/nano-global-nav-user-profile_3.entry.js +2 -2
  79. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  80. package/dist/esm/nano-grid-item.entry.js +25 -0
  81. package/dist/esm/nano-grid-item.entry.js.map +1 -0
  82. package/dist/esm/nano-grid_2.entry.js +431 -0
  83. package/dist/esm/nano-grid_2.entry.js.map +1 -0
  84. package/dist/esm/nano-hero.entry.js +4 -10
  85. package/dist/esm/nano-hero.entry.js.map +1 -1
  86. package/dist/esm/nano-icon-button_2.entry.js +2 -2
  87. package/dist/esm/nano-icon-button_2.entry.js.map +1 -1
  88. package/dist/esm/nano-input.entry.js +2 -2
  89. package/dist/esm/nano-input.entry.js.map +1 -1
  90. package/dist/esm/nano-range.entry.js +1 -1
  91. package/dist/esm/nano-range.entry.js.map +1 -1
  92. package/dist/esm/nano-sortable.entry.js +1 -0
  93. package/dist/esm/nano-sortable.entry.js.map +1 -1
  94. package/dist/esm/{nano-table-ec980076.js → nano-table-ba637f26.js} +37 -30
  95. package/dist/esm/nano-table-ba637f26.js.map +1 -0
  96. package/dist/esm/nano-table.entry.js +1 -1
  97. package/dist/esm/{table.worker-b53db58e.js → table.worker-1cae39c9.js} +2 -2
  98. package/dist/esm/table.worker-1cae39c9.js.map +1 -0
  99. package/dist/nano-components/nano-components.css +1 -1
  100. package/dist/nano-components/nano-components.esm.js +1 -1
  101. package/dist/nano-components/nano-components.esm.js.map +1 -1
  102. package/dist/nano-components/p-00cf8021.entry.js +5 -0
  103. package/dist/nano-components/p-00cf8021.entry.js.map +1 -0
  104. package/dist/nano-components/{p-f591400b.entry.js → p-158c73b0.entry.js} +2 -2
  105. package/dist/nano-components/p-365c997a.js +5 -0
  106. package/dist/nano-components/p-553acf24.entry.js +5 -0
  107. package/dist/nano-components/{p-58b53239.entry.js.map → p-553acf24.entry.js.map} +1 -1
  108. package/dist/nano-components/p-6975f110.entry.js +5 -0
  109. package/dist/nano-components/p-6975f110.entry.js.map +1 -0
  110. package/dist/nano-components/p-71057181.js +5 -0
  111. package/dist/nano-components/p-71057181.js.map +1 -0
  112. package/dist/nano-components/p-ad6209ec.entry.js +5 -0
  113. package/dist/nano-components/p-ad6209ec.entry.js.map +1 -0
  114. package/dist/nano-components/p-bdef618c.entry.js +5 -0
  115. package/dist/nano-components/p-bdef618c.entry.js.map +1 -0
  116. package/dist/nano-components/{p-241baff8.entry.js → p-d79c6862.entry.js} +2 -2
  117. package/dist/nano-components/p-d79c6862.entry.js.map +1 -0
  118. package/dist/nano-components/p-deb0799c.entry.js +5 -0
  119. package/dist/nano-components/{p-6a3a29c6.entry.js.map → p-deb0799c.entry.js.map} +1 -1
  120. package/dist/nano-components/p-ebb98a9e.entry.js +5 -0
  121. package/dist/nano-components/p-ebb98a9e.entry.js.map +1 -0
  122. package/dist/nano-components/p-fc585ea2.js +5 -0
  123. package/dist/nano-components/p-fc585ea2.js.map +1 -0
  124. package/dist/types/components/grid/grid-item.d.ts +3 -11
  125. package/dist/types/components/grid/grid.d.ts +44 -68
  126. package/dist/types/components/hero/hero.d.ts +1 -3
  127. package/dist/types/components/table/table.d.ts +5 -0
  128. package/dist/types/components.d.ts +85 -61
  129. package/dist/types/utils/constructible-style.d.ts +31 -0
  130. package/docs-json.json +147 -88
  131. package/docs-vscode.json +28 -21
  132. package/hydrate/index.js +340 -306
  133. package/package.json +2 -2
  134. package/dist/cjs/form-control-2e900f54.js.map +0 -1
  135. package/dist/cjs/nano-grid_3.cjs.entry.js +0 -431
  136. package/dist/cjs/nano-grid_3.cjs.entry.js.map +0 -1
  137. package/dist/cjs/nano-table-ff33dc43.js.map +0 -1
  138. package/dist/cjs/table.worker-0a6bc962.js.map +0 -1
  139. package/dist/collection/components/grid/grid-item.css +0 -15
  140. package/dist/components/grid-item.js +0 -107
  141. package/dist/components/grid-item.js.map +0 -1
  142. package/dist/esm/form-control-269ba84f.js.map +0 -1
  143. package/dist/esm/nano-grid_3.entry.js +0 -425
  144. package/dist/esm/nano-grid_3.entry.js.map +0 -1
  145. package/dist/esm/nano-table-ec980076.js.map +0 -1
  146. package/dist/esm/table.worker-b53db58e.js.map +0 -1
  147. package/dist/nano-components/p-064af7d0.js +0 -5
  148. package/dist/nano-components/p-064af7d0.js.map +0 -1
  149. package/dist/nano-components/p-107d4549.entry.js +0 -5
  150. package/dist/nano-components/p-107d4549.entry.js.map +0 -1
  151. package/dist/nano-components/p-239d343a.entry.js +0 -5
  152. package/dist/nano-components/p-239d343a.entry.js.map +0 -1
  153. package/dist/nano-components/p-241baff8.entry.js.map +0 -1
  154. package/dist/nano-components/p-58b53239.entry.js +0 -5
  155. package/dist/nano-components/p-5ac74848.js +0 -5
  156. package/dist/nano-components/p-5ac74848.js.map +0 -1
  157. package/dist/nano-components/p-6a3a29c6.entry.js +0 -5
  158. package/dist/nano-components/p-806bcd46.js +0 -5
  159. package/dist/nano-components/p-d3de231c.entry.js +0 -5
  160. package/dist/nano-components/p-d3de231c.entry.js.map +0 -1
  161. package/dist/nano-components/p-d792f692.entry.js +0 -5
  162. package/dist/nano-components/p-d792f692.entry.js.map +0 -1
  163. /package/dist/nano-components/{p-806bcd46.js.map → p-158c73b0.entry.js.map} +0 -0
  164. /package/dist/nano-components/{p-f591400b.entry.js.map → p-365c997a.js.map} +0 -0
@@ -16,7 +16,6 @@ import { ComponentInterface } from '../../stencil-public-runtime';
16
16
  export declare class Hero implements ComponentInterface {
17
17
  private mo?;
18
18
  host: HTMLNanoHeroElement;
19
- gridSizes: string[];
20
19
  hasIconBox: boolean;
21
20
  hasScrim: boolean;
22
21
  hasSecondaryContent: boolean;
@@ -28,7 +27,7 @@ export declare class Hero implements ComponentInterface {
28
27
  breadCrumbChange(): void;
29
28
  iconBoxItems: Element[];
30
29
  iconBoxItemChange(): void;
31
- /** src for backgronund image. For more control use the `background` slot instead. */
30
+ /** src for background image. For more control use the `background` slot instead. */
32
31
  imgSrc?: string;
33
32
  /** Optional list string providing media sizes with corresponding image srcs.
34
33
  * i.e. show img-x at 300px wide. Format `srcSet="200w src/imgSmall.jpg, 500h src/imgMed.png"` */
@@ -41,7 +40,6 @@ export declare class Hero implements ComponentInterface {
41
40
  level: 'top' | 'sub';
42
41
  private slotChangeObserver;
43
42
  private processSlottedContent;
44
- private handleGridChange;
45
43
  disconnectedCallback(): void;
46
44
  componentDidLoad(): void;
47
45
  componentWillLoad(): void;
@@ -227,6 +227,11 @@ export declare class Table implements ComponentInterface {
227
227
  private getBlockHeight;
228
228
  /** cache the height for all active blocks for later renders */
229
229
  private setBlockHeight;
230
+ /**
231
+ * On scroll, loop through all blocks' heights and cumulatively, add them together.
232
+ * When we find that the scroll position is less than this cumulative block height -
233
+ * stop loop - it's on the current active block.
234
+ */
230
235
  private scrollHandler;
231
236
  /** Process slotted content */
232
237
  private processSlots;
@@ -5,7 +5,7 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { AlgoliaNetworkError, AloliaSearchResultDetail, CheckboxChangeEventDetail, Color, ControlValidity, ControlValidityEventDetail, DateDisabledPredicate, DateInputChangeEventDetail, DragEvent, DuetLocalizedText, FileInputChangeEventDetail, FileWithUrl, FilterChangeEventDetail, Flickity, FlickityOptions, GridSizes, IndexResult, InputChangeEventDetail, LocalDateOpts, MyAccountData, MyAccountUser, NanoFormEles, NavItemEventDetail, OptionInterface, PageChangeEventDetail, PickerChangeEvent, PlainFormEles, RangeChangeEventDetail, RangeValue, ResizeStateChangeEventDetail, SearchIndex, SelectChangeEventDetail, SlideAnimation, StyleEventDetail, TableTypes, TextFieldTypes, ValidationState, ValidatorValueStore } from "./interface";
8
+ import { AlgoliaNetworkError, AloliaSearchResultDetail, CheckboxChangeEventDetail, Color, ControlValidity, ControlValidityEventDetail, DateDisabledPredicate, DateInputChangeEventDetail, DragEvent, DuetLocalizedText, FileInputChangeEventDetail, FileWithUrl, FilterChangeEventDetail, Flickity, FlickityOptions, IndexResult, InputChangeEventDetail, LocalDateOpts, MyAccountData, MyAccountUser, NanoFormEles, NavItemEventDetail, OptionInterface, PageChangeEventDetail, PickerChangeEvent, PlainFormEles, RangeChangeEventDetail, RangeValue, ResizeStateChangeEventDetail, SearchIndex, SelectChangeEventDetail, SlideAnimation, StyleEventDetail, TableTypes, TextFieldTypes, ValidationState, ValidatorValueStore } from "./interface";
9
9
  import { StorageMethods } from "./utils/store/component-store";
10
10
  import { DaysOfWeek } from "./utils/date-utils";
11
11
  import { PopoverPlacement } from "./utils/popover";
@@ -1118,42 +1118,49 @@ export namespace Components {
1118
1118
  interface NanoGlobalSearchResults {
1119
1119
  }
1120
1120
  /**
1121
- * A context-aware CSS grid implementation.
1122
- * Uses it's own width to choose column number - not screen width.
1121
+ * A lightweight, context-aware CSS grid implementation.
1122
+ * - Define multiple grids templates at different breakpoints
1123
+ * - Uses `@container` queries to select the correct grid depending on the current dimensions
1124
+ * - Use `grid-states="..."` on direct descendants for `column` / `row` - `start` / `end`
1125
+ * - SSR optimised
1123
1126
  */
1124
1127
  interface NanoGrid {
1125
- /**
1126
- * shortcut for a traditional website like grid (requires more than one row). The second row will auto expand to fill the grid height. The first row and > 2nd row will be the size of their content. e.g. header, body and footer.
1127
- */
1128
- "contentPanel": boolean;
1129
- /**
1130
- * Helper to make grid items expand to full height in IE11
1131
- */
1132
- "fullHeight": boolean;
1133
1128
  /**
1134
1129
  * the number of columns the grid has at the large breakpoint.
1135
1130
  */
1136
1131
  "lCols": number;
1137
1132
  /**
1138
- * the component's large breakpoint. Note - all breakpoints are based on component width, not screen width.
1133
+ * the component's large breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem`
1139
1134
  */
1140
- "lSize": number;
1135
+ "lSize": number | string;
1136
+ /**
1137
+ * Optional large `grid-template`. *Note* - you must set `lCols` for this to take affect
1138
+ */
1139
+ "lTpl"?: string;
1141
1140
  /**
1142
1141
  * the number of columns the grid has at the medium breakpoint.
1143
1142
  */
1144
1143
  "mCols": number;
1145
1144
  /**
1146
- * the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width.
1145
+ * the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem`
1146
+ */
1147
+ "mSize": number | string;
1148
+ /**
1149
+ * Optional medium `grid-template`. *Note* - you must set `mCols` for this to take affect
1147
1150
  */
1148
- "mSize": number;
1151
+ "mTpl"?: string;
1149
1152
  /**
1150
1153
  * the number of columns the grid has at the small breakpoint.
1151
1154
  */
1152
1155
  "sCols": number;
1153
1156
  /**
1154
- * the component's small breakpoint. Note - all breakpoints are based on component width, not screen width.
1157
+ * the component's small breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem`
1155
1158
  */
1156
- "sSize": number;
1159
+ "sSize": number | string;
1160
+ /**
1161
+ * Optional small `grid-template`. *Note* - you must set `sCols` for this to take affect
1162
+ */
1163
+ "sTpl"?: string;
1157
1164
  /**
1158
1165
  * shows a grid helper to visualise where columns are
1159
1166
  */
@@ -1163,33 +1170,35 @@ export namespace Components {
1163
1170
  */
1164
1171
  "xlCols": number;
1165
1172
  /**
1166
- * the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width.
1173
+ * the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem`
1174
+ */
1175
+ "xlSize": number | string;
1176
+ /**
1177
+ * Optional xl `grid-template`. *Note* - you must set `xlCols` for this to take affect
1167
1178
  */
1168
- "xlSize": number;
1179
+ "xlTpl"?: string;
1169
1180
  /**
1170
1181
  * the number of columns the grid has at the xxl breakpoint (anything greater than the xl breakpoint)
1171
1182
  */
1172
1183
  "xxlCols": number;
1184
+ /**
1185
+ * Optional xxl `grid-template`. *Note* - you must set `xxlCols` for this to take affect
1186
+ */
1187
+ "xxlTpl"?: string;
1173
1188
  }
1174
1189
  /**
1190
+ * @deprecated - you can now use `grid-states="..."`
1191
+ * on any direct `nano-grid` descendent without limitation rendering `nano-grid-item` obsolete.
1175
1192
  * Grid items to be used with [grid](/story/nano-components-grid) elements
1176
1193
  */
1177
1194
  interface NanoGridItem {
1178
- /**
1179
- * Called by parent grid to trigger new classes
1180
- */
1181
- "changeBP": (newGridSizes: GridSizes[]) => Promise<void>;
1182
- /**
1183
- * How to position this item within it's parent grid at different break points. Examples: xl-col-span-2 l-col-start-2 xxl-row-span-2 m-row-start-2
1184
- */
1185
- "gridStates": string;
1186
1195
  }
1187
1196
  /**
1188
1197
  * Hero components are designed to be used once per content page to add visual impact to the introductory section of a page.
1189
1198
  */
1190
1199
  interface NanoHero {
1191
1200
  /**
1192
- * src for backgronund image. For more control use the `background` slot instead.
1201
+ * src for background image. For more control use the `background` slot instead.
1193
1202
  */
1194
1203
  "imgSrc"?: string;
1195
1204
  /**
@@ -2622,10 +2631,6 @@ export interface NanoGlobalSearchResultsCustomEvent<T> extends CustomEvent<T> {
2622
2631
  detail: T;
2623
2632
  target: HTMLNanoGlobalSearchResultsElement;
2624
2633
  }
2625
- export interface NanoGridCustomEvent<T> extends CustomEvent<T> {
2626
- detail: T;
2627
- target: HTMLNanoGridElement;
2628
- }
2629
2634
  export interface NanoImgCustomEvent<T> extends CustomEvent<T> {
2630
2635
  detail: T;
2631
2636
  target: HTMLNanoImgElement;
@@ -2932,8 +2937,11 @@ declare global {
2932
2937
  new (): HTMLNanoGlobalSearchResultsElement;
2933
2938
  };
2934
2939
  /**
2935
- * A context-aware CSS grid implementation.
2936
- * Uses it's own width to choose column number - not screen width.
2940
+ * A lightweight, context-aware CSS grid implementation.
2941
+ * - Define multiple grids templates at different breakpoints
2942
+ * - Uses `@container` queries to select the correct grid depending on the current dimensions
2943
+ * - Use `grid-states="..."` on direct descendants for `column` / `row` - `start` / `end`
2944
+ * - SSR optimised
2937
2945
  */
2938
2946
  interface HTMLNanoGridElement extends Components.NanoGrid, HTMLStencilElement {
2939
2947
  }
@@ -2942,6 +2950,8 @@ declare global {
2942
2950
  new (): HTMLNanoGridElement;
2943
2951
  };
2944
2952
  /**
2953
+ * @deprecated - you can now use `grid-states="..."`
2954
+ * on any direct `nano-grid` descendent without limitation rendering `nano-grid-item` obsolete.
2945
2955
  * Grid items to be used with [grid](/story/nano-components-grid) elements
2946
2956
  */
2947
2957
  interface HTMLNanoGridItemElement extends Components.NanoGridItem, HTMLStencilElement {
@@ -4438,46 +4448,49 @@ declare namespace LocalJSX {
4438
4448
  "onNanoSearchGoBack"?: (event: NanoGlobalSearchResultsCustomEvent<any>) => void;
4439
4449
  }
4440
4450
  /**
4441
- * A context-aware CSS grid implementation.
4442
- * Uses it's own width to choose column number - not screen width.
4451
+ * A lightweight, context-aware CSS grid implementation.
4452
+ * - Define multiple grids templates at different breakpoints
4453
+ * - Uses `@container` queries to select the correct grid depending on the current dimensions
4454
+ * - Use `grid-states="..."` on direct descendants for `column` / `row` - `start` / `end`
4455
+ * - SSR optimised
4443
4456
  */
4444
4457
  interface NanoGrid {
4445
- /**
4446
- * shortcut for a traditional website like grid (requires more than one row). The second row will auto expand to fill the grid height. The first row and > 2nd row will be the size of their content. e.g. header, body and footer.
4447
- */
4448
- "contentPanel"?: boolean;
4449
- /**
4450
- * Helper to make grid items expand to full height in IE11
4451
- */
4452
- "fullHeight"?: boolean;
4453
4458
  /**
4454
4459
  * the number of columns the grid has at the large breakpoint.
4455
4460
  */
4456
4461
  "lCols"?: number;
4457
4462
  /**
4458
- * the component's large breakpoint. Note - all breakpoints are based on component width, not screen width.
4463
+ * the component's large breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem`
4464
+ */
4465
+ "lSize"?: number | string;
4466
+ /**
4467
+ * Optional large `grid-template`. *Note* - you must set `lCols` for this to take affect
4459
4468
  */
4460
- "lSize"?: number;
4469
+ "lTpl"?: string;
4461
4470
  /**
4462
4471
  * the number of columns the grid has at the medium breakpoint.
4463
4472
  */
4464
4473
  "mCols"?: number;
4465
4474
  /**
4466
- * the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width.
4475
+ * the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem`
4467
4476
  */
4468
- "mSize"?: number;
4477
+ "mSize"?: number | string;
4469
4478
  /**
4470
- * Emitted when the `nano-grid` changes breakpoint
4479
+ * Optional medium `grid-template`. *Note* - you must set `mCols` for this to take affect
4471
4480
  */
4472
- "onNanoBpChange"?: (event: NanoGridCustomEvent<string[]>) => void;
4481
+ "mTpl"?: string;
4473
4482
  /**
4474
4483
  * the number of columns the grid has at the small breakpoint.
4475
4484
  */
4476
4485
  "sCols"?: number;
4477
4486
  /**
4478
- * the component's small breakpoint. Note - all breakpoints are based on component width, not screen width.
4487
+ * the component's small breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem`
4479
4488
  */
4480
- "sSize"?: number;
4489
+ "sSize"?: number | string;
4490
+ /**
4491
+ * Optional small `grid-template`. *Note* - you must set `sCols` for this to take affect
4492
+ */
4493
+ "sTpl"?: string;
4481
4494
  /**
4482
4495
  * shows a grid helper to visualise where columns are
4483
4496
  */
@@ -4487,29 +4500,35 @@ declare namespace LocalJSX {
4487
4500
  */
4488
4501
  "xlCols"?: number;
4489
4502
  /**
4490
- * the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width.
4503
+ * the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width. Will default to `px` if no unit supplied e.g. `20rem`
4504
+ */
4505
+ "xlSize"?: number | string;
4506
+ /**
4507
+ * Optional xl `grid-template`. *Note* - you must set `xlCols` for this to take affect
4491
4508
  */
4492
- "xlSize"?: number;
4509
+ "xlTpl"?: string;
4493
4510
  /**
4494
4511
  * the number of columns the grid has at the xxl breakpoint (anything greater than the xl breakpoint)
4495
4512
  */
4496
4513
  "xxlCols"?: number;
4514
+ /**
4515
+ * Optional xxl `grid-template`. *Note* - you must set `xxlCols` for this to take affect
4516
+ */
4517
+ "xxlTpl"?: string;
4497
4518
  }
4498
4519
  /**
4520
+ * @deprecated - you can now use `grid-states="..."`
4521
+ * on any direct `nano-grid` descendent without limitation rendering `nano-grid-item` obsolete.
4499
4522
  * Grid items to be used with [grid](/story/nano-components-grid) elements
4500
4523
  */
4501
4524
  interface NanoGridItem {
4502
- /**
4503
- * How to position this item within it's parent grid at different break points. Examples: xl-col-span-2 l-col-start-2 xxl-row-span-2 m-row-start-2
4504
- */
4505
- "gridStates"?: string;
4506
4525
  }
4507
4526
  /**
4508
4527
  * Hero components are designed to be used once per content page to add visual impact to the introductory section of a page.
4509
4528
  */
4510
4529
  interface NanoHero {
4511
4530
  /**
4512
- * src for backgronund image. For more control use the `background` slot instead.
4531
+ * src for background image. For more control use the `background` slot instead.
4513
4532
  */
4514
4533
  "imgSrc"?: string;
4515
4534
  /**
@@ -6119,11 +6138,16 @@ declare module "@stencil/core" {
6119
6138
  */
6120
6139
  "nano-global-search-results": LocalJSX.NanoGlobalSearchResults & JSXBase.HTMLAttributes<HTMLNanoGlobalSearchResultsElement>;
6121
6140
  /**
6122
- * A context-aware CSS grid implementation.
6123
- * Uses it's own width to choose column number - not screen width.
6141
+ * A lightweight, context-aware CSS grid implementation.
6142
+ * - Define multiple grids templates at different breakpoints
6143
+ * - Uses `@container` queries to select the correct grid depending on the current dimensions
6144
+ * - Use `grid-states="..."` on direct descendants for `column` / `row` - `start` / `end`
6145
+ * - SSR optimised
6124
6146
  */
6125
6147
  "nano-grid": LocalJSX.NanoGrid & JSXBase.HTMLAttributes<HTMLNanoGridElement>;
6126
6148
  /**
6149
+ * @deprecated - you can now use `grid-states="..."`
6150
+ * on any direct `nano-grid` descendent without limitation rendering `nano-grid-item` obsolete.
6127
6151
  * Grid items to be used with [grid](/story/nano-components-grid) elements
6128
6152
  */
6129
6153
  "nano-grid-item": LocalJSX.NanoGridItem & JSXBase.HTMLAttributes<HTMLNanoGridItemElement>;
@@ -0,0 +1,31 @@
1
+ import { ComponentInterface } from '../stencil-public-runtime';
2
+ declare type ConstructibleStyleDecorator = (target: ComponentInterface, propertyKey: string) => void;
3
+ /**
4
+ * Dynamically create a constructible stylesheet which is applied to the component.
5
+ * The stylesheet is then cached for future instances of the component.
6
+ * @usage
7
+ As a string:
8
+ ```
9
+ @ConstructableStyle() style = `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
10
+ ```
11
+ As a function:
12
+ ```
13
+ @ConstructableStyle() style = () => `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
14
+ ```
15
+ * @param opts - optional `cacheKeyProperty` - in case an instance of a component could produce different styles based on variables.
16
+ * @returns `@ConstructableStyle` decorator
17
+ */
18
+ export declare function ConstructibleStyle(opts?: ConstructibleStyleOptions): ConstructibleStyleDecorator;
19
+ export interface ConstructibleStyleOptions {
20
+ /**
21
+ * Set this in case an instance of a component could produce different styles based on variables.
22
+ * This will ensure that you get new styles for each mode.
23
+ * @example
24
+ ```
25
+ @Prop() mode: string;
26
+ @ConstructableStyle({ cacheKeyProperty: "mode" }) style = `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
27
+ ```
28
+ */
29
+ cacheKeyProperty?: string;
30
+ }
31
+ export {};