@roxyapi/ui-react 0.1.2 → 0.1.3

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 (151) hide show
  1. package/README.md +330 -29
  2. package/dist/components/biorhythm-chart.d.ts +8 -5
  3. package/dist/components/biorhythm-chart.d.ts.map +1 -1
  4. package/dist/components/biorhythm-chart.js +35 -9
  5. package/dist/components/biorhythm-chart.js.map +2 -2
  6. package/dist/components/compatibility-card.d.ts +8 -5
  7. package/dist/components/compatibility-card.d.ts.map +1 -1
  8. package/dist/components/compatibility-card.js +35 -9
  9. package/dist/components/compatibility-card.js.map +2 -2
  10. package/dist/components/dasha-timeline.d.ts +8 -5
  11. package/dist/components/dasha-timeline.d.ts.map +1 -1
  12. package/dist/components/dasha-timeline.js +35 -9
  13. package/dist/components/dasha-timeline.js.map +2 -2
  14. package/dist/components/data.d.ts +6 -4
  15. package/dist/components/data.d.ts.map +1 -1
  16. package/dist/components/data.js +35 -9
  17. package/dist/components/data.js.map +2 -2
  18. package/dist/components/dosha-card.d.ts +8 -5
  19. package/dist/components/dosha-card.d.ts.map +1 -1
  20. package/dist/components/dosha-card.js +35 -9
  21. package/dist/components/dosha-card.js.map +2 -2
  22. package/dist/components/endpoint-form.d.ts +20 -4
  23. package/dist/components/endpoint-form.d.ts.map +1 -1
  24. package/dist/components/endpoint-form.js +59 -9
  25. package/dist/components/endpoint-form.js.map +2 -2
  26. package/dist/components/guna-milan.d.ts +8 -5
  27. package/dist/components/guna-milan.d.ts.map +1 -1
  28. package/dist/components/guna-milan.js +35 -9
  29. package/dist/components/guna-milan.js.map +2 -2
  30. package/dist/components/hexagram.d.ts +8 -5
  31. package/dist/components/hexagram.d.ts.map +1 -1
  32. package/dist/components/hexagram.js +35 -9
  33. package/dist/components/hexagram.js.map +2 -2
  34. package/dist/components/horoscope-card.d.ts +8 -5
  35. package/dist/components/horoscope-card.d.ts.map +1 -1
  36. package/dist/components/horoscope-card.js +35 -9
  37. package/dist/components/horoscope-card.js.map +2 -2
  38. package/dist/components/kp-planets-table.d.ts +8 -5
  39. package/dist/components/kp-planets-table.d.ts.map +1 -1
  40. package/dist/components/kp-planets-table.js +35 -9
  41. package/dist/components/kp-planets-table.js.map +2 -2
  42. package/dist/components/location-search.d.ts +22 -4
  43. package/dist/components/location-search.d.ts.map +1 -1
  44. package/dist/components/location-search.js +51 -9
  45. package/dist/components/location-search.js.map +2 -2
  46. package/dist/components/moon-phase.d.ts +8 -5
  47. package/dist/components/moon-phase.d.ts.map +1 -1
  48. package/dist/components/moon-phase.js +35 -9
  49. package/dist/components/moon-phase.js.map +2 -2
  50. package/dist/components/natal-chart.d.ts +8 -5
  51. package/dist/components/natal-chart.d.ts.map +1 -1
  52. package/dist/components/natal-chart.js +35 -9
  53. package/dist/components/natal-chart.js.map +2 -2
  54. package/dist/components/numerology-card.d.ts +8 -5
  55. package/dist/components/numerology-card.d.ts.map +1 -1
  56. package/dist/components/numerology-card.js +35 -9
  57. package/dist/components/numerology-card.js.map +2 -2
  58. package/dist/components/panchang-table.d.ts +8 -5
  59. package/dist/components/panchang-table.d.ts.map +1 -1
  60. package/dist/components/panchang-table.js +35 -9
  61. package/dist/components/panchang-table.js.map +2 -2
  62. package/dist/components/synastry-chart.d.ts +15 -5
  63. package/dist/components/synastry-chart.d.ts.map +1 -1
  64. package/dist/components/synastry-chart.js +35 -9
  65. package/dist/components/synastry-chart.js.map +2 -2
  66. package/dist/components/tarot-card.d.ts +8 -5
  67. package/dist/components/tarot-card.d.ts.map +1 -1
  68. package/dist/components/tarot-card.js +35 -9
  69. package/dist/components/tarot-card.js.map +2 -2
  70. package/dist/components/tarot-spread.d.ts +8 -5
  71. package/dist/components/tarot-spread.d.ts.map +1 -1
  72. package/dist/components/tarot-spread.js +35 -9
  73. package/dist/components/tarot-spread.js.map +2 -2
  74. package/dist/components/vedic-kundli.d.ts +8 -5
  75. package/dist/components/vedic-kundli.d.ts.map +1 -1
  76. package/dist/components/vedic-kundli.js +35 -9
  77. package/dist/components/vedic-kundli.js.map +2 -2
  78. package/dist/index.cjs +545 -99
  79. package/dist/index.cjs.map +2 -2
  80. package/dist/index.d.ts +20 -20
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +545 -99
  83. package/dist/index.js.map +2 -2
  84. package/dist/load-ui.d.ts +2 -0
  85. package/dist/load-ui.d.ts.map +1 -1
  86. package/dist/load-ui.js +13 -4
  87. package/dist/load-ui.js.map +2 -2
  88. package/package.json +27 -7
  89. package/src/components/biorhythm-chart.d.ts +0 -12
  90. package/src/components/biorhythm-chart.d.ts.map +0 -1
  91. package/src/components/biorhythm-chart.tsx +0 -35
  92. package/src/components/compatibility-card.d.ts +0 -12
  93. package/src/components/compatibility-card.d.ts.map +0 -1
  94. package/src/components/compatibility-card.tsx +0 -35
  95. package/src/components/dasha-timeline.d.ts +0 -12
  96. package/src/components/dasha-timeline.d.ts.map +0 -1
  97. package/src/components/dasha-timeline.tsx +0 -35
  98. package/src/components/data.d.ts +0 -11
  99. package/src/components/data.d.ts.map +0 -1
  100. package/src/components/data.tsx +0 -35
  101. package/src/components/dosha-card.d.ts +0 -12
  102. package/src/components/dosha-card.d.ts.map +0 -1
  103. package/src/components/dosha-card.tsx +0 -35
  104. package/src/components/endpoint-form.d.ts +0 -12
  105. package/src/components/endpoint-form.d.ts.map +0 -1
  106. package/src/components/endpoint-form.tsx +0 -35
  107. package/src/components/guna-milan.d.ts +0 -12
  108. package/src/components/guna-milan.d.ts.map +0 -1
  109. package/src/components/guna-milan.tsx +0 -35
  110. package/src/components/hexagram.d.ts +0 -12
  111. package/src/components/hexagram.d.ts.map +0 -1
  112. package/src/components/hexagram.tsx +0 -35
  113. package/src/components/horoscope-card.d.ts +0 -12
  114. package/src/components/horoscope-card.d.ts.map +0 -1
  115. package/src/components/horoscope-card.tsx +0 -35
  116. package/src/components/kp-planets-table.d.ts +0 -12
  117. package/src/components/kp-planets-table.d.ts.map +0 -1
  118. package/src/components/kp-planets-table.tsx +0 -35
  119. package/src/components/location-search.d.ts +0 -12
  120. package/src/components/location-search.d.ts.map +0 -1
  121. package/src/components/location-search.tsx +0 -35
  122. package/src/components/moon-phase.d.ts +0 -12
  123. package/src/components/moon-phase.d.ts.map +0 -1
  124. package/src/components/moon-phase.tsx +0 -35
  125. package/src/components/natal-chart.d.ts +0 -12
  126. package/src/components/natal-chart.d.ts.map +0 -1
  127. package/src/components/natal-chart.tsx +0 -35
  128. package/src/components/numerology-card.d.ts +0 -12
  129. package/src/components/numerology-card.d.ts.map +0 -1
  130. package/src/components/numerology-card.tsx +0 -35
  131. package/src/components/panchang-table.d.ts +0 -12
  132. package/src/components/panchang-table.d.ts.map +0 -1
  133. package/src/components/panchang-table.tsx +0 -35
  134. package/src/components/synastry-chart.d.ts +0 -12
  135. package/src/components/synastry-chart.d.ts.map +0 -1
  136. package/src/components/synastry-chart.tsx +0 -35
  137. package/src/components/tarot-card.d.ts +0 -12
  138. package/src/components/tarot-card.d.ts.map +0 -1
  139. package/src/components/tarot-card.tsx +0 -35
  140. package/src/components/tarot-spread.d.ts +0 -12
  141. package/src/components/tarot-spread.d.ts.map +0 -1
  142. package/src/components/tarot-spread.tsx +0 -35
  143. package/src/components/vedic-kundli.d.ts +0 -12
  144. package/src/components/vedic-kundli.d.ts.map +0 -1
  145. package/src/components/vedic-kundli.tsx +0 -35
  146. package/src/index.d.ts +0 -21
  147. package/src/index.d.ts.map +0 -1
  148. package/src/index.ts +0 -20
  149. package/src/load-ui.d.ts +0 -2
  150. package/src/load-ui.d.ts.map +0 -1
  151. package/src/load-ui.ts +0 -41
