kempo-ui 0.0.3 → 0.0.5

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.
Files changed (193) hide show
  1. package/.github/workflows/publish-major.yml +39 -0
  2. package/.github/workflows/publish-minor.yml +39 -0
  3. package/.github/workflows/{publish-npm.yml → publish-patch.yml} +1 -1
  4. package/.vscode/settings.json +2 -0
  5. package/dist/kempo-hljs.css +1 -0
  6. package/dist/src/components/Accordion.js +36 -0
  7. package/dist/src/components/Card.js +37 -0
  8. package/dist/src/components/Collapsible.js +41 -0
  9. package/dist/src/components/ContentSlider.js +44 -0
  10. package/dist/src/components/Dialog.js +120 -0
  11. package/dist/src/components/Icon.js +2 -2
  12. package/dist/src/components/PersistantCollapsible.js +1 -0
  13. package/dist/src/components/PhotoViewer.js +135 -0
  14. package/dist/src/components/Resize.js +96 -0
  15. package/dist/src/components/ShadowComponent.js +1 -1
  16. package/dist/src/components/ShowMore.js +42 -0
  17. package/dist/src/components/SideMenu.js +1 -1
  18. package/dist/src/components/Sortable.js +45 -0
  19. package/dist/src/components/Split.js +84 -0
  20. package/dist/src/components/Table.js +151 -0
  21. package/dist/src/components/Tabs.js +155 -0
  22. package/dist/src/components/Tags.js +69 -0
  23. package/dist/src/components/ThemeSwitcher.js +23 -0
  24. package/dist/src/components/Timestamp.js +1 -0
  25. package/dist/src/components/Toast.js +141 -0
  26. package/dist/src/components/Toggle.js +74 -0
  27. package/dist/src/components/tableControls/DeleteRecord.js +7 -0
  28. package/dist/src/components/tableControls/Edit.js +18 -0
  29. package/dist/src/components/tableControls/ExportCSV.js +8 -0
  30. package/dist/src/components/tableControls/ExportJson.js +8 -0
  31. package/dist/src/components/tableControls/FieldSortHide.js +26 -0
  32. package/dist/src/components/tableControls/Filters.js +47 -0
  33. package/dist/src/components/tableControls/FirstPage.js +9 -0
  34. package/dist/src/components/tableControls/HiddenCount.js +3 -0
  35. package/dist/src/components/tableControls/Hide.js +5 -0
  36. package/dist/src/components/tableControls/LastPage.js +9 -0
  37. package/dist/src/components/tableControls/NextPage.js +9 -0
  38. package/dist/src/components/tableControls/PageSelect.js +22 -0
  39. package/dist/src/components/tableControls/PageSize.js +5 -0
  40. package/dist/src/components/tableControls/PrevPage.js +9 -0
  41. package/dist/src/components/tableControls/Search.js +9 -0
  42. package/dist/src/components/tableControls/ShowAll.js +5 -0
  43. package/dist/src/components/tableControls/TableControl.js +16 -0
  44. package/dist/src/utils/debounce.js +1 -0
  45. package/dist/src/utils/drag.js +1 -0
  46. package/dist/src/utils/formatTimestamp.js +1 -0
  47. package/dist/src/utils/propConverters.js +1 -0
  48. package/dist/src/utils/toTitleCase.js +1 -0
  49. package/dist/src/utils/watchWindowSize.js +1 -0
  50. package/docs/components/accordion.html +69 -25
  51. package/docs/components/card.html +6 -5
  52. package/docs/components/collapsible.html +198 -0
  53. package/docs/components/content-slider.html +56 -26
  54. package/docs/components/dialog.html +54 -48
  55. package/docs/components/focus-capture.html +59 -15
  56. package/docs/components/hybrid-component.html +112 -0
  57. package/docs/components/icon.html +5 -10
  58. package/docs/components/import.html +1 -6
  59. package/docs/components/light-component.html +99 -0
  60. package/docs/components/persistant-collapsible.html +123 -0
  61. package/docs/components/photo-viewer.html +226 -0
  62. package/docs/components/resize.html +44 -18
  63. package/docs/components/shadow-component.html +88 -0
  64. package/docs/components/show-more.html +12 -6
  65. package/docs/components/side-menu.html +3 -12
  66. package/docs/components/sortable.html +91 -55
  67. package/docs/components/split.html +26 -5
  68. package/docs/components/tablePagination.html +4 -4
  69. package/docs/components/tableRecordFiltering.html +16 -3
  70. package/docs/components/tableRecordSelection.html +2 -2
  71. package/docs/components/tabs.html +24 -7
  72. package/docs/components/tags.html +24 -8
  73. package/docs/components/theme-switcher.html +3 -6
  74. package/docs/components/timestamp.html +20 -24
  75. package/docs/components/toast.html +23 -32
  76. package/docs/components/toggle.html +4 -3
  77. package/docs/icons/error.svg +1 -1
  78. package/docs/icons/warning.svg +1 -1
  79. package/docs/index.html +197 -5
  80. package/docs/kempo-hljs.css +1 -0
  81. package/docs/kempo.min.css +1 -1
  82. package/docs/media/civic.jpg +0 -0
  83. package/docs/media/corvette.jpg +0 -0
  84. package/docs/media/evo.jpg +0 -0
  85. package/docs/media/gtr.jpg +0 -0
  86. package/docs/media/nsx.jpg +0 -0
  87. package/docs/nav.inc.html +19 -24
  88. package/docs/src/components/Accordion.js +36 -0
  89. package/docs/src/components/Card.js +37 -0
  90. package/docs/src/components/Collapsible.js +41 -0
  91. package/docs/src/components/ContentSlider.js +44 -0
  92. package/docs/src/components/Dialog.js +120 -0
  93. package/docs/src/components/Icon.js +2 -2
  94. package/docs/src/components/PersistantCollapsible.js +1 -0
  95. package/docs/src/components/PhotoViewer.js +135 -0
  96. package/docs/src/components/Resize.js +96 -0
  97. package/docs/src/components/ShadowComponent.js +1 -1
  98. package/docs/src/components/ShowMore.js +42 -0
  99. package/docs/src/components/SideMenu.js +1 -1
  100. package/docs/src/components/Sortable.js +45 -0
  101. package/docs/src/components/Split.js +84 -0
  102. package/docs/src/components/Table.js +151 -0
  103. package/docs/src/components/Tabs.js +155 -0
  104. package/docs/src/components/Tags.js +69 -0
  105. package/docs/src/components/ThemeSwitcher.js +23 -0
  106. package/docs/src/components/Timestamp.js +1 -0
  107. package/docs/src/components/Toast.js +141 -0
  108. package/docs/src/components/Toggle.js +74 -0
  109. package/docs/src/components/tableControls/DeleteRecord.js +7 -0
  110. package/docs/src/components/tableControls/Edit.js +18 -0
  111. package/docs/src/components/tableControls/ExportCSV.js +8 -0
  112. package/docs/src/components/tableControls/ExportJson.js +8 -0
  113. package/docs/src/components/tableControls/FieldSortHide.js +26 -0
  114. package/docs/src/components/tableControls/Filters.js +47 -0
  115. package/docs/src/components/tableControls/FirstPage.js +9 -0
  116. package/docs/src/components/tableControls/HiddenCount.js +3 -0
  117. package/docs/src/components/tableControls/Hide.js +5 -0
  118. package/docs/src/components/tableControls/LastPage.js +9 -0
  119. package/docs/src/components/tableControls/NextPage.js +9 -0
  120. package/docs/src/components/tableControls/PageSelect.js +22 -0
  121. package/docs/src/components/tableControls/PageSize.js +5 -0
  122. package/docs/src/components/tableControls/PrevPage.js +9 -0
  123. package/docs/src/components/tableControls/Search.js +9 -0
  124. package/docs/src/components/tableControls/ShowAll.js +5 -0
  125. package/docs/src/components/tableControls/TableControl.js +16 -0
  126. package/docs/src/utils/debounce.js +1 -0
  127. package/docs/src/utils/drag.js +1 -0
  128. package/docs/src/utils/formatTimestamp.js +1 -0
  129. package/docs/src/utils/propConverters.js +1 -0
  130. package/docs/src/utils/toTitleCase.js +1 -0
  131. package/docs/src/utils/watchWindowSize.js +1 -0
  132. package/docs/utils/debounce.html +78 -0
  133. package/docs/utils/drag.html +89 -0
  134. package/docs/utils/formatTimestamp.html +114 -0
  135. package/docs/utils/propConverters.html +132 -0
  136. package/docs/utils/toTitleCase.html +71 -0
  137. package/docs/utils/watchWindowSize.html +166 -0
  138. package/icons/error.svg +1 -1
  139. package/icons/warning.svg +1 -1
  140. package/package.json +1 -1
  141. package/scripts/build.js +4 -1
  142. package/scripts/docs.js +4 -2
  143. package/src/components/Accordion.js +229 -0
  144. package/src/components/Collapsible.js +109 -0
  145. package/src/components/ContentSlider.js +205 -0
  146. package/src/components/Dialog.js +376 -0
  147. package/src/components/PersistantCollapsible.js +69 -0
  148. package/src/components/PhotoViewer.js +368 -0
  149. package/src/components/Resize.js +210 -0
  150. package/src/components/ShadowComponent.js +3 -1
  151. package/src/components/ShowMore.js +109 -0
  152. package/src/components/Sortable.js +193 -0
  153. package/src/components/Split.js +192 -0
  154. package/src/components/Table.js +1202 -0
  155. package/src/components/Tabs.js +428 -0
  156. package/src/components/Tags.js +253 -0
  157. package/src/components/Timestamp.js +31 -0
  158. package/src/components/Toast.js +454 -0
  159. package/src/components/Toggle.js +173 -0
  160. package/src/components/tableControls/DeleteRecord.js +29 -0
  161. package/src/components/tableControls/Edit.js +88 -0
  162. package/src/components/tableControls/ExportCSV.js +71 -0
  163. package/src/components/tableControls/ExportJson.js +55 -0
  164. package/src/components/tableControls/FieldSortHide.js +76 -0
  165. package/src/components/tableControls/Filters.js +114 -0
  166. package/src/components/tableControls/FirstPage.js +65 -0
  167. package/src/components/tableControls/HiddenCount.js +45 -0
  168. package/src/components/tableControls/Hide.js +34 -0
  169. package/src/components/tableControls/LastPage.js +65 -0
  170. package/src/components/tableControls/NextPage.js +65 -0
  171. package/src/components/tableControls/PageSelect.js +109 -0
  172. package/src/components/tableControls/PageSize.js +68 -0
  173. package/src/components/tableControls/PrevPage.js +65 -0
  174. package/src/components/tableControls/Search.js +58 -0
  175. package/src/components/tableControls/ShowAll.js +34 -0
  176. package/src/components/tableControls/TableControl.js +105 -0
  177. package/src/utils/debounce.js +9 -0
  178. package/src/utils/drag.js +80 -0
  179. package/src/utils/formatTimestamp.js +27 -0
  180. package/src/utils/toTitleCase.js +9 -0
  181. package/src/utils/watchWindowSize.js +16 -0
  182. package/dist/src/utils/cli.js +0 -1
  183. package/dist/src/utils/fs-utils.js +0 -1
  184. package/docs/components/component.html +0 -90
  185. package/docs/components/directory-viewer.html +0 -90
  186. package/docs/components/lazy-component.html +0 -84
  187. package/docs/components/reactive-component.html +0 -69
  188. package/docs/components/reactive-lazy-component.html +0 -69
  189. package/docs/components/search.html +0 -102
  190. package/docs/src/utils/cli.js +0 -1
  191. package/docs/src/utils/fs-utils.js +0 -1
  192. package/src/utils/cli.js +0 -43
  193. package/src/utils/fs-utils.js +0 -41
