kempo-ui 0.1.5 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/skills/highlight-code/SKILL.md +22 -6
- package/.github/skills/new-component/SKILL.md +68 -4
- package/AGENTS.md +11 -0
- package/bin/highlight_code.js +7 -15
- package/dist/components/Aside.js +326 -0
- package/dist/components/Dialog.js +1 -1
- package/dist/components/Dropdown.js +1 -1
- package/dist/components/Main.js +2 -2
- package/dist/components/Nav.js +27 -0
- package/dist/components/PhotoViewer.js +1 -1
- package/dist/components/ShadowComponent.js +1 -1
- package/dist/components/ThemeSelect.js +5 -1
- package/dist/components/ThemeSwitcher.js +1 -0
- package/dist/components/Toast.js +1 -1
- package/docs/components/accordion.html +4 -3
- package/docs/components/aside-items.html +43 -0
- package/docs/components/aside-menu.html +43 -0
- package/docs/components/aside-push.html +26 -0
- package/docs/components/aside.html +567 -0
- package/docs/components/card.html +4 -3
- package/docs/components/color-picker.html +4 -3
- package/docs/components/content-slider.html +4 -3
- package/docs/components/dialog.html +4 -3
- package/docs/components/dropdown.html +4 -3
- package/docs/components/filter-list.html +4 -3
- package/docs/components/focus-capture.html +6 -5
- package/docs/components/html-editor.html +5 -4
- package/docs/components/hybrid-component.html +5 -4
- package/docs/components/icon.html +4 -3
- package/docs/components/import.html +5 -4
- package/docs/components/light-component.html +4 -3
- package/docs/components/nav.html +117 -0
- package/docs/components/photo-viewer.html +5 -4
- package/docs/components/resize.html +5 -4
- package/docs/components/shadow-component.html +4 -3
- package/docs/components/show-more.html +5 -4
- package/docs/components/sortable.html +4 -3
- package/docs/components/spinner.html +4 -3
- package/docs/components/split.html +5 -4
- package/docs/components/table.html +4 -3
- package/docs/components/tableControls.html +4 -3
- package/docs/components/tableCustomFields.html +4 -3
- package/docs/components/tableFetchRecords.html +5 -4
- package/docs/components/tableFieldSortHide.html +5 -4
- package/docs/components/tablePagination.html +4 -3
- package/docs/components/tableRecordEditing.html +4 -3
- package/docs/components/tableRecordFiltering.html +5 -4
- package/docs/components/tableRecordHiding.html +4 -3
- package/docs/components/tableRecordSearching.html +5 -4
- package/docs/components/tableRecordSelection.html +4 -3
- package/docs/components/tableRowControls.html +4 -3
- package/docs/components/tableServerSync.html +5 -4
- package/docs/components/tableSorting.html +5 -4
- package/docs/components/tabs.html +4 -3
- package/docs/components/tags.html +4 -3
- package/docs/components/theme-select.html +4 -3
- package/docs/components/theme-switcher.html +5 -4
- package/docs/components/timestamp.html +4 -3
- package/docs/components/toast.html +4 -3
- package/docs/components/toggle.html +5 -4
- package/docs/components/tree.html +5 -4
- package/docs/index.html +22 -21
- package/docs/nav-1.inc.html +18 -12
- package/docs/nav.inc.html +20 -13
- package/docs/nav.inc.js +1 -1
- package/docs/src/components/Aside.js +326 -0
- package/docs/src/components/Dialog.js +1 -1
- package/docs/src/components/Dropdown.js +1 -1
- package/docs/src/components/Main.js +2 -2
- package/docs/src/components/Nav.js +27 -0
- package/docs/src/components/PhotoViewer.js +1 -1
- package/docs/src/components/ShadowComponent.js +1 -1
- package/docs/src/components/ThemeSelect.js +5 -1
- package/docs/src/components/ThemeSwitcher.js +1 -0
- package/docs/src/components/Toast.js +1 -1
- package/docs/utils/context.html +4 -3
- package/docs/utils/cookie.html +4 -3
- package/docs/utils/debounce.html +4 -3
- package/docs/utils/drag.html +4 -3
- package/docs/utils/elevation.html +156 -0
- package/docs/utils/formatTimestamp.html +4 -3
- package/docs/utils/object.html +4 -3
- package/docs/utils/propConverters.html +4 -3
- package/docs/utils/string.html +4 -3
- package/docs/utils/theme.html +4 -3
- package/docs/utils/toTitleCase.html +4 -3
- package/docs/utils/type.html +4 -3
- package/docs/utils/wait.html +4 -3
- package/llm.txt.md +247 -0
- package/package.json +3 -4
- package/src/components/Aside.js +726 -0
- package/src/components/Dialog.js +1 -1
- package/src/components/Dropdown.js +1 -1
- package/src/components/Main.js +34 -30
- package/src/components/Nav.js +53 -0
- package/src/components/PhotoViewer.js +1 -1
- package/src/components/ShadowComponent.js +1 -1
- package/src/components/ThemeSelect.js +8 -0
- package/src/components/ThemeSwitcher.js +1 -0
- package/src/components/Toast.js +1 -1
- package/tests/bin/get_icon.node-test.js +26 -0
- package/tests/bin/highlight_code.node-test.js +108 -0
- package/tests/bin/list_icons.node-test.js +26 -0
- package/tests/components/Aside.browser-test.js +778 -0
- package/tests/components/Main.browser-test.js +115 -283
- package/dist/components/SideMenu.js +0 -97
- package/dist/components/SidePanel.js +0 -236
- package/docs/components/side-menu.html +0 -189
- package/docs/components/side-panel-basic.html +0 -44
- package/docs/components/side-panel-dual.html +0 -70
- package/docs/components/side-panel-menu.html +0 -50
- package/docs/components/side-panel-persistent.html +0 -90
- package/docs/components/side-panel-scroll.html +0 -176
- package/docs/components/side-panel.html +0 -245
- package/docs/src/components/SideMenu.js +0 -97
- package/docs/src/components/SidePanel.js +0 -236
- package/scripts/update-kempo-css.js +0 -53
- package/src/components/SideMenu.js +0 -178
- package/src/components/SidePanel.js +0 -513
- package/tests/components/SideMenu.browser-test.js +0 -667
- package/tests/components/SidePanel.browser-test.js +0 -520
- package/tools/highlight.js +0 -51
|
@@ -11,32 +11,48 @@ Use this skill whenever you need syntax-highlighted HTML to embed in a documenta
|
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
|
+
Pipe code via stdin (supports multi-line):
|
|
14
15
|
```powershell
|
|
15
|
-
|
|
16
|
+
@"
|
|
17
|
+
<div class='container'>
|
|
18
|
+
<h1>Hello</h1>
|
|
19
|
+
</div>
|
|
20
|
+
"@ | npx kempo-highlightcode <lang>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or pass minified code as an argument:
|
|
24
|
+
```powershell
|
|
25
|
+
npx kempo-highlightcode <lang> "<div class='container'><h1>Hello</h1></div>"
|
|
16
26
|
```
|
|
17
27
|
|
|
18
28
|
**Supported languages:** `html`, `css`, `js` / `javascript`, `ts` / `typescript`, `json`, `md` / `markdown`, `sh` / `bash`, `xml`
|
|
19
29
|
|
|
20
30
|
## Output
|
|
21
31
|
|
|
22
|
-
Prints
|
|
32
|
+
Prints a complete `<pre><code class="hljs {lang}">…</code></pre>` block to stdout, with `<br>` tags instead of newlines — a single line suitable for embedding directly in HTML.
|
|
23
33
|
|
|
24
34
|
Input is automatically beautified before highlighting, so you can pass minified code.
|
|
25
35
|
|
|
26
36
|
## Workflow for Updating Doc Code Samples
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
Pipe the code into the script, capture to `$hl`, then use PowerShell's `.Replace()` to patch the HTML file:
|
|
29
39
|
|
|
30
40
|
```powershell
|
|
31
|
-
$hl =
|
|
41
|
+
$hl = @"
|
|
42
|
+
<k-table id=myExample></k-table>
|
|
43
|
+
<script type=module>
|
|
44
|
+
doSomething('foo');
|
|
45
|
+
</script>
|
|
46
|
+
"@ | npx kempo-highlightcode xml
|
|
32
47
|
$html = [System.IO.File]::ReadAllText((Resolve-Path 'docs/components/my-component.html'))
|
|
33
48
|
$old = [regex]::Match($html, '(?s)<pre><code class="hljs xml">.*?</code></pre>').Value
|
|
34
|
-
[System.IO.File]::WriteAllText((Resolve-Path 'docs/components/my-component.html'), $html.Replace($old,
|
|
49
|
+
[System.IO.File]::WriteAllText((Resolve-Path 'docs/components/my-component.html'), $html.Replace($old, $hl))
|
|
35
50
|
```
|
|
36
51
|
|
|
37
52
|
## Important Notes
|
|
38
53
|
|
|
39
|
-
- Use
|
|
54
|
+
- Use PowerShell **here-strings** (`@"…"@`) for multi-line code input via stdin.
|
|
55
|
+
- Use **single-quotes** for JS string literals inside the code. This preserves all quoting correctly through to node.
|
|
40
56
|
- HTML attribute values should be **unquoted** in the argument (`id=foo` not `id="foo"`) — the beautifier adds consistent formatting anyway.
|
|
41
57
|
- Use `[System.IO.File]::ReadAllText` / `WriteAllText` + `.Replace()` (not `-replace`) to avoid regex interpretation of the replacement string.
|
|
42
58
|
- If a page has multiple `<pre><code>` blocks, adjust the regex to match the specific one (e.g. match by a nearby unique string, or loop with an index).
|
|
@@ -13,13 +13,14 @@ Use this skill any time you are asked to create a new component or add a new cus
|
|
|
13
13
|
|
|
14
14
|
## Overview
|
|
15
15
|
|
|
16
|
-
Creating a component involves
|
|
16
|
+
Creating a component involves six steps:
|
|
17
17
|
|
|
18
18
|
1. **Choose the base component** — pick the right rendering strategy
|
|
19
19
|
2. **Write the source file** in `src/components/`
|
|
20
20
|
3. **Register the custom element** at the bottom of the source file
|
|
21
21
|
4. **Add documentation** in `docs/components/`
|
|
22
22
|
5. **Write and run unit tests** in `tests/components/`
|
|
23
|
+
6. **Update `llm.txt.md`** — add a row to the Components table
|
|
23
24
|
|
|
24
25
|
---
|
|
25
26
|
|
|
@@ -152,15 +153,42 @@ customElements.define('k-my-component', MyComponent);
|
|
|
152
153
|
|
|
153
154
|
---
|
|
154
155
|
|
|
155
|
-
## Step 3: Register in the Nav and Index (if it should appear in docs)
|
|
156
|
+
## Step 3: Register in the Nav, Search, and Index (if it should appear in docs)
|
|
156
157
|
|
|
157
|
-
|
|
158
|
+
There are **two** nav include files that must both be updated:
|
|
159
|
+
|
|
160
|
+
- `docs/nav.inc.html` — used on the homepage (paths start with `./`)
|
|
161
|
+
- `docs/nav-1.inc.html` — used on sub-pages (paths start with `../`)
|
|
162
|
+
|
|
163
|
+
In **each** file, add the component in **three** places, all in alphabetical order:
|
|
164
|
+
|
|
165
|
+
### 1. Search dropdown filter item
|
|
166
|
+
|
|
167
|
+
Inside the `<k-filter-list id="navSearchList">`, add a `<k-filter-item>` in alphabetical order among the other component entries:
|
|
158
168
|
|
|
159
169
|
```html
|
|
170
|
+
<!-- nav.inc.html (homepage) -->
|
|
171
|
+
<k-filter-item filter-keywords="my component mycomponent components"><a href="./components/my-component.html">My Component<br><small>Component</small></a></k-filter-item>
|
|
172
|
+
|
|
173
|
+
<!-- nav-1.inc.html (sub-pages) -->
|
|
174
|
+
<k-filter-item filter-keywords="my component mycomponent components"><a href="../components/my-component.html">My Component<br><small>Component</small></a></k-filter-item>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 2. Sidebar menu link
|
|
178
|
+
|
|
179
|
+
Inside the `<menu>` under the `Components` `<div>`, add an `<a>` tag in alphabetical order:
|
|
180
|
+
|
|
181
|
+
```html
|
|
182
|
+
<!-- nav.inc.html -->
|
|
160
183
|
<a href="./components/my-component.html">My Component</a>
|
|
184
|
+
|
|
185
|
+
<!-- nav-1.inc.html -->
|
|
186
|
+
<a href="../components/my-component.html">My Component</a>
|
|
161
187
|
```
|
|
162
188
|
|
|
163
|
-
|
|
189
|
+
### 3. Homepage card
|
|
190
|
+
|
|
191
|
+
Add a card in `docs/index.html` inside the `<div class="row -mx">` under the `<h2>Components</h2>` section, in alphabetical order:
|
|
164
192
|
|
|
165
193
|
```html
|
|
166
194
|
<div class="span-12 t-span-6 d-span-4 px">
|
|
@@ -266,3 +294,39 @@ The partial string `MyComponent` will match any test file whose path contains th
|
|
|
266
294
|
- Prefer `el.closest('k-parent')?.doSomething()` over dispatching an event and listening for it.
|
|
267
295
|
- Child components should locate their parent via `closest('k-parent-element')` and call its methods directly.
|
|
268
296
|
- Avoid `window` globals and global custom events for coordination. Scope events to the relevant element; reserve `window` events for global, non-visual concerns (e.g. settings changes).
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Elevation (Z-Index)
|
|
301
|
+
|
|
302
|
+
Any component using `position: fixed` must follow the kempo-css elevation system where `z-index = level × 10`.
|
|
303
|
+
|
|
304
|
+
| Level | z-index | Kempo UI Components | Notes |
|
|
305
|
+
|-------|---------|---------------------|-------|
|
|
306
|
+
| 2 | 20 | (page default) | No z-index needed for flow-position components |
|
|
307
|
+
| 3 | 30 | Aside (push) | Fixed panels that sit **below** a fixed navbar |
|
|
308
|
+
| 5 | 50 | *(navbar — user-defined)* | Reserved buffer for user-defined navbars |
|
|
309
|
+
| 6 | 60 | Aside (overlay) | Overlay drawers that sit **above** a fixed navbar |
|
|
310
|
+
| 7 | 70 | Dropdown | Floating menus; above navbar and overlay|
|
|
311
|
+
| 8 | 80 | Dialog, PhotoViewer | Full-screen modals and lightboxes |
|
|
312
|
+
| 9 | 90 | Toast | Notification toasts; always topmost |
|
|
313
|
+
|
|
314
|
+
Levels 1, 4 are intentional buffer zones for user customization.
|
|
315
|
+
|
|
316
|
+
When deciding a new component's elevation:
|
|
317
|
+
- If it is a panel or drawer in `push` mode (shifts page content), use level 3.
|
|
318
|
+
- If it is a panel or drawer in `overlay` mode (floats over content), use level 6.
|
|
319
|
+
- If it covers the entire viewport (modal/dialog), use level 8.
|
|
320
|
+
- If it is a temporary notification, use level 9.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Step 6: Update `llm.txt.md`
|
|
325
|
+
|
|
326
|
+
Add a row for the new component to the **Components** table in `llm.txt.md` at the root of the repository. Keep the table in alphabetical order by element name.
|
|
327
|
+
|
|
328
|
+
```markdown
|
|
329
|
+
| `<k-my-component>` | `MyComponent.js` | One-sentence description | [my-component.html](https://dustinpoissant.github.io/kempo-ui/components/my-component.html) |
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
If the component registers multiple elements (e.g. a parent + child pair), list all element names in the first column separated by spaces.
|
package/AGENTS.md
CHANGED
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
- All components should be in the `src/components/` directory.
|
|
7
7
|
- All utility function module files should be in the `src/utils/` directory.
|
|
8
8
|
- All documnentation should be in the `docs/` directory. This directory is used by GitHub as the "GitHub Pages", so all links need to be relative, and there will be a build script which copies all code to the `docs/` directory.
|
|
9
|
+
- `llm.txt.md` in the root is the consumer-facing LLM reference for this library. **Keep it up to date**: when adding a new component or utility, add a row to the relevant table in `llm.txt.md`.
|
|
10
|
+
|
|
11
|
+
## Dependencies
|
|
12
|
+
|
|
13
|
+
- [Kempo-CSS](https://raw.githubusercontent.com/dustinpoissant/kempo-css/refs/heads/main/llms.txt) - Injected into the shadow root of all components extending ShadowCompoentn or Hybrid Component. Do not assume bootstrap styles, some may be similar, but these are not compatible with bootstrap, read the docs.
|
|
14
|
+
- [Kempo-TestingFramework](https://raw.githubusercontent.com/dustinpoissant/kempo-testing-framework/refs/heads/main/llm.txt) - Used to create and run tests inside the `tests` directory. Do not assume you know the syntax, read the docs.
|
|
15
|
+
- [Kempo-Server](https://raw.githubusercontent.com/dustinpoissant/kempo-server/refs/heads/main/llm.txt) - A node server with file-based routing and robust configution options, this is used to run the docs servers.
|
|
9
16
|
|
|
10
17
|
## Coding Style Guidelines
|
|
11
18
|
|
|
@@ -103,3 +110,7 @@ Do not prefix identifiers with underscores.
|
|
|
103
110
|
- **DO NOT** create one-off test files or framework-less tests
|
|
104
111
|
- Test components in their natural documentation environment
|
|
105
112
|
- Validate both functionality and visual appearance
|
|
113
|
+
- **ALL tests must pass — ZERO failures are acceptable.** If a test fails after a change, fix it immediately. There are no "pre-existing failures" in this project.
|
|
114
|
+
|
|
115
|
+
### Building
|
|
116
|
+
The docs should be running using `npm run dev` which serves the html files in the docs, but reroutes all requests to `docs/src` to use `src` so we do not need to build or "watch" files to build, if you save a file, just refresh the docs page. Same for icons, the server reroutes `docs/icons` to `icons` so we dont need to watch or build after adding an icon.
|
package/bin/highlight_code.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import hljs from 'highlight.js';
|
|
3
3
|
import beautify from 'js-beautify';
|
|
4
4
|
|
|
5
5
|
const LANG_ALIASES = {
|
|
@@ -28,6 +28,7 @@ const args = process.argv.slice(2);
|
|
|
28
28
|
|
|
29
29
|
if(args.length < 1){
|
|
30
30
|
console.error('Usage: node bin/highlight_code.js <lang> <code>');
|
|
31
|
+
console.error(' echo "<code>" | node bin/highlight_code.js <lang>');
|
|
31
32
|
process.exit(1);
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -40,21 +41,12 @@ if(!lang){
|
|
|
40
41
|
process.exit(1);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
const
|
|
44
|
-
const fns = { javascript: beautify.js, css: beautify.css, html: beautify.html, xml: beautify.html };
|
|
45
|
-
const fn = fns[lang] || beautify.js;
|
|
46
|
-
return fn(code, BEAUTIFY_OPTIONS);
|
|
47
|
-
};
|
|
44
|
+
const beautifyFns = { javascript: beautify.js, css: beautify.css, html: beautify.html, xml: beautify.html };
|
|
48
45
|
|
|
49
|
-
const run =
|
|
50
|
-
const formatted =
|
|
51
|
-
const
|
|
52
|
-
process.stdout.write(
|
|
53
|
-
full
|
|
54
|
-
.replace(/^<pre><code class="hljs [^"]*">/, '')
|
|
55
|
-
.replace(/<\/code><\/pre>\n?$/, '')
|
|
56
|
-
.replace(/\n/g, '<br>') + '\n'
|
|
57
|
-
);
|
|
46
|
+
const run = code => {
|
|
47
|
+
const formatted = (beautifyFns[lang] || beautify.js)(code, BEAUTIFY_OPTIONS);
|
|
48
|
+
const highlighted = hljs.highlight(formatted, { language: lang }).value;
|
|
49
|
+
process.stdout.write(`<pre><code class="hljs ${lang}">${highlighted.replace(/\n/g, '<br>')}</code></pre>\n`);
|
|
58
50
|
};
|
|
59
51
|
|
|
60
52
|
if(rest.length > 0){
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import ShadowComponent from"./ShadowComponent.js";import{html,css,nothing}from"../lit-all.min.js";import{boolTrueFalse}from"../utils/propConverters.js";import"./FocusCapture.js";import"./Icon.js";export default class Aside extends ShadowComponent{static properties={state:{type:String,reflect:!0},side:{type:String,reflect:!0},main:{type:String,reflect:!0},overlayClose:{type:Boolean,reflect:!0,attribute:"overlay-close",converter:boolTrueFalse},escClose:{type:Boolean,reflect:!0,attribute:"esc-close",converter:boolTrueFalse}};constructor(){super(),this.state="offscreen",this.side="left",this.main="overlay",this.overlayClose=!0,this.escClose=!0}overlayClick=()=>{this.overlayClose&&this.hide()};handleKeyDown=e=>{this.escClose&&"Escape"===e.key&&this.hide()};updated(e){if(super.updated(e),e.has("state")){const t=e.get("state");"offscreen"===this.state||"offscreen"!==t&&void 0!==t?"offscreen"===this.state&&void 0!==t&&"offscreen"!==t&&document.removeEventListener("keydown",this.handleKeyDown):document.addEventListener("keydown",this.handleKeyDown),"overlay"===this.main&&("expanded"===this.state?document.body.classList.add("no-scroll"):document.body.classList.remove("no-scroll"));const s="offscreen"===this.state?0:this.getTargetWidth(this.state),a={aside:this,state:this.state,main:this.main,width:s};this.dispatchEvent(new CustomEvent("aside_state_change",{detail:a})),window.dispatchEvent(new CustomEvent("aside_state_change",{detail:a})),this.inert="offscreen"===this.state}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.body.classList.remove("no-scroll");const e={aside:this,state:"offscreen",main:this.main,width:0};this.dispatchEvent(new CustomEvent("aside_state_change",{detail:e})),window.dispatchEvent(new CustomEvent("aside_state_change",{detail:e}))}expand=()=>this.state="expanded";collapse=()=>this.state="collapsed";hide=()=>this.state="offscreen";toggle=()=>{this.state="expanded"===this.state?"offscreen":"expanded"};getTargetWidth(e){const t=parseFloat(getComputedStyle(document.documentElement).fontSize),s="collapsed"===e?"--collapsed-width":"--width",a=getComputedStyle(this).getPropertyValue(s).trim();return(a?parseFloat(a):"collapsed"===e?3.5:20)*t}render(){const e=html`<aside><slot></slot></aside>`;return"overlay"===this.main?html`
|
|
2
|
+
<k-focus-capture>
|
|
3
|
+
<div id="container">
|
|
4
|
+
<button id="overlay-btn" @click=${this.overlayClick}>
|
|
5
|
+
<div id="overlay-x"><k-icon name="close"></k-icon></div>
|
|
6
|
+
</button>
|
|
7
|
+
${e}
|
|
8
|
+
</div>
|
|
9
|
+
</k-focus-capture>
|
|
10
|
+
`:e}static styles=css`
|
|
11
|
+
:host {
|
|
12
|
+
--bg: var(--c_bg);
|
|
13
|
+
--border: var(--c_border);
|
|
14
|
+
--width: 20rem;
|
|
15
|
+
--collapsed-width: 3.5rem;
|
|
16
|
+
position: fixed;
|
|
17
|
+
top: 0;
|
|
18
|
+
height: 100vh;
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
}
|
|
21
|
+
:host([main="push"]) {
|
|
22
|
+
left: 0;
|
|
23
|
+
z-index: 30;
|
|
24
|
+
transition: width var(--animation_ms, 256ms);
|
|
25
|
+
}
|
|
26
|
+
:host([main="push"][side="right"]) {
|
|
27
|
+
left: auto;
|
|
28
|
+
right: 0;
|
|
29
|
+
}
|
|
30
|
+
:host([main="push"][state="collapsed"]) {
|
|
31
|
+
width: var(--collapsed-width);
|
|
32
|
+
pointer-events: auto;
|
|
33
|
+
}
|
|
34
|
+
:host([main="push"][state="expanded"]) {
|
|
35
|
+
width: var(--width);
|
|
36
|
+
pointer-events: auto;
|
|
37
|
+
}
|
|
38
|
+
:host([main="overlay"]) {
|
|
39
|
+
left: 0;
|
|
40
|
+
width: 100vw;
|
|
41
|
+
max-width: 100%;
|
|
42
|
+
z-index: 60;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
}
|
|
45
|
+
:host([main="overlay"][state="expanded"]) {
|
|
46
|
+
pointer-events: auto;
|
|
47
|
+
}
|
|
48
|
+
k-focus-capture {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
}
|
|
52
|
+
#container {
|
|
53
|
+
position: relative;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
}
|
|
57
|
+
#overlay-btn {
|
|
58
|
+
position: absolute;
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
left: 0;
|
|
62
|
+
top: 0;
|
|
63
|
+
background: var(--overlay, rgba(0, 0, 0, 0.5));
|
|
64
|
+
border: none;
|
|
65
|
+
padding: 0;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
z-index: 1;
|
|
68
|
+
opacity: 0;
|
|
69
|
+
transition: opacity var(--animation_ms, 256ms);
|
|
70
|
+
}
|
|
71
|
+
:host([state="expanded"]) #overlay-btn {
|
|
72
|
+
opacity: 1;
|
|
73
|
+
}
|
|
74
|
+
#overlay-x {
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: var(--spacer_h);
|
|
77
|
+
right: var(--spacer_h);
|
|
78
|
+
font-size: 1.75rem;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
color: var(--tc_light);
|
|
81
|
+
}
|
|
82
|
+
:host([overlay-close="false"]) #overlay-x {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
:host([overlay-close="false"]) #overlay-btn {
|
|
86
|
+
cursor: default;
|
|
87
|
+
}
|
|
88
|
+
:host([side="right"]) #overlay-x {
|
|
89
|
+
right: auto;
|
|
90
|
+
left: var(--spacer_h);
|
|
91
|
+
}
|
|
92
|
+
aside {
|
|
93
|
+
position: fixed;
|
|
94
|
+
top: 0;
|
|
95
|
+
left: 0;
|
|
96
|
+
height: 100vh;
|
|
97
|
+
overflow-y: auto;
|
|
98
|
+
overflow-x: hidden;
|
|
99
|
+
background: var(--bg);
|
|
100
|
+
padding: var(--aside_padding, var(--spacer));
|
|
101
|
+
z-index: 2;
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
border-right: 1px solid var(--border);
|
|
104
|
+
transition: width var(--animation_ms, 256ms), transform var(--animation_ms, 256ms);
|
|
105
|
+
}
|
|
106
|
+
:host([side="right"]) aside {
|
|
107
|
+
left: auto;
|
|
108
|
+
right: 0;
|
|
109
|
+
border-right: none;
|
|
110
|
+
border-left: 1px solid var(--border);
|
|
111
|
+
}
|
|
112
|
+
:host([main="push"]) aside {
|
|
113
|
+
position: absolute;
|
|
114
|
+
width: var(--width);
|
|
115
|
+
transform: translateX(-100%);
|
|
116
|
+
}
|
|
117
|
+
:host([main="push"][side="right"]) aside {
|
|
118
|
+
transform: translateX(100%);
|
|
119
|
+
}
|
|
120
|
+
:host([main="push"][state="collapsed"]) aside {
|
|
121
|
+
width: var(--collapsed-width);
|
|
122
|
+
transform: translateX(0);
|
|
123
|
+
}
|
|
124
|
+
:host([main="push"][state="expanded"]) aside {
|
|
125
|
+
transform: translateX(0);
|
|
126
|
+
}
|
|
127
|
+
:host([main="overlay"]) aside {
|
|
128
|
+
width: var(--width);
|
|
129
|
+
max-width: calc(100vw - 6rem);
|
|
130
|
+
border: none;
|
|
131
|
+
transform: translateX(-100%);
|
|
132
|
+
}
|
|
133
|
+
:host([main="overlay"][state="expanded"]) aside {
|
|
134
|
+
transform: translateX(0);
|
|
135
|
+
}
|
|
136
|
+
:host([main="overlay"][side="right"]) aside {
|
|
137
|
+
transform: translateX(100%);
|
|
138
|
+
}
|
|
139
|
+
:host([main="overlay"][side="right"][state="expanded"]) aside {
|
|
140
|
+
transform: translateX(0);
|
|
141
|
+
}
|
|
142
|
+
`}customElements.define("k-aside",Aside);class AsideItem extends ShadowComponent{static properties={icon:{type:String},href:{type:String},active:{type:Boolean,reflect:!0},collapsed:{type:Boolean,reflect:!0},"no-expand":{type:Boolean,attribute:"no-expand"},"hide-when-collapsed":{type:Boolean,attribute:"hide-when-collapsed"}};constructor(){super(),this.icon="",this.href="#",this.active=!1,this.collapsed=!1,this["no-expand"]=!1,this["hide-when-collapsed"]=!1}connectedCallback(){super.connectedCallback(),this.aside=this.closest("k-aside"),this.aside&&(this.collapsed="collapsed"===this.aside.state,this.aside.addEventListener("aside_state_change",this.handleStateChange))}disconnectedCallback(){super.disconnectedCallback(),this.aside&&this.aside.removeEventListener("aside_state_change",this.handleStateChange)}handleStateChange=e=>{const{state:t}=e.detail;"collapsed"===t?this.collapsed=!0:"expanded"===t&&(this.collapsed=!1)};handleClick=e=>{this.collapsed&&!this["no-expand"]&&this.aside&&(e.preventDefault(),this.aside.expand())};render(){return html`
|
|
143
|
+
<a href="${this.href}" class="item ${this.active?"active bg-primary":""}" @click=${this.handleClick}>
|
|
144
|
+
${this.icon?html`<k-icon name="${this.icon}"></k-icon>`:this.collapsed?html`<k-icon name="dot"></k-icon>`:nothing}
|
|
145
|
+
${this.collapsed?nothing:html`<span class="label"><slot></slot></span>`}
|
|
146
|
+
</a>
|
|
147
|
+
`}static styles=css`
|
|
148
|
+
:host {
|
|
149
|
+
display: block;
|
|
150
|
+
}
|
|
151
|
+
:host([collapsed][hide-when-collapsed]) {
|
|
152
|
+
display: none;
|
|
153
|
+
}
|
|
154
|
+
.item {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
gap: var(--spacer_h);
|
|
158
|
+
padding: var(--spacer_h);
|
|
159
|
+
color: var(--tc);
|
|
160
|
+
text-decoration: none;
|
|
161
|
+
border-radius: var(--radius);
|
|
162
|
+
margin: 0 var(--spacer_h);
|
|
163
|
+
transition: background var(--animation_ms), color var(--animation_ms);
|
|
164
|
+
white-space: nowrap;
|
|
165
|
+
}
|
|
166
|
+
.item:hover {
|
|
167
|
+
background: var(--c_bg_hover);
|
|
168
|
+
}
|
|
169
|
+
.item.active {
|
|
170
|
+
color: var(--tc_on_primary);
|
|
171
|
+
}
|
|
172
|
+
.item.active:hover {
|
|
173
|
+
background: var(--c_primary);
|
|
174
|
+
filter: brightness(1.1);
|
|
175
|
+
}
|
|
176
|
+
k-icon {
|
|
177
|
+
flex-shrink: 0;
|
|
178
|
+
}
|
|
179
|
+
.label {
|
|
180
|
+
min-width: 0;
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
text-overflow: ellipsis;
|
|
183
|
+
}
|
|
184
|
+
`}class AsideLabel extends ShadowComponent{static properties={collapsed:{type:Boolean,reflect:!0}};constructor(){super(),this.collapsed=!1}connectedCallback(){super.connectedCallback(),this.aside=this.closest("k-aside"),this.aside&&(this.collapsed="collapsed"===this.aside.state,this.aside.addEventListener("aside_state_change",this.handleStateChange))}disconnectedCallback(){super.disconnectedCallback(),this.aside&&this.aside.removeEventListener("aside_state_change",this.handleStateChange)}handleStateChange=e=>{const{state:t}=e.detail;"collapsed"===t?this.collapsed=!0:"expanded"===t&&(this.collapsed=!1)};render(){return this.collapsed?html`<hr>`:html`<div class="label"><slot></slot></div>`}static styles=css`
|
|
185
|
+
:host {
|
|
186
|
+
display: block;
|
|
187
|
+
margin: var(--spacer_h) 0;
|
|
188
|
+
}
|
|
189
|
+
:host([collapsed]) {
|
|
190
|
+
margin: 0 var(--spacer_h);
|
|
191
|
+
align-self: stretch;
|
|
192
|
+
}
|
|
193
|
+
.label {
|
|
194
|
+
padding: 0 var(--spacer);
|
|
195
|
+
font-size: 0.75rem;
|
|
196
|
+
font-weight: 600;
|
|
197
|
+
text-transform: uppercase;
|
|
198
|
+
color: var(--c_text_muted);
|
|
199
|
+
letter-spacing: 0.05em;
|
|
200
|
+
}
|
|
201
|
+
hr {
|
|
202
|
+
border: none;
|
|
203
|
+
border-top: 1px solid var(--c_border);
|
|
204
|
+
margin: var(--spacer_h) var(--spacer);
|
|
205
|
+
}
|
|
206
|
+
:host([collapsed]) hr {
|
|
207
|
+
margin: var(--spacer_h) 0;
|
|
208
|
+
}
|
|
209
|
+
`}class AsideMenu extends ShadowComponent{static properties={icon:{type:String},label:{type:String},open:{type:Boolean,reflect:!0},collapsed:{type:Boolean,reflect:!0},"no-expand":{type:Boolean,attribute:"no-expand"},"hide-when-collapsed":{type:Boolean,attribute:"hide-when-collapsed"}};constructor(){super(),this.icon="",this.label="",this.open=!1,this.collapsed=!1,this["no-expand"]=!1,this["hide-when-collapsed"]=!1}connectedCallback(){super.connectedCallback(),this.aside=this.closest("k-aside"),this.aside&&(this.collapsed="collapsed"===this.aside.state,this.aside.addEventListener("aside_state_change",this.handleStateChange))}disconnectedCallback(){super.disconnectedCallback(),this.aside&&this.aside.removeEventListener("aside_state_change",this.handleStateChange)}handleStateChange=e=>{const{state:t}=e.detail;"collapsed"===t?(this.collapsed=!0,this.open=!1):"expanded"===t&&(this.collapsed=!1)};toggleMenu=()=>{this.collapsed&&!this["no-expand"]&&this.aside?this.aside.expand():this.collapsed||(this.open=!this.open)};render(){return html`
|
|
210
|
+
<div class="menu-container">
|
|
211
|
+
<button class="no-btn menu-header ${this.open?"open":""}" @click=${this.toggleMenu}>
|
|
212
|
+
${this.icon?html`<k-icon name="${this.icon}"></k-icon>`:this.collapsed?html`<k-icon name="dot"></k-icon>`:nothing}
|
|
213
|
+
${this.collapsed?nothing:html`<span class="label">${this.label}</span>`}
|
|
214
|
+
${this.collapsed?nothing:html`<k-icon class="chevron" name="chevron" direction="${this.open?"down":"right"}"></k-icon>`}
|
|
215
|
+
</button>
|
|
216
|
+
<div class="menu-content ${this.open&&!this.collapsed?"open":""}">
|
|
217
|
+
<slot></slot>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
`}static styles=css`
|
|
221
|
+
:host {
|
|
222
|
+
display: block;
|
|
223
|
+
}
|
|
224
|
+
:host([collapsed][hide-when-collapsed]) {
|
|
225
|
+
display: none;
|
|
226
|
+
}
|
|
227
|
+
.menu-header {
|
|
228
|
+
display: flex !important;
|
|
229
|
+
align-items: center;
|
|
230
|
+
gap: var(--spacer_h);
|
|
231
|
+
padding: var(--spacer_h) !important;
|
|
232
|
+
color: var(--tc);
|
|
233
|
+
background: transparent;
|
|
234
|
+
border: none;
|
|
235
|
+
border-radius: var(--radius);
|
|
236
|
+
margin: 0 var(--spacer_h);
|
|
237
|
+
width: calc(100% - var(--spacer));
|
|
238
|
+
cursor: pointer;
|
|
239
|
+
text-align: left;
|
|
240
|
+
white-space: nowrap;
|
|
241
|
+
transition: background var(--animation_ms);
|
|
242
|
+
}
|
|
243
|
+
:host([collapsed]) .menu-header {
|
|
244
|
+
width: auto;
|
|
245
|
+
}
|
|
246
|
+
.menu-header:hover {
|
|
247
|
+
background: var(--c_bg_hover);
|
|
248
|
+
}
|
|
249
|
+
k-icon {
|
|
250
|
+
flex-shrink: 0;
|
|
251
|
+
}
|
|
252
|
+
.label {
|
|
253
|
+
flex: 1;
|
|
254
|
+
min-width: 0;
|
|
255
|
+
overflow: hidden;
|
|
256
|
+
text-overflow: ellipsis;
|
|
257
|
+
}
|
|
258
|
+
.chevron {
|
|
259
|
+
transition: transform var(--animation_ms);
|
|
260
|
+
}
|
|
261
|
+
.menu-content {
|
|
262
|
+
max-height: 0;
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
transition: max-height var(--animation_ms);
|
|
265
|
+
padding-left: calc(var(--spacer_h) * 2);
|
|
266
|
+
}
|
|
267
|
+
:host([collapsed]) .menu-content {
|
|
268
|
+
padding-left: 0;
|
|
269
|
+
}
|
|
270
|
+
.menu-content.open {
|
|
271
|
+
max-height: 500px;
|
|
272
|
+
}
|
|
273
|
+
::slotted(*) {
|
|
274
|
+
margin: 0.25rem 0;
|
|
275
|
+
}
|
|
276
|
+
`}class AsideSpacer extends ShadowComponent{render(){return html`<div></div>`}static styles=css`
|
|
277
|
+
:host {
|
|
278
|
+
display: block;
|
|
279
|
+
flex: 1;
|
|
280
|
+
}
|
|
281
|
+
`}class AsideToggle extends ShadowComponent{static properties={collapsed:{type:Boolean,reflect:!0},direction:{type:String}};constructor(){super(),this.collapsed=!1,this.direction="left"}connectedCallback(){super.connectedCallback(),this.aside=this.closest("k-aside"),this.aside&&(this.collapsed="collapsed"===this.aside.state,this.updateDirection(),this.aside.addEventListener("aside_state_change",this.handleStateChange))}disconnectedCallback(){super.disconnectedCallback(),this.aside&&this.aside.removeEventListener("aside_state_change",this.handleStateChange)}handleStateChange=e=>{const{state:t}=e.detail;"collapsed"===t?this.collapsed=!0:"expanded"===t&&(this.collapsed=!1),this.updateDirection()};handleClick=()=>{this.aside&&(this.aside.state="collapsed"===this.aside.state?"expanded":"collapsed")};updateDirection=()=>{const e="right"===this.aside?.side;this.direction=this.collapsed!==e?"right":"left"};render(){return html`
|
|
282
|
+
<div id="header">
|
|
283
|
+
<slot></slot>
|
|
284
|
+
<button id="toggle" @click=${this.handleClick}>
|
|
285
|
+
<k-icon name="arrow-line" direction=${this.direction}></k-icon>
|
|
286
|
+
</button>
|
|
287
|
+
</div>
|
|
288
|
+
`}static styles=css`
|
|
289
|
+
:host {
|
|
290
|
+
display: block;
|
|
291
|
+
}
|
|
292
|
+
#header {
|
|
293
|
+
display: flex;
|
|
294
|
+
align-items: center;
|
|
295
|
+
justify-content: flex-end;
|
|
296
|
+
gap: var(--spacer_h);
|
|
297
|
+
padding: var(--spacer_h);
|
|
298
|
+
border-bottom: 1px solid var(--c_border);
|
|
299
|
+
flex-shrink: 0;
|
|
300
|
+
}
|
|
301
|
+
::slotted(*) {
|
|
302
|
+
margin-right: auto;
|
|
303
|
+
flex: 1;
|
|
304
|
+
min-width: 0;
|
|
305
|
+
}
|
|
306
|
+
:host([collapsed]) ::slotted(*) {
|
|
307
|
+
display: none;
|
|
308
|
+
}
|
|
309
|
+
#toggle {
|
|
310
|
+
flex-shrink: 0;
|
|
311
|
+
width: 2rem;
|
|
312
|
+
height: 2rem;
|
|
313
|
+
border: none;
|
|
314
|
+
background: transparent;
|
|
315
|
+
color: var(--c_text);
|
|
316
|
+
cursor: pointer;
|
|
317
|
+
display: flex;
|
|
318
|
+
align-items: center;
|
|
319
|
+
justify-content: center;
|
|
320
|
+
border-radius: var(--radius);
|
|
321
|
+
padding: 0;
|
|
322
|
+
}
|
|
323
|
+
#toggle:hover {
|
|
324
|
+
background: var(--c_bg_hover);
|
|
325
|
+
}
|
|
326
|
+
`}customElements.define("k-aside-item",AsideItem),customElements.define("k-aside-label",AsideLabel),customElements.define("k-aside-menu",AsideMenu),customElements.define("k-aside-spacer",AsideSpacer),customElements.define("k-aside-toggle",AsideToggle);
|
|
@@ -11,7 +11,7 @@ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComp
|
|
|
11
11
|
display: none;
|
|
12
12
|
position: fixed;
|
|
13
13
|
position-anchor: --dropdown-trigger;
|
|
14
|
-
z-index:
|
|
14
|
+
z-index: 70;
|
|
15
15
|
min-width: anchor-size(width);
|
|
16
16
|
background: var(--c_bg);
|
|
17
17
|
border: 1px solid var(--c_border);
|
package/dist/components/Main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ShadowComponent from"./ShadowComponent.js";import{html,css}from"../lit-all.min.js";export default class Main extends ShadowComponent{
|
|
1
|
+
import ShadowComponent from"./ShadowComponent.js";import{html,css}from"../lit-all.min.js";export default class Main extends ShadowComponent{constructor(){super(),this.widthMap=new Map}connectedCallback(){super.connectedCallback(),window.addEventListener("aside_state_change",this.handleAsideChange),document.querySelectorAll('k-aside[main="push"]').forEach(t=>{if("offscreen"!==t.state){const e=t.getTargetWidth(t.state);e>0&&this.widthMap.set(t,{side:t.side||"left",width:e})}}),this.recalculate()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("aside_state_change",this.handleAsideChange)}handleAsideChange=t=>{const{aside:e,state:a,main:i,width:s}=t.detail;"overlay"===i||"offscreen"===a?this.widthMap.delete(e):this.widthMap.set(e,{side:e.side||"left",width:s}),this.recalculate()};recalculate=()=>{let t=0,e=0;for(const[,{side:a,width:i}]of this.widthMap)"right"===a?e=Math.max(e,i):t=Math.max(t,i);this.style.setProperty("--left-panel-width",`${t}px`),this.style.setProperty("--right-panel-width",`${e}px`)};render(){return html`
|
|
2
2
|
<main>
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</main>
|
|
@@ -17,4 +17,4 @@ import ShadowComponent from"./ShadowComponent.js";import{html,css}from"../lit-al
|
|
|
17
17
|
padding-left: var(--spacer);
|
|
18
18
|
padding-right: var(--spacer);
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
`}window.customElements.define("k-main",Main);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComponent.js";export default class Nav extends ShadowComponent{static properties={fixed:{type:Boolean,reflect:!0}};constructor(){super(),this.fixed=!1}render(){return html`<nav><slot></slot></nav>`}static styles=css`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
:host([fixed]) {
|
|
6
|
+
position: fixed;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
z-index: 50;
|
|
11
|
+
}
|
|
12
|
+
nav {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
::slotted(a) {
|
|
18
|
+
display: inline-block;
|
|
19
|
+
padding: var(--spacer);
|
|
20
|
+
text-decoration: none !important;
|
|
21
|
+
}
|
|
22
|
+
::slotted(.link) {
|
|
23
|
+
display: inline-block;
|
|
24
|
+
padding: var(--spacer) !important;
|
|
25
|
+
text-decoration: none !important;
|
|
26
|
+
}
|
|
27
|
+
`}customElements.define("k-nav",Nav);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LitElement}from"../lit-all.min.js";export default class ShadowComponent extends LitElement{#e;connectedCallback(){super.connectedCallback(),this.#e=new MutationObserver(()=>{this.childrenUpdated(),this.requestUpdate()}),this.#e.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.#e?.disconnect()}childrenUpdated(){}createRenderRoot(){const e=this.attachShadow({mode:"open"}),t=document.createElement("link");t.rel="stylesheet",t.href=window.kempo?.pathToStylesheet||"https://cdn.jsdelivr.net/npm/kempo-css@
|
|
1
|
+
import{LitElement}from"../lit-all.min.js";export default class ShadowComponent extends LitElement{#e;connectedCallback(){super.connectedCallback(),this.#e=new MutationObserver(()=>{this.childrenUpdated(),this.requestUpdate()}),this.#e.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.#e?.disconnect()}childrenUpdated(){}createRenderRoot(){const e=this.attachShadow({mode:"open"}),t=document.createElement("link");t.rel="stylesheet",t.href=window.kempo?.pathToStylesheet||"https://cdn.jsdelivr.net/npm/kempo-css@2/dist/kempo.min.css",e.appendChild(t);const n=this.constructor.styles;if(n){const t=document.createElement("style");Array.isArray(n)?t.textContent=n.map(e=>e.cssText||e).join("\n"):t.textContent=n.cssText||n,e.appendChild(t)}const s=document.createElement("div");return s.style.display="contents",e.appendChild(s),s}}
|
|
@@ -5,4 +5,8 @@ import ShadowComponent from"./ShadowComponent.js";import{html,css}from"../lit-al
|
|
|
5
5
|
<option value="dark">Dark</option>
|
|
6
6
|
<option value="auto">System Default</option>
|
|
7
7
|
</select>
|
|
8
|
-
`}static
|
|
8
|
+
`}static styles=css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
`;static setTheme(e){theme.set(e)}static getCurrentTheme(){return theme.get()}static getCalculatedCurrentTheme(){return theme.getCalculated()}}customElements.define("k-theme-select",ThemeSelect);
|
|
@@ -19,5 +19,6 @@ import ShadowComponent from"./ShadowComponent.js";import{html,css}from"../lit-al
|
|
|
19
19
|
}
|
|
20
20
|
button.no-btn {
|
|
21
21
|
padding: var(--padding);
|
|
22
|
+
border-radius: var(--radius);
|
|
22
23
|
}
|
|
23
24
|
`;static setTheme(e){theme.set(e)}static getCurrentTheme(){return theme.get()}static getCalculatedCurrentTheme(){return theme.getCalculated()}}customElements.define("k-theme-switcher",ThemeSwitcher);
|