@illinois-grad/grad-vue 2.5.5 → 3.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.
@@ -2840,15 +2840,6 @@
2840
2840
  "optional": true,
2841
2841
  "description": "Title and accessible name for the nav landmark"
2842
2842
  },
2843
- {
2844
- "kind": "field",
2845
- "name": "items",
2846
- "type": {
2847
- "text": "TreeMenuItem[]"
2848
- },
2849
- "optional": false,
2850
- "description": "Items for the menu"
2851
- },
2852
2843
  {
2853
2844
  "kind": "field",
2854
2845
  "name": "listType",
@@ -2856,7 +2847,7 @@
2856
2847
  "text": "\"ul\" | \"ol\""
2857
2848
  },
2858
2849
  "optional": true,
2859
- "description": "List element type - use `ol` for numbered hierarchies like book chapters",
2850
+ "description": "List element type",
2860
2851
  "default": "\"ul\""
2861
2852
  },
2862
2853
  {
@@ -2868,12 +2859,60 @@
2868
2859
  "optional": true,
2869
2860
  "description": "Theme",
2870
2861
  "default": "\"light\""
2862
+ },
2863
+ {
2864
+ "kind": "field",
2865
+ "name": "storageKey",
2866
+ "type": {
2867
+ "text": "string"
2868
+ },
2869
+ "optional": true,
2870
+ "description": "When provided, expanded/collapsed states are saved to `sessionStorage` under this key and restored on page load. Item states are keyed by each the `label` prop."
2871
2871
  }
2872
2872
  ],
2873
2873
  "events": []
2874
2874
  }
2875
2875
  ]
2876
2876
  },