@@ -7,8 +7,10 @@
7
7
  <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
8
  <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
9
9
  <script type="module">
10
+ import ShadowComponent from '../src/components/ShadowComponent.js';
10
11
  import Import from '../src/components/Import.js';
11
12
  import Icon from '../src/components/Icon.js';
13
+ ShadowComponent.stylesheetPath = '../kempo.min.css';
12
14
  Import.replacements.root = '../';
13
15
  Icon.pathToIcons = ['../icons'];
14
16
  </script>
@@ -28,9 +30,9 @@
28
30
  <h6 class="mt">JavaScript Reference</h6>
29
31
  <a href="#constructor">Constructor</a><br />
30
32
  <a href="#requirements">Requirements</a><br />
31
- <a href="#attributes">Attributes</a><br />
32
33
  <a href="#properties">Properties</a><br />
33
34
  <a href="#methods">Methods</a><br />
35
+ <a href="#events">Events</a><br />
34
36
  </div>
35
37
  </details>
36
38
 
@@ -79,43 +81,85 @@
79
81
  <h2 id="jsRef">JavaScript Reference</h2>
80
82
 
81
83
  <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
82
- <h6>Extends <a href="./component.html">Component</a></h6>
84
+ <h6>Extends <a href="./component.html">ShadowComponent</a></h6>
83
85
  <h5>
