reke-ui 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +21 -0
  2. package/cli/install-skills.mjs +169 -0
  3. package/custom-elements.json +272 -28
  4. package/dist/__type-checks__/no-lit-in-public-types.d.ts +2 -0
  5. package/dist/__type-checks__/no-lit-in-public-types.d.ts.map +1 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js +9 -0
  7. package/dist/components/reke-alert/reke-alert.d.ts.map +1 -1
  8. package/dist/components/reke-alert/reke-alert.js +32 -40
  9. package/dist/components/reke-alert/reke-alert.styles.js +7 -10
  10. package/dist/components/reke-badge/reke-badge.js +26 -40
  11. package/dist/components/reke-badge/reke-badge.styles.js +7 -10
  12. package/dist/components/reke-button/reke-button.d.ts.map +1 -1
  13. package/dist/components/reke-button/reke-button.js +41 -52
  14. package/dist/components/reke-button/reke-button.styles.js +7 -10
  15. package/dist/components/reke-card/reke-card.d.ts.map +1 -1
  16. package/dist/components/reke-card/reke-card.js +38 -58
  17. package/dist/components/reke-card/reke-card.styles.js +7 -10
  18. package/dist/components/reke-checkbox/reke-checkbox.js +40 -47
  19. package/dist/components/reke-checkbox/reke-checkbox.styles.d.ts.map +1 -1
  20. package/dist/components/reke-checkbox/reke-checkbox.styles.js +7 -9
  21. package/dist/components/reke-chip/reke-chip.d.ts.map +1 -1
  22. package/dist/components/reke-chip/reke-chip.js +42 -50
  23. package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
  24. package/dist/components/reke-chip/reke-chip.styles.js +16 -13
  25. package/dist/components/reke-date-range/reke-date-range.d.ts.map +1 -1
  26. package/dist/components/reke-date-range/reke-date-range.js +240 -260
  27. package/dist/components/reke-date-range/reke-date-range.styles.d.ts.map +1 -1
  28. package/dist/components/reke-date-range/reke-date-range.styles.js +29 -16
  29. package/dist/components/reke-dialog/reke-dialog.d.ts.map +1 -1
  30. package/dist/components/reke-dialog/reke-dialog.js +52 -65
  31. package/dist/components/reke-dialog/reke-dialog.styles.d.ts.map +1 -1
  32. package/dist/components/reke-dialog/reke-dialog.styles.js +8 -10
  33. package/dist/components/reke-file-upload/reke-file-upload.d.ts.map +1 -1
  34. package/dist/components/reke-file-upload/reke-file-upload.js +62 -86
  35. package/dist/components/reke-file-upload/reke-file-upload.styles.js +7 -10
  36. package/dist/components/reke-input/reke-input.js +42 -61
  37. package/dist/components/reke-input/reke-input.styles.d.ts.map +1 -1
  38. package/dist/components/reke-input/reke-input.styles.js +8 -10
  39. package/dist/components/reke-select/reke-select.d.ts.map +1 -1
  40. package/dist/components/reke-select/reke-select.js +66 -89
  41. package/dist/components/reke-select/reke-select.styles.d.ts.map +1 -1
  42. package/dist/components/reke-select/reke-select.styles.js +9 -11
  43. package/dist/components/reke-table/reke-table.d.ts +134 -23
  44. package/dist/components/reke-table/reke-table.d.ts.map +1 -1
  45. package/dist/components/reke-table/reke-table.js +242 -143
  46. package/dist/components/reke-table/reke-table.styles.d.ts.map +1 -1
  47. package/dist/components/reke-table/reke-table.styles.js +67 -9
  48. package/dist/components/reke-textarea/reke-textarea.js +42 -61
  49. package/dist/components/reke-textarea/reke-textarea.styles.js +6 -9
  50. package/dist/components/reke-toast/reke-toast.d.ts.map +1 -1
  51. package/dist/components/reke-toast/reke-toast.js +50 -68
  52. package/dist/components/reke-toast/reke-toast.styles.d.ts.map +1 -1
  53. package/dist/components/reke-toast/reke-toast.styles.js +13 -12
  54. package/dist/components/reke-toggle/reke-toggle.js +36 -43
  55. package/dist/components/reke-toggle/reke-toggle.styles.js +7 -10
  56. package/dist/components/reke-tooltip/reke-tooltip.js +31 -47
  57. package/dist/components/reke-tooltip/reke-tooltip.styles.js +6 -9
  58. package/dist/index.d.ts +23 -23
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +15 -33
  61. package/dist/react-bridge/table.d.ts +58 -0
  62. package/dist/react-bridge/table.d.ts.map +1 -0
  63. package/dist/react-bridge/table.js +115 -0
  64. package/dist/react.d.ts +12 -26
  65. package/dist/react.d.ts.map +1 -1
  66. package/dist/react.js +110 -146
  67. package/dist/shared/base-element.js +13 -15
  68. package/dist/shared/tailwind-styles.js +6 -6
  69. package/dist/shared/tailwind.js +4 -0
  70. package/dist/tokens/reke-tokens.css +47 -0
  71. package/package.json +40 -20
  72. package/dist/shared/tailwind.css.js +0 -4
