@canonical/ds-types 0.27.0 → 0.28.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.
@@ -0,0 +1,2 @@
1
+ export * from "./types.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grid/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The grid presets from \@canonical/styles (`.grid.responsive` / `.grid.intrinsic`). */
2
+ export const GRID_PRESETS = ["responsive", "intrinsic"];
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/grid/types.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,WAAW,CAAU,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./grid/index.js";
1
2
  export * from "./modifierFamilies/index.js";
2
3
  export * from "./navigation/index.js";
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./types.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/grid/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** The grid presets from \@canonical/styles (`.grid.responsive` / `.grid.intrinsic`). */
2
+ export declare const GRID_PRESETS: readonly ["responsive", "intrinsic"];
3
+ /**
4
+ * A grid preset laying out content items:
5
+ *
6
+ * - `responsive` — fixed-responsive, breakpoint-driven columns (4 below
7
+ * 768px, 8 to 1279px, 12 from 1280px).
8
+ * - `intrinsic` — fluid auto-fill in groups of four
9
+ * `minmax(--grid-col-min, 1fr)` columns; column count follows available
10
+ * width, not breakpoints.
11
+ */
12
+ export type GridPreset = (typeof GRID_PRESETS)[number];
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/grid/types.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,eAAO,MAAM,YAAY,sCAAuC,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from "./grid/index.js";
1
2
  export * from "./modifierFamilies/index.js";
2
3
  export * from "./navigation/index.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
@@ -60,9 +60,14 @@ export interface Item<C = DefaultComponent> {
60
60
  * Internal type with parent reference and depth annotations.
61
61
  * Generated by annotateTree() helper.
62
62
  *
63
- * @template C - Custom component type for rendering the item
63
+ * Generic over the **whole item type** `T` it annotates, so an enhanced item
64
+ * (extra fields beyond the base WD405 `Item`, e.g. `icon`/`slot`) survives
65
+ * annotation with its fields intact and fully typed. `T` may itself carry a
66
+ * custom component type (`Item<C>`).
67
+ *
68
+ * @template T - The item type being annotated (defaults to the base `Item`)
64
69
  */
65
- export interface _Item<C = DefaultComponent> extends Item<C> {
70
+ export type _Item<T extends Item = Item> = Omit<T, "items"> & {
66
71
  /**
67
72
  * URL (or key) of the parent item in the navigation hierarchy.
68
73
  * e.g. '/parent' for a child item under '/parent', or null for the root.
@@ -76,17 +81,21 @@ export interface _Item<C = DefaultComponent> extends Item<C> {
76
81
  /**
77
82
  * Array of annotated child items, if any.
78
83
  * e.g. Prepared sub-items with their own parentUrl and depth.
84
+ *
85
+ * `T`'s own `items` is omitted before intersecting so this annotated form
86
+ * (`_Item<T>[]`) is the one surfaced when iterating children — otherwise the
87
+ * intersection would expose `T`'s base element type.
79
88
  */
80
- items?: _Item<C>[];
81
- }
89
+ items?: _Item<T>[];
90
+ };
82
91
  /**
83
92
  * Index for quick lookup of items by URL or key - Private API (WD405)
84
93
  *
85
94
  * A dictionary for O(1) lookup of prepared items.
86
95
  *
87
- * @template C - Custom component type for rendering the item
96
+ * @template T - The item type being annotated (defaults to the base `Item`)
88
97
  */
89
- export type _Index<C = DefaultComponent> = {
90
- [url: string]: _Item<C>;
98
+ export type _Index<T extends Item = Item> = {
99
+ [url: string]: _Item<T>;
91
100
  };
92
101
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/navigation/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,WAAW,IAAI,CAAC,CAAC,GAAG,gBAAgB;IACxC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,O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IACH,gBAAgB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAExC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC;CACf;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG;IAC5D;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI;IAC1C,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;CACzB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@canonical/ds-types",
3
3
  "description": "Types and related type utilities for Pragma.",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -28,6 +28,9 @@
28
28
  "url": "https://github.com/canonical/pragma/issues"
29
29
  },
30
30
  "homepage": "https://github.com/canonical/pragma#readme",
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
31
34
  "scripts": {
32
35
  "build": "bun run build:package",
33
36
  "build:all": "bun run build:package",
@@ -43,10 +46,10 @@
43
46
  },
44
47
  "devDependencies": {
45
48
  "@biomejs/biome": "2.4.9",
46
- "@canonical/biome-config": "^0.27.0",
47
- "@canonical/typescript-config": "^0.27.0",
48
- "@canonical/webarchitect": "^0.27.0",
49
+ "@canonical/biome-config": "^0.28.0",
50
+ "@canonical/typescript-config": "^0.28.0",
51
+ "@canonical/webarchitect": "^0.28.0",
49
52
  "typescript": "^5.9.3"
50
53
  },
51
- "gitHead": "5df5709bf7cb6f2016be2f6eba8391637e2e2a0c"
54
+ "gitHead": "8297d72122bcba903f7e8833cb23ccbaa164ed56"
52
55
  }