84
86
  <code>new Accordion()</code><br />
85
87
  </h5>
86
88
 
87
89
  <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
88
90
  <ul>
89
- <li><a href="../utils/element.html">utils/element.js</a></li>
91
+ <li><a href="./component.html">ShadowComponent</a></li>
90
92
  </ul>
91
93
 
92
- <h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
93
- <h5><code>forPanel: string</code></h5>
94
- <p>Specifies the panel associated with the header.</p>
95
- <h5><code>active: boolean</code></h5>
96
- <p>Indicates whether the panel or header is active.</p>
97
- <h5><code>transitioning: boolean</code></h5>
98
- <p>Indicates whether the panel is in the process of transitioning.</p>
99
-
100
94
  <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
101
- <h5><code>activeHeader: HTMLElement</code></h5>
102
- <p>Returns the currently active header element.</p>
103
- <h5><code>activePanel: HTMLElement</code></h5>
104
- <p>Returns the currently active panel element.</p>
95
+
96
+ <h4>Accordion (Main Component)</h4>
97
+ <h5><code>activeHeader<i>: HTMLElement | null</i></code></h5>
98
+ <p>Returns the currently active header element, or <code>null</code> if no panel is open.</p>
99
+ <h5><code>activePanel<i>: HTMLElement | null</i></code></h5>
100
+ <p>Returns the currently active panel element, or <code>null</code> if no panel is open.</p>
101
+
102
+ <h4>AccordionHeader</h4>
103
+ <h5><code>forPanel<i>: string</i></code></h5>
104
+ <p>The panel name that this header controls. Syncs with the <code>for-panel</code> attribute.</p>
105
+ <h5><code>active<i>: boolean</i></code></h5>
106
+ <p>Whether this header is currently active (its associated panel is open). Syncs with the <code>active</code> attribute.</p>
107
+ <h5><code>accordion<i>: Accordion | null</i></code></h5>
108
+ <p>Returns the parent accordion component, or <code>null</code> if not inside an accordion.</p>
109
+
110
+ <h4>AccordionPanel</h4>
111
+ <h5><code>name<i>: string</i></code></h5>
112
+ <p>Unique identifier for this panel. Must match the <code>for-panel</code> attribute of its associated header. Syncs with the <code>name</code> attribute.</p>
113
+ <h5><code>active<i>: boolean</i></code></h5>
114
+ <p>Whether this panel is currently open. Syncs with the <code>active</code> attribute.</p>
115
+ <h5><code>transitioning<i>: boolean</i></code></h5>
116
+ <p>Whether this panel is currently animating (opening or closing). Syncs with the <code>transitioning</code> attribute.</p>
117
+ <h5><code>accordion<i>: Accordion | null</i></code></h5>
118
+ <p>Returns the parent accordion component, or <code>null</code> if not inside an accordion.</p>
105
119
 
