reke-ui 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +23 -0
  2. package/cli/install-skills.mjs +169 -0
  3. package/custom-elements.json +472 -128
  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 +45 -0
  9. package/dist/components/reke-alert/reke-alert.styles.d.ts.map +1 -1
  10. package/dist/components/reke-alert/reke-alert.styles.js +103 -0
  11. package/dist/components/reke-badge/reke-badge.d.ts +4 -2
  12. package/dist/components/reke-badge/reke-badge.d.ts.map +1 -1
  13. package/dist/components/reke-badge/reke-badge.js +30 -0
  14. package/dist/components/reke-badge/reke-badge.styles.d.ts.map +1 -1
  15. package/dist/components/reke-badge/reke-badge.styles.js +92 -0
  16. package/dist/components/reke-button/reke-button.d.ts.map +1 -1
  17. package/dist/components/reke-button/reke-button.js +53 -0
  18. package/dist/components/reke-button/reke-button.styles.d.ts.map +1 -1
  19. package/dist/components/reke-button/reke-button.styles.js +226 -0
  20. package/dist/components/reke-card/reke-card.d.ts +7 -0
  21. package/dist/components/reke-card/reke-card.d.ts.map +1 -1
  22. package/dist/components/reke-card/reke-card.js +50 -0
  23. package/dist/components/reke-card/reke-card.styles.d.ts.map +1 -1
  24. package/dist/components/reke-card/reke-card.styles.js +147 -0
  25. package/dist/components/reke-checkbox/reke-checkbox.js +57 -0
  26. package/dist/components/reke-checkbox/reke-checkbox.styles.d.ts.map +1 -1
  27. package/dist/components/reke-checkbox/reke-checkbox.styles.js +79 -0
  28. package/dist/components/reke-chip/reke-chip.d.ts.map +1 -1
  29. package/dist/components/reke-chip/reke-chip.js +62 -0
  30. package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
  31. package/dist/components/reke-chip/reke-chip.styles.js +128 -0
  32. package/dist/components/reke-date-range/reke-date-range.d.ts.map +1 -1
  33. package/dist/components/reke-date-range/reke-date-range.js +326 -0
  34. package/dist/components/reke-date-range/reke-date-range.styles.d.ts.map +1 -1
  35. package/dist/components/reke-date-range/reke-date-range.styles.js +335 -0
  36. package/dist/components/reke-dialog/reke-dialog.d.ts.map +1 -1
  37. package/dist/components/reke-dialog/reke-dialog.js +77 -0
  38. package/dist/components/reke-dialog/reke-dialog.styles.d.ts.map +1 -1
  39. package/dist/components/reke-dialog/reke-dialog.styles.js +132 -0
  40. package/dist/components/reke-file-upload/reke-file-upload.d.ts.map +1 -1
  41. package/dist/components/reke-file-upload/reke-file-upload.js +84 -0
  42. package/dist/components/reke-file-upload/reke-file-upload.styles.js +104 -0
  43. package/dist/components/reke-input/reke-input.js +54 -0
  44. package/dist/components/reke-input/reke-input.styles.d.ts.map +1 -1
  45. package/dist/components/reke-input/reke-input.styles.js +78 -0
  46. package/dist/components/reke-select/reke-select.d.ts.map +1 -1
  47. package/dist/components/reke-select/reke-select.js +89 -0
  48. package/dist/components/reke-select/reke-select.styles.d.ts.map +1 -1
  49. package/dist/components/reke-select/reke-select.styles.js +120 -0
  50. package/dist/components/reke-table/reke-table.d.ts +144 -13
  51. package/dist/components/reke-table/reke-table.d.ts.map +1 -1
  52. package/dist/components/reke-table/reke-table.js +291 -0
  53. package/dist/components/reke-table/reke-table.styles.d.ts.map +1 -1
  54. package/dist/components/reke-table/reke-table.styles.js +265 -0
  55. package/dist/components/reke-textarea/reke-textarea.js +54 -0
  56. package/dist/components/reke-textarea/reke-textarea.styles.js +73 -0
  57. package/dist/components/reke-toast/reke-toast.d.ts.map +1 -1
  58. package/dist/components/reke-toast/reke-toast.js +74 -0
  59. package/dist/components/reke-toast/reke-toast.styles.d.ts.map +1 -1
  60. package/dist/components/reke-toast/reke-toast.styles.js +183 -0
  61. package/dist/components/reke-toggle/reke-toggle.js +50 -0
  62. package/dist/components/reke-toggle/reke-toggle.styles.js +68 -0
  63. package/dist/components/reke-tooltip/reke-tooltip.js +51 -0
  64. package/dist/components/reke-tooltip/reke-tooltip.styles.js +64 -0
  65. package/dist/index.d.ts +23 -23
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +18 -0
  68. package/dist/node_modules/lit/directives/ref.js +1 -0
  69. package/dist/node_modules/lit-html/async-directive.js +55 -0
  70. package/dist/node_modules/lit-html/directive-helpers.js +5 -0
  71. package/dist/node_modules/lit-html/directive.js +28 -0
  72. package/dist/node_modules/lit-html/directives/ref.js +30 -0
  73. package/dist/node_modules/lit-html/lit-html.js +234 -0
  74. package/dist/react-bridge/table.d.ts +58 -0
  75. package/dist/react-bridge/table.d.ts.map +1 -0
  76. package/dist/react-bridge/table.js +115 -0
  77. package/dist/react.d.ts +12 -26
  78. package/dist/react.d.ts.map +1 -1
  79. package/dist/react.js +111 -132
  80. package/dist/shared/base-element.js +14 -0
  81. package/dist/shared/tailwind-styles.js +6 -0
  82. package/dist/shared/tailwind.js +4 -0
  83. package/dist/tokens/reke-tokens.css +70 -0
  84. package/package.json +43 -23
  85. package/dist/reke-chip-DexKxhxn.js +0 -3358
  86. package/dist/reke-ui.js +0 -20
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A Web Component library built with [Lit 3](https://lit.dev). Ships with dark and light themes. Framework-agnostic — works with Vue, React, Angular, Svelte, or vanilla JS.
4
4
 
5
+ **[Documentation](https://jreque.github.io/reke-ui/)** · **[Storybook](https://jreque.github.io/reke-ui/storybook/)**
6
+
5
7
  ## Components
6
8
 
7
9
  | Component | Tag | Description |
@@ -104,6 +106,8 @@ function App() {
104
106
  }
105
107
  ```
106
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
+
107
111
  ### Vanilla JS
108
112
 
109
113
  ```html
@@ -144,6 +148,25 @@ Override any CSS custom property to match your brand:
144
148
 
145
149
  See all available tokens in [`src/tokens/reke-tokens.css`](src/tokens/reke-tokens.css).
146
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
+
147
170
  ## Development
148
171
 
149
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
+ }