reke-ui 0.1.0 → 0.1.2
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 +2 -0
- package/custom-elements.json +216 -116
- package/dist/components/reke-alert/reke-alert.js +53 -0
- package/dist/components/reke-alert/reke-alert.styles.d.ts.map +1 -1
- package/dist/components/reke-alert/reke-alert.styles.js +106 -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 +44 -0
- package/dist/components/reke-badge/reke-badge.styles.d.ts.map +1 -1
- package/dist/components/reke-badge/reke-badge.styles.js +95 -0
- package/dist/components/reke-button/reke-button.js +64 -0
- package/dist/components/reke-button/reke-button.styles.d.ts.map +1 -1
- package/dist/components/reke-button/reke-button.styles.js +229 -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 +70 -0
- package/dist/components/reke-card/reke-card.styles.d.ts.map +1 -1
- package/dist/components/reke-card/reke-card.styles.js +150 -0
- package/dist/components/reke-checkbox/reke-checkbox.js +64 -0
- package/dist/components/reke-checkbox/reke-checkbox.styles.js +81 -0
- package/dist/components/reke-chip/reke-chip.js +70 -0
- package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.styles.js +125 -0
- package/dist/components/reke-date-range/reke-date-range.js +346 -0
- package/dist/components/reke-date-range/reke-date-range.styles.js +322 -0
- package/dist/components/reke-dialog/reke-dialog.js +90 -0
- package/dist/components/reke-dialog/reke-dialog.styles.js +134 -0
- package/dist/components/reke-file-upload/reke-file-upload.js +108 -0
- package/dist/components/reke-file-upload/reke-file-upload.styles.js +107 -0
- package/dist/components/reke-input/reke-input.js +73 -0
- package/dist/components/reke-input/reke-input.styles.js +80 -0
- package/dist/components/reke-select/reke-select.js +112 -0
- package/dist/components/reke-select/reke-select.styles.js +122 -0
- package/dist/components/reke-table/reke-table.d.ts +21 -1
- package/dist/components/reke-table/reke-table.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.js +191 -0
- package/dist/components/reke-table/reke-table.styles.js +207 -0
- package/dist/components/reke-textarea/reke-textarea.js +73 -0
- package/dist/components/reke-textarea/reke-textarea.styles.js +76 -0
- package/dist/components/reke-toast/reke-toast.js +92 -0
- package/dist/components/reke-toast/reke-toast.styles.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.styles.js +182 -0
- package/dist/components/reke-toggle/reke-toggle.js +57 -0
- package/dist/components/reke-toggle/reke-toggle.styles.js +71 -0
- package/dist/components/reke-tooltip/reke-tooltip.js +67 -0
- package/dist/components/reke-tooltip/reke-tooltip.styles.js +67 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -0
- package/dist/react.js +79 -64
- package/dist/shared/base-element.js +16 -0
- package/dist/shared/tailwind-styles.js +6 -0
- package/dist/shared/tailwind.css.js +4 -0
- package/dist/tokens/reke-tokens.css +23 -0
- package/package.json +6 -4
- package/dist/reke-chip-Xb0Y_Cqo.js +0 -3358
- package/dist/reke-ui.js +0 -20
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as r } from "lit";
|
|
3
|
+
const a = [
|
|
4
|
+
e,
|
|
5
|
+
r`
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([disabled]) {
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
opacity: 0.5;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dropzone {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
gap: var(--reke-space-sm, 12px);
|
|
21
|
+
padding: var(--reke-space-xl, 24px) var(--reke-space-lg, 20px);
|
|
22
|
+
border-radius: var(--reke-radius, 4px);
|
|
23
|
+
border: 1px dashed var(--reke-color-border, #252525);
|
|
24
|
+
background-color: transparent;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
transition: border-color 0.2s ease, background-color 0.2s ease;
|
|
27
|
+
text-align: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dropzone:hover {
|
|
31
|
+
border-color: var(--reke-color-text-muted, #525252);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.dropzone--dragging {
|
|
35
|
+
border-color: var(--reke-color-primary, #22c55e);
|
|
36
|
+
background-color: color-mix(in srgb, var(--reke-color-primary, #22c55e) 5%, transparent);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dropzone--error {
|
|
40
|
+
border-color: var(--reke-color-danger, #ef4444);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.dropzone--compact {
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.icon {
|
|
49
|
+
width: 36px;
|
|
50
|
+
height: 36px;
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
background-color: color-mix(in srgb, var(--reke-color-primary, #22c55e) 10%, transparent);
|
|
53
|
+
border: 1px solid color-mix(in srgb, var(--reke-color-primary, #22c55e) 20%, transparent);
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
color: var(--reke-color-primary, #22c55e);
|
|
58
|
+
font-size: 16px;
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.dropzone--compact .icon {
|
|
63
|
+
width: 28px;
|
|
64
|
+
height: 28px;
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.text {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
gap: 2px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.text__primary {
|
|
75
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
76
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
77
|
+
font-weight: var(--reke-font-weight-medium, 500);
|
|
78
|
+
color: var(--reke-color-text, #e5e5e5);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.text__secondary {
|
|
82
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
83
|
+
font-size: var(--reke-font-size-2xs, 11px);
|
|
84
|
+
color: var(--reke-color-text-disabled, #3b3b3b);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.text__file {
|
|
88
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
89
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
90
|
+
font-weight: var(--reke-font-weight-medium, 500);
|
|
91
|
+
color: var(--reke-color-primary, #22c55e);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.text__error {
|
|
95
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
96
|
+
font-size: var(--reke-font-size-2xs, 11px);
|
|
97
|
+
color: var(--reke-color-danger, #ef4444);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
input[type='file'] {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
`
|
|
104
|
+
];
|
|
105
|
+
export {
|
|
106
|
+
a as styles
|
|
107
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { nothing as n, html as u } from "lit";
|
|
2
|
+
import { property as l, customElement as d } from "lit/decorators.js";
|
|
3
|
+
import { classMap as c } from "lit/directives/class-map.js";
|
|
4
|
+
import { RekeElement as m } from "../../shared/base-element.js";
|
|
5
|
+
import { styles as b } from "./reke-input.styles.js";
|
|
6
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, t = (s, a, p, i) => {
|
|
7
|
+
for (var r = i > 1 ? void 0 : i ? y(a, p) : a, o = s.length - 1, h; o >= 0; o--)
|
|
8
|
+
(h = s[o]) && (r = (i ? h(a, p, r) : h(r)) || r);
|
|
9
|
+
return i && r && v(a, p, r), r;
|
|
10
|
+
};
|
|
11
|
+
let e = class extends m {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.value = "", this.placeholder = "", this.type = "text", this.size = "md", this.disabled = !1, this.error = !1, this.label = "";
|
|
14
|
+
}
|
|
15
|
+
handleInput(s) {
|
|
16
|
+
const a = s.target;
|
|
17
|
+
this.value = a.value, this.emit("reke-input", { value: this.value });
|
|
18
|
+
}
|
|
19
|
+
handleChange() {
|
|
20
|
+
this.emit("reke-change", { value: this.value });
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const s = {
|
|
24
|
+
input: !0,
|
|
25
|
+
[`input--${this.size}`]: !0,
|
|
26
|
+
"input--error": this.error
|
|
27
|
+
};
|
|
28
|
+
return u`
|
|
29
|
+
${this.label ? u`<label class="label">${this.label}</label>` : n}
|
|
30
|
+
<input
|
|
31
|
+
part="input"
|
|
32
|
+
class=${c(s)}
|
|
33
|
+
type=${this.type}
|
|
34
|
+
.value=${this.value}
|
|
35
|
+
placeholder=${this.placeholder || n}
|
|
36
|
+
?disabled=${this.disabled}
|
|
37
|
+
aria-disabled=${this.disabled}
|
|
38
|
+
aria-invalid=${this.error}
|
|
39
|
+
aria-label=${this.label || n}
|
|
40
|
+
@input=${this.handleInput}
|
|
41
|
+
@change=${this.handleChange}
|
|
42
|
+
/>
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
e.styles = b;
|
|
47
|
+
t([
|
|
48
|
+
l()
|
|
49
|
+
], e.prototype, "value", 2);
|
|
50
|
+
t([
|
|
51
|
+
l()
|
|
52
|
+
], e.prototype, "placeholder", 2);
|
|
53
|
+
t([
|
|
54
|
+
l()
|
|
55
|
+
], e.prototype, "type", 2);
|
|
56
|
+
t([
|
|
57
|
+
l({ reflect: !0 })
|
|
58
|
+
], e.prototype, "size", 2);
|
|
59
|
+
t([
|
|
60
|
+
l({ type: Boolean, reflect: !0 })
|
|
61
|
+
], e.prototype, "disabled", 2);
|
|
62
|
+
t([
|
|
63
|
+
l({ type: Boolean, reflect: !0 })
|
|
64
|
+
], e.prototype, "error", 2);
|
|
65
|
+
t([
|
|
66
|
+
l()
|
|
67
|
+
], e.prototype, "label", 2);
|
|
68
|
+
e = t([
|
|
69
|
+
d("reke-input")
|
|
70
|
+
], e);
|
|
71
|
+
export {
|
|
72
|
+
e as RekeInput
|
|
73
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as r } from "lit";
|
|
3
|
+
const s = [
|
|
4
|
+
e,
|
|
5
|
+
r`
|
|
6
|
+
:host {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([disabled]) {
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
opacity: 0.5;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.label {
|
|
16
|
+
display: block;
|
|
17
|
+
margin-bottom: var(--reke-space-2xs, 6px);
|
|
18
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
19
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
20
|
+
color: var(--reke-color-text-label, #8A8A8A);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.input {
|
|
24
|
+
display: block;
|
|
25
|
+
width: 100%;
|
|
26
|
+
background-color: var(--reke-color-surface, #1A1A1A);
|
|
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
|
+
];
|
|
78
|
+
export {
|
|
79
|
+
s as styles
|
|
80
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { nothing as n, html as d } from "lit";
|
|
2
|
+
import { property as a, state as h, customElement as u } from "lit/decorators.js";
|
|
3
|
+
import { classMap as b } from "lit/directives/class-map.js";
|
|
4
|
+
import { RekeElement as _ } from "../../shared/base-element.js";
|
|
5
|
+
import { styles as m } from "./reke-select.styles.js";
|
|
6
|
+
var v = Object.defineProperty, f = Object.getOwnPropertyDescriptor, i = (e, l, r, s) => {
|
|
7
|
+
for (var o = s > 1 ? void 0 : s ? f(l, r) : l, p = e.length - 1, c; p >= 0; p--)
|
|
8
|
+
(c = e[p]) && (o = (s ? c(l, r, o) : c(o)) || o);
|
|
9
|
+
return s && o && v(l, r, o), o;
|
|
10
|
+
};
|
|
11
|
+
let t = class extends _ {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), 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);
|
|
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((l) => l.value === this.value)?.label;
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
const e = this.selectedLabel, l = !e, r = {
|
|
38
|
+
trigger: !0,
|
|
39
|
+
[`trigger--${this.size}`]: !0,
|
|
40
|
+
"trigger--error": this.error,
|
|
41
|
+
"trigger--placeholder": l
|
|
42
|
+
};
|
|
43
|
+
return d`
|
|
44
|
+
${this.label ? d`<label class="label">${this.label}</label>` : n}
|
|
45
|
+
<button
|
|
46
|
+
part="trigger"
|
|
47
|
+
class=${b(r)}
|
|
48
|
+
type="button"
|
|
49
|
+
?disabled=${this.disabled}
|
|
50
|
+
aria-expanded=${this._open}
|
|
51
|
+
aria-haspopup="listbox"
|
|
52
|
+
aria-label=${this.label || n}
|
|
53
|
+
@click=${this.handleTriggerClick}
|
|
54
|
+
>
|
|
55
|
+
<span class="trigger__text">${e ?? this.placeholder}</span>
|
|
56
|
+
<span class="trigger__chevron" aria-hidden="true">▼</span>
|
|
57
|
+
</button>
|
|
58
|
+
${this._open ? d`
|
|
59
|
+
<ul
|
|
60
|
+
part="dropdown"
|
|
61
|
+
class="dropdown"
|
|
62
|
+
role="listbox"
|
|
63
|
+
aria-label=${this.label || n}
|
|
64
|
+
>
|
|
65
|
+
${this.options.map(
|
|
66
|
+
(s) => d`
|
|
67
|
+
<li
|
|
68
|
+
class="option ${s.value === this.value ? "option--selected" : ""}"
|
|
69
|
+
role="option"
|
|
70
|
+
aria-selected=${s.value === this.value}
|
|
71
|
+
@click=${() => this.handleOptionClick(s.value)}
|
|
72
|
+
>
|
|
73
|
+
${s.label}
|
|
74
|
+
</li>
|
|
75
|
+
`
|
|
76
|
+
)}
|
|
77
|
+
</ul>
|
|
78
|
+
` : n}
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
t.styles = m;
|
|
83
|
+
i([
|
|
84
|
+
a()
|
|
85
|
+
], t.prototype, "value", 2);
|
|
86
|
+
i([
|
|
87
|
+
a()
|
|
88
|
+
], t.prototype, "placeholder", 2);
|
|
89
|
+
i([
|
|
90
|
+
a({ attribute: !1 })
|
|
91
|
+
], t.prototype, "options", 2);
|
|
92
|
+
i([
|
|
93
|
+
a({ type: Boolean, reflect: !0 })
|
|
94
|
+
], t.prototype, "disabled", 2);
|
|
95
|
+
i([
|
|
96
|
+
a({ type: Boolean, reflect: !0 })
|
|
97
|
+
], t.prototype, "error", 2);
|
|
98
|
+
i([
|
|
99
|
+
a()
|
|
100
|
+
], t.prototype, "label", 2);
|
|
101
|
+
i([
|
|
102
|
+
a({ reflect: !0 })
|
|
103
|
+
], t.prototype, "size", 2);
|
|
104
|
+
i([
|
|
105
|
+
h()
|
|
106
|
+
], t.prototype, "_open", 2);
|
|
107
|
+
t = i([
|
|
108
|
+
u("reke-select")
|
|
109
|
+
], t);
|
|
110
|
+
export {
|
|
111
|
+
t as RekeSelect
|
|
112
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { tailwindStyles as r } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as e } from "lit";
|
|
3
|
+
const i = [
|
|
4
|
+
r,
|
|
5
|
+
e`
|
|
6
|
+
:host {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([disabled]) {
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
opacity: 0.5;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.label {
|
|
17
|
+
display: block;
|
|
18
|
+
margin-bottom: var(--reke-space-2xs, 6px);
|
|
19
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
20
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
21
|
+
color: var(--reke-color-text-label, #8A8A8A);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.trigger {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
width: 100%;
|
|
29
|
+
background-color: var(--reke-color-surface, #1A1A1A);
|
|
30
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
31
|
+
border: 1px solid var(--reke-color-border, #252525);
|
|
32
|
+
border-radius: var(--reke-radius, 4px);
|
|
33
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
outline: none;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
transition: border-color 0.15s ease;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.trigger--placeholder {
|
|
41
|
+
color: var(--reke-color-text-muted, #525252);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.trigger__chevron {
|
|
45
|
+
font-size: 8px;
|
|
46
|
+
margin-left: 8px;
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* === Sizes === */
|
|
51
|
+
|
|
52
|
+
.trigger--sm {
|
|
53
|
+
padding: var(--reke-space-xs, 8px) var(--reke-space-sm, 12px);
|
|
54
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.trigger--md {
|
|
58
|
+
padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
|
|
59
|
+
font-size: var(--reke-font-size-sm, 13px);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.trigger--lg {
|
|
63
|
+
padding: var(--reke-space-md, 16px) var(--reke-space-lg, 20px);
|
|
64
|
+
font-size: var(--reke-font-size-md, 14px);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.trigger:focus-visible {
|
|
68
|
+
border-color: var(--reke-color-primary, #22C55E);
|
|
69
|
+
outline: 2px solid var(--reke-color-primary, #22C55E);
|
|
70
|
+
outline-offset: -1px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.trigger--error {
|
|
74
|
+
border-color: var(--reke-color-danger, #EF4444);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.trigger--error:focus-visible {
|
|
78
|
+
border-color: var(--reke-color-danger, #EF4444);
|
|
79
|
+
outline-color: var(--reke-color-danger, #EF4444);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* === Dropdown === */
|
|
83
|
+
|
|
84
|
+
.dropdown {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 100%;
|
|
87
|
+
left: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
margin: 0;
|
|
90
|
+
margin-top: 4px;
|
|
91
|
+
padding: 0;
|
|
92
|
+
list-style: none;
|
|
93
|
+
background-color: var(--reke-color-surface, #1A1A1A);
|
|
94
|
+
border: 1px solid var(--reke-color-border, #252525);
|
|
95
|
+
border-radius: var(--reke-radius, 4px);
|
|
96
|
+
max-height: 200px;
|
|
97
|
+
overflow-y: auto;
|
|
98
|
+
z-index: 100;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* === Option === */
|
|
102
|
+
|
|
103
|
+
.option {
|
|
104
|
+
padding: var(--reke-space-xs, 8px) var(--reke-space-md, 16px);
|
|
105
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
106
|
+
font-size: var(--reke-font-size-sm, 13px);
|
|
107
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.option:hover {
|
|
112
|
+
background-color: var(--reke-color-surface-elevated, #151515);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.option--selected {
|
|
116
|
+
color: var(--reke-color-primary, #22C55E);
|
|
117
|
+
}
|
|
118
|
+
`
|
|
119
|
+
];
|
|
120
|
+
export {
|
|
121
|
+
i as styles
|
|
122
|
+
};
|
|
@@ -8,7 +8,7 @@ export interface TableColumn {
|
|
|
8
8
|
/** Set to false to disable sorting on this column. Default: true. */
|
|
9
9
|
sortable?: boolean;
|
|
10
10
|
/** Custom render function for cell content. Falls back to row[col.key] if omitted. */
|
|
11
|
-
render?: (value: unknown, row: TableRow, index: number) => TemplateResult | string;
|
|
11
|
+
render?: (value: unknown, row: TableRow, index: number) => TemplateResult | string | HTMLElement | Node;
|
|
12
12
|
}
|
|
13
13
|
export type TableRow = Record<string, unknown>;
|
|
14
14
|
export type ExpandedRowRenderer = (row: TableRow, index: number) => TemplateResult;
|
|
@@ -39,6 +39,10 @@ export type ExpandedRowRenderer = (row: TableRow, index: number) => TemplateResu
|
|
|
39
39
|
* @cssprop [--reke-color-border=#252525] - Border and row divider color.
|
|
40
40
|
* @cssprop [--reke-color-text=#E5E5E5] - Cell text color.
|
|
41
41
|
* @cssprop [--reke-color-text-muted=#525252] - Header text color.
|
|
42
|
+
*
|
|
43
|
+
* Props:
|
|
44
|
+
* - `expandedRowRender`: Lit-based expand render. Receives `(row, index)` → TemplateResult.
|
|
45
|
+
* - `expandedRowElement`: Framework-agnostic expand render. Receives `(host, row, index)` — mount any framework. Return cleanup or void.
|
|
42
46
|
*/
|
|
43
47
|
export declare class RekeTable extends RekeElement {
|
|
44
48
|
static styles: import("lit").CSSResult[];
|
|
@@ -53,8 +57,22 @@ export declare class RekeTable extends RekeElement {
|
|
|
53
57
|
sortDirection: 'asc' | 'desc';
|
|
54
58
|
/** When set, rows become expandable with a chevron toggle. */
|
|
55
59
|
expandedRowRender: ExpandedRowRenderer | null;
|
|
60
|
+
/**
|
|
61
|
+
* Framework-agnostic alternative to expandedRowRender.
|
|
62
|
+
* Receives an HTMLElement host — mount any framework's content into it.
|
|
63
|
+
* Return a cleanup function (called on collapse) or void.
|
|
64
|
+
*
|
|
65
|
+
* @example React usage:
|
|
66
|
+
* expandedRowElement={(host, row, i) => {
|
|
67
|
+
* const root = createRoot(host);
|
|
68
|
+
* root.render(<MyContent data={row} />);
|
|
69
|
+
* return () => root.unmount();
|
|
70
|
+
* }}
|
|
71
|
+
*/
|
|
72
|
+
expandedRowElement: ((host: HTMLElement, row: TableRow, index: number) => (() => void) | void) | null;
|
|
56
73
|
/** Set of row indices currently expanded. */
|
|
57
74
|
expandedRows: Set<number>;
|
|
75
|
+
private _expandCleanups;
|
|
58
76
|
private _hasToolbar;
|
|
59
77
|
private _hasFooter;
|
|
60
78
|
private handleHeaderClick;
|
|
@@ -66,6 +84,8 @@ export declare class RekeTable extends RekeElement {
|
|
|
66
84
|
private _onToolbarSlotChange;
|
|
67
85
|
private _onFooterSlotChange;
|
|
68
86
|
private _renderRow;
|
|
87
|
+
private _renderExpandedElement;
|
|
88
|
+
disconnectedCallback(): void;
|
|
69
89
|
render(): TemplateResult<1>;
|
|
70
90
|
}
|
|
71
91
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-table.d.ts","sourceRoot":"","sources":["../../../src/components/reke-table/reke-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sFAAsF;IACtF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,cAAc,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"reke-table.d.ts","sourceRoot":"","sources":["../../../src/components/reke-table/reke-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sFAAsF;IACtF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;CACzG;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/C,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,cAAc,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBACa,SAAU,SAAQ,WAAW;IACxC,OAAgB,MAAM,4BAAU;IAGhC,OAAO,EAAE,WAAW,EAAE,CAAM;IAG5B,IAAI,EAAE,QAAQ,EAAE,CAAM;IAGtB,OAAO,UAAS;IAGhB,KAAK,UAAS;IAGd,SAAS,UAAS;IAGlB,QAAQ,UAAS;IAGjB,UAAU,UAAS;IAGnB,OAAO,SAAM;IAGb,aAAa,EAAE,KAAK,GAAG,MAAM,CAAS;IAEtC,8DAA8D;IAE9D,iBAAiB,EAAE,mBAAmB,GAAG,IAAI,CAAQ;IAErD;;;;;;;;;;;OAWG;IAEH,kBAAkB,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IAE7G,6CAA6C;IAE7C,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IAEtC,OAAO,CAAC,eAAe,CAAiC;IAE/C,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAS;IAEpC,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,cAAc;IAItB,wDAAwD;IACxD,YAAY,CAAC,KAAK,EAAE,MAAM;IAmB1B,oEAAoE;IACpE,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIrC,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,UAAU;IAmClB,OAAO,CAAC,sBAAsB;IAUrB,oBAAoB;IAMpB,MAAM;CAoEhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|