106
120
  <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
107
- <h5><code>getHeader(panelName: string): HTMLElement</code></h5>
108
- <p>Returns the header element associated with the specified panel name.</p>
109
- <h5><code>getPanel(panelName: string): HTMLElement</code></h5>
110
- <p>Returns the panel element associated with the specified panel name.</p>
111
- <h5><code>openPanel(panelName: string): void</code></h5>
112
- <p>Opens the panel associated with the specified panel name.</p>
113
- <h5><code>closePanel(panelName: string): void</code></h5>
114
- <p>Closes the panel associated with the specified panel name.</p>
115
- <h5><code>togglePanel(panelName: string): void</code></h5>
116
- <p>Toggles the panel associated with the specified panel name.</p>
121
+
122
+ <h4>Accordion (Main Component)</h4>
123
+ <h5><code>getHeader(panelName)<i>: HTMLElement | null</i></code></h5>
124
+ <p>Returns the header element associated with the specified panel name, or <code>null</code> if not found.</p>
125
+ <ul>
126
+ <li><strong>panelName</strong> <code>string</code> - The name of the panel whose header to retrieve</li>
127
+ </ul>
128
+
129
+ <h5><code>getPanel(panelName)<i>: HTMLElement | null</i></code></h5>
130
+ <p>Returns the panel element with the specified name, or <code>null</code> if not found.</p>
131
+ <ul>
132
+ <li><strong>panelName</strong> <code>string</code> - The name of the panel to retrieve</li>
133
+ </ul>
134
+
135
+ <h5><code>openPanel(panelName)<i>: void</i></code></h5>
136
+ <p>Opens the panel with the specified name. Closes any currently open panel first. Dispatches an <code>openpanel</code> event.</p>
137
+ <ul>
138
+ <li><strong>panelName</strong> <code>string</code> - The name of the panel to open</li>
139
+ </ul>
140
+
141
+ <h5><code>closePanel(panelName)<i>: void</i></code></h5>
142
+ <p>Closes the panel with the specified name. Dispatches a <code>closepanel</code> event.</p>
143
+ <ul>
144
+ <li><strong>panelName</strong> <code>string</code> - The name of the panel to close</li>
145
+ </ul>
146
+
147
+ <h5><code>togglePanel(panelName)<i>: void</i></code></h5>
148
+ <p>Toggles the panel with the specified name (opens if closed, closes if open). Dispatches a <code>togglepanel</code> event.</p>
149
+ <ul>
150
+ <li><strong>panelName</strong> <code>string</code> - The name of the panel to toggle</li>
151
+ </ul>
152
+
153
+ <h3 id="events"><a href="#events" class="no-link">Events</a></h3>
154
+ <h5><code>openpanel</code></h5>
155
+ <p>Fired when a panel is opened. The event detail contains <code>{ panelName }</code>.</p>
156
+ <h5><code>closepanel</code></h5>
157
+ <p>Fired when a panel is closed. The event detail contains <code>{ panelName }</code>.</p>
158
+ <h5><code>togglepanel</code></h5>
159
+ <p>Fired when a panel is toggled. The event detail contains <code>{ panelName }</code>.</p>
117
160
 
118
161
  </main>
162
+ <div style="height:33vh"></div>
119
163
  <script type="module" src="../src/components/Import.js"></script>
120
164
  <script type="module" src="../src/components/Accordion.js"></script>
121
165
  </body>
@@ -7,8 +7,10 @@
7
7
  <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
8
  <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
9
9
  <script type="module">
