@elyracode/mini-lit 0.9.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/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/Alert.d.ts +12 -0
- package/dist/Alert.d.ts.map +1 -0
- package/dist/Alert.js +35 -0
- package/dist/Alert.js.map +1 -0
- package/dist/Badge.d.ts +8 -0
- package/dist/Badge.d.ts.map +1 -0
- package/dist/Badge.js +19 -0
- package/dist/Badge.js.map +1 -0
- package/dist/Button.d.ts +14 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.js +60 -0
- package/dist/Button.js.map +1 -0
- package/dist/Card.d.ts +19 -0
- package/dist/Card.d.ts.map +1 -0
- package/dist/Card.js +76 -0
- package/dist/Card.js.map +1 -0
- package/dist/Checkbox.d.ts +15 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.js +49 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/CodeBlock.d.ts +11 -0
- package/dist/CodeBlock.d.ts.map +1 -0
- package/dist/CodeBlock.js +90 -0
- package/dist/CodeBlock.js.map +1 -0
- package/dist/CopyButton.d.ts +11 -0
- package/dist/CopyButton.d.ts.map +1 -0
- package/dist/CopyButton.js +65 -0
- package/dist/CopyButton.js.map +1 -0
- package/dist/Dialog.d.ts +24 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.js +72 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/DialogBase.d.ts +13 -0
- package/dist/DialogBase.d.ts.map +1 -0
- package/dist/DialogBase.js +48 -0
- package/dist/DialogBase.js.map +1 -0
- package/dist/Diff.d.ts +8 -0
- package/dist/Diff.d.ts.map +1 -0
- package/dist/Diff.js +47 -0
- package/dist/Diff.js.map +1 -0
- package/dist/DownloadButton.d.ts +16 -0
- package/dist/DownloadButton.d.ts.map +1 -0
- package/dist/DownloadButton.js +53 -0
- package/dist/DownloadButton.js.map +1 -0
- package/dist/FileButton.d.ts +9 -0
- package/dist/FileButton.d.ts.map +1 -0
- package/dist/FileButton.js +53 -0
- package/dist/FileButton.js.map +1 -0
- package/dist/Input.d.ts +28 -0
- package/dist/Input.d.ts.map +1 -0
- package/dist/Input.js +58 -0
- package/dist/Input.js.map +1 -0
- package/dist/Label.d.ts +9 -0
- package/dist/Label.d.ts.map +1 -0
- package/dist/Label.js +17 -0
- package/dist/Label.js.map +1 -0
- package/dist/LanguageSelector.d.ts +14 -0
- package/dist/LanguageSelector.d.ts.map +1 -0
- package/dist/LanguageSelector.js +92 -0
- package/dist/LanguageSelector.js.map +1 -0
- package/dist/MarkdownBlock.d.ts +10 -0
- package/dist/MarkdownBlock.d.ts.map +1 -0
- package/dist/MarkdownBlock.js +257 -0
- package/dist/MarkdownBlock.js.map +1 -0
- package/dist/ModeToggle.d.ts +14 -0
- package/dist/ModeToggle.d.ts.map +1 -0
- package/dist/ModeToggle.js +59 -0
- package/dist/ModeToggle.js.map +1 -0
- package/dist/PreviewCode.d.ts +12 -0
- package/dist/PreviewCode.d.ts.map +1 -0
- package/dist/PreviewCode.js +80 -0
- package/dist/PreviewCode.js.map +1 -0
- package/dist/PreviewCodeToggle.d.ts +15 -0
- package/dist/PreviewCodeToggle.d.ts.map +1 -0
- package/dist/PreviewCodeToggle.js +55 -0
- package/dist/PreviewCodeToggle.js.map +1 -0
- package/dist/Progress.d.ts +10 -0
- package/dist/Progress.d.ts.map +1 -0
- package/dist/Progress.js +27 -0
- package/dist/Progress.js.map +1 -0
- package/dist/PromptDialog.d.ts +20 -0
- package/dist/PromptDialog.d.ts.map +1 -0
- package/dist/PromptDialog.js +114 -0
- package/dist/PromptDialog.js.map +1 -0
- package/dist/Select.d.ts +25 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.js +335 -0
- package/dist/Select.js.map +1 -0
- package/dist/Separator.d.ts +10 -0
- package/dist/Separator.d.ts.map +1 -0
- package/dist/Separator.js +19 -0
- package/dist/Separator.js.map +1 -0
- package/dist/Sidebar.d.ts +27 -0
- package/dist/Sidebar.d.ts.map +1 -0
- package/dist/Sidebar.js +151 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/SplitPanel.d.ts +40 -0
- package/dist/SplitPanel.d.ts.map +1 -0
- package/dist/SplitPanel.js +275 -0
- package/dist/SplitPanel.js.map +1 -0
- package/dist/Switch.d.ts +13 -0
- package/dist/Switch.d.ts.map +1 -0
- package/dist/Switch.js +48 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Textarea.d.ts +21 -0
- package/dist/Textarea.d.ts.map +1 -0
- package/dist/Textarea.js +67 -0
- package/dist/Textarea.js.map +1 -0
- package/dist/ThemeToggle.d.ts +11 -0
- package/dist/ThemeToggle.d.ts.map +1 -0
- package/dist/ThemeToggle.js +91 -0
- package/dist/ThemeToggle.js.map +1 -0
- package/dist/component.d.ts +190 -0
- package/dist/component.d.ts.map +1 -0
- package/dist/component.js +241 -0
- package/dist/component.js.map +1 -0
- package/dist/i18n.d.ts +73 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +146 -0
- package/dist/i18n.js.map +1 -0
- package/dist/icons.d.ts +7 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +21 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/mini.d.ts +19 -0
- package/dist/mini.d.ts.map +1 -0
- package/dist/mini.js +29 -0
- package/dist/mini.js.map +1 -0
- package/llms.txt +681 -0
- package/package.json +69 -0
- package/src/styles/base.css +63 -0
- package/src/styles/themes/claude.css +155 -0
- package/src/styles/themes/default.css +102 -0
- package/src/styles/utils/markdown.css +104 -0
- package/src/styles/utils/math.css +7 -0
- package/src/styles/utils/syntax-highlighting.css +134 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutChildren, type TemplateResult } from "./mini.js";
|
|
2
|
+
interface ProgressProps extends ComponentPropsWithoutChildren {
|
|
3
|
+
value?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
indicatorClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function Progress(props: ProgressProps): TemplateResult;
|
|
8
|
+
export declare function Progress(value?: number, max?: number, className?: string): TemplateResult;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=Progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../src/Progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,6BAA6B,EAAY,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAE9F,UAAU,aAAc,SAAQ,6BAA6B;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAyBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,cAAc,CAAC;AAC/D,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC"}
|
package/dist/Progress.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { fc, html } from "./mini.js";
|
|
2
|
+
const _Progress = fc(({ value = 0, max = 100, indicatorClassName = "", className = "" }) => {
|
|
3
|
+
const percentage = Math.min(Math.max(0, (value / max) * 100), 100);
|
|
4
|
+
const baseClasses = "relative h-2 w-full overflow-hidden rounded-full bg-secondary";
|
|
5
|
+
const indicatorClasses = "h-full w-full flex-1 bg-primary transition-all";
|
|
6
|
+
return html `
|
|
7
|
+
<div
|
|
8
|
+
role="progressbar"
|
|
9
|
+
aria-valuemin="0"
|
|
10
|
+
aria-valuemax="${max}"
|
|
11
|
+
aria-valuenow="${value}"
|
|
12
|
+
class="${baseClasses} ${className}"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
class="${indicatorClasses} ${indicatorClassName}"
|
|
16
|
+
style="transform: translateX(-${100 - percentage}%)"
|
|
17
|
+
></div>
|
|
18
|
+
</div>
|
|
19
|
+
`;
|
|
20
|
+
});
|
|
21
|
+
export function Progress(propsOrValue = 0, max = 100, className = "") {
|
|
22
|
+
if (typeof propsOrValue === "object" && propsOrValue !== null) {
|
|
23
|
+
return _Progress(propsOrValue);
|
|
24
|
+
}
|
|
25
|
+
return _Progress({ value: propsOrValue, max, className });
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=Progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.js","sourceRoot":"","sources":["../src/Progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,EAAE,EAAE,IAAI,EAAuB,MAAM,WAAW,CAAC;AAQ9F,MAAM,SAAS,GAAG,EAAE,CAAgB,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,kBAAkB,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE;IACvG,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAEnE,MAAM,WAAW,GAAG,+DAA+D,CAAC;IACpF,MAAM,gBAAgB,GAAG,gDAAgD,CAAC;IAE1E,OAAO,IAAI,CAAA;;;;0BAIY,GAAG;0BACH,KAAK;kBACb,WAAW,IAAI,SAAS;;;qBAGrB,gBAAgB,IAAI,kBAAkB;4CACf,GAAG,GAAG,UAAU;;;IAGxD,CAAC;AACL,CAAC,CAAC,CAAC;AAKH,MAAM,UAAU,QAAQ,CAAC,eAAuC,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,SAAS,GAAG,EAAE;IACzF,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QAC7D,OAAO,SAAS,CAAC,YAA6B,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,SAAS,CAAC,EAAE,KAAK,EAAE,YAAsB,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type PropertyValues, type TemplateResult } from "lit";
|
|
2
|
+
import { DialogBase } from "./DialogBase.js";
|
|
3
|
+
export declare class PromptDialog extends DialogBase {
|
|
4
|
+
headerTitle: string;
|
|
5
|
+
message: string;
|
|
6
|
+
defaultValue: string;
|
|
7
|
+
isPassword: boolean;
|
|
8
|
+
private inputValue;
|
|
9
|
+
private resolvePromise?;
|
|
10
|
+
private inputRef;
|
|
11
|
+
protected modalWidth: string;
|
|
12
|
+
protected modalHeight: string;
|
|
13
|
+
static ask(title: string, message: string, defaultValue?: string, isPassword?: boolean): Promise<string | undefined>;
|
|
14
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
15
|
+
private handleConfirm;
|
|
16
|
+
private handleCancel;
|
|
17
|
+
protected renderContent(): TemplateResult;
|
|
18
|
+
}
|
|
19
|
+
export default PromptDialog;
|
|
20
|
+
//# sourceMappingURL=PromptDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptDialog.d.ts","sourceRoot":"","sources":["../src/PromptDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAOrE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,qBACa,YAAa,SAAQ,UAAU;IAC7B,WAAW,SAAM;IACjB,OAAO,SAAM;IACb,YAAY,SAAM;IAClB,UAAU,UAAS;IAEtB,OAAO,CAAC,UAAU,CAAM;IACjC,OAAO,CAAC,cAAc,CAAC,CAAsC;IAC7D,OAAO,CAAC,QAAQ,CAAiC;IAEjD,UAAmB,UAAU,SAAsB;IACnD,UAAmB,WAAW,SAAU;WAE3B,GAAG,CACb,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,YAAY,SAAK,EACjB,UAAU,UAAQ,GAClB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;cAcX,YAAY,CAAC,kBAAkB,EAAE,cAAc,GAAG,IAAI;IAKzE,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,YAAY;cAKD,aAAa,IAAI,cAAc;CAqCpD;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var PromptDialog_1;
|
|
8
|
+
import { html } from "lit";
|
|
9
|
+
import { customElement } from "lit/decorators/custom-element.js";
|
|
10
|
+
import { property } from "lit/decorators/property.js";
|
|
11
|
+
import { state } from "lit/decorators/state.js";
|
|
12
|
+
import { createRef } from "lit/directives/ref.js";
|
|
13
|
+
import { Button } from "./Button.js";
|
|
14
|
+
import { DialogContent, DialogFooter, DialogHeader } from "./Dialog.js";
|
|
15
|
+
import { DialogBase } from "./DialogBase.js";
|
|
16
|
+
import { Input } from "./Input.js";
|
|
17
|
+
import { i18n } from "./i18n.js";
|
|
18
|
+
let PromptDialog = PromptDialog_1 = class PromptDialog extends DialogBase {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.headerTitle = "";
|
|
22
|
+
this.message = "";
|
|
23
|
+
this.defaultValue = "";
|
|
24
|
+
this.isPassword = false;
|
|
25
|
+
this.inputValue = "";
|
|
26
|
+
this.inputRef = createRef();
|
|
27
|
+
this.modalWidth = "min(400px, 90vw)";
|
|
28
|
+
this.modalHeight = "auto";
|
|
29
|
+
}
|
|
30
|
+
static async ask(title, message, defaultValue = "", isPassword = false) {
|
|
31
|
+
const dialog = new PromptDialog_1();
|
|
32
|
+
dialog.headerTitle = title;
|
|
33
|
+
dialog.message = message;
|
|
34
|
+
dialog.defaultValue = defaultValue;
|
|
35
|
+
dialog.isPassword = isPassword;
|
|
36
|
+
dialog.inputValue = defaultValue;
|
|
37
|
+
return new Promise((resolve) => {
|
|
38
|
+
dialog.resolvePromise = resolve;
|
|
39
|
+
dialog.open();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
firstUpdated(_changedProperties) {
|
|
43
|
+
super.firstUpdated(_changedProperties);
|
|
44
|
+
this.inputRef.value?.focus();
|
|
45
|
+
}
|
|
46
|
+
handleConfirm() {
|
|
47
|
+
this.resolvePromise?.(this.inputValue);
|
|
48
|
+
this.close();
|
|
49
|
+
}
|
|
50
|
+
handleCancel() {
|
|
51
|
+
this.resolvePromise?.(undefined);
|
|
52
|
+
this.close();
|
|
53
|
+
}
|
|
54
|
+
renderContent() {
|
|
55
|
+
return DialogContent({
|
|
56
|
+
children: html `
|
|
57
|
+
${DialogHeader({
|
|
58
|
+
title: this.headerTitle || i18n("Input Required"),
|
|
59
|
+
description: this.message,
|
|
60
|
+
})}
|
|
61
|
+
${Input({
|
|
62
|
+
type: this.isPassword ? "password" : "text",
|
|
63
|
+
value: this.inputValue,
|
|
64
|
+
className: "w-full",
|
|
65
|
+
inputRef: this.inputRef,
|
|
66
|
+
onInput: (e) => {
|
|
67
|
+
this.inputValue = e.target.value;
|
|
68
|
+
},
|
|
69
|
+
onKeyDown: (e) => {
|
|
70
|
+
if (e.key === "Enter")
|
|
71
|
+
this.handleConfirm();
|
|
72
|
+
if (e.key === "Escape")
|
|
73
|
+
this.handleCancel();
|
|
74
|
+
},
|
|
75
|
+
})}
|
|
76
|
+
${DialogFooter({
|
|
77
|
+
children: html `
|
|
78
|
+
${Button({
|
|
79
|
+
variant: "outline",
|
|
80
|
+
onClick: () => this.handleCancel(),
|
|
81
|
+
children: i18n("Cancel"),
|
|
82
|
+
})}
|
|
83
|
+
${Button({
|
|
84
|
+
variant: "default",
|
|
85
|
+
onClick: () => this.handleConfirm(),
|
|
86
|
+
children: i18n("Confirm"),
|
|
87
|
+
})}
|
|
88
|
+
`,
|
|
89
|
+
})}
|
|
90
|
+
`,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
__decorate([
|
|
95
|
+
property()
|
|
96
|
+
], PromptDialog.prototype, "headerTitle", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
property()
|
|
99
|
+
], PromptDialog.prototype, "message", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
property()
|
|
102
|
+
], PromptDialog.prototype, "defaultValue", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
property()
|
|
105
|
+
], PromptDialog.prototype, "isPassword", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
state()
|
|
108
|
+
], PromptDialog.prototype, "inputValue", void 0);
|
|
109
|
+
PromptDialog = PromptDialog_1 = __decorate([
|
|
110
|
+
customElement("prompt-dialog")
|
|
111
|
+
], PromptDialog);
|
|
112
|
+
export { PromptDialog };
|
|
113
|
+
export default PromptDialog;
|
|
114
|
+
//# sourceMappingURL=PromptDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptDialog.js","sourceRoot":"","sources":["../src/PromptDialog.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,IAAI,EAA4C,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,kCA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AC;MACR,YAAY,CAAC;gBACJ,QAAQ,EAAE,IAAI,CAAA;QACrB,MAAM,CAAC;oBACM,OAAO,EAAE,SAAS;oBAClB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;oBAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC;iBAC1B,CAAC;QACZ,MAAM,CAAC;oBACM,OAAO,EAAE,SAAS;oBAClB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;oBACnC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC;iBAC3B,CAAC;MACd;aACO,CAAC;IACV;SACG,CAAC,CAAC;IACN,CAAC;CACH,CAAA;AAnFc;IAAX,QAAQ,EAAE;iDAAkB;AACjB;IAAX,QAAQ,EAAE;6CAAc;AACb;IAAX,QAAQ,EAAE;kDAAmB;AAClB;IAAX,QAAQ,EAAE;gDAAoB;AAEd;IAAhB,KAAK,EAAE;gDAAyB;AANvB,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAoFxB;;AAED,eAAe,YAAY,CAAC"}
|
package/dist/Select.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type TemplateResult } from "lit";
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: TemplateResult | string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectGroup {
|
|
9
|
+
label?: string;
|
|
10
|
+
options: SelectOption[];
|
|
11
|
+
}
|
|
12
|
+
export interface SelectProps {
|
|
13
|
+
value?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
options: SelectOption[] | SelectGroup[];
|
|
16
|
+
onChange: (value: string) => void;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
width?: string | undefined;
|
|
20
|
+
size?: "sm" | "md" | "lg";
|
|
21
|
+
variant?: "default" | "ghost" | "outline";
|
|
22
|
+
fitContent?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function Select(props: SelectProps): TemplateResult;
|
|
25
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../src/Select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIxD,MAAM,WAAW,YAAY;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,EAAE,GAAG,WAAW,EAAE,CAAC;IACxC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACvB;AAUD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,cAAc,CAoYzD"}
|
package/dist/Select.js
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { html, render } from "lit";
|
|
2
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
3
|
+
import { i18n } from "./i18n.js";
|
|
4
|
+
let activeSelect = null;
|
|
5
|
+
export function Select(props) {
|
|
6
|
+
const { value, placeholder = i18n("Select an option"), options, onChange, disabled = false, className = "", width = "180px", size = "md", variant = "default", fitContent = false, } = props;
|
|
7
|
+
// Create refs
|
|
8
|
+
const triggerRef = createRef();
|
|
9
|
+
// Initialize state
|
|
10
|
+
const state = {
|
|
11
|
+
isOpen: false,
|
|
12
|
+
focusedIndex: -1,
|
|
13
|
+
};
|
|
14
|
+
// Size classes
|
|
15
|
+
const sizeClasses = {
|
|
16
|
+
sm: "h-8 px-2 text-xs",
|
|
17
|
+
md: "h-9 px-3 text-sm",
|
|
18
|
+
lg: "h-10 px-4 text-base",
|
|
19
|
+
};
|
|
20
|
+
// Variant classes
|
|
21
|
+
const variantClasses = {
|
|
22
|
+
default: "text-foreground border-input bg-transparent hover:bg-accent/50 shadow-xs",
|
|
23
|
+
ghost: "text-foreground border-transparent bg-transparent hover:bg-accent hover:text-accent-foreground",
|
|
24
|
+
outline: "text-foreground border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
|
|
25
|
+
};
|
|
26
|
+
// Flatten options for easier access
|
|
27
|
+
const flatOptions = [];
|
|
28
|
+
const isGrouped = options.length > 0 && "options" in options[0];
|
|
29
|
+
if (isGrouped) {
|
|
30
|
+
options.forEach((group) => {
|
|
31
|
+
flatOptions.push(...group.options.filter((opt) => !opt.disabled));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
flatOptions.push(...options.filter((opt) => !opt.disabled));
|
|
36
|
+
}
|
|
37
|
+
// Find selected option
|
|
38
|
+
const selectedOption = flatOptions.find((opt) => opt.value === value);
|
|
39
|
+
// Portal container
|
|
40
|
+
let portalContainer = null;
|
|
41
|
+
const ensurePortalContainer = () => {
|
|
42
|
+
if (!portalContainer) {
|
|
43
|
+
portalContainer = document.createElement("div");
|
|
44
|
+
portalContainer.className = "select-portal-container";
|
|
45
|
+
portalContainer.style.cssText = "position: fixed; z-index: 50; pointer-events: none;";
|
|
46
|
+
document.body.appendChild(portalContainer);
|
|
47
|
+
}
|
|
48
|
+
return portalContainer;
|
|
49
|
+
};
|
|
50
|
+
const updatePosition = () => {
|
|
51
|
+
if (!triggerRef.value || !portalContainer)
|
|
52
|
+
return;
|
|
53
|
+
const rect = triggerRef.value.getBoundingClientRect();
|
|
54
|
+
state.triggerRect = rect;
|
|
55
|
+
// Calculate position
|
|
56
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
57
|
+
const spaceAbove = rect.top;
|
|
58
|
+
const dropdownHeight = 300; // Max height
|
|
59
|
+
const showAbove = spaceBelow < dropdownHeight && spaceAbove > spaceBelow;
|
|
60
|
+
portalContainer.style.cssText = `
|
|
61
|
+
position: fixed;
|
|
62
|
+
left: ${rect.left}px;
|
|
63
|
+
${showAbove ? `bottom: ${window.innerHeight - rect.top}px` : `top: ${rect.bottom}px`};
|
|
64
|
+
min-width: ${rect.width}px;
|
|
65
|
+
width: max-content;
|
|
66
|
+
z-index: 50;
|
|
67
|
+
pointer-events: ${state.isOpen ? "auto" : "none"};
|
|
68
|
+
`;
|
|
69
|
+
};
|
|
70
|
+
const open = () => {
|
|
71
|
+
if (disabled || state.isOpen)
|
|
72
|
+
return;
|
|
73
|
+
// Close any other open select
|
|
74
|
+
if (activeSelect && activeSelect !== api) {
|
|
75
|
+
activeSelect.close();
|
|
76
|
+
}
|
|
77
|
+
state.isOpen = true;
|
|
78
|
+
state.focusedIndex = selectedOption ? flatOptions.indexOf(selectedOption) : 0;
|
|
79
|
+
ensurePortalContainer();
|
|
80
|
+
updatePosition();
|
|
81
|
+
renderPortal();
|
|
82
|
+
// Add listeners
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
document.addEventListener("click", handleOutsideClick);
|
|
85
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
86
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
87
|
+
window.addEventListener("resize", updatePosition);
|
|
88
|
+
}, 0);
|
|
89
|
+
activeSelect = api;
|
|
90
|
+
// Re-render trigger to update aria-expanded
|
|
91
|
+
if (triggerRef.value) {
|
|
92
|
+
triggerRef.value.setAttribute("aria-expanded", "true");
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const close = () => {
|
|
96
|
+
if (!state.isOpen)
|
|
97
|
+
return;
|
|
98
|
+
state.isOpen = false;
|
|
99
|
+
state.focusedIndex = -1;
|
|
100
|
+
// Remove listeners
|
|
101
|
+
document.removeEventListener("click", handleOutsideClick);
|
|
102
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
103
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
104
|
+
window.removeEventListener("resize", updatePosition);
|
|
105
|
+
// Clear portal
|
|
106
|
+
if (portalContainer) {
|
|
107
|
+
render(html ``, portalContainer);
|
|
108
|
+
}
|
|
109
|
+
if (activeSelect === api) {
|
|
110
|
+
activeSelect = null;
|
|
111
|
+
}
|
|
112
|
+
// Re-render trigger to update aria-expanded
|
|
113
|
+
if (triggerRef.value) {
|
|
114
|
+
triggerRef.value.setAttribute("aria-expanded", "false");
|
|
115
|
+
triggerRef.value.focus();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const handleOutsideClick = (e) => {
|
|
119
|
+
const target = e.target;
|
|
120
|
+
if (triggerRef.value?.contains(target) || portalContainer?.contains(target)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
close();
|
|
124
|
+
};
|
|
125
|
+
const handleKeyDown = (e) => {
|
|
126
|
+
if (!state.isOpen)
|
|
127
|
+
return;
|
|
128
|
+
switch (e.key) {
|
|
129
|
+
case "Escape":
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
close();
|
|
132
|
+
break;
|
|
133
|
+
case "ArrowDown":
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
state.focusedIndex = Math.min(state.focusedIndex + 1, flatOptions.length - 1);
|
|
136
|
+
renderPortal();
|
|
137
|
+
break;
|
|
138
|
+
case "ArrowUp":
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
state.focusedIndex = Math.max(state.focusedIndex - 1, 0);
|
|
141
|
+
renderPortal();
|
|
142
|
+
break;
|
|
143
|
+
case "Enter":
|
|
144
|
+
case " ":
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
if (state.focusedIndex >= 0 && state.focusedIndex < flatOptions.length) {
|
|
147
|
+
selectOption(flatOptions[state.focusedIndex].value);
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
case "Home":
|
|
151
|
+
e.preventDefault();
|
|
152
|
+
state.focusedIndex = 0;
|
|
153
|
+
renderPortal();
|
|
154
|
+
break;
|
|
155
|
+
case "End":
|
|
156
|
+
e.preventDefault();
|
|
157
|
+
state.focusedIndex = flatOptions.length - 1;
|
|
158
|
+
renderPortal();
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
const selectOption = (optionValue) => {
|
|
163
|
+
onChange(optionValue);
|
|
164
|
+
close();
|
|
165
|
+
};
|
|
166
|
+
const renderPortal = () => {
|
|
167
|
+
if (!portalContainer || !state.isOpen)
|
|
168
|
+
return;
|
|
169
|
+
const dropdownContent = html `
|
|
170
|
+
<div
|
|
171
|
+
class="border border-border bg-popover text-popover-foreground shadow-md rounded-md overflow-hidden animate-in fade-in-0 zoom-in-95"
|
|
172
|
+
role="listbox"
|
|
173
|
+
style="max-height: 300px; overflow-y: auto;"
|
|
174
|
+
>
|
|
175
|
+
<div class="p-1">
|
|
176
|
+
${isGrouped
|
|
177
|
+
? options.map((group, _groupIndex) => html `
|
|
178
|
+
<div role="group">
|
|
179
|
+
${group.label
|
|
180
|
+
? html `
|
|
181
|
+
<div class="text-muted-foreground px-2 py-1.5 text-xs font-medium">
|
|
182
|
+
${group.label}
|
|
183
|
+
</div>
|
|
184
|
+
`
|
|
185
|
+
: ""}
|
|
186
|
+
${group.options.map((option, _optionIndex) => {
|
|
187
|
+
const globalIndex = flatOptions.indexOf(option);
|
|
188
|
+
const isFocused = globalIndex === state.focusedIndex;
|
|
189
|
+
const isSelected = option.value === value;
|
|
190
|
+
return html `
|
|
191
|
+
<div
|
|
192
|
+
role="option"
|
|
193
|
+
aria-selected=${isSelected}
|
|
194
|
+
data-disabled=${option.disabled || false}
|
|
195
|
+
tabindex="-1"
|
|
196
|
+
class="relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none transition-colors
|
|
197
|
+
${isFocused ? "bg-accent text-accent-foreground" : ""}
|
|
198
|
+
${option.disabled ? "pointer-events-none opacity-50" : "hover:bg-accent hover:text-accent-foreground"}
|
|
199
|
+
${isSelected ? "font-medium" : ""}"
|
|
200
|
+
@click=${option.disabled ? null : () => selectOption(option.value)}
|
|
201
|
+
@mouseenter=${() => {
|
|
202
|
+
if (!option.disabled) {
|
|
203
|
+
state.focusedIndex = globalIndex;
|
|
204
|
+
renderPortal();
|
|
205
|
+
}
|
|
206
|
+
}}
|
|
207
|
+
>
|
|
208
|
+
<span class="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
209
|
+
${isSelected
|
|
210
|
+
? html `
|
|
211
|
+
<svg
|
|
212
|
+
class="h-4 w-4"
|
|
213
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
214
|
+
viewBox="0 0 24 24"
|
|
215
|
+
fill="none"
|
|
216
|
+
stroke="currentColor"
|
|
217
|
+
stroke-width="2"
|
|
218
|
+
stroke-linecap="round"
|
|
219
|
+
stroke-linejoin="round"
|
|
220
|
+
>
|
|
221
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
|
222
|
+
</svg>
|
|
223
|
+
`
|
|
224
|
+
: ""}
|
|
225
|
+
</span>
|
|
226
|
+
${option.icon ? html `<span class="flex-shrink-0">${option.icon}</span>` : ""}
|
|
227
|
+
<span>${option.label}</span>
|
|
228
|
+
</div>
|
|
229
|
+
`;
|
|
230
|
+
})}
|
|
231
|
+
</div>
|
|
232
|
+
`)
|
|
233
|
+
: options.map((option, index) => {
|
|
234
|
+
const isFocused = index === state.focusedIndex;
|
|
235
|
+
const isSelected = option.value === value;
|
|
236
|
+
return html `
|
|
237
|
+
<div
|
|
238
|
+
role="option"
|
|
239
|
+
aria-selected=${isSelected}
|
|
240
|
+
data-disabled=${option.disabled || false}
|
|
241
|
+
tabindex="-1"
|
|
242
|
+
class="relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none transition-colors
|
|
243
|
+
${isFocused ? "bg-accent text-accent-foreground" : ""}
|
|
244
|
+
${option.disabled ? "pointer-events-none opacity-50" : "hover:bg-accent hover:text-accent-foreground"}
|
|
245
|
+
${isSelected ? "font-medium" : ""}"
|
|
246
|
+
@click=${option.disabled ? null : () => selectOption(option.value)}
|
|
247
|
+
@mouseenter=${() => {
|
|
248
|
+
if (!option.disabled) {
|
|
249
|
+
state.focusedIndex = index;
|
|
250
|
+
renderPortal();
|
|
251
|
+
}
|
|
252
|
+
}}
|
|
253
|
+
>
|
|
254
|
+
<span class="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
255
|
+
${isSelected
|
|
256
|
+
? html `
|
|
257
|
+
<svg
|
|
258
|
+
class="h-4 w-4"
|
|
259
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
260
|
+
viewBox="0 0 24 24"
|
|
261
|
+
fill="none"
|
|
262
|
+
stroke="currentColor"
|
|
263
|
+
stroke-width="2"
|
|
264
|
+
stroke-linecap="round"
|
|
265
|
+
stroke-linejoin="round"
|
|
266
|
+
>
|
|
267
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
|
268
|
+
</svg>
|
|
269
|
+
`
|
|
270
|
+
: ""}
|
|
271
|
+
</span>
|
|
272
|
+
${option.icon ? html `<span class="flex-shrink-0">${option.icon}</span>` : ""}
|
|
273
|
+
<span>${option.label}</span>
|
|
274
|
+
</div>
|
|
275
|
+
`;
|
|
276
|
+
})}
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
`;
|
|
280
|
+
render(dropdownContent, portalContainer);
|
|
281
|
+
};
|
|
282
|
+
const api = { close };
|
|
283
|
+
const handleTriggerClick = (e) => {
|
|
284
|
+
e.preventDefault();
|
|
285
|
+
e.stopPropagation();
|
|
286
|
+
if (state.isOpen) {
|
|
287
|
+
close();
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
open();
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
// Calculate dynamic width if fitContent is enabled
|
|
294
|
+
const buttonWidth = fitContent ? "auto" : width;
|
|
295
|
+
const minWidth = fitContent ? width || "auto" : undefined;
|
|
296
|
+
// Trigger button
|
|
297
|
+
return html `
|
|
298
|
+
<button
|
|
299
|
+
${ref(triggerRef)}
|
|
300
|
+
type="button"
|
|
301
|
+
role="combobox"
|
|
302
|
+
aria-expanded=${state.isOpen}
|
|
303
|
+
aria-haspopup="listbox"
|
|
304
|
+
aria-autocomplete="none"
|
|
305
|
+
?disabled=${disabled}
|
|
306
|
+
@click=${handleTriggerClick}
|
|
307
|
+
class="flex items-center justify-between gap-2 rounded-md border whitespace-nowrap transition-[color,box-shadow] outline-none
|
|
308
|
+
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background
|
|
309
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
310
|
+
data-[placeholder]:text-muted-foreground
|
|
311
|
+
${sizeClasses[size]} ${variantClasses[variant]} ${className}"
|
|
312
|
+
style="width: ${buttonWidth}; ${minWidth ? `min-width: ${minWidth};` : ""}"
|
|
313
|
+
>
|
|
314
|
+
<span class="flex items-center gap-2 truncate">
|
|
315
|
+
${selectedOption?.icon ? html `<span class="flex-shrink-0">${selectedOption.icon}</span>` : ""}
|
|
316
|
+
${selectedOption ? selectedOption.label : placeholder}
|
|
317
|
+
</span>
|
|
318
|
+
<svg
|
|
319
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
320
|
+
width="24"
|
|
321
|
+
height="24"
|
|
322
|
+
viewBox="0 0 24 24"
|
|
323
|
+
fill="none"
|
|
324
|
+
stroke="currentColor"
|
|
325
|
+
stroke-width="2"
|
|
326
|
+
stroke-linecap="round"
|
|
327
|
+
stroke-linejoin="round"
|
|
328
|
+
class="h-4 w-4 opacity-50 flex-shrink-0"
|
|
329
|
+
>
|
|
330
|
+
<path d="m6 9 6 6 6-6"></path>
|
|
331
|
+
</svg>
|
|
332
|
+
</button>
|
|
333
|
+
`;
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../src/Select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAuB,MAAM,KAAK,CAAC;AACxD,OAAO,EAAE,SAAS,EAAY,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAiCjC,IAAI,YAAY,GAAiC,IAAI,CAAC;AAEtD,MAAM,UAAU,MAAM,CAAC,KAAkB;IACtC,MAAM,EACH,KAAK,EACL,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,EACtC,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,OAAO,EACf,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,SAAS,EACnB,UAAU,GAAG,KAAK,GACpB,GAAG,KAAK,CAAC;IAEV,cAAc;IACd,MAAM,UAAU,GAA2B,SAAS,EAAE,CAAC;IAEvD,mBAAmB;IACnB,MAAM,KAAK,GAAgB;QACxB,MAAM,EAAE,KAAK;QACb,YAAY,EAAE,CAAC,CAAC;KAClB,CAAC;IAEF,eAAe;IACf,MAAM,WAAW,GAAG;QACjB,EAAE,EAAE,kBAAkB;QACtB,EAAE,EAAE,kBAAkB;QACtB,EAAE,EAAE,qBAAq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QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAE1D,iBAAiB;IACjB,OAAO,IAAI,CAAA;;WAEH,GAAG,CAAC,UAAU,CAAC;;;yBAGD,KAAK,CAAC,MAAM;;;qBAGhB,QAAQ;kBACX,kBAAkB;;;;;MAK9B,WAAW,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,IAAI,SAAS;yBACtC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE;;;cAGpE,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,+BAA+B,cAAc,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE;cAC3F,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW;;;;;;;;;;;;;;;;;IAiB7D,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutChildren, type TemplateResult } from "./mini.js";
|
|
2
|
+
export type SeparatorOrientation = "horizontal" | "vertical";
|
|
3
|
+
interface SeparatorProps extends ComponentPropsWithoutChildren {
|
|
4
|
+
orientation?: SeparatorOrientation;
|
|
5
|
+
decorative?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function Separator(props: SeparatorProps): TemplateResult;
|
|
8
|
+
export declare function Separator(orientation?: SeparatorOrientation, className?: string): TemplateResult;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=Separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../src/Separator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,6BAA6B,EAAY,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAE9F,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE7D,UAAU,cAAe,SAAQ,6BAA6B;IAC3D,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;CACvB;AAiBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAAC;AACjE,wBAAgB,SAAS,CAAC,WAAW,CAAC,EAAE,oBAAoB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { fc, html } from "./mini.js";
|
|
2
|
+
const _Separator = fc(({ orientation = "horizontal", decorative = true, className = "" }) => {
|
|
3
|
+
const orientationClasses = orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]";
|
|
4
|
+
const baseClasses = "shrink-0 bg-border";
|
|
5
|
+
return html `
|
|
6
|
+
<div
|
|
7
|
+
role="${decorative ? "none" : "separator"}"
|
|
8
|
+
aria-orientation="${decorative ? undefined : orientation}"
|
|
9
|
+
class="${baseClasses} ${orientationClasses} ${className}"
|
|
10
|
+
></div>
|
|
11
|
+
`;
|
|
12
|
+
});
|
|
13
|
+
export function Separator(propsOrOrientation = "horizontal", className = "") {
|
|
14
|
+
if (typeof propsOrOrientation === "object" && propsOrOrientation !== null) {
|
|
15
|
+
return _Separator(propsOrOrientation);
|
|
16
|
+
}
|
|
17
|
+
return _Separator({ orientation: propsOrOrientation, className });
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=Separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Separator.js","sourceRoot":"","sources":["../src/Separator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,EAAE,EAAE,IAAI,EAAuB,MAAM,WAAW,CAAC;AAS9F,MAAM,UAAU,GAAG,EAAE,CAAiB,CAAC,EAAE,WAAW,GAAG,YAAY,EAAE,UAAU,GAAG,IAAI,EAAE,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE;IACzG,MAAM,kBAAkB,GAAG,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAE9F,MAAM,WAAW,GAAG,oBAAoB,CAAC;IAEzC,OAAO,IAAI,CAAA;;iBAEG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW;6BACrB,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;kBAC/C,WAAW,IAAI,kBAAkB,IAAI,SAAS;;IAE5D,CAAC;AACL,CAAC,CAAC,CAAC;AAKH,MAAM,UAAU,SAAS,CACtB,qBAA4D,YAAY,EACxE,SAAS,GAAG,EAAE;IAEd,IAAI,OAAO,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,IAAI,EAAE,CAAC;QACzE,OAAO,UAAU,CAAC,kBAAoC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,UAAU,CAAC,EAAE,WAAW,EAAE,kBAA0C,EAAE,SAAS,EAAE,CAAC,CAAC;AAC7F,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
2
|
+
import { type BaseComponentProps } from "./mini.js";
|
|
3
|
+
export declare class Sidebar extends LitElement {
|
|
4
|
+
defaultOpen: boolean;
|
|
5
|
+
breakpoint: "sm" | "md" | "lg" | "xl";
|
|
6
|
+
className: string;
|
|
7
|
+
logo: TemplateResult | string;
|
|
8
|
+
footer: TemplateResult | string;
|
|
9
|
+
content: TemplateResult | string;
|
|
10
|
+
private isOpen;
|
|
11
|
+
protected createRenderRoot(): this;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
private toggleSidebar;
|
|
14
|
+
render(): TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
export interface SidebarItemProps extends BaseComponentProps {
|
|
17
|
+
href?: string;
|
|
18
|
+
active?: boolean;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
children: TemplateResult | string;
|
|
21
|
+
}
|
|
22
|
+
export declare const SidebarItem: import("./mini.js").Component<SidebarItemProps>;
|
|
23
|
+
export interface SidebarSectionProps extends BaseComponentProps {
|
|
24
|
+
title?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const SidebarSection: import("./mini.js").Component<SidebarSectionProps>;
|
|
27
|
+
//# sourceMappingURL=Sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../src/Sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAK5D,OAAO,EAAE,KAAK,kBAAkB,EAAM,MAAM,WAAW,CAAC;AAExD,qBACa,OAAQ,SAAQ,UAAU;IACoB,WAAW,UAAS;IAChD,UAAU,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IACpB,SAAS,SAAM;IACxC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAM;IACnC,MAAM,EAAE,cAAc,GAAG,MAAM,CAAM;IACrC,OAAO,EAAE,cAAc,GAAG,MAAM,CAAM;IAEzD,OAAO,CAAC,MAAM,CAAS;IAEhC,SAAS,CAAC,gBAAgB;IAI1B,iBAAiB;IAKjB,OAAO,CAAC,aAAa,CAEnB;IAEF,MAAM;CAsER;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,cAAc,GAAG,MAAM,CAAC;CACpC;AAED,eAAO,MAAM,WAAW,iDAetB,CAAC;AAEH,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,cAAc,oDAYzB,CAAC"}
|