kempo-ui 0.4.17 → 0.4.19

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 (175) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/Button.js +30 -0
  3. package/dist/components/CodeEditor.js +1 -1
  4. package/dist/components/Combobox.js +4 -3
  5. package/dist/components/ContentSlider.js +1 -1
  6. package/dist/components/HtmlEditor.js +2 -2
  7. package/dist/components/MarkdownEditor.js +3 -3
  8. package/dist/components/Pagination.js +43 -0
  9. package/dist/components/Slider.js +2 -2
  10. package/dist/components/markdownEditorControls/Heading.js +5 -5
  11. package/dist/components/markdownEditorControls/Table.js +2 -2
  12. package/dist/components/paginationControls/FirstPage.js +1 -0
  13. package/dist/components/paginationControls/GotoPage.js +17 -0
  14. package/dist/components/paginationControls/ItemsPerPage.js +15 -0
  15. package/dist/components/paginationControls/LastPage.js +1 -0
  16. package/dist/components/paginationControls/NextPage.js +1 -0
  17. package/dist/components/paginationControls/PageCount.js +1 -0
  18. package/dist/components/paginationControls/PageInfo.js +6 -0
  19. package/dist/components/paginationControls/PaginationButtonControl.js +20 -0
  20. package/dist/components/paginationControls/PaginationControl.js +5 -0
  21. package/dist/components/paginationControls/PrevPage.js +1 -0
  22. package/dist/utils/number.js +1 -0
  23. package/dist/utils/propConverters.js +1 -1
  24. package/docs/components/accordion.html +8 -0
  25. package/docs/components/aside.html +8 -0
  26. package/docs/components/button.html +595 -0
  27. package/docs/components/calendar.html +8 -0
  28. package/docs/components/card.html +8 -0
  29. package/docs/components/chat.html +8 -0
  30. package/docs/components/code-editor.html +8 -0
  31. package/docs/components/color-picker.html +8 -0
  32. package/docs/components/combobox.html +38 -0
  33. package/docs/components/content-slider.html +8 -0
  34. package/docs/components/context.html +8 -0
  35. package/docs/components/dialog.html +8 -0
  36. package/docs/components/dropdown.html +8 -0
  37. package/docs/components/filter-list.html +8 -0
  38. package/docs/components/focus-capture.html +8 -0
  39. package/docs/components/html-editor.html +8 -0
  40. package/docs/components/hybrid-component.html +8 -0
  41. package/docs/components/icon.html +8 -0
  42. package/docs/components/import.html +8 -0
  43. package/docs/components/light-component.html +8 -0
  44. package/docs/components/markdown-editor.html +8 -0
  45. package/docs/components/markdown.html +8 -0
  46. package/docs/components/nav-spacer.html +8 -0
  47. package/docs/components/nav.html +8 -0
  48. package/docs/components/pagination.html +876 -0
  49. package/docs/components/photo-viewer.html +8 -0
  50. package/docs/components/progress.html +8 -0
  51. package/docs/components/resize.html +8 -0
  52. package/docs/components/segmented-control.html +8 -0
  53. package/docs/components/shadow-component.html +8 -0
  54. package/docs/components/show-more.html +8 -0
  55. package/docs/components/slider.html +8 -0
  56. package/docs/components/sortable.html +8 -0
  57. package/docs/components/speech-to-text.html +8 -0
  58. package/docs/components/spinner.html +8 -0
  59. package/docs/components/split.html +8 -0
  60. package/docs/components/table.html +8 -0
  61. package/docs/components/tableControls.html +8 -0
  62. package/docs/components/tableCustomFields.html +8 -0
  63. package/docs/components/tableFetchRecords.html +8 -0
  64. package/docs/components/tableFieldSortHide.html +8 -0
  65. package/docs/components/tablePagination.html +8 -0
  66. package/docs/components/tablePlaceholder.html +8 -0
  67. package/docs/components/tableRecordEditing.html +8 -0
  68. package/docs/components/tableRecordFiltering.html +8 -0
  69. package/docs/components/tableRecordHiding.html +8 -0
  70. package/docs/components/tableRecordSearching.html +8 -0
  71. package/docs/components/tableRecordSelection.html +8 -0
  72. package/docs/components/tableRowControls.html +8 -0
  73. package/docs/components/tableServerSync.html +8 -0
  74. package/docs/components/tableSorting.html +8 -0
  75. package/docs/components/tabs.html +8 -0
  76. package/docs/components/tags.html +8 -0
  77. package/docs/components/text-to-speech.html +8 -0
  78. package/docs/components/theme-select.html +8 -0
  79. package/docs/components/theme-switcher.html +8 -0
  80. package/docs/components/time.html +8 -0
  81. package/docs/components/timestamp.html +8 -0
  82. package/docs/components/toast.html +8 -0
  83. package/docs/components/toggle.html +8 -0
  84. package/docs/components/tree.html +8 -0
  85. package/docs/components/voice-selector.html +8 -0
  86. package/docs/index.html +8 -0
  87. package/docs/src/components/Button.js +30 -0
  88. package/docs/src/components/CodeEditor.js +1 -1
  89. package/docs/src/components/Combobox.js +4 -3
  90. package/docs/src/components/ContentSlider.js +1 -1
  91. package/docs/src/components/HtmlEditor.js +2 -2
  92. package/docs/src/components/MarkdownEditor.js +3 -3
  93. package/docs/src/components/Pagination.js +43 -0
  94. package/docs/src/components/Slider.js +2 -2
  95. package/docs/src/components/markdownEditorControls/Heading.js +5 -5
  96. package/docs/src/components/markdownEditorControls/Table.js +2 -2
  97. package/docs/src/components/paginationControls/FirstPage.js +1 -0
  98. package/docs/src/components/paginationControls/GotoPage.js +17 -0
  99. package/docs/src/components/paginationControls/ItemsPerPage.js +15 -0
  100. package/docs/src/components/paginationControls/LastPage.js +1 -0
  101. package/docs/src/components/paginationControls/NextPage.js +1 -0
  102. package/docs/src/components/paginationControls/PageCount.js +1 -0
  103. package/docs/src/components/paginationControls/PageInfo.js +6 -0
  104. package/docs/src/components/paginationControls/PaginationButtonControl.js +20 -0
  105. package/docs/src/components/paginationControls/PaginationControl.js +5 -0
  106. package/docs/src/components/paginationControls/PrevPage.js +1 -0
  107. package/docs/src/utils/number.js +1 -0
  108. package/docs/src/utils/propConverters.js +1 -1
  109. package/docs/utils/context.html +8 -0
  110. package/docs/utils/cookie.html +8 -0
  111. package/docs/utils/debounce.html +8 -0
  112. package/docs/utils/drag.html +8 -0
  113. package/docs/utils/elevation.html +8 -0
  114. package/docs/utils/formatTimestamp.html +8 -0
  115. package/docs/utils/object.html +8 -0
  116. package/docs/utils/propConverters.html +8 -0
  117. package/docs/utils/sanitizeHtml.html +8 -0
  118. package/docs/utils/string.html +8 -0
  119. package/docs/utils/theme.html +8 -0
  120. package/docs/utils/toTitleCase.html +8 -0
  121. package/docs/utils/type.html +8 -0
  122. package/docs/utils/voice.html +8 -0
  123. package/docs/utils/wait.html +8 -0
  124. package/docs-src/components/button.page.html +95 -0
  125. package/docs-src/components/combobox.page.html +30 -0
  126. package/docs-src/components/pagination.page.html +375 -0
  127. package/docs-src/nav.fragment.html +8 -0
  128. package/llms.txt +12 -0
  129. package/package.json +1 -1
  130. package/src/components/Button.js +91 -0
  131. package/src/components/CodeEditor.js +10 -21
  132. package/src/components/Combobox.js +8 -3
  133. package/src/components/ContentSlider.js +2 -1
  134. package/src/components/HtmlEditor.js +43 -57
  135. package/src/components/MarkdownEditor.js +12 -22
  136. package/src/components/Pagination.js +207 -0
  137. package/src/components/Slider.js +6 -5
  138. package/src/components/markdownEditorControls/Heading.js +3 -2
  139. package/src/components/markdownEditorControls/Table.js +2 -1
  140. package/src/components/paginationControls/FirstPage.js +26 -0
  141. package/src/components/paginationControls/GotoPage.js +56 -0
  142. package/src/components/paginationControls/ItemsPerPage.js +44 -0
  143. package/src/components/paginationControls/LastPage.js +26 -0
  144. package/src/components/paginationControls/NextPage.js +26 -0
  145. package/src/components/paginationControls/PageCount.js +10 -0
  146. package/src/components/paginationControls/PageInfo.js +23 -0
  147. package/src/components/paginationControls/PaginationButtonControl.js +76 -0
  148. package/src/components/paginationControls/PaginationControl.js +43 -0
  149. package/src/components/paginationControls/PrevPage.js +26 -0
  150. package/src/utils/number.js +10 -0
  151. package/src/utils/propConverters.js +7 -1
  152. package/tasks/0006-create-pagination-component/screenshot-01-top.png +0 -0
  153. package/tasks/0006-create-pagination-component/screenshot-02-controls.png +0 -0
  154. package/tasks/0006-create-pagination-component/screenshot-03-preconfigured.png +0 -0
  155. package/tasks/0006-create-pagination-component/screenshot-04-live-demo-page1.png +0 -0
  156. package/tasks/0006-create-pagination-component/screenshot-05-live-demo-page2.png +0 -0
  157. package/tasks/0006-create-pagination-component/screenshot-06-live-demo-last-page.png +0 -0
  158. package/tasks/0006-create-pagination-component/screenshot-07-js-reference.png +0 -0
  159. package/tasks/0006-create-pagination-component.md +136 -0
  160. package/tasks/released/0006-create-pagination-component/screenshot-01-top.png +0 -0
  161. package/tasks/released/0006-create-pagination-component/screenshot-02-controls.png +0 -0
  162. package/tasks/released/0006-create-pagination-component/screenshot-03-preconfigured.png +0 -0
  163. package/tasks/released/0006-create-pagination-component/screenshot-04-live-demo-page1.png +0 -0
  164. package/tasks/released/0006-create-pagination-component/screenshot-05-live-demo-page2.png +0 -0
  165. package/tasks/released/0006-create-pagination-component/screenshot-06-live-demo-last-page.png +0 -0
  166. package/tasks/released/0006-create-pagination-component/screenshot-07-js-reference.png +0 -0
  167. package/tasks/released/0006-create-pagination-component.md +136 -0
  168. package/tests/components/Button.browser-test.js +207 -0
  169. package/tests/components/CodeEditor.browser-test.js +43 -1
  170. package/tests/components/Combobox.browser-test.js +69 -2
  171. package/tests/components/HtmlEditor.browser-test.js +88 -0
  172. package/tests/components/MarkdownEditor.browser-test.js +72 -0
  173. package/tests/components/Pagination.browser-test.js +478 -0
  174. package/tests/components/Tabs.browser-test.js +1 -1
  175. package/tests/utils/number.test.js +110 -0