10
+ import ShadowComponent from '../src/components/ShadowComponent.js';
10
11
  import Import from '../src/components/Import.js';
11
12
  import Icon from '../src/components/Icon.js';
13
+ ShadowComponent.stylesheetPath = '../kempo.min.css';
12
14
  Import.replacements.root = '../';
13
15
  Icon.pathToIcons = ['../icons'];
14
16
  </script>
@@ -26,7 +28,6 @@
26
28
  <h6 class="mt">JavaScript Reference</h6>
27
29
  <a href="#constructor">Constructor</a><br />
28
30
  <a href="#requirements">Requirements</a><br />
29
- <a href="#attributes">Attributes</a><br />
30
31
  <a href="#properties">Properties</a><br />
31
32
  <a href="#methods">Methods</a><br />
32
33
  </div>
@@ -60,7 +61,7 @@
60
61
  <h2 id="jsRef">JavaScript Reference</h2>
61
62
 
62
63
  <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
63
- <h6>Extends <a href="./component.html">Component</a></h6>
64
+ <h6>Extends <a href="./shadow-component.html">ShadowComponent</a></h6>
64
65
  <h5>
65
66
  <code>new Card()</code><br />
66
67
  <code>new Card(<i>string</i> label)</code>
@@ -72,12 +73,12 @@
72
73
 
73
74
  <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
74
75
  <ul>
75
- <li><a href="./component.html">Component</a></li>
76
+ <li><a href="./shadow-component.html">ShadowComponent</a></li>
76
77
  </ul>
77
78
 
78
- <h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
79
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
79
80
  <h5><code>label<i>: string</i></code></h5>
80
- <p>The label for the card.</p>
81
+ <p>The label for the card. Syncs with the <code>label</code> attribute.</p>
81
82
 
82
83
  <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
83
84
  <h5><code>setLabel(<i>string</i> label)<i>: void</i></code></h5>