@@ -1,107 +1,219 @@
1
- import { nothing as h, html as n } from "lit";
2
- import { property as l, state as c, customElement as b } from "lit/decorators.js";
3
- import { classMap as y } from "lit/directives/class-map.js";
4
- import { RekeElement as f } from "../../shared/base-element.js";
5
- import { styles as u } from "./reke-table.styles.js";
6
- var m = Object.defineProperty, w = Object.getOwnPropertyDescriptor, a = (t, e, r, o) => {
7
- for (var d = o > 1 ? void 0 : o ? w(e, r) : e, i = t.length - 1, p; i >= 0; i--)
8
- (p = t[i]) && (d = (o ? p(e, r, d) : p(d)) || d);
9
- return o && d && m(e, r, d), d;
10
- };
11
- let s = class extends f {
12
- constructor() {
13
- super(...arguments), this.columns = [], this.rows = [], this.striped = !1, this.dense = !1, this.hoverable = !1, this.bordered = !1, this.borderless = !1, this.sortKey = "", this.sortDirection = "asc", this.expandedRowRender = null, this.expandedRowElement = null, this.expandedRows = /* @__PURE__ */ new Set(), this._expandCleanups = /* @__PURE__ */ new Map(), this._hasToolbar = !1, this._hasFooter = !1;
14
- }
15
- handleHeaderClick(t) {
16
- t.sortable !== !1 && (this.sortKey === t.key ? this.sortDirection = this.sortDirection === "asc" ? "desc" : "asc" : (this.sortKey = t.key, this.sortDirection = "asc"), this.emit("reke-sort", { key: this.sortKey, direction: this.sortDirection }));
17
- }
18
- handleRowClick(t, e) {
19
- this.emit("reke-row-click", { row: t, index: e });
20
- }
21
- /** Toggle expand state for a row at the given index. */
22
- toggleExpand(t) {
23
- const e = new Set(this.expandedRows), r = this.rows[t], o = !e.has(t);
24
- if (o)
25
- e.add(t);
26
- else {
27
- e.delete(t);
28
- const d = this._expandCleanups.get(t);
29
- d && (d(), this._expandCleanups.delete(t));
30
- }
31
- this.expandedRows = e, this.emit("reke-row-expand", { row: r, index: t, expanded: o });
32
- }
33
- /** Check whether a row at the given index is currently expanded. */
34
- isRowExpanded(t) {
35
- return this.expandedRows.has(t);
36
- }
37
- _onToolbarSlotChange(t) {
38
- const e = t.target;
39
- this._hasToolbar = e.assignedNodes({ flatten: !0 }).length > 0;
40
- }
41
- _onFooterSlotChange(t) {
42
- const e = t.target;
43
- this._hasFooter = e.assignedNodes({ flatten: !0 }).length > 0;
44
- }
45
- _renderRow(t, e) {
46
- const r = this.expandedRows.has(e);
47
- return n`
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-table.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
+ import { ref as l } from "lit/directives/ref.js";
8
+ //#region src/components/reke-table/reke-table.ts
9
+ function u() {
10
+ try {
11
+ let e = {
12
+ BASE_URL: "/",
13
+ DEV: !1,
14
+ MODE: "production",
15
+ PROD: !0,
16
+ SSR: !1
17
+ };
18
+ if (e && typeof e.DEV == "boolean") return e.DEV;
19
+ if (e && typeof e.MODE == "string") return e.MODE !== "production";
20
+ } catch {}
21
+ try {
22
+ let e = globalThis.process;
23
+ if (e?.env?.NODE_ENV) return e.env.NODE_ENV === "development";
24
+ } catch {}
25
+ return !1;
26
+ }
27
+ var d = class extends e {
28
+ constructor(...e) {
29
+ super(...e), this.columns = [], this.rows = [], this.striped = !1, this.dense = !1, this.hoverable = !1, this.bordered = !1, this.borderless = !1, this.expandable = !1, this.expandOnRowClick = !1, this.sortKey = "", this.sortDirection = "asc", this.expandedRowElement = null, this.expandedRows = /* @__PURE__ */ new Set(), this._hostCache = /* @__PURE__ */ new Map(), this._cleanupMap = /* @__PURE__ */ new Map(), this._warnedDupKeys = /* @__PURE__ */ new Set(), this._warnedNumericTarget = !1, this._mountedKeys = /* @__PURE__ */ new Set(), this._keyToRow = /* @__PURE__ */ new Map(), this._refCallbacks = /* @__PURE__ */ new Map(), this._hasToolbar = !1, this._hasFooter = !1, this._warnedLegacyApi = !1;
30
+ }
31
+ static {
32
+ this.styles = n;
33
+ }
34
+ _resolveKey(e, t) {
35
+ return this.getRowKey ? this.getRowKey(e, t) : String(t);
36
+ }
37
+ handleHeaderClick(e) {
38
+ e.sortable !== !1 && (this.sortKey === e.key ? this.sortDirection = this.sortDirection === "asc" ? "desc" : "asc" : (this.sortKey = e.key, this.sortDirection = "asc"), this.emit("reke-sort", {
39
+ key: this.sortKey,
40
+ direction: this.sortDirection
41
+ }));
42
+ }
43
+ handleRowClick(e, t) {
44
+ if (this.emit("reke-row-click", {
45
+ row: e,
46
+ index: t
47
+ }), this.expandOnRowClick) {
48
+ let n = this._resolveKey(e, t);
49
+ this.toggleExpand(n);
50
+ }
51
+ }
52
+ _handleChevronClick(e, t) {
53
+ e.stopPropagation(), this.toggleExpand(t);
54
+ }
55
+ _handleChevronKeydown(e, t) {
56
+ (e.key === "Enter" || e.key === " " || e.key === "Spacebar") && (e.preventDefault(), e.stopPropagation(), this.toggleExpand(t));
57
+ }
58
+ toggleExpand(e) {
59
+ let t, n, r, i = typeof e == "number" && e === Math.trunc(e) && e >= 0 && e < this.rows.length;
60
+ i && this.getRowKey && !this._warnedNumericTarget && u() && (this._warnedNumericTarget = !0, console.warn("[reke-table] toggleExpand received a numeric target while `getRowKey` is set; in-range numeric targets are interpreted as row INDICES, not keys. Pass the resolved key to target by identity.")), i ? (n = e, r = this.rows[n], t = this._resolveKey(r, n)) : (t = e, n = this.rows.findIndex((e, n) => this._resolveKey(e, n) === t), r = n >= 0 ? this.rows[n] : void 0);
61
+ let a = new Set(this.expandedRows), o = !a.has(t);
62
+ o ? a.add(t) : (a.delete(t), this._safeCleanup(t), this._hostCache.delete(t), this._mountedKeys.delete(t), this._refCallbacks.delete(t)), this.expandedRows = a, this.emit("reke-row-expand", {
63
+ row: r,
64
+ index: n,
65
+ key: t,
66
+ expanded: o
67
+ });
68
+ }
69
+ isRowExpanded(e) {
70
+ return this.expandedRows.has(e);
71
+ }
72
+ _onToolbarSlotChange(e) {
73
+ let t = e.target;
74
+ this._hasToolbar = t.assignedNodes({ flatten: !0 }).length > 0;
75
+ }
76
+ _onFooterSlotChange(e) {
77
+ let t = e.target;
78
+ this._hasFooter = t.assignedNodes({ flatten: !0 }).length > 0;
79
+ }
80
+ _getOrCreateHost(e) {
81
+ let t = this._hostCache.get(e);
82
+ return t || (t = document.createElement("div"), t.style.cssText = "display: contents;", this._hostCache.set(e, t)), t;
83
+ }
84
+ _expandTdRef(e) {
85
+ let t = this._refCallbacks.get(e);
86
+ return t || (t = (t) => {
87
+ if (!t) return;
88
+ let n = t, r = this._getOrCreateHost(e);
89
+ r.parentElement !== n && n.appendChild(r);
90
+ }, this._refCallbacks.set(e, t)), t;
91
+ }
92
+ _renderRow(e, t, n) {
93
+ let a = this.expandedRows.has(n), o = `reke-table-expand-${String(n)}`, s = this.columns.length + +!!this.expandable;
94
+ return r`
48
95
  <tr
49
96
  part="row"
50
- class="row ${e % 2 === 1 ? "row--even" : ""} ${r ? "row--expanded" : ""}"
51
- @click=${() => this.handleRowClick(t, e)}
97
+ class="row ${t % 2 == 1 ? "row--even" : ""} ${a ? "row--expanded" : ""}"
98
+ @click=${() => this.handleRowClick(e, t)}
52
99
  >
53
- ${this.columns.map(
54
- (o) => n`
100
+ ${this.expandable ? r`
101
+ <td
102
+ part="expand-toggle-cell"
103
+ class="expand-toggle-cell"
104
+ >
105
+ <button
106
+ type="button"
107
+ part="expand-toggle-button"
108
+ class="expand-toggle-button ${a ? "expand-toggle-button--expanded" : ""}"
109
+ aria-expanded=${a ? "true" : "false"}
110
+ aria-controls=${o}
111
+ aria-label=${a ? "Collapse row" : "Expand row"}
112
+ @click=${(e) => this._handleChevronClick(e, n)}
113
+ @keydown=${(e) => this._handleChevronKeydown(e, n)}
114
+ >
115
+ <span class="expand-toggle-chevron" aria-hidden="true">▶</span>
116
+ </button>
117
+ </td>
118
+ ` : i}
119
+ ${this.columns.map((n) => r`
55
120
  <td
56
121
  part="cell"
57
122
  class="cell"
58
- data-align=${o.align || "left"}
123
+ data-align=${n.align || "left"}
59
124
  >
60
- ${o.render ? o.render(t[o.key], t, e) : t[o.key] ?? ""}
125
+ ${n.render ? n.render(e[n.key], e, t) : e[n.key] ?? ""}
61
126
  </td>
62
- `
63
- )}
127
+ `)}
64
128
  </tr>
65
- ${(this.expandedRowElement || this.expandedRowRender) && r ? n`
129
+ ${this.expandedRowElement && a && this._keyToRow.get(n) === e ? r`
66
130
  <tr part="expand-row" class="expand-row">
67
- <td part="expand-content" class="expand-content" colspan=${this.columns.length}>
68
- ${this.expandedRowElement ? this._renderExpandedElement(t, e) : this.expandedRowRender(t, e)}
69
- </td>
131
+ <td
132
+ part="expand-content"
133
+ class="expand-content"
134
+ id=${o}
135
+ colspan=${s}
136
+ ${l(this._expandTdRef(n))}
137
+ ></td>
70
138
  </tr>
71
- ` : h}
139
+ ` : i}
72
140
  `;
73
- }
74
- _renderExpandedElement(t, e) {
75
- const r = document.createElement("div");
76
- r.style.cssText = "display: contents;";
77
- const o = this.expandedRowElement(r, t, e);
78
- return o && this._expandCleanups.set(e, o), r;
79
- }
80
- disconnectedCallback() {
81
- super.disconnectedCallback(), this._expandCleanups.forEach((t) => t()), this._expandCleanups.clear();
82
- }
83
- render() {
84
- const t = {
85
- table: !0,
86
- "table--striped": this.striped,
87
- "table--dense": this.dense,
88
- "table--hoverable": this.hoverable,
89
- "table--bordered": this.bordered
90
- };
91
- return n`
141
+ }
142
+ willUpdate(e) {
143
+ let t = u();
144
+ t && this.expandedRowRender != null && !this._warnedLegacyApi && (this._warnedLegacyApi = !0, console.error("[reke-table] `expandedRowRender` was removed. Use `expandedRowElement(host, row, key) => Cleanup | void` instead."));
145
+ let n = /* @__PURE__ */ new Map();
146
+ for (let e = 0; e < this.rows.length; e += 1) {
147
+ let r = this.rows[e], i = this._resolveKey(r, e);
148
+ n.has(i) && t && !this._warnedDupKeys.has(i) && (this._warnedDupKeys.add(i), console.warn(`[reke-table] Duplicate getRowKey value detected: ${JSON.stringify(i)}. Last row with this key wins for expand bookkeeping.`)), n.set(i, r);
149
+ }
150
+ this._keyToRow = n;
151
+ }
152
+ updated(e) {
153
+ if (!this.expandedRowElement) {
154
+ this._runAllCleanupsAndClear();
155
+ for (let e of Array.from(this.expandedRows)) this._keyToRow.has(e) || this.expandedRows.delete(e);
156
+ return;
157
+ }
158
+ let t = /* @__PURE__ */ new Set([...this.expandedRows, ...this._hostCache.keys()]);
159
+ for (let e of t) {
160
+ let t = this._keyToRow.has(e), n = this.expandedRows.has(e);
161
+ t && n || (this._safeCleanup(e), this._hostCache.delete(e), this._mountedKeys.delete(e), this._refCallbacks.delete(e), t || this.expandedRows.delete(e));
162
+ }
163
+ for (let e of this.expandedRows) {
164
+ if (this._mountedKeys.has(e)) continue;
165
+ let t = this._keyToRow.get(e);
166
+ if (!t) continue;
167
+ let n = this._getOrCreateHost(e), r = this.expandedRowElement(n, t, e);
168
+ typeof r == "function" && this._cleanupMap.set(e, r), this._mountedKeys.add(e);
169
+ }
170
+ }
171
+ _safeCleanup(e) {
172
+ let t = this._cleanupMap.get(e);
173
+ if (t) {
174
+ try {
175
+ t();
176
+ } catch {}
177
+ this._cleanupMap.delete(e);
178
+ }
179
+ }
180
+ _runAllCleanupsAndClear() {
181
+ for (let e of this._cleanupMap.values()) try {
182
+ e();
183
+ } catch {}
184
+ this._cleanupMap.clear(), this._hostCache.clear(), this._mountedKeys.clear(), this._refCallbacks.clear();
185
+ }
186
+ disconnectedCallback() {
187
+ super.disconnectedCallback(), this._runAllCleanupsAndClear();
188
+ }
189
+ render() {
190
+ let e = {
191
+ table: !0,
192
+ "table--striped": this.striped,
193
+ "table--dense": this.dense,
194
+ "table--hoverable": this.hoverable,
195
+ "table--bordered": this.bordered
196
+ };
197
+ return r`
92
198
  <div class="table-container">
93
- ${this._hasToolbar ? n`
199
+ ${this._hasToolbar ? r`
94
200
  <div part="toolbar" class="table-toolbar">
95
201
  <slot name="toolbar" @slotchange=${this._onToolbarSlotChange}></slot>
96
202
  </div>
97
- ` : n`<slot name="toolbar" @slotchange=${this._onToolbarSlotChange} style="display:none"></slot>`}
203
+ ` : r`<slot name="toolbar" @slotchange=${this._onToolbarSlotChange} style="display:none"></slot>`}
98
204
 
99
205
  <div class="table-wrapper">
100
- <table part="table" class=${y(t)} role="table">
206
+ <table part="table" class=${c(e)} role="table">
101
207
  <thead part="header">
102
208
  <tr>
103
- ${this.columns.map(
104
- (e) => n`
209
+ ${this.expandable ? r`
210
+ <th
211
+ part="expand-toggle-header-cell"
212
+ class="expand-toggle-header-cell"
213
+ aria-hidden="true"
214
+ ></th>
215
+ ` : i}
216
+ ${this.columns.map((e) => r`
105
217
  <th
106
218
  part="header-cell"
107
219
  class="header-cell ${this.sortKey === e.key ? "header-cell--sorted" : ""} ${e.sortable === !1 ? "header-cell--no-sort" : ""}"
@@ -111,81 +223,68 @@ let s = class extends f {
111
223
  >
112
224
  <span class="header-content">
113
225
  ${e.header}
114
- ${this.sortKey === e.key ? n`<span class="sort-indicator" aria-hidden="true">${this.sortDirection === "asc" ? "↑" : "↓"}</span>` : h}
226
+ ${this.sortKey === e.key ? r`<span class="sort-indicator" aria-hidden="true">${this.sortDirection === "asc" ? "↑" : "↓"}</span>` : i}
115
227
  </span>
116
228
  </th>
117
- `
118
- )}
229
+ `)}
119
230
  </tr>
120
231
  </thead>
121
232
  <tbody part="body">
122
- ${this.rows.map((e, r) => this._renderRow(e, r))}
123
- ${this.rows.length === 0 ? n`
233
+ ${this.rows.map((e, t) => {
234
+ let n = this._resolveKey(e, t);
235
+ return this._renderRow(e, t, n);
236
+ })}
237
+ ${this.rows.length === 0 ? r`
124
238
  <tr class="row row--empty">
125
- <td class="cell cell--empty" colspan=${this.columns.length}>
239
+ <td
240
+ class="cell cell--empty"
241
+ colspan=${this.columns.length + +!!this.expandable}
242
+ >
126
243
  <slot name="empty">No data</slot>
127
244
  </td>
128
245
  </tr>
129
- ` : h}
246
+ ` : i}
130
247
  </tbody>
131
248
  </table>
132
249
  </div>
133
250
 
134
- ${this._hasFooter ? n`
251
+ ${this._hasFooter ? r`
135
252
  <div part="footer" class="table-footer">
136
253
  <slot name="footer" @slotchange=${this._onFooterSlotChange}></slot>
137
254
  </div>
138
- ` : n`<slot name="footer" @slotchange=${this._onFooterSlotChange} style="display:none"></slot>`}
255
+ ` : r`<slot name="footer" @slotchange=${this._onFooterSlotChange} style="display:none"></slot>`}
139
256
  </div>
140
257
  `;
141
- }
142
- };
143
- s.styles = u;
144
- a([
145
- l({ attribute: !1 })
146
- ], s.prototype, "columns", 2);
147
- a([
148
- l({ attribute: !1 })
149
- ], s.prototype, "rows", 2);
150
- a([
151
- l({ type: Boolean, reflect: !0 })
152
- ], s.prototype, "striped", 2);
153
- a([
154
- l({ type: Boolean, reflect: !0 })
155
- ], s.prototype, "dense", 2);
156
- a([
157
- l({ type: Boolean, reflect: !0 })
158
- ], s.prototype, "hoverable", 2);
159
- a([
160
- l({ type: Boolean, reflect: !0 })
161
- ], s.prototype, "bordered", 2);
162
- a([
163
- l({ type: Boolean, reflect: !0 })
164
- ], s.prototype, "borderless", 2);
165
- a([
166
- l({ reflect: !0, attribute: "sort-key" })
167
- ], s.prototype, "sortKey", 2);
168
- a([
169
- l({ reflect: !0, attribute: "sort-direction" })
170
- ], s.prototype, "sortDirection", 2);
171
- a([
172
- l({ attribute: !1 })
173
- ], s.prototype, "expandedRowRender", 2);
174
- a([
175
- l({ attribute: !1 })
176
- ], s.prototype, "expandedRowElement", 2);
177
- a([
178
- l({ attribute: !1 })
179
- ], s.prototype, "expandedRows", 2);
180
- a([
181
- c()
182
- ], s.prototype, "_hasToolbar", 2);
183
- a([
184
- c()
185
- ], s.prototype, "_hasFooter", 2);
186
- s = a([
187
- b("reke-table")
188
- ], s);
189
- export {
190
- s as RekeTable
258
+ }
191
259
  };