@@ -0,0 +1,595 @@
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>Button - Base Components - Kempo Docs - A Web Components Solution</title>
7
+ <link rel="icon" type="image/png" sizes="48x48" href="../media/icon48.png">
8
+ <link rel="manifest" href="../manifest.json" />
9
+ <link rel="stylesheet" href="../kempo-vars.css" />
10
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/kempo-css@2/dist/kempo.min.css" />
11
+ <link rel="stylesheet" href="../kempo-hljs.css" />
12
+ <link rel="stylesheet" href="../styles.css" />
13
+ <script>window.litDisableBundleWarning = true;</script>
14
+
15
+ </head>
16
+ <body>
17
+
18
+ <k-nav
19
+ fixed
20
+ class="bg-primary"
21
+ >
22
+ <button
23
+ id="toggleNavSideMenu"
24
+ class="link"
25
+ >
26
+ <k-icon name="menu"></k-icon>
27
+ </button>
28
+ <a
29
+ href="../"
30
+ class="d-if ph"
31
+ style="align-items: center"
32
+ >
33
+ <img
34
+ src="../media/icon32.png"
35
+ alt="Kempo UI Icon"
36
+ class="pr"
37
+ />
38
+ Kempo UI
39
+ </a>
40
+ <div
41
+ style="position:relative;margin:0 .25rem;align-self:center;"
42
+ theme="light"
43
+ >
44
+ <input
45
+ id="navSearchInput"
46
+ type="search"
47
+ placeholder="Search docs..."
48
+ autocomplete="off"
49
+ style="width:11rem;"
50
+ />
51
+ <div
52
+ id="navSearchDropdown"
53
+ hidden
54
+ theme="light"
55
+ style="position:absolute;top:calc(100% + 4px);left:0;width:min(480px,90vw);max-height:70vh;background:var(--c_bg);border:1px solid var(--c_border);border-radius:var(--radius);overflow:auto;z-index:9999;box-shadow:0 4px 12px rgba(0,0,0,.3);"
56
+ >
57
+ <k-filter-list
58
+ id="navSearchList"
59
+ style="display:block;padding:.25rem 0;"
60
+ >
61
+ <k-filter-item filter-keywords="accordion components"><a
62
+ href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
63
+ <k-filter-item filter-keywords="aside sidebar components"><a
64
+ href="../components/aside.html">Aside<br><small>Component</small></a></k-filter-item>
65
+ <k-filter-item filter-keywords="calendar date picker range month day components"><a
66
+ href="../components/calendar.html"
67
+ >Calendar<br><small>Component</small></a></k-filter-item>
68
+ <k-filter-item filter-keywords="card components"><a
69
+ href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
70
+ <k-filter-item filter-keywords="chat message conversation messaging components"><a
71
+ href="../components/chat.html"
72
+ >Chat<br><small>Component</small></a></k-filter-item>
73
+ <k-filter-item filter-keywords="code editor codeeditor monaco components"><a
74
+ href="../components/code-editor.html"
75
+ >Code Editor<br><small>Component</small></a></k-filter-item>
76
+ <k-filter-item filter-keywords="combobox combo box search autocomplete components"><a
77
+ href="../components/combobox.html"
78
+ >Combobox<br><small>Component</small></a></k-filter-item>
79
+ <k-filter-item filter-keywords="color picker colorpicker components"><a
80
+ href="../components/color-picker.html"
81
+ >Color Picker<br><small>Component</small></a></k-filter-item>
82
+ <k-filter-item filter-keywords="content slider components"><a
83
+ href="../components/content-slider.html"
84
+ >Content Slider<br><small>Component</small></a></k-filter-item>
85
+ <k-filter-item filter-keywords="context state global components"><a
86
+ href="../components/context.html"
87
+ >Context<br><small>Component</small></a></k-filter-item>
88
+ <k-filter-item filter-keywords="dialog modal popup components"><a
89
+ href="../components/dialog.html">Dialog<br><small>Component</small></a></k-filter-item>
90
+ <k-filter-item filter-keywords="dropdown select components"><a
91
+ href="../components/dropdown.html">Dropdown<br><small>Component</small></a></k-filter-item>
92
+ <k-filter-item filter-keywords="filter list filterlist components"><a
93
+ href="../components/filter-list.html"
94
+ >Filter List<br><small>Component</small></a></k-filter-item>
95
+ <k-filter-item filter-keywords="focus capture focuscapture components"><a
96
+ href="../components/focus-capture.html"
97
+ >Focus Capture<br><small>Component</small></a></k-filter-item>
98
+ <k-filter-item filter-keywords="html editor components"><a
99
+ href="../components/html-editor.html">HTML
100
+ Editor<br><small>Component</small></a></k-filter-item>
101
+ <k-filter-item filter-keywords="markdown render parser marked gfm components"><a
102
+ href="../components/markdown.html"
103
+ >Markdown<br><small>Component</small></a></k-filter-item>
104
+ <k-filter-item filter-keywords="markdown editor markdowneditor write preview marked gfm tables components"><a
105
+ href="../components/markdown-editor.html"
106
+ >Markdown Editor<br><small>Component</small></a></k-filter-item>
107
+ <k-filter-item filter-keywords="icon components"><a
108
+ href="../components/icon.html">Icon<br><small>Component</small></a></k-filter-item>
109
+ <k-filter-item filter-keywords="import components"><a
110
+ href="../components/import.html">Import<br><small>Component</small></a></k-filter-item>
111
+ <k-filter-item filter-keywords="nav navbar navigation components"><a
112
+ href="../components/nav.html">Nav<br><small>Component</small></a></k-filter-item>
113
+ <k-filter-item filter-keywords="nav spacer navbar spacer navspacer components"><a
114
+ href="../components/nav-spacer.html"
115
+ >Nav Spacer<br><small>Component</small></a></k-filter-item>
116
+ <k-filter-item filter-keywords="photo viewer photoviewer components"><a
117
+ href="../components/photo-viewer.html"
118
+ >Photo Viewer<br><small>Component</small></a></k-filter-item>
119
+ <k-filter-item filter-keywords="pagination pager page components"><a
120
+ href="../components/pagination.html"
121
+ >Pagination<br><small>Component</small></a></k-filter-item>
122
+ <k-filter-item filter-keywords="progress loading components"><a
123
+ href="../components/progress.html">Progress<br><small>Component</small></a></k-filter-item>
124
+ <k-filter-item filter-keywords="resize components"><a
125
+ href="../components/resize.html">Resize<br><small>Component</small></a></k-filter-item>
126
+ <k-filter-item filter-keywords="segmented control segment option button group components"><a
127
+ href="../components/segmented-control.html"
128
+ >Segmented Control<br><small>Component</small></a></k-filter-item>
129
+ <k-filter-item filter-keywords="show more showmore components"><a
130
+ href="../components/show-more.html"
131
+ >Show More<br><small>Component</small></a></k-filter-item>
132
+ <k-filter-item filter-keywords="slider range input step components"><a
133
+ href="../components/slider.html"
134
+ >Slider<br><small>Component</small></a></k-filter-item>
135
+ <k-filter-item filter-keywords="sortable drag drop sort components"><a
136
+ href="../components/sortable.html"
137
+ >Sortable<br><small>Component</small></a></k-filter-item>
138
+ <k-filter-item filter-keywords="speech to text speechtotext microphone voice recognition transcription components"><a
139
+ href="../components/speech-to-text.html"
140
+ >Speech To Text<br><small>Component</small></a></k-filter-item>
141
+ <k-filter-item filter-keywords="spinner loading components"><a
142
+ href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
143
+ <k-filter-item filter-keywords="split pane components"><a
144
+ href="../components/split.html">Split<br><small>Component</small></a></k-filter-item>
145
+ <k-filter-item filter-keywords="table data grid components"><a
146
+ href="../components/table.html">Table<br><small>Component</small></a></k-filter-item>
147
+ <k-filter-item filter-keywords="table controls advanced example"><a
148
+ href="../components/tableControls.html"
149
+ >Table &mdash; Controls<br><small>Advanced Example</small></a></k-filter-item>
150
+ <k-filter-item filter-keywords="table custom fields advanced example"><a
151
+ href="../components/tableCustomFields.html"
152
+ >Table &mdash; Custom Fields<br><small>Advanced Example</small></a></k-filter-item>
153
+ <k-filter-item filter-keywords="table fetch records advanced example"><a
154
+ href="../components/tableFetchRecords.html"
155
+ >Table &mdash; Fetch Records<br><small>Advanced Example</small></a></k-filter-item>
156
+ <k-filter-item filter-keywords="table field sort hide advanced example"><a
157
+ href="../components/tableFieldSortHide.html"
158
+ >Table &mdash; Field Sort &amp; Hide<br><small>Advanced Example</small></a></k-filter-item>
159
+ <k-filter-item filter-keywords="table pagination advanced example"><a
160
+ href="../components/tablePagination.html"
161
+ >Table &mdash; Pagination<br><small>Advanced Example</small></a></k-filter-item>
162
+ <k-filter-item filter-keywords="table record editing advanced example"><a
163
+ href="../components/tableRecordEditing.html"
164
+ >Table &mdash; Record Editing<br><small>Advanced Example</small></a></k-filter-item>
165
+ <k-filter-item filter-keywords="table record filtering advanced example"><a
166
+ href="../components/tableRecordFiltering.html"
167
+ >Table &mdash; Record Filtering<br><small>Advanced Example</small></a></k-filter-item>
168
+ <k-filter-item filter-keywords="table record hiding advanced example"><a
169
+ href="../components/tableRecordHiding.html"
170
+ >Table &mdash; Record Hiding<br><small>Advanced Example</small></a></k-filter-item>
171
+ <k-filter-item filter-keywords="table record searching advanced example"><a
172
+ href="../components/tableRecordSearching.html"
173
+ >Table &mdash; Record Searching<br><small>Advanced Example</small></a></k-filter-item>
174
+ <k-filter-item filter-keywords="table record selection advanced example"><a
175
+ href="../components/tableRecordSelection.html"
176
+ >Table &mdash; Record Selection<br><small>Advanced Example</small></a></k-filter-item>
177
+ <k-filter-item filter-keywords="table row controls advanced example"><a
178
+ href="../components/tableRowControls.html"
179
+ >Table &mdash; Row Controls<br><small>Advanced Example</small></a></k-filter-item>
180
+ <k-filter-item filter-keywords="table server sync advanced example"><a
181
+ href="../components/tableServerSync.html"
182
+ >Table &mdash; Server Sync<br><small>Advanced Example</small></a></k-filter-item>
183
+ <k-filter-item filter-keywords="table sorting advanced example"><a
184
+ href="../components/tableSorting.html"
185
+ >Table &mdash; Sorting<br><small>Advanced Example</small></a></k-filter-item>
186
+ <k-filter-item filter-keywords="table placeholder advanced example"><a
187
+ href="../components/tablePlaceholder.html"
188
+ >Table &mdash; Placeholder<br><small>Advanced Example</small></a></k-filter-item>
189
+ <k-filter-item filter-keywords="tabs tab panel components"><a
190
+ href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
191
+ <k-filter-item filter-keywords="tags tag input components"><a
192
+ href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
193
+ <k-filter-item filter-keywords="text to speech texttospeech tts speak voice synthesis components"><a
194
+ href="../components/text-to-speech.html"
195
+ >Text To Speech<br><small>Component</small></a></k-filter-item>
196
+ <k-filter-item filter-keywords="theme select dropdown dark light components"><a
197
+ href="../components/theme-select.html"
198
+ >Theme Select<br><small>Component</small></a></k-filter-item>
199
+ <k-filter-item filter-keywords="theme switcher dark light components"><a
200
+ href="../components/theme-switcher.html"
201
+ >Theme Switcher<br><small>Component</small></a></k-filter-item>
202
+ <k-filter-item filter-keywords="time picker clock hour minute form components"><a
203
+ href="../components/time.html"
204
+ >Time<br><small>Component</small></a></k-filter-item>
205
+ <k-filter-item filter-keywords="timestamp date time components"><a
206
+ href="../components/timestamp.html"
207
+ >Timestamp<br><small>Component</small></a></k-filter-item>
208
+ <k-filter-item filter-keywords="toast notification alert components"><a
209
+ href="../components/toast.html"
210
+ >Toast<br><small>Component</small></a></k-filter-item>
211
+ <k-filter-item filter-keywords="toggle switch checkbox components"><a
212
+ href="../components/toggle.html"
213
+ >Toggle<br><small>Component</small></a></k-filter-item>
214
+ <k-filter-item filter-keywords="tree treeview components"><a
215
+ href="../components/tree.html">Tree<br><small>Component</small></a></k-filter-item>
216
+ <k-filter-item filter-keywords="voice selector dropdown speech synthesis preference components"><a
217
+ href="../components/voice-selector.html"
218
+ >Voice Selector<br><small>Component</small></a></k-filter-item>
219
+ <k-filter-item filter-keywords="shadow component base"><a
220
+ href="../components/shadow-component.html"
221
+ >Shadow Component<br><small>Base Component</small></a></k-filter-item>
222
+ <k-filter-item filter-keywords="light component base"><a
223
+ href="../components/light-component.html">Light Component<br><small>Base
224
+ Component</small></a></k-filter-item>
225
+ <k-filter-item filter-keywords="hybrid component base"><a
226
+ href="../components/hybrid-component.html"
227
+ >Hybrid Component<br><small>Base Component</small></a></k-filter-item>
228
+ <k-filter-item filter-keywords="button base component keyboard disabled accessibility"><a
229
+ href="../components/button.html"
230
+ >Button<br><small>Base Component</small></a></k-filter-item>
231
+ <k-filter-item filter-keywords="cookie utils utility"><a
232
+ href="../utils/cookie.html">cookie<br><small>Utility</small></a></k-filter-item>
233
+ <k-filter-item filter-keywords="context utils utility"><a
234
+ href="../utils/context.html">context<br><small>Utility</small></a></k-filter-item>
235
+ <k-filter-item filter-keywords="debounce utils utility"><a
236
+ href="../utils/debounce.html">debounce<br><small>Utility</small></a></k-filter-item>
237
+ <k-filter-item filter-keywords="drag utils utility"><a
238
+ href="../utils/drag.html">drag<br><small>Utility</small></a></k-filter-item>
239
+ <k-filter-item filter-keywords="elevation z-index stacking utils"><a
240
+ href="../utils/elevation.html">elevation<br><small>Utility</small></a></k-filter-item>
241
+ <k-filter-item filter-keywords="formattimestamp timestamp format date time utils utility"><a
242
+ href="../utils/formatTimestamp.html"
243
+ >formatTimestamp<br><small>Utility</small></a></k-filter-item>
244
+ <k-filter-item filter-keywords="object utils utility"><a
245
+ href="../utils/object.html">object<br><small>Utility</small></a></k-filter-item>
246
+ <k-filter-item filter-keywords="propconverters prop converters utils utility"><a
247
+ href="../utils/propConverters.html"
248
+ >propConverters<br><small>Utility</small></a></k-filter-item>
249
+ <k-filter-item filter-keywords="sanitizehtml sanitize html xss security utils utility"><a
250
+ href="../utils/sanitizeHtml.html"
251
+ >sanitizeHtml<br><small>Utility</small></a></k-filter-item>
252
+ <k-filter-item filter-keywords="string utils utility"><a
253
+ href="../utils/string.html">string<br><small>Utility</small></a></k-filter-item>
254
+ <k-filter-item filter-keywords="theme utils utility"><a
255
+ href="../utils/theme.html">theme<br><small>Utility</small></a></k-filter-item>
256
+ <k-filter-item filter-keywords="type utils utility"><a
257
+ href="../utils/type.html">type<br><small>Utility</small></a></k-filter-item>
258
+ <k-filter-item filter-keywords="voice speech synthesis preference utils utility"><a
259
+ href="../utils/voice.html">voice<br><small>Utility</small></a></k-filter-item>
260
+ <k-filter-item filter-keywords="wait async utils utility"><a
261
+ href="../utils/wait.html">wait<br><small>Utility</small></a></k-filter-item>
262
+ </k-filter-list>
263
+ </div>
264
+ </div>
265
+ <div class="flex"></div>
266
+ <a
267
+ href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20"
268
+ target="_blank"
269
+ ><k-icon name="license"></k-icon></a>
270
+ <a
271
+ href="https://www.npmjs.com/package/kempo-ui"
272
+ target="_blank"
273
+ ><k-icon name="npm"></k-icon></a>
274
+ <a
275
+ href="https://github.com/dustinpoissant/kempo-ui"
276
+ target="_blank"
277
+ ><k-icon name="github-mark"></k-icon></a>
278
+ <k-theme-switcher
279
+ class="mr"
280
+ style="
281
+ --padding: 0.5rem;
282
+ --c_active: var(--tc_on_primary);
283
+ --tc_active: var(--c_primary);
284
+ --c_inactive__hover: rgba(255, 255, 255, 0.1);
285
+ "
286
+ ></k-theme-switcher>
287
+ </k-nav>
288
+ <div style="width: 100%; height: 4rem;"></div>
289
+ <k-aside
290
+ id="navSideMenu"
291
+ main="overlay"
292
+ state="offscreen"
293
+ >
294
+ <menu>
295
+ <a
296
+ href="../"
297
+ class="ta-center bb mb r0"
298
+ >
299
+ <h1 class="tc-primary">Kempo UI</h1>
300
+ <img
301
+ src="../media/icon128.png"
302
+ alt="Kempo UI Icon"
303
+ />
304
+ </a>
305
+
306
+ <div class="pl mb">
307
+ <h3>Components</h3>
308
+ <a href="../components/accordion.html">Accordion</a>
309
+ <a href="../components/aside.html">Aside</a>
310
+ <a href="../components/calendar.html">Calendar</a>
311
+ <a href="../components/card.html">Card</a>
312
+ <a href="../components/chat.html">Chat</a>
313
+ <a href="../components/code-editor.html">Code Editor</a>
314
+ <a href="../components/combobox.html">Combobox</a>
315
+ <a href="../components/color-picker.html">ColorPicker</a>
316
+ <a href="../components/content-slider.html">Content Slider</a>
317
+ <a href="../components/context.html">Context</a>
318
+ <a href="../components/dialog.html">Dialog</a>
319
+ <a href="../components/dropdown.html">Dropdown</a>
320
+ <a href="../components/filter-list.html">Filter List</a>
321
+ <a href="../components/focus-capture.html">FocusCapture</a>
322
+ <a href="../components/html-editor.html">HTML Editor</a>
323
+ <a href="../components/markdown.html">Markdown</a>
324
+ <a href="../components/markdown-editor.html">Markdown Editor</a>
325
+ <a href="../components/icon.html">Icon</a>
326
+ <a href="../components/import.html">Import</a>
327
+ <a href="../components/nav.html">Nav</a>
328
+ <a href="../components/nav-spacer.html">Nav Spacer</a>
329
+ <a href="../components/photo-viewer.html">Photo Viewer</a>
330
+ <a href="../components/pagination.html">Pagination</a>
331
+ <a href="../components/progress.html">Progress</a>
332
+ <a href="../components/resize.html">Resize</a>
333
+ <a href="../components/show-more.html">Show More</a>
334
+ <a href="../components/slider.html">Slider</a>
335
+ <a href="../components/sortable.html">Sortable</a>
336
+ <a href="../components/speech-to-text.html">Speech To Text</a>
337
+ <a href="../components/spinner.html">Spinner</a>
338
+ <a href="../components/split.html">Split</a>
339
+ <a href="../components/table.html">Table</a>
340
+ <a href="../components/tabs.html">Tabs</a>
341
+ <a href="../components/tags.html">Tags</a>
342
+ <a href="../components/text-to-speech.html">Text To Speech</a>
343
+ <a href="../components/theme-select.html">Theme Select</a>
344
+ <a href="../components/theme-switcher.html">Theme Switcher</a>
345
+ <a href="../components/time.html">Time</a>
346
+ <a href="../components/timestamp.html">Timestamp</a>
347
+ <a href="../components/toast.html">Toast</a>
348
+ <a href="../components/toggle.html">Toggle</a>
349
+ <a href="../components/tree.html">Tree</a>
350
+ <a href="../components/voice-selector.html">Voice Selector</a>
351
+ </div>
352
+
353
+ <h5 class="mb0">Base Components</h5>
354
+ <div class="pl mb">
355
+ <a href="../components/shadow-component.html">Shadow Component</a>
356
+ <a href="../components/light-component.html">Light Component</a>
357
+ <a href="../components/hybrid-component.html">Hybrid Component</a>
358
+ <a href="../components/button.html">Button</a>
359
+ </div>
360
+
361
+ <h5 class="mb0">Utils</h5>
362
+ <div class="pl mb">
363
+ <a href="../utils/cookie.html">cookie</a>
364
+ <a href="../utils/context.html">context</a>
365
+ <a href="../utils/debounce.html">debounce</a>
366
+ <a href="../utils/drag.html">drag</a>
367
+ <a href="../utils/elevation.html">elevation</a>
368
+ <a href="../utils/formatTimestamp.html">formatTimestamp</a>
369
+ <a href="../utils/object.html">object</a>
370
+ <a href="../utils/propConverters.html">propConverters</a>
371
+ <a href="../utils/sanitizeHtml.html">sanitizeHtml</a>
372
+ <a href="../utils/string.html">string</a>
373
+ <a href="../utils/theme.html">theme</a>
374
+ <a href="../utils/type.html">type</a>
375
+ <a href="../utils/voice.html">voice</a>
376
+ <a href="../utils/wait.html">wait</a>
377
+ </div>
378
+ </menu>
379
+ </k-aside>
380
+ <style>
381
+ #navSearchList a {
382
+ display: block;
383
+ padding: .25rem .5rem;
384
+ border-radius: var(--radius);
385
+ text-decoration: none;
386
+ color: var(--tc);
387
+ }
388
+
389
+ #navSearchList a:hover {
390
+ background: rgba(128, 128, 128, .15);
391
+ }
392
+
393
+ #navSearchList a small {
394
+ display: block;
395
+ color: var(--tc_muted);
396
+ }
397
+ </style>
398
+ <script
399
+ src="../src/components/Nav.js"
400
+ type="module"
401
+ ></script>
402
+ <script
403
+ src="../src/components/FilterList.js"
404
+ type="module"
405
+ ></script>
406
+ <script
407
+ src="../src/components/FilterItem.js"
408
+ type="module"
409
+ ></script>
410
+ <script
411
+ src="../src/components/Aside.js"
412
+ type="module"
413
+ ></script>
414
+ <script
415
+ src="../src/components/Icon.js"
416
+ type="module"
417
+ ></script>
418
+ <script
419
+ src="../src/components/ThemeSwitcher.js"
420
+ type="module"
421
+ ></script>
422
+ <script type="module">
423
+ import debounce from '../src/utils/debounce.js';
424
+
425
+ document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
426
+ await window.customElements.whenDefined('k-aside');
427
+ document.getElementById('navSideMenu').toggle();
428
+ });
429
+
430
+ document.addEventListener('click', function (e) {
431
+ if (e.target.matches('a[href^="#"]')) {
432
+ e.preventDefault();
433
+ const targetId = e.target.getAttribute('href').replace('#', '');
434
+ const target = document.getElementById(targetId);
435
+ if (target) {
436
+ target.scrollIntoView({ behavior: 'smooth' });
437
+ const url = window.location.pathname + window.location.search + '#' + targetId;
438
+ history.replaceState(null, '', url);
439
+ }
440
+ }
441
+ });
442
+
443
+ /*
444
+ Nav Search
445
+ */
446
+ const searchInput = document.getElementById('navSearchInput');
447
+ const searchDropdown = document.getElementById('navSearchDropdown');
448
+ let navSearchList = null;
449
+
450
+ const openSearch = async () => {
451
+ await customElements.whenDefined('k-filter-list');
452
+ if (!navSearchList) navSearchList = document.getElementById('navSearchList');
453
+ navSearchList.filter(searchInput.value);
454
+ searchDropdown.hidden = false;
455
+ };
456
+
457
+ const closeSearch = () => {
458
+ searchDropdown.hidden = true;
459
+ navSearchList?.clearFocus();
460
+ };
461
+
462
+ searchInput.addEventListener('focus', openSearch);
463
+
464
+ searchInput.addEventListener('input', debounce(e => {
465
+ navSearchList?.filter(e.target.value);
466
+ }, 150));
467
+
468
+ searchInput.addEventListener('keydown', e => {
469
+ if (e.key === 'Escape') {
470
+ searchInput.value = '';
471
+ searchInput.blur();
472
+ closeSearch();
473
+ } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter') {
474
+ navSearchList?.handleKeydown(e);
475
+ }
476
+ });
477
+
478
+ searchInput.addEventListener('blur', () => {
479
+ setTimeout(closeSearch, 150);
480
+ });
481
+
482
+ document.addEventListener('keydown', e => {
483
+ let active = document.activeElement;
484
+ while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
485
+ const tag = active?.tagName;
486
+ if (tag === 'INPUT' || tag === 'TEXTAREA' || active?.isContentEditable) return;
487
+ if (e.metaKey || e.ctrlKey || e.altKey) return;
488
+ if (e.key.length === 1) {
489
+ searchInput.focus();
490
+ }
491
+ });
492
+ </script>
493
+
494
+
495
+ <h1 class="ta-center">Button</h1>
496
+
497
+ <k-main>
498
+
499
+ <k-accordion persistent-id="toc" class="b r mb">
500
+ <k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
501
+ <k-accordion-panel name="toc-panel">
502
+ <div class="m">
503
+ <h6>Guide</h6>
504
+ <a href="#overview">Overview</a><br />
505
+ <a href="#basicUsage">Basic Usage</a><br />
506
+ <a href="#customStyles">Custom Styles</a><br />
507
+ <a href="#overridingHandlers">Overriding Event Handlers</a><br />
508
+ <a href="#disabled">Disabled State</a><br />
509
+
510
+ <h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
511
+ <a href="#constructor">Constructor</a><br />
512
+ <a href="#staticProperties">Static Properties</a><br />
513
+ <a href="#properties">Properties</a><br />
514
+ <a href="#methods">Methods</a><br />
515
+ <a href="#eventHandlers">Event Handlers</a><br />
516
+ </div>
517
+ </k-accordion-panel>
518
+ </k-accordion>
519
+
520
+ <h3 id="overview"><a href="#overview" class="no-link">Overview</a></h3>
521
+ <p>Button is a base class for creating custom elements that behave like buttons. Unlike using a native
522
+ <code>&lt;button&gt;</code> element internally, extending Button makes the custom element <em>itself</em> the
523
+ button — enabling direct styling via <code>:host</code>, <code>:host(:hover)</code>,
524
+ <code>:host([disabled])</code>, and so on, without <code>::part()</code>.</p>
525
+ <p>Button is <strong>not registered to a tag</strong>. It is a base class only. Extend it to create your own
526
+ button-like components.</p>
527
+ <ul>
528
+ <li>Shadow DOM with kempo-css button styles applied to <code>:host</code></li>
529
+ <li>Keyboard accessible: <kbd>Enter</kbd> and <kbd>Space</kbd> trigger <code>click()</code></li>
530
+ <li><code>role="button"</code> and <code>tabindex</code> set automatically</li>
531
+ <li><code>disabled</code> attribute blocks interaction and sets <code>aria-disabled</code></li>
532
+ <li>Inherits from <a href="./shadow-component.html">ShadowComponent</a></li>
533
+ </ul>
534
+
535
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
536
+ <p>Extend Button and register a tag:</p>
537
+ <pre><code class="hljs javascript"><span class="hljs-keyword">import</span> <span class="hljs-title class_">Button</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kempo-ui/src/components/Button.js&#x27;</span>;<br><span class="hljs-keyword">import</span> {<br> html,<br> css<br>} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kempo-ui/src/lit-all.min.js&#x27;</span>;<br><span class="hljs-keyword">class</span> <span class="hljs-title class_">MyButton</span> <span class="hljs-keyword">extends</span> <span class="hljs-title class_ inherited__">Button</span> {}<br>customElements.<span class="hljs-title function_">define</span>(<span class="hljs-string">&#x27;my-button&#x27;</span>, <span class="hljs-title class_">MyButton</span>);</code></pre>
538
+
539
+ <h3 id="customStyles"><a href="#customStyles" class="no-link">Custom Styles</a></h3>
540
+ <p>Extend <code>Button.styles</code> to preserve the base button appearance while adding your own:</p>
541
+ <pre><code class="hljs javascript"><span class="hljs-keyword">import</span> <span class="hljs-title class_">Button</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kempo-ui/src/components/Button.js&#x27;</span>;<br><span class="hljs-keyword">import</span> {<br> html,<br> css<br>} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kempo-ui/src/lit-all.min.js&#x27;</span>;<br><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">IconButton</span> <span class="hljs-keyword">extends</span> <span class="hljs-title class_ inherited__">Button</span> {<br> <span class="hljs-keyword">static</span> properties = {<br> ...<span class="hljs-title class_">Button</span>.<span class="hljs-property">properties</span>,<br> <span class="hljs-attr">icon</span>: {<br> <span class="hljs-attr">type</span>: <span class="hljs-title class_">String</span>,<br> <span class="hljs-attr">reflect</span>: <span class="hljs-literal">true</span><br> },<br> <span class="hljs-attr">label</span>: {<br> <span class="hljs-attr">type</span>: <span class="hljs-title class_">String</span>,<br> <span class="hljs-attr">reflect</span>: <span class="hljs-literal">true</span><br> }<br> };<br> <span class="hljs-title function_">render</span>(<span class="hljs-params"></span>) {<br> <span class="hljs-keyword">return</span> html`<span class="language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-icon</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;</span></span></span><span class="hljs-subst">${<span class="hljs-variable language_">this</span>.icon}</span><span class="language-xml"><span class="hljs-tag"><span class="hljs-string">&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-icon</span>&gt;</span> </span><span class="hljs-subst">${<span class="hljs-variable language_">this</span>.label}</span><span class="language-xml">`</span>;<br> }<br> <span class="hljs-keyword">static</span> styles = [<br> <span class="hljs-title class_">Button</span>.<span class="hljs-property">styles</span>,<br> css`<span class="language-css"><br> <span class="hljs-selector-pseudo">:host</span> {<br> <span class="hljs-attribute">gap</span>: <span class="hljs-built_in">var</span>(--spacer_sm);<br> <span class="hljs-attribute">align-items</span>: center;<br> <span class="hljs-attribute">display</span>: inline-flex;<br> }<br> `</span><br> ];<br>}<br>customElements.<span class="hljs-title function_">define</span>(<span class="hljs-string">&#x27;my-icon-button&#x27;</span>, <span class="hljs-title class_">IconButton</span>);</code></pre>
542
+
543
+ <h3 id="overridingHandlers"><a href="#overridingHandlers" class="no-link">Overriding Event Handlers</a></h3>
544
+ <p>Event handlers are public arrow function class fields. Subclasses can override them directly, or add their
545
+ own handlers on top. This is useful for building control components that perform an action when clicked:</p>
546
+ <pre><code class="hljs javascript"><span class="hljs-keyword">import</span> <span class="hljs-title class_">Button</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;kempo-ui/src/components/Button.js&#x27;</span>;<br><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">MyControl</span> <span class="hljs-keyword">extends</span> <span class="hljs-title class_ inherited__">Button</span> {<br> <span class="hljs-title function_">handleAction</span>(<span class="hljs-params"></span>) {<br> <span class="hljs-comment">// override this in subclasses</span><br> }<br> handleClick = <span class="hljs-function">() =&gt;</span> <span class="hljs-variable language_">this</span>.<span class="hljs-title function_">handleAction</span>();<br> <span class="hljs-title function_">connectedCallback</span>(<span class="hljs-params"></span>) {<br> <span class="hljs-variable language_">super</span>.<span class="hljs-title function_">connectedCallback</span>();<br> <span class="hljs-variable language_">this</span>.<span class="hljs-title function_">addEventListener</span>(<span class="hljs-string">&#x27;click&#x27;</span>, <span class="hljs-variable language_">this</span>.<span class="hljs-property">handleClick</span>);<br> }<br> <span class="hljs-title function_">disconnectedCallback</span>(<span class="hljs-params"></span>) {<br> <span class="hljs-variable language_">super</span>.<span class="hljs-title function_">disconnectedCallback</span>();<br> <span class="hljs-variable language_">this</span>.<span class="hljs-title function_">removeEventListener</span>(<span class="hljs-string">&#x27;click&#x27;</span>, <span class="hljs-variable language_">this</span>.<span class="hljs-property">handleClick</span>);<br> }<br>}</code></pre>
547
+
548
+ <h3 id="disabled"><a href="#disabled" class="no-link">Disabled State</a></h3>
549
+ <p>Set the <code>disabled</code> attribute or property to block interaction. When disabled:</p>
550
+ <ul>
551
+ <li>Click events are stopped via <code>stopImmediatePropagation()</code></li>
552
+ <li>Keyboard activation (<kbd>Enter</kbd> / <kbd>Space</kbd>) is suppressed</li>
553
+ <li><code>tabindex="-1"</code> removes it from the tab order</li>
554
+ <li><code>aria-disabled="true"</code> is set for screen readers</li>
555
+ <li><code>:host([disabled])</code> reduces opacity and changes cursor</li>
556
+ </ul>
557
+
558
+ <h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
559
+
560
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
561
+ <h6>Extends ShadowComponent</h6>
562
+ <h5><code>new Button()</code></h5>
563
+ <p>Base class only — not registered to a tag. Extend this class and register your own tag.</p>
564
+
565
+ <h3 id="staticProperties"><a href="#staticProperties" class="no-link">Static Properties</a></h3>
566
+ <h5><code>styles<i>: CSSResult | CSSResult[]</i></code></h5>
567
+ <p>Lit <code>static styles</code> providing the base button appearance. Spread or array-extend this in
568
+ subclasses: <code>static styles = [Button.styles, css`...`]</code>.</p>
569
+
570
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
571
+ <h5><code>disabled<i>: boolean</i></code></h5>
572
+ <p>Reflects to the <code>disabled</code> attribute. When <code>true</code>, blocks all interaction and updates
573
+ <code>tabindex</code> and <code>aria-disabled</code> accordingly.</p>
574
+
575
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
576
+ <p>Inherits all methods from <a href="./shadow-component.html">ShadowComponent</a>.</p>
577
+
578
+ <h3 id="eventHandlers"><a href="#eventHandlers" class="no-link">Event Handlers</a></h3>
579
+ <p>These are public arrow function class fields — they can be referenced directly (e.g. to
580
+ <code>addEventListener</code> / <code>removeEventListener</code>) or overridden in a subclass.</p>
581
+ <h5><code>handleClick<i>: (e: Event) => void</i></code></h5>
582
+ <p>Stops propagation when <code>disabled</code>. Registered on the host element in
583
+ <code>connectedCallback</code>.</p>
584
+ <h5><code>handleKeyDown<i>: (e: KeyboardEvent) => void</i></code></h5>
585
+ <p>Calls <code>this.click()</code> when <kbd>Enter</kbd> or <kbd>Space</kbd> is pressed and the element is not
586
+ disabled.</p>
587
+
588
+ </k-main>
589
+ <div style="height:33vh"></div>
590
+ <script type="module" src="../src/components/Main.js"></script>
591
+
592
+ <script type="module" src="../src/components/Accordion.js"></script>
593
+
594
+ </body>
595
+ </html>