@@ -0,0 +1,198 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Collapsible - Components - Kempo Docs - A Web Components Solution</title>
7
+ <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
+ <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
9
+ <script type="module">
10
+ import ShadowComponent from '../src/components/ShadowComponent.js';
11
+ import Import from '../src/components/Import.js';
12
+ import Icon from '../src/components/Icon.js';
13
+ ShadowComponent.stylesheetPath = '../kempo.min.css';
14
+ Import.replacements.root = '../';
15
+ Icon.pathToIcons = ['../icons'];
16
+ </script>
17
+ </head>
18
+ <body>
19
+ <k-import src="../nav.inc.html"></k-import>
20
+ <h1 class="ta-center">Collapsible</h1>
21
+ <main>
22
+ <details class="b r mb">
23
+ <summary class="p">Table of Contents</summary>
24
+ <div class="m mt0 pl">
25
+ <h6>Examples</h6>
26
+ <a href="#basicUsage">Basic Usage</a><br />
27
+ <a href="#defaultOpen">Default Open</a><br />
28
+ <a href="#customLabel">Custom Label</a><br />
29
+ <a href="#customIcon">Custom Icon</a><br />
30
+
31
+ <h6 class="mt">JavaScript Reference</h6>
32
+ <a href="#constructor">Constructor</a><br />
33
+ <a href="#requirements">Requirements</a><br />
34
+ <a href="#properties">Properties</a><br />
35
+ <a href="#methods">Methods</a><br />
36
+ <a href="#events">Events</a><br />
37
+ <a href="#slots">Slots</a><br />
38
+ </div>
39
+ </details>
40
+
41
+ <h3>Description</h3>
42
+ <p>The Collapsible component provides a way to show/hide content with a clickable label header. It features a rotating chevron icon and smooth transitions. The component extends the <a href="./component.html">ShadowComponent</a> class and supports customizable labels and icons through slots.</p>
43
+
44
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
45
+ <p>Use the collapsible component to create expandable content sections. Click the label to toggle the content visibility.</p>
46
+
47
+ <div class="row -mx mb">
48
+ <div class="col d-span-6 m-span-12 px">
49
+ <k-card label="HTML">
50
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-collapsible</span>&gt;</span>
51
+ <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"label"</span>&gt;</span>Click to expand<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
52
+ <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>This content can be collapsed or expanded.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
53
+ <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Add any content here that you want to show/hide.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
54
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-collapsible</span>&gt;</span></code></pre>
55
+ </k-card>
56
+ </div>
57
+ <div class="col d-span-6 m-span-12 px">
58
+ <k-card label="Output">
59
+ <k-collapsible>
60
+ <span slot="label">Click to expand</span>
61
+ <p>This content can be collapsed or expanded.</p>
62
+ <p>Add any content here that you want to show/hide.</p>
63
+ </k-collapsible>
64
+ </k-card>
65
+ </div>
66
+ </div>
67
+
68
+ <h3 id="defaultOpen"><a href="#defaultOpen" class="no-link">Default Open</a></h3>
69
+ <p>Set the <code>opened</code> attribute to have the collapsible start in an expanded state.</p>
70
+
71
+ <div class="row -mx mb">
72
+ <div class="col d-span-6 m-span-12 px">
73
+ <k-card label="HTML">
74
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-collapsible</span> <span class="hljs-attr">opened</span>=<span class="hljs-string">"true"</span>&gt;</span>
75
+ <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"label"</span>&gt;</span>Already expanded<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
76
+ <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>This collapsible starts in an open state.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
77
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-collapsible</span>&gt;</span></code></pre>
78
+ </k-card>
79
+ </div>
80
+ <div class="col d-span-6 m-span-12 px">
81
+ <k-card label="Output">
82
+ <k-collapsible opened="true">
83
+ <span slot="label">Already expanded</span>
84
+ <p>This collapsible starts in an open state.</p>
85
+ </k-collapsible>
86
+ </k-card>
87
+ </div>
88
+ </div>
89
+
90
+ <h3 id="customLabel"><a href="#customLabel" class="no-link">Custom Label</a></h3>
91
+ <p>You can put any content in the label slot, including formatted text, icons, or even other components.</p>
92
+
93
+ <div class="row -mx mb">
94
+ <div class="col d-span-6 m-span-12 px">
95
+ <k-card label="HTML">
96
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-collapsible</span>&gt;</span>
97
+ <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"label"</span>&gt;</span>
98
+ <span class="hljs-tag">&lt;<span class="hljs-name">strong</span>&gt;</span>Advanced Settings<span class="hljs-tag">&lt;/<span class="hljs-name">strong</span>&gt;</span>
99
+ <span class="hljs-tag">&lt;<span class="hljs-name">small</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"opacity-50 ml"</span>&gt;</span>(Optional)<span class="hljs-tag">&lt;/<span class="hljs-name">small</span>&gt;</span>
100
+ <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
101
+ <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Configure advanced options here.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
102
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-collapsible</span>&gt;</span></code></pre>
103
+ </k-card>
104
+ </div>
105
+ <div class="col d-span-6 m-span-12 px">
106
+ <k-card label="Output">
107
+ <k-collapsible>
108
+ <div slot="label">
109
+ <strong>Advanced Settings</strong>
110
+ <small class="opacity-50 ml">(Optional)</small>
111
+ </div>
112
+ <p>Configure advanced options here.</p>
113
+ </k-collapsible>
114
+ </k-card>
115
+ </div>
116
+ </div>
117
+
118
+ <h3 id="customIcon"><a href="#customIcon" class="no-link">Custom Icon</a></h3>
119
+ <p>Replace the default chevron icon with your own content using the <code>labelIcon</code> slot.</p>
120
+
121
+ <div class="row -mx mb">
122
+ <div class="col d-span-6 m-span-12 px">
123
+ <k-card label="HTML">
124
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-collapsible</span>&gt;</span>
125
+ <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"label"</span>&gt;</span>Custom Icon<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
126
+ <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"labelIcon"</span>&gt;</span>▼<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
127
+ <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Using a custom arrow icon.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
128
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-collapsible</span>&gt;</span></code></pre>
129
+ </k-card>
130
+ </div>
131
+ <div class="col d-span-6 m-span-12 px">
132
+ <k-card label="Output">
133
+ <k-collapsible>
134
+ <span slot="label">Custom Icon</span>
135
+ <span slot="labelIcon">▼</span>
136
+ <p>Using a custom arrow icon.</p>
137
+ </k-collapsible>
138
+ </k-card>
139
+ </div>
140
+ </div>
141
+
142
+ <h2 id="jsRef">JavaScript Reference</h2>
143
+
144
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
145
+ <h6>Extends <a href="./component.html">ShadowComponent</a></h6>
146
+ <h5>
147
+ <code>new Collapsible()</code>
148
+ </h5>
149
+
150
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
151
+ <ul>
152
+ <li><a href="./component.html">ShadowComponent</a></li>
153
+ <li><a href="./icon.html">Icon</a></li>
154
+ </ul>
155
+
156
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
157
+ <h5><code>opened<i>: boolean</i></code></h5>
158
+ <p>Gets or sets whether the collapsible is currently expanded. Changing this property will trigger the appropriate events and visual state changes. Syncs to <code>opened</code> attribute. Default value is <code>false</code>.</p>
159
+
160
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
161
+ <h5><code>open()<i>: void</i></code></h5>
162
+ <p>Expands the collapsible to show its content. Sets <code>opened</code> to <code>true</code>.</p>
163
+
164
+ <h5><code>close()<i>: void</i></code></h5>
165
+ <p>Collapses the collapsible to hide its content. Sets <code>opened</code> to <code>false</code>.</p>
166
+
167
+ <h5><code>toggle()<i>: void</i></code></h5>
168
+ <p>Toggles the collapsible state (expands if collapsed, collapses if expanded). Dispatches an <code>openedtoggled</code> event.</p>
169
+
170
+ <h3 id="events"><a href="#events" class="no-link">Events</a></h3>
171
+ <h5><code>openedchanged</code></h5>
172
+ <p>Fired when the opened state changes. The event detail contains the string <code>"open"</code> or <code>"close"</code>.</p>
173
+
174
+ <h5><code>open</code></h5>
175
+ <p>Fired when the collapsible is expanded.</p>
176
+
177
+ <h5><code>close</code></h5>
178
+ <p>Fired when the collapsible is collapsed.</p>
179
+
180
+ <h5><code>openedtoggled</code></h5>
181
+ <p>Fired when the <code>toggle()</code> method is called (typically when the label is clicked).</p>
182
+
183
+ <h3 id="slots"><a href="#slots" class="no-link">Slots</a></h3>
184
+ <h5><code>Default Slot</code></h5>
185
+ <p>The main content area that can be collapsed or expanded.</p>
186
+
187
+ <h5><code>label</code></h5>
188
+ <p>The clickable label content. This is what users click to toggle the collapsible state.</p>
189
+
190
+ <h5><code>labelIcon</code></h5>
191
+ <p>Custom content for the toggle icon. Defaults to a right-pointing chevron that rotates when expanded. The icon automatically gets hover effects and rotation animations.</p>
192
+
193
+ </main>
194
+ <div style="height:33vh"></div>
195
+ <script type="module" src="../src/components/Import.js"></script>
196
+ <script type="module" src="../src/components/Collapsible.js"></script>
197
+ </body>
198
+ </html>
@@ -7,8 +7,10 @@
7
7
  <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
