reke-ui 0.1.1 → 0.2.0
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/README.md +23 -0
- package/cli/install-skills.mjs +169 -0
- package/custom-elements.json +472 -128
- package/dist/__type-checks__/no-lit-in-public-types.d.ts +2 -0
- package/dist/__type-checks__/no-lit-in-public-types.d.ts.map +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js +9 -0
- package/dist/components/reke-alert/reke-alert.d.ts.map +1 -1
- package/dist/components/reke-alert/reke-alert.js +45 -0
- package/dist/components/reke-alert/reke-alert.styles.d.ts.map +1 -1
- package/dist/components/reke-alert/reke-alert.styles.js +103 -0
- package/dist/components/reke-badge/reke-badge.d.ts +4 -2
- package/dist/components/reke-badge/reke-badge.d.ts.map +1 -1
- package/dist/components/reke-badge/reke-badge.js +30 -0
- package/dist/components/reke-badge/reke-badge.styles.d.ts.map +1 -1
- package/dist/components/reke-badge/reke-badge.styles.js +92 -0
- package/dist/components/reke-button/reke-button.d.ts.map +1 -1
- package/dist/components/reke-button/reke-button.js +53 -0
- package/dist/components/reke-button/reke-button.styles.d.ts.map +1 -1
- package/dist/components/reke-button/reke-button.styles.js +226 -0
- package/dist/components/reke-card/reke-card.d.ts +7 -0
- package/dist/components/reke-card/reke-card.d.ts.map +1 -1
- package/dist/components/reke-card/reke-card.js +50 -0
- package/dist/components/reke-card/reke-card.styles.d.ts.map +1 -1
- package/dist/components/reke-card/reke-card.styles.js +147 -0
- package/dist/components/reke-checkbox/reke-checkbox.js +57 -0
- package/dist/components/reke-checkbox/reke-checkbox.styles.d.ts.map +1 -1
- package/dist/components/reke-checkbox/reke-checkbox.styles.js +79 -0
- package/dist/components/reke-chip/reke-chip.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.js +62 -0
- package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.styles.js +128 -0
- package/dist/components/reke-date-range/reke-date-range.d.ts.map +1 -1
- package/dist/components/reke-date-range/reke-date-range.js +326 -0
- package/dist/components/reke-date-range/reke-date-range.styles.d.ts.map +1 -1
- package/dist/components/reke-date-range/reke-date-range.styles.js +335 -0
- package/dist/components/reke-dialog/reke-dialog.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.js +77 -0
- package/dist/components/reke-dialog/reke-dialog.styles.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.styles.js +132 -0
- package/dist/components/reke-file-upload/reke-file-upload.d.ts.map +1 -1
- package/dist/components/reke-file-upload/reke-file-upload.js +84 -0
- package/dist/components/reke-file-upload/reke-file-upload.styles.js +104 -0
- package/dist/components/reke-input/reke-input.js +54 -0
- package/dist/components/reke-input/reke-input.styles.d.ts.map +1 -1
- package/dist/components/reke-input/reke-input.styles.js +78 -0
- package/dist/components/reke-select/reke-select.d.ts.map +1 -1
- package/dist/components/reke-select/reke-select.js +89 -0
- package/dist/components/reke-select/reke-select.styles.d.ts.map +1 -1
- package/dist/components/reke-select/reke-select.styles.js +120 -0
- package/dist/components/reke-table/reke-table.d.ts +144 -13
- package/dist/components/reke-table/reke-table.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.js +291 -0
- package/dist/components/reke-table/reke-table.styles.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.styles.js +265 -0
- package/dist/components/reke-textarea/reke-textarea.js +54 -0
- package/dist/components/reke-textarea/reke-textarea.styles.js +73 -0
- package/dist/components/reke-toast/reke-toast.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.js +74 -0
- package/dist/components/reke-toast/reke-toast.styles.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.styles.js +183 -0
- package/dist/components/reke-toggle/reke-toggle.js +50 -0
- package/dist/components/reke-toggle/reke-toggle.styles.js +68 -0
- package/dist/components/reke-tooltip/reke-tooltip.js +51 -0
- package/dist/components/reke-tooltip/reke-tooltip.styles.js +64 -0
- package/dist/index.d.ts +23 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- package/dist/node_modules/lit/directives/ref.js +1 -0
- package/dist/node_modules/lit-html/async-directive.js +55 -0
- package/dist/node_modules/lit-html/directive-helpers.js +5 -0
- package/dist/node_modules/lit-html/directive.js +28 -0
- package/dist/node_modules/lit-html/directives/ref.js +30 -0
- package/dist/node_modules/lit-html/lit-html.js +234 -0
- package/dist/react-bridge/table.d.ts +58 -0
- package/dist/react-bridge/table.d.ts.map +1 -0
- package/dist/react-bridge/table.js +115 -0
- package/dist/react.d.ts +12 -26
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +111 -132
- package/dist/shared/base-element.js +14 -0
- package/dist/shared/tailwind-styles.js +6 -0
- package/dist/shared/tailwind.js +4 -0
- package/dist/tokens/reke-tokens.css +70 -0
- package/package.json +43 -23
- package/dist/reke-chip-DexKxhxn.js +0 -3358
- package/dist/reke-ui.js +0 -20
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { RekeElement as e } from "../../shared/base-element.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js";
|
|
3
|
+
import { styles as n } from "./reke-dialog.styles.js";
|
|
4
|
+
import { html as r, nothing as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { classMap as s } from "lit/directives/class-map.js";
|
|
7
|
+
//#region src/components/reke-dialog/reke-dialog.ts
|
|
8
|
+
var c = class extends e {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.open = !1, this.heading = "", this.variant = "modal", this.position = "right", this._handleKeydown = (e) => {
|
|
11
|
+
e.key === "Escape" && this.open && this.close();
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
static {
|
|
15
|
+
this.styles = n;
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
super.connectedCallback(), document.addEventListener("keydown", this._handleKeydown);
|
|
19
|
+
}
|
|
20
|
+
disconnectedCallback() {
|
|
21
|
+
super.disconnectedCallback(), document.removeEventListener("keydown", this._handleKeydown);
|
|
22
|
+
}
|
|
23
|
+
show() {
|
|
24
|
+
this.open = !0;
|
|
25
|
+
}
|
|
26
|
+
close() {
|
|
27
|
+
this.open = !1, this.emit("reke-close");
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
if (!this.open) return i;
|
|
31
|
+
let e = this.variant === "drawer", t = {
|
|
32
|
+
backdrop: !0,
|
|
33
|
+
"backdrop--drawer": e,
|
|
34
|
+
[`backdrop--${this.position}`]: e
|
|
35
|
+
}, n = {
|
|
36
|
+
dialog: !e,
|
|
37
|
+
drawer: e,
|
|
38
|
+
[`drawer--${this.position}`]: e
|
|
39
|
+
};
|
|
40
|
+
return r`
|
|
41
|
+
<div class=${s(t)} @click=${this.close}>
|
|
42
|
+
<div
|
|
43
|
+
class=${s(n)}
|
|
44
|
+
role="dialog"
|
|
45
|
+
aria-modal="true"
|
|
46
|
+
aria-label=${this.heading}
|
|
47
|
+
@click=${(e) => e.stopPropagation()}
|
|
48
|
+
>
|
|
49
|
+
${this.heading ? r`
|
|
50
|
+
<div class="dialog-header">
|
|
51
|
+
<h2 class="dialog-title">${this.heading}</h2>
|
|
52
|
+
<button
|
|
53
|
+
class="close-btn"
|
|
54
|
+
@click=${this.close}
|
|
55
|
+
aria-label="Close"
|
|
56
|
+
>
|
|
57
|
+
×
|
|
58
|
+
</button>
|
|
59
|
+
</div>
|
|
60
|
+
` : i}
|
|
61
|
+
<div class="dialog-body">
|
|
62
|
+
<slot></slot>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="dialog-footer">
|
|
65
|
+
<slot name="footer"></slot>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
t([o({
|
|
73
|
+
type: Boolean,
|
|
74
|
+
reflect: !0
|
|
75
|
+
})], c.prototype, "open", void 0), t([o()], c.prototype, "heading", void 0), t([o({ reflect: !0 })], c.prototype, "variant", void 0), t([o({ reflect: !0 })], c.prototype, "position", void 0), c = t([a("reke-dialog")], c);
|
|
76
|
+
//#endregion
|
|
77
|
+
export { c as RekeDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-dialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-dialog/reke-dialog.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"reke-dialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-dialog/reke-dialog.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BAiIlB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as t } from "lit";
|
|
3
|
+
//#region src/components/reke-dialog/reke-dialog.styles.ts
|
|
4
|
+
var n = [e, t`
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* === Backdrop === */
|
|
10
|
+
|
|
11
|
+
.backdrop {
|
|
12
|
+
position: fixed;
|
|
13
|
+
inset: 0;
|
|
14
|
+
background: rgba(0, 0, 0, 0.6);
|
|
15
|
+
backdrop-filter: blur(2px);
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
z-index: 1000;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.backdrop--drawer {
|
|
23
|
+
align-items: stretch;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.backdrop--right {
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.backdrop--left {
|
|
31
|
+
justify-content: flex-start;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* === Modal === */
|
|
35
|
+
|
|
36
|
+
.dialog {
|
|
37
|
+
background: var(--reke-color-bg, #0f0f10);
|
|
38
|
+
border: 1px solid var(--reke-color-border, #252525);
|
|
39
|
+
border-radius: 6px;
|
|
40
|
+
min-width: 400px;
|
|
41
|
+
max-width: 560px;
|
|
42
|
+
width: 100%;
|
|
43
|
+
max-height: 80vh;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
font-family: var(
|
|
46
|
+
--reke-font-mono,
|
|
47
|
+
'JetBrains Mono',
|
|
48
|
+
ui-monospace,
|
|
49
|
+
monospace
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* === Drawer === */
|
|
54
|
+
|
|
55
|
+
.drawer {
|
|
56
|
+
background: var(--reke-color-bg, #0f0f10);
|
|
57
|
+
width: 400px;
|
|
58
|
+
max-width: 90vw;
|
|
59
|
+
height: 100%;
|
|
60
|
+
overflow-y: auto;
|
|
61
|
+
font-family: var(
|
|
62
|
+
--reke-font-mono,
|
|
63
|
+
'JetBrains Mono',
|
|
64
|
+
ui-monospace,
|
|
65
|
+
monospace
|
|
66
|
+
);
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.drawer--right {
|
|
72
|
+
border-left: 1px solid var(--reke-color-border, #252525);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.drawer--left {
|
|
76
|
+
border-right: 1px solid var(--reke-color-border, #252525);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* === Shared parts === */
|
|
80
|
+
|
|
81
|
+
.dialog-header {
|
|
82
|
+
display: flex;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
align-items: center;
|
|
85
|
+
padding: 16px 20px;
|
|
86
|
+
border-bottom: 1px solid var(--reke-color-border, #252525);
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.dialog-title {
|
|
91
|
+
margin: 0;
|
|
92
|
+
font-size: var(--reke-font-size-md, 14px);
|
|
93
|
+
font-weight: var(--reke-font-weight-semibold, 600);
|
|
94
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.close-btn {
|
|
98
|
+
background: transparent;
|
|
99
|
+
border: none;
|
|
100
|
+
color: var(--reke-color-text-muted, #525252);
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
font-size: 20px;
|
|
103
|
+
padding: 4px 8px;
|
|
104
|
+
line-height: 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.close-btn:hover {
|
|
108
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.close-btn:focus-visible {
|
|
112
|
+
outline: 2px solid var(--reke-color-primary, #22C55E);
|
|
113
|
+
outline-offset: 2px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.dialog-body {
|
|
117
|
+
padding: 20px;
|
|
118
|
+
flex: 1;
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.dialog-footer {
|
|
123
|
+
padding: 12px 20px;
|
|
124
|
+
border-top: 1px solid var(--reke-color-border, #252525);
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: flex-end;
|
|
127
|
+
gap: 8px;
|
|
128
|
+
flex-shrink: 0;
|
|
129
|
+
}
|
|
130
|
+
`];
|
|
131
|
+
//#endregion
|
|
132
|
+
export { n as styles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-file-upload.d.ts","sourceRoot":"","sources":["../../../src/components/reke-file-upload/reke-file-upload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D;;;;;;;;;;;;;;;GAeG;AACH,qBACa,cAAe,SAAQ,WAAW;IAC7C,OAAgB,MAAM,4BAAU;IAEhC,kEAAkE;IAElE,MAAM,SAAM;IAGZ,IAAI,SAAM;IAGV,QAAQ,UAAS;IAGjB,KAAK,UAAS;IAGd,YAAY,SAAM;IAElB,oCAAoC;IAEpC,OAAO,UAAS;IAGhB,OAAO,CAAC,SAAS,CAAS;IAG1B,OAAO,CAAC,SAAS,CAAM;IAGvB,OAAO,CAAC,MAAM,CAAoB;IAElC,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,iBAAiB;IAQzB,gDAAgD;IAChD,KAAK;IAMI,MAAM;
|
|
1
|
+
{"version":3,"file":"reke-file-upload.d.ts","sourceRoot":"","sources":["../../../src/components/reke-file-upload/reke-file-upload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D;;;;;;;;;;;;;;;GAeG;AACH,qBACa,cAAe,SAAQ,WAAW;IAC7C,OAAgB,MAAM,4BAAU;IAEhC,kEAAkE;IAElE,MAAM,SAAM;IAGZ,IAAI,SAAM;IAGV,QAAQ,UAAS;IAGjB,KAAK,UAAS;IAGd,YAAY,SAAM;IAElB,oCAAoC;IAEpC,OAAO,UAAS;IAGhB,OAAO,CAAC,SAAS,CAAS;IAG1B,OAAO,CAAC,SAAS,CAAM;IAGvB,OAAO,CAAC,MAAM,CAAoB;IAElC,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,iBAAiB;IAQzB,gDAAgD;IAChD,KAAK;IAMI,MAAM;CAmDhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { RekeElement as e } from "../../shared/base-element.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js";
|
|
3
|
+
import { styles as n } from "./reke-file-upload.styles.js";
|
|
4
|
+
import { html as r, nothing as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o, query as s, state as c } from "lit/decorators.js";
|
|
6
|
+
import { classMap as l } from "lit/directives/class-map.js";
|
|
7
|
+
//#region src/components/reke-file-upload/reke-file-upload.ts
|
|
8
|
+
var u = class extends e {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.accept = "", this.hint = "", this.disabled = !1, this.error = !1, this.errorMessage = "", this.compact = !1, this._dragging = !1, this._fileName = "";
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.styles = n;
|
|
14
|
+
}
|
|
15
|
+
handleClick() {
|
|
16
|
+
this.disabled || this._input.click();
|
|
17
|
+
}
|
|
18
|
+
handleDragOver(e) {
|
|
19
|
+
e.preventDefault(), e.stopPropagation(), this.disabled || (this._dragging = !0);
|
|
20
|
+
}
|
|
21
|
+
handleDragLeave(e) {
|
|
22
|
+
e.preventDefault(), e.stopPropagation(), this._dragging = !1;
|
|
23
|
+
}
|
|
24
|
+
handleDrop(e) {
|
|
25
|
+
if (e.preventDefault(), e.stopPropagation(), this._dragging = !1, this.disabled) return;
|
|
26
|
+
let t = e.dataTransfer?.files[0];
|
|
27
|
+
t && (this._fileName = t.name, this.emit("reke-file-select", { file: t }));
|
|
28
|
+
}
|
|
29
|
+
handleInputChange() {
|
|
30
|
+
let e = this._input.files?.[0];
|
|
31
|
+
e && (this._fileName = e.name, this.emit("reke-file-select", { file: e }));
|
|
32
|
+
}
|
|
33
|
+
clear() {
|
|
34
|
+
this._fileName = "", this._input && (this._input.value = ""), this.emit("reke-file-clear");
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return r`
|
|
38
|
+
<div
|
|
39
|
+
part="dropzone"
|
|
40
|
+
class=${l({
|
|
41
|
+
dropzone: !0,
|
|
42
|
+
"dropzone--dragging": this._dragging,
|
|
43
|
+
"dropzone--error": this.error,
|
|
44
|
+
"dropzone--compact": this.compact
|
|
45
|
+
})}
|
|
46
|
+
@click=${this.handleClick}
|
|
47
|
+
@dragover=${this.handleDragOver}
|
|
48
|
+
@dragleave=${this.handleDragLeave}
|
|
49
|
+
@drop=${this.handleDrop}
|
|
50
|
+
role="button"
|
|
51
|
+
tabindex="0"
|
|
52
|
+
aria-label="Upload file"
|
|
53
|
+
@keydown=${(e) => {
|
|
54
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.handleClick());
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<div class="icon" aria-hidden="true">↑</div>
|
|
58
|
+
<div class="text">
|
|
59
|
+
${this._fileName ? r`<span class="text__file">${this._fileName}</span>` : r`<span class="text__primary">
|
|
60
|
+
${this._dragging ? "drop file here" : "drag or select file"}
|
|
61
|
+
</span>`}
|
|
62
|
+
${this.error && this.errorMessage ? r`<span class="text__error">${this.errorMessage}</span>` : this.hint ? r`<span class="text__secondary">${this.hint}</span>` : i}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<input
|
|
66
|
+
type="file"
|
|
67
|
+
accept=${this.accept || i}
|
|
68
|
+
@change=${this.handleInputChange}
|
|
69
|
+
/>
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
t([o()], u.prototype, "accept", void 0), t([o()], u.prototype, "hint", void 0), t([o({
|
|
74
|
+
type: Boolean,
|
|
75
|
+
reflect: !0
|
|
76
|
+
})], u.prototype, "disabled", void 0), t([o({
|
|
77
|
+
type: Boolean,
|
|
78
|
+
reflect: !0
|
|
79
|
+
})], u.prototype, "error", void 0), t([o({ attribute: "error-message" })], u.prototype, "errorMessage", void 0), t([o({
|
|
80
|
+
type: Boolean,
|
|
81
|
+
reflect: !0
|
|
82
|
+
})], u.prototype, "compact", void 0), t([c()], u.prototype, "_dragging", void 0), t([c()], u.prototype, "_fileName", void 0), t([s("input[type=\"file\"]")], u.prototype, "_input", void 0), u = t([a("reke-file-upload")], u);
|
|
83
|
+
//#endregion
|
|
84
|
+
export { u as RekeFileUpload };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as t } from "lit";
|
|
3
|
+
//#region src/components/reke-file-upload/reke-file-upload.styles.ts
|
|
4
|
+
var n = [e, t`
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([disabled]) {
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
opacity: 0.5;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dropzone {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
gap: var(--reke-space-sm, 12px);
|
|
20
|
+
padding: var(--reke-space-xl, 24px) var(--reke-space-lg, 20px);
|
|
21
|
+
border-radius: var(--reke-radius, 4px);
|
|
22
|
+
border: 1px dashed var(--reke-color-border, #252525);
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
transition: border-color 0.2s ease, background-color 0.2s ease;
|
|
26
|
+
text-align: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dropzone:hover {
|
|
30
|
+
border-color: var(--reke-color-text-muted, #525252);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.dropzone--dragging {
|
|
34
|
+
border-color: var(--reke-color-primary, #22c55e);
|
|
35
|
+
background-color: color-mix(in srgb, var(--reke-color-primary, #22c55e) 5%, transparent);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dropzone--error {
|
|
39
|
+
border-color: var(--reke-color-danger, #ef4444);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dropzone--compact {
|
|
43
|
+
flex-direction: row;
|
|
44
|
+
padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.icon {
|
|
48
|
+
width: 36px;
|
|
49
|
+
height: 36px;
|
|
50
|
+
border-radius: 50%;
|
|
51
|
+
background-color: color-mix(in srgb, var(--reke-color-primary, #22c55e) 10%, transparent);
|
|
52
|
+
border: 1px solid color-mix(in srgb, var(--reke-color-primary, #22c55e) 20%, transparent);
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
color: var(--reke-color-primary, #22c55e);
|
|
57
|
+
font-size: 16px;
|
|
58
|
+
flex-shrink: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.dropzone--compact .icon {
|
|
62
|
+
width: 28px;
|
|
63
|
+
height: 28px;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.text {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
gap: 2px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.text__primary {
|
|
74
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
75
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
76
|
+
font-weight: var(--reke-font-weight-medium, 500);
|
|
77
|
+
color: var(--reke-color-text, #e5e5e5);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.text__secondary {
|
|
81
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
82
|
+
font-size: var(--reke-font-size-2xs, 11px);
|
|
83
|
+
color: var(--reke-color-text-ghost, #7A7A7A);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.text__file {
|
|
87
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
88
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
89
|
+
font-weight: var(--reke-font-weight-medium, 500);
|
|
90
|
+
color: var(--reke-color-primary, #22c55e);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.text__error {
|
|
94
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
95
|
+
font-size: var(--reke-font-size-2xs, 11px);
|
|
96
|
+
color: var(--reke-color-danger, #ef4444);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
input[type='file'] {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
`];
|
|
103
|
+
//#endregion
|
|
104
|
+
export { n as styles };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { RekeElement as e } from "../../shared/base-element.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js";
|
|
3
|
+
import { styles as n } from "./reke-input.styles.js";
|
|
4
|
+
import { html as r, nothing as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { classMap as s } from "lit/directives/class-map.js";
|
|
7
|
+
//#region src/components/reke-input/reke-input.ts
|
|
8
|
+
var c = class extends e {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.value = "", this.placeholder = "", this.type = "text", this.size = "md", this.disabled = !1, this.error = !1, this.label = "";
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.styles = n;
|
|
14
|
+
}
|
|
15
|
+
handleInput(e) {
|
|
16
|
+
let t = e.target;
|
|
17
|
+
this.value = t.value, this.emit("reke-input", { value: this.value });
|
|
18
|
+
}
|
|
19
|
+
handleChange() {
|
|
20
|
+
this.emit("reke-change", { value: this.value });
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
let e = {
|
|
24
|
+
input: !0,
|
|
25
|
+
[`input--${this.size}`]: !0,
|
|
26
|
+
"input--error": this.error
|
|
27
|
+
};
|
|
28
|
+
return r`
|
|
29
|
+
${this.label ? r`<label class="label">${this.label}</label>` : i}
|
|
30
|
+
<input
|
|
31
|
+
part="input"
|
|
32
|
+
class=${s(e)}
|
|
33
|
+
type=${this.type}
|
|
34
|
+
.value=${this.value}
|
|
35
|
+
placeholder=${this.placeholder || i}
|
|
36
|
+
?disabled=${this.disabled}
|
|
37
|
+
aria-disabled=${this.disabled}
|
|
38
|
+
aria-invalid=${this.error}
|
|
39
|
+
aria-label=${this.label || i}
|
|
40
|
+
@input=${this.handleInput}
|
|
41
|
+
@change=${this.handleChange}
|
|
42
|
+
/>
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
t([o()], c.prototype, "value", void 0), t([o()], c.prototype, "placeholder", void 0), t([o()], c.prototype, "type", void 0), t([o({ reflect: !0 })], c.prototype, "size", void 0), t([o({
|
|
47
|
+
type: Boolean,
|
|
48
|
+
reflect: !0
|
|
49
|
+
})], c.prototype, "disabled", void 0), t([o({
|
|
50
|
+
type: Boolean,
|
|
51
|
+
reflect: !0
|
|
52
|
+
})], c.prototype, "error", void 0), t([o()], c.prototype, "label", void 0), c = t([a("reke-input")], c);
|
|
53
|
+
//#endregion
|
|
54
|
+
export { c as RekeInput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-input.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-input/reke-input.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"reke-input.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-input/reke-input.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BA2ElB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as t } from "lit";
|
|
3
|
+
//#region src/components/reke-input/reke-input.styles.ts
|
|
4
|
+
var n = [e, t`
|
|
5
|
+
:host {
|
|
6
|
+
display: inline-block;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([disabled]) {
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
opacity: 0.5;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.label {
|
|
15
|
+
display: block;
|
|
16
|
+
margin-bottom: var(--reke-space-2xs, 6px);
|
|
17
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
18
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
19
|
+
color: var(--reke-color-text-label, #8A8A8A);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.input {
|
|
23
|
+
display: block;
|
|
24
|
+
width: 100%;
|
|
25
|
+
background: var(--reke-color-input-bg, var(--reke-color-surface, #1A1A1A));
|
|
26
|
+
box-shadow: var(--reke-shadow-input, none);
|
|
27
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
28
|
+
border: 1px solid var(--reke-color-border, #252525);
|
|
29
|
+
border-radius: var(--reke-radius, 4px);
|
|
30
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
outline: none;
|
|
33
|
+
transition: border-color 0.15s ease;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.input::placeholder {
|
|
37
|
+
color: var(--reke-color-text-muted, #525252);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.input:focus-visible {
|
|
41
|
+
border-color: var(--reke-color-primary, #22C55E);
|
|
42
|
+
outline: 2px solid var(--reke-color-primary, #22C55E);
|
|
43
|
+
outline-offset: -1px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.input--error {
|
|
47
|
+
border-color: var(--reke-color-danger, #EF4444);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.input--error:focus-visible {
|
|
51
|
+
border-color: var(--reke-color-danger, #EF4444);
|
|
52
|
+
outline-color: var(--reke-color-danger, #EF4444);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* === Sizes === */
|
|
56
|
+
|
|
57
|
+
.input--xs {
|
|
58
|
+
padding: var(--reke-space-2xs, 6px) var(--reke-space-xs, 8px);
|
|
59
|
+
font-size: var(--reke-font-size-2xs, 11px);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.input--sm {
|
|
63
|
+
padding: var(--reke-space-xs, 8px) var(--reke-space-sm, 12px);
|
|
64
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.input--md {
|
|
68
|
+
padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
|
|
69
|
+
font-size: var(--reke-font-size-sm, 13px);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.input--lg {
|
|
73
|
+
padding: var(--reke-space-md, 16px) var(--reke-space-lg, 20px);
|
|
74
|
+
font-size: var(--reke-font-size-md, 14px);
|
|
75
|
+
}
|
|
76
|
+
`];
|
|
77
|
+
//#endregion
|
|
78
|
+
export { n as styles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-select.d.ts","sourceRoot":"","sources":["../../../src/components/reke-select/reke-select.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,UAAW,SAAQ,WAAW;IACzC,OAAgB,MAAM,4BAAU;IAGhC,KAAK,SAAM;IAGX,WAAW,SAAe;IAG1B,OAAO,EAAE,YAAY,EAAE,CAAM;IAG7B,QAAQ,UAAS;IAGjB,KAAK,UAAS;IAGd,KAAK,SAAM;IAGX,IAAI,EAAE,UAAU,CAAQ;IAGxB,OAAO,CAAC,KAAK,CAAS;IAEtB,OAAO,CAAC,wBAAwB,CAAsC;IACtE,OAAO,CAAC,mBAAmB,CAAiC;IAEnD,iBAAiB;IAMjB,oBAAoB;IAM7B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,iBAAiB;IAMzB,OAAO,KAAK,aAAa,GAGxB;IAEQ,MAAM;
|
|
1
|
+
{"version":3,"file":"reke-select.d.ts","sourceRoot":"","sources":["../../../src/components/reke-select/reke-select.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,UAAW,SAAQ,WAAW;IACzC,OAAgB,MAAM,4BAAU;IAGhC,KAAK,SAAM;IAGX,WAAW,SAAe;IAG1B,OAAO,EAAE,YAAY,EAAE,CAAM;IAG7B,QAAQ,UAAS;IAGjB,KAAK,UAAS;IAGd,KAAK,SAAM;IAGX,IAAI,EAAE,UAAU,CAAQ;IAGxB,OAAO,CAAC,KAAK,CAAS;IAEtB,OAAO,CAAC,wBAAwB,CAAsC;IACtE,OAAO,CAAC,mBAAmB,CAAiC;IAEnD,iBAAiB;IAMjB,oBAAoB;IAM7B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,iBAAiB;IAMzB,OAAO,KAAK,aAAa,GAGxB;IAEQ,MAAM;CAsDhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { RekeElement as e } from "../../shared/base-element.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js";
|
|
3
|
+
import { styles as n } from "./reke-select.styles.js";
|
|
4
|
+
import { html as r, nothing as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o, state as s } from "lit/decorators.js";
|
|
6
|
+
import { classMap as c } from "lit/directives/class-map.js";
|
|
7
|
+
//#region src/components/reke-select/reke-select.ts
|
|
8
|
+
var l = class extends e {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.value = "", this.placeholder = "Select...", this.options = [], this.disabled = !1, this.error = !1, this.label = "", this.size = "md", this._open = !1, this._boundHandleOutsideClick = this.handleOutsideClick.bind(this), this._boundHandleKeyDown = this.handleKeyDown.bind(this);
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.styles = n;
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
super.connectedCallback(), document.addEventListener("click", this._boundHandleOutsideClick), document.addEventListener("keydown", this._boundHandleKeyDown);
|
|
17
|
+
}
|
|
18
|
+
disconnectedCallback() {
|
|
19
|
+
super.disconnectedCallback(), document.removeEventListener("click", this._boundHandleOutsideClick), document.removeEventListener("keydown", this._boundHandleKeyDown);
|
|
20
|
+
}
|
|
21
|
+
handleOutsideClick(e) {
|
|
22
|
+
e.composedPath().includes(this) || (this._open = !1);
|
|
23
|
+
}
|
|
24
|
+
handleKeyDown(e) {
|
|
25
|
+
e.key === "Escape" && this._open && (this._open = !1);
|
|
26
|
+
}
|
|
27
|
+
handleTriggerClick() {
|
|
28
|
+
this.disabled || (this._open = !this._open);
|
|
29
|
+
}
|
|
30
|
+
handleOptionClick(e) {
|
|
31
|
+
this.value = e, this._open = !1, this.emit("reke-change", { value: this.value });
|
|
32
|
+
}
|
|
33
|
+
get selectedLabel() {
|
|
34
|
+
return this.options.find((e) => e.value === this.value)?.label;
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
let e = this.selectedLabel, t = !e, n = {
|
|
38
|
+
trigger: !0,
|
|
39
|
+
[`trigger--${this.size}`]: !0,
|
|
40
|
+
"trigger--error": this.error,
|
|
41
|
+
"trigger--placeholder": t
|
|
42
|
+
};
|
|
43
|
+
return r`
|
|
44
|
+
${this.label ? r`<label class="label">${this.label}</label>` : i}
|
|
45
|
+
<button
|
|
46
|
+
part="trigger"
|
|
47
|
+
class=${c(n)}
|
|
48
|
+
type="button"
|
|
49
|
+
?disabled=${this.disabled}
|
|
50
|
+
aria-expanded=${this._open}
|
|
51
|
+
aria-haspopup="listbox"
|
|
52
|
+
aria-invalid=${this.error}
|
|
53
|
+
aria-label=${this.label || i}
|
|
54
|
+
@click=${this.handleTriggerClick}
|
|
55
|
+
>
|
|
56
|
+
<span class="trigger__text">${e ?? this.placeholder}</span>
|
|
57
|
+
<span class="trigger__chevron" aria-hidden="true">▼</span>
|
|
58
|
+
</button>
|
|
59
|
+
${this._open ? r`
|
|
60
|
+
<ul
|
|
61
|
+
part="dropdown"
|
|
62
|
+
class="dropdown"
|
|
63
|
+
role="listbox"
|
|
64
|
+
aria-label=${this.label || i}
|
|
65
|
+
>
|
|
66
|
+
${this.options.map((e) => r`
|
|
67
|
+
<li
|
|
68
|
+
class="option ${e.value === this.value ? "option--selected" : ""}"
|
|
69
|
+
role="option"
|
|
70
|
+
aria-selected=${e.value === this.value}
|
|
71
|
+
@click=${() => this.handleOptionClick(e.value)}
|
|
72
|
+
>
|
|
73
|
+
${e.label}
|
|
74
|
+
</li>
|
|
75
|
+
`)}
|
|
76
|
+
</ul>
|
|
77
|
+
` : i}
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
t([o()], l.prototype, "value", void 0), t([o()], l.prototype, "placeholder", void 0), t([o({ attribute: !1 })], l.prototype, "options", void 0), t([o({
|
|
82
|
+
type: Boolean,
|
|
83
|
+
reflect: !0
|
|
84
|
+
})], l.prototype, "disabled", void 0), t([o({
|
|
85
|
+
type: Boolean,
|
|
86
|
+
reflect: !0
|
|
87
|
+
})], l.prototype, "error", void 0), t([o()], l.prototype, "label", void 0), t([o({ reflect: !0 })], l.prototype, "size", void 0), t([s()], l.prototype, "_open", void 0), l = t([a("reke-select")], l);
|
|
88
|
+
//#endregion
|
|
89
|
+
export { l as RekeSelect };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-select.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-select/reke-select.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"reke-select.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-select/reke-select.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BAqHlB,CAAC"}
|