package/README.md CHANGED
@@ -1,17 +1,131 @@
1
1
  <p align="center">
2
2
  <a href="https://roxyapi.com/ui">
3
- <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/banner.png" alt="Roxy UI. Beautiful spiritual components in 30 minutes." width="100%">
3
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/banner.png" alt="Roxy UI: complete UI library for astrology, vedic, tarot, and more" width="100%">
4
4
  </a>
5
5
  </p>
6
6
 
7
7
  # @roxyapi/ui
8
8
 
9
9
  [![npm](https://img.shields.io/npm/v/@roxyapi/ui)](https://www.npmjs.com/package/@roxyapi/ui)
10
+ [![Live preview](https://img.shields.io/badge/live%20preview-roxyapi.github.io%2Fui-7c3aed?logo=github)](https://roxyapi.github.io/ui/)
10
11
  [![Docs](https://img.shields.io/badge/docs-roxyapi.com-blue)](https://roxyapi.com/ui)
11
12
  [![API Reference](https://img.shields.io/badge/api%20reference-roxyapi.com-blue)](https://roxyapi.com/api-reference)
12
13
  [![Pricing](https://img.shields.io/badge/pricing-roxyapi.com-blue)](https://roxyapi.com/pricing)
14
+ [![License](https://img.shields.io/npm/l/@roxyapi/ui)](LICENSE)
15
+
16
+ > Live demo: **<https://roxyapi.github.io/ui/>**. Every component rendered against real API responses, light + dark, with the React/shadcn install command per card.
17
+
18
+ Web components for the RoxyAPI catalog. Drop astrology, tarot, numerology, and every other RoxyAPI domain into any framework with one script tag or one npm install. Stateless components, typed responses, theme-agnostic. Beautiful defaults out of the box; the look is yours after that.
19
+
20
+ ## Theme-agnostic, every component
21
+
22
+ Light, dark, your brand. Override one CSS variable and every component updates. No class overrides, no rebuild, no Tailwind required. Customize live at <https://roxyapi.github.io/ui/> using the **Customize** dialog (every token, color picker, copy-paste snippet) or write your own variables on `:root`.
23
+
24
+ <table>
25
+ <tr>
26
+ <th width="50%" align="center">Light</th>
27
+ <th width="50%" align="center">Dark</th>
28
+ </tr>
29
+ <tr>
30
+ <td width="50%" align="center">
31
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/natal-chart-light.png" alt="Natal chart, light mode">
32
+ </td>
33
+ <td width="50%" align="center">
34
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/natal-chart-dark.png" alt="Natal chart, dark mode">
35
+ </td>
36
+ </tr>
37
+ <tr>
38
+ <td width="50%" align="center">
39
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/vedic-kundli-light.png" alt="Vedic kundli, light mode">
40
+ </td>
41
+ <td width="50%" align="center">
42
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/vedic-kundli-dark.png" alt="Vedic kundli, dark mode">
43
+ </td>
44
+ </tr>
45
+ </table>
13
46
 
14
- Web components for the RoxyAPI catalog. Drop astrology, tarot, numerology, and every other RoxyAPI domain into any framework with one script tag or one npm install. Stateless components, typed responses, beautiful defaults in 30 minutes.
47
+ ```css
48
+ :root {
49
+ /* Surface */
50
+ --roxy-bg: #fafafa;
51
+ --roxy-fg: #0a0a0a;
52
+ --roxy-muted: #71717a;
53
+ --roxy-border: #e4e4e7;
54
+
55
+ /* Brand */
56
+ --roxy-accent: #f59e0b;
57
+ --roxy-accent-fg: #b45309;
58
+
59
+ /* Status (each has a -fg variant for WCAG-AA text contrast) */
60
+ --roxy-success: #16a34a;
61
+ --roxy-warning: #f59e0b;
62
+ --roxy-danger: #dc2626;
63
+ --roxy-info: #2563eb;
64
+
65
+ /* Shape + motion */
66
+ --roxy-radius-md: 12px;
67
+ --roxy-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
68
+ --roxy-motion-duration: 200ms; /* 0ms when prefers-reduced-motion */
69
+ }
70
+
71
+ [data-theme="dark"] {
72
+ --roxy-bg: #0a0a0a;
73
+ --roxy-fg: #fafafa;
74
+ --roxy-muted: #a1a1aa;
75
+ --roxy-border: #27272a;
76
+ }
77
+ ```
78
+
79
+ Pick a tone, set the vars, every chart and card follows. Full token reference at [THEMING.md](https://github.com/RoxyAPI/ui/blob/main/packages/ui/THEMING.md). Live tweaker on the [demo site](https://roxyapi.github.io/ui/).
80
+
81
+ ## Gallery (chart-heavy components)
82
+
83
+ <table>
84
+ <tr>
85
+ <td width="50%"><strong>Synastry</strong> · <code>&lt;roxy-synastry-chart&gt;</code><br><sub>POST /astrology/synastry</sub><br>
86
+ <picture>
87
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/synastry-chart-dark.png">
88
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/synastry-chart-light.png" alt="Synastry dual-wheel with inter-aspects">
89
+ </picture>
90
+ </td>
91
+ <td width="50%"><strong>Moon phase</strong> · <code>&lt;roxy-moon-phase&gt;</code><br><sub>GET /astrology/moon-phase/&lbrace;current,upcoming,calendar&rbrace;</sub><br>
92
+ <picture>
93
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/moon-phase-dark.png">
94
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/moon-phase-light.png" alt="Moon phase card with illumination and age">
95
+ </picture>
96
+ </td>
97
+ </tr>
98
+ <tr>
99
+ <td width="50%"><strong>Biorhythm</strong> · <code>&lt;roxy-biorhythm-chart&gt;</code><br><sub>POST /biorhythm/&lbrace;daily,forecast,critical-days&rbrace;</sub><br>
100
+ <picture>
101
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/biorhythm-chart-dark.png">
102
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/biorhythm-chart-light.png" alt="Biorhythm physical, emotional, intellectual cycle bars">
103
+ </picture>
104
+ </td>
105
+ <td width="50%"><strong>I Ching hexagram</strong> · <code>&lt;roxy-hexagram&gt;</code><br><sub>GET /iching/hexagrams/&lbrace;number&rbrace;, /iching/cast</sub><br>
106
+ <picture>
107
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/hexagram-dark.png">
108
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/hexagram-light.png" alt="I Ching hexagram with trigrams and judgment">
109
+ </picture>
110
+ </td>
111
+ </tr>
112
+ <tr>
113
+ <td width="50%"><strong>Dasha timeline</strong> · <code>&lt;roxy-dasha-timeline&gt;</code><br><sub>POST /vedic-astrology/dasha/&lbrace;current,major,sub&rbrace;</sub><br>
114
+ <picture>
115
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/dasha-timeline-dark.png">
116
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/dasha-timeline-light.png" alt="Vimshottari dasha mahadasha and antardasha timeline">
117
+ </picture>
118
+ </td>
119
+ <td width="50%"><strong>Tarot spread</strong> · <code>&lt;roxy-tarot-spread&gt;</code><br><sub>POST /tarot/spreads/&lbrace;three-card,celtic-cross,love&rbrace;</sub><br>
120
+ <picture>
121
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/tarot-spread-dark.png">
122
+ <img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/tarot-spread-light.png" alt="Tarot spread with three-card layout and reading">
123
+ </picture>
124
+ </td>
125
+ </tr>
126
+ </table>
127
+
128
+ Tables, cards, forms, and helper components in the [live demo](https://roxyapi.github.io/ui/).
15
129
 
16
130
  ## Why developers use Roxy UI
17
131
 
@@ -34,7 +148,7 @@ Vanilla HTML. Three lines. No build step.
34
148
  ></script>
35
149
  <roxy-natal-chart id="chart"></roxy-natal-chart>
36
150
  <script type="module">
37
- import { createRoxy } from 'https://cdn.jsdelivr.net/npm/@roxyapi/sdk@1/dist/factory.js';
151
+ import { createRoxy } from 'https://cdn.jsdelivr.net/npm/@roxyapi/sdk@latest/dist/factory.js';
38
152
  const roxy = createRoxy(import.meta.env?.ROXY_API_KEY);
39
153
  const { data } = await roxy.astrology.generateNatalChart({
40
154
  body: { date: '1990-01-15', time: '14:30:00', latitude: 28.6139, longitude: 77.209, timezone: 5.5 },
@@ -48,24 +162,12 @@ Then add the kundli, the panchang, the dasha timeline, the tarot spread.
48
162
  ## Install
49
163
 
50
164
  ```bash
51
- npm install @roxyapi/ui
52
- # or
53
- bun add @roxyapi/ui
54
- ```
55
-
56
- ```ts
57
- import '@roxyapi/ui';
58
- // or per component
59
- import '@roxyapi/ui/components/natal-chart';
60
- ```
61
-
62
- React users get a typed package with the same components.
63
-
64
- ```bash
65
- npm install @roxyapi/ui-react
165
+ npm install @roxyapi/ui-react @roxyapi/sdk
66
166
  ```
67
167
 
68
168
  ```tsx
169
+ 'use client';
170
+
69
171
  import { RoxyNatalChart } from '@roxyapi/ui-react';
70
172
 
71
173
  export function Chart({ data }: { data: NatalChart }) {
@@ -73,6 +175,12 @@ export function Chart({ data }: { data: NatalChart }) {
73
175
  }
74
176
  ```
75
177
 
178
+ For frameworks that consume custom elements directly (Vue, Svelte, Angular, Solid, vanilla HTML, WordPress) install `@roxyapi/ui` instead.
179
+
180
+ ```bash
181
+ npm install @roxyapi/ui
182
+ ```
183
+
76
184
  ## Quick start
77
185
 
78
186
  ```ts
@@ -93,18 +201,29 @@ document.querySelector('roxy-vedic-kundli')!.data = kundli;
93
201
 
94
202
  Always call `/location/search` first. Every chart endpoint expects latitude, longitude, and timezone.
95
203
 
204
+ > **Timezone format.** RoxyAPI accepts both forms: a decimal-hour offset (`5.5` for IST, `-5` for EST) or an IANA name (`'Asia/Kolkata'`, `'America/New_York'`). Pick one and stay consistent. The decimal form is shorter and what `/location/search` returns; examples on this page use it. The IANA form is correct over DST boundaries when historical accuracy matters.
205
+
206
+ ## API keys
207
+
208
+ Get keys at <https://roxyapi.com/account>.
209
+
210
+ - **Secret key** (server-side only). Use in Node, Bun, Hono, Next.js route handlers, Workers. Never commit, never ship in client bundles.
211
+ - **Publishable key** (`pk_live_*` / `pk_test_*`). Safe in browsers, locked to the origins you register on the key. Use with the widgets auto-mount script for WordPress, Shopify, static HTML, embed scenarios. The API gateway rejects requests from any origin not on the key's allowlist.
212
+
213
+ For the SDK examples on this page, set `ROXY_API_KEY` to a secret key in your server env. For the widgets auto-mount path (`data-publishable-key="pk_live_xxx"`), use a publishable key with your site's domain registered.
214
+
96
215
  ## Distribution
97
216
 
98
217
  | Surface | URL |
99
218
  |---|---|
100
219
  | npm `@roxyapi/ui` | `npmjs.com/package/@roxyapi/ui` |
101
220
  | npm `@roxyapi/ui-react` | `npmjs.com/package/@roxyapi/ui-react` |
102
- | jsdelivr full UMD | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js` |
103
- | jsdelivr per-component UMD | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/components/{name}.js` |
221
+ | jsDelivr CDN (full bundle) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js` |
222
+ | jsDelivr CDN (per component) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/components/{name}.js` |
104
223
  | Widgets auto-mount | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/widgets.js` |
105
- | shadcn registry | `bunx shadcn add https://cdn.jsdelivr.net/gh/RoxyAPI/ui@main/registry/{name}.json` |
224
+ | shadcn registry | `npx shadcn@latest add https://cdn.jsdelivr.net/gh/RoxyAPI/ui@v0.1.2/registry/{name}.json` |
106
225
 
107
- ## Phase 1 components
226
+ ## Components
108
227
 
109
228
  <!-- BEGIN:COMPONENTS -->
110
229
  | Element | Domain | Endpoint(s) | What it renders |
@@ -139,11 +258,10 @@ Always call `/location/search` first. Every chart endpoint expects latitude, lon
139
258
  - Numerology calculators with full-chart breakdowns and personal year forecasts.
140
259
  - Biorhythm dashboards with critical-day alerts.
141
260
  - I Ching apps with hexagram lookup and three-coin casting.
142
- - Founder hosted-app surfaces consuming the same components under brand themes.
143
261
 
144
262
  ## Theming
145
263
 
146
- Every component reads from `--roxy-*` CSS custom properties. Override globally on `:root` or per element. Light + dark defaults, container queries for responsive layouts at 320px and up. See [THEMING.md](packages/ui/THEMING.md) for the full token reference.
264
+ Every component reads from `--roxy-*` CSS custom properties. Override globally on `:root` or per element. Light + dark defaults, container queries for responsive layouts at 320px and up. See [THEMING.md](https://github.com/RoxyAPI/ui/blob/main/packages/ui/THEMING.md) for the full token reference.
147
265
 
148
266
  ```css
149
267
  :root {
@@ -167,10 +285,13 @@ roxy-natal-chart {
167
285
 
168
286
  ## Built for AI agents
169
287
 
170
- - Works with Claude Code, Cursor, Copilot, Codex, Gemini CLI.
171
- - Ships with `AGENTS.md` so agents know which component to render for which response.
172
- - Combines with the `@roxyapi/sdk` for typed prop shapes that match the OpenAPI spec.
173
- - Remote MCP servers per domain at `roxyapi.com/mcp/{domain}`. No local setup, runs in seconds.
288
+ [`AGENTS.md`](AGENTS.md) is bundled inside both npm packages. Once installed, agents can read it from `node_modules/@roxyapi/ui/AGENTS.md` (or `@roxyapi/ui-react/AGENTS.md`) for the component decision tree, integration patterns, and rules.
289
+
290
+ - Works with Claude Code, Cursor, Copilot, Codex, Gemini CLI, and any MCP-compatible client.
291
+ - Component decision tree maps each RoxyAPI endpoint to the component that renders its response.
292
+ - Typed prop shapes derive from the OpenAPI spec. The SDK at `@roxyapi/sdk` returns shapes that flow straight into `data`. No field renames, no glue code.
293
+ - Remote MCP servers per domain at `roxyapi.com/mcp/{domain}`. No local setup. JSON tool-call responses feed straight into the matching component.
294
+ - Use cases agents handle in one prompt: birth chart from city + DOB, daily tarot embed, Vedic kundli matching, numerology life-path card, biorhythm dashboard, daily horoscope by sign, panchang for the day, I Ching three-coin cast.
174
295
 
175
296
  ## Build anything, fast
176
297
 
@@ -183,7 +304,187 @@ bun run preview
183
304
  # http://localhost:3001
184
305
  ```
185
306
 
186
- Three steps. Thirty minutes. See [examples](examples/) for a full vanilla HTML, React, Vue, and WordPress integration.
307
+ Local preview serves `apps/docs/` on port 3001. Same directory and same paths the live demo at <https://roxyapi.github.io/ui/> serves. See [examples](examples/) for vanilla HTML, React, Vue, and WordPress.
308
+
309
+ ## Stack and integrations
310
+
311
+ Roxy UI runs in any framework that supports the DOM: **React, Next.js, Vue, Svelte, Angular, Solid, Astro, Qwik, Hono, Remix, Nuxt, SvelteKit, Lit, plain HTML, WordPress, Shopify themes that allow custom code, and any MCP-compatible AI agent**. Distribution paths: npm, jsDelivr CDN, shadcn registry. Use cases: astrology widgets, kundli matching, daily horoscope, tarot reader, numerology calculator, biorhythm dashboard, I Ching cast, panchang almanac, dasha timeline, moon phase tracker, synastry compatibility, dosha checker.
312
+
313
+ ## FAQ
314
+
315
+ <details>
316
+ <summary><strong>How big is each component? What is the bundle cost?</strong></summary>
317
+
318
+ Per-component bundles run 8-10 KB gzipped, capped at 30 KB by CI. The full bundle (every component, helpers, base styles) is around 26 KB gzipped, capped at 150 KB. The React package loads the runtime on mount, so a route that renders one chart pays for one component, not the whole catalog. Pin a concrete version in production for byte-stable cache hits.
319
+ </details>
320
+
321
+ <details>
322
+ <summary><strong>Does this work with Next.js App Router, Remix, Nuxt, SvelteKit, and Astro?</strong></summary>
323
+
324
+ Yes. The components are standard custom elements; any framework that touches the DOM can mount them. For SSR/RSC frameworks, fetch on the server, pass the response to a client island. Next.js App Router pattern:
325
+
326
+ ```tsx
327
+ // app/page.tsx (Server Component)
328
+ import { createRoxy } from '@roxyapi/sdk';
329
+ import ChartView from './chart-view';
330
+
331
+ const roxy = createRoxy(process.env.ROXY_API_KEY!);
332
+
333
+ export default async function Page() {
334
+ const { data } = await roxy.astrology.generateNatalChart({
335
+ body: { date: '1990-01-15', time: '14:30:00', latitude: 28.6139, longitude: 77.209, timezone: 5.5 },
336
+ });
337
+ return <ChartView data={data} />;
338
+ }
339
+ ```
340
+
341
+ ```tsx
342
+ // app/chart-view.tsx (Client Component)
343
+ 'use client';
344
+ import { RoxyNatalChart } from '@roxyapi/ui-react';
345
+
346
+ export default function ChartView({ data }: { data: unknown }) {
347
+ return <RoxyNatalChart data={data} />;
348
+ }
349
+ ```
350
+
351
+ The server component fetches, the client component renders. The API key never crosses the network. Same shape works in Remix loaders, Nuxt server routes, SvelteKit `+page.server.ts`, and Astro server endpoints.
352
+ </details>
353
+
354
+ <details>
355
+ <summary><strong>Tailwind v3 vs v4 compatibility?</strong></summary>
356
+
357
+ Both work. Components do not consume Tailwind utilities. Tailwind utilities apply outside the components on wrappers and containers; inside the Shadow DOM, components read `--roxy-*` CSS custom properties only.
358
+
359
+ For Tailwind v4 users, the shadcn registry installs a CSS bridge that maps your existing v4 design tokens onto `--roxy-*`. For Tailwind v3 users, set `--roxy-*` directly on `:root`, or write a tiny bridge:
360
+
361
+ ```css
362
+ :root {
363
+ --roxy-bg: theme(colors.background);
364
+ --roxy-fg: theme(colors.foreground);
365
+ --roxy-accent: theme(colors.primary.DEFAULT);
366
+ --roxy-border: theme(colors.border);
367
+ }
368
+ ```
369
+ </details>
370
+
371
+ <details>
372
+ <summary><strong>How do React 17/18 vs 19 differ for custom-event handling?</strong></summary>
373
+
374
+ React 19 routes hyphenated DOM events through camelCase props or lowercase attributes correctly, so `<RoxyLocationSearch onroxy-location-select={...}>` works as expected.
375
+
376
+ For React 17 and 18, use a ref plus `addEventListener` in `useEffect`:
377
+
378
+ ```tsx
379
+ const ref = useRef<HTMLElement>(null);
380
+ useEffect(() => {
381
+ const el = ref.current;
382
+ if (!el) return;
383
+ const handler = (e: Event) => console.log((e as CustomEvent).detail);
384
+ el.addEventListener('roxy-location-select', handler);
385
+ return () => el.removeEventListener('roxy-location-select', handler);
386
+ }, []);
387
+
388
+ return <roxy-location-search ref={ref} />;
389
+ ```
390
+
391
+ Upgrade to React 19 when you can; the wrappers route everything cleanly.
392
+ </details>
393
+
394
+ <details>
395
+ <summary><strong>Browser support matrix?</strong></summary>
396
+
397
+ Chrome 120+, Firefox 120+, Safari 17+, Edge 120+. The floor is set by ES modules, Custom Elements v1, Shadow DOM v1, container queries, and `color-mix()`. No polyfills shipped; older browsers fail loud rather than degrade silently. This covers ~95% of global traffic per Can I Use.
398
+ </details>
399
+
400
+ <details>
401
+ <summary><strong>Are the TypeScript types reliable?</strong></summary>
402
+
403
+ Yes. Component prop types are regenerated from the OpenAPI spec on every release via `@hey-api/openapi-ts`. Spec change in the API translates to typed change at the component boundary. There are no hand-written response shapes inside components, so types cannot drift from what the API returns. The SDK at `@roxyapi/sdk` shares the same type pipeline.
404
+ </details>
405
+
406
+ <details>
407
+ <summary><strong>What is the accessibility story?</strong></summary>
408
+
409
+ WAI-ARIA 1.2 throughout. Keyboard navigation on every interactive surface. Focus rings honor `--roxy-ring`. `prefers-reduced-motion: reduce` pins `--roxy-motion-duration` to `0ms` and disables entry animations. Color contrast hits WCAG AA at the defaults; verify any custom palette before shipping. CI runs axe-core against every component; zero blocking violations is a build gate.
410
+ </details>
411
+
412
+ <details>
413
+ <summary><strong>Why can my Tailwind classes not reach the chart inside the component?</strong></summary>
414
+
415
+ Components ship in Shadow DOM for style isolation; Tailwind utilities are scoped to the page tree and stop at the shadow boundary. This is by design: customer styles cannot accidentally bleed into a chart, and component styles cannot leak out. Theme through `--roxy-*` custom properties (they pierce the shadow boundary) on `:root` or per element.
416
+ </details>
417
+
418
+ <details>
419
+ <summary><strong>What is the security model for API keys?</strong></summary>
420
+
421
+ Two key classes. Secret keys (unprefixed) live server-side only and grant full access. Publishable keys (`pk_live_*` / `pk_test_*`) are browser-safe and locked to an origin allowlist registered on the key. The API gateway rejects requests from any other origin and counts the failed attempt against the rate limit, so a stolen key cannot be brute-fired from elsewhere.
422
+
423
+ For CSP, allow `script-src https://cdn.jsdelivr.net` if loading the bundle from the CDN. Subresource Integrity hashes are available via the jsDelivr SRI API for any pinned version.
424
+ </details>
425
+
426
+ <details>
427
+ <summary><strong>How does versioning work?</strong></summary>
428
+
429
+ Semver. Pre-1.0, minor bumps may include breaking changes (we will note them in the changelog). Patch bumps are always backwards-compatible. Pin a concrete version in production code:
430
+
431
+ ```bash
432
+ npm install @roxyapi/ui@0.1.x
433
+ ```
434
+
435
+ ```html
436
+ <script src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.1.5/dist/cdn/roxy-ui.js"></script>
437
+ ```
438
+
439
+ The `@latest` URL on this page is for paste-friendly marketing; production code should pin.
440
+ </details>
441
+
442
+ <details>
443
+ <summary><strong>How do I test components in my app?</strong></summary>
444
+
445
+ Mock `@roxyapi/sdk` at the network boundary so unit tests do not hit the live API. Snapshot the Shadow DOM output for visual stability. End-to-end with Playwright works well; the components emit semantic ARIA roles, so locators are stable across releases.
446
+ </details>
447
+
448
+ <details>
449
+ <summary><strong>What if I want to fork or own a component?</strong></summary>
450
+
451
+ Use the shadcn registry. The registry drops the component source, a wrapper file, and a CSS theme bridge into your repo. Edit anything; the source is yours from that point.
452
+
453
+ ```bash
454
+ npx shadcn@latest add https://cdn.jsdelivr.net/gh/RoxyAPI/ui@v0.1.2/registry/natal-chart.json
455
+ ```
456
+ </details>
457
+
458
+ <details>
459
+ <summary><strong>What if I need an endpoint that has no dedicated component?</strong></summary>
460
+
461
+ Use `<roxy-data>`. It is the generic fallback renderer; pass any RoxyAPI response and it produces a structured layout (tables, lists, badges) without bespoke logic. New endpoints render automatically; bespoke components ship only when a novel pattern emerges.
462
+ </details>
463
+
464
+ <details>
465
+ <summary><strong>Does this integrate with MCP-aware AI agents?</strong></summary>
466
+
467
+ Yes. RoxyAPI hosts a remote MCP server per domain at `roxyapi.com/mcp/{domain}`. Configure once, render anywhere:
468
+
469
+ ```json
470
+ {
471
+ "mcpServers": {
472
+ "roxy-astrology": {
473
+ "url": "https://roxyapi.com/mcp/astrology",
474
+ "headers": { "Authorization": "Bearer <your-secret-key>" }
475
+ }
476
+ }
477
+ }
478
+ ```
479
+
480
+ Tool-call JSON has the same shape as the SDK response. Pass it straight into the matching component.
481
+ </details>
482
+
483
+ <details>
484
+ <summary><strong>License and contribution?</strong></summary>
485
+
486
+ MIT. Source on [GitHub](https://github.com/RoxyAPI/ui). Open an issue or pull request for bugs and ideas. The component manifest is data-driven, so most additions are spec changes upstream rather than UI repo edits.
487
+ </details>
187
488
 
188
489
  ## License
189
490
 
@@ -1,9 +1,12 @@
1
1
  import * as React from 'react';
2
- type DivAttrs = React.HTMLAttributes<HTMLElement>;
3
- export interface RoxyBiorhythmChartProps extends Omit<DivAttrs, 'children' | 'onSelect'> {
4
- data?: unknown;
5
- [attr: string]: unknown;
2
+ import type { GetCriticalDaysResponse, GetDailyBiorhythmResponse, GetForecastResponse } from '@roxyapi/ui/types';
3
+ type ElementAttrs = Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'data'>;
4
+ export interface RoxyBiorhythmChartProps extends ElementAttrs {
5
+ /** Spec-derived response payload. Pass the raw RoxyAPI response. */
6
+ data?: GetDailyBiorhythmResponse | GetForecastResponse | GetCriticalDaysResponse;
7
+ className?: string;
8
+ style?: React.CSSProperties;
6
9
  }
7
- export declare const RoxyBiorhythmChart: React.ForwardRefExoticComponent<Omit<RoxyBiorhythmChartProps, "ref"> & React.RefAttributes<HTMLElement>>;
10
+ export declare const RoxyBiorhythmChart: React.ForwardRefExoticComponent<RoxyBiorhythmChartProps & React.RefAttributes<HTMLElement | null>>;
8
11
  export {};
9
12
  //# sourceMappingURL=biorhythm-chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"biorhythm-chart.d.ts","sourceRoot":"","sources":["../../src/components/biorhythm-chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,QAAQ,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AAElD,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;IACvF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,0GAwB9B,CAAC"}
1
+ {"version":3,"file":"biorhythm-chart.d.ts","sourceRoot":"","sources":["../../src/components/biorhythm-chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEjH,KAAK,YAAY,GAAG,IAAI,CACvB,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,UAAU,GAAG,MAAM,CACnB,CAAC;AAEF,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC5D,oEAAoE;IACpE,IAAI,CAAC,EAAE,yBAAyB,GAAG,mBAAmB,GAAG,uBAAuB,CAAC;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAE5B;AAED,eAAO,MAAM,kBAAkB,oGAgD9B,CAAC"}
@@ -3,14 +3,19 @@ import * as React from "react";
3
3
 
4
4
  // packages/ui-react/src/load-ui.ts
5
5
  var SCRIPT_ID = "roxyapi-ui-loader";
6
- var CDN_BASE = "https://cdn.jsdelivr.net/npm/@roxyapi/ui@0/dist/cdn";
6
+ var CDN_BASE_LATEST = "https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn";
7
+ var CDN_BASE_PREFIX = "https://cdn.jsdelivr.net/npm/@roxyapi/ui@";
8
+ var CDN_BASE_SUFFIX = "/dist/cdn";
7
9
  var loaded = null;
8
- function ensureScriptLoaded(version = "0.1.0") {
10
+ function buildBase(version) {
11
+ if (!version || version === "latest") return CDN_BASE_LATEST;
12
+ return `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;
13
+ }
14
+ function ensureScriptLoaded(version = "latest") {
9
15
  if (typeof document === "undefined") return Promise.resolve();
10
16
  if (loaded) return loaded;
11
17
  loaded = new Promise((resolve, reject) => {
12
- const major = version.split(".")[0];
13
- const url = `${CDN_BASE.replace("@0", "@" + major)}/roxy-ui.js`;
18
+ const url = `${buildBase(version)}/roxy-ui.js`;
14
19
  let existing = document.getElementById(SCRIPT_ID);
15
20
  if (existing) {
16
21
  if (existing.dataset.loaded === "true") {
@@ -38,25 +43,46 @@ function ensureScriptLoaded(version = "0.1.0") {
38
43
 
39
44
  // packages/ui-react/src/components/biorhythm-chart.tsx
40
45
  var RoxyBiorhythmChart = React.forwardRef(
41
- function RoxyBiorhythmChart2({ data, ...rest }, ref) {
46
+ function RoxyBiorhythmChart2({ data, className, style, ...rest }, ref) {
42
47
  const internal = React.useRef(null);
43
- React.useImperativeHandle(ref, () => internal.current);
48
+ React.useImperativeHandle(
49
+ ref,
50
+ () => internal.current,
51
+ []
52
+ );
44
53
  const [loaded2, setLoaded] = React.useState(false);
54
+ const [error, setError] = React.useState(null);
45
55
  React.useEffect(() => {
46
56
  let active = true;
47
57
  ensureScriptLoaded().then(() => {
48
58
  if (active) setLoaded(true);
59
+ }).catch((err) => {
60
+ if (!active) return;
61
+ setError(err instanceof Error ? err : new Error(String(err)));
49
62
  });
50
63
  return () => {
51
64
  active = false;
52
65
  };
53
66
  }, []);
54
67
  React.useEffect(() => {
55
- if (internal.current && data !== void 0) {
56
- internal.current.data = data;
68
+ const el = internal.current;
69
+ if (el && data !== void 0) {
70
+ el.data = data;
57
71
  }
58
72
  }, [data, loaded2]);
59
- return React.createElement("roxy-biorhythm-chart", { ref: internal, ...rest });
73
+ if (error) {
74
+ return React.createElement(
75
+ "div",
76
+ { role: "alert", className, style },
77
+ `Roxy UI script load failed: ${error.message}`
78
+ );
79
+ }
80
+ return React.createElement("roxy-biorhythm-chart", {
81
+ ref: internal,
82
+ className,
83
+ style,
84
+ ...rest
85
+ });
60
86
  }
61
87
  );
62
88
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/biorhythm-chart.tsx", "../../src/load-ui.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\n\ntype DivAttrs = React.HTMLAttributes<HTMLElement>;\n\nexport interface RoxyBiorhythmChartProps extends Omit<DivAttrs, 'children' | 'onSelect'> {\n\tdata?: unknown;\n\t[attr: string]: unknown;\n}\n\nexport const RoxyBiorhythmChart = React.forwardRef<HTMLElement, RoxyBiorhythmChartProps>(\n\tfunction RoxyBiorhythmChart({ data, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle(ref, () => internal.current as HTMLElement);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded().then(() => {\n\t\t\t\tif (active) setLoaded(true);\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tif (internal.current && data !== undefined) {\n\t\t\t\t(internal.current as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\treturn React.createElement('roxy-biorhythm-chart', { ref: internal, ...rest });\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@0/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nexport function ensureScriptLoaded(version: string = '0.1.0'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst major = version.split('.')[0];\n\t\tconst url = `${CDN_BASE.replace('@0', '@' + major)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n"],
5
- "mappings": ";AAAA,YAAY,WAAW;;;ACKvB,IAAM,YAAY;AAClB,IAAM,WAAW;AAEjB,IAAI,SAA+B;AAE5B,SAAS,mBAAmB,UAAkB,SAAwB;AAC5E,MAAI,OAAO,aAAa,YAAa,QAAO,QAAQ,QAAQ;AAC5D,MAAI,OAAQ,QAAO;AAEnB,WAAS,IAAI,QAAc,CAAC,SAAS,WAAW;AAC/C,UAAM,QAAQ,QAAQ,MAAM,GAAG,EAAE,CAAC;AAClC,UAAM,MAAM,GAAG,SAAS,QAAQ,MAAM,MAAM,KAAK,CAAC;AAClD,QAAI,WAAW,SAAS,eAAe,SAAS;AAChD,QAAI,UAAU;AACb,UAAI,SAAS,QAAQ,WAAW,QAAQ;AACvC,gBAAQ;AAAA,MACT,OAAO;AACN,iBAAS,iBAAiB,QAAQ,MAAM,QAAQ,CAAC;AACjD,iBAAS,iBAAiB,SAAS,MAAM,OAAO,IAAI,MAAM,qBAAqB,CAAC,CAAC;AAAA,MAClF;AACA;AAAA,IACD;AACA,eAAW,SAAS,cAAc,QAAQ;AAC1C,aAAS,KAAK;AACd,aAAS,MAAM;AACf,aAAS,QAAQ;AACjB,aAAS,cAAc;AACvB,aAAS,iBAAiB,QAAQ,MAAM;AACvC,eAAU,QAAQ,SAAS;AAC3B,cAAQ;AAAA,IACT,CAAC;AACD,aAAS,iBAAiB,SAAS,MAAM,OAAO,IAAI,MAAM,qBAAqB,CAAC,CAAC;AACjF,aAAS,KAAK,YAAY,QAAQ;AAAA,EACnC,CAAC;AACD,SAAO;AACR;;;AD9BO,IAAM,qBAA2B;AAAA,EACvC,SAASA,oBAAmB,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK;AACnD,UAAM,WAAiB,aAA2B,IAAI;AACtD,IAAM,0BAAoB,KAAK,MAAM,SAAS,OAAsB;AACpE,UAAM,CAACC,SAAQ,SAAS,IAAU,eAAS,KAAK;AAEhD,IAAM,gBAAU,MAAM;AACrB,UAAI,SAAS;AACb,yBAAmB,EAAE,KAAK,MAAM;AAC/B,YAAI,OAAQ,WAAU,IAAI;AAAA,MAC3B,CAAC;AACD,aAAO,MAAM;AACZ,iBAAS;AAAA,MACV;AAAA,IACD,GAAG,CAAC,CAAC;AAEL,IAAM,gBAAU,MAAM;AACrB,UAAI,SAAS,WAAW,SAAS,QAAW;AAC3C,QAAC,SAAS,QAAyC,OAAO;AAAA,MAC3D;AAAA,IACD,GAAG,CAAC,MAAMA,OAAM,CAAC;AAEjB,WAAa,oBAAc,wBAAwB,EAAE,KAAK,UAAU,GAAG,KAAK,CAAC;AAAA,EAC9E;AACD;",
4
+ "sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { GetCriticalDaysResponse, GetDailyBiorhythmResponse, GetForecastResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyBiorhythmChartProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: GetDailyBiorhythmResponse | GetForecastResponse | GetCriticalDaysResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\n}\n\nexport const RoxyBiorhythmChart = React.forwardRef<HTMLElement | null, RoxyBiorhythmChartProps>(\n\tfunction RoxyBiorhythmChart({ data, className, style, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-biorhythm-chart', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') tracks the marketing\n * snippets and resolves to whatever jsDelivr has cached for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.1.3\";\n"],
5
+ "mappings": ";AAAA,YAAY,WAAW;;;ACSvB,IAAM,YAAY;AAClB,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAExB,IAAI,SAA+B;AAEnC,SAAS,UAAU,SAAyB;AAC3C,MAAI,CAAC,WAAW,YAAY,SAAU,QAAO;AAC7C,SAAO,GAAG,eAAe,GAAG,OAAO,GAAG,eAAe;AACtD;AAEO,SAAS,mBAAmB,UAAkB,UAAyB;AAC7E,MAAI,OAAO,aAAa,YAAa,QAAO,QAAQ,QAAQ;AAC5D,MAAI,OAAQ,QAAO;AAEnB,WAAS,IAAI,QAAc,CAAC,SAAS,WAAW;AAC/C,UAAM,MAAM,GAAG,UAAU,OAAO,CAAC;AACjC,QAAI,WAAW,SAAS,eAAe,SAAS;AAChD,QAAI,UAAU;AACb,UAAI,SAAS,QAAQ,WAAW,QAAQ;AACvC,gBAAQ;AAAA,MACT,OAAO;AACN,iBAAS,iBAAiB,QAAQ,MAAM,QAAQ,CAAC;AACjD,iBAAS,iBAAiB,SAAS,MAAM,OAAO,IAAI,MAAM,qBAAqB,CAAC,CAAC;AAAA,MAClF;AACA;AAAA,IACD;AACA,eAAW,SAAS,cAAc,QAAQ;AAC1C,aAAS,KAAK;AACd,aAAS,MAAM;AACf,aAAS,QAAQ;AACjB,aAAS,cAAc;AACvB,aAAS,iBAAiB,QAAQ,MAAM;AACvC,eAAU,QAAQ,SAAS;AAC3B,cAAQ;AAAA,IACT,CAAC;AACD,aAAS,iBAAiB,SAAS,MAAM,OAAO,IAAI,MAAM,qBAAqB,CAAC,CAAC;AACjF,aAAS,KAAK,YAAY,QAAQ;AAAA,EACnC,CAAC;AACD,SAAO;AACR;;;ADjCO,IAAM,qBAA2B;AAAA,EACvC,SAASA,oBAAmB,EAAE,MAAM,WAAW,OAAO,GAAG,KAAK,GAAG,KAAK;AACrE,UAAM,WAAiB,aAA2B,IAAI;AACtD,IAAM;AAAA,MACL;AAAA,MACA,MAAM,SAAS;AAAA,MACf,CAAC;AAAA,IACF;AACA,UAAM,CAACC,SAAQ,SAAS,IAAU,eAAS,KAAK;AAChD,UAAM,CAAC,OAAO,QAAQ,IAAU,eAAuB,IAAI;AAE3D,IAAM,gBAAU,MAAM;AACrB,UAAI,SAAS;AACb,yBAAmB,EACjB,KAAK,MAAM;AACX,YAAI,OAAQ,WAAU,IAAI;AAAA,MAC3B,CAAC,EACA,MAAM,CAAC,QAAiB;AACxB,YAAI,CAAC,OAAQ;AACb,iBAAS,eAAe,QAAQ,MAAM,IAAI,MAAM,OAAO,GAAG,CAAC,CAAC;AAAA,MAC7D,CAAC;AACF,aAAO,MAAM;AACZ,iBAAS;AAAA,MACV;AAAA,IACD,GAAG,CAAC,CAAC;AAEL,IAAM,gBAAU,MAAM;AACrB,YAAM,KAAK,SAAS;AACpB,UAAI,MAAM,SAAS,QAAW;AAC7B,QAAC,GAAoC,OAAO;AAAA,MAC7C;AAAA,IACD,GAAG,CAAC,MAAMA,OAAM,CAAC;AAEjB,QAAI,OAAO;AACV,aAAa;AAAA,QACZ;AAAA,QACA,EAAE,MAAM,SAAS,WAAW,MAAM;AAAA,QAClC,+BAA+B,MAAM,OAAO;AAAA,MAC7C;AAAA,IACD;AAEA,WAAa,oBAAc,wBAAwB;AAAA,MAClD,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACJ,CAAC;AAAA,EACF;AACD;",
6
6
  "names": ["RoxyBiorhythmChart", "loaded"]
7
7
  }
@@ -1,9 +1,12 @@
1
1
  import * as React from 'react';
2
- type DivAttrs = React.HTMLAttributes<HTMLElement>;
3
- export interface RoxyCompatibilityCardProps extends Omit<DivAttrs, 'children' | 'onSelect'> {
4
- data?: unknown;
5
- [attr: string]: unknown;
2
+ import type { CalculateBioCompatibilityResponse, CalculateCompatibilityResponse, CalculateNumCompatibilityResponse } from '@roxyapi/ui/types';
3
+ type ElementAttrs = Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'data'>;
4
+ export interface RoxyCompatibilityCardProps extends ElementAttrs {
5
+ /** Spec-derived response payload. Pass the raw RoxyAPI response. */
6
+ data?: CalculateCompatibilityResponse | CalculateNumCompatibilityResponse | CalculateBioCompatibilityResponse;
7
+ className?: string;
8
+ style?: React.CSSProperties;
6
9
  }
7
- export declare const RoxyCompatibilityCard: React.ForwardRefExoticComponent<Omit<RoxyCompatibilityCardProps, "ref"> & React.RefAttributes<HTMLElement>>;
10
+ export declare const RoxyCompatibilityCard: React.ForwardRefExoticComponent<RoxyCompatibilityCardProps & React.RefAttributes<HTMLElement | null>>;
8
11
  export {};
9
12
  //# sourceMappingURL=compatibility-card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compatibility-card.d.ts","sourceRoot":"","sources":["../../src/components/compatibility-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,QAAQ,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AAElD,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;IAC1F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,qBAAqB,6GAwBjC,CAAC"}
1
+ {"version":3,"file":"compatibility-card.d.ts","sourceRoot":"","sources":["../../src/components/compatibility-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iCAAiC,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AAE9I,KAAK,YAAY,GAAG,IAAI,CACvB,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,UAAU,GAAG,MAAM,CACnB,CAAC;AAEF,MAAM,WAAW,0BAA2B,SAAQ,YAAY;IAC/D,oEAAoE;IACpE,IAAI,CAAC,EAAE,8BAA8B,GAAG,iCAAiC,GAAG,iCAAiC,CAAC;IAC9G,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAE5B;AAED,eAAO,MAAM,qBAAqB,uGAgDjC,CAAC"}