8
  <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
9
9
  <script type="module">
10
+ import ShadowComponent from '../src/components/ShadowComponent.js';
10
11
  import Import from '../src/components/Import.js';
11
12
  import Icon from '../src/components/Icon.js';
13
+ ShadowComponent.stylesheetPath = '../kempo.min.css';
12
14
  Import.replacements.root = '../';
13
15
  Icon.pathToIcons = ['../icons'];
14
16
  </script>
@@ -31,14 +33,15 @@
31
33
  <h6 class="mt">JavaScript Reference</h6>
32
34
  <a href="#constructor">Constructor</a><br />
33
35
  <a href="#requirements">Requirements</a><br />
34
- <a href="#attributes">Attributes</a><br />
35
36
  <a href="#properties">Properties</a><br />
36
37
  <a href="#methods">Methods</a><br />
38
+ <a href="#events">Events</a><br />
39
+ <a href="#slots">Slots</a><br />
37
40
  </div>
38
41
  </details>
39
42
 
40
43
  <h3>Description</h3>
41
- <p>description</p>
44
+ <p>The ContentSlider component provides a way to display multiple content slides with navigation controls. Users can navigate through slides using previous/next buttons, keyboard arrows, or programmatically. It extends the <a href="./component.html">ShadowComponent</a> class and supports looping, keyboard controls, and customizable navigation.</p>
42
45
 
43
46
  <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
44
47
  <div class="row -mx">
@@ -141,50 +144,77 @@
141
144
  <h2 id="jsRef">JavaScript Refrerence</h2>
142
145
 
143
146
  <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
144
- <h6>Extends <a href="./lazy-component.html">LazyComponent</a></h6>
147
+ <h6>Extends <a href="./component.html">ShadowComponent</a></h6>
145
148
  <h5>
146
- <code>new ContentSlider()</code><br />
147
- <code>new ContentSlider(<i>&lt;Array>HTMLElement</i> content)</code><br/>
148
- <code>new ContentSlider(<i>&lt;Array>HTMLElement</i> content, <i>Object</i> init_attrs)</code>
149
+ <code>new ContentSlider()</code>
149
150
  </h5>
150
151
 
151
- <h4>Paramters</h4>
152
- <h5><code>content<i>: &lt;Array>HTMLElement></i></code></h5>
153
- <p>An array of <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement" target="_blank">HTMLElement</a>s that will be the contents of this slider.</p>
154
- <h5><code>init_attrs<i>: Object</i></code></h5>
155
- <p>An options object that may contain the initial values of the attributes (see attributes below).</p>
156
-
157
152
  <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
158
153
  <ul>
159
- <li><a href="">LazyComponent Class</a></li>
160
- <li><a href="">elements.js Util</a></li>
154
+ <li><a href="./component.html">ShadowComponent</a></li>
155
+ <li><a href="./icon.html">Icon</a></li>
161
156
  </ul>
162
157
 
163
- <h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
158
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
164
159
  <h5><code>index<i>: number</i></code></h5>
165
- <p>The index of the currently active slide (base <code>0</code>). The default value is <code>0</code>.</p>
160
+ <p>Gets or sets the current slide index. Automatically validates to stay within bounds. Syncs to <code>index</code> attribute. Default value is <code>0</code>.</p>
166
161
 