260
+ t([o({ attribute: !1 })], d.prototype, "columns", void 0), t([o({ attribute: !1 })], d.prototype, "rows", void 0), t([o({
261
+ type: Boolean,
262
+ reflect: !0
263
+ })], d.prototype, "striped", void 0), t([o({
264
+ type: Boolean,
265
+ reflect: !0
266
+ })], d.prototype, "dense", void 0), t([o({
267
+ type: Boolean,
268
+ reflect: !0
269
+ })], d.prototype, "hoverable", void 0), t([o({
270
+ type: Boolean,
271
+ reflect: !0
272
+ })], d.prototype, "bordered", void 0), t([o({
273
+ type: Boolean,
274
+ reflect: !0
275
+ })], d.prototype, "borderless", void 0), t([o({
276
+ type: Boolean,
277
+ reflect: !0
278
+ })], d.prototype, "expandable", void 0), t([o({
279
+ type: Boolean,
280
+ reflect: !0,
281
+ attribute: "expand-on-row-click"
282
+ })], d.prototype, "expandOnRowClick", void 0), t([o({
283
+ reflect: !0,
284
+ attribute: "sort-key"
285
+ })], d.prototype, "sortKey", void 0), t([o({
286
+ reflect: !0,
287
+ attribute: "sort-direction"
288
+ })], d.prototype, "sortDirection", void 0), t([o({ attribute: !1 })], d.prototype, "expandedRowElement", void 0), t([o({ attribute: !1 })], d.prototype, "getRowKey", void 0), t([o({ attribute: !1 })], d.prototype, "expandedRows", void 0), t([s()], d.prototype, "_hasToolbar", void 0), t([s()], d.prototype, "_hasFooter", void 0), d = t([a("reke-table")], d);
289
+ //#endregion
290
+ export { d as RekeTable };
@@ -1 +1 @@
1
- {"version":3,"file":"reke-table.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-table/reke-table.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BAyMlB,CAAC"}
1
+ {"version":3,"file":"reke-table.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-table/reke-table.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BAsQlB,CAAC"}
@@ -1,8 +1,7 @@
1
1
  import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
2
- import { css as r } from "lit";
3
- const t = [
4
- e,
5
- r`
2
+ import { css as t } from "lit";
3
+ //#region src/components/reke-table/reke-table.styles.ts
4
+ var n = [e, t`
6
5
  :host {
7
6
  display: block;
8
7
  }
@@ -145,6 +144,67 @@ const t = [
145
144
  padding: 24px 16px;
146
145
  }
147
146
 
147
+ /* === Expand toggle column (opt-in via expandable prop) === */
148
+
149
+ .expand-toggle-header-cell {
150
+ width: 40px;
151
+ padding: 12px 8px;
152
+ border-bottom: 1px solid var(--reke-color-border, #252525);
153
+ background: var(--reke-color-surface, #1A1A1A);
154
+ }
155
+
156
+ .expand-toggle-cell {
157
+ width: 40px;
158
+ padding: 8px 4px 8px 8px;
159
+ text-align: center;
160
+ vertical-align: middle;
161
+ }
162
+
163
+ .expand-toggle-button {
164
+ display: inline-flex;
165
+ align-items: center;
166
+ justify-content: center;
167
+ width: 24px;
168
+ height: 24px;
169
+ padding: 0;
170
+ background: transparent;
171
+ border: none;
172
+ border-radius: var(--reke-radius, 4px);
173
+ color: var(--reke-color-text-muted, #525252);
174
+ cursor: pointer;
175
+ font: inherit;
176
+ line-height: 1;
177
+ }
178
+
179
+ .expand-toggle-button:hover {
180
+ color: var(--reke-color-text, #E5E5E5);
181
+ background: color-mix(in srgb, var(--reke-color-surface, #1A1A1A) 75%, var(--reke-color-border, #252525));
182
+ }
183
+
184
+ .expand-toggle-button:focus-visible {
185
+ outline: 2px solid var(--reke-color-primary, #22C55E);
186
+ outline-offset: 2px;
187
+ }
188
+
189
+ .expand-toggle-chevron {
190
+ display: inline-block;
191
+ font-size: 10px;
192
+ transition: transform 120ms ease;
193
+ transform: rotate(0deg);
194
+ }
195
+
196
+ .expand-toggle-button--expanded .expand-toggle-chevron {
197
+ transform: rotate(90deg);
198
+ }
199
+
200
+ .table--dense .expand-toggle-header-cell {
201
+ padding: 8px 6px;
202
+ }
203
+
204
+ .table--dense .expand-toggle-cell {
205
+ padding: 4px 4px 4px 6px;
206
+ }
207
+
148
208
  /* === Expanded row === */
149
209
 
150
210
  .expand-row {
@@ -200,8 +260,6 @@ const t = [
200
260
  border: none;
201
261
  border-radius: 0;
202
262
  }
203
- `
204
- ];
205
- export {
206
- t as styles
207
- };
263
+ `];
264
+ //#endregion
265
+ export { n as styles };
@@ -1,73 +1,54 @@
1
- import { nothing as n, html as u } from "lit";
2
- import { property as a, 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-textarea.styles.js";
6
- var v = Object.defineProperty, f = Object.getOwnPropertyDescriptor, t = (l, s, i, o) => {
7
- for (var r = o > 1 ? void 0 : o ? f(s, i) : s, p = l.length - 1, h; p >= 0; p--)
8
- (h = l[p]) && (r = (o ? h(s, i, r) : h(r)) || r);
9
- return o && r && v(s, i, r), r;
10
- };
11
- let e = class extends m {
12
- constructor() {
13
- super(...arguments), this.value = "", this.placeholder = "", this.rows = 4, this.size = "md", this.disabled = !1, this.error = !1, this.label = "";
14
- }
15
- handleInput(l) {
16
- const s = l.target;
17
- this.value = s.value, this.emit("reke-input", { value: this.value });
18
- }
19
- handleChange() {
20
- this.emit("reke-change", { value: this.value });
21
- }
22
- render() {
23
- const l = {
24
- textarea: !0,
25
- [`textarea--${this.size}`]: !0,
26
- "textarea--error": this.error
27
- };
28
- return u`
29
- ${this.label ? u`<label class="label">${this.label}</label>` : n}
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-textarea.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-textarea/reke-textarea.ts
8
+ var c = class extends e {
9
+ constructor(...e) {
10
+ super(...e), this.value = "", this.placeholder = "", this.rows = 4, 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
+ textarea: !0,
25
+ [`textarea--${this.size}`]: !0,
26
+ "textarea--error": this.error
27
+ };
28
+ return r`
29
+ ${this.label ? r`<label class="label">${this.label}</label>` : i}
30
30
  <textarea
31
31
  part="textarea"
32
- class=${c(l)}
32
+ class=${s(e)}
33
33
  .value=${this.value}
34
- placeholder=${this.placeholder || n}
34
+ placeholder=${this.placeholder || i}
35
35
  rows=${this.rows}
36
36
  ?disabled=${this.disabled}
37
37
  aria-disabled=${this.disabled}
38
38
  aria-invalid=${this.error}
39
- aria-label=${this.label || n}
39
+ aria-label=${this.label || i}
40
40
  @input=${this.handleInput}
41
41
  @change=${this.handleChange}
42
42
  ></textarea>
43
43
  `;
44
- }
45
- };
46
- e.styles = b;
47
- t([
48
- a()
49
- ], e.prototype, "value", 2);
50
- t([
51
- a()
52
- ], e.prototype, "placeholder", 2);
53
- t([
54
- a({ type: Number })
55
- ], e.prototype, "rows", 2);
56
- t([
57
- a({ reflect: !0 })
58
- ], e.prototype, "size", 2);
59
- t([
60
- a({ type: Boolean, reflect: !0 })
61
- ], e.prototype, "disabled", 2);
62
- t([
63
- a({ type: Boolean, reflect: !0 })
64
- ], e.prototype, "error", 2);
65
- t([
66
- a()
67
- ], e.prototype, "label", 2);
68
- e = t([
69
- d("reke-textarea")
70
- ], e);
71
- export {
72
- e as RekeTextarea
44
+ }
73
45
  };
46
+ t([o()], c.prototype, "value", void 0), t([o()], c.prototype, "placeholder", void 0), t([o({ type: Number })], c.prototype, "rows", 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-textarea")], c);
53
+ //#endregion
54
+ export { c as RekeTextarea };