reke-ui 0.2.0 → 0.3.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/custom-elements.json +725 -322
- package/dist/components/reke-combobox/reke-combobox.d.ts +70 -0
- package/dist/components/reke-combobox/reke-combobox.d.ts.map +1 -0
- package/dist/components/reke-combobox/reke-combobox.js +146 -0
- package/dist/components/reke-combobox/reke-combobox.styles.d.ts +2 -0
- package/dist/components/reke-combobox/reke-combobox.styles.d.ts.map +1 -0
- package/dist/components/reke-combobox/reke-combobox.styles.js +162 -0
- package/dist/components/reke-table/reke-table.d.ts +11 -0
- package/dist/components/reke-table/reke-table.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.js +83 -52
- package/dist/components/reke-table/reke-table.styles.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.styles.js +28 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -11
- package/dist/react.d.ts +9 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +61 -52
- package/dist/shared/tailwind.js +1 -1
- package/package.json +5 -1
- package/dist/node_modules/lit/directives/ref.js +0 -1
- package/dist/node_modules/lit-html/async-directive.js +0 -55
- package/dist/node_modules/lit-html/directive-helpers.js +0 -5
- package/dist/node_modules/lit-html/directive.js +0 -28
- package/dist/node_modules/lit-html/directives/ref.js +0 -30
- package/dist/node_modules/lit-html/lit-html.js +0 -234
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { RekeElement } from '../../shared/base-element.js';
|
|
2
|
+
export type ComboboxSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface ComboboxOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Optional image (e.g. a token/coin logo) rendered before the label. */
|
|
7
|
+
image?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @tag reke-combobox
|
|
11
|
+
* @summary A searchable select. Type to filter options, navigate with the
|
|
12
|
+
* keyboard. Unlike `reke-select`, it exposes a text query and is meant for long
|
|
13
|
+
* option lists.
|
|
14
|
+
*
|
|
15
|
+
* @fires reke-change - Fired when an option is selected. Detail: `{ value: string }`.
|
|
16
|
+
* @fires reke-search - Fired when the query changes (for remote filtering). Detail: `{ query: string }`.
|
|
17
|
+
*
|
|
18
|
+
* @csspart input - The text input element.
|
|
19
|
+
* @csspart dropdown - The dropdown list container.
|
|
20
|
+
* @csspart option - Each option row.
|
|
21
|
+
* @csspart empty - The "no results" row.
|
|
22
|
+
*
|
|
23
|
+
* @cssprop [--reke-color-primary=#22C55E] - Focus ring and active/selected option color.
|
|
24
|
+
* @cssprop [--reke-color-surface=#1A1A1A] - Input and dropdown background.
|
|
25
|
+
* @cssprop [--reke-color-surface-elevated=#151515] - Option hover/active background.
|
|
26
|
+
* @cssprop [--reke-color-border=#252525] - Input and dropdown border.
|
|
27
|
+
* @cssprop [--reke-color-danger=#EF4444] - Error state border.
|
|
28
|
+
* @cssprop [--reke-color-text=#E5E5E5] - Text color.
|
|
29
|
+
* @cssprop [--reke-color-text-muted=#525252] - Placeholder / empty color.
|
|
30
|
+
* @cssprop [--reke-color-text-label=#8A8A8A] - Label color.
|
|
31
|
+
*/
|
|
32
|
+
export declare class RekeCombobox extends RekeElement {
|
|
33
|
+
static styles: import("lit").CSSResult[];
|
|
34
|
+
value: string;
|
|
35
|
+
placeholder: string;
|
|
36
|
+
options: ComboboxOption[];
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
error: boolean;
|
|
39
|
+
label: string;
|
|
40
|
+
emptyText: string;
|
|
41
|
+
size: ComboboxSize;
|
|
42
|
+
private _open;
|
|
43
|
+
private _query;
|
|
44
|
+
private _activeIndex;
|
|
45
|
+
/** Inline `position: fixed` coords so the dropdown escapes any ancestor
|
|
46
|
+
* `overflow: hidden` (cards, table cells, etc.). */
|
|
47
|
+
private _dropdownStyle;
|
|
48
|
+
private _boundHandleOutsideClick;
|
|
49
|
+
private _boundReposition;
|
|
50
|
+
connectedCallback(): void;
|
|
51
|
+
disconnectedCallback(): void;
|
|
52
|
+
private updatePosition;
|
|
53
|
+
private addPositionListeners;
|
|
54
|
+
private removePositionListeners;
|
|
55
|
+
private handleOutsideClick;
|
|
56
|
+
private get selectedLabel();
|
|
57
|
+
private get filteredOptions();
|
|
58
|
+
private open;
|
|
59
|
+
private close;
|
|
60
|
+
private selectOption;
|
|
61
|
+
private handleInput;
|
|
62
|
+
private handleKeyDown;
|
|
63
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
64
|
+
}
|
|
65
|
+
declare global {
|
|
66
|
+
interface HTMLElementTagNameMap {
|
|
67
|
+
'reke-combobox': RekeCombobox;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=reke-combobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reke-combobox.d.ts","sourceRoot":"","sources":["../../../src/components/reke-combobox/reke-combobox.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBACa,YAAa,SAAQ,WAAW;IAC3C,OAAgB,MAAM,4BAAU;IAGhC,KAAK,SAAM;IAGX,WAAW,SAAe;IAG1B,OAAO,EAAE,cAAc,EAAE,CAAM;IAG/B,QAAQ,UAAS;IAGjB,KAAK,UAAS;IAGd,KAAK,SAAM;IAGX,SAAS,SAAoB;IAG7B,IAAI,EAAE,YAAY,CAAQ;IAG1B,OAAO,CAAC,KAAK,CAAS;IAGtB,OAAO,CAAC,MAAM,CAAM;IAGpB,OAAO,CAAC,YAAY,CAAK;IAEzB;wDACoD;IAEpD,OAAO,CAAC,cAAc,CAAM;IAE5B,OAAO,CAAC,wBAAwB,CAAsC;IACtE,OAAO,CAAC,gBAAgB,CAA+B;IAE9C,iBAAiB;IAKjB,oBAAoB;IAM7B,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,uBAAuB;IAK/B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,KAAK,aAAa,GAExB;IAED,OAAO,KAAK,eAAe,GAM1B;IAED,OAAO,CAAC,IAAI;IASZ,OAAO,CAAC,KAAK;IAMb,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,aAAa;IA4BZ,MAAM;CAmFhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -0,0 +1,146 @@
|
|
|
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-combobox.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-combobox/reke-combobox.ts
|
|
8
|
+
var l = class extends e {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.value = "", this.placeholder = "Buscar...", this.options = [], this.disabled = !1, this.error = !1, this.label = "", this.emptyText = "Sin resultados", this.size = "md", this._open = !1, this._query = "", this._activeIndex = 0, this._dropdownStyle = "", this._boundHandleOutsideClick = this.handleOutsideClick.bind(this), this._boundReposition = () => this.updatePosition();
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.styles = n;
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
super.connectedCallback(), document.addEventListener("click", this._boundHandleOutsideClick);
|
|
17
|
+
}
|
|
18
|
+
disconnectedCallback() {
|
|
19
|
+
super.disconnectedCallback(), document.removeEventListener("click", this._boundHandleOutsideClick), this.removePositionListeners();
|
|
20
|
+
}
|
|
21
|
+
updatePosition() {
|
|
22
|
+
let e = this.shadowRoot?.querySelector(".control");
|
|
23
|
+
if (!e) return;
|
|
24
|
+
let t = e.getBoundingClientRect();
|
|
25
|
+
this._dropdownStyle = `position:fixed;top:${t.bottom + 4}px;left:${t.left}px;width:${t.width}px;right:auto;`;
|
|
26
|
+
}
|
|
27
|
+
addPositionListeners() {
|
|
28
|
+
window.addEventListener("scroll", this._boundReposition, !0), window.addEventListener("resize", this._boundReposition);
|
|
29
|
+
}
|
|
30
|
+
removePositionListeners() {
|
|
31
|
+
window.removeEventListener("scroll", this._boundReposition, !0), window.removeEventListener("resize", this._boundReposition);
|
|
32
|
+
}
|
|
33
|
+
handleOutsideClick(e) {
|
|
34
|
+
e.composedPath().includes(this) || this.close();
|
|
35
|
+
}
|
|
36
|
+
get selectedLabel() {
|
|
37
|
+
return this.options.find((e) => e.value === this.value)?.label ?? "";
|
|
38
|
+
}
|
|
39
|
+
get filteredOptions() {
|
|
40
|
+
let e = this._query.trim().toLowerCase();
|
|
41
|
+
return e === "" ? this.options : this.options.filter((t) => t.label.toLowerCase().includes(e) || t.value.toLowerCase().includes(e));
|
|
42
|
+
}
|
|
43
|
+
open() {
|
|
44
|
+
this.disabled || this._open || (this._open = !0, this._query = "", this._activeIndex = 0, this.addPositionListeners(), this.updateComplete.then(() => this.updatePosition()));
|
|
45
|
+
}
|
|
46
|
+
close() {
|
|
47
|
+
this._open = !1, this._query = "", this.removePositionListeners();
|
|
48
|
+
}
|
|
49
|
+
selectOption(e) {
|
|
50
|
+
this.value = e.value, this.close(), this.emit("reke-change", { value: this.value });
|
|
51
|
+
}
|
|
52
|
+
handleInput(e) {
|
|
53
|
+
this._query = e.target.value, this._open = !0, this._activeIndex = 0, this.emit("reke-search", { query: this._query });
|
|
54
|
+
}
|
|
55
|
+
handleKeyDown(e) {
|
|
56
|
+
let t = this.filteredOptions;
|
|
57
|
+
switch (e.key) {
|
|
58
|
+
case "ArrowDown":
|
|
59
|
+
e.preventDefault(), this._open ? this._activeIndex = Math.min(this._activeIndex + 1, t.length - 1) : this.open();
|
|
60
|
+
break;
|
|
61
|
+
case "ArrowUp":
|
|
62
|
+
e.preventDefault(), this._activeIndex = Math.max(this._activeIndex - 1, 0);
|
|
63
|
+
break;
|
|
64
|
+
case "Enter": {
|
|
65
|
+
if (!this._open) break;
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
let n = t[this._activeIndex];
|
|
68
|
+
n && this.selectOption(n);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case "Escape":
|
|
72
|
+
this._open && (e.preventDefault(), this.close());
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
let e = this.filteredOptions, t = this._open ? this._query : this.selectedLabel, n = {
|
|
78
|
+
input: !0,
|
|
79
|
+
[`input--${this.size}`]: !0,
|
|
80
|
+
"input--error": this.error
|
|
81
|
+
};
|
|
82
|
+
return r`
|
|
83
|
+
${this.label ? r`<label class="label">${this.label}</label>` : i}
|
|
84
|
+
<div class="control">
|
|
85
|
+
<input
|
|
86
|
+
part="input"
|
|
87
|
+
class=${c(n)}
|
|
88
|
+
type="text"
|
|
89
|
+
role="combobox"
|
|
90
|
+
.value=${t}
|
|
91
|
+
placeholder=${this.selectedLabel || this.placeholder}
|
|
92
|
+
?disabled=${this.disabled}
|
|
93
|
+
autocomplete="off"
|
|
94
|
+
aria-expanded=${this._open}
|
|
95
|
+
aria-controls="reke-combobox-list"
|
|
96
|
+
aria-autocomplete="list"
|
|
97
|
+
aria-invalid=${this.error}
|
|
98
|
+
aria-activedescendant=${this._open && e[this._activeIndex] ? `reke-combobox-opt-${this._activeIndex}` : i}
|
|
99
|
+
@focus=${this.open}
|
|
100
|
+
@click=${this.open}
|
|
101
|
+
@input=${this.handleInput}
|
|
102
|
+
@keydown=${this.handleKeyDown}
|
|
103
|
+
/>
|
|
104
|
+
<span class="chevron" aria-hidden="true">▼</span>
|
|
105
|
+
</div>
|
|
106
|
+
${this._open ? r`
|
|
107
|
+
<ul
|
|
108
|
+
part="dropdown"
|
|
109
|
+
id="reke-combobox-list"
|
|
110
|
+
class="dropdown"
|
|
111
|
+
role="listbox"
|
|
112
|
+
style=${this._dropdownStyle}
|
|
113
|
+
>
|
|
114
|
+
${e.length === 0 ? r`<li part="empty" class="empty">${this.emptyText}</li>` : e.map((e, t) => r`
|
|
115
|
+
<li
|
|
116
|
+
part="option"
|
|
117
|
+
id="reke-combobox-opt-${t}"
|
|
118
|
+
class=${c({
|
|
119
|
+
option: !0,
|
|
120
|
+
"option--selected": e.value === this.value,
|
|
121
|
+
"option--active": t === this._activeIndex
|
|
122
|
+
})}
|
|
123
|
+
role="option"
|
|
124
|
+
aria-selected=${e.value === this.value}
|
|
125
|
+
@click=${() => this.selectOption(e)}
|
|
126
|
+
@mousemove=${() => {
|
|
127
|
+
this._activeIndex = t;
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
${e.image ? r`<img class="option-img" src=${e.image} alt="" loading="lazy" />` : i}${e.label}
|
|
131
|
+
</li>
|
|
132
|
+
`)}
|
|
133
|
+
</ul>
|
|
134
|
+
` : i}
|
|
135
|
+
`;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
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({
|
|
139
|
+
type: Boolean,
|
|
140
|
+
reflect: !0
|
|
141
|
+
})], l.prototype, "disabled", void 0), t([o({
|
|
142
|
+
type: Boolean,
|
|
143
|
+
reflect: !0
|
|
144
|
+
})], l.prototype, "error", void 0), t([o()], l.prototype, "label", void 0), t([o()], l.prototype, "emptyText", void 0), t([o({ reflect: !0 })], l.prototype, "size", void 0), t([s()], l.prototype, "_open", void 0), t([s()], l.prototype, "_query", void 0), t([s()], l.prototype, "_activeIndex", void 0), t([s()], l.prototype, "_dropdownStyle", void 0), l = t([a("reke-combobox")], l);
|
|
145
|
+
//#endregion
|
|
146
|
+
export { l as RekeCombobox };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reke-combobox.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-combobox/reke-combobox.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BA+JlB,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as t } from "lit";
|
|
3
|
+
//#region src/components/reke-combobox/reke-combobox.styles.ts
|
|
4
|
+
var n = [e, t`
|
|
5
|
+
:host {
|
|
6
|
+
display: inline-block;
|
|
7
|
+
position: relative;
|
|
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
|
+
.control {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.input {
|
|
30
|
+
width: 100%;
|
|
31
|
+
background: var(--reke-color-input-bg, var(--reke-color-surface, #1A1A1A));
|
|
32
|
+
box-shadow: var(--reke-shadow-input, none);
|
|
33
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
34
|
+
border: 1px solid var(--reke-color-border, #252525);
|
|
35
|
+
border-radius: var(--reke-radius, 4px);
|
|
36
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
37
|
+
cursor: text;
|
|
38
|
+
outline: none;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
transition: border-color 0.15s ease;
|
|
41
|
+
padding-right: 28px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.input::placeholder {
|
|
45
|
+
color: var(--reke-color-text-muted, #525252);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.chevron {
|
|
49
|
+
position: absolute;
|
|
50
|
+
right: 10px;
|
|
51
|
+
font-size: 8px;
|
|
52
|
+
color: var(--reke-color-text-muted, #525252);
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* === Sizes === */
|
|
58
|
+
|
|
59
|
+
.input--sm {
|
|
60
|
+
padding: var(--reke-space-xs, 8px) var(--reke-space-sm, 12px);
|
|
61
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.input--md {
|
|
65
|
+
padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
|
|
66
|
+
font-size: var(--reke-font-size-sm, 13px);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.input--lg {
|
|
70
|
+
padding: var(--reke-space-md, 16px) var(--reke-space-lg, 20px);
|
|
71
|
+
font-size: var(--reke-font-size-md, 14px);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.input:focus-visible {
|
|
75
|
+
border-color: var(--reke-color-primary, #22C55E);
|
|
76
|
+
outline: 2px solid var(--reke-color-primary, #22C55E);
|
|
77
|
+
outline-offset: -1px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.input--error {
|
|
81
|
+
border-color: var(--reke-color-danger, #EF4444);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.input--error:focus-visible {
|
|
85
|
+
border-color: var(--reke-color-danger, #EF4444);
|
|
86
|
+
outline-color: var(--reke-color-danger, #EF4444);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* === Dropdown === */
|
|
90
|
+
|
|
91
|
+
.dropdown {
|
|
92
|
+
/* Positioned inline as position:fixed by the component so it escapes any
|
|
93
|
+
ancestor overflow:hidden. */
|
|
94
|
+
margin: 0;
|
|
95
|
+
padding: 0;
|
|
96
|
+
list-style: none;
|
|
97
|
+
background-color: var(--reke-color-surface, #1A1A1A);
|
|
98
|
+
border: 1px solid var(--reke-color-border, #252525);
|
|
99
|
+
border-radius: var(--reke-radius, 4px);
|
|
100
|
+
max-height: 240px;
|
|
101
|
+
overflow-y: auto;
|
|
102
|
+
z-index: 100;
|
|
103
|
+
animation: dropdown-in 0.15s ease;
|
|
104
|
+
transform-origin: top;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@keyframes dropdown-in {
|
|
108
|
+
from {
|
|
109
|
+
opacity: 0;
|
|
110
|
+
transform: translateY(-4px);
|
|
111
|
+
}
|
|
112
|
+
to {
|
|
113
|
+
opacity: 1;
|
|
114
|
+
transform: translateY(0);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@media (prefers-reduced-motion: reduce) {
|
|
119
|
+
.dropdown {
|
|
120
|
+
animation: none;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* === Option === */
|
|
125
|
+
|
|
126
|
+
.option {
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
gap: 8px;
|
|
130
|
+
padding: var(--reke-space-xs, 8px) var(--reke-space-md, 16px);
|
|
131
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
132
|
+
font-size: var(--reke-font-size-sm, 13px);
|
|
133
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.option-img {
|
|
138
|
+
width: 16px;
|
|
139
|
+
height: 16px;
|
|
140
|
+
border-radius: 50%;
|
|
141
|
+
flex-shrink: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Active follows keyboard/mouse; hover kept for pointer-only devices. */
|
|
145
|
+
.option--active,
|
|
146
|
+
.option:hover {
|
|
147
|
+
background-color: var(--reke-color-surface-elevated, #151515);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.option--selected {
|
|
151
|
+
color: var(--reke-color-primary, #22C55E);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.empty {
|
|
155
|
+
padding: var(--reke-space-xs, 8px) var(--reke-space-md, 16px);
|
|
156
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
157
|
+
font-size: var(--reke-font-size-sm, 13px);
|
|
158
|
+
color: var(--reke-color-text-muted, #525252);
|
|
159
|
+
}
|
|
160
|
+
`];
|
|
161
|
+
//#endregion
|
|
162
|
+
export { n as styles };
|
|
@@ -144,6 +144,17 @@ export declare class RekeTable extends RekeElement {
|
|
|
144
144
|
private _warnedNumericTarget;
|
|
145
145
|
/** Track which keys are currently mounted in the DOM, to honor the contract that mount happens after `updated()` reconciles. */
|
|
146
146
|
private _mountedKeys;
|
|
147
|
+
/** Keys currently animating their collapse. Cleanup is deferred until transitionend. */
|
|
148
|
+
private _collapsingKeys;
|
|
149
|
+
/**
|
|
150
|
+
* Keys newly expanded this tick. They render collapsed (0fr) for the first
|
|
151
|
+
* paint, then `updated()` clears them on the next frame so the CSS grid
|
|
152
|
+
* transition animates open (0fr → 1fr). Without this, a freshly-mounted
|
|
153
|
+
* expand row starts at 1fr and pops open with no animation.
|
|
154
|
+
*/
|
|
155
|
+
private _enteringKeys;
|
|
156
|
+
/** transitionend handlers keyed by row key, for cleanup on collapse animation end. */
|
|
157
|
+
private _collapseEndHandlers;
|
|
147
158
|
/** Latest resolved row map: key → row. Filled during render so callbacks can look up rows. */
|
|
148
159
|
private _keyToRow;
|
|
149
160
|
/** Stable ref callback per row key. One closure per key, reused across renders. */
|
|
@@ -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,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAI9E,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,CACP,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,MAAM,KACV,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;CACnD;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/C,mCAAmC;AACnC,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAErC,yDAAyD;AACzD,MAAM,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;AAEnG,yEAAyE;AACzE,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,KAA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