167
162
  <h5><code>controls<i>: boolean</i></code></h5>
168
- <p>A boolean that indicates if the control buttons should be shown. The default value is <code>true</code>.</p>
163
+ <p>Gets or sets whether control buttons are visible. Syncs to <code>controls</code> attribute. Default value is <code>true</code>.</p>
169
164
 
170
165
  <h5><code>keyboardControls<i>: boolean</i></code></h5>
171
- <p>A boolean that indicates if the left and right arrows should be used to control the slider. The default value is <code>true</code>.</p>
166
+ <p>Gets or sets whether keyboard controls are enabled. Syncs to <code>keyboard-controls</code> attribute. Default value is <code>true</code>.</p>
172
167
 
173
168
  <h5><code>globalControls<i>: boolean</i></code></h5>
174
- <p>A boolean that indicates if the left and right arrows should be used to control the slider even when it is not focused (the listener is on the window). The default value is <code>false</code>.</p>
169
+ <p>Gets or sets whether global keyboard controls are enabled. Use with caution - recommended only for prominent sliders. Syncs to <code>global-controls</code> attribute. Default value is <code>false</code>.</p>
175
170
 
176
171
  <h5><code>loop<i>: boolean</i></code></h5>
177
- <p>A boolean that indicates index should loop. When true, after the last side it will go back to the first, and when on the first slide the previous slide will be the last. The default value is <code>false</code>.</p>
172
+ <p>Gets or sets whether the slider loops continuously (after the last slide, go to the first; before the first slide, go to the last). Syncs to <code>loop</code> attribute. Default value is <code>false</code>.</p>
173
+
174
+ <h5><code>content<i>: Array&lt;HTMLElement&gt;</i></code></h5>
175
+ <p>Array of child elements that serve as slides. Automatically updated when the component is connected.</p>
178
176
 
179
177
  <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
180
- <h5><code>previous()<i>: undefined</i></code></h5>
181
- <p>Goes to the previous slide.</p>
178
+ <h5><code>previous()<i>: void</i></code></h5>
179
+ <p>Navigates to the previous slide. If <code>loop</code> is enabled and currently on the first slide, goes to the last slide. Dispatches a <code>previous</code> event.</p>
182
180
 
183
- <h5><code>next()<i>: undefined</i></code></h5>
184
- <p>Goes to the next slide.</p>
181
+ <h5><code>next()<i>: void</i></code></h5>
182
+ <p>Navigates to the next slide. If <code>loop</code> is enabled and currently on the last slide, goes to the first slide. Dispatches a <code>next</code> event.</p>
183
+
184
+ <h5><code>goto(index)<i>: void</i></code></h5>
185
+ <p>Navigates to the slide at the specified index. Index is automatically validated to stay within bounds. Dispatches a <code>goto</code> event.</p>
186
+ <ul>
187
+ <li><strong>index</strong> <code>number</code> - The zero-based index of the slide to navigate to</li>
188
+ </ul>
189
+
190
+ <h3 id="events"><a href="#events" class="no-link">Events</a></h3>
191
+ <h5><code>change</code></h5>
192
+ <p>Fired when the active slide changes. The event detail contains <code>{ index }</code>.</p>
193
+
194
+ <h5><code>previous</code></h5>
195
+ <p>Fired when the previous button is clicked or previous navigation is triggered. The event detail contains <code>{ index }</code> of the target slide.</p>
196
+
197
+ <h5><code>next</code></h5>
198
+ <p>Fired when the next button is clicked or next navigation is triggered. The event detail contains <code>{ index }</code> of the target slide.</p>
199
+
200
+ <h5><code>goto</code></h5>
201
+ <p>Fired when programmatic navigation to a specific slide occurs. The event detail contains <code>{ index }</code> of the target slide.</p>
202
+
203
+ <h5><code>keyleft</code></h5>
204
+ <p>Fired when the left arrow key is pressed (before triggering previous navigation).</p>
205
+
206
+ <h5><code>keyright</code></h5>
207
+ <p>Fired when the right arrow key is pressed (before triggering next navigation).</p>
208
+
209
+ <h3 id="slots"><a href="#slots" class="no-link">Slots</a></h3>
210
+ <h5><code>Default Slot</code></h5>
211
+ <p>The main content area where slide elements are placed. Each direct child element becomes a slide.</p>
212
+
213
+ <h5><code>prev</code></h5>
214
+ <p>Custom content for the previous button. Defaults to a left chevron icon if not provided.</p>
185
215
 
186
- <h5><code>goto(<i>number<i> index)<i>: undefined</i></code></h5>
187
- <p>Goes to the specified slide. If the index is more than the number of slides the last side will be shown. If the index is below 0, the first slide will be shown.</p>
216
+ <h5><code>next</code></h5>
217
+ <p>Custom content for the next button. Defaults to a right chevron icon if not provided.</p>
188
218
 
189
219
  </main>
190
220
  <script type="module" src="../src/components/Import.js"></script>