@access-ci/ui 0.1.2 → 0.2.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
@@ -17,24 +17,44 @@ Sites using ACCESS user interface components should include the Archivo font fam
17
17
  />
18
18
  ```
19
19
 
20
- ## Menus
20
+ ## Components
21
21
 
22
- The library includes functions for rendering the ACCESS universal navigation menus,
23
- site menus, and footer menus:
22
+ The library includes functions for rendering common ACCESS user interface components:
23
+
24
+ - `universalMenus`: Universal navigation menus
25
+ - `header`: Logo header
26
+ - `siteMenus`: Site-specific navigation menus
27
+ - `tableOfContents`: Page table of contents
28
+ - `footerMenus`: Site-specific navigation menus above the footer
29
+ - `footer`: Universal footer
30
+
31
+ ## Example
24
32
 
25
33
  ```html
26
34
  <div id="universal-menus"></div>
27
- ...
35
+ <div id="header"></div>
28
36
  <div id="site-menus"></div>
29
- ...
37
+ <div id="main" class="container">
38
+ <div id="body">
39
+ <h1>Page Title</h1>
40
+ <h2>First Section</h2>
41
+ <h2>Second Section</h2>
42
+ <h2>Third Section</h2>
43
+ </div>
44
+ <div id="table-of-contents"></div>
45
+ </div>
30
46
  <div id="footer-menus"></div>
47
+ <div id="footer"></div>
31
48
  <script type="module">
32
49
  import {
50
+ footer,
33
51
  footerMenus,
52
+ header,
53
+ siteMenus,
54
+ tableOfContents,
34
55
  universalMenuItems,
35
56
  universalMenus,
36
- siteMenus,
37
- } from "/src/index.js";
57
+ } from "https://esm.sh/@access-ci/ui@0.2.0";
38
58
 
39
59
  const siteItems = [
40
60
  {
@@ -79,15 +99,27 @@ site menus, and footer menus:
79
99
  target: document.getElementById("universal-menus"),
80
100
  });
81
101
 
102
+ header({
103
+ siteName: "Allocations",
104
+ target: document.getElementById("header"),
105
+ });
106
+
82
107
  siteMenus({
83
108
  items: siteItems,
84
109
  siteName: "Allocations",
85
110
  target: document.getElementById("site-menus"),
86
111
  });
87
112
 
113
+ tableOfContents({
114
+ headings: document.querySelectorAll("#body h1, #body h2"),
115
+ target: document.getElementById("table-of-contents"),
116
+ });
117
+
88
118
  footerMenus({
89
119
  items: siteItems,
90
120
  target: document.getElementById("footer-menus"),
91
121
  });
122
+
123
+ footer({ target: document.getElementById("footer") });
92
124
  </script>
93
125
  ```