kempo-ui 0.4.2 → 0.4.4
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/.claude/skills/get-icon/SKILL.md +144 -0
- package/.claude/skills/highlight-code/SKILL.md +62 -0
- package/.claude/skills/new-component/SKILL.md +362 -0
- package/.github/skills/get-icon/SKILL.md +4 -4
- package/.github/skills/highlight-code/SKILL.md +51 -20
- package/.github/skills/new-component/SKILL.md +183 -152
- package/AGENTS.md +2 -2
- package/dist/components/Calendar.js +170 -0
- package/dist/components/SpeechToText.js +60 -0
- package/dist/components/TextToSpeech.js +56 -0
- package/dist/components/Time.js +37 -0
- package/docs/components/accordion.html +16 -0
- package/docs/components/aside.html +16 -0
- package/docs/components/calendar.html +720 -0
- package/docs/components/card.html +16 -0
- package/docs/components/code-editor.html +16 -0
- package/docs/components/color-picker.html +16 -0
- package/docs/components/combobox.html +16 -0
- package/docs/components/content-slider.html +16 -0
- package/docs/components/context.html +16 -0
- package/docs/components/dialog.html +16 -0
- package/docs/components/dropdown.html +16 -0
- package/docs/components/filter-list.html +16 -0
- package/docs/components/focus-capture.html +16 -0
- package/docs/components/html-editor.html +16 -0
- package/docs/components/hybrid-component.html +16 -0
- package/docs/components/icon.html +16 -0
- package/docs/components/import.html +16 -0
- package/docs/components/light-component.html +16 -0
- package/docs/components/nav-spacer.html +16 -0
- package/docs/components/nav.html +16 -0
- package/docs/components/photo-viewer.html +16 -0
- package/docs/components/progress.html +16 -0
- package/docs/components/resize.html +16 -0
- package/docs/components/shadow-component.html +16 -0
- package/docs/components/show-more.html +16 -0
- package/docs/components/slider.html +16 -0
- package/docs/components/sortable.html +16 -0
- package/docs/components/speech-to-text.html +717 -0
- package/docs/components/spinner.html +16 -0
- package/docs/components/split.html +16 -0
- package/docs/components/table.html +16 -0
- package/docs/components/tableControls.html +16 -0
- package/docs/components/tableCustomFields.html +16 -0
- package/docs/components/tableFetchRecords.html +16 -0
- package/docs/components/tableFieldSortHide.html +16 -0
- package/docs/components/tablePagination.html +16 -0
- package/docs/components/tablePlaceholder.html +16 -0
- package/docs/components/tableRecordEditing.html +16 -0
- package/docs/components/tableRecordFiltering.html +16 -0
- package/docs/components/tableRecordHiding.html +16 -0
- package/docs/components/tableRecordSearching.html +16 -0
- package/docs/components/tableRecordSelection.html +16 -0
- package/docs/components/tableRowControls.html +16 -0
- package/docs/components/tableServerSync.html +16 -0
- package/docs/components/tableSorting.html +16 -0
- package/docs/components/tabs.html +16 -0
- package/docs/components/tags.html +16 -0
- package/docs/components/text-to-speech.html +668 -0
- package/docs/components/theme-select.html +16 -0
- package/docs/components/theme-switcher.html +16 -0
- package/docs/components/time.html +670 -0
- package/docs/components/timestamp.html +16 -0
- package/docs/components/toast.html +16 -0
- package/docs/components/toggle.html +16 -0
- package/docs/components/tree.html +16 -0
- package/docs/icons/mic.svg +1 -0
- package/docs/icons/record_voice_over.svg +1 -0
- package/docs/icons/stop.svg +1 -0
- package/docs/index.html +40 -0
- package/docs/src/components/Calendar.js +170 -0
- package/docs/src/components/SpeechToText.js +60 -0
- package/docs/src/components/TextToSpeech.js +56 -0
- package/docs/src/components/Time.js +37 -0
- package/docs/utils/context.html +16 -0
- package/docs/utils/cookie.html +16 -0
- package/docs/utils/debounce.html +16 -0
- package/docs/utils/drag.html +16 -0
- package/docs/utils/elevation.html +16 -0
- package/docs/utils/formatTimestamp.html +16 -0
- package/docs/utils/object.html +16 -0
- package/docs/utils/propConverters.html +16 -0
- package/docs/utils/string.html +16 -0
- package/docs/utils/theme.html +16 -0
- package/docs/utils/toTitleCase.html +16 -0
- package/docs/utils/type.html +16 -0
- package/docs/utils/wait.html +16 -0
- package/docs-src/components/calendar.page.html +254 -0
- package/docs-src/components/speech-to-text.page.html +251 -0
- package/docs-src/components/text-to-speech.page.html +202 -0
- package/docs-src/components/time.page.html +204 -0
- package/docs-src/index.page.html +24 -0
- package/docs-src/nav.fragment.html +16 -0
- package/icons/mic.svg +1 -0
- package/icons/record_voice_over.svg +1 -0
- package/icons/stop.svg +1 -0
- package/llms.txt +4 -0
- package/package.json +1 -1
- package/src/components/Calendar.js +473 -0
- package/src/components/SpeechToText.js +252 -0
- package/src/components/TextToSpeech.js +194 -0
- package/src/components/Time.js +137 -0
- package/tests/components/SpeechToText.browser-test.js +530 -0
- package/tests/components/TextToSpeech.browser-test.js +432 -0
|
@@ -62,6 +62,9 @@
|
|
|
62
62
|
href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
|
|
63
63
|
<k-filter-item filter-keywords="aside sidebar components"><a
|
|
64
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>
|
|
65
68
|
<k-filter-item filter-keywords="card components"><a
|
|
66
69
|
href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
|
|
67
70
|
<k-filter-item filter-keywords="code editor codeeditor monaco components"><a
|
|
@@ -117,6 +120,9 @@
|
|
|
117
120
|
<k-filter-item filter-keywords="sortable drag drop sort components"><a
|
|
118
121
|
href="../components/sortable.html"
|
|
119
122
|
>Sortable<br><small>Component</small></a></k-filter-item>
|
|
123
|
+
<k-filter-item filter-keywords="speech to text speechtotext microphone voice recognition transcription components"><a
|
|
124
|
+
href="../components/speech-to-text.html"
|
|
125
|
+
>Speech To Text<br><small>Component</small></a></k-filter-item>
|
|
120
126
|
<k-filter-item filter-keywords="spinner loading components"><a
|
|
121
127
|
href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
|
|
122
128
|
<k-filter-item filter-keywords="split pane components"><a
|
|
@@ -169,12 +175,18 @@
|
|
|
169
175
|
href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
|
|
170
176
|
<k-filter-item filter-keywords="tags tag input components"><a
|
|
171
177
|
href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
|
|
178
|
+
<k-filter-item filter-keywords="text to speech texttospeech tts speak voice synthesis components"><a
|
|
179
|
+
href="../components/text-to-speech.html"
|
|
180
|
+
>Text To Speech<br><small>Component</small></a></k-filter-item>
|
|
172
181
|
<k-filter-item filter-keywords="theme select dropdown dark light components"><a
|
|
173
182
|
href="../components/theme-select.html"
|
|
174
183
|
>Theme Select<br><small>Component</small></a></k-filter-item>
|
|
175
184
|
<k-filter-item filter-keywords="theme switcher dark light components"><a
|
|
176
185
|
href="../components/theme-switcher.html"
|
|
177
186
|
>Theme Switcher<br><small>Component</small></a></k-filter-item>
|
|
187
|
+
<k-filter-item filter-keywords="time picker clock hour minute form components"><a
|
|
188
|
+
href="../components/time.html"
|
|
189
|
+
>Time<br><small>Component</small></a></k-filter-item>
|
|
178
190
|
<k-filter-item filter-keywords="timestamp date time components"><a
|
|
179
191
|
href="../components/timestamp.html"
|
|
180
192
|
>Timestamp<br><small>Component</small></a></k-filter-item>
|
|
@@ -269,6 +281,7 @@
|
|
|
269
281
|
<h3>Components</h3>
|
|
270
282
|
<a href="../components/accordion.html">Accordion</a>
|
|
271
283
|
<a href="../components/aside.html">Aside</a>
|
|
284
|
+
<a href="../components/calendar.html">Calendar</a>
|
|
272
285
|
<a href="../components/card.html">Card</a>
|
|
273
286
|
<a href="../components/code-editor.html">Code Editor</a>
|
|
274
287
|
<a href="../components/combobox.html">Combobox</a>
|
|
@@ -290,13 +303,16 @@
|
|
|
290
303
|
<a href="../components/show-more.html">Show More</a>
|
|
291
304
|
<a href="../components/slider.html">Slider</a>
|
|
292
305
|
<a href="../components/sortable.html">Sortable</a>
|
|
306
|
+
<a href="../components/speech-to-text.html">Speech To Text</a>
|
|
293
307
|
<a href="../components/spinner.html">Spinner</a>
|
|
294
308
|
<a href="../components/split.html">Split</a>
|
|
295
309
|
<a href="../components/table.html">Table</a>
|
|
296
310
|
<a href="../components/tabs.html">Tabs</a>
|
|
297
311
|
<a href="../components/tags.html">Tags</a>
|
|
312
|
+
<a href="../components/text-to-speech.html">Text To Speech</a>
|
|
298
313
|
<a href="../components/theme-select.html">Theme Select</a>
|
|
299
314
|
<a href="../components/theme-switcher.html">Theme Switcher</a>
|
|
315
|
+
<a href="../components/time.html">Time</a>
|
|
300
316
|
<a href="../components/timestamp.html">Timestamp</a>
|
|
301
317
|
<a href="../components/toast.html">Toast</a>
|
|
302
318
|
<a href="../components/toggle.html">Toggle</a>
|
|
@@ -62,6 +62,9 @@
|
|
|
62
62
|
href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
|
|
63
63
|
<k-filter-item filter-keywords="aside sidebar components"><a
|
|
64
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>
|
|
65
68
|
<k-filter-item filter-keywords="card components"><a
|
|
66
69
|
href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
|
|
67
70
|
<k-filter-item filter-keywords="code editor codeeditor monaco components"><a
|
|
@@ -117,6 +120,9 @@
|
|
|
117
120
|
<k-filter-item filter-keywords="sortable drag drop sort components"><a
|
|
118
121
|
href="../components/sortable.html"
|
|
119
122
|
>Sortable<br><small>Component</small></a></k-filter-item>
|
|
123
|
+
<k-filter-item filter-keywords="speech to text speechtotext microphone voice recognition transcription components"><a
|
|
124
|
+
href="../components/speech-to-text.html"
|
|
125
|
+
>Speech To Text<br><small>Component</small></a></k-filter-item>
|
|
120
126
|
<k-filter-item filter-keywords="spinner loading components"><a
|
|
121
127
|
href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
|
|
122
128
|
<k-filter-item filter-keywords="split pane components"><a
|
|
@@ -169,12 +175,18 @@
|
|
|
169
175
|
href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
|
|
170
176
|
<k-filter-item filter-keywords="tags tag input components"><a
|
|
171
177
|
href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
|
|
178
|
+
<k-filter-item filter-keywords="text to speech texttospeech tts speak voice synthesis components"><a
|
|
179
|
+
href="../components/text-to-speech.html"
|
|
180
|
+
>Text To Speech<br><small>Component</small></a></k-filter-item>
|
|
172
181
|
<k-filter-item filter-keywords="theme select dropdown dark light components"><a
|
|
173
182
|
href="../components/theme-select.html"
|
|
174
183
|
>Theme Select<br><small>Component</small></a></k-filter-item>
|
|
175
184
|
<k-filter-item filter-keywords="theme switcher dark light components"><a
|
|
176
185
|
href="../components/theme-switcher.html"
|
|
177
186
|
>Theme Switcher<br><small>Component</small></a></k-filter-item>
|
|
187
|
+
<k-filter-item filter-keywords="time picker clock hour minute form components"><a
|
|
188
|
+
href="../components/time.html"
|
|
189
|
+
>Time<br><small>Component</small></a></k-filter-item>
|
|
178
190
|
<k-filter-item filter-keywords="timestamp date time components"><a
|
|
179
191
|
href="../components/timestamp.html"
|
|
180
192
|
>Timestamp<br><small>Component</small></a></k-filter-item>
|
|
@@ -269,6 +281,7 @@
|
|
|
269
281
|
<h3>Components</h3>
|
|
270
282
|
<a href="../components/accordion.html">Accordion</a>
|
|
271
283
|
<a href="../components/aside.html">Aside</a>
|
|
284
|
+
<a href="../components/calendar.html">Calendar</a>
|
|
272
285
|
<a href="../components/card.html">Card</a>
|
|
273
286
|
<a href="../components/code-editor.html">Code Editor</a>
|
|
274
287
|
<a href="../components/combobox.html">Combobox</a>
|
|
@@ -290,13 +303,16 @@
|
|
|
290
303
|
<a href="../components/show-more.html">Show More</a>
|
|
291
304
|
<a href="../components/slider.html">Slider</a>
|
|
292
305
|
<a href="../components/sortable.html">Sortable</a>
|
|
306
|
+
<a href="../components/speech-to-text.html">Speech To Text</a>
|
|
293
307
|
<a href="../components/spinner.html">Spinner</a>
|
|
294
308
|
<a href="../components/split.html">Split</a>
|
|
295
309
|
<a href="../components/table.html">Table</a>
|
|
296
310
|
<a href="../components/tabs.html">Tabs</a>
|
|
297
311
|
<a href="../components/tags.html">Tags</a>
|
|
312
|
+
<a href="../components/text-to-speech.html">Text To Speech</a>
|
|
298
313
|
<a href="../components/theme-select.html">Theme Select</a>
|
|
299
314
|
<a href="../components/theme-switcher.html">Theme Switcher</a>
|
|
315
|
+
<a href="../components/time.html">Time</a>
|
|
300
316
|
<a href="../components/timestamp.html">Timestamp</a>
|
|
301
317
|
<a href="../components/toast.html">Toast</a>
|
|
302
318
|
<a href="../components/toggle.html">Toggle</a>
|
|
@@ -62,6 +62,9 @@
|
|
|
62
62
|
href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
|
|
63
63
|
<k-filter-item filter-keywords="aside sidebar components"><a
|
|
64
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>
|
|
65
68
|
<k-filter-item filter-keywords="card components"><a
|
|
66
69
|
href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
|
|
67
70
|
<k-filter-item filter-keywords="code editor codeeditor monaco components"><a
|
|
@@ -117,6 +120,9 @@
|
|
|
117
120
|
<k-filter-item filter-keywords="sortable drag drop sort components"><a
|
|
118
121
|
href="../components/sortable.html"
|
|
119
122
|
>Sortable<br><small>Component</small></a></k-filter-item>
|
|
123
|
+
<k-filter-item filter-keywords="speech to text speechtotext microphone voice recognition transcription components"><a
|
|
124
|
+
href="../components/speech-to-text.html"
|
|
125
|
+
>Speech To Text<br><small>Component</small></a></k-filter-item>
|
|
120
126
|
<k-filter-item filter-keywords="spinner loading components"><a
|
|
121
127
|
href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
|
|
122
128
|
<k-filter-item filter-keywords="split pane components"><a
|
|
@@ -169,12 +175,18 @@
|
|
|
169
175
|
href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
|
|
170
176
|
<k-filter-item filter-keywords="tags tag input components"><a
|
|
171
177
|
href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
|
|
178
|
+
<k-filter-item filter-keywords="text to speech texttospeech tts speak voice synthesis components"><a
|
|
179
|
+
href="../components/text-to-speech.html"
|
|
180
|
+
>Text To Speech<br><small>Component</small></a></k-filter-item>
|
|
172
181
|
<k-filter-item filter-keywords="theme select dropdown dark light components"><a
|
|
173
182
|
href="../components/theme-select.html"
|
|
174
183
|
>Theme Select<br><small>Component</small></a></k-filter-item>
|
|
175
184
|
<k-filter-item filter-keywords="theme switcher dark light components"><a
|
|
176
185
|
href="../components/theme-switcher.html"
|
|
177
186
|
>Theme Switcher<br><small>Component</small></a></k-filter-item>
|
|
187
|
+
<k-filter-item filter-keywords="time picker clock hour minute form components"><a
|
|
188
|
+
href="../components/time.html"
|
|
189
|
+
>Time<br><small>Component</small></a></k-filter-item>
|
|
178
190
|
<k-filter-item filter-keywords="timestamp date time components"><a
|
|
179
191
|
href="../components/timestamp.html"
|
|
180
192
|
>Timestamp<br><small>Component</small></a></k-filter-item>
|
|
@@ -269,6 +281,7 @@
|
|
|
269
281
|
<h3>Components</h3>
|
|
270
282
|
<a href="../components/accordion.html">Accordion</a>
|
|
271
283
|
<a href="../components/aside.html">Aside</a>
|
|
284
|
+
<a href="../components/calendar.html">Calendar</a>
|
|
272
285
|
<a href="../components/card.html">Card</a>
|
|
273
286
|
<a href="../components/code-editor.html">Code Editor</a>
|
|
274
287
|
<a href="../components/combobox.html">Combobox</a>
|
|
@@ -290,13 +303,16 @@
|
|
|
290
303
|
<a href="../components/show-more.html">Show More</a>
|
|
291
304
|
<a href="../components/slider.html">Slider</a>
|
|
292
305
|
<a href="../components/sortable.html">Sortable</a>
|
|
306
|
+
<a href="../components/speech-to-text.html">Speech To Text</a>
|
|
293
307
|
<a href="../components/spinner.html">Spinner</a>
|
|
294
308
|
<a href="../components/split.html">Split</a>
|
|
295
309
|
<a href="../components/table.html">Table</a>
|
|
296
310
|
<a href="../components/tabs.html">Tabs</a>
|
|
297
311
|
<a href="../components/tags.html">Tags</a>
|
|
312
|
+
<a href="../components/text-to-speech.html">Text To Speech</a>
|
|
298
313
|
<a href="../components/theme-select.html">Theme Select</a>
|
|
299
314
|
<a href="../components/theme-switcher.html">Theme Switcher</a>
|
|
315
|
+
<a href="../components/time.html">Time</a>
|
|
300
316
|
<a href="../components/timestamp.html">Timestamp</a>
|
|
301
317
|
<a href="../components/toast.html">Toast</a>
|
|
302
318
|
<a href="../components/toggle.html">Toggle</a>
|
|
@@ -62,6 +62,9 @@
|
|
|
62
62
|
href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
|
|
63
63
|
<k-filter-item filter-keywords="aside sidebar components"><a
|
|
64
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>
|
|
65
68
|
<k-filter-item filter-keywords="card components"><a
|
|
66
69
|
href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
|
|
67
70
|
<k-filter-item filter-keywords="code editor codeeditor monaco components"><a
|
|
@@ -117,6 +120,9 @@
|
|
|
117
120
|
<k-filter-item filter-keywords="sortable drag drop sort components"><a
|
|
118
121
|
href="../components/sortable.html"
|
|
119
122
|
>Sortable<br><small>Component</small></a></k-filter-item>
|
|
123
|
+
<k-filter-item filter-keywords="speech to text speechtotext microphone voice recognition transcription components"><a
|
|
124
|
+
href="../components/speech-to-text.html"
|
|
125
|
+
>Speech To Text<br><small>Component</small></a></k-filter-item>
|
|
120
126
|
<k-filter-item filter-keywords="spinner loading components"><a
|
|
121
127
|
href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
|
|
122
128
|
<k-filter-item filter-keywords="split pane components"><a
|
|
@@ -169,12 +175,18 @@
|
|
|
169
175
|
href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
|
|
170
176
|
<k-filter-item filter-keywords="tags tag input components"><a
|
|
171
177
|
href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
|
|
178
|
+
<k-filter-item filter-keywords="text to speech texttospeech tts speak voice synthesis components"><a
|
|
179
|
+
href="../components/text-to-speech.html"
|
|
180
|
+
>Text To Speech<br><small>Component</small></a></k-filter-item>
|
|
172
181
|
<k-filter-item filter-keywords="theme select dropdown dark light components"><a
|
|
173
182
|
href="../components/theme-select.html"
|
|
174
183
|
>Theme Select<br><small>Component</small></a></k-filter-item>
|
|
175
184
|
<k-filter-item filter-keywords="theme switcher dark light components"><a
|
|
176
185
|
href="../components/theme-switcher.html"
|
|
177
186
|
>Theme Switcher<br><small>Component</small></a></k-filter-item>
|
|
187
|
+
<k-filter-item filter-keywords="time picker clock hour minute form components"><a
|
|
188
|
+
href="../components/time.html"
|
|
189
|
+
>Time<br><small>Component</small></a></k-filter-item>
|
|
178
190
|
<k-filter-item filter-keywords="timestamp date time components"><a
|
|
179
191
|
href="../components/timestamp.html"
|
|
180
192
|
>Timestamp<br><small>Component</small></a></k-filter-item>
|
|
@@ -269,6 +281,7 @@
|
|
|
269
281
|
<h3>Components</h3>
|
|
270
282
|
<a href="../components/accordion.html">Accordion</a>
|
|
271
283
|
<a href="../components/aside.html">Aside</a>
|
|
284
|
+
<a href="../components/calendar.html">Calendar</a>
|
|
272
285
|
<a href="../components/card.html">Card</a>
|
|
273
286
|
<a href="../components/code-editor.html">Code Editor</a>
|
|
274
287
|
<a href="../components/combobox.html">Combobox</a>
|
|
@@ -290,13 +303,16 @@
|
|
|
290
303
|
<a href="../components/show-more.html">Show More</a>
|
|
291
304
|
<a href="../components/slider.html">Slider</a>
|
|
292
305
|
<a href="../components/sortable.html">Sortable</a>
|
|
306
|
+
<a href="../components/speech-to-text.html">Speech To Text</a>
|
|
293
307
|
<a href="../components/spinner.html">Spinner</a>
|
|
294
308
|
<a href="../components/split.html">Split</a>
|
|
295
309
|
<a href="../components/table.html">Table</a>
|
|
296
310
|
<a href="../components/tabs.html">Tabs</a>
|
|
297
311
|
<a href="../components/tags.html">Tags</a>
|
|
312
|
+
<a href="../components/text-to-speech.html">Text To Speech</a>
|
|
298
313
|
<a href="../components/theme-select.html">Theme Select</a>
|
|
299
314
|
<a href="../components/theme-switcher.html">Theme Switcher</a>
|
|
315
|
+
<a href="../components/time.html">Time</a>
|
|
300
316
|
<a href="../components/timestamp.html">Timestamp</a>
|
|
301
317
|
<a href="../components/toast.html">Toast</a>
|
|
302
318
|
<a href="../components/toggle.html">Toggle</a>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M395-435q-35-35-35-85v-240q0-50 35-85t85-35q50 0 85 35t35 85v240q0 50-35 85t-85 35q-50 0-85-35Zm85-205Zm-40 520v-123q-104-14-172-93t-68-184h80q0 83 58.5 141.5T480-320q83 0 141.5-58.5T680-520h80q0 105-68 184t-172 93v123h-80Zm68.5-371.5Q520-503 520-520v-240q0-17-11.5-28.5T480-800q-17 0-28.5 11.5T440-760v240q0 17 11.5 28.5T480-480q17 0 28.5-11.5Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="m798-322-62-62q44-41 69-97t25-119q0-63-25-118t-69-96l62-64q56 53 89 125t33 153q0 81-33 153t-89 125ZM670-450l-64-64q18-17 29-38.5t11-47.5q0-26-11-47.5T606-686l64-64q32 29 50 67.5t18 82.5q0 44-18 82.5T670-450Zm-310 10q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47ZM40-120v-112q0-33 17-62t47-44q51-26 115-44t141-18q77 0 141 18t115 44q30 15 47 44t17 62v112H40Zm80-80h480v-32q0-11-5.5-20T580-266q-36-18-92.5-36T360-320q-71 0-127.5 18T140-266q-9 5-14.5 14t-5.5 20v32Zm296.5-343.5Q440-567 440-600t-23.5-56.5Q393-680 360-680t-56.5 23.5Q280-633 280-600t23.5 56.5Q327-520 360-520t56.5-23.5ZM360-600Zm0 400Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M240-240v-480h480v480H240Z"/></svg>
|
package/docs/index.html
CHANGED
|
@@ -62,6 +62,9 @@
|
|
|
62
62
|
href="./components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
|
|
63
63
|
<k-filter-item filter-keywords="aside sidebar components"><a
|
|
64
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>
|
|
65
68
|
<k-filter-item filter-keywords="card components"><a
|
|
66
69
|
href="./components/card.html">Card<br><small>Component</small></a></k-filter-item>
|
|
67
70
|
<k-filter-item filter-keywords="code editor codeeditor monaco components"><a
|
|
@@ -117,6 +120,9 @@
|
|
|
117
120
|
<k-filter-item filter-keywords="sortable drag drop sort components"><a
|
|
118
121
|
href="./components/sortable.html"
|
|
119
122
|
>Sortable<br><small>Component</small></a></k-filter-item>
|
|
123
|
+
<k-filter-item filter-keywords="speech to text speechtotext microphone voice recognition transcription components"><a
|
|
124
|
+
href="./components/speech-to-text.html"
|
|
125
|
+
>Speech To Text<br><small>Component</small></a></k-filter-item>
|
|
120
126
|
<k-filter-item filter-keywords="spinner loading components"><a
|
|
121
127
|
href="./components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
|
|
122
128
|
<k-filter-item filter-keywords="split pane components"><a
|
|
@@ -169,12 +175,18 @@
|
|
|
169
175
|
href="./components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
|
|
170
176
|
<k-filter-item filter-keywords="tags tag input components"><a
|
|
171
177
|
href="./components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
|
|
178
|
+
<k-filter-item filter-keywords="text to speech texttospeech tts speak voice synthesis components"><a
|
|
179
|
+
href="./components/text-to-speech.html"
|
|
180
|
+
>Text To Speech<br><small>Component</small></a></k-filter-item>
|
|
172
181
|
<k-filter-item filter-keywords="theme select dropdown dark light components"><a
|
|
173
182
|
href="./components/theme-select.html"
|
|
174
183
|
>Theme Select<br><small>Component</small></a></k-filter-item>
|
|
175
184
|
<k-filter-item filter-keywords="theme switcher dark light components"><a
|
|
176
185
|
href="./components/theme-switcher.html"
|
|
177
186
|
>Theme Switcher<br><small>Component</small></a></k-filter-item>
|
|
187
|
+
<k-filter-item filter-keywords="time picker clock hour minute form components"><a
|
|
188
|
+
href="./components/time.html"
|
|
189
|
+
>Time<br><small>Component</small></a></k-filter-item>
|
|
178
190
|
<k-filter-item filter-keywords="timestamp date time components"><a
|
|
179
191
|
href="./components/timestamp.html"
|
|
180
192
|
>Timestamp<br><small>Component</small></a></k-filter-item>
|
|
@@ -269,6 +281,7 @@
|
|
|
269
281
|
<h3>Components</h3>
|
|
270
282
|
<a href="./components/accordion.html">Accordion</a>
|
|
271
283
|
<a href="./components/aside.html">Aside</a>
|
|
284
|
+
<a href="./components/calendar.html">Calendar</a>
|
|
272
285
|
<a href="./components/card.html">Card</a>
|
|
273
286
|
<a href="./components/code-editor.html">Code Editor</a>
|
|
274
287
|
<a href="./components/combobox.html">Combobox</a>
|
|
@@ -290,13 +303,16 @@
|
|
|
290
303
|
<a href="./components/show-more.html">Show More</a>
|
|
291
304
|
<a href="./components/slider.html">Slider</a>
|
|
292
305
|
<a href="./components/sortable.html">Sortable</a>
|
|
306
|
+
<a href="./components/speech-to-text.html">Speech To Text</a>
|
|
293
307
|
<a href="./components/spinner.html">Spinner</a>
|
|
294
308
|
<a href="./components/split.html">Split</a>
|
|
295
309
|
<a href="./components/table.html">Table</a>
|
|
296
310
|
<a href="./components/tabs.html">Tabs</a>
|
|
297
311
|
<a href="./components/tags.html">Tags</a>
|
|
312
|
+
<a href="./components/text-to-speech.html">Text To Speech</a>
|
|
298
313
|
<a href="./components/theme-select.html">Theme Select</a>
|
|
299
314
|
<a href="./components/theme-switcher.html">Theme Switcher</a>
|
|
315
|
+
<a href="./components/time.html">Time</a>
|
|
300
316
|
<a href="./components/timestamp.html">Timestamp</a>
|
|
301
317
|
<a href="./components/toast.html">Toast</a>
|
|
302
318
|
<a href="./components/toggle.html">Toggle</a>
|
|
@@ -490,6 +506,12 @@
|
|
|
490
506
|
<p class="tc-muted">Enhanced sidebar component with push and overlay modes.</p>
|
|
491
507
|
</a>
|
|
492
508
|
</div>
|
|
509
|
+
<div class="span-12 t-span-6 d-span-4 px">
|
|
510
|
+
<a href="./components/calendar.html" class="card mb no-link d-b">
|
|
511
|
+
<h3 class="tc-primary">Calendar</h3>
|
|
512
|
+
<p class="tc-muted">Month-grid date picker widget with single and range selection modes.</p>
|
|
513
|
+
</a>
|
|
514
|
+
</div>
|
|
493
515
|
<div class="span-12 t-span-6 d-span-4 px">
|
|
494
516
|
<a href="./components/card.html" class="card mb no-link d-b">
|
|
495
517
|
<h3 class="tc-primary">Card</h3>
|
|
@@ -616,6 +638,12 @@
|
|
|
616
638
|
<p class="tc-muted">Drag-and-drop lists with reordering and sort events.</p>
|
|
617
639
|
</a>
|
|
618
640
|
</div>
|
|
641
|
+
<div class="span-12 t-span-6 d-span-4 px">
|
|
642
|
+
<a href="./components/speech-to-text.html" class="card mb no-link d-b">
|
|
643
|
+
<h3 class="tc-primary">Speech To Text</h3>
|
|
644
|
+
<p class="tc-muted">Microphone button that uses the Web Speech API to transcribe spoken input.</p>
|
|
645
|
+
</a>
|
|
646
|
+
</div>
|
|
619
647
|
<div class="span-12 t-span-6 d-span-4 px">
|
|
620
648
|
<a href="./components/spinner.html" class="card mb no-link d-b">
|
|
621
649
|
<h3 class="tc-primary">Spinner</h3>
|
|
@@ -646,6 +674,12 @@
|
|
|
646
674
|
<p class="tc-muted">Input field for adding and removing tags with keyboard support.</p>
|
|
647
675
|
</a>
|
|
648
676
|
</div>
|
|
677
|
+
<div class="span-12 t-span-6 d-span-4 px">
|
|
678
|
+
<a href="./components/text-to-speech.html" class="card mb no-link d-b">
|
|
679
|
+
<h3 class="tc-primary">Text To Speech</h3>
|
|
680
|
+
<p class="tc-muted">Button that speaks the given text aloud using the browser's SpeechSynthesis API.</p>
|
|
681
|
+
</a>
|
|
682
|
+
</div>
|
|
649
683
|
<div class="span-12 t-span-6 d-span-4 px">
|
|
650
684
|
<a href="./components/theme-select.html" class="card mb no-link d-b">
|
|
651
685
|
<h3 class="tc-primary">Theme Select</h3>
|
|
@@ -658,6 +692,12 @@
|
|
|
658
692
|
<p class="tc-muted">Toggle between light, dark, and auto theme modes.</p>
|
|
659
693
|
</a>
|
|
660
694
|
</div>
|
|
695
|
+
<div class="span-12 t-span-6 d-span-4 px">
|
|
696
|
+
<a href="./components/time.html" class="card mb no-link d-b">
|
|
697
|
+
<h3 class="tc-primary">Time</h3>
|
|
698
|
+
<p class="tc-muted">Time picker with 12/24-hour display, configurable minute increments, and form submission.</p>
|
|
699
|
+
</a>
|
|
700
|
+
</div>
|
|
661
701
|
<div class="span-12 t-span-6 d-span-4 px">
|
|
662
702
|
<a href="./components/timestamp.html" class="card mb no-link d-b">
|
|
663
703
|
<h3 class="tc-primary">Timestamp</h3>
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import{html as e,css as t}from"../lit-all.min.js";import a from"./ShadowComponent.js";const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Su","Mo","Tu","We","Th","Fr","Sa"];export default class r extends a{static formAssociated=!0;static properties={value:{type:String,reflect:!0},name:{type:String,reflect:!0},mode:{type:String,reflect:!0},min:{type:String,reflect:!0},max:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},view:{state:!0},hoverDate:{state:!0}};constructor(){super(),this.internals=this.attachInternals(),this.value="",this.name="",this.mode="single",this.min="",this.max="",this.disabled=!1,this.required=!1;const e=new Date;this.view=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`,this.hoverDate=null}#e=!1;updated(e){if(super.updated(e),this.internals.setFormValue(this.value),this.required&&!this.value?this.internals.setValidity({valueMissing:!0},"Please select a date.",this.shadowRoot?.querySelector(".day")):this.internals.setValidity({}),e.has("value")&&void 0!==e.get("value")&&this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0})),e.has("value")&&this.value&&!this.#e){const e=this.fromIso(this.value.split(",")[0]);if(e){const t=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`;t!==this.view&&(this.view=t)}}this.#e=!1}get isRange(){return"range"===this.mode}get viewYear(){return Number(this.view.split("-")[0])}get viewMonth(){return Number(this.view.split("-")[1])-1}get parsed(){if(!this.value)return this.isRange?{start:null,end:null}:{date:null};if(this.isRange){const[e,t]=this.value.split(",");return{start:e?this.fromIso(e):null,end:t?this.fromIso(t):null}}return{date:this.fromIso(this.value)}}toIso=e=>e?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:"";fromIso=e=>{if(!e)return null;const[t,a,i]=e.split("-").map(Number);return isNaN(t)||isNaN(a)||isNaN(i)?null:new Date(t,a-1,i)};isSameDay=(e,t)=>!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate());isWithinRange=(e,t,a)=>{if(!t||!a||!e)return!1;const i=e.getTime();return i>t.getTime()&&i<a.getTime()};resolveDate=e=>{if(!e)return null;const t=String(e).toLowerCase();if("today"===t||"tomorrow"===t||"yesterday"===t){const e=new Date;return e.setHours(0,0,0,0),"tomorrow"===t&&e.setDate(e.getDate()+1),"yesterday"===t&&e.setDate(e.getDate()-1),e}return this.fromIso(e)};get minDate(){return this.resolveDate(this.min)||this.fromIso("1900-01-01")}get maxDate(){if(this.max)return this.resolveDate(this.max);const e=new Date;return new Date(e.getFullYear()+10,11,31)}isDisabledDate=e=>{if(!e)return!1;const t=this.minDate;if(t&&e<t)return!0;const a=this.maxDate;return!!(a&&e>a)};get availableYears(){const e=this.minDate?.getFullYear()??1900,t=this.maxDate?.getFullYear()??(new Date).getFullYear()+10,a=[];for(let i=e;i<=t;i++)a.push(i);return a}isMonthDisabled=(e,t)=>{const a=new Date(e,t+1,0),i=new Date(e,t,1),s=this.minDate,r=this.maxDate;return!!(s&&a<s)||!!(r&&i>r)};get weekGrid(){const e=this.viewYear,t=this.viewMonth,a=new Date(e,t,1).getDay(),i=new Date(e,t,1-a),s=[];for(let e=0;e<6;e++){const t=[];for(let a=0;a<7;a++){const s=new Date(i);s.setDate(i.getDate()+7*e+a),t.push(s)}s.push(t)}return s}get monthLabel(){return`${i[this.viewMonth]} ${this.viewYear}`}prevMonth=()=>{const e=new Date(this.viewYear,this.viewMonth-1,1);this.view=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`};nextMonth=()=>{const e=new Date(this.viewYear,this.viewMonth+1,1);this.view=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`};goToMonth=(e,t)=>{this.view=`${e}-${String(t+1).padStart(2,"0")}`};goToToday=()=>{const e=new Date;this.view=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`};handleDayClick=e=>{if(!this.disabled&&!this.isDisabledDate(e))if(this.#e=!0,this.isRange){const{start:t,end:a}=this.parsed;this.value=!t||a?this.toIso(e):e<t?`${this.toIso(e)},${this.toIso(t)}`:`${this.toIso(t)},${this.toIso(e)}`}else this.value=this.toIso(e)};handleDayHover=e=>{this.isRange&&(this.hoverDate=e)};handleMouseLeave=()=>{this.isRange&&(this.hoverDate=null)};handleMonthChange=e=>{this.goToMonth(this.viewYear,Number(e.target.value))};handleYearChange=e=>{this.goToMonth(Number(e.target.value),this.viewMonth)};render(){const t=new Date,a=this.parsed,r=a.date,n=a.start,o=a.end,l=this.isRange&&n&&!o&&this.hoverDate?this.hoverDate:o,d=this.isRange&&n&&l&&n>l?l:n,h=this.isRange&&n&&l&&n>l?n:l;return e`
|
|
2
|
+
<div class="header">
|
|
3
|
+
<select
|
|
4
|
+
class="month-select"
|
|
5
|
+
aria-label="Month"
|
|
6
|
+
?disabled=${this.disabled}
|
|
7
|
+
@change=${this.handleMonthChange}
|
|
8
|
+
>
|
|
9
|
+
${i.map((t,a)=>e`
|
|
10
|
+
<option
|
|
11
|
+
value=${a}
|
|
12
|
+
?selected=${a===this.viewMonth}
|
|
13
|
+
?disabled=${this.isMonthDisabled(this.viewYear,a)}
|
|
14
|
+
>${t}</option>
|
|
15
|
+
`)}
|
|
16
|
+
</select>
|
|
17
|
+
<select
|
|
18
|
+
class="year-select"
|
|
19
|
+
aria-label="Year"
|
|
20
|
+
?disabled=${this.disabled}
|
|
21
|
+
@change=${this.handleYearChange}
|
|
22
|
+
>
|
|
23
|
+
${this.availableYears.map(t=>e`
|
|
24
|
+
<option value=${t} ?selected=${t===this.viewYear}>${t}</option>
|
|
25
|
+
`)}
|
|
26
|
+
</select>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="grid" @mouseleave=${this.handleMouseLeave}>
|
|
29
|
+
<div class="row head">
|
|
30
|
+
${s.map(t=>e`<div class="dow">${t}</div>`)}
|
|
31
|
+
</div>
|
|
32
|
+
${this.weekGrid.map(a=>e`
|
|
33
|
+
<div class="row">
|
|
34
|
+
${a.map(a=>{const i=a.getMonth()!==this.viewMonth,s=this.isSameDay(a,t),n=!this.isRange&&this.isSameDay(a,r),l=this.isRange&&this.isSameDay(a,d),g=this.isRange&&this.isSameDay(a,h),u=this.isRange&&this.isWithinRange(a,d,h),c=this.isDisabledDate(a),v=["day",i?"outside":"",s?"today":"",n?"selected":"",l?"range-start":"",g&&!l?"range-end":"",u?"in-range":"",this.isRange&&!o&&(l||g||u)&&!n?"preview":"",c?"disabled":""].filter(Boolean).join(" ");return e`
|
|
35
|
+
<button
|
|
36
|
+
type="button"
|
|
37
|
+
class="no-btn ${v}"
|
|
38
|
+
?disabled=${c||this.disabled}
|
|
39
|
+
aria-selected=${n||l||g?"true":"false"}
|
|
40
|
+
@click=${()=>this.handleDayClick(a)}
|
|
41
|
+
@mouseenter=${()=>this.handleDayHover(a)}
|
|
42
|
+
>${a.getDate()}</button>
|
|
43
|
+
`})}
|
|
44
|
+
</div>
|
|
45
|
+
`)}
|
|
46
|
+
</div>
|
|
47
|
+
`}static styles=t`
|
|
48
|
+
:host {
|
|
49
|
+
--day_size: 2rem;
|
|
50
|
+
--day_radius: var(--radius);
|
|
51
|
+
--day_bg__selected: var(--c_primary);
|
|
52
|
+
--day_tc__selected: white;
|
|
53
|
+
--day_bg__range: var(--c_bg__alt);
|
|
54
|
+
--day_bg__hover: var(--c_bg__alt);
|
|
55
|
+
|
|
56
|
+
display: inline-block;
|
|
57
|
+
border: 1px solid var(--c_border);
|
|
58
|
+
border-radius: var(--radius);
|
|
59
|
+
padding: 0.5rem;
|
|
60
|
+
background: var(--c_bg);
|
|
61
|
+
user-select: none;
|
|
62
|
+
}
|
|
63
|
+
:host([disabled]) {
|
|
64
|
+
opacity: 0.5;
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
}
|
|
67
|
+
.header {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: 0.25rem;
|
|
71
|
+
padding: 0.25rem;
|
|
72
|
+
margin-bottom: 0.25rem;
|
|
73
|
+
}
|
|
74
|
+
.month-select,
|
|
75
|
+
.year-select {
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
width: auto;
|
|
78
|
+
}
|
|
79
|
+
.month-select {
|
|
80
|
+
flex: 1;
|
|
81
|
+
}
|
|
82
|
+
.grid {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
}
|
|
86
|
+
.row {
|
|
87
|
+
display: grid;
|
|
88
|
+
grid-template-columns: repeat(7, var(--day_size));
|
|
89
|
+
}
|
|
90
|
+
.row.head {
|
|
91
|
+
margin-bottom: 0.25rem;
|
|
92
|
+
}
|
|
93
|
+
.dow {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
font-size: 0.75rem;
|
|
98
|
+
color: var(--tc_muted);
|
|
99
|
+
font-weight: 500;
|
|
100
|
+
height: var(--day_size);
|
|
101
|
+
}
|
|
102
|
+
.day {
|
|
103
|
+
appearance: none;
|
|
104
|
+
background: transparent;
|
|
105
|
+
border: 1px solid transparent;
|
|
106
|
+
border-radius: var(--day_radius);
|
|
107
|
+
width: var(--day_size);
|
|
108
|
+
height: var(--day_size);
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
color: var(--tc);
|
|
111
|
+
font: inherit;
|
|
112
|
+
font-size: 0.875rem;
|
|
113
|
+
padding: 0;
|
|
114
|
+
position: relative;
|
|
115
|
+
display: inline-flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
transition: background var(--animation_ms), color var(--animation_ms);
|
|
119
|
+
}
|
|
120
|
+
.day:hover:not(:disabled):not(.selected):not(.range-start):not(.range-end) {
|
|
121
|
+
background: var(--day_bg__hover);
|
|
122
|
+
}
|
|
123
|
+
.day:focus-visible {
|
|
124
|
+
outline: none;
|
|
125
|
+
border-color: var(--c_primary);
|
|
126
|
+
box-shadow: var(--focus_shadow);
|
|
127
|
+
z-index: 1;
|
|
128
|
+
}
|
|
129
|
+
.day.outside {
|
|
130
|
+
color: var(--tc_muted);
|
|
131
|
+
opacity: 0.5;
|
|
132
|
+
}
|
|
133
|
+
.day.today {
|
|
134
|
+
font-weight: 700;
|
|
135
|
+
border-color: var(--c_primary);
|
|
136
|
+
}
|
|
137
|
+
.day.selected,
|
|
138
|
+
.day.in-range,
|
|
139
|
+
.day.range-start,
|
|
140
|
+
.day.range-end {
|
|
141
|
+
background: var(--day_bg__selected);
|
|
142
|
+
color: var(--day_tc__selected);
|
|
143
|
+
border-color: transparent;
|
|
144
|
+
}
|
|
145
|
+
.day.in-range {
|
|
146
|
+
border-radius: 0;
|
|
147
|
+
}
|
|
148
|
+
.day.range-start:not(.range-end) {
|
|
149
|
+
border-top-right-radius: 0;
|
|
150
|
+
border-bottom-right-radius: 0;
|
|
151
|
+
}
|
|
152
|
+
.day.range-end:not(.range-start) {
|
|
153
|
+
border-top-left-radius: 0;
|
|
154
|
+
border-bottom-left-radius: 0;
|
|
155
|
+
}
|
|
156
|
+
.day.outside.in-range,
|
|
157
|
+
.day.outside.range-start,
|
|
158
|
+
.day.outside.range-end {
|
|
159
|
+
opacity: 0.6;
|
|
160
|
+
}
|
|
161
|
+
.day.preview.in-range,
|
|
162
|
+
.day.preview.range-start,
|
|
163
|
+
.day.preview.range-end {
|
|
164
|
+
opacity: 0.75;
|
|
165
|
+
}
|
|
166
|
+
.day:disabled {
|
|
167
|
+
opacity: 0.3;
|
|
168
|
+
cursor: not-allowed;
|
|
169
|
+
}
|
|
170
|
+
`}customElements.define("k-calendar",r);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import{html as t,css as i}from"../lit-all.min.js";import n from"./ShadowComponent.js";import"./Icon.js";export default class e extends n{static properties={language:{type:String,reflect:!0},continuous:{type:Boolean,reflect:!0},interim:{type:Boolean,reflect:!0},minConfidence:{type:Number,reflect:!0,attribute:"min-confidence"},timeout:{type:Number,reflect:!0},disabled:{type:Boolean,reflect:!0},listening:{type:Boolean,reflect:!0}};#t=null;#i="";#n="";#e=!1;#s=null;constructor(){super(),this.language="en-US",this.continuous=!1,this.interim=!1,this.minConfidence=0,this.timeout=0,this.disabled=!1,this.listening=!1}connectedCallback(){super.connectedCallback();const t=window.SpeechRecognition||window.webkitSpeechRecognition;t?(this.#t=new t,this.#t.lang=this.language,this.#t.continuous=this.continuous,this.#t.interimResults=!0,this.#t.onstart=this.handleStart,this.#t.onend=this.handleEnd,this.#t.onresult=this.handleResult,this.#t.onerror=this.handleError):this.#e=!0}disconnectedCallback(){if(super.disconnectedCallback(),this.#o(),this.#t){try{this.#t.stop()}catch(t){}this.#t.onstart=null,this.#t.onend=null,this.#t.onresult=null,this.#t.onerror=null,this.#t=null}}updated(t){super.updated(t),this.#t&&(t.has("language")&&(this.#t.lang=this.language),t.has("continuous")&&(this.#t.continuous=this.continuous))}handleStart=()=>{this.#i="",this.#n="",this.listening=!0,this.#r(),this.dispatchEvent(new CustomEvent("start",{bubbles:!0}))};handleResult=t=>{let i="",n="";for(let e=t.resultIndex;e<t.results.length;e++){const s=t.results[e],o=s[0];("number"==typeof o.confidence?o.confidence:0)<this.minConfidence||(s.isFinal?i+=o.transcript:n+=o.transcript)}i&&(this.#i+=i),(i||n)&&(this.#n=n),(i||this.interim)&&this.dispatchEvent(new CustomEvent("result",{detail:{text:(this.#i+(n||this.#n)).trim(),isFinal:!!i&&!n},bubbles:!0}))};handleEnd=()=>{this.listening=!1,this.#o();const t=(this.#i+this.#n).trim();this.dispatchEvent(new CustomEvent("end",{detail:{text:t},bubbles:!0}))};handleError=t=>{this.listening=!1,this.#o(),this.dispatchEvent(new CustomEvent("error",{detail:{error:t.error,message:t.message},bubbles:!0}))};#r=()=>{this.#o(),this.timeout>0&&(this.#s=setTimeout(()=>this.stop(),1e3*this.timeout))};#o=()=>{this.#s&&(clearTimeout(this.#s),this.#s=null)};handleClick=()=>{this.disabled||(this.listening?this.stop():this.start())};start=()=>{if(!this.disabled&&this.#t&&!this.listening)try{this.#t.start()}catch(t){}};stop=()=>{if(this.#t&&this.listening)try{this.#t.stop()}catch(t){}};toggle=()=>{this.handleClick()};render(){const i=!this.#e,n=i?this.listening?"Stop listening":"Start listening":"Speech recognition not supported in this browser";return t`
|
|
2
|
+
<button
|
|
3
|
+
type="button"
|
|
4
|
+
class="no-btn btn ${this.listening?"listening":""}"
|
|
5
|
+
?disabled=${this.disabled||!i}
|
|
6
|
+
@click=${this.handleClick}
|
|
7
|
+
aria-label=${n}
|
|
8
|
+
title=${n}
|
|
9
|
+
>
|
|
10
|
+
<k-icon name=${this.listening?"stop":"mic"}></k-icon>
|
|
11
|
+
</button>
|
|
12
|
+
`}static styles=i`
|
|
13
|
+
:host {
|
|
14
|
+
--btn_size: 2.5rem;
|
|
15
|
+
--btn_bg: var(--c_bg);
|
|
16
|
+
--btn_bg__listening: var(--c_danger, #d32f2f);
|
|
17
|
+
--btn_tc__listening: white;
|
|
18
|
+
display: inline-block;
|
|
19
|
+
}
|
|
20
|
+
:host([disabled]) {
|
|
21
|
+
opacity: 0.5;
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
}
|
|
24
|
+
.btn {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
width: var(--btn_size);
|
|
29
|
+
height: var(--btn_size);
|
|
30
|
+
padding: 0;
|
|
31
|
+
border: 1px solid var(--c_border);
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
background: var(--btn_bg);
|
|
34
|
+
color: var(--tc);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
transition: background var(--animation_ms), color var(--animation_ms), border-color var(--animation_ms);
|
|
37
|
+
}
|
|
38
|
+
.btn:hover:not(:disabled) {
|
|
39
|
+
background: var(--c_bg__alt);
|
|
40
|
+
}
|
|
41
|
+
.btn:focus-visible {
|
|
42
|
+
outline: none;
|
|
43
|
+
box-shadow: var(--focus_shadow);
|
|
44
|
+
}
|
|
45
|
+
:host([listening]) .btn,
|
|
46
|
+
:host([listening]) .btn:hover,
|
|
47
|
+
:host([listening]) .btn:focus-visible {
|
|
48
|
+
background: var(--btn_bg__listening);
|
|
49
|
+
color: var(--btn_tc__listening);
|
|
50
|
+
border-color: transparent;
|
|
51
|
+
animation: pulse 1.4s infinite;
|
|
52
|
+
}
|
|
53
|
+
.btn:disabled {
|
|
54
|
+
cursor: not-allowed;
|
|
55
|
+
}
|
|
56
|
+
@keyframes pulse {
|
|
57
|
+
0%, 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.5); }
|
|
58
|
+
50% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); }
|
|
59
|
+
}
|
|
60
|
+
`}customElements.define("k-speech-to-text",e);
|