@roxyapi/ui 0.0.1 → 0.1.2
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/AGENTS.md +169 -0
- package/LICENSE +21 -0
- package/README.md +198 -0
- package/THEMING.md +129 -0
- package/dist/cdn/components/biorhythm-chart.js +261 -0
- package/dist/cdn/components/biorhythm-chart.js.map +7 -0
- package/dist/cdn/components/compatibility-card.js +257 -0
- package/dist/cdn/components/compatibility-card.js.map +7 -0
- package/dist/cdn/components/dasha-timeline.js +244 -0
- package/dist/cdn/components/dasha-timeline.js.map +7 -0
- package/dist/cdn/components/data.js +258 -0
- package/dist/cdn/components/data.js.map +7 -0
- package/dist/cdn/components/dosha-card.js +254 -0
- package/dist/cdn/components/dosha-card.js.map +7 -0
- package/dist/cdn/components/endpoint-form.js +253 -0
- package/dist/cdn/components/endpoint-form.js.map +7 -0
- package/dist/cdn/components/guna-milan.js +256 -0
- package/dist/cdn/components/guna-milan.js.map +7 -0
- package/dist/cdn/components/hexagram.js +275 -0
- package/dist/cdn/components/hexagram.js.map +7 -0
- package/dist/cdn/components/horoscope-card.js +302 -0
- package/dist/cdn/components/horoscope-card.js.map +7 -0
- package/dist/cdn/components/kp-planets-table.js +224 -0
- package/dist/cdn/components/kp-planets-table.js.map +7 -0
- package/dist/cdn/components/location-search.js +267 -0
- package/dist/cdn/components/location-search.js.map +7 -0
- package/dist/cdn/components/moon-phase.js +251 -0
- package/dist/cdn/components/moon-phase.js.map +7 -0
- package/dist/cdn/components/natal-chart.js +237 -0
- package/dist/cdn/components/natal-chart.js.map +7 -0
- package/dist/cdn/components/numerology-card.js +252 -0
- package/dist/cdn/components/numerology-card.js.map +7 -0
- package/dist/cdn/components/panchang-table.js +234 -0
- package/dist/cdn/components/panchang-table.js.map +7 -0
- package/dist/cdn/components/synastry-chart.js +303 -0
- package/dist/cdn/components/synastry-chart.js.map +7 -0
- package/dist/cdn/components/tarot-card.js +260 -0
- package/dist/cdn/components/tarot-card.js.map +7 -0
- package/dist/cdn/components/tarot-spread.js +261 -0
- package/dist/cdn/components/tarot-spread.js.map +7 -0
- package/dist/cdn/components/vedic-kundli.js +189 -0
- package/dist/cdn/components/vedic-kundli.js.map +7 -0
- package/dist/cdn/roxy-ui.js +2552 -0
- package/dist/cdn/roxy-ui.js.map +7 -0
- package/dist/cdn/widgets.js +114 -0
- package/dist/components/biorhythm-chart.d.ts +66 -0
- package/dist/components/biorhythm-chart.d.ts.map +1 -0
- package/dist/components/biorhythm-chart.js +318 -0
- package/dist/components/biorhythm-chart.js.map +7 -0
- package/dist/components/compatibility-card.d.ts +46 -0
- package/dist/components/compatibility-card.d.ts.map +1 -0
- package/dist/components/compatibility-card.js +279 -0
- package/dist/components/compatibility-card.js.map +7 -0
- package/dist/components/dasha-timeline.d.ts +53 -0
- package/dist/components/dasha-timeline.d.ts.map +1 -0
- package/dist/components/dasha-timeline.js +269 -0
- package/dist/components/dasha-timeline.js.map +7 -0
- package/dist/components/data.d.ts +40 -0
- package/dist/components/data.d.ts.map +1 -0
- package/dist/components/data.js +339 -0
- package/dist/components/data.js.map +7 -0
- package/dist/components/dosha-card.d.ts +35 -0
- package/dist/components/dosha-card.d.ts.map +1 -0
- package/dist/components/dosha-card.js +278 -0
- package/dist/components/dosha-card.js.map +7 -0
- package/dist/components/endpoint-form.d.ts +39 -0
- package/dist/components/endpoint-form.d.ts.map +1 -0
- package/dist/components/endpoint-form.js +432 -0
- package/dist/components/endpoint-form.js.map +7 -0
- package/dist/components/guna-milan.d.ts +35 -0
- package/dist/components/guna-milan.d.ts.map +1 -0
- package/dist/components/guna-milan.js +302 -0
- package/dist/components/guna-milan.js.map +7 -0
- package/dist/components/hexagram.d.ts +47 -0
- package/dist/components/hexagram.d.ts.map +1 -0
- package/dist/components/hexagram.js +334 -0
- package/dist/components/hexagram.js.map +7 -0
- package/dist/components/horoscope-card.d.ts +38 -0
- package/dist/components/horoscope-card.d.ts.map +1 -0
- package/dist/components/horoscope-card.js +332 -0
- package/dist/components/horoscope-card.js.map +7 -0
- package/dist/components/kp-planets-table.d.ts +36 -0
- package/dist/components/kp-planets-table.d.ts.map +1 -0
- package/dist/components/kp-planets-table.js +227 -0
- package/dist/components/kp-planets-table.js.map +7 -0
- package/dist/components/location-search.d.ts +56 -0
- package/dist/components/location-search.d.ts.map +1 -0
- package/dist/components/location-search.js +401 -0
- package/dist/components/location-search.js.map +7 -0
- package/dist/components/moon-phase.d.ts +38 -0
- package/dist/components/moon-phase.d.ts.map +1 -0
- package/dist/components/moon-phase.js +284 -0
- package/dist/components/moon-phase.js.map +7 -0
- package/dist/components/natal-chart.d.ts +65 -0
- package/dist/components/natal-chart.d.ts.map +1 -0
- package/dist/components/natal-chart.js +407 -0
- package/dist/components/natal-chart.js.map +7 -0
- package/dist/components/numerology-card.d.ts +55 -0
- package/dist/components/numerology-card.d.ts.map +1 -0
- package/dist/components/numerology-card.js +274 -0
- package/dist/components/numerology-card.js.map +7 -0
- package/dist/components/panchang-table.d.ts +77 -0
- package/dist/components/panchang-table.d.ts.map +1 -0
- package/dist/components/panchang-table.js +285 -0
- package/dist/components/panchang-table.js.map +7 -0
- package/dist/components/synastry-chart.d.ts +52 -0
- package/dist/components/synastry-chart.d.ts.map +1 -0
- package/dist/components/synastry-chart.js +415 -0
- package/dist/components/synastry-chart.js.map +7 -0
- package/dist/components/tarot-card.d.ts +47 -0
- package/dist/components/tarot-card.d.ts.map +1 -0
- package/dist/components/tarot-card.js +281 -0
- package/dist/components/tarot-card.js.map +7 -0
- package/dist/components/tarot-spread.d.ts +42 -0
- package/dist/components/tarot-spread.d.ts.map +1 -0
- package/dist/components/tarot-spread.js +271 -0
- package/dist/components/tarot-spread.js.map +7 -0
- package/dist/components/vedic-kundli.d.ts +45 -0
- package/dist/components/vedic-kundli.d.ts.map +1 -0
- package/dist/components/vedic-kundli.js +325 -0
- package/dist/components/vedic-kundli.js.map +7 -0
- package/dist/index.cjs +4174 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4154 -0
- package/dist/index.js.map +7 -0
- package/dist/manifest.json +24 -0
- package/dist/styles/tokens.css +147 -0
- package/dist/tokens/index.d.ts +17 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/utils/base-styles.d.ts +6 -0
- package/dist/utils/base-styles.d.ts.map +1 -0
- package/dist/utils/debounce.d.ts +5 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/dist/utils/degree.d.ts +29 -0
- package/dist/utils/degree.d.ts.map +1 -0
- package/dist/utils/motion.d.ts +13 -0
- package/dist/utils/motion.d.ts.map +1 -0
- package/package.json +71 -3
- package/src/components/biorhythm-chart.ts +290 -0
- package/src/components/compatibility-card.ts +231 -0
- package/src/components/dasha-timeline.ts +251 -0
- package/src/components/data.ts +287 -0
- package/src/components/dosha-card.ts +215 -0
- package/src/components/endpoint-form.ts +433 -0
- package/src/components/guna-milan.ts +245 -0
- package/src/components/hexagram.ts +279 -0
- package/src/components/horoscope-card.ts +291 -0
- package/src/components/kp-planets-table.ts +156 -0
- package/src/components/location-search.ts +335 -0
- package/src/components/moon-phase.ts +221 -0
- package/src/components/natal-chart.ts +298 -0
- package/src/components/numerology-card.ts +243 -0
- package/src/components/panchang-table.ts +265 -0
- package/src/components/synastry-chart.ts +341 -0
- package/src/components/tarot-card.ts +235 -0
- package/src/components/tarot-spread.ts +224 -0
- package/src/components/vedic-kundli.ts +257 -0
- package/src/index.ts +61 -0
- package/src/styles/tokens.css +147 -0
- package/src/tokens/index.ts +130 -0
- package/src/types/index.ts +3 -0
- package/src/types/types.gen.ts +28526 -0
- package/src/utils/base-styles.ts +89 -0
- package/src/utils/debounce.ts +13 -0
- package/src/utils/degree.ts +64 -0
- package/src/utils/motion.ts +18 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
This file teaches AI coding agents (Claude Code, Cursor, Copilot, Codex, Gemini CLI) how to use Roxy UI when integrating RoxyAPI into a project.
|
|
4
|
+
|
|
5
|
+
## Identity
|
|
6
|
+
|
|
7
|
+
Roxy UI is the official web component library for the RoxyAPI catalog. Components and helpers cover Western astrology, Vedic astrology, numerology, tarot, biorhythm, I Ching, crystals, dreams, angel numbers, with the location helper for geocoding. New endpoints regenerate component types automatically.
|
|
8
|
+
|
|
9
|
+
## Decision tree for picking a component
|
|
10
|
+
|
|
11
|
+
Use the table below. Match the user request against the endpoint, render the matching component.
|
|
12
|
+
|
|
13
|
+
<!-- BEGIN:COMPONENTS -->
|
|
14
|
+
| Element | Domain | Endpoint(s) | What it renders |
|
|
15
|
+
|---|---|---|---|
|
|
16
|
+
| `<roxy-natal-chart>` | Western | POST /astrology/natal-chart | Natal chart wheel with planet glyphs and aspect lines |
|
|
17
|
+
| `<roxy-horoscope-card>` | Western | GET /astrology/horoscope/{sign}/{daily,weekly,monthly} | Daily, weekly, or monthly horoscope card |
|
|
18
|
+
| `<roxy-synastry-chart>` | Western | POST /astrology/synastry | Dual-wheel synastry with inter-aspects table |
|
|
19
|
+
| `<roxy-compatibility-card>` | Cross | POST /astrology/compatibility-score, /numerology/compatibility, /biorhythm/compatibility | Score card with category breakdown |
|
|
20
|
+
| `<roxy-moon-phase>` | Western | GET /astrology/moon-phase/{current,upcoming,calendar/...} | Moon phase card and calendar |
|
|
21
|
+
| `<roxy-vedic-kundli>` | Vedic | POST /vedic-astrology/birth-chart | South or North Indian kundli |
|
|
22
|
+
| `<roxy-panchang-table>` | Vedic | POST /vedic-astrology/panchang/{basic,detailed} | 15+ muhurtas in detailed mode |
|
|
23
|
+
| `<roxy-dasha-timeline>` | Vedic | POST /vedic-astrology/dasha/{current,major,sub/...} | Vimshottari mahadasha + antardasha + pratyantardasha |
|
|
24
|
+
| `<roxy-dosha-card>` | Vedic | POST /vedic-astrology/dosha/{manglik,kalsarpa,sadhesati} | Presence, severity, remedies, scoped effects |
|
|
25
|
+
| `<roxy-guna-milan>` | Vedic | POST /vedic-astrology/compatibility | 36-point Ashtakoota with eight sub-scores |
|
|
26
|
+
| `<roxy-kp-planets-table>` | Vedic (KP) | POST /vedic-astrology/kp/planets | Sub-lord and sub-sub-lord columns |
|
|
27
|
+
| `<roxy-numerology-card>` | Numerology | POST /numerology/{life-path,expression,personal-year,chart} | Life path, expression, personal year, full chart |
|
|
28
|
+
| `<roxy-tarot-card>` | Tarot | GET /tarot/cards/{id}, POST /tarot/daily | Single card with upright and reversed flip |
|
|
29
|
+
| `<roxy-tarot-spread>` | Tarot | POST /tarot/spreads/{three-card,celtic-cross,love}, /tarot/yes-no, /tarot/draw | Spreads with positions and reading |
|
|
30
|
+
| `<roxy-biorhythm-chart>` | Biorhythm | POST /biorhythm/{daily,forecast,critical-days} | Daily bars, forecast cycle lines, critical days |
|
|
31
|
+
| `<roxy-hexagram>` | I Ching | GET /iching/hexagrams/{number}, /iching/cast, POST /iching/daily, /iching/daily/cast | Hexagram with trigrams, judgment, image, changing lines |
|
|
32
|
+
| `<roxy-endpoint-form>` | Helper | Any endpoint via x-roxy-ui hints | Schema-driven form, emits roxy-submit |
|
|
33
|
+
| `<roxy-location-search>` | Helper | GET /location/search | Debounced city search input, emits roxy-location-select |
|
|
34
|
+
| `<roxy-data>` | Helper | Any response shape | Generic fallback renderer for unknown shapes |
|
|
35
|
+
<!-- END:COMPONENTS -->
|
|
36
|
+
|
|
37
|
+
## Integration patterns
|
|
38
|
+
|
|
39
|
+
### Pattern 1: vanilla HTML, no build step
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<script
|
|
43
|
+
src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js"
|
|
44
|
+
crossorigin="anonymous"
|
|
45
|
+
></script>
|
|
46
|
+
|
|
47
|
+
<roxy-natal-chart id="chart"></roxy-natal-chart>
|
|
48
|
+
|
|
49
|
+
<script type="module">
|
|
50
|
+
const res = await fetch('https://roxyapi.com/api/v2/astrology/natal-chart', {
|
|
51
|
+
method: 'POST',
|
|
52
|
+
headers: { 'Content-Type': 'application/json', 'X-API-Key': 'roxy_xxx' },
|
|
53
|
+
body: JSON.stringify({
|
|
54
|
+
date: '1990-01-15',
|
|
55
|
+
time: '14:30:00',
|
|
56
|
+
latitude: 28.6139,
|
|
57
|
+
longitude: 77.209,
|
|
58
|
+
timezone: 5.5,
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
const data = await res.json();
|
|
62
|
+
document.getElementById('chart').data = data;
|
|
63
|
+
</script>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Pattern 2: React, with the typed SDK
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import { createRoxy } from '@roxyapi/sdk';
|
|
70
|
+
import { RoxyNatalChart, RoxyLocationSearch } from '@roxyapi/ui-react';
|
|
71
|
+
import { useState } from 'react';
|
|
72
|
+
|
|
73
|
+
const roxy = createRoxy(process.env.NEXT_PUBLIC_ROXY_API_KEY!);
|
|
74
|
+
|
|
75
|
+
export function BirthChartView() {
|
|
76
|
+
const [chart, setChart] = useState(null);
|
|
77
|
+
|
|
78
|
+
const onLocationSelect = async (e: CustomEvent<{ latitude: number; longitude: number; timezone: string }>) => {
|
|
79
|
+
const { data } = await roxy.astrology.generateNatalChart({
|
|
80
|
+
body: { date: '1990-01-15', time: '14:30:00', ...e.detail },
|
|
81
|
+
});
|
|
82
|
+
setChart(data);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<div>
|
|
87
|
+
<RoxyLocationSearch onroxy-location-select={onLocationSelect} />
|
|
88
|
+
{chart && <RoxyNatalChart data={chart} />}
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Pattern 3: schema-driven form
|
|
95
|
+
|
|
96
|
+
`<roxy-endpoint-form>` reads the OpenAPI spec and renders the inputs for any endpoint. Listen for the `roxy-submit` event with the validated payload.
|
|
97
|
+
|
|
98
|
+
```html
|
|
99
|
+
<roxy-endpoint-form
|
|
100
|
+
data-endpoint="vedic-astrology/birth-chart"
|
|
101
|
+
method="POST"
|
|
102
|
+
submit-label="Generate kundli"
|
|
103
|
+
></roxy-endpoint-form>
|
|
104
|
+
|
|
105
|
+
<script type="module">
|
|
106
|
+
const form = document.querySelector('roxy-endpoint-form');
|
|
107
|
+
form.addEventListener('roxy-submit', async (e) => {
|
|
108
|
+
const { endpoint, values } = e.detail;
|
|
109
|
+
const res = await fetch(`https://roxyapi.com/api/v2/${endpoint}`, {
|
|
110
|
+
method: 'POST',
|
|
111
|
+
headers: { 'Content-Type': 'application/json', 'X-API-Key': 'roxy_xxx' },
|
|
112
|
+
body: JSON.stringify(values),
|
|
113
|
+
});
|
|
114
|
+
const kundli = await res.json();
|
|
115
|
+
document.querySelector('roxy-vedic-kundli').data = kundli;
|
|
116
|
+
});
|
|
117
|
+
</script>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Pattern 4: widgets auto-mount (no JavaScript wiring)
|
|
121
|
+
|
|
122
|
+
Use the publishable key flow for vibecoder embeds.
|
|
123
|
+
|
|
124
|
+
```html
|
|
125
|
+
<script
|
|
126
|
+
src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/widgets.js"
|
|
127
|
+
defer
|
|
128
|
+
></script>
|
|
129
|
+
|
|
130
|
+
<div
|
|
131
|
+
data-roxy-widget="natal-chart"
|
|
132
|
+
data-publishable-key="pk_live_xxx"
|
|
133
|
+
data-date="1990-01-15"
|
|
134
|
+
data-time="14:30:00"
|
|
135
|
+
data-latitude="28.6139"
|
|
136
|
+
data-longitude="77.209"
|
|
137
|
+
data-timezone="5.5"
|
|
138
|
+
></div>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The auto-mount script reads `data-*` attributes, calls the matching endpoint, and renders the matching component.
|
|
142
|
+
|
|
143
|
+
## Rules every agent must follow
|
|
144
|
+
|
|
145
|
+
- Always call `/location/search` first before any chart endpoint that takes latitude, longitude, or timezone. Use `<roxy-location-search>` for the input UI.
|
|
146
|
+
- Pass the response object directly. Components are stateless; they do not fetch internally except for `<roxy-location-search>`, `<roxy-endpoint-form>`, and the widgets auto-mount script.
|
|
147
|
+
- Use the typed SDK from `@roxyapi/sdk` so prop shapes match the spec automatically.
|
|
148
|
+
- Theming is CSS custom properties on `:root` or per element. Do not write Tailwind classes inside the components; the shadow DOM ignores them.
|
|
149
|
+
- Honor reduced motion. The library already respects `prefers-reduced-motion: reduce` and the `--roxy-motion-duration` variable.
|
|
150
|
+
- A11y violations are CI failures. Do not paste over `role` or `aria-*` attributes; the components emit them correctly already.
|
|
151
|
+
|
|
152
|
+
## Domain ordering
|
|
153
|
+
|
|
154
|
+
When listing domains in user-visible copy, use the canonical order: Western astrology, Vedic astrology, numerology, tarot, biorhythm, I Ching, crystals, dreams, angel numbers. Location is utility, not a selling domain.
|
|
155
|
+
|
|
156
|
+
## What not to ship
|
|
157
|
+
|
|
158
|
+
- Do not bundle `@roxyapi/ui` and `@roxyapi/ui-react` together; they are decoupled by design.
|
|
159
|
+
- Use `@roxyapi/ui-react` for React projects. Use `@roxyapi/ui` directly elsewhere.
|
|
160
|
+
- Do not write your own kundli component. The lifted layout in `<roxy-vedic-kundli>` is the canonical RoxyAPI render path.
|
|
161
|
+
- Do not call astrology endpoints with hardcoded coordinates. Always geocode first via `<roxy-location-search>` or `roxy.location.searchCities()`.
|
|
162
|
+
|
|
163
|
+
## Where to look next
|
|
164
|
+
|
|
165
|
+
- Component source: `packages/ui/src/components/`
|
|
166
|
+
- Sample data for every component: `apps/docs/sample-data.js`
|
|
167
|
+
- Token reference: `packages/ui/THEMING.md`
|
|
168
|
+
- Live preview: `bun run preview` then open `http://localhost:3001`
|
|
169
|
+
- Money endpoints reference: see the RoxyAPI methodology page at `roxyapi.com/methodology`
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Roxy Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<p align="center">
|
|
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%">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# @roxyapi/ui
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@roxyapi/ui)
|
|
10
|
+
[](https://roxyapi.com/ui)
|
|
11
|
+
[](https://roxyapi.com/api-reference)
|
|
12
|
+
[](https://roxyapi.com/pricing)
|
|
13
|
+
|
|
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.
|
|
15
|
+
|
|
16
|
+
## Why developers use Roxy UI
|
|
17
|
+
|
|
18
|
+
- One API key. Charts, tables, cards, forms for every domain in the catalog.
|
|
19
|
+
- Works in React, Vue, Svelte, Angular, Solid, vanilla HTML, WordPress.
|
|
20
|
+
- Stateless. Caller fetches via `@roxyapi/sdk`, passes the response as `data`.
|
|
21
|
+
- Theming via CSS custom properties. No Tailwind required, no class-name overrides.
|
|
22
|
+
- A11y zero violations under axe-core. Keyboard navigation. Reduced-motion honored.
|
|
23
|
+
- Tree-shake friendly. Tight bundle budget enforced in CI.
|
|
24
|
+
|
|
25
|
+
## Start with one component
|
|
26
|
+
|
|
27
|
+
Vanilla HTML. Three lines. No build step.
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<script
|
|
31
|
+
src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js"
|
|
32
|
+
crossorigin="anonymous"
|
|
33
|
+
defer
|
|
34
|
+
></script>
|
|
35
|
+
<roxy-natal-chart id="chart"></roxy-natal-chart>
|
|
36
|
+
<script type="module">
|
|
37
|
+
import { createRoxy } from 'https://cdn.jsdelivr.net/npm/@roxyapi/sdk@1/dist/factory.js';
|
|
38
|
+
const roxy = createRoxy(import.meta.env?.ROXY_API_KEY);
|
|
39
|
+
const { data } = await roxy.astrology.generateNatalChart({
|
|
40
|
+
body: { date: '1990-01-15', time: '14:30:00', latitude: 28.6139, longitude: 77.209, timezone: 5.5 },
|
|
41
|
+
});
|
|
42
|
+
document.getElementById('chart').data = data;
|
|
43
|
+
</script>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then add the kundli, the panchang, the dasha timeline, the tarot spread.
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```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
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import { RoxyNatalChart } from '@roxyapi/ui-react';
|
|
70
|
+
|
|
71
|
+
export function Chart({ data }: { data: NatalChart }) {
|
|
72
|
+
return <RoxyNatalChart data={data} />;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Quick start
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { createRoxy } from '@roxyapi/sdk';
|
|
80
|
+
import '@roxyapi/ui';
|
|
81
|
+
|
|
82
|
+
const roxy = createRoxy(process.env.ROXY_API_KEY!);
|
|
83
|
+
|
|
84
|
+
const { data: cities } = await roxy.location.searchCities({ query: { q: 'Mumbai' } });
|
|
85
|
+
const { latitude, longitude, timezone } = cities.cities[0];
|
|
86
|
+
|
|
87
|
+
const { data: kundli } = await roxy.vedicAstrology.generateBirthChart({
|
|
88
|
+
body: { date: '1990-01-15', time: '14:30:00', latitude, longitude, timezone },
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
document.querySelector('roxy-vedic-kundli')!.data = kundli;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Always call `/location/search` first. Every chart endpoint expects latitude, longitude, and timezone.
|
|
95
|
+
|
|
96
|
+
## Distribution
|
|
97
|
+
|
|
98
|
+
| Surface | URL |
|
|
99
|
+
|---|---|
|
|
100
|
+
| npm `@roxyapi/ui` | `npmjs.com/package/@roxyapi/ui` |
|
|
101
|
+
| 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` |
|
|
104
|
+
| 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` |
|
|
106
|
+
|
|
107
|
+
## Phase 1 components
|
|
108
|
+
|
|
109
|
+
<!-- BEGIN:COMPONENTS -->
|
|
110
|
+
| Element | Domain | Endpoint(s) | What it renders |
|
|
111
|
+
|---|---|---|---|
|
|
112
|
+
| `<roxy-natal-chart>` | Western | POST /astrology/natal-chart | Natal chart wheel with planet glyphs and aspect lines |
|
|
113
|
+
| `<roxy-horoscope-card>` | Western | GET /astrology/horoscope/{sign}/{daily,weekly,monthly} | Daily, weekly, or monthly horoscope card |
|
|
114
|
+
| `<roxy-synastry-chart>` | Western | POST /astrology/synastry | Dual-wheel synastry with inter-aspects table |
|
|
115
|
+
| `<roxy-compatibility-card>` | Cross | POST /astrology/compatibility-score, /numerology/compatibility, /biorhythm/compatibility | Score card with category breakdown |
|
|
116
|
+
| `<roxy-moon-phase>` | Western | GET /astrology/moon-phase/{current,upcoming,calendar/...} | Moon phase card and calendar |
|
|
117
|
+
| `<roxy-vedic-kundli>` | Vedic | POST /vedic-astrology/birth-chart | South or North Indian kundli |
|
|
118
|
+
| `<roxy-panchang-table>` | Vedic | POST /vedic-astrology/panchang/{basic,detailed} | 15+ muhurtas in detailed mode |
|
|
119
|
+
| `<roxy-dasha-timeline>` | Vedic | POST /vedic-astrology/dasha/{current,major,sub/...} | Vimshottari mahadasha + antardasha + pratyantardasha |
|
|
120
|
+
| `<roxy-dosha-card>` | Vedic | POST /vedic-astrology/dosha/{manglik,kalsarpa,sadhesati} | Presence, severity, remedies, scoped effects |
|
|
121
|
+
| `<roxy-guna-milan>` | Vedic | POST /vedic-astrology/compatibility | 36-point Ashtakoota with eight sub-scores |
|
|
122
|
+
| `<roxy-kp-planets-table>` | Vedic (KP) | POST /vedic-astrology/kp/planets | Sub-lord and sub-sub-lord columns |
|
|
123
|
+
| `<roxy-numerology-card>` | Numerology | POST /numerology/{life-path,expression,personal-year,chart} | Life path, expression, personal year, full chart |
|
|
124
|
+
| `<roxy-tarot-card>` | Tarot | GET /tarot/cards/{id}, POST /tarot/daily | Single card with upright and reversed flip |
|
|
125
|
+
| `<roxy-tarot-spread>` | Tarot | POST /tarot/spreads/{three-card,celtic-cross,love}, /tarot/yes-no, /tarot/draw | Spreads with positions and reading |
|
|
126
|
+
| `<roxy-biorhythm-chart>` | Biorhythm | POST /biorhythm/{daily,forecast,critical-days} | Daily bars, forecast cycle lines, critical days |
|
|
127
|
+
| `<roxy-hexagram>` | I Ching | GET /iching/hexagrams/{number}, /iching/cast, POST /iching/daily, /iching/daily/cast | Hexagram with trigrams, judgment, image, changing lines |
|
|
128
|
+
| `<roxy-endpoint-form>` | Helper | Any endpoint via x-roxy-ui hints | Schema-driven form, emits roxy-submit |
|
|
129
|
+
| `<roxy-location-search>` | Helper | GET /location/search | Debounced city search input, emits roxy-location-select |
|
|
130
|
+
| `<roxy-data>` | Helper | Any response shape | Generic fallback renderer for unknown shapes |
|
|
131
|
+
<!-- END:COMPONENTS -->
|
|
132
|
+
|
|
133
|
+
## What you can build
|
|
134
|
+
|
|
135
|
+
- Astrology dating apps with synastry charts and compatibility scores.
|
|
136
|
+
- Kundli matching platforms with Guna Milan and Mangal Dosha checks.
|
|
137
|
+
- Daily horoscope embeds for wellness, news, and lifestyle apps.
|
|
138
|
+
- Tarot reading apps with daily pulls, three-card spreads, and Celtic Cross.
|
|
139
|
+
- Numerology calculators with full-chart breakdowns and personal year forecasts.
|
|
140
|
+
- Biorhythm dashboards with critical-day alerts.
|
|
141
|
+
- I Ching apps with hexagram lookup and three-coin casting.
|
|
142
|
+
- Founder hosted-app surfaces consuming the same components under brand themes.
|
|
143
|
+
|
|
144
|
+
## Theming
|
|
145
|
+
|
|
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.
|
|
147
|
+
|
|
148
|
+
```css
|
|
149
|
+
:root {
|
|
150
|
+
--roxy-accent: #6d28d9;
|
|
151
|
+
--roxy-radius-md: 12px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
roxy-natal-chart {
|
|
155
|
+
--roxy-accent: #ec4899;
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Reliability
|
|
160
|
+
|
|
161
|
+
- Verified astronomical calculations from Roxy Ephemeris, verified against NASA JPL Horizons.
|
|
162
|
+
- Stable, versioned API. New endpoints regenerate component types automatically.
|
|
163
|
+
- Consistent response formats across every domain in the catalog.
|
|
164
|
+
- A11y zero violations enforced in CI.
|
|
165
|
+
- Tight per-component bundle budget enforced in CI.
|
|
166
|
+
- Coverage of the highest-demand endpoints across Western astrology, Vedic astrology, numerology, tarot, biorhythm, I Ching, plus helpers for location search and schema-driven forms.
|
|
167
|
+
|
|
168
|
+
## Built for AI agents
|
|
169
|
+
|
|
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.
|
|
174
|
+
|
|
175
|
+
## Build anything, fast
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
git clone https://github.com/RoxyAPI/ui.git
|
|
179
|
+
cd ui
|
|
180
|
+
bun install
|
|
181
|
+
bun run build
|
|
182
|
+
bun run preview
|
|
183
|
+
# http://localhost:3001
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Three steps. Thirty minutes. See [examples](examples/) for a full vanilla HTML, React, Vue, and WordPress integration.
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT. See [LICENSE](LICENSE).
|
|
191
|
+
|
|
192
|
+
## Links
|
|
193
|
+
|
|
194
|
+
- [Documentation](https://roxyapi.com/ui)
|
|
195
|
+
- [API reference](https://roxyapi.com/api-reference)
|
|
196
|
+
- [Methodology](https://roxyapi.com/methodology)
|
|
197
|
+
- [Pricing](https://roxyapi.com/pricing)
|
|
198
|
+
- [Support](https://roxyapi.com/contact)
|
package/THEMING.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Theming Roxy UI
|
|
2
|
+
|
|
3
|
+
Every Roxy UI component reads its colors, fonts, spacing, and motion from a single set of CSS custom properties on `:host`. Override them at `:root` to brand the whole library, or scope to one element to skin a single component.
|
|
4
|
+
|
|
5
|
+
## Token reference
|
|
6
|
+
|
|
7
|
+
### Color
|
|
8
|
+
|
|
9
|
+
| Variable | Light default | Dark default | Used by |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| `--roxy-primary` | `#0f172a` | `#f8fafc` | Headings, primary text |
|
|
12
|
+
| `--roxy-secondary` | `#475569` | `#94a3b8` | Subheadings, muted accents |
|
|
13
|
+
| `--roxy-accent` | `#f59e0b` | `#fbbf24` | Planet glyphs, hexagram lines, focused state |
|
|
14
|
+
| `--roxy-success` | `#16a34a` | `#22c55e` | Positive doshas, biorhythm peaks |
|
|
15
|
+
| `--roxy-warning` | `#ea580c` | `#fb923c` | Caution states, mid severity |
|
|
16
|
+
| `--roxy-danger` | `#dc2626` | `#ef4444` | Manglik present, critical days |
|
|
17
|
+
| `--roxy-info` | `#0284c7` | `#38bdf8` | Informational badges |
|
|
18
|
+
| `--roxy-bg` | `#ffffff` | `#0a0a0a` | Card and chart backgrounds |
|
|
19
|
+
| `--roxy-fg` | `#0a0a0a` | `#fafafa` | Body text |
|
|
20
|
+
| `--roxy-muted` | `#71717a` | `#a1a1aa` | Secondary text |
|
|
21
|
+
| `--roxy-border` | `#e4e4e7` | `#27272a` | Wheel lines, table borders |
|
|
22
|
+
| `--roxy-ring` | `rgba(245, 158, 11, 0.4)` | `rgba(251, 191, 36, 0.45)` | Focus outlines |
|
|
23
|
+
|
|
24
|
+
### Typography
|
|
25
|
+
|
|
26
|
+
| Variable | Default | Notes |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `--roxy-font-sans` | `Geist, system-ui, ...` | Body and headings |
|
|
29
|
+
| `--roxy-font-mono` | `Geist Mono, ui-monospace, ...` | Numeric tables, code |
|
|
30
|
+
| `--roxy-text-xs` | `0.75rem` | Captions |
|
|
31
|
+
| `--roxy-text-sm` | `0.875rem` | Body small |
|
|
32
|
+
| `--roxy-text-base` | `1rem` | Body |
|
|
33
|
+
| `--roxy-text-lg` | `1.125rem` | Subheading |
|
|
34
|
+
| `--roxy-text-xl` | `1.5rem` | Heading |
|
|
35
|
+
| `--roxy-weight-normal` | `400` | Body |
|
|
36
|
+
| `--roxy-weight-bold` | `600` | Heading |
|
|
37
|
+
| `--roxy-leading-tight` | `1.2` | Heading |
|
|
38
|
+
| `--roxy-leading-normal` | `1.5` | Body |
|
|
39
|
+
| `--roxy-tracking-tight` | `-0.02em` | Heading |
|
|
40
|
+
| `--roxy-tracking-normal` | `0em` | Body |
|
|
41
|
+
|
|
42
|
+
### Spacing
|
|
43
|
+
|
|
44
|
+
| Variable | Default |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `--roxy-space-xs` | `0.25rem` |
|
|
47
|
+
| `--roxy-space-sm` | `0.5rem` |
|
|
48
|
+
| `--roxy-space-md` | `1rem` |
|
|
49
|
+
| `--roxy-space-lg` | `1.5rem` |
|
|
50
|
+
| `--roxy-space-xl` | `2.5rem` |
|
|
51
|
+
|
|
52
|
+
### Radius
|
|
53
|
+
|
|
54
|
+
| Variable | Default |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `--roxy-radius-sm` | `4px` |
|
|
57
|
+
| `--roxy-radius-md` | `8px` |
|
|
58
|
+
| `--roxy-radius-lg` | `12px` |
|
|
59
|
+
| `--roxy-radius-full` | `9999px` |
|
|
60
|
+
|
|
61
|
+
### Shadow
|
|
62
|
+
|
|
63
|
+
| Variable | Default |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `--roxy-shadow-sm` | `0 1px 2px rgba(0, 0, 0, 0.06)` |
|
|
66
|
+
| `--roxy-shadow-md` | `0 4px 6px -1px rgba(0, 0, 0, 0.08), ...` |
|
|
67
|
+
| `--roxy-shadow-lg` | `0 12px 24px -8px rgba(0, 0, 0, 0.14)` |
|
|
68
|
+
|
|
69
|
+
### Motion
|
|
70
|
+
|
|
71
|
+
| Variable | Default | Notes |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `--roxy-motion-duration` | `200ms` | Set to `0ms` to disable transitions and entry animations |
|
|
74
|
+
| `--roxy-motion-easing` | `cubic-bezier(0.4, 0, 0.2, 1)` | Standard ease |
|
|
75
|
+
|
|
76
|
+
`prefers-reduced-motion: reduce` always pins duration to `0ms`. Honor this by default.
|
|
77
|
+
|
|
78
|
+
## Patterns
|
|
79
|
+
|
|
80
|
+
### Brand the whole library
|
|
81
|
+
|
|
82
|
+
```css
|
|
83
|
+
:root {
|
|
84
|
+
--roxy-accent: #6d28d9;
|
|
85
|
+
--roxy-radius-md: 12px;
|
|
86
|
+
--roxy-font-sans: 'Inter', system-ui;
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Brand one component
|
|
91
|
+
|
|
92
|
+
```css
|
|
93
|
+
roxy-natal-chart {
|
|
94
|
+
--roxy-accent: #d946ef;
|
|
95
|
+
--roxy-border: #f0abfc;
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Dark mode
|
|
100
|
+
|
|
101
|
+
Three opt-in mechanisms work out of the box.
|
|
102
|
+
|
|
103
|
+
```css
|
|
104
|
+
/* System preference: nothing to do */
|
|
105
|
+
|
|
106
|
+
/* data-theme on the document */
|
|
107
|
+
:root[data-theme='dark'] { /* automatic */ }
|
|
108
|
+
|
|
109
|
+
/* Tailwind dark class on an ancestor */
|
|
110
|
+
.dark roxy-natal-chart { /* automatic */ }
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Map Tailwind tokens
|
|
114
|
+
|
|
115
|
+
Tailwind users can map our tokens to theirs in five lines of `globals.css`:
|
|
116
|
+
|
|
117
|
+
```css
|
|
118
|
+
:root {
|
|
119
|
+
--roxy-bg: theme(colors.background);
|
|
120
|
+
--roxy-fg: theme(colors.foreground);
|
|
121
|
+
--roxy-accent: theme(colors.primary.DEFAULT);
|
|
122
|
+
--roxy-border: theme(colors.border);
|
|
123
|
+
--roxy-radius-md: theme(borderRadius.md);
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## A11y
|
|
128
|
+
|
|
129
|
+
Color contrast must stay at 4.5:1 minimum against `--roxy-bg` for body text and 3:1 for large text. The defaults pass WCAG AA. Verify any custom palette with the axe Chrome extension or any contrast checker before shipping.
|