@roxyapi/ui 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +6 -0
- package/README.md +327 -14
- package/THEMING.md +24 -7
- package/dist/cdn/components/ashtakavarga-grid.js +349 -0
- package/dist/cdn/components/ashtakavarga-grid.js.map +7 -0
- package/dist/cdn/components/biorhythm-chart.js +15 -22
- package/dist/cdn/components/biorhythm-chart.js.map +3 -3
- package/dist/cdn/components/choghadiya-grid.js +239 -0
- package/dist/cdn/components/choghadiya-grid.js.map +7 -0
- package/dist/cdn/components/compatibility-card.js +36 -34
- package/dist/cdn/components/compatibility-card.js.map +4 -4
- package/dist/cdn/components/dasha-timeline.js +35 -39
- package/dist/cdn/components/dasha-timeline.js.map +4 -4
- package/dist/cdn/components/data.js +9 -9
- package/dist/cdn/components/data.js.map +4 -4
- package/dist/cdn/components/divisional-chart.js +279 -0
- package/dist/cdn/components/divisional-chart.js.map +7 -0
- package/dist/cdn/components/dosha-card.js +49 -49
- package/dist/cdn/components/dosha-card.js.map +3 -3
- package/dist/cdn/components/endpoint-form.js +47 -28
- package/dist/cdn/components/endpoint-form.js.map +4 -4
- package/dist/cdn/components/guna-milan.js +66 -24
- package/dist/cdn/components/guna-milan.js.map +4 -4
- package/dist/cdn/components/hexagram.js +26 -26
- package/dist/cdn/components/hexagram.js.map +3 -3
- package/dist/cdn/components/horoscope-card.js +47 -40
- package/dist/cdn/components/horoscope-card.js.map +4 -4
- package/dist/cdn/components/kp-planets-table.js +10 -10
- package/dist/cdn/components/kp-planets-table.js.map +4 -4
- package/dist/cdn/components/location-search.js +6 -6
- package/dist/cdn/components/location-search.js.map +3 -3
- package/dist/cdn/components/moon-phase.js +18 -18
- package/dist/cdn/components/moon-phase.js.map +4 -4
- package/dist/cdn/components/natal-chart.js +240 -24
- package/dist/cdn/components/natal-chart.js.map +4 -4
- package/dist/cdn/components/numerology-card.js +40 -31
- package/dist/cdn/components/numerology-card.js.map +4 -4
- package/dist/cdn/components/panchang-table.js +30 -30
- package/dist/cdn/components/panchang-table.js.map +4 -4
- package/dist/cdn/components/shadbala-table.js +312 -0
- package/dist/cdn/components/shadbala-table.js.map +7 -0
- package/dist/cdn/components/synastry-chart.js +129 -39
- package/dist/cdn/components/synastry-chart.js.map +4 -4
- package/dist/cdn/components/tarot-card.js +49 -20
- package/dist/cdn/components/tarot-card.js.map +3 -3
- package/dist/cdn/components/tarot-spread.js +43 -27
- package/dist/cdn/components/tarot-spread.js.map +3 -3
- package/dist/cdn/components/transits-table.js +391 -0
- package/dist/cdn/components/transits-table.js.map +7 -0
- package/dist/cdn/components/vedic-kundli.js +63 -27
- package/dist/cdn/components/vedic-kundli.js.map +4 -4
- package/dist/cdn/components/yoga-list.js +334 -0
- package/dist/cdn/components/yoga-list.js.map +7 -0
- package/dist/cdn/roxy-ui.js +2104 -544
- package/dist/cdn/roxy-ui.js.map +4 -4
- package/dist/components/ashtakavarga-grid.d.ts +26 -0
- package/dist/components/ashtakavarga-grid.d.ts.map +1 -0
- package/dist/components/ashtakavarga-grid.js +457 -0
- package/dist/components/ashtakavarga-grid.js.map +7 -0
- package/dist/components/biorhythm-chart.d.ts +2 -46
- package/dist/components/biorhythm-chart.d.ts.map +1 -1
- package/dist/components/biorhythm-chart.js +24 -23
- package/dist/components/biorhythm-chart.js.map +2 -2
- package/dist/components/choghadiya-grid.d.ts +19 -0
- package/dist/components/choghadiya-grid.d.ts.map +1 -0
- package/dist/components/choghadiya-grid.js +304 -0
- package/dist/components/choghadiya-grid.js.map +7 -0
- package/dist/components/compatibility-card.d.ts +2 -27
- package/dist/components/compatibility-card.d.ts.map +1 -1
- package/dist/components/compatibility-card.js +50 -29
- package/dist/components/compatibility-card.js.map +3 -3
- package/dist/components/dasha-timeline.d.ts +2 -31
- package/dist/components/dasha-timeline.d.ts.map +1 -1
- package/dist/components/dasha-timeline.js +32 -30
- package/dist/components/dasha-timeline.js.map +3 -3
- package/dist/components/data.d.ts +11 -7
- package/dist/components/data.d.ts.map +1 -1
- package/dist/components/data.js +16 -6
- package/dist/components/data.js.map +3 -3
- package/dist/components/divisional-chart.d.ts +20 -0
- package/dist/components/divisional-chart.d.ts.map +1 -0
- package/dist/components/divisional-chart.js +471 -0
- package/dist/components/divisional-chart.js.map +7 -0
- package/dist/components/dosha-card.d.ts +2 -16
- package/dist/components/dosha-card.d.ts.map +1 -1
- package/dist/components/dosha-card.js +45 -43
- package/dist/components/dosha-card.js.map +2 -2
- package/dist/components/endpoint-form.d.ts +2 -0
- package/dist/components/endpoint-form.d.ts.map +1 -1
- package/dist/components/endpoint-form.js +71 -11
- package/dist/components/endpoint-form.js.map +3 -3
- package/dist/components/guna-milan.d.ts +2 -20
- package/dist/components/guna-milan.d.ts.map +1 -1
- package/dist/components/guna-milan.js +79 -20
- package/dist/components/guna-milan.js.map +4 -4
- package/dist/components/hexagram.d.ts +3 -27
- package/dist/components/hexagram.d.ts.map +1 -1
- package/dist/components/hexagram.js +48 -15
- package/dist/components/hexagram.js.map +2 -2
- package/dist/components/horoscope-card.d.ts +2 -20
- package/dist/components/horoscope-card.d.ts.map +1 -1
- package/dist/components/horoscope-card.js +54 -18
- package/dist/components/horoscope-card.js.map +3 -3
- package/dist/components/kp-planets-table.d.ts +2 -21
- package/dist/components/kp-planets-table.d.ts.map +1 -1
- package/dist/components/kp-planets-table.js +10 -4
- package/dist/components/kp-planets-table.js.map +3 -3
- package/dist/components/location-search.d.ts +5 -14
- package/dist/components/location-search.d.ts.map +1 -1
- package/dist/components/location-search.js +45 -5
- package/dist/components/location-search.js.map +2 -2
- package/dist/components/moon-phase.d.ts +4 -21
- package/dist/components/moon-phase.d.ts.map +1 -1
- package/dist/components/moon-phase.js +34 -4
- package/dist/components/moon-phase.js.map +3 -3
- package/dist/components/natal-chart.d.ts +9 -43
- package/dist/components/natal-chart.d.ts.map +1 -1
- package/dist/components/natal-chart.js +346 -79
- package/dist/components/natal-chart.js.map +3 -3
- package/dist/components/numerology-card.d.ts +5 -37
- package/dist/components/numerology-card.d.ts.map +1 -1
- package/dist/components/numerology-card.js +58 -30
- package/dist/components/numerology-card.js.map +3 -3
- package/dist/components/panchang-table.d.ts +3 -62
- package/dist/components/panchang-table.d.ts.map +1 -1
- package/dist/components/panchang-table.js +62 -32
- package/dist/components/panchang-table.js.map +3 -3
- package/dist/components/shadbala-table.d.ts +18 -0
- package/dist/components/shadbala-table.d.ts.map +1 -0
- package/dist/components/shadbala-table.js +400 -0
- package/dist/components/shadbala-table.js.map +7 -0
- package/dist/components/synastry-chart.d.ts +9 -28
- package/dist/components/synastry-chart.d.ts.map +1 -1
- package/dist/components/synastry-chart.js +201 -56
- package/dist/components/synastry-chart.js.map +3 -3
- package/dist/components/tarot-card.d.ts +5 -29
- package/dist/components/tarot-card.d.ts.map +1 -1
- package/dist/components/tarot-card.js +59 -20
- package/dist/components/tarot-card.js.map +2 -2
- package/dist/components/tarot-spread.d.ts +2 -24
- package/dist/components/tarot-spread.d.ts.map +1 -1
- package/dist/components/tarot-spread.js +39 -13
- package/dist/components/tarot-spread.js.map +2 -2
- package/dist/components/transits-table.d.ts +21 -0
- package/dist/components/transits-table.d.ts.map +1 -0
- package/dist/components/transits-table.js +515 -0
- package/dist/components/transits-table.js.map +7 -0
- package/dist/components/vedic-kundli.d.ts +5 -28
- package/dist/components/vedic-kundli.d.ts.map +1 -1
- package/dist/components/vedic-kundli.js +147 -83
- package/dist/components/vedic-kundli.js.map +3 -3
- package/dist/components/yoga-list.d.ts +29 -0
- package/dist/components/yoga-list.d.ts.map +1 -0
- package/dist/components/yoga-list.js +389 -0
- package/dist/components/yoga-list.js.map +7 -0
- package/dist/index.cjs +3693 -1180
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3709 -1196
- package/dist/index.js.map +4 -4
- package/dist/manifest.d.ts +43 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.json +7 -2
- package/dist/styles/tokens.css +73 -1
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types.gen.d.ts +27811 -0
- package/dist/types/types.gen.d.ts.map +1 -0
- package/dist/utils/debounce.d.ts +9 -1
- package/dist/utils/debounce.d.ts.map +1 -1
- package/dist/utils/format.d.ts +29 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/kundli-render.d.ts +63 -0
- package/dist/utils/kundli-render.d.ts.map +1 -0
- package/dist/utils/string.d.ts +14 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +7 -1
- package/src/components/ashtakavarga-grid.ts +354 -0
- package/src/components/biorhythm-chart.ts +39 -84
- package/src/components/choghadiya-grid.ts +185 -0
- package/src/components/compatibility-card.ts +85 -52
- package/src/components/dasha-timeline.ts +55 -73
- package/src/components/data.ts +28 -16
- package/src/components/divisional-chart.ts +214 -0
- package/src/components/dosha-card.ts +72 -68
- package/src/components/endpoint-form.ts +80 -18
- package/src/components/guna-milan.ts +87 -47
- package/src/components/hexagram.ts +53 -43
- package/src/components/horoscope-card.ts +59 -43
- package/src/components/kp-planets-table.ts +8 -27
- package/src/components/location-search.ts +47 -23
- package/src/components/moon-phase.ts +28 -25
- package/src/components/natal-chart.ts +364 -110
- package/src/components/numerology-card.ts +86 -84
- package/src/components/panchang-table.ts +40 -78
- package/src/components/shadbala-table.ts +286 -0
- package/src/components/synastry-chart.ts +213 -97
- package/src/components/tarot-card.ts +76 -62
- package/src/components/tarot-spread.ts +72 -45
- package/src/components/transits-table.ts +350 -0
- package/src/components/vedic-kundli.ts +59 -173
- package/src/components/yoga-list.ts +328 -0
- package/src/index.ts +18 -26
- package/src/manifest.ts +340 -0
- package/src/styles/tokens.css +73 -1
- package/src/tokens/index.ts +14 -0
- package/src/types/types.gen.ts +3 -3
- package/src/utils/debounce.ts +23 -4
- package/src/utils/format.ts +75 -0
- package/src/utils/kundli-render.ts +197 -0
- package/src/utils/string.ts +23 -0
- package/src/version.ts +2 -0
- package/dist/utils/motion.d.ts +0 -13
- package/dist/utils/motion.d.ts.map +0 -1
- package/src/utils/motion.ts +0 -18
package/AGENTS.md
CHANGED
|
@@ -24,6 +24,12 @@ Use the table below. Match the user request against the endpoint, render the mat
|
|
|
24
24
|
| `<roxy-dosha-card>` | Vedic | POST /vedic-astrology/dosha/{manglik,kalsarpa,sadhesati} | Presence, severity, remedies, scoped effects |
|
|
25
25
|
| `<roxy-guna-milan>` | Vedic | POST /vedic-astrology/compatibility | 36-point Ashtakoota with eight sub-scores |
|
|
26
26
|
| `<roxy-kp-planets-table>` | Vedic (KP) | POST /vedic-astrology/kp/planets | Sub-lord and sub-sub-lord columns |
|
|
27
|
+
| `<roxy-transits-table>` | Western | POST /astrology/transits | Transit planet positions plus optional aspects to a natal chart |
|
|
28
|
+
| `<roxy-divisional-chart>` | Vedic | POST /vedic-astrology/divisional-chart | Generic divisional varga wheel from D2 Hora to D60 Shashtiamsa |
|
|
29
|
+
| `<roxy-ashtakavarga-grid>` | Vedic | POST /vedic-astrology/ashtakavarga | Sarva, Bhinna, and Shodhya Pinda views in a tabbed heatmap |
|
|
30
|
+
| `<roxy-shadbala-table>` | Vedic | POST /vedic-astrology/shadbala | Six-fold planetary strength bar plus rupas and adequacy badge |
|
|
31
|
+
| `<roxy-yoga-list>` | Vedic | GET /vedic-astrology/yoga, /yoga/{id} | Filterable yoga cards from the 300 plus yoga catalog |
|
|
32
|
+
| `<roxy-choghadiya-grid>` | Vedic | POST /vedic-astrology/panchang/choghadiya | Day and night Choghadiya muhurta tiles colored by effect |
|
|
27
33
|
| `<roxy-numerology-card>` | Numerology | POST /numerology/{life-path,expression,personal-year,chart} | Life path, expression, personal year, full chart |
|
|
28
34
|
| `<roxy-tarot-card>` | Tarot | GET /tarot/cards/{id}, POST /tarot/daily | Single card with upright and reversed flip |
|
|
29
35
|
| `<roxy-tarot-spread>` | Tarot | POST /tarot/spreads/{three-card,celtic-cross,love}, /tarot/yes-no, /tarot/draw | Spreads with positions and reading |
|
package/README.md
CHANGED
|
@@ -1,17 +1,131 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://roxyapi.com/ui">
|
|
3
|
-
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/banner.png" alt="Roxy UI
|
|
3
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/banner.png" alt="Roxy UI: complete UI library for astrology, vedic, tarot, and more" width="100%">
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
# @roxyapi/ui
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@roxyapi/ui)
|
|
10
|
+
[](https://roxyapi.github.io/ui/)
|
|
10
11
|
[](https://roxyapi.com/ui)
|
|
11
12
|
[](https://roxyapi.com/api-reference)
|
|
12
13
|
[](https://roxyapi.com/pricing)
|
|
14
|
+
[](LICENSE)
|
|
15
|
+
|
|
16
|
+
> Live demo: **<https://roxyapi.github.io/ui/>**. Every component rendered against real API responses, light + dark, with the React/shadcn install command per card.
|
|
17
|
+
|
|
18
|
+
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
|
+
|
|
20
|
+
## Theme-agnostic, every component
|
|
21
|
+
|
|
22
|
+
Light, dark, your brand. Override one CSS variable and every component updates. No class overrides, no rebuild, no Tailwind required. Customize live at <https://roxyapi.github.io/ui/> using the **Customize** dialog (every token, color picker, copy-paste snippet) or write your own variables on `:root`.
|
|
23
|
+
|
|
24
|
+
<table>
|
|
25
|
+
<tr>
|
|
26
|
+
<th width="50%" align="center">Light</th>
|
|
27
|
+
<th width="50%" align="center">Dark</th>
|
|
28
|
+
</tr>
|
|
29
|
+
<tr>
|
|
30
|
+
<td width="50%" align="center">
|
|
31
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/natal-chart-light.png" alt="Natal chart, light mode">
|
|
32
|
+
</td>
|
|
33
|
+
<td width="50%" align="center">
|
|
34
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/natal-chart-dark.png" alt="Natal chart, dark mode">
|
|
35
|
+
</td>
|
|
36
|
+
</tr>
|
|
37
|
+
<tr>
|
|
38
|
+
<td width="50%" align="center">
|
|
39
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/vedic-kundli-light.png" alt="Vedic kundli, light mode">
|
|
40
|
+
</td>
|
|
41
|
+
<td width="50%" align="center">
|
|
42
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/vedic-kundli-dark.png" alt="Vedic kundli, dark mode">
|
|
43
|
+
</td>
|
|
44
|
+
</tr>
|
|
45
|
+
</table>
|
|
13
46
|
|
|
14
|
-
|
|
47
|
+
```css
|
|
48
|
+
:root {
|
|
49
|
+
/* Surface */
|
|
50
|
+
--roxy-bg: #fafafa;
|
|
51
|
+
--roxy-fg: #0a0a0a;
|
|
52
|
+
--roxy-muted: #71717a;
|
|
53
|
+
--roxy-border: #e4e4e7;
|
|
54
|
+
|
|
55
|
+
/* Brand */
|
|
56
|
+
--roxy-accent: #f59e0b;
|
|
57
|
+
--roxy-accent-fg: #b45309;
|
|
58
|
+
|
|
59
|
+
/* Status (each has a -fg variant for WCAG-AA text contrast) */
|
|
60
|
+
--roxy-success: #16a34a;
|
|
61
|
+
--roxy-warning: #f59e0b;
|
|
62
|
+
--roxy-danger: #dc2626;
|
|
63
|
+
--roxy-info: #2563eb;
|
|
64
|
+
|
|
65
|
+
/* Shape + motion */
|
|
66
|
+
--roxy-radius-md: 12px;
|
|
67
|
+
--roxy-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
|
|
68
|
+
--roxy-motion-duration: 200ms; /* 0ms when prefers-reduced-motion */
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-theme="dark"] {
|
|
72
|
+
--roxy-bg: #0a0a0a;
|
|
73
|
+
--roxy-fg: #fafafa;
|
|
74
|
+
--roxy-muted: #a1a1aa;
|
|
75
|
+
--roxy-border: #27272a;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Pick a tone, set the vars, every chart and card follows. Full token reference at [THEMING.md](https://github.com/RoxyAPI/ui/blob/main/packages/ui/THEMING.md). Live tweaker on the [demo site](https://roxyapi.github.io/ui/).
|
|
80
|
+
|
|
81
|
+
## Gallery (chart-heavy components)
|
|
82
|
+
|
|
83
|
+
<table>
|
|
84
|
+
<tr>
|
|
85
|
+
<td width="50%"><strong>Synastry</strong> · <code><roxy-synastry-chart></code><br><sub>POST /astrology/synastry</sub><br>
|
|
86
|
+
<picture>
|
|
87
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/synastry-chart-dark.png">
|
|
88
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/synastry-chart-light.png" alt="Synastry dual-wheel with inter-aspects">
|
|
89
|
+
</picture>
|
|
90
|
+
</td>
|
|
91
|
+
<td width="50%"><strong>Moon phase</strong> · <code><roxy-moon-phase></code><br><sub>GET /astrology/moon-phase/{current,upcoming,calendar}</sub><br>
|
|
92
|
+
<picture>
|
|
93
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/moon-phase-dark.png">
|
|
94
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/moon-phase-light.png" alt="Moon phase card with illumination and age">
|
|
95
|
+
</picture>
|
|
96
|
+
</td>
|
|
97
|
+
</tr>
|
|
98
|
+
<tr>
|
|
99
|
+
<td width="50%"><strong>Biorhythm</strong> · <code><roxy-biorhythm-chart></code><br><sub>POST /biorhythm/{daily,forecast,critical-days}</sub><br>
|
|
100
|
+
<picture>
|
|
101
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/biorhythm-chart-dark.png">
|
|
102
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/biorhythm-chart-light.png" alt="Biorhythm physical, emotional, intellectual cycle bars">
|
|
103
|
+
</picture>
|
|
104
|
+
</td>
|
|
105
|
+
<td width="50%"><strong>I Ching hexagram</strong> · <code><roxy-hexagram></code><br><sub>GET /iching/hexagrams/{number}, /iching/cast</sub><br>
|
|
106
|
+
<picture>
|
|
107
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/hexagram-dark.png">
|
|
108
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/hexagram-light.png" alt="I Ching hexagram with trigrams and judgment">
|
|
109
|
+
</picture>
|
|
110
|
+
</td>
|
|
111
|
+
</tr>
|
|
112
|
+
<tr>
|
|
113
|
+
<td width="50%"><strong>Dasha timeline</strong> · <code><roxy-dasha-timeline></code><br><sub>POST /vedic-astrology/dasha/{current,major,sub}</sub><br>
|
|
114
|
+
<picture>
|
|
115
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/dasha-timeline-dark.png">
|
|
116
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/dasha-timeline-light.png" alt="Vimshottari dasha mahadasha and antardasha timeline">
|
|
117
|
+
</picture>
|
|
118
|
+
</td>
|
|
119
|
+
<td width="50%"><strong>Tarot spread</strong> · <code><roxy-tarot-spread></code><br><sub>POST /tarot/spreads/{three-card,celtic-cross,love}</sub><br>
|
|
120
|
+
<picture>
|
|
121
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/tarot-spread-dark.png">
|
|
122
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/tarot-spread-light.png" alt="Tarot spread with three-card layout and reading">
|
|
123
|
+
</picture>
|
|
124
|
+
</td>
|
|
125
|
+
</tr>
|
|
126
|
+
</table>
|
|
127
|
+
|
|
128
|
+
Tables, cards, forms, and helper components in the [live demo](https://roxyapi.github.io/ui/).
|
|
15
129
|
|
|
16
130
|
## Why developers use Roxy UI
|
|
17
131
|
|
|
@@ -34,7 +148,7 @@ Vanilla HTML. Three lines. No build step.
|
|
|
34
148
|
></script>
|
|
35
149
|
<roxy-natal-chart id="chart"></roxy-natal-chart>
|
|
36
150
|
<script type="module">
|
|
37
|
-
import { createRoxy } from 'https://cdn.jsdelivr.net/npm/@roxyapi/sdk@
|
|
151
|
+
import { createRoxy } from 'https://cdn.jsdelivr.net/npm/@roxyapi/sdk@latest/dist/factory.js';
|
|
38
152
|
const roxy = createRoxy(import.meta.env?.ROXY_API_KEY);
|
|
39
153
|
const { data } = await roxy.astrology.generateNatalChart({
|
|
40
154
|
body: { date: '1990-01-15', time: '14:30:00', latitude: 28.6139, longitude: 77.209, timezone: 5.5 },
|
|
@@ -93,18 +207,29 @@ document.querySelector('roxy-vedic-kundli')!.data = kundli;
|
|
|
93
207
|
|
|
94
208
|
Always call `/location/search` first. Every chart endpoint expects latitude, longitude, and timezone.
|
|
95
209
|
|
|
210
|
+
> **Timezone format.** RoxyAPI accepts both forms: a decimal-hour offset (`5.5` for IST, `-5` for EST) or an IANA name (`'Asia/Kolkata'`, `'America/New_York'`). Pick one and stay consistent. The decimal form is shorter and what `/location/search` returns; examples on this page use it. The IANA form is correct over DST boundaries when historical accuracy matters.
|
|
211
|
+
|
|
212
|
+
## API keys
|
|
213
|
+
|
|
214
|
+
Get keys at <https://roxyapi.com/account>.
|
|
215
|
+
|
|
216
|
+
- **Secret key** (server-side only). Use in Node, Bun, Hono, Next.js route handlers, Workers. Never commit, never ship in client bundles.
|
|
217
|
+
- **Publishable key** (`pk_live_*` / `pk_test_*`). Safe in browsers, locked to the origins you register on the key. Use with the widgets auto-mount script for WordPress, Shopify, static HTML, embed scenarios. The API gateway rejects requests from any origin not on the key's allowlist.
|
|
218
|
+
|
|
219
|
+
For the SDK examples on this page, set `ROXY_API_KEY` to a secret key in your server env. For the widgets auto-mount path (`data-publishable-key="pk_live_xxx"`), use a publishable key with your site's domain registered.
|
|
220
|
+
|
|
96
221
|
## Distribution
|
|
97
222
|
|
|
98
223
|
| Surface | URL |
|
|
99
224
|
|---|---|
|
|
100
225
|
| npm `@roxyapi/ui` | `npmjs.com/package/@roxyapi/ui` |
|
|
101
226
|
| npm `@roxyapi/ui-react` | `npmjs.com/package/@roxyapi/ui-react` |
|
|
102
|
-
|
|
|
103
|
-
|
|
|
227
|
+
| jsDelivr CDN (full bundle) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js` |
|
|
228
|
+
| jsDelivr CDN (per component) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/components/{name}.js` |
|
|
104
229
|
| Widgets auto-mount | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/widgets.js` |
|
|
105
|
-
| shadcn registry | `
|
|
230
|
+
| shadcn registry | `npx shadcn@latest add https://cdn.jsdelivr.net/gh/RoxyAPI/ui@latest/registry/{name}.json` |
|
|
106
231
|
|
|
107
|
-
##
|
|
232
|
+
## Components
|
|
108
233
|
|
|
109
234
|
<!-- BEGIN:COMPONENTS -->
|
|
110
235
|
| Element | Domain | Endpoint(s) | What it renders |
|
|
@@ -120,6 +245,12 @@ Always call `/location/search` first. Every chart endpoint expects latitude, lon
|
|
|
120
245
|
| `<roxy-dosha-card>` | Vedic | POST /vedic-astrology/dosha/{manglik,kalsarpa,sadhesati} | Presence, severity, remedies, scoped effects |
|
|
121
246
|
| `<roxy-guna-milan>` | Vedic | POST /vedic-astrology/compatibility | 36-point Ashtakoota with eight sub-scores |
|
|
122
247
|
| `<roxy-kp-planets-table>` | Vedic (KP) | POST /vedic-astrology/kp/planets | Sub-lord and sub-sub-lord columns |
|
|
248
|
+
| `<roxy-transits-table>` | Western | POST /astrology/transits | Transit planet positions plus optional aspects to a natal chart |
|
|
249
|
+
| `<roxy-divisional-chart>` | Vedic | POST /vedic-astrology/divisional-chart | Generic divisional varga wheel from D2 Hora to D60 Shashtiamsa |
|
|
250
|
+
| `<roxy-ashtakavarga-grid>` | Vedic | POST /vedic-astrology/ashtakavarga | Sarva, Bhinna, and Shodhya Pinda views in a tabbed heatmap |
|
|
251
|
+
| `<roxy-shadbala-table>` | Vedic | POST /vedic-astrology/shadbala | Six-fold planetary strength bar plus rupas and adequacy badge |
|
|
252
|
+
| `<roxy-yoga-list>` | Vedic | GET /vedic-astrology/yoga, /yoga/{id} | Filterable yoga cards from the 300 plus yoga catalog |
|
|
253
|
+
| `<roxy-choghadiya-grid>` | Vedic | POST /vedic-astrology/panchang/choghadiya | Day and night Choghadiya muhurta tiles colored by effect |
|
|
123
254
|
| `<roxy-numerology-card>` | Numerology | POST /numerology/{life-path,expression,personal-year,chart} | Life path, expression, personal year, full chart |
|
|
124
255
|
| `<roxy-tarot-card>` | Tarot | GET /tarot/cards/{id}, POST /tarot/daily | Single card with upright and reversed flip |
|
|
125
256
|
| `<roxy-tarot-spread>` | Tarot | POST /tarot/spreads/{three-card,celtic-cross,love}, /tarot/yes-no, /tarot/draw | Spreads with positions and reading |
|
|
@@ -139,11 +270,10 @@ Always call `/location/search` first. Every chart endpoint expects latitude, lon
|
|
|
139
270
|
- Numerology calculators with full-chart breakdowns and personal year forecasts.
|
|
140
271
|
- Biorhythm dashboards with critical-day alerts.
|
|
141
272
|
- I Ching apps with hexagram lookup and three-coin casting.
|
|
142
|
-
- Founder hosted-app surfaces consuming the same components under brand themes.
|
|
143
273
|
|
|
144
274
|
## Theming
|
|
145
275
|
|
|
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.
|
|
276
|
+
Every component reads from `--roxy-*` CSS custom properties. Override globally on `:root` or per element. Light + dark defaults, container queries for responsive layouts at 320px and up. See [THEMING.md](https://github.com/RoxyAPI/ui/blob/main/packages/ui/THEMING.md) for the full token reference.
|
|
147
277
|
|
|
148
278
|
```css
|
|
149
279
|
:root {
|
|
@@ -167,10 +297,13 @@ roxy-natal-chart {
|
|
|
167
297
|
|
|
168
298
|
## Built for AI agents
|
|
169
299
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
300
|
+
[`AGENTS.md`](AGENTS.md) is bundled inside both npm packages. Once installed, agents can read it from `node_modules/@roxyapi/ui/AGENTS.md` (or `@roxyapi/ui-react/AGENTS.md`) for the component decision tree, integration patterns, and rules.
|
|
301
|
+
|
|
302
|
+
- Works with Claude Code, Cursor, Copilot, Codex, Gemini CLI, and any MCP-compatible client.
|
|
303
|
+
- Component decision tree maps each RoxyAPI endpoint to the component that renders its response.
|
|
304
|
+
- Typed prop shapes derive from the OpenAPI spec. The SDK at `@roxyapi/sdk` returns shapes that flow straight into `data`. No field renames, no glue code.
|
|
305
|
+
- Remote MCP servers per domain at `roxyapi.com/mcp/{domain}`. No local setup. JSON tool-call responses feed straight into the matching component.
|
|
306
|
+
- Use cases agents handle in one prompt: birth chart from city + DOB, daily tarot embed, Vedic kundli matching, numerology life-path card, biorhythm dashboard, daily horoscope by sign, panchang for the day, I Ching three-coin cast.
|
|
174
307
|
|
|
175
308
|
## Build anything, fast
|
|
176
309
|
|
|
@@ -183,7 +316,187 @@ bun run preview
|
|
|
183
316
|
# http://localhost:3001
|
|
184
317
|
```
|
|
185
318
|
|
|
186
|
-
|
|
319
|
+
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.
|
|
320
|
+
|
|
321
|
+
## Stack and integrations
|
|
322
|
+
|
|
323
|
+
Roxy UI runs in any framework that supports the DOM: **React, Next.js, Vue, Svelte, Angular, Solid, Astro, Qwik, Hono, Remix, Nuxt, SvelteKit, Lit, plain HTML, WordPress, Shopify themes that allow custom code, and any MCP-compatible AI agent**. Distribution paths: npm, jsDelivr CDN, shadcn registry. Use cases: astrology widgets, kundli matching, daily horoscope, tarot reader, numerology calculator, biorhythm dashboard, I Ching cast, panchang almanac, dasha timeline, moon phase tracker, synastry compatibility, dosha checker.
|
|
324
|
+
|
|
325
|
+
## FAQ
|
|
326
|
+
|
|
327
|
+
<details>
|
|
328
|
+
<summary><strong>How big is each component? What is the bundle cost?</strong></summary>
|
|
329
|
+
|
|
330
|
+
Per-component bundles run 8-10 KB gzipped, capped at 30 KB by CI. The full bundle (every component, helpers, base styles) is around 26 KB gzipped, capped at 150 KB. The React package loads the runtime on mount, so a route that renders one chart pays for one component, not the whole catalog. Pin a concrete version in production for byte-stable cache hits.
|
|
331
|
+
</details>
|
|
332
|
+
|
|
333
|
+
<details>
|
|
334
|
+
<summary><strong>Does this work with Next.js App Router, Remix, Nuxt, SvelteKit, and Astro?</strong></summary>
|
|
335
|
+
|
|
336
|
+
Yes. The components are standard custom elements; any framework that touches the DOM can mount them. For SSR/RSC frameworks, fetch on the server, pass the response to a client island. Next.js App Router pattern:
|
|
337
|
+
|
|
338
|
+
```tsx
|
|
339
|
+
// app/page.tsx (Server Component)
|
|
340
|
+
import { createRoxy } from '@roxyapi/sdk';
|
|
341
|
+
import ChartView from './chart-view';
|
|
342
|
+
|
|
343
|
+
const roxy = createRoxy(process.env.ROXY_API_KEY!);
|
|
344
|
+
|
|
345
|
+
export default async function Page() {
|
|
346
|
+
const { data } = await roxy.astrology.generateNatalChart({
|
|
347
|
+
body: { date: '1990-01-15', time: '14:30:00', latitude: 28.6139, longitude: 77.209, timezone: 5.5 },
|
|
348
|
+
});
|
|
349
|
+
return <ChartView data={data} />;
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
```tsx
|
|
354
|
+
// app/chart-view.tsx (Client Component)
|
|
355
|
+
'use client';
|
|
356
|
+
import { RoxyNatalChart } from '@roxyapi/ui-react';
|
|
357
|
+
|
|
358
|
+
export default function ChartView({ data }: { data: unknown }) {
|
|
359
|
+
return <RoxyNatalChart data={data} />;
|
|
360
|
+
}
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
The server component fetches, the client component renders. The API key never crosses the network. Same shape works in Remix loaders, Nuxt server routes, SvelteKit `+page.server.ts`, and Astro server endpoints.
|
|
364
|
+
</details>
|
|
365
|
+
|
|
366
|
+
<details>
|
|
367
|
+
<summary><strong>Tailwind v3 vs v4 compatibility?</strong></summary>
|
|
368
|
+
|
|
369
|
+
Both work. Components do not consume Tailwind utilities. Tailwind utilities apply outside the components on wrappers and containers; inside the Shadow DOM, components read `--roxy-*` CSS custom properties only.
|
|
370
|
+
|
|
371
|
+
For Tailwind v4 users, the shadcn registry installs a CSS bridge that maps your existing v4 design tokens onto `--roxy-*`. For Tailwind v3 users, set `--roxy-*` directly on `:root`, or write a tiny bridge:
|
|
372
|
+
|
|
373
|
+
```css
|
|
374
|
+
:root {
|
|
375
|
+
--roxy-bg: theme(colors.background);
|
|
376
|
+
--roxy-fg: theme(colors.foreground);
|
|
377
|
+
--roxy-accent: theme(colors.primary.DEFAULT);
|
|
378
|
+
--roxy-border: theme(colors.border);
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
</details>
|
|
382
|
+
|
|
383
|
+
<details>
|
|
384
|
+
<summary><strong>How do React 17/18 vs 19 differ for custom-event handling?</strong></summary>
|
|
385
|
+
|
|
386
|
+
React 19 routes hyphenated DOM events through camelCase props or lowercase attributes correctly, so `<RoxyLocationSearch onroxy-location-select={...}>` works as expected.
|
|
387
|
+
|
|
388
|
+
For React 17 and 18, use a ref plus `addEventListener` in `useEffect`:
|
|
389
|
+
|
|
390
|
+
```tsx
|
|
391
|
+
const ref = useRef<HTMLElement>(null);
|
|
392
|
+
useEffect(() => {
|
|
393
|
+
const el = ref.current;
|
|
394
|
+
if (!el) return;
|
|
395
|
+
const handler = (e: Event) => console.log((e as CustomEvent).detail);
|
|
396
|
+
el.addEventListener('roxy-location-select', handler);
|
|
397
|
+
return () => el.removeEventListener('roxy-location-select', handler);
|
|
398
|
+
}, []);
|
|
399
|
+
|
|
400
|
+
return <roxy-location-search ref={ref} />;
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
Upgrade to React 19 when you can; the wrappers route everything cleanly.
|
|
404
|
+
</details>
|
|
405
|
+
|
|
406
|
+
<details>
|
|
407
|
+
<summary><strong>Browser support matrix?</strong></summary>
|
|
408
|
+
|
|
409
|
+
Chrome 120+, Firefox 120+, Safari 17+, Edge 120+. The floor is set by ES modules, Custom Elements v1, Shadow DOM v1, container queries, and `color-mix()`. No polyfills shipped; older browsers fail loud rather than degrade silently. This covers ~95% of global traffic per Can I Use.
|
|
410
|
+
</details>
|
|
411
|
+
|
|
412
|
+
<details>
|
|
413
|
+
<summary><strong>Are the TypeScript types reliable?</strong></summary>
|
|
414
|
+
|
|
415
|
+
Yes. Component prop types are regenerated from the OpenAPI spec on every release via `@hey-api/openapi-ts`. Spec change in the API translates to typed change at the component boundary. There are no hand-written response shapes inside components, so types cannot drift from what the API returns. The SDK at `@roxyapi/sdk` shares the same type pipeline.
|
|
416
|
+
</details>
|
|
417
|
+
|
|
418
|
+
<details>
|
|
419
|
+
<summary><strong>What is the accessibility story?</strong></summary>
|
|
420
|
+
|
|
421
|
+
WAI-ARIA 1.2 throughout. Keyboard navigation on every interactive surface. Focus rings honor `--roxy-ring`. `prefers-reduced-motion: reduce` pins `--roxy-motion-duration` to `0ms` and disables entry animations. Color contrast hits WCAG AA at the defaults; verify any custom palette before shipping. CI runs axe-core against every component; zero blocking violations is a build gate.
|
|
422
|
+
</details>
|
|
423
|
+
|
|
424
|
+
<details>
|
|
425
|
+
<summary><strong>Why can my Tailwind classes not reach the chart inside the component?</strong></summary>
|
|
426
|
+
|
|
427
|
+
Components ship in Shadow DOM for style isolation; Tailwind utilities are scoped to the page tree and stop at the shadow boundary. This is by design: customer styles cannot accidentally bleed into a chart, and component styles cannot leak out. Theme through `--roxy-*` custom properties (they pierce the shadow boundary) on `:root` or per element.
|
|
428
|
+
</details>
|
|
429
|
+
|
|
430
|
+
<details>
|
|
431
|
+
<summary><strong>What is the security model for API keys?</strong></summary>
|
|
432
|
+
|
|
433
|
+
Two key classes. Secret keys (unprefixed) live server-side only and grant full access. Publishable keys (`pk_live_*` / `pk_test_*`) are browser-safe and locked to an origin allowlist registered on the key. The API gateway rejects requests from any other origin and counts the failed attempt against the rate limit, so a stolen key cannot be brute-fired from elsewhere.
|
|
434
|
+
|
|
435
|
+
For CSP, allow `script-src https://cdn.jsdelivr.net` if loading the bundle from the CDN. Subresource Integrity hashes are available via the jsDelivr SRI API for any pinned version.
|
|
436
|
+
</details>
|
|
437
|
+
|
|
438
|
+
<details>
|
|
439
|
+
<summary><strong>How does versioning work?</strong></summary>
|
|
440
|
+
|
|
441
|
+
Semver. Pre-1.0, minor bumps may include breaking changes (we will note them in the changelog). Patch bumps are always backwards-compatible. Pin a concrete version in production code:
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
npm install @roxyapi/ui@0.1.x
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
```html
|
|
448
|
+
<script src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.1.5/dist/cdn/roxy-ui.js"></script>
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
The `@latest` URL on this page is for paste-friendly marketing; production code should pin.
|
|
452
|
+
</details>
|
|
453
|
+
|
|
454
|
+
<details>
|
|
455
|
+
<summary><strong>How do I test components in my app?</strong></summary>
|
|
456
|
+
|
|
457
|
+
Mock `@roxyapi/sdk` at the network boundary so unit tests do not hit the live API. Snapshot the Shadow DOM output for visual stability. End-to-end with Playwright works well; the components emit semantic ARIA roles, so locators are stable across releases.
|
|
458
|
+
</details>
|
|
459
|
+
|
|
460
|
+
<details>
|
|
461
|
+
<summary><strong>What if I want to fork or own a component?</strong></summary>
|
|
462
|
+
|
|
463
|
+
Use the shadcn registry. The registry drops the component source, a wrapper file, and a CSS theme bridge into your repo. Edit anything; the source is yours from that point.
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
npx shadcn@latest add https://cdn.jsdelivr.net/gh/RoxyAPI/ui@latest/registry/natal-chart.json
|
|
467
|
+
```
|
|
468
|
+
</details>
|
|
469
|
+
|
|
470
|
+
<details>
|
|
471
|
+
<summary><strong>What if I need an endpoint that has no dedicated component?</strong></summary>
|
|
472
|
+
|
|
473
|
+
Use `<roxy-data>`. It is the generic fallback renderer; pass any RoxyAPI response and it produces a structured layout (tables, lists, badges) without bespoke logic. New endpoints render automatically; bespoke components ship only when a novel pattern emerges.
|
|
474
|
+
</details>
|
|
475
|
+
|
|
476
|
+
<details>
|
|
477
|
+
<summary><strong>Does this integrate with MCP-aware AI agents?</strong></summary>
|
|
478
|
+
|
|
479
|
+
Yes. RoxyAPI hosts a remote MCP server per domain at `roxyapi.com/mcp/{domain}`. Configure once, render anywhere:
|
|
480
|
+
|
|
481
|
+
```json
|
|
482
|
+
{
|
|
483
|
+
"mcpServers": {
|
|
484
|
+
"roxy-astrology": {
|
|
485
|
+
"url": "https://roxyapi.com/mcp/astrology",
|
|
486
|
+
"headers": { "Authorization": "Bearer <your-secret-key>" }
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
Tool-call JSON has the same shape as the SDK response. Pass it straight into the matching component.
|
|
493
|
+
</details>
|
|
494
|
+
|
|
495
|
+
<details>
|
|
496
|
+
<summary><strong>License and contribution?</strong></summary>
|
|
497
|
+
|
|
498
|
+
MIT. Source on [GitHub](https://github.com/RoxyAPI/ui). Open an issue or pull request for bugs and ideas. The component manifest is data-driven, so most additions are spec changes upstream rather than UI repo edits.
|
|
499
|
+
</details>
|
|
187
500
|
|
|
188
501
|
## License
|
|
189
502
|
|
package/THEMING.md
CHANGED
|
@@ -8,19 +8,20 @@ Every Roxy UI component reads its colors, fonts, spacing, and motion from a sing
|
|
|
8
8
|
|
|
9
9
|
| Variable | Light default | Dark default | Used by |
|
|
10
10
|
|---|---|---|---|
|
|
11
|
-
| `--roxy-
|
|
12
|
-
| `--roxy-
|
|
11
|
+
| `--roxy-bg` | `#ffffff` | `#0a0a0a` | Card and chart backgrounds |
|
|
12
|
+
| `--roxy-fg` | `#0a0a0a` | `#fafafa` | Body text, headings |
|
|
13
|
+
| `--roxy-muted` | `#71717a` | `#a1a1aa` | Secondary text, subheadings |
|
|
14
|
+
| `--roxy-border` | `#e4e4e7` | `#27272a` | Wheel lines, table borders |
|
|
13
15
|
| `--roxy-accent` | `#f59e0b` | `#fbbf24` | Planet glyphs, hexagram lines, focused state |
|
|
16
|
+
| `--roxy-accent-fg` | `#b45309` | `#fcd34d` | Accent-on-accent text (WCAG-AA contrast) |
|
|
14
17
|
| `--roxy-success` | `#16a34a` | `#22c55e` | Positive doshas, biorhythm peaks |
|
|
15
18
|
| `--roxy-warning` | `#ea580c` | `#fb923c` | Caution states, mid severity |
|
|
16
19
|
| `--roxy-danger` | `#dc2626` | `#ef4444` | Manglik present, critical days |
|
|
17
20
|
| `--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
21
|
| `--roxy-ring` | `rgba(245, 158, 11, 0.4)` | `rgba(251, 191, 36, 0.45)` | Focus outlines |
|
|
23
22
|
|
|
23
|
+
Status tokens each have a `-fg` variant (e.g. `--roxy-success-fg`) for text rendered on top of the status color, sized for WCAG-AA contrast.
|
|
24
|
+
|
|
24
25
|
### Typography
|
|
25
26
|
|
|
26
27
|
| Variable | Default | Notes |
|
|
@@ -112,7 +113,21 @@ Three opt-in mechanisms work out of the box.
|
|
|
112
113
|
|
|
113
114
|
### Map Tailwind tokens
|
|
114
115
|
|
|
115
|
-
Tailwind users can map our tokens to theirs in five lines of `globals.css
|
|
116
|
+
Tailwind users can map our tokens to theirs in five lines of `globals.css`. Pick the syntax that matches your Tailwind version.
|
|
117
|
+
|
|
118
|
+
**Tailwind v4 (CSS-first config, recommended):**
|
|
119
|
+
|
|
120
|
+
```css
|
|
121
|
+
:root {
|
|
122
|
+
--roxy-bg: var(--color-background);
|
|
123
|
+
--roxy-fg: var(--color-foreground);
|
|
124
|
+
--roxy-accent: var(--color-primary);
|
|
125
|
+
--roxy-border: var(--color-border);
|
|
126
|
+
--roxy-radius-md: var(--radius);
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Tailwind v3 (`tailwind.config.js`):**
|
|
116
131
|
|
|
117
132
|
```css
|
|
118
133
|
:root {
|
|
@@ -124,6 +139,8 @@ Tailwind users can map our tokens to theirs in five lines of `globals.css`:
|
|
|
124
139
|
}
|
|
125
140
|
```
|
|
126
141
|
|
|
142
|
+
If you used the shadcn registry path, this bridge installs automatically and reads from your existing shadcn tokens.
|
|
143
|
+
|
|
127
144
|
## A11y
|
|
128
145
|
|
|
129
146
|
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.
|