2877
+ {
2878
+ "kind": "javascript-module",
2879
+ "path": "dist/web-components.js",
2880
+ "declarations": [
2881
+ {
2882
+ "kind": "custom-element",
2883
+ "name": "GTreeMenuListElement",
2884
+ "tagName": "g-tree-menu-list",
2885
+ "members": [],
2886
+ "events": []
2887
+ }
2888
+ ]
2889
+ },
2890
+ {
2891
+ "kind": "javascript-module",
2892
+ "path": "dist/web-components.js",
2893
+ "declarations": [
2894
+ {
2895
+ "kind": "custom-element",
2896
+ "name": "GTreeMenuItemElement",
2897
+ "tagName": "g-tree-menu-item",
2898
+ "members": [],
2899
+ "events": [
2900
+ {
2901
+ "name": "expand",
2902
+ "type": {
2903
+ "text": "CustomEvent"
2904
+ }
2905
+ },
2906
+ {
2907
+ "name": "collapse",
2908
+ "type": {
2909
+ "text": "CustomEvent"
2910
+ }
2911
+ }
2912
+ ]
2913
+ }
2914
+ ]
2915
+ },
2877
2916
  {
2878
2917
  "kind": "javascript-module",
2879
2918
  "path": "dist/web-components.js",
@@ -1,20 +1,37 @@
1
- import type { TreeMenuItem } from "./tree-menu/GTreeMenuList.vue";
2
1
  /**
3
2
  * A hierarchical sidebar menu component suitable for book-like or nested-section
4
3
  * navigation. Items with children start collapsed and can be expanded/collapsed
5
4
  * individually.
6
5
  *
6
+ * Links are authored directly in HTML for progressive enhancement — the page
7
+ * works as a basic list of links even without JavaScript.
8
+ *
9
+ * Use `GTreeMenuList` and `GTreeMenuItem` sub-components to build the menu:
10
+ *
11
+ * ```vue-html
12
+ * <GTreeMenu title="Contents">
13
+ * <GTreeMenuList>
14
+ * <GTreeMenuItem label="Chapter 1">
15
+ * <a href="#ch1">Chapter 1</a>
16
+ * <template #children>
17
+ * <GTreeMenuItem><a href="#s1">Section 1.1</a></GTreeMenuItem>
18
+ * </template>
19
+ * </GTreeMenuItem>
20
+ * </GTreeMenuList>
21
+ * </GTreeMenu>
22
+ * ```
23
+ *
7
24
  * **Props**:
8
25
  *
9
26
  * - `title` - optional heading and accessible name for the nav landmark.
10
- * - `items` - array of `TreeMenuItem` objects. Each item may have:
11
- * - `label` - display text (required).
12
- * - `href` or `to` - link destination. When `to` is provided and `vue-router`
13
- * is present the link is rendered as a `<router-link>`.
14
- * - `children` - nested `TreeMenuItem[]` for sub-levels (unlimited depth).
15
27
  * - `listType` - `ul` (default) or `ol`. Use `ol` for numbered
16
- * hierarchies such as book chapters.
28
+ * hierarchies such as book chapters. Inherited by nested `GTreeMenuList`
29
+ * components via provide/inject.
17
30
  * - `theme` - `light` (default) or `dark`.
31
+ * - `storageKey` - when provided, expanded/collapsed states are persisted to
32
+ * `sessionStorage` under this key and restored on page load. This is useful
33
+ * in Web Component / Drupal contexts where every page navigation is a full
34
+ * refresh. Item states are keyed by the item's `label` prop.
18
35
  *
19
36
  * **Keyboard navigation** (tree-view style):
20
37
  *
@@ -26,18 +43,14 @@ import type { TreeMenuItem } from "./tree-menu/GTreeMenuList.vue";
26
43
  */
27
44
  declare const _default: typeof __VLS_export;
28
45
  export default _default;
29
- declare const __VLS_export: import("vue").DefineComponent<{
46
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
30
47
  /**
31
48
  * Title and accessible name for the nav landmark
32
49
  * @demo Tree Menu
33
50
  */
34
51
  title?: string;
35
52
  /**
36
- * Items for the menu
37
- */
38
- items: TreeMenuItem[];
39
- /**
40
- * List element type - use `ol` for numbered hierarchies like book chapters
53
+ * List element type
41
54
  * @demo
42
55
  */
43
56
  listType?: "ul" | "ol";
@@ -46,6 +59,12 @@ declare const __VLS_export: import("vue").DefineComponent<{
46
59
  * @demo
47
60
  */
48
61
  theme?: "light" | "dark";
62
+ /**
63
+ * When provided, expanded/collapsed states are saved to `sessionStorage`
64
+ * under this key and restored on page load. Item states are keyed by each
65
+ * the `label` prop.
66
+ */
67
+ storageKey?: string;
49
68
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
50
69
  /**
51
70
  * Title and accessible name for the nav landmark
@@ -53,11 +72,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
53
72
  */
54
73
  title?: string;
55
74
  /**
56
- * Items for the menu
57
- */
58
- items: TreeMenuItem[];
59
- /**
60
- * List element type - use `ol` for numbered hierarchies like book chapters
75
+ * List element type
61
76
  * @demo
62
77
  */
63
78
  listType?: "ul" | "ol";
@@ -66,7 +81,20 @@ declare const __VLS_export: import("vue").DefineComponent<{
66
81
  * @demo
67
82
  */
68
83
  theme?: "light" | "dark";
84
+ /**
85
+ * When provided, expanded/collapsed states are saved to `sessionStorage`
86
+ * under this key and restored on page load. Item states are keyed by each
87
+ * the `label` prop.
88
+ */
89
+ storageKey?: string;
69
90
  }> & Readonly<{}>, {
70
91
  theme: "light" | "dark";
71
92
  listType: "ul" | "ol";
72
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
93
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
94
+ default?: (props: {}) => any;
95
+ }>;
96
+ type __VLS_WithSlots<T, S> = T & {
97
+ new (): {
98
+ $slots: S;
99
+ };
100
+ };
@@ -0,0 +1,52 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
4
+ /**
5
+ * Accessible label used for the toggle button's aria-label when the
6
+ * item has children (e.g. "Chapter 1" → "Chapter 1 sub-menu").
7
+ */
8
+ label?: string;
9
+ /**
10
+ * Whether the item starts expanded. Only meaningful for items that
11
+ * have a `#children` slot. When a `storageKey` is active on the parent
12
+ * `GTreeMenu` and a stored value exists for this item's `label`, the
13
+ * stored value takes precedence over this prop and subsequent prop
14
+ * updates are ignored for that item.
15
+ * @demo
16
+ */
17
+ expanded?: boolean;
18
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
+ expand: () => any;
20
+ collapse: () => any;
21
+ }, string, import("vue").PublicProps, Readonly<{
22
+ /**
23
+ * Accessible label used for the toggle button's aria-label when the
24
+ * item has children (e.g. "Chapter 1" → "Chapter 1 sub-menu").
25
+ */
26
+ label?: string;
27
+ /**
28
+ * Whether the item starts expanded. Only meaningful for items that
29
+ * have a `#children` slot. When a `storageKey` is active on the parent
30
+ * `GTreeMenu` and a stored value exists for this item's `label`, the
31
+ * stored value takes precedence over this prop and subsequent prop
32
+ * updates are ignored for that item.
33
+ * @demo
34
+ */
35
+ expanded?: boolean;
36
+ }> & Readonly<{
37
+ onExpand?: (() => any) | undefined;
38
+ onCollapse?: (() => any) | undefined;
39
+ }>, {
40
+ expanded: boolean;
41
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
42
+ default?: (props: {}) => any;
43
+ } & {
44
+ default?: (props: {}) => any;
45
+ } & {
46
+ children?: (props: {}) => any;
47
+ }>;
48
+ type __VLS_WithSlots<T, S> = T & {
49
+ new (): {
50
+ $slots: S;
51
+ };
52
+ };
@@ -1,23 +1,28 @@
1
- export type TreeMenuItem = {
2
- label: string;
3
- href?: string;
4
- to?: string;
5
- children?: TreeMenuItem[];
6
- };
1
+ /**
2
+ * List wrapper for `GTreeMenuItem` items inside a `GTreeMenu`.
3
+ * Renders as `<ul>` or `<ol>` depending on the `listType` prop.
4
+ * When no `listType` is specified the value provided by the parent
5
+ * `GTreeMenu` (via provide/inject) is used, falling back to `ul`.
6
+ */
7
7
  declare const _default: typeof __VLS_export;
8
8
  export default _default;
9
- declare const __VLS_export: import("vue").DefineComponent<{
10
- items: TreeMenuItem[];
11
- listType: "ul" | "ol";
12
- expandedItems: Set<string>;
13
- keyPrefix: string;
14
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
- toggle: (key: string) => any;
16
- }, string, import("vue").PublicProps, Readonly<{
17
- items: TreeMenuItem[];
9
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
10
+ /**
11
+ * List element type (`ul` or `ol`).
12
+ */
13
+ listType?: "ul" | "ol";
14
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
15
+ /**
16
+ * List element type (`ul` or `ol`).
17
+ */
18
+ listType?: "ul" | "ol";
19
+ }> & Readonly<{}>, {
18
20
  listType: "ul" | "ol";
19
- expandedItems: Set<string>;
20
- keyPrefix: string;
21
- }> & Readonly<{
22
- onToggle?: ((key: string) => any) | undefined;
23
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
22
+ default?: (props: {}) => any;
23
+ }>;
24
+ type __VLS_WithSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };