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.
- package/README.md +21 -0
- package/cli/install-skills.mjs +169 -0
- package/custom-elements.json +272 -28
- 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 +32 -40
- package/dist/components/reke-alert/reke-alert.styles.js +7 -10
- package/dist/components/reke-badge/reke-badge.js +26 -40
- package/dist/components/reke-badge/reke-badge.styles.js +7 -10
- package/dist/components/reke-button/reke-button.d.ts.map +1 -1
- package/dist/components/reke-button/reke-button.js +41 -52
- package/dist/components/reke-button/reke-button.styles.js +7 -10
- package/dist/components/reke-card/reke-card.d.ts.map +1 -1
- package/dist/components/reke-card/reke-card.js +38 -58
- package/dist/components/reke-card/reke-card.styles.js +7 -10
- package/dist/components/reke-checkbox/reke-checkbox.js +40 -47
- package/dist/components/reke-checkbox/reke-checkbox.styles.d.ts.map +1 -1
- package/dist/components/reke-checkbox/reke-checkbox.styles.js +7 -9
- package/dist/components/reke-chip/reke-chip.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.js +42 -50
- package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.styles.js +16 -13
- package/dist/components/reke-date-range/reke-date-range.d.ts.map +1 -1
- package/dist/components/reke-date-range/reke-date-range.js +240 -260
- 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 +29 -16
- package/dist/components/reke-dialog/reke-dialog.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.js +52 -65
- package/dist/components/reke-dialog/reke-dialog.styles.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.styles.js +8 -10
- package/dist/components/reke-file-upload/reke-file-upload.d.ts.map +1 -1
- package/dist/components/reke-file-upload/reke-file-upload.js +62 -86
- package/dist/components/reke-file-upload/reke-file-upload.styles.js +7 -10
- package/dist/components/reke-input/reke-input.js +42 -61
- package/dist/components/reke-input/reke-input.styles.d.ts.map +1 -1
- package/dist/components/reke-input/reke-input.styles.js +8 -10
- package/dist/components/reke-select/reke-select.d.ts.map +1 -1
- package/dist/components/reke-select/reke-select.js +66 -89
- package/dist/components/reke-select/reke-select.styles.d.ts.map +1 -1
- package/dist/components/reke-select/reke-select.styles.js +9 -11
- package/dist/components/reke-table/reke-table.d.ts +134 -23
- package/dist/components/reke-table/reke-table.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.js +242 -143
- package/dist/components/reke-table/reke-table.styles.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.styles.js +67 -9
- package/dist/components/reke-textarea/reke-textarea.js +42 -61
- package/dist/components/reke-textarea/reke-textarea.styles.js +6 -9
- package/dist/components/reke-toast/reke-toast.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.js +50 -68
- package/dist/components/reke-toast/reke-toast.styles.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.styles.js +13 -12
- package/dist/components/reke-toggle/reke-toggle.js +36 -43
- package/dist/components/reke-toggle/reke-toggle.styles.js +7 -10
- package/dist/components/reke-tooltip/reke-tooltip.js +31 -47
- package/dist/components/reke-tooltip/reke-tooltip.styles.js +6 -9
- package/dist/index.d.ts +23 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -33
- 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 +110 -146
- package/dist/shared/base-element.js +13 -15
- package/dist/shared/tailwind-styles.js +6 -6
- package/dist/shared/tailwind.js +4 -0
- package/dist/tokens/reke-tokens.css +47 -0
- package/package.json +40 -20
- package/dist/shared/tailwind.css.js +0 -4
package/README.md
CHANGED
|
@@ -106,6 +106,8 @@ function App() {
|
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
> **Components with render props** (e.g. `Table` with `expandedRowRender` or `columns[].render`) use a React-native bridge: return `ReactNode` (JSX), pass `getRowKey` for stable keying, and never `import { html } from 'lit'` in app code. See `README-DOC.md` → reke-table → React usage, or install the agent skills below for the full contract.
|
|
110
|
+
|
|
109
111
|
### Vanilla JS
|
|
110
112
|
|
|
111
113
|
```html
|
|
@@ -146,6 +148,25 @@ Override any CSS custom property to match your brand:
|
|
|
146
148
|
|
|
147
149
|
See all available tokens in [`src/tokens/reke-tokens.css`](src/tokens/reke-tokens.css).
|
|
148
150
|
|
|
151
|
+
## Agent skills
|
|
152
|
+
|
|
153
|
+
reke-ui ships **LLM-first skills** that teach AI coding agents how to consume the library correctly (3-layer token system, component APIs, React bridge contract for components with render props).
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npm install reke-ui
|
|
157
|
+
npx reke-ui install-skills
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
This copies three consumer skills into your project's `.claude/skills/` directory:
|
|
161
|
+
|
|
162
|
+
- `reke-ui-consumer` — install, imports, framework integration, full component reference, React bridge contract
|
|
163
|
+
- `reke-design-system` — 3-layer token architecture for Tailwind v4 projects (microfrontend-safe scoping)
|
|
164
|
+
- `reke-bridge` — when and how to bridge web components to your framework (React today; pattern documented for Vue/Svelte)
|
|
165
|
+
|
|
166
|
+
After install, ask your agent to refresh its skill index: **"update skill registry"** (or **"actualizá las skills"**). The agent will then know how to use reke-ui idiomatically — no more guessing or copy-pasted anti-patterns.
|
|
167
|
+
|
|
168
|
+
Options: `--force` reinstalls even if versions match, `--dry-run` previews without writing files.
|
|
169
|
+
|
|
149
170
|
## Development
|
|
150
171
|
|
|
151
172
|
```bash
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* reke-ui install-skills
|
|
4
|
+
*
|
|
5
|
+
* Copies consumer-facing agent skills (LLM instructions) from this package
|
|
6
|
+
* into the current project's `.claude/skills/` directory, so any AI agent
|
|
7
|
+
* working in that project knows how to consume reke-ui correctly.
|
|
8
|
+
*
|
|
9
|
+
* Why this exists:
|
|
10
|
+
* reke-ui ships agent skills (.claude/skills/) that document its consumer
|
|
11
|
+
* API, the React bridge contract, and the 3-layer token system. These skills
|
|
12
|
+
* are LLM-first instructions — they only help when they live in a directory
|
|
13
|
+
* the agent scans. Library `node_modules/.../.claude/skills/` is NEVER
|
|
14
|
+
* scanned automatically by skill-registry. This CLI puts them where they
|
|
15
|
+
* belong.
|
|
16
|
+
*
|
|
17
|
+
* What it does:
|
|
18
|
+
* 1. Locates the reke-ui package's bundled `.claude/skills/`.
|
|
19
|
+
* 2. Copies CONSUMER skills only (not internal-maintainer skills) to
|
|
20
|
+
* `<consumer-cwd>/.claude/skills/`.
|
|
21
|
+
* 3. Writes a marker file with the reke-ui version so we can detect drift.
|
|
22
|
+
* 4. Prints next-step instructions for the user.
|
|
23
|
+
*
|
|
24
|
+
* What it does NOT do:
|
|
25
|
+
* - It does not invoke skill-registry. skill-registry is an agent skill,
|
|
26
|
+
* not a CLI tool. The user must ask their agent to update the registry
|
|
27
|
+
* after install (we print the exact phrase to use).
|
|
28
|
+
* - It does not modify package.json, tsconfig, or any project file other
|
|
29
|
+
* than files under `.claude/skills/reke-ui-*` and the marker.
|
|
30
|
+
*/
|
|
31
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync, rmSync } from 'node:fs';
|
|
32
|
+
import { dirname, join, resolve } from 'node:path';
|
|
33
|
+
import { fileURLToPath } from 'node:url';
|
|
34
|
+
|
|
35
|
+
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
|
|
36
|
+
// Package root is one level up from cli/
|
|
37
|
+
const PKG_ROOT = resolve(SCRIPT_DIR, '..');
|
|
38
|
+
const SOURCE_SKILLS = join(PKG_ROOT, '.claude', 'skills');
|
|
39
|
+
|
|
40
|
+
// Skills published to consumers. Internal-maintainer skills (lit-expert,
|
|
41
|
+
// reke-component, test-runner, a11y-checker, update-docs) are deliberately
|
|
42
|
+
// excluded — those only help when working ON reke-ui itself.
|
|
43
|
+
const CONSUMER_SKILLS = ['reke-ui-consumer', 'reke-bridge', 'reke-design-system'];
|
|
44
|
+
|
|
45
|
+
const CWD = process.cwd();
|
|
46
|
+
const TARGET_DIR = join(CWD, '.claude', 'skills');
|
|
47
|
+
const MARKER_FILE = join(CWD, '.claude', '.reke-ui-skills-version');
|
|
48
|
+
|
|
49
|
+
const args = process.argv.slice(2);
|
|
50
|
+
const FORCE = args.includes('--force') || args.includes('-f');
|
|
51
|
+
const DRY = args.includes('--dry-run') || args.includes('-n');
|
|
52
|
+
|
|
53
|
+
function log(msg) {
|
|
54
|
+
process.stdout.write(`${msg}\n`);
|
|
55
|
+
}
|
|
56
|
+
function warn(msg) {
|
|
57
|
+
process.stderr.write(`\x1b[33m${msg}\x1b[0m\n`);
|
|
58
|
+
}
|
|
59
|
+
function err(msg) {
|
|
60
|
+
process.stderr.write(`\x1b[31m${msg}\x1b[0m\n`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function readPkgVersion() {
|
|
64
|
+
try {
|
|
65
|
+
const pkg = JSON.parse(readFileSync(join(PKG_ROOT, 'package.json'), 'utf8'));
|
|
66
|
+
return pkg.version || 'unknown';
|
|
67
|
+
} catch {
|
|
68
|
+
return 'unknown';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function readMarker() {
|
|
73
|
+
if (!existsSync(MARKER_FILE)) return null;
|
|
74
|
+
try {
|
|
75
|
+
return JSON.parse(readFileSync(MARKER_FILE, 'utf8'));
|
|
76
|
+
} catch {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function writeMarker(version, skills) {
|
|
82
|
+
writeFileSync(
|
|
83
|
+
MARKER_FILE,
|
|
84
|
+
`${JSON.stringify(
|
|
85
|
+
{
|
|
86
|
+
package: 'reke-ui',
|
|
87
|
+
version,
|
|
88
|
+
installedAt: new Date().toISOString(),
|
|
89
|
+
skills,
|
|
90
|
+
},
|
|
91
|
+
null,
|
|
92
|
+
2,
|
|
93
|
+
)}\n`,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function installSkill(name, version) {
|
|
98
|
+
const src = join(SOURCE_SKILLS, name);
|
|
99
|
+
const dst = join(TARGET_DIR, name);
|
|
100
|
+
if (!existsSync(src)) {
|
|
101
|
+
warn(` ⚠ skill missing in package: ${name} (skipping)`);
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
if (existsSync(dst) && !FORCE) {
|
|
105
|
+
const existing = readMarker();
|
|
106
|
+
const sameVersion = existing && existing.version === version;
|
|
107
|
+
if (sameVersion) {
|
|
108
|
+
log(` = ${name} (already at v${version})`);
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
log(` → ${name} (updating from v${existing?.version || '?'} to v${version})`);
|
|
112
|
+
} else {
|
|
113
|
+
log(` + ${name}`);
|
|
114
|
+
}
|
|
115
|
+
if (DRY) return true;
|
|
116
|
+
rmSync(dst, { recursive: true, force: true });
|
|
117
|
+
cpSync(src, dst, { recursive: true });
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function main() {
|
|
122
|
+
log('\nreke-ui install-skills');
|
|
123
|
+
log('───────────────────────');
|
|
124
|
+
|
|
125
|
+
if (!existsSync(SOURCE_SKILLS)) {
|
|
126
|
+
err(`error: source skills not found at ${SOURCE_SKILLS}`);
|
|
127
|
+
err('Is this a corrupted reke-ui install?');
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const version = readPkgVersion();
|
|
132
|
+
log(`reke-ui version : ${version}`);
|
|
133
|
+
log(`target : ${TARGET_DIR}`);
|
|
134
|
+
if (DRY) log('mode : DRY RUN (no files written)\n');
|
|
135
|
+
else log('');
|
|
136
|
+
|
|
137
|
+
if (!DRY) mkdirSync(TARGET_DIR, { recursive: true });
|
|
138
|
+
|
|
139
|
+
log('skills:');
|
|
140
|
+
const installed = [];
|
|
141
|
+
for (const name of CONSUMER_SKILLS) {
|
|
142
|
+
const ok = installSkill(name, version);
|
|
143
|
+
if (ok) installed.push(name);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (!DRY && installed.length > 0) {
|
|
147
|
+
writeMarker(version, installed);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
log('');
|
|
151
|
+
if (installed.length === 0 && !DRY) {
|
|
152
|
+
log('Nothing to do — skills already up to date.');
|
|
153
|
+
log('Run with --force to reinstall.\n');
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
log('Next step:');
|
|
158
|
+
log(' Ask your agent to regenerate the skill registry. Phrase it as:');
|
|
159
|
+
log(' "actualizá las skills" / "update skill registry"\n');
|
|
160
|
+
log('Or run any skill-registry-aware command in this project; the agent');
|
|
161
|
+
log('will pick up the new skills under .claude/skills/reke-ui-*\n');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
try {
|
|
165
|
+
main();
|
|
166
|
+
} catch (e) {
|
|
167
|
+
err(`fatal: ${e.message || e}`);
|
|
168
|
+
process.exit(1);
|
|
169
|
+
}
|
package/custom-elements.json
CHANGED
|
@@ -2458,9 +2458,19 @@
|
|
|
2458
2458
|
"default": "#E5E5E5"
|
|
2459
2459
|
},
|
|
2460
2460
|
{
|
|
2461
|
-
"description": "Header text color.
|
|
2461
|
+
"description": "Header text color.",
|
|
2462
2462
|
"name": "--reke-color-text-muted",
|
|
2463
2463
|
"default": "#525252"
|
|
2464
|
+
},
|
|
2465
|
+
{
|
|
2466
|
+
"description": "Chevron focus outline color.",
|
|
2467
|
+
"name": "--reke-color-primary",
|
|
2468
|
+
"default": "#22C55E"
|
|
2469
|
+
},
|
|
2470
|
+
{
|
|
2471
|
+
"description": "Chevron button corner radius. Props: - `expandedRowElement`: Framework-agnostic expand render. Receives `(host, row, key)`. Mount any framework. Return cleanup or void. - `getRowKey`: Optional `(row, index) => RowKey`. Defaults to `String(index)`. Use a stable domain id for identity-keyed expand state across sorts. - `expandable`: Opt-in boolean (default `false`). When `true`, `reke-table` prepends a leading toggle column with an accessible chevron `<button>` per row: `aria-expanded` reflects the row's expand state, `aria-controls` points at the expand `<td>`, and `Enter`/`Space` activate the toggle. Consumers can also build their own toggles by leaving `expandable=false` (default) and calling `toggleExpand(key)` directly. - `expandOnRowClick` (attribute `expand-on-row-click`): Opt-in boolean (default `false`). When `true`, clicking anywhere on a row calls `toggleExpand(key)` internally. `reke-row-click` is STILL emitted on every row click. The chevron button calls `stopPropagation()` so chevron clicks do NOT double-toggle. Consumers MUST use EITHER this prop OR their own `reke-row-click` → `toggleExpand` handler, not both. For keyboard / screen-reader users, pair with `expandable`.",
|
|
2472
|
+
"name": "--reke-radius",
|
|
2473
|
+
"default": "4px"
|
|
2464
2474
|
}
|
|
2465
2475
|
],
|
|
2466
2476
|
"cssParts": [
|
|
@@ -2503,6 +2513,14 @@
|
|
|
2503
2513
|
{
|
|
2504
2514
|
"description": "The td spanning all columns in the expanded row.",
|
|
2505
2515
|
"name": "expand-content"
|
|
2516
|
+
},
|
|
2517
|
+
{
|
|
2518
|
+
"description": "The leading `<td>` that contains the chevron button (only when `expandable`).",
|
|
2519
|
+
"name": "expand-toggle-cell"
|
|
2520
|
+
},
|
|
2521
|
+
{
|
|
2522
|
+
"description": "The chevron `<button>` itself (only when `expandable`).",
|
|
2523
|
+
"name": "expand-toggle-button"
|
|
2506
2524
|
}
|
|
2507
2525
|
],
|
|
2508
2526
|
"slots": [
|
|
@@ -2586,6 +2604,28 @@
|
|
|
2586
2604
|
"attribute": "borderless",
|
|
2587
2605
|
"reflects": true
|
|
2588
2606
|
},
|
|
2607
|
+
{
|
|
2608
|
+
"kind": "field",
|
|
2609
|
+
"name": "expandable",
|
|
2610
|
+
"type": {
|
|
2611
|
+
"text": "boolean"
|
|
2612
|
+
},
|
|
2613
|
+
"default": "false",
|
|
2614
|
+
"description": "Opt-in: when `true`, the table prepends a leading toggle column whose\n`<button>` calls `toggleExpand(key)`, exposes `aria-expanded` reflecting\nthe expand state, `aria-controls` pointing at the expand `<td>` id\n(`reke-table-expand-<key>`), and accepts `Enter` / `Space` activation.\n\nDefaults to `false` so consumers that already wire their own toggles\n(chips, links, custom buttons) are unaffected.",
|
|
2615
|
+
"attribute": "expandable",
|
|
2616
|
+
"reflects": true
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
"kind": "field",
|
|
2620
|
+
"name": "expandOnRowClick",
|
|
2621
|
+
"type": {
|
|
2622
|
+
"text": "boolean"
|
|
2623
|
+
},
|
|
2624
|
+
"default": "false",
|
|
2625
|
+
"description": "Opt-in: when `true`, clicking anywhere on a row (outside the chevron, if\npresent) calls `toggleExpand(key)` internally using the row's identity\nkey. The `reke-row-click` event is STILL emitted on every row click so\nconsumers can react in addition to the built-in toggle.\n\nDefault is `false` to preserve non-breaking behavior: existing consumers\nthat wire their own `reke-row-click` → `toggleExpand` handlers are\nunaffected.\n\nA11y note: row clicks are a pointer convenience only. The `<tr>` does NOT\nreceive `role=\"button\"` or `tabindex` (that would be a clickable-row\na11y anti-pattern). For keyboard / screen-reader users, pair this prop\nwith `expandable` so the accessible chevron `<button>` is available.\n\nDouble-wiring caveat: consumers MUST use EITHER `expandOnRowClick` OR\ntheir own `reke-row-click` → `toggleExpand` handler — not both — or the\nrow will toggle twice and net to no change.\n\nChevron interaction: the chevron `<button>` calls `stopPropagation()`, so\nclicking the chevron does NOT trigger the row-click toggle (no double\ntoggle).",
|
|
2626
|
+
"attribute": "expand-on-row-click",
|
|
2627
|
+
"reflects": true
|
|
2628
|
+
},
|
|
2589
2629
|
{
|
|
2590
2630
|
"kind": "field",
|
|
2591
2631
|
"name": "sortKey",
|
|
@@ -2608,36 +2648,81 @@
|
|
|
2608
2648
|
},
|
|
2609
2649
|
{
|
|
2610
2650
|
"kind": "field",
|
|
2611
|
-
"name": "
|
|
2651
|
+
"name": "expandedRowElement",
|
|
2612
2652
|
"type": {
|
|
2613
|
-
"text": "
|
|
2653
|
+
"text": "ExpandedRowElement | null"
|
|
2614
2654
|
},
|
|
2615
2655
|
"default": "null",
|
|
2616
|
-
"description": "
|
|
2656
|
+
"description": "Framework-agnostic expand callback. Sole expand API."
|
|
2617
2657
|
},
|
|
2618
2658
|
{
|
|
2619
2659
|
"kind": "field",
|
|
2620
|
-
"name": "
|
|
2660
|
+
"name": "getRowKey",
|
|
2621
2661
|
"type": {
|
|
2622
|
-
"text": "
|
|
2662
|
+
"text": "GetRowKey | undefined"
|
|
2623
2663
|
},
|
|
2624
|
-
"
|
|
2625
|
-
"description": "Framework-agnostic alternative to expandedRowRender.\nReceives an HTMLElement host — mount any framework's content into it.\nReturn a cleanup function (called on collapse) or void."
|
|
2664
|
+
"description": "Resolve a stable identifier for each row.\nDefaults to `String(index)` — identity-equivalent only when rows are stable.\nProvide a domain id (e.g. `row => row.id`) to keep expand state across sorts."
|
|
2626
2665
|
},
|
|
2627
2666
|
{
|
|
2628
2667
|
"kind": "field",
|
|
2629
2668
|
"name": "expandedRows",
|
|
2630
2669
|
"type": {
|
|
2631
|
-
"text": "Set<
|
|
2670
|
+
"text": "Set<RowKey>"
|
|
2632
2671
|
},
|
|
2633
2672
|
"default": "new Set()",
|
|
2634
|
-
"description": "Set of row
|
|
2673
|
+
"description": "Set of row keys currently expanded."
|
|
2635
2674
|
},
|
|
2636
2675
|
{
|
|
2637
2676
|
"kind": "field",
|
|
2638
|
-
"name": "
|
|
2677
|
+
"name": "_hostCache",
|
|
2639
2678
|
"privacy": "private",
|
|
2640
|
-
"default": "new Map<
|
|
2679
|
+
"default": "new Map<RowKey, HTMLElement>()",
|
|
2680
|
+
"description": "Host element cached per row key. Survives unrelated re-renders."
|
|
2681
|
+
},
|
|
2682
|
+
{
|
|
2683
|
+
"kind": "field",
|
|
2684
|
+
"name": "_cleanupMap",
|
|
2685
|
+
"privacy": "private",
|
|
2686
|
+
"default": "new Map<RowKey, Cleanup>()",
|
|
2687
|
+
"description": "Cleanup cached per row key. Invoked exactly once on collapse / row removal / disconnect."
|
|
2688
|
+
},
|
|
2689
|
+
{
|
|
2690
|
+
"kind": "field",
|
|
2691
|
+
"name": "_warnedDupKeys",
|
|
2692
|
+
"privacy": "private",
|
|
2693
|
+
"default": "new Set<RowKey>()",
|
|
2694
|
+
"description": "Keys we have already warned about as duplicates (one-shot per component lifetime)."
|
|
2695
|
+
},
|
|
2696
|
+
{
|
|
2697
|
+
"kind": "field",
|
|
2698
|
+
"name": "_warnedNumericTarget",
|
|
2699
|
+
"type": {
|
|
2700
|
+
"text": "boolean"
|
|
2701
|
+
},
|
|
2702
|
+
"privacy": "private",
|
|
2703
|
+
"default": "false",
|
|
2704
|
+
"description": "One-shot guard for the numeric-target-with-getRowKey ambiguity warning."
|
|
2705
|
+
},
|
|
2706
|
+
{
|
|
2707
|
+
"kind": "field",
|
|
2708
|
+
"name": "_mountedKeys",
|
|
2709
|
+
"privacy": "private",
|
|
2710
|
+
"default": "new Set<RowKey>()",
|
|
2711
|
+
"description": "Track which keys are currently mounted in the DOM, to honor the contract that mount happens after `updated()` reconciles."
|
|
2712
|
+
},
|
|
2713
|
+
{
|
|
2714
|
+
"kind": "field",
|
|
2715
|
+
"name": "_keyToRow",
|
|
2716
|
+
"privacy": "private",
|
|
2717
|
+
"default": "new Map<RowKey, TableRow>()",
|
|
2718
|
+
"description": "Latest resolved row map: key → row. Filled during render so callbacks can look up rows."
|
|
2719
|
+
},
|
|
2720
|
+
{
|
|
2721
|
+
"kind": "field",
|
|
2722
|
+
"name": "_refCallbacks",
|
|
2723
|
+
"privacy": "private",
|
|
2724
|
+
"default": "new Map<RowKey, (el: Element | undefined) => void>()",
|
|
2725
|
+
"description": "Stable ref callback per row key. One closure per key, reused across renders."
|
|
2641
2726
|
},
|
|
2642
2727
|
{
|
|
2643
2728
|
"kind": "field",
|
|
@@ -2657,6 +2742,30 @@
|
|
|
2657
2742
|
"privacy": "private",
|
|
2658
2743
|
"default": "false"
|
|
2659
2744
|
},
|
|
2745
|
+
{
|
|
2746
|
+
"kind": "method",
|
|
2747
|
+
"name": "_resolveKey",
|
|
2748
|
+
"privacy": "private",
|
|
2749
|
+
"return": {
|
|
2750
|
+
"type": {
|
|
2751
|
+
"text": "RowKey"
|
|
2752
|
+
}
|
|
2753
|
+
},
|
|
2754
|
+
"parameters": [
|
|
2755
|
+
{
|
|
2756
|
+
"name": "row",
|
|
2757
|
+
"type": {
|
|
2758
|
+
"text": "TableRow"
|
|
2759
|
+
}
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
"name": "index",
|
|
2763
|
+
"type": {
|
|
2764
|
+
"text": "number"
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2767
|
+
]
|
|
2768
|
+
},
|
|
2660
2769
|
{
|
|
2661
2770
|
"kind": "method",
|
|
2662
2771
|
"name": "handleHeaderClick",
|
|
@@ -2689,18 +2798,73 @@
|
|
|
2689
2798
|
}
|
|
2690
2799
|
]
|
|
2691
2800
|
},
|
|
2801
|
+
{
|
|
2802
|
+
"kind": "method",
|
|
2803
|
+
"name": "_handleChevronClick",
|
|
2804
|
+
"privacy": "private",
|
|
2805
|
+
"return": {
|
|
2806
|
+
"type": {
|
|
2807
|
+
"text": "void"
|
|
2808
|
+
}
|
|
2809
|
+
},
|
|
2810
|
+
"parameters": [
|
|
2811
|
+
{
|
|
2812
|
+
"name": "event",
|
|
2813
|
+
"type": {
|
|
2814
|
+
"text": "Event"
|
|
2815
|
+
}
|
|
2816
|
+
},
|
|
2817
|
+
{
|
|
2818
|
+
"name": "key",
|
|
2819
|
+
"type": {
|
|
2820
|
+
"text": "RowKey"
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
],
|
|
2824
|
+
"description": "Chevron button click handler. Stops propagation so it does NOT also fire\nthe row-level `reke-row-click` event, then toggles the row by key."
|
|
2825
|
+
},
|
|
2826
|
+
{
|
|
2827
|
+
"kind": "method",
|
|
2828
|
+
"name": "_handleChevronKeydown",
|
|
2829
|
+
"privacy": "private",
|
|
2830
|
+
"return": {
|
|
2831
|
+
"type": {
|
|
2832
|
+
"text": "void"
|
|
2833
|
+
}
|
|
2834
|
+
},
|
|
2835
|
+
"parameters": [
|
|
2836
|
+
{
|
|
2837
|
+
"name": "event",
|
|
2838
|
+
"type": {
|
|
2839
|
+
"text": "KeyboardEvent"
|
|
2840
|
+
}
|
|
2841
|
+
},
|
|
2842
|
+
{
|
|
2843
|
+
"name": "key",
|
|
2844
|
+
"type": {
|
|
2845
|
+
"text": "RowKey"
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
],
|
|
2849
|
+
"description": "Chevron keyboard activation. The element is a native `<button>`, so Enter\nalready fires `click` natively. We still handle it here to keep the\nkeyboard contract explicit and testable across environments where the\n`KeyboardEvent` is dispatched programmatically (Vitest browser mode tests\ndispatch raw `keydown`s without the synthesized `click`).\n\nFor Space we MUST call `preventDefault()` so the page does not scroll."
|
|
2850
|
+
},
|
|
2692
2851
|
{
|
|
2693
2852
|
"kind": "method",
|
|
2694
2853
|
"name": "toggleExpand",
|
|
2854
|
+
"return": {
|
|
2855
|
+
"type": {
|
|
2856
|
+
"text": "void"
|
|
2857
|
+
}
|
|
2858
|
+
},
|
|
2695
2859
|
"parameters": [
|
|
2696
2860
|
{
|
|
2697
|
-
"name": "
|
|
2861
|
+
"name": "target",
|
|
2698
2862
|
"type": {
|
|
2699
|
-
"text": "number"
|
|
2863
|
+
"text": "number | RowKey"
|
|
2700
2864
|
}
|
|
2701
2865
|
}
|
|
2702
2866
|
],
|
|
2703
|
-
"description": "Toggle expand state for a row
|
|
2867
|
+
"description": "Toggle expand state for a row.\nAccepts either a numeric `index` into `rows` or a `RowKey` (the value returned by `getRowKey`).\nWhen `getRowKey` is unset, indices and keys collapse onto `String(index)`."
|
|
2704
2868
|
},
|
|
2705
2869
|
{
|
|
2706
2870
|
"kind": "method",
|
|
@@ -2712,13 +2876,13 @@
|
|
|
2712
2876
|
},
|
|
2713
2877
|
"parameters": [
|
|
2714
2878
|
{
|
|
2715
|
-
"name": "
|
|
2879
|
+
"name": "key",
|
|
2716
2880
|
"type": {
|
|
2717
|
-
"text": "
|
|
2881
|
+
"text": "RowKey"
|
|
2718
2882
|
}
|
|
2719
2883
|
}
|
|
2720
2884
|
],
|
|
2721
|
-
"description": "Check whether a row
|
|
2885
|
+
"description": "Check whether a row with the given key is currently expanded."
|
|
2722
2886
|
},
|
|
2723
2887
|
{
|
|
2724
2888
|
"kind": "method",
|
|
@@ -2748,26 +2912,44 @@
|
|
|
2748
2912
|
},
|
|
2749
2913
|
{
|
|
2750
2914
|
"kind": "method",
|
|
2751
|
-
"name": "
|
|
2915
|
+
"name": "_getOrCreateHost",
|
|
2752
2916
|
"privacy": "private",
|
|
2917
|
+
"return": {
|
|
2918
|
+
"type": {
|
|
2919
|
+
"text": "HTMLElement"
|
|
2920
|
+
}
|
|
2921
|
+
},
|
|
2753
2922
|
"parameters": [
|
|
2754
2923
|
{
|
|
2755
|
-
"name": "
|
|
2924
|
+
"name": "key",
|
|
2756
2925
|
"type": {
|
|
2757
|
-
"text": "
|
|
2926
|
+
"text": "RowKey"
|
|
2758
2927
|
}
|
|
2759
|
-
}
|
|
2928
|
+
}
|
|
2929
|
+
]
|
|
2930
|
+
},
|
|
2931
|
+
{
|
|
2932
|
+
"kind": "method",
|
|
2933
|
+
"name": "_expandTdRef",
|
|
2934
|
+
"privacy": "private",
|
|
2935
|
+
"return": {
|
|
2936
|
+
"type": {
|
|
2937
|
+
"text": "(el: Element | undefined) => void"
|
|
2938
|
+
}
|
|
2939
|
+
},
|
|
2940
|
+
"parameters": [
|
|
2760
2941
|
{
|
|
2761
|
-
"name": "
|
|
2942
|
+
"name": "key",
|
|
2762
2943
|
"type": {
|
|
2763
|
-
"text": "
|
|
2944
|
+
"text": "RowKey"
|
|
2764
2945
|
}
|
|
2765
2946
|
}
|
|
2766
|
-
]
|
|
2947
|
+
],
|
|
2948
|
+
"description": "Return a STABLE ref callback for a given row key. Lit's `ref()` directive accepts a\ncallback `(el: Element | undefined) => void` directly, so no cast is needed. The callback\nis memoized per key to avoid churning Lit's ref directive on every render."
|
|
2767
2949
|
},
|
|
2768
2950
|
{
|
|
2769
2951
|
"kind": "method",
|
|
2770
|
-
"name": "
|
|
2952
|
+
"name": "_renderRow",
|
|
2771
2953
|
"privacy": "private",
|
|
2772
2954
|
"parameters": [
|
|
2773
2955
|
{
|
|
@@ -2781,8 +2963,52 @@
|
|
|
2781
2963
|
"type": {
|
|
2782
2964
|
"text": "number"
|
|
2783
2965
|
}
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
"name": "key",
|
|
2969
|
+
"type": {
|
|
2970
|
+
"text": "RowKey"
|
|
2971
|
+
}
|
|
2784
2972
|
}
|
|
2785
2973
|
]
|
|
2974
|
+
},
|
|
2975
|
+
{
|
|
2976
|
+
"kind": "field",
|
|
2977
|
+
"name": "_warnedLegacyApi",
|
|
2978
|
+
"type": {
|
|
2979
|
+
"text": "boolean"
|
|
2980
|
+
},
|
|
2981
|
+
"privacy": "private",
|
|
2982
|
+
"default": "false"
|
|
2983
|
+
},
|
|
2984
|
+
{
|
|
2985
|
+
"kind": "method",
|
|
2986
|
+
"name": "_safeCleanup",
|
|
2987
|
+
"privacy": "private",
|
|
2988
|
+
"return": {
|
|
2989
|
+
"type": {
|
|
2990
|
+
"text": "void"
|
|
2991
|
+
}
|
|
2992
|
+
},
|
|
2993
|
+
"parameters": [
|
|
2994
|
+
{
|
|
2995
|
+
"name": "key",
|
|
2996
|
+
"type": {
|
|
2997
|
+
"text": "RowKey"
|
|
2998
|
+
}
|
|
2999
|
+
}
|
|
3000
|
+
],
|
|
3001
|
+
"description": "Invoke the cached cleanup for a key, swallowing consumer errors so our own state\nmutation (`expandedRows`, host/cleanup/ref maps) and `emit` stay consistent even if\nthe consumer's cleanup throws. Deletes the cleanup entry after running."
|
|
3002
|
+
},
|
|
3003
|
+
{
|
|
3004
|
+
"kind": "method",
|
|
3005
|
+
"name": "_runAllCleanupsAndClear",
|
|
3006
|
+
"privacy": "private",
|
|
3007
|
+
"return": {
|
|
3008
|
+
"type": {
|
|
3009
|
+
"text": "void"
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
2786
3012
|
}
|
|
2787
3013
|
],
|
|
2788
3014
|
"events": [
|
|
@@ -2795,7 +3021,7 @@
|
|
|
2795
3021
|
"name": "reke-sort"
|
|
2796
3022
|
},
|
|
2797
3023
|
{
|
|
2798
|
-
"description": "Fired when a row is expanded or collapsed. Detail: `{ row: TableRow, index: number, expanded: boolean }`.",
|
|
3024
|
+
"description": "Fired when a row is expanded or collapsed. Detail: `{ row: TableRow, index: number, key: RowKey, expanded: boolean }`.",
|
|
2799
3025
|
"name": "reke-row-expand"
|
|
2800
3026
|
}
|
|
2801
3027
|
],
|
|
@@ -2840,6 +3066,24 @@
|
|
|
2840
3066
|
"default": "false",
|
|
2841
3067
|
"fieldName": "borderless"
|
|
2842
3068
|
},
|
|
3069
|
+
{
|
|
3070
|
+
"name": "expandable",
|
|
3071
|
+
"type": {
|
|
3072
|
+
"text": "boolean"
|
|
3073
|
+
},
|
|
3074
|
+
"default": "false",
|
|
3075
|
+
"description": "Opt-in: when `true`, the table prepends a leading toggle column whose\n`<button>` calls `toggleExpand(key)`, exposes `aria-expanded` reflecting\nthe expand state, `aria-controls` pointing at the expand `<td>` id\n(`reke-table-expand-<key>`), and accepts `Enter` / `Space` activation.\n\nDefaults to `false` so consumers that already wire their own toggles\n(chips, links, custom buttons) are unaffected.",
|
|
3076
|
+
"fieldName": "expandable"
|
|
3077
|
+
},
|
|
3078
|
+
{
|
|
3079
|
+
"name": "expand-on-row-click",
|
|
3080
|
+
"type": {
|
|
3081
|
+
"text": "boolean"
|
|
3082
|
+
},
|
|
3083
|
+
"default": "false",
|
|
3084
|
+
"description": "Opt-in: when `true`, clicking anywhere on a row (outside the chevron, if\npresent) calls `toggleExpand(key)` internally using the row's identity\nkey. The `reke-row-click` event is STILL emitted on every row click so\nconsumers can react in addition to the built-in toggle.\n\nDefault is `false` to preserve non-breaking behavior: existing consumers\nthat wire their own `reke-row-click` → `toggleExpand` handlers are\nunaffected.\n\nA11y note: row clicks are a pointer convenience only. The `<tr>` does NOT\nreceive `role=\"button\"` or `tabindex` (that would be a clickable-row\na11y anti-pattern). For keyboard / screen-reader users, pair this prop\nwith `expandable` so the accessible chevron `<button>` is available.\n\nDouble-wiring caveat: consumers MUST use EITHER `expandOnRowClick` OR\ntheir own `reke-row-click` → `toggleExpand` handler — not both — or the\nrow will toggle twice and net to no change.\n\nChevron interaction: the chevron `<button>` calls `stopPropagation()`, so\nclicking the chevron does NOT trigger the row-click toggle (no double\ntoggle).",
|
|
3085
|
+
"fieldName": "expandOnRowClick"
|
|
3086
|
+
},
|
|
2843
3087
|
{
|
|
2844
3088
|
"name": "sort-key",
|
|
2845
3089
|
"type": {
|
|
@@ -2863,7 +3107,7 @@
|
|
|
2863
3107
|
},
|
|
2864
3108
|
"tagName": "reke-table",
|
|
2865
3109
|
"customElement": true,
|
|
2866
|
-
"summary": "A data table with custom cell rendering, expandable rows, and toolbar/footer slots."
|
|
3110
|
+
"summary": "A data table with custom cell rendering, framework-agnostic expandable rows, and toolbar/footer slots."
|
|
2867
3111
|
}
|
|
2868
3112
|
],
|
|
2869
3113
|
"exports": [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-lit-in-public-types.d.ts","sourceRoot":"","sources":["../../src/__type-checks__/no-lit-in-public-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
|
|
2
|
+
function e(e, t, n, r) {
|
|
3
|
+
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
4
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
5
|
+
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
6
|
+
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { e as __decorate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-alert.d.ts","sourceRoot":"","sources":["../../../src/components/reke-alert/reke-alert.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpE;;;;;;;;;;;;;;;GAeG;AACH,qBACa,SAAU,SAAQ,WAAW;IACxC,OAAgB,MAAM,4BAAU;IAGhC,OAAO,EAAE,YAAY,CAAU;IAG/B,WAAW,UAAS;IAEpB,OAAO,CAAC,WAAW;IAKV,MAAM;
|
|
1
|
+
{"version":3,"file":"reke-alert.d.ts","sourceRoot":"","sources":["../../../src/components/reke-alert/reke-alert.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpE;;;;;;;;;;;;;;;GAeG;AACH,qBACa,SAAU,SAAQ,WAAW;IACxC,OAAgB,MAAM,4BAAU;IAGhC,OAAO,EAAE,YAAY,CAAU;IAG/B,WAAW,UAAS;IAEpB,OAAO,CAAC,WAAW;IAKV,MAAM;CA2BhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|