@canonical/ds-types 0.29.0 → 0.30.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.
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default component type for navigation items.
|
|
3
|
-
* Framework-agnostic — consumers supply a concrete type
|
|
4
|
-
* (e.g. React.ComponentType) via the generic parameter.
|
|
5
|
-
*/
|
|
6
|
-
export type DefaultComponent = unknown;
|
|
7
1
|
/**
|
|
8
2
|
* Navigation item - Public API (WD405)
|
|
9
3
|
*
|
|
10
4
|
* A unified type for navigation items across the design system.
|
|
11
5
|
* Used by Breadcrumbs, SiteNavigation, FileTree, MegaMenu, etc.
|
|
12
6
|
*
|
|
13
|
-
*
|
|
7
|
+
* Only fields consumed by the shared navigation utilities belong here.
|
|
8
|
+
* Styling and rendering customization (CSS classes, custom renderers)
|
|
9
|
+
* belong on the item types that components declare by extending this
|
|
10
|
+
* one (e.g. BreadcrumbItem, MenuItem), using each framework's own idioms.
|
|
14
11
|
*/
|
|
15
|
-
export interface Item
|
|
12
|
+
export interface Item {
|
|
16
13
|
/**
|
|
17
14
|
* Unique identifier for the item when a URL is not provided.
|
|
18
15
|
* e.g. 'section-header' for a non-navigable grouping item.
|
|
@@ -33,26 +30,11 @@ export interface Item<C = DefaultComponent> {
|
|
|
33
30
|
* e.g. true to prevent clicks on unavailable features.
|
|
34
31
|
*/
|
|
35
32
|
disabled?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* CSS class name for custom styling of the item.
|
|
38
|
-
* e.g. 'nav-item-active' to highlight the current page.
|
|
39
|
-
*/
|
|
40
|
-
className?: string;
|
|
41
33
|
/**
|
|
42
34
|
* Array of child items for nested navigation structures.
|
|
43
35
|
* e.g. Submenu items under a parent like 'Settings'.
|
|
44
36
|
*/
|
|
45
|
-
items?: Item
|
|
46
|
-
/**
|
|
47
|
-
* Enum value determining the type of display for items.
|
|
48
|
-
* e.g. 'list' for rendering as a simple list.
|
|
49
|
-
*/
|
|
50
|
-
displayItemsType?: "default" | "custom";
|
|
51
|
-
/**
|
|
52
|
-
* Custom component for rendering the item itself.
|
|
53
|
-
* e.g. A specialized renderer for complex items.
|
|
54
|
-
*/
|
|
55
|
-
Component?: C;
|
|
37
|
+
items?: Item[];
|
|
56
38
|
}
|
|
57
39
|
/**
|
|
58
40
|
* Annotated navigation item - Private API (WD405)
|
|
@@ -62,8 +44,7 @@ export interface Item<C = DefaultComponent> {
|
|
|
62
44
|
*
|
|
63
45
|
* Generic over the **whole item type** `T` it annotates, so an enhanced item
|
|
64
46
|
* (extra fields beyond the base WD405 `Item`, e.g. `icon`/`slot`) survives
|
|
65
|
-
* annotation with its fields intact and fully typed.
|
|
66
|
-
* custom component type (`Item<C>`).
|
|
47
|
+
* annotation with its fields intact and fully typed.
|
|
67
48
|
*
|
|
68
49
|
* @template T - The item type being annotated (defaults to the base `Item`)
|
|
69
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/navigation/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/navigation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,IAAI;IACnB;;;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,OAAO,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;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.
|
|
4
|
+
"version": "0.30.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@biomejs/biome": "2.4.9",
|
|
49
|
-
"@canonical/biome-config": "^0.
|
|
50
|
-
"@canonical/typescript-config": "^0.
|
|
51
|
-
"@canonical/webarchitect": "^0.
|
|
49
|
+
"@canonical/biome-config": "^0.30.0",
|
|
50
|
+
"@canonical/typescript-config": "^0.30.0",
|
|
51
|
+
"@canonical/webarchitect": "^0.30.0",
|
|
52
52
|
"typescript": "^5.9.3"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "40fe86ac955473536ac14f074812a9821f5b65c0"
|
|
55
55
|
}
|