@illinois-grad/grad-vue 2.5.5 → 3.0.1

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.
package/README.md CHANGED
@@ -131,7 +131,7 @@ The project uses Vitest 4 for unit and accessibility testing in **browser mode**
131
131
  npm test
132
132
 
133
133
  # Run tests once
134
- npm run test:run
134
+ npm run test:report
135
135
  ```
136
136
 
137
137
  ### Building
@@ -1869,12 +1869,12 @@
1869
1869
  "members": [
1870
1870
  {
1871
1871
  "kind": "field",
1872
- "name": "title",
1872
+ "name": "heading",
1873
1873
  "type": {
1874
1874
  "text": "string"
1875
1875
  },
1876
1876
  "optional": true,
1877
- "description": "Title and accessible name"
1877
+ "description": "Heading and accessible name"
1878
1878
  },
1879
1879
  {
1880
1880
  "kind": "field",
@@ -2348,12 +2348,12 @@
2348
2348
  "members": [
2349
2349
  {
2350
2350
  "kind": "field",
2351
- "name": "title",
2351
+ "name": "heading",
2352
2352
  "type": {
2353
2353
  "text": "string"
2354
2354
  },
2355
2355
  "optional": true,
2356
- "description": "Title for the popover.",
2356
+ "description": "Heading for the popover.",
2357
2357
  "default": "\"Period Selection\""
2358
2358
  },
2359
2359
  {
@@ -2833,21 +2833,12 @@
2833
2833
  "members": [
2834
2834
  {
2835
2835
  "kind": "field",
2836
- "name": "title",
2836
+ "name": "heading",
2837
2837
  "type": {
2838
2838
  "text": "string"
2839
2839
  },
2840
2840
  "optional": true,
2841
- "description": "Title and accessible name for the nav landmark"
2842
- },
2843
- {
2844
- "kind": "field",
2845
- "name": "items",
2846
- "type": {
2847
- "text": "TreeMenuItem[]"
2848
- },
2849
- "optional": false,
2850
- "description": "Items for the menu"
2841
+ "description": "Heading and accessible name for the nav landmark"
2851
2842
  },
2852
2843
  {
2853
2844
  "kind": "field",
@@ -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",
@@ -70,10 +70,10 @@ declare const _default: typeof __VLS_export;
70
70
  export default _default;
71
71
  declare const __VLS_export: import("vue").DefineComponent<{
72
72
  /**
73
- * Title and accessible name
73
+ * Heading and accessible name
74
74
  * @demo Sidebar Menu
75
75
  */
76
- title?: string;
76
+ heading?: string;
77
77
  /**
78
78
  * Items for the menu
79
79
  */
@@ -106,10 +106,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
106
106
  "update:modelValue": (value: string | null) => any;
107
107
  }, string, import("vue").PublicProps, Readonly<{
108
108
  /**
109
- * Title and accessible name
109
+ * Heading and accessible name
110
110
  * @demo Sidebar Menu
111
111
  */
112
- title?: string;
112
+ heading?: string;
113
113
  /**
114
114
  * Items for the menu
115
115
  */
@@ -6,10 +6,10 @@ declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: import("vue").DefineComponent<{
8
8
  /**
9
- * Title for the popover.
9
+ * Heading for the popover.
10
10
  * @demo Period Selection
11
11
  */
12
- title?: string;
12
+ heading?: string;
13
13
  /**
14
14
  * Label for year select.
15
15
  * @demo Select Year
@@ -40,10 +40,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
40
40
  }) => any;
41
41
  }, string, import("vue").PublicProps, Readonly<{
42
42
  /**
43
- * Title for the popover.
43
+ * Heading for the popover.
44
44
  * @demo Period Selection
45
45
  */
46
- title?: string;
46
+ heading?: string;
47
47
  /**
48
48
  * Label for year select.
49
49
  * @demo Select Year
@@ -73,7 +73,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
73
73
  name: string;
74
74
  }) => any) | undefined;
75
75
  }>, {
76
- title: string;
76
+ heading: string;
77
77
  termYears: string[];
78
78
  termNames: string[];
79
79
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -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 heading="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
- * - `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).
26
+ * - `heading` - optional heading and accessible name for the nav landmark.
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
- * Title and accessible name for the nav landmark
48
+ * Heading and accessible name for the nav landmark
32
49
  * @demo Tree Menu
33
50
  */
34
- title?: string;
51
+ heading?: 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,18 +59,20 @@ declare const __VLS_export: import("vue").DefineComponent<{
46
59
  * @demo
47
60
  */
48
61
  theme?: "light" | "dark";
49
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
50
62
  /**
51
- * Title and accessible name for the nav landmark
52
- * @demo Tree Menu
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.
53
66
  */
54
- title?: string;
67
+ storageKey?: string;
68
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
55
69
  /**
56
- * Items for the menu
70
+ * Heading and accessible name for the nav landmark
71
+ * @demo Tree Menu
57
72
  */
58
- items: TreeMenuItem[];
73
+ heading?: string;
59
74
  /**
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
+ };