@roxyapi/ui-react 0.53.3 → 1.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 +33 -38
- package/README.md +42 -73
- package/dist/components/almanac-day.d.ts +0 -1
- package/dist/components/almanac-day.js +1 -2
- package/dist/components/angel-number-card.d.ts +0 -1
- package/dist/components/angel-number-card.js +1 -2
- package/dist/components/angel-number-lookup.d.ts +0 -1
- package/dist/components/angel-number-lookup.js +1 -2
- package/dist/components/arudha-padas.d.ts +0 -1
- package/dist/components/arudha-padas.js +1 -2
- package/dist/components/ashtakavarga-grid.d.ts +0 -1
- package/dist/components/ashtakavarga-grid.js +1 -2
- package/dist/components/aspects-table.d.ts +0 -1
- package/dist/components/aspects-table.js +1 -2
- package/dist/components/astrocartography-map.d.ts +0 -1
- package/dist/components/astrocartography-map.js +1 -2
- package/dist/components/bazi-chart.d.ts +0 -1
- package/dist/components/bazi-chart.js +1 -2
- package/dist/components/bhav-chalit-table.d.ts +0 -1
- package/dist/components/bhav-chalit-table.js +1 -2
- package/dist/components/bhava-bala-table.d.ts +0 -1
- package/dist/components/bhava-bala-table.js +1 -2
- package/dist/components/biorhythm-chart.d.ts +0 -1
- package/dist/components/biorhythm-chart.js +1 -2
- package/dist/components/bodygraph.d.ts +0 -1
- package/dist/components/bodygraph.js +1 -2
- package/dist/components/chara-karakas.d.ts +0 -1
- package/dist/components/chara-karakas.js +1 -2
- package/dist/components/choghadiya-grid.d.ts +0 -1
- package/dist/components/choghadiya-grid.js +1 -2
- package/dist/components/compatibility-card.d.ts +0 -1
- package/dist/components/compatibility-card.js +1 -2
- package/dist/components/compound-number.d.ts +0 -1
- package/dist/components/compound-number.js +1 -2
- package/dist/components/crystal-card.d.ts +0 -1
- package/dist/components/crystal-card.js +1 -2
- package/dist/components/crystal-grid.d.ts +0 -1
- package/dist/components/crystal-grid.js +1 -2
- package/dist/components/dasha-timeline.d.ts +0 -1
- package/dist/components/dasha-timeline.js +1 -2
- package/dist/components/data.d.ts +0 -1
- package/dist/components/data.js +1 -2
- package/dist/components/divisional-chart.d.ts +0 -1
- package/dist/components/divisional-chart.js +1 -2
- package/dist/components/dosha-card.d.ts +0 -1
- package/dist/components/dosha-card.js +1 -2
- package/dist/components/dosha-constitution.d.ts +0 -1
- package/dist/components/dosha-constitution.js +1 -2
- package/dist/components/dream-card.d.ts +0 -1
- package/dist/components/dream-card.js +1 -2
- package/dist/components/dream-search.d.ts +0 -1
- package/dist/components/dream-search.js +1 -2
- package/dist/components/endpoint-form.d.ts +0 -1
- package/dist/components/endpoint-form.js +1 -2
- package/dist/components/ephemeris-table.d.ts +0 -1
- package/dist/components/ephemeris-table.js +1 -2
- package/dist/components/fixed-stars.d.ts +0 -1
- package/dist/components/fixed-stars.js +1 -2
- package/dist/components/flying-star-chart.d.ts +0 -1
- package/dist/components/flying-star-chart.js +1 -2
- package/dist/components/forecast-digest.d.ts +0 -1
- package/dist/components/forecast-digest.js +1 -2
- package/dist/components/forecast-timeline.d.ts +0 -1
- package/dist/components/forecast-timeline.js +1 -2
- package/dist/components/gematria.d.ts +0 -1
- package/dist/components/gematria.js +1 -2
- package/dist/components/gochara-table.d.ts +0 -1
- package/dist/components/gochara-table.js +1 -2
- package/dist/components/guna-milan.d.ts +0 -1
- package/dist/components/guna-milan.js +1 -2
- package/dist/components/hd-connection.d.ts +0 -1
- package/dist/components/hd-connection.js +1 -2
- package/dist/components/hd-penta.d.ts +0 -1
- package/dist/components/hd-penta.js +1 -2
- package/dist/components/hd-type-card.d.ts +0 -1
- package/dist/components/hd-type-card.js +1 -2
- package/dist/components/hd-variables.d.ts +0 -1
- package/dist/components/hd-variables.js +1 -2
- package/dist/components/heliacal-table.d.ts +0 -1
- package/dist/components/heliacal-table.js +1 -2
- package/dist/components/hexagram.d.ts +0 -1
- package/dist/components/hexagram.js +1 -2
- package/dist/components/hora-table.d.ts +0 -1
- package/dist/components/hora-table.js +1 -2
- package/dist/components/horoscope-card.d.ts +0 -1
- package/dist/components/horoscope-card.js +1 -2
- package/dist/components/kp-chart.d.ts +0 -1
- package/dist/components/kp-chart.js +1 -2
- package/dist/components/kp-finance-card.d.ts +0 -1
- package/dist/components/kp-finance-card.js +1 -2
- package/dist/components/kp-planets-table.d.ts +0 -1
- package/dist/components/kp-planets-table.js +1 -2
- package/dist/components/kp-ruling-planets.d.ts +0 -1
- package/dist/components/kp-ruling-planets.js +1 -2
- package/dist/components/kua-card.d.ts +0 -1
- package/dist/components/kua-card.js +1 -2
- package/dist/components/local-space-compass.d.ts +0 -1
- package/dist/components/local-space-compass.js +1 -2
- package/dist/components/location-search.d.ts +0 -1
- package/dist/components/location-search.js +1 -2
- package/dist/components/luck-pillars.d.ts +0 -1
- package/dist/components/luck-pillars.js +1 -2
- package/dist/components/mayan-day-sign.d.ts +0 -1
- package/dist/components/mayan-day-sign.js +1 -2
- package/dist/components/moon-phase.d.ts +0 -1
- package/dist/components/moon-phase.js +1 -2
- package/dist/components/nakshatra-card.d.ts +0 -1
- package/dist/components/nakshatra-card.js +1 -2
- package/dist/components/natal-chart.d.ts +0 -1
- package/dist/components/natal-chart.js +1 -2
- package/dist/components/numerology-card.d.ts +0 -1
- package/dist/components/numerology-card.js +1 -2
- package/dist/components/panchang-table.d.ts +0 -1
- package/dist/components/panchang-table.js +1 -2
- package/dist/components/positions-table.d.ts +0 -1
- package/dist/components/positions-table.js +1 -2
- package/dist/components/profection-card.d.ts +0 -1
- package/dist/components/profection-card.js +1 -2
- package/dist/components/reference-card.d.ts +0 -1
- package/dist/components/reference-card.js +1 -2
- package/dist/components/relocation-wheel.d.ts +0 -1
- package/dist/components/relocation-wheel.js +1 -2
- package/dist/components/shadbala-table.d.ts +0 -1
- package/dist/components/shadbala-table.js +1 -2
- package/dist/components/synastry-chart.d.ts +0 -1
- package/dist/components/synastry-chart.js +1 -2
- package/dist/components/tarot-card.d.ts +0 -1
- package/dist/components/tarot-card.js +1 -2
- package/dist/components/tarot-catalog.d.ts +0 -1
- package/dist/components/tarot-catalog.js +1 -2
- package/dist/components/tarot-spread.d.ts +0 -1
- package/dist/components/tarot-spread.js +1 -2
- package/dist/components/transit-wheel.d.ts +0 -1
- package/dist/components/transit-wheel.js +1 -2
- package/dist/components/transits-table.d.ts +0 -1
- package/dist/components/transits-table.js +1 -2
- package/dist/components/upagraha-table.d.ts +0 -1
- package/dist/components/upagraha-table.js +1 -2
- package/dist/components/vastu-mandala.d.ts +0 -1
- package/dist/components/vastu-mandala.js +1 -2
- package/dist/components/vedic-aspects.d.ts +0 -1
- package/dist/components/vedic-aspects.js +1 -2
- package/dist/components/vedic-daily.d.ts +0 -1
- package/dist/components/vedic-daily.js +1 -2
- package/dist/components/vedic-kundli.d.ts +0 -1
- package/dist/components/vedic-kundli.js +1 -2
- package/dist/components/vedic-planets-table.d.ts +0 -1
- package/dist/components/vedic-planets-table.js +1 -2
- package/dist/components/western-planets-table.d.ts +0 -1
- package/dist/components/western-planets-table.js +1 -2
- package/dist/components/yoga-list.d.ts +0 -1
- package/dist/components/yoga-list.js +1 -2
- package/dist/components/zodiac-card.d.ts +0 -1
- package/dist/components/zodiac-card.js +1 -2
- package/dist/generated/tool-components.d.ts +0 -1
- package/dist/index.cjs +1 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/dist/jsx.cjs +0 -1
- package/dist/jsx.d.ts +2 -3
- package/dist/jsx.js +0 -1
- package/dist/load-ui.d.ts +2 -3
- package/dist/load-ui.js +1 -2
- package/dist/tool-component.cjs +0 -1
- package/dist/tool-component.d.ts +0 -1
- package/dist/tool-component.js +0 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/types.gen.d.ts +48 -37
- package/dist/utils/compact.d.ts +0 -1
- package/dist/utils/tool-component.d.ts +0 -1
- package/package.json +1 -1
- package/dist/components/almanac-day.d.ts.map +0 -1
- package/dist/components/almanac-day.js.map +0 -7
- package/dist/components/angel-number-card.d.ts.map +0 -1
- package/dist/components/angel-number-card.js.map +0 -7
- package/dist/components/angel-number-lookup.d.ts.map +0 -1
- package/dist/components/angel-number-lookup.js.map +0 -7
- package/dist/components/arudha-padas.d.ts.map +0 -1
- package/dist/components/arudha-padas.js.map +0 -7
- package/dist/components/ashtakavarga-grid.d.ts.map +0 -1
- package/dist/components/ashtakavarga-grid.js.map +0 -7
- package/dist/components/aspects-table.d.ts.map +0 -1
- package/dist/components/aspects-table.js.map +0 -7
- package/dist/components/astrocartography-map.d.ts.map +0 -1
- package/dist/components/astrocartography-map.js.map +0 -7
- package/dist/components/bazi-chart.d.ts.map +0 -1
- package/dist/components/bazi-chart.js.map +0 -7
- package/dist/components/bhav-chalit-table.d.ts.map +0 -1
- package/dist/components/bhav-chalit-table.js.map +0 -7
- package/dist/components/bhava-bala-table.d.ts.map +0 -1
- package/dist/components/bhava-bala-table.js.map +0 -7
- package/dist/components/biorhythm-chart.d.ts.map +0 -1
- package/dist/components/biorhythm-chart.js.map +0 -7
- package/dist/components/bodygraph.d.ts.map +0 -1
- package/dist/components/bodygraph.js.map +0 -7
- package/dist/components/chara-karakas.d.ts.map +0 -1
- package/dist/components/chara-karakas.js.map +0 -7
- package/dist/components/choghadiya-grid.d.ts.map +0 -1
- package/dist/components/choghadiya-grid.js.map +0 -7
- package/dist/components/compatibility-card.d.ts.map +0 -1
- package/dist/components/compatibility-card.js.map +0 -7
- package/dist/components/compound-number.d.ts.map +0 -1
- package/dist/components/compound-number.js.map +0 -7
- package/dist/components/crystal-card.d.ts.map +0 -1
- package/dist/components/crystal-card.js.map +0 -7
- package/dist/components/crystal-grid.d.ts.map +0 -1
- package/dist/components/crystal-grid.js.map +0 -7
- package/dist/components/dasha-timeline.d.ts.map +0 -1
- package/dist/components/dasha-timeline.js.map +0 -7
- package/dist/components/data.d.ts.map +0 -1
- package/dist/components/data.js.map +0 -7
- package/dist/components/divisional-chart.d.ts.map +0 -1
- package/dist/components/divisional-chart.js.map +0 -7
- package/dist/components/dosha-card.d.ts.map +0 -1
- package/dist/components/dosha-card.js.map +0 -7
- package/dist/components/dosha-constitution.d.ts.map +0 -1
- package/dist/components/dosha-constitution.js.map +0 -7
- package/dist/components/dream-card.d.ts.map +0 -1
- package/dist/components/dream-card.js.map +0 -7
- package/dist/components/dream-search.d.ts.map +0 -1
- package/dist/components/dream-search.js.map +0 -7
- package/dist/components/endpoint-form.d.ts.map +0 -1
- package/dist/components/endpoint-form.js.map +0 -7
- package/dist/components/ephemeris-table.d.ts.map +0 -1
- package/dist/components/ephemeris-table.js.map +0 -7
- package/dist/components/fixed-stars.d.ts.map +0 -1
- package/dist/components/fixed-stars.js.map +0 -7
- package/dist/components/flying-star-chart.d.ts.map +0 -1
- package/dist/components/flying-star-chart.js.map +0 -7
- package/dist/components/forecast-digest.d.ts.map +0 -1
- package/dist/components/forecast-digest.js.map +0 -7
- package/dist/components/forecast-timeline.d.ts.map +0 -1
- package/dist/components/forecast-timeline.js.map +0 -7
- package/dist/components/gematria.d.ts.map +0 -1
- package/dist/components/gematria.js.map +0 -7
- package/dist/components/gochara-table.d.ts.map +0 -1
- package/dist/components/gochara-table.js.map +0 -7
- package/dist/components/guna-milan.d.ts.map +0 -1
- package/dist/components/guna-milan.js.map +0 -7
- package/dist/components/hd-connection.d.ts.map +0 -1
- package/dist/components/hd-connection.js.map +0 -7
- package/dist/components/hd-penta.d.ts.map +0 -1
- package/dist/components/hd-penta.js.map +0 -7
- package/dist/components/hd-type-card.d.ts.map +0 -1
- package/dist/components/hd-type-card.js.map +0 -7
- package/dist/components/hd-variables.d.ts.map +0 -1
- package/dist/components/hd-variables.js.map +0 -7
- package/dist/components/heliacal-table.d.ts.map +0 -1
- package/dist/components/heliacal-table.js.map +0 -7
- package/dist/components/hexagram.d.ts.map +0 -1
- package/dist/components/hexagram.js.map +0 -7
- package/dist/components/hora-table.d.ts.map +0 -1
- package/dist/components/hora-table.js.map +0 -7
- package/dist/components/horoscope-card.d.ts.map +0 -1
- package/dist/components/horoscope-card.js.map +0 -7
- package/dist/components/kp-chart.d.ts.map +0 -1
- package/dist/components/kp-chart.js.map +0 -7
- package/dist/components/kp-finance-card.d.ts.map +0 -1
- package/dist/components/kp-finance-card.js.map +0 -7
- package/dist/components/kp-planets-table.d.ts.map +0 -1
- package/dist/components/kp-planets-table.js.map +0 -7
- package/dist/components/kp-ruling-planets.d.ts.map +0 -1
- package/dist/components/kp-ruling-planets.js.map +0 -7
- package/dist/components/kua-card.d.ts.map +0 -1
- package/dist/components/kua-card.js.map +0 -7
- package/dist/components/local-space-compass.d.ts.map +0 -1
- package/dist/components/local-space-compass.js.map +0 -7
- package/dist/components/location-search.d.ts.map +0 -1
- package/dist/components/location-search.js.map +0 -7
- package/dist/components/luck-pillars.d.ts.map +0 -1
- package/dist/components/luck-pillars.js.map +0 -7
- package/dist/components/mayan-day-sign.d.ts.map +0 -1
- package/dist/components/mayan-day-sign.js.map +0 -7
- package/dist/components/moon-phase.d.ts.map +0 -1
- package/dist/components/moon-phase.js.map +0 -7
- package/dist/components/nakshatra-card.d.ts.map +0 -1
- package/dist/components/nakshatra-card.js.map +0 -7
- package/dist/components/natal-chart.d.ts.map +0 -1
- package/dist/components/natal-chart.js.map +0 -7
- package/dist/components/numerology-card.d.ts.map +0 -1
- package/dist/components/numerology-card.js.map +0 -7
- package/dist/components/panchang-table.d.ts.map +0 -1
- package/dist/components/panchang-table.js.map +0 -7
- package/dist/components/positions-table.d.ts.map +0 -1
- package/dist/components/positions-table.js.map +0 -7
- package/dist/components/profection-card.d.ts.map +0 -1
- package/dist/components/profection-card.js.map +0 -7
- package/dist/components/reference-card.d.ts.map +0 -1
- package/dist/components/reference-card.js.map +0 -7
- package/dist/components/relocation-wheel.d.ts.map +0 -1
- package/dist/components/relocation-wheel.js.map +0 -7
- package/dist/components/shadbala-table.d.ts.map +0 -1
- package/dist/components/shadbala-table.js.map +0 -7
- package/dist/components/synastry-chart.d.ts.map +0 -1
- package/dist/components/synastry-chart.js.map +0 -7
- package/dist/components/tarot-card.d.ts.map +0 -1
- package/dist/components/tarot-card.js.map +0 -7
- package/dist/components/tarot-catalog.d.ts.map +0 -1
- package/dist/components/tarot-catalog.js.map +0 -7
- package/dist/components/tarot-spread.d.ts.map +0 -1
- package/dist/components/tarot-spread.js.map +0 -7
- package/dist/components/transit-wheel.d.ts.map +0 -1
- package/dist/components/transit-wheel.js.map +0 -7
- package/dist/components/transits-table.d.ts.map +0 -1
- package/dist/components/transits-table.js.map +0 -7
- package/dist/components/upagraha-table.d.ts.map +0 -1
- package/dist/components/upagraha-table.js.map +0 -7
- package/dist/components/vastu-mandala.d.ts.map +0 -1
- package/dist/components/vastu-mandala.js.map +0 -7
- package/dist/components/vedic-aspects.d.ts.map +0 -1
- package/dist/components/vedic-aspects.js.map +0 -7
- package/dist/components/vedic-daily.d.ts.map +0 -1
- package/dist/components/vedic-daily.js.map +0 -7
- package/dist/components/vedic-kundli.d.ts.map +0 -1
- package/dist/components/vedic-kundli.js.map +0 -7
- package/dist/components/vedic-planets-table.d.ts.map +0 -1
- package/dist/components/vedic-planets-table.js.map +0 -7
- package/dist/components/western-planets-table.d.ts.map +0 -1
- package/dist/components/western-planets-table.js.map +0 -7
- package/dist/components/yoga-list.d.ts.map +0 -1
- package/dist/components/yoga-list.js.map +0 -7
- package/dist/components/zodiac-card.d.ts.map +0 -1
- package/dist/components/zodiac-card.js.map +0 -7
- package/dist/generated/tool-components.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/jsx.cjs.map +0 -7
- package/dist/jsx.d.ts.map +0 -1
- package/dist/jsx.js.map +0 -7
- package/dist/load-ui.d.ts.map +0 -1
- package/dist/load-ui.js.map +0 -7
- package/dist/tool-component.cjs.map +0 -7
- package/dist/tool-component.d.ts.map +0 -1
- package/dist/tool-component.js.map +0 -7
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/types.gen.d.ts.map +0 -1
- package/dist/utils/compact.d.ts.map +0 -1
- package/dist/utils/tool-component.d.ts.map +0 -1
package/AGENTS.md
CHANGED
|
@@ -4,11 +4,11 @@ This file teaches AI coding agents (Claude Code, Cursor, Copilot, Codex, Gemini
|
|
|
4
4
|
|
|
5
5
|
This file ships inside `@roxyapi/ui`, `@roxyapi/ui-react`, and `@roxyapi/ui-vue` on npm. After install, read it at `node_modules/@roxyapi/ui/AGENTS.md`.
|
|
6
6
|
|
|
7
|
-
Live preview: <https://roxyapi.
|
|
7
|
+
Live preview: <https://roxyapi.com/ui>. Source of truth for component types: the combined OpenAPI spec at `https://roxyapi.com/api/v2/openapi.json`, regenerated into the response types every package exports. Per-product specs live at `https://roxyapi.com/api/v2/{slug}/openapi.json`.
|
|
8
8
|
|
|
9
9
|
## Identity
|
|
10
10
|
|
|
11
|
-
Roxy UI is the official web component library for the RoxyAPI catalog. Components and helpers cover Western astrology, Vedic astrology, forecast, Human Design, Chinese astrology, feng shui, numerology, tarot, biorhythm, I Ching, crystals, dreams, angel numbers, with the location helper for geocoding. New endpoints regenerate component types automatically.
|
|
11
|
+
Roxy UI is the official web component library for the RoxyAPI catalog. Components and helpers cover Western astrology, Vedic astrology, forecast, Human Design, Chinese astrology, feng shui, Mesoamerican astrology, Vastu, numerology, Kabbalah, tarot, biorhythm, Ayurveda, I Ching, crystals, dreams, angel numbers, with the location helper for geocoding. New endpoints regenerate component types automatically.
|
|
12
12
|
|
|
13
13
|
## Decision tree for picking a component
|
|
14
14
|
|
|
@@ -169,7 +169,7 @@ element.data = data;
|
|
|
169
169
|
|
|
170
170
|
Every chart endpoint (Western, Vedic, KP, synastry, transits, dasha, dosha, panchang) needs `latitude`, `longitude`, and `timezone`. Never ask the user to type coordinates. Call `/location/search` first, then feed the result into the chart endpoint.
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
Some endpoints take TWO locations, and they name them in two different ways. `POST /astrology/synastry`, `/astrology/composite-chart`, `/vedic-astrology/compatibility` and `/human-design/connection` nest a full location per person (`person1` / `person2`, or `personA` / `personB`). `POST /astrology/relocation-chart` instead takes `birthLatitude`, `birthLongitude`, `relocationLatitude`, `relocationLongitude` at the top level with a single `timezone`, which is the BIRTH timezone: relocating does not move the birth moment. `<roxy-endpoint-form>` renders a separate city search for each location automatically, so self-fetch mode needs no extra work.
|
|
173
173
|
|
|
174
174
|
```ts
|
|
175
175
|
// Right
|
|
@@ -182,7 +182,7 @@ const { data: chart } = await roxy.astrology.generateNatalChart({
|
|
|
182
182
|
|
|
183
183
|
### 3. Timezone format inconsistency
|
|
184
184
|
|
|
185
|
-
Every chart endpoint accepts `timezone` as either a decimal-hour offset (`5.5` for IST, `-5` for EST) or an IANA name (`'Asia/Kolkata'`, `'America/New_York'`).
|
|
185
|
+
Every chart endpoint accepts `timezone` as either a decimal-hour offset (`5.5` for IST, `-5` for EST) or an IANA name (`'Asia/Kolkata'`, `'America/New_York'`). `/location/search` returns both, `timezone` as the IANA name and `utcOffset` as the decimal hours; the IANA form is correct over DST boundaries. Pick one and stay consistent in a single integration. Mixing them does not break the API but makes the bug surface area larger.
|
|
186
186
|
|
|
187
187
|
### 4. Secret key in the browser
|
|
188
188
|
|
|
@@ -195,16 +195,21 @@ const roxy = createRoxy(process.env.ROXY_API_KEY!);
|
|
|
195
195
|
|
|
196
196
|
For direct client-side calls, use a **publishable key** (`pk_live_*` / `pk_test_*`) instead. Publishable keys are browser-safe: mint one at `roxyapi.com/account`, register the origins you embed on, and the API gateway returns 403 for any other origin. See the client-side pattern below.
|
|
197
197
|
|
|
198
|
-
### 5.
|
|
198
|
+
### 5. Next.js App Router: render from a Server Component
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
Every component in `@roxyapi/ui-react` ships as a client boundary, so a Server Component imports it and passes `data` directly, with no `'use client'` file of its own. The server fetches with the SDK, the markup is server rendered, and the element hydrates in the browser. Add `'use client'` only to a file that holds state or passes an event handler.
|
|
201
201
|
|
|
202
202
|
```tsx
|
|
203
|
-
// app/
|
|
204
|
-
|
|
203
|
+
// app/page.tsx (Server Component)
|
|
204
|
+
import { createRoxy } from '@roxyapi/sdk';
|
|
205
205
|
import { RoxyNatalChart } from '@roxyapi/ui-react';
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
const roxy = createRoxy(process.env.ROXY_API_KEY!);
|
|
208
|
+
|
|
209
|
+
export default async function Page() {
|
|
210
|
+
const { data } = await roxy.astrology.generateNatalChart({
|
|
211
|
+
body: { date: '1990-01-15', time: '14:30:00', latitude: 40.71, longitude: -74.01, timezone: -5 },
|
|
212
|
+
});
|
|
208
213
|
return <RoxyNatalChart data={data} />;
|
|
209
214
|
}
|
|
210
215
|
```
|
|
@@ -239,7 +244,7 @@ Several components select a view, mode, or chart layout in addition to `data`. T
|
|
|
239
244
|
<RoxyPanchangTable data={panchang} detail="detailed" />
|
|
240
245
|
```
|
|
241
246
|
|
|
242
|
-
The full set: `
|
|
247
|
+
The full set: `RoxyHoroscopeCard` `period` and `layout`, `RoxyMoonPhase` `mode`, `RoxyZodiacCard` `mode`, `RoxyKuaCard` `mode`, `RoxyMayanDaySign` `mode`, `RoxyVastuMandala` `mode`, `RoxyAlmanacDay` `mode`, `RoxyFlyingStarChart` `mode`, `RoxyCompatibilityCard` `mode`, `RoxyVedicKundli` `chartStyle` and `chartReference`, `RoxyDivisionalChart` `chartStyle`, `RoxyPanchangTable` `detail`, `RoxyDashaTimeline` `period`, `RoxyDoshaCard` `type`, `RoxyNumerologyCard` `type`, `RoxyTarotSpread` `spread`, `RoxyBiorhythmChart` `mode`. `RoxyNatalChart` reads its house system and `RoxyHexagram` its variant from the response itself, so neither takes such a prop. Outside React and Vue, set the same value as a kebab-case attribute or a JS property on the element (for example `chart-style="south"` or `el.chartStyle = 'south'`).
|
|
243
248
|
|
|
244
249
|
### 6c. Vue and Nuxt
|
|
245
250
|
|
|
@@ -256,7 +261,7 @@ import { RoxyVedicKundli, RoxyLocationSearch } from '@roxyapi/ui-vue';
|
|
|
256
261
|
</template>
|
|
257
262
|
```
|
|
258
263
|
|
|
259
|
-
In Nuxt, render
|
|
264
|
+
In Nuxt, render them in any page or component, server rendered or not: the markup renders on the server and the element hydrates in the browser, with no `<ClientOnly>` boundary.
|
|
260
265
|
|
|
261
266
|
### 7. Local response interface drift
|
|
262
267
|
|
|
@@ -310,7 +315,7 @@ const data = natal as unknown as NatalChartResponse;
|
|
|
310
315
|
|
|
311
316
|
### 11. The components load from a CDN. Self-host if your CSP forbids that.
|
|
312
317
|
|
|
313
|
-
On first mount the components fetch their rendering bundle from the CDN, pinned to the exact `@roxyapi/ui` release the
|
|
318
|
+
On first mount the components fetch their rendering bundle from the CDN, pinned to the exact `@roxyapi/ui` release the package was built against, so a lockfile pins your runtime too. Behind a strict Content-Security-Policy, an air-gapped network, or offline development nothing will render, and every component shows a visible `Roxy UI script load failed` error rather than failing quietly.
|
|
314
319
|
|
|
315
320
|
Either allowlist `cdn.jsdelivr.net` in `script-src`, or serve the bundle yourself. Copy `node_modules/@roxyapi/ui/dist/cdn/` onto your own origin and call the loader ONCE at app entry, before any component mounts:
|
|
316
321
|
|
|
@@ -322,21 +327,21 @@ ensureScriptLoaded(ROXY_UI_VERSION, '/assets/roxy-ui'); // your origin
|
|
|
322
327
|
|
|
323
328
|
The loader keeps a single shared promise, so the first call wins and every component reuses it.
|
|
324
329
|
|
|
325
|
-
### 12. Theming: set
|
|
330
|
+
### 12. Theming: set a base, not the shades
|
|
326
331
|
|
|
327
|
-
|
|
332
|
+
**Components take every colour, size, radius, space and font from `--roxy-*` tokens, so restyle through the tokens and never by overriding the internals of a component.** A handful of tokens are bases and the rest derive from them, so one declaration restyles the library.
|
|
328
333
|
|
|
329
334
|
```css
|
|
330
335
|
:root { --roxy-accent: #8b5cf6; }
|
|
331
336
|
```
|
|
332
337
|
|
|
333
|
-
If you theme dark differently, set it in your dark block too, exactly as you would for any design-token system:
|
|
338
|
+
The text-safe accent (`--roxy-accent-ink`) and the focus ring (`--roxy-ring`) derive from `--roxy-accent`. If you theme dark differently, set it in your dark block too, exactly as you would for any design-token system:
|
|
334
339
|
|
|
335
340
|
```css
|
|
336
341
|
[data-theme='dark'] { --roxy-accent: #a78bfa; }
|
|
337
342
|
```
|
|
338
343
|
|
|
339
|
-
If the page is not white or near black,
|
|
344
|
+
If the page is not white or near black, set `--roxy-bg` and `--roxy-fg` to your page colour and ink: the card, the label ink, the muted text and every hairline derive from those two. `--roxy-font-sans` is unset by default, so components inherit your page font until you set it; `--roxy-radius` sets every corner. Do not hardcode `--roxy-accent-ink`: you will pin it to one hue and it will stop tracking your brand. To size a drawn chart, set `--roxy-chart-max-width` on it or on `:root`. Dark mode already works with no wiring, via `prefers-color-scheme`, a `.dark` class, or `[data-theme='dark']` on any ancestor. Every token, the presets and the drawing hooks are in `THEMING.md`.
|
|
340
345
|
|
|
341
346
|
## Integration patterns
|
|
342
347
|
|
|
@@ -396,7 +401,7 @@ export function BirthChartView() {
|
|
|
396
401
|
}
|
|
397
402
|
```
|
|
398
403
|
|
|
399
|
-
For a static chart with no picker, fetch in a Server Component and
|
|
404
|
+
For a static chart with no picker, fetch in a Server Component and render the component there (Pattern 6).
|
|
400
405
|
|
|
401
406
|
### Pattern 3: schema-driven form
|
|
402
407
|
|
|
@@ -454,7 +459,7 @@ In React, the same props are typed: `<RoxyNatalChart publishableKey={process.env
|
|
|
454
459
|
|
|
455
460
|
**One tag, no element wiring.** For the simplest embed, load `dist/cdn/widgets.js` and drop a `<div data-roxy-widget="{slug}" data-publishable-key="pk_live_...">`. The script mounts the matching component from a generated slug map: with every path parameter supplied as a `data-*` attribute (`data-sign`, `data-id`) it fetches on mount, otherwise it renders the same input form. A second `data-*` attribute picks a variant (`data-period`, `data-mode`, `data-type`, `data-spread`). To keep every key on your own server instead, drop the publishable key and give the tag `data-submit-url`: the widget renders the form and routes every request there, the city search included, and `data-location-url` sends the city search somewhere else. `data-submit-context` rides along with each proxied request.
|
|
456
461
|
|
|
457
|
-
**Theme every widget in one link.** Add `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/styles/themes/practitioner.css">` for a warm
|
|
462
|
+
**Theme every widget in one link.** Add `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/styles/themes/practitioner.css">` for the Rosewater preset, a warm serif look (or `eucalyptus.css`, `kiln.css`, `moonlit.css`, or `celeste.css` for the roxyapi.com look, from the same folder; `components-catalog.json` lists every preset under `themes`), or set the `--roxy-font-display` token alone to swap result headings to a display face (it defaults to the body font, so nothing changes until you set it). See [THEMING.md](packages/ui/THEMING.md).
|
|
458
463
|
|
|
459
464
|
### Pattern 5: MCP tool-call response
|
|
460
465
|
|
|
@@ -504,12 +509,12 @@ No field renames. No glue code. Use the decision tree above to pick the componen
|
|
|
504
509
|
|
|
505
510
|
### Pattern 6: Next.js RSC streaming
|
|
506
511
|
|
|
507
|
-
Server fetches with the secret key
|
|
512
|
+
Server fetches with the secret key and renders the React component in the same Server Component. The API key never crosses the network.
|
|
508
513
|
|
|
509
514
|
```tsx
|
|
510
515
|
// app/page.tsx (Server Component)
|
|
511
516
|
import { createRoxy } from '@roxyapi/sdk';
|
|
512
|
-
import
|
|
517
|
+
import { RoxyVedicKundli } from '@roxyapi/ui-react';
|
|
513
518
|
|
|
514
519
|
const roxy = createRoxy(process.env.ROXY_API_KEY!);
|
|
515
520
|
|
|
@@ -517,16 +522,6 @@ export default async function Page() {
|
|
|
517
522
|
const { data } = await roxy.vedicAstrology.generateBirthChart({
|
|
518
523
|
body: { date: '1990-01-15', time: '14:30:00', latitude: 19.07, longitude: 72.88, timezone: 5.5 },
|
|
519
524
|
});
|
|
520
|
-
return <BirthChartView data={data} />;
|
|
521
|
-
}
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
```tsx
|
|
525
|
-
// app/birth-chart-view.tsx (Client Component)
|
|
526
|
-
'use client';
|
|
527
|
-
import { RoxyVedicKundli } from '@roxyapi/ui-react';
|
|
528
|
-
|
|
529
|
-
export default function BirthChartView({ data }: { data: unknown }) {
|
|
530
525
|
return <RoxyVedicKundli data={data} />;
|
|
531
526
|
}
|
|
532
527
|
```
|
|
@@ -562,7 +557,7 @@ Rules for this pattern:
|
|
|
562
557
|
|
|
563
558
|
This is how the WordPress plugin renders: PHP fetches the response server-side, caches it, and writes the script into the page. The same shape works in any framework that emits HTML.
|
|
564
559
|
|
|
565
|
-
- Writing the tag itself in a React or Next.js file? Import `@roxyapi/ui-react/jsx` once anywhere in the project and every `roxy-*` tag is typed, with its attributes and their legal values. It is the raw-tag path, so it carries attributes only; a page that passes a response uses the
|
|
560
|
+
- Writing the tag itself in a React or Next.js file? Import `@roxyapi/ui-react/jsx` once anywhere in the project and every `roxy-*` tag is typed, with its attributes and their legal values. It is the raw-tag path, so it carries attributes only; a page that passes a response uses the React or Vue component instead, which sets `data` as a property.
|
|
566
561
|
|
|
567
562
|
## Localized responses
|
|
568
563
|
|
|
@@ -609,7 +604,7 @@ Ask for the response language AND load the matching catalogue, and the whole car
|
|
|
609
604
|
|
|
610
605
|
## Theming and dark mode
|
|
611
606
|
|
|
612
|
-
Components react to three signals in priority order. No events to dispatch. No JS bridge to write.
|
|
607
|
+
Components react to three signals in priority order. No events to dispatch. No JS bridge to write. Every component loads the design tokens when it connects, so a single script tag or a single import yields full theming and dark mode with nothing else to add.
|
|
613
608
|
|
|
614
609
|
| Signal | Where | Effect |
|
|
615
610
|
|---|---|---|
|
|
@@ -633,7 +628,7 @@ Per-element scope is supported:
|
|
|
633
628
|
|
|
634
629
|
Every visible aspect of the chart is driven by `--roxy-*` CSS custom properties on `:host`. Override any token on `:root`, on `:host`, or per element. Do not write Tailwind utility classes inside the components; the Shadow DOM boundary stops them at the door.
|
|
635
630
|
|
|
636
|
-
**One plain declaration is the whole override, including from inside a layer of your own.** The shipped defaults are declared at zero specificity and inside the `roxy` cascade layer, so `:root { --roxy-accent: #6d28d9 }` beats them in both modes, and so does the same line inside `@layer base`, which is where a framework maps its palette onto ours. Never reach for `html:root` or `!important`. If you link `tokens.css` after your own CSS, name the order once with `@layer roxy, base, components, utilities;`. And if your tokens are scoped to a
|
|
631
|
+
**One plain declaration is the whole override, including from inside a layer of your own.** The shipped defaults are declared at zero specificity and inside the `roxy` cascade layer, so `:root { --roxy-accent: #6d28d9 }` beats them in both modes, and so does the same line inside `@layer base`, which is where a framework maps its palette onto ours. Never reach for `html:root` or `!important`. If you link `tokens.css` after your own CSS, name the order once with `@layer roxy, base, components, utilities;`. And if your tokens are scoped to a container element rather than to `:root`, write the mode on that same container element (`data-theme="light"` or `"dark"`), because every token you did not override is still decided at the document root by the visitor OS.
|
|
637
632
|
|
|
638
633
|
## Choosing what a component renders
|
|
639
634
|
|
|
@@ -668,7 +663,7 @@ Both are off by default. `hide-sections` takes a comma-separated list, is case-i
|
|
|
668
663
|
|
|
669
664
|
| part | What it names |
|
|
670
665
|
|---|---|
|
|
671
|
-
| `card` | The component's own card or
|
|
666
|
+
| `card` | The component's own card or container root |
|
|
672
667
|
| `header` | The heading row (title, meta, score) |
|
|
673
668
|
| `chart` | The graphic: wheel, map, bodygraph, bar set, hexagram figure, card art |
|
|
674
669
|
| `legend` | The key to the chart |
|
|
@@ -688,7 +683,7 @@ That table is the shared vocabulary, not the whole list. **`components-catalog.j
|
|
|
688
683
|
## Rules every agent must follow
|
|
689
684
|
|
|
690
685
|
- Always call `/location/search` first before any chart endpoint that takes latitude, longitude, or timezone. Use `<roxy-location-search>` for the input UI.
|
|
691
|
-
- Pass the response object directly. Components are stateless; they
|
|
686
|
+
- Pass the response object directly. Components are stateless; they fetch only in self-fetch mode (a `publishable-key` or a `submit-url`, Pattern 4), plus `<roxy-location-search>`, `<roxy-endpoint-form>`, and the widgets auto-mount script.
|
|
692
687
|
- Use the typed SDK from `@roxyapi/sdk` so prop shapes match the spec automatically.
|
|
693
688
|
- Theming is CSS custom properties on `:root` or per element. Switch light and dark via `data-theme` on any ancestor (see the table above). Do not write Tailwind classes inside the components; the shadow DOM ignores them.
|
|
694
689
|
- Honor reduced motion. The library already respects `prefers-reduced-motion: reduce` and the `--roxy-motion-duration` variable.
|
|
@@ -697,7 +692,7 @@ That table is the shared vocabulary, not the whole list. **`components-catalog.j
|
|
|
697
692
|
|
|
698
693
|
## Domain ordering
|
|
699
694
|
|
|
700
|
-
When listing domains in user-visible copy, use the canonical order: Western astrology, Vedic astrology, forecast, human design, Chinese astrology, feng shui, numerology, tarot, biorhythm, I Ching, crystals, dreams, angel numbers. Sort by this list and skip any domain the catalog does not carry a component for. Location is utility, not a selling domain. The `domain` field in `components-catalog.json` carries
|
|
695
|
+
When listing domains in user-visible copy, use the canonical order: Western astrology, Vedic astrology, forecast, human design, Chinese astrology, feng shui, Mesoamerican astrology, Vastu, numerology, Kabbalah, tarot, biorhythm, Ayurveda, I Ching, crystals, dreams, angel numbers. Sort by this list and skip any domain the catalog does not carry a component for. Location is utility, not a selling domain. The `domain` field in `components-catalog.json` carries short forms of these names (`Western`, `Vedic`, `Feng Shui`), so sort by this list rather than by whatever order you discovered components in.
|
|
701
696
|
|
|
702
697
|
## What not to ship
|
|
703
698
|
|
|
@@ -712,8 +707,8 @@ When listing domains in user-visible copy, use the canonical order: Western astr
|
|
|
712
707
|
|
|
713
708
|
## Where to look next
|
|
714
709
|
|
|
715
|
-
- **Machine-readable catalog, and the one to reach for first**: <https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/components-catalog.json>. Every component with its `tag`, `pascal` name, `domain`, what it renders, the `endpoints` it consumes, its `parts`, and copy-paste `snippets`. Fetch and query it instead of scraping the tables in this file.
|
|
710
|
+
- **Machine-readable catalog, and the one to reach for first**: <https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/components-catalog.json>. Every component with its `tag`, `pascal` name, `domain`, what it renders, the `endpoints` it consumes, its markup `attributes`, its `parts`, and copy-paste `snippets`, plus the theme presets under `themes`. Fetch and query it instead of scraping the tables in this file.
|
|
716
711
|
- Token reference: `THEMING.md`, beside this file in the package
|
|
717
712
|
- Endpoint reference: <https://roxyapi.com/api-reference>
|
|
718
713
|
- Integration guide: <https://roxyapi.com/docs/ui>
|
|
719
|
-
- Live preview of every component: <https://roxyapi.
|
|
714
|
+
- Live preview of every component: <https://roxyapi.com/ui>
|
package/README.md
CHANGED
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
# @roxyapi/ui-react
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@roxyapi/ui-react)
|
|
10
|
-
[](https://roxyapi.com/ui)
|
|
11
11
|
[](https://roxyapi.com/ui)
|
|
12
12
|
[](https://roxyapi.com/api-reference)
|
|
13
13
|
[](https://roxyapi.com/pricing)
|
|
14
14
|
[](LICENSE)
|
|
15
15
|
|
|
16
|
-
> Live demo: **<https://roxyapi.
|
|
16
|
+
> Live demo: **<https://roxyapi.com/ui>**. Every component rendered against real API responses, light + dark, with the React/shadcn install command per card.
|
|
17
17
|
|
|
18
18
|
UI component library 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
19
|
|
|
20
20
|
## Theme-agnostic, every component
|
|
21
21
|
|
|
22
|
-
Light, dark, your brand.
|
|
22
|
+
Light, dark, your brand. A handful of base tokens style the whole library and everything else derives from them, so one line restyles every component: `--roxy-accent` moves every accent mark, accent text and focus ring, `--roxy-font-sans` every heading and label, `--roxy-radius` every corner. The default look adapts to your page: it inherits your font, keeps the ink neutral and the borders hairline, and spends one restrained accent. No class overrides, no rebuild, no Tailwind required. Customize live at <https://roxyapi.com/ui> with the **Theme** menu and the **Customize colors** dialog (a picker per colour token, a copy-paste snippet).
|
|
23
23
|
|
|
24
24
|
<table>
|
|
25
25
|
<tr>
|
|
@@ -54,44 +54,36 @@ Light, dark, your brand. Set `--roxy-accent` on `:root` and every component foll
|
|
|
54
54
|
|
|
55
55
|
```css
|
|
56
56
|
:root {
|
|
57
|
-
/*
|
|
58
|
-
surface you place the component on; --roxy-bg is the field behind an input. */
|
|
59
|
-
--roxy-surface: #ffffff;
|
|
57
|
+
/* Page and ink. The card, the secondary ink, the muted text and every hairline derive from these two. */
|
|
60
58
|
--roxy-bg: #ffffff;
|
|
61
59
|
--roxy-fg: #0a0a0a;
|
|
62
|
-
--roxy-secondary: #475569;
|
|
63
|
-
--roxy-muted: #71717a;
|
|
64
|
-
--roxy-border: #e4e4e7;
|
|
65
60
|
|
|
66
|
-
/* Brand.
|
|
67
|
-
|
|
68
|
-
--roxy-accent: #f59e0b;
|
|
61
|
+
/* Brand. The text-safe shade (--roxy-accent-ink) and the focus ring (--roxy-ring) derive from it. */
|
|
62
|
+
--roxy-accent: #4a6297;
|
|
69
63
|
|
|
70
|
-
/* Status
|
|
64
|
+
/* Status. Each derives its own -fg ink for text on a tint of it. */
|
|
71
65
|
--roxy-success: #16a34a;
|
|
72
66
|
--roxy-warning: #ea580c;
|
|
73
67
|
--roxy-danger: #dc2626;
|
|
74
68
|
--roxy-info: #0284c7;
|
|
75
69
|
|
|
76
|
-
/*
|
|
77
|
-
--roxy-
|
|
78
|
-
--roxy-
|
|
70
|
+
/* Type, space, shape, motion. Leave the font unset to keep your page font. */
|
|
71
|
+
--roxy-font-sans: 'Inter', system-ui;
|
|
72
|
+
--roxy-text-base: 1rem;
|
|
73
|
+
--roxy-space-unit: 0.25rem;
|
|
74
|
+
--roxy-radius: 6px;
|
|
79
75
|
--roxy-motion-duration: 200ms; /* 0ms when prefers-reduced-motion */
|
|
80
76
|
}
|
|
81
77
|
|
|
82
78
|
[data-theme="dark"] {
|
|
83
|
-
--roxy-surface: #18181b;
|
|
84
79
|
--roxy-bg: #0a0a0a;
|
|
85
80
|
--roxy-fg: #fafafa;
|
|
86
|
-
--roxy-secondary: #94a3b8;
|
|
87
|
-
--roxy-muted: #a1a1aa;
|
|
88
|
-
--roxy-border: #27272a;
|
|
89
81
|
/* Only if you want a different accent in dark. Omit it to keep the default. */
|
|
90
|
-
--roxy-accent: #
|
|
82
|
+
--roxy-accent: #92aade;
|
|
91
83
|
}
|
|
92
84
|
```
|
|
93
85
|
|
|
94
|
-
Pick a tone, set the
|
|
86
|
+
Pick a tone, set the bases, every chart and card follows. Named presets ship as one stylesheet each (Rosewater, Eucalyptus, Kiln, Moonlit, and Celeste, the roxyapi.com look). Full token reference, the presets and the drawing hooks at [THEMING.md](https://github.com/RoxyAPI/ui/blob/main/packages/ui/THEMING.md). See the [FAQ](#faq) for switching between light and dark at runtime.
|
|
95
87
|
|
|
96
88
|
## Gallery
|
|
97
89
|
|
|
@@ -290,7 +282,7 @@ Every chart, table, and card adapts to light and dark automatically. Hover any i
|
|
|
290
282
|
</tr>
|
|
291
283
|
</table>
|
|
292
284
|
|
|
293
|
-
Tables, cards, forms, and helper components in the [live demo](https://roxyapi.
|
|
285
|
+
Tables, cards, forms, and helper components in the [live demo](https://roxyapi.com/ui).
|
|
294
286
|
|
|
295
287
|
## Why developers use Roxy UI
|
|
296
288
|
|
|
@@ -320,7 +312,7 @@ Then expand into natal charts, kundli, dasha, tarot, and every other domain. The
|
|
|
320
312
|
|
|
321
313
|
> **Pass `data`, not the envelope.** The SDK returns `{ data, error, request, response }`. Pass `data`, or the component renders `[object Object]`. This is the most common integration bug.
|
|
322
314
|
|
|
323
|
-
The key stays on your server. Vanilla HTML or a server-rendered page fetches the same way, then [inlines the JSON into the component](#server-rendered-no-javascript-wiring): no build step, no key in the browser. Try every component in the [live demo](https://roxyapi.
|
|
315
|
+
The key stays on your server. Vanilla HTML or a server-rendered page fetches the same way, then [inlines the JSON into the component](#server-rendered-no-javascript-wiring): no build step, no key in the browser. Try every component in the [live demo](https://roxyapi.com/ui), each with Preview, Code, and shadcn tabs and a live color customizer.
|
|
324
316
|
|
|
325
317
|
## Install
|
|
326
318
|
|
|
@@ -331,8 +323,6 @@ npm install @roxyapi/ui-react
|
|
|
331
323
|
One package. No peer install, no stylesheet to link, no Tailwind, no config change. Every response type is exported from the package, so nothing else is needed to be fully typed.
|
|
332
324
|
|
|
333
325
|
```tsx
|
|
334
|
-
'use client';
|
|
335
|
-
|
|
336
326
|
import { RoxyNatalChart, type NatalChartResponse } from '@roxyapi/ui-react';
|
|
337
327
|
|
|
338
328
|
export function Chart({ data }: { data: NatalChartResponse }) {
|
|
@@ -368,7 +358,7 @@ document.querySelector('roxy-vedic-kundli')!.data = kundli;
|
|
|
368
358
|
|
|
369
359
|
Always call `/location/search` first. Every chart endpoint expects latitude, longitude, and timezone.
|
|
370
360
|
|
|
371
|
-
> **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.
|
|
361
|
+
> **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. `/location/search` returns both, `timezone` as the IANA name and `utcOffset` as the decimal hours; the decimal form is shorter and the examples on this page use it. The IANA form is correct over DST boundaries when historical accuracy matters.
|
|
372
362
|
|
|
373
363
|
## Render an AI tool result
|
|
374
364
|
|
|
@@ -392,7 +382,7 @@ In React, `pascal` is the export name, so a namespace import renders it directly
|
|
|
392
382
|
|
|
393
383
|
```tsx
|
|
394
384
|
import * as RoxyUI from '@roxyapi/ui-react';
|
|
395
|
-
import { componentForTool } from '@roxyapi/ui-react';
|
|
385
|
+
import { componentForTool } from '@roxyapi/ui-react/tool-component';
|
|
396
386
|
|
|
397
387
|
export function ToolWidget({ toolName, output }: { toolName: string; output: string }) {
|
|
398
388
|
const found = componentForTool(toolName);
|
|
@@ -404,7 +394,7 @@ export function ToolWidget({ toolName, output }: { toolName: string; output: str
|
|
|
404
394
|
|
|
405
395
|
A compact tool result is decoded for you, and a name a host prefixed with its server (`roxy_tarot:post_tarot_daily`) resolves the same as a bare one. Full recipe, with the vendor connectors and the Vercel AI SDK: <https://roxyapi.com/docs/tutorials/ai-chat-widgets>. Runnable page: [examples/vanilla/tool-result.html](examples/vanilla/tool-result.html).
|
|
406
396
|
|
|
407
|
-
**The lookup also ships on its own path**, `@roxyapi/ui/tool-component` and the same subpath on both
|
|
397
|
+
**The lookup also ships on its own path**, `@roxyapi/ui/tool-component` and the same subpath on both framework packages, for a module that decides WHICH component to render and never renders one: a server component, a route handler, a worker. It carries `componentForTool`, `expandCompact` and the name table, and no elements, so nothing in that file pulls in the library.
|
|
408
398
|
|
|
409
399
|
```ts
|
|
410
400
|
import { componentForTool } from '@roxyapi/ui-react/tool-component';
|
|
@@ -464,11 +454,11 @@ This is how the WordPress plugin renders: PHP fetches the response server-side,
|
|
|
464
454
|
import '@roxyapi/ui-react/jsx';
|
|
465
455
|
|
|
466
456
|
export default function Page() {
|
|
467
|
-
return <roxy-tarot-spread
|
|
457
|
+
return <roxy-tarot-spread spread="three-card" hide-readings />;
|
|
468
458
|
}
|
|
469
459
|
```
|
|
470
460
|
|
|
471
|
-
One import anywhere in the project types the tags everywhere in it. The typings carry attributes only, which is what markup can carry: a page that passes a response uses the
|
|
461
|
+
One import anywhere in the project types the tags everywhere in it. The typings carry attributes only, which is what markup can carry: a page that passes a response uses the React or Vue component, which sets `data` as a property. Your `tsconfig.json` needs `moduleResolution` on `bundler`, `node16` or `nodenext`, because the older `node10` resolution ignores the package export map.
|
|
472
462
|
|
|
473
463
|
## Most-used components per domain
|
|
474
464
|
|
|
@@ -826,7 +816,7 @@ Two ways to feed a component, and the key rule for each:
|
|
|
826
816
|
|
|
827
817
|
Set `ROXY_API_KEY` to your secret key in your server env for the server-side SDK examples on this page. For self-fetch embedding with no backend, use a publishable key (see the fully client-side pattern in [`AGENTS.md`](AGENTS.md)).
|
|
828
818
|
|
|
829
|
-
The self-fetch form renders spec-driven inputs (a zodiac tile picker, a boolean toggle, native date and time, a city search wherever the request takes coordinates or a timezone, and one card per record for a request that takes several, with `Add` and `Remove` inside the bounds the API declares), collapses optional fields under one Advanced disclosure, reads a `lang` attribute for localized responses, and prints what the API rejects under the input it rejected, marked and summarised by label. When the page routes RoxyAPI traffic through your own server instead, `submit-url` alone names the route that answers every request the component makes, the city search included, so no key of any kind reaches the browser; add `location-url` only to send the city search somewhere else. `submit-context` takes a JSON object of your own and hands it to that route as `context` beside the request, which is where a page attaches its own verification data to a submission. For the simplest embed, load `dist/cdn/widgets.js` and drop one `<div data-roxy-widget="{slug}" data-publishable-key="pk_live_...">`: with the required attributes present it fetches on mount, otherwise it renders the form. That tag takes `data-submit-url`, `data-location-url` and `data-submit-context` too, so a one-tag embed can route every request through your server and carry no key at all. A single `<link>` to
|
|
819
|
+
The self-fetch form renders spec-driven inputs (a zodiac tile picker, a boolean toggle, native date and time, a city search wherever the request takes coordinates or a timezone, and one card per record for a request that takes several, with `Add` and `Remove` inside the bounds the API declares), collapses optional fields under one Advanced disclosure, reads a `lang` attribute for localized responses, and prints what the API rejects under the input it rejected, marked and summarised by label. When the page routes RoxyAPI traffic through your own server instead, `submit-url` alone names the route that answers every request the component makes, the city search included, so no key of any kind reaches the browser; add `location-url` only to send the city search somewhere else. `submit-context` takes a JSON object of your own and hands it to that route as `context` beside the request, which is where a page attaches its own verification data to a submission. For the simplest embed, load `dist/cdn/widgets.js` and drop one `<div data-roxy-widget="{slug}" data-publishable-key="pk_live_...">`: with the required attributes present it fetches on mount, otherwise it renders the form. That tag takes `data-submit-url`, `data-location-url` and `data-submit-context` too, so a one-tag embed can route every request through your server and carry no key at all. A single `<link>` to a theme preset (Rosewater, Eucalyptus, Kiln, Moonlit or Celeste, from the [Distribution](#distribution) table) restyles every widget on the page. A list that shows one entry per tile (the dream search, the crystal grid) opens the picked entry in place under its tiles when it holds the key, and every pick also emits `roxy-symbol-select` for a page that pairs its own card. Any element that carries a key exposes `load({ path, method, query })`, which fetches one request into it and renders the result as assigned data.
|
|
830
820
|
|
|
831
821
|
## Distribution
|
|
832
822
|
|
|
@@ -838,9 +828,9 @@ The self-fetch form renders spec-driven inputs (a zodiac tile picker, a boolean
|
|
|
838
828
|
| jsDelivr CDN (full bundle) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js` |
|
|
839
829
|
| jsDelivr CDN (per component) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/components/{name}.js` |
|
|
840
830
|
| Widgets auto-mount (one tag, browser keys) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/widgets.js` |
|
|
841
|
-
|
|
|
831
|
+
| Theme presets (one link each, by key: `practitioner` for Rosewater, `eucalyptus`, `kiln`, `moonlit`, `celeste`) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/styles/themes/{key}.css` |
|
|
842
832
|
| shadcn registry | `npx shadcn@latest add https://cdn.jsdelivr.net/gh/RoxyAPI/ui@latest/registry/{name}.json` |
|
|
843
|
-
| Components catalog (JSON: every component, domain, and
|
|
833
|
+
| Components catalog (JSON: every component, its domain, endpoints, attributes and parts, and the theme presets) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/components-catalog.json` |
|
|
844
834
|
|
|
845
835
|
### Serve from your own domain
|
|
846
836
|
|
|
@@ -947,12 +937,12 @@ Every file a page loads ships in the package `dist` folder, and each [GitHub rel
|
|
|
947
937
|
|
|
948
938
|
## Theming
|
|
949
939
|
|
|
950
|
-
Every component
|
|
940
|
+
Every component takes every colour, size, radius, space and font from `--roxy-*` CSS custom properties, and most of them derive from a handful of bases, so restyle through the tokens and never by overriding the internals of a component. Override globally on `:root` or per element. Light + dark defaults, container queries for responsive layouts at 320px and up. Every component loads the default tokens when it connects, from npm and the CDN alike, and your own declarations always win over the defaults: they are declared at zero specificity and inside the `roxy` cascade layer, so one plain line beats them in both modes, with no `!important` and no extra selector weight, and it works from inside a layer of your own. See [THEMING.md](https://github.com/RoxyAPI/ui/blob/main/packages/ui/THEMING.md) for the full token reference and for the one rule a page that scopes its theme to a container element has to know.
|
|
951
941
|
|
|
952
942
|
```css
|
|
953
943
|
:root {
|
|
954
944
|
--roxy-accent: #6d28d9;
|
|
955
|
-
--roxy-radius
|
|
945
|
+
--roxy-radius: 12px;
|
|
956
946
|
}
|
|
957
947
|
|
|
958
948
|
roxy-natal-chart {
|
|
@@ -1090,18 +1080,9 @@ Chinese is keyed by script rather than by language, so a page declaring `zh-Hant
|
|
|
1090
1080
|
- Remote MCP servers per domain at `roxyapi.com/mcp/{domain}`. No local setup. JSON tool-call responses feed straight into the matching component.
|
|
1091
1081
|
- 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.
|
|
1092
1082
|
|
|
1093
|
-
##
|
|
1083
|
+
## See every component
|
|
1094
1084
|
|
|
1095
|
-
|
|
1096
|
-
git clone https://github.com/RoxyAPI/ui.git
|
|
1097
|
-
cd ui
|
|
1098
|
-
bun install
|
|
1099
|
-
bun run build
|
|
1100
|
-
bun run preview
|
|
1101
|
-
# http://localhost:3001
|
|
1102
|
-
```
|
|
1103
|
-
|
|
1104
|
-
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.
|
|
1085
|
+
Every component renders on sample data, light and dark, in every shipped language, at <https://roxyapi.com/ui>. See [examples](examples/) for vanilla HTML, React, Vue, and WordPress.
|
|
1105
1086
|
|
|
1106
1087
|
## Stack and integrations
|
|
1107
1088
|
|
|
@@ -1141,28 +1122,26 @@ Persist the choice in `localStorage` from your own code; the components do not o
|
|
|
1141
1122
|
<details>
|
|
1142
1123
|
<summary><strong>How big is each component? What is the bundle cost?</strong></summary>
|
|
1143
1124
|
|
|
1144
|
-
Every component bundle is
|
|
1125
|
+
Every component bundle is at most 32.3 KB gzipped and the full bundle (every component, helpers, base styles, and the inlined design tokens) is under 180 KB gzipped. Both ceilings are enforced in CI on every build, measured on the compressed bytes a browser actually downloads, so a release cannot quietly grow past them. 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.
|
|
1145
1126
|
</details>
|
|
1146
1127
|
|
|
1147
1128
|
<details>
|
|
1148
1129
|
<summary><strong>How tall does each component render on mobile?</strong></summary>
|
|
1149
1130
|
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
What can grow vertically is the data card around it. `<roxy-natal-chart>` stacks the wheel above the aspect-grid tab, the dignity table, and the planet-reading accordion; the host article on the demo page measures roughly 2100px tall at 390px width because the accordion is fully expanded server-side. Production embeds usually drop the accordion or wrap the chart in a sized container, and the wheel alone fits the fold. Same applies to the synastry chart and the dasha timeline.
|
|
1131
|
+
A drawn chart (a wheel, a kundli, a bodygraph, a compass) keeps its proportions and caps itself at a width that suits it, so on a phone it takes the width of the card. Set `--roxy-chart-max-width` on one element or on `:root` to size it yourself. A grid or table figure spans the card at every width.
|
|
1153
1132
|
|
|
1154
|
-
|
|
1133
|
+
What grows vertically is the reading around the chart. `<roxy-natal-chart>` stacks the wheel above the aspect grid, the dignity table and the planet readings, and the same holds for the synastry chart and the dasha timeline. Keep the chart and drop the prose with `hide-readings`, or drop any single block with `hide-sections`; see [Chart without the written report](#chart-without-the-written-report).
|
|
1155
1134
|
</details>
|
|
1156
1135
|
|
|
1157
1136
|
<details>
|
|
1158
1137
|
<summary><strong>Does this work with Next.js App Router, Remix, Nuxt, SvelteKit, and Astro?</strong></summary>
|
|
1159
1138
|
|
|
1160
|
-
Yes. The components are standard custom elements; any framework that touches the DOM can mount them.
|
|
1139
|
+
Yes. The components are standard custom elements; any framework that touches the DOM can mount them. Each React component ships as a client boundary, so a Next.js Server Component fetches and renders it in one file:
|
|
1161
1140
|
|
|
1162
1141
|
```tsx
|
|
1163
1142
|
// app/page.tsx (Server Component)
|
|
1164
1143
|
import { createRoxy } from '@roxyapi/sdk';
|
|
1165
|
-
import
|
|
1144
|
+
import { RoxyNatalChart } from '@roxyapi/ui-react';
|
|
1166
1145
|
|
|
1167
1146
|
const roxy = createRoxy(process.env.ROXY_API_KEY!);
|
|
1168
1147
|
|
|
@@ -1170,21 +1149,11 @@ export default async function Page() {
|
|
|
1170
1149
|
const { data } = await roxy.astrology.generateNatalChart({
|
|
1171
1150
|
body: { date: '1990-01-15', time: '14:30:00', latitude: 19.07, longitude: 72.88, timezone: 5.5 },
|
|
1172
1151
|
});
|
|
1173
|
-
return <ChartView data={data} />;
|
|
1174
|
-
}
|
|
1175
|
-
```
|
|
1176
|
-
|
|
1177
|
-
```tsx
|
|
1178
|
-
// app/chart-view.tsx (Client Component)
|
|
1179
|
-
'use client';
|
|
1180
|
-
import { RoxyNatalChart } from '@roxyapi/ui-react';
|
|
1181
|
-
|
|
1182
|
-
export default function ChartView({ data }: { data: unknown }) {
|
|
1183
1152
|
return <RoxyNatalChart data={data} />;
|
|
1184
1153
|
}
|
|
1185
1154
|
```
|
|
1186
1155
|
|
|
1187
|
-
The server
|
|
1156
|
+
The markup is server rendered and hydrates in the browser. The API key never crosses the network. Nuxt pages render `@roxyapi/ui-vue` the same way, server rendered with no `<ClientOnly>`, and the same fetch shape works in Remix loaders, SvelteKit `+page.server.ts`, and Astro server endpoints.
|
|
1188
1157
|
</details>
|
|
1189
1158
|
|
|
1190
1159
|
<details>
|
|
@@ -1264,17 +1233,17 @@ For CSP, allow `script-src https://cdn.jsdelivr.net` if loading the bundle from
|
|
|
1264
1233
|
<details>
|
|
1265
1234
|
<summary><strong>How does versioning work?</strong></summary>
|
|
1266
1235
|
|
|
1267
|
-
Semver.
|
|
1236
|
+
Semver. Patch and minor releases are backwards compatible: tags, attributes, events, `data` shapes and part names keep working. A major release names every breaking change in its release notes. Pin a concrete version in production code:
|
|
1268
1237
|
|
|
1269
1238
|
```bash
|
|
1270
|
-
npm install @roxyapi/ui@
|
|
1239
|
+
npm install @roxyapi/ui@1
|
|
1271
1240
|
```
|
|
1272
1241
|
|
|
1273
1242
|
```html
|
|
1274
|
-
<script src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@
|
|
1243
|
+
<script src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@1.1.1/dist/cdn/roxy-ui.js"></script>
|
|
1275
1244
|
```
|
|
1276
1245
|
|
|
1277
|
-
The `@latest` URL on this page is for paste-friendly
|
|
1246
|
+
The `@latest` URL on this page is for paste-friendly examples; production code should pin.
|
|
1278
1247
|
</details>
|
|
1279
1248
|
|
|
1280
1249
|
<details>
|
|
@@ -1284,9 +1253,9 @@ Mock `@roxyapi/sdk` at the network boundary so unit tests do not hit the live AP
|
|
|
1284
1253
|
</details>
|
|
1285
1254
|
|
|
1286
1255
|
<details>
|
|
1287
|
-
<summary><strong>
|
|
1256
|
+
<summary><strong>Can I own the component file in my repo?</strong></summary>
|
|
1288
1257
|
|
|
1289
|
-
Use the shadcn registry.
|
|
1258
|
+
Use the shadcn registry. It drops a small typed React file per component into your repo, re-exporting the component from `@roxyapi/ui-react` so it stays in step with the package, plus a CSS theme bridge that maps your shadcn tokens onto `--roxy-*`. Rename it, wrap it, add your own props; restyle the drawing through the tokens and `::part()`.
|
|
1290
1259
|
|
|
1291
1260
|
```bash
|
|
1292
1261
|
npx shadcn@latest add https://cdn.jsdelivr.net/gh/RoxyAPI/ui@latest/registry/natal-chart.json
|
|
@@ -1319,9 +1288,9 @@ Tool-call JSON has the same shape as the SDK response. Pass it straight into the
|
|
|
1319
1288
|
</details>
|
|
1320
1289
|
|
|
1321
1290
|
<details>
|
|
1322
|
-
<summary><strong>
|
|
1291
|
+
<summary><strong>What is the license?</strong></summary>
|
|
1323
1292
|
|
|
1324
|
-
MIT
|
|
1293
|
+
MIT licensed and free to use, in commercial products too. Report bugs and ideas as [GitHub issues](https://github.com/RoxyAPI/ui/issues).
|
|
1325
1294
|
</details>
|
|
1326
1295
|
|
|
1327
1296
|
## License
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import*as n from"react";var I="
|
|
2
|
-
//# sourceMappingURL=almanac-day.js.map
|
|
1
|
+
"use client";import*as n from"react";var I="1.1.2",v="roxyapi-ui-loader",_="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn",$="https://cdn.jsdelivr.net/npm/@roxyapi/ui@",C="/dist/cdn",d=null;function O(a){return!a||a==="latest"?_:`${$}${a}${C}`}function P(a=I,i){return typeof document>"u"?Promise.resolve():d||(d=new Promise((o,u)=>{let c=`${i??O(a)}/roxy-ui.js`,r=document.getElementById(v);if(r){r.dataset.loaded==="true"?o():(r.addEventListener("load",()=>o()),r.addEventListener("error",()=>u(new Error("roxy-ui load failed"))));return}r=document.createElement("script"),r.id=v,r.src=c,r.async=!0,r.crossOrigin="anonymous",r.addEventListener("load",()=>{r.dataset.loaded="true",o()}),r.addEventListener("error",()=>u(new Error("roxy-ui load failed"))),document.head.appendChild(r)}),d)}var G=n.forwardRef(function({data:i,className:o,style:u,mode:c,endpoint:r,method:l,publishableKey:f,baseUrl:m,submitUrl:p,submitContext:E,locationUrl:R,specUrl:g,lang:y,submitLabel:w,remember:L,errorMessage:x,attribution:k,hideReadings:h,hideSections:S,...T},D){let t=n.useRef(null);n.useImperativeHandle(D,()=>t.current,[]);let[s,H]=n.useState(!1),[b,M]=n.useState(null);return n.useEffect(()=>{let e=!0;return P().then(()=>{e&&H(!0)}).catch(A=>{e&&M(A instanceof Error?A:new Error(String(A)))}),()=>{e=!1}},[]),n.useEffect(()=>{let e=t.current;e&&i!==void 0&&(e.data=i)},[i,s]),n.useEffect(()=>{let e=t.current;e&&c!==void 0&&(e.mode=c)},[c,s]),n.useEffect(()=>{let e=t.current;e&&r!==void 0&&(e.endpoint=r)},[r,s]),n.useEffect(()=>{let e=t.current;e&&l!==void 0&&(e.method=l)},[l,s]),n.useEffect(()=>{let e=t.current;e&&f!==void 0&&(e.publishableKey=f)},[f,s]),n.useEffect(()=>{let e=t.current;e&&m!==void 0&&(e.baseUrl=m)},[m,s]),n.useEffect(()=>{let e=t.current;e&&p!==void 0&&(e.submitUrl=p)},[p,s]),n.useEffect(()=>{let e=t.current;e&&E!==void 0&&(e.submitContext=E)},[E,s]),n.useEffect(()=>{let e=t.current;e&&R!==void 0&&(e.locationUrl=R)},[R,s]),n.useEffect(()=>{let e=t.current;e&&g!==void 0&&(e.specUrl=g)},[g,s]),n.useEffect(()=>{let e=t.current;e&&y!==void 0&&(e.lang=y)},[y,s]),n.useEffect(()=>{let e=t.current;e&&w!==void 0&&(e.submitLabel=w)},[w,s]),n.useEffect(()=>{let e=t.current;e&&L!==void 0&&(e.remember=L)},[L,s]),n.useEffect(()=>{let e=t.current;e&&x!==void 0&&(e.errorMessage=x)},[x,s]),n.useEffect(()=>{let e=t.current;e&&k!==void 0&&(e.attribution=k)},[k,s]),n.useEffect(()=>{let e=t.current;e&&h!==void 0&&(e.hideReadings=h)},[h,s]),n.useEffect(()=>{let e=t.current;e&&S!==void 0&&(e.hideSections=S)},[S,s]),b?n.createElement("div",{role:"alert",className:o,style:u},`Roxy UI script load failed: ${b.message}`):n.createElement("roxy-almanac-day",{ref:t,className:o,style:u,suppressHydrationWarning:!0,...T})});export{G as RoxyAlmanacDay};
|
|
@@ -39,4 +39,3 @@ export interface RoxyAngelNumberCardProps extends ElementAttrs {
|
|
|
39
39
|
}
|
|
40
40
|
export declare const RoxyAngelNumberCard: React.ForwardRefExoticComponent<RoxyAngelNumberCardProps & React.RefAttributes<HTMLElement | null>>;
|
|
41
41
|
export {};
|
|
42
|
-
//# sourceMappingURL=angel-number-card.d.ts.map
|