@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
|
@@ -10,7 +10,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
// packages/ui/src/components/vedic-kundli.ts
|
|
13
|
-
import { css as css2, html, LitElement
|
|
13
|
+
import { css as css2, html, LitElement } from "lit";
|
|
14
14
|
import { customElement, property } from "lit/decorators.js";
|
|
15
15
|
|
|
16
16
|
// packages/ui/src/tokens/index.ts
|
|
@@ -44,6 +44,23 @@ var SIGN_ABBR = {
|
|
|
44
44
|
Aquarius: "Aq",
|
|
45
45
|
Pisces: "Pi"
|
|
46
46
|
};
|
|
47
|
+
var SIGNS_ORDER = [
|
|
48
|
+
"Aries",
|
|
49
|
+
"Taurus",
|
|
50
|
+
"Gemini",
|
|
51
|
+
"Cancer",
|
|
52
|
+
"Leo",
|
|
53
|
+
"Virgo",
|
|
54
|
+
"Libra",
|
|
55
|
+
"Scorpio",
|
|
56
|
+
"Sagittarius",
|
|
57
|
+
"Capricorn",
|
|
58
|
+
"Aquarius",
|
|
59
|
+
"Pisces"
|
|
60
|
+
];
|
|
61
|
+
var RASHI_KEYS = SIGNS_ORDER.map(
|
|
62
|
+
(s) => s.toLowerCase()
|
|
63
|
+
);
|
|
47
64
|
|
|
48
65
|
// packages/ui/src/utils/base-styles.ts
|
|
49
66
|
import { css } from "lit";
|
|
@@ -131,7 +148,19 @@ var baseStyles = css`
|
|
|
131
148
|
}
|
|
132
149
|
`;
|
|
133
150
|
|
|
134
|
-
// packages/ui/src/
|
|
151
|
+
// packages/ui/src/utils/kundli-render.ts
|
|
152
|
+
import { nothing, svg } from "lit";
|
|
153
|
+
|
|
154
|
+
// packages/ui/src/utils/string.ts
|
|
155
|
+
function capitalize(s) {
|
|
156
|
+
if (!s) return "";
|
|
157
|
+
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// packages/ui/src/utils/kundli-render.ts
|
|
161
|
+
var RASHI_TO_SIGN = Object.fromEntries(
|
|
162
|
+
SIGNS_ORDER.map((s) => [s.toLowerCase(), s])
|
|
163
|
+
);
|
|
135
164
|
var SOUTH_HOUSE_CENTERS = {
|
|
136
165
|
1: { x: 150, y: 58 },
|
|
137
166
|
2: { x: 205, y: 52 },
|
|
@@ -160,34 +189,93 @@ var SOUTH_SIGN_POSITIONS = {
|
|
|
160
189
|
11: { x: 35, y: 100 },
|
|
161
190
|
12: { x: 78, y: 40 }
|
|
162
191
|
};
|
|
163
|
-
var
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
];
|
|
177
|
-
var RASHI_TO_SIGN = {
|
|
178
|
-
aries: "Aries",
|
|
179
|
-
taurus: "Taurus",
|
|
180
|
-
gemini: "Gemini",
|
|
181
|
-
cancer: "Cancer",
|
|
182
|
-
leo: "Leo",
|
|
183
|
-
virgo: "Virgo",
|
|
184
|
-
libra: "Libra",
|
|
185
|
-
scorpio: "Scorpio",
|
|
186
|
-
sagittarius: "Sagittarius",
|
|
187
|
-
capricorn: "Capricorn",
|
|
188
|
-
aquarius: "Aquarius",
|
|
189
|
-
pisces: "Pisces"
|
|
192
|
+
var NORTH_HOUSE_CENTERS = {
|
|
193
|
+
1: { x: 150, y: 60 },
|
|
194
|
+
2: { x: 225, y: 100 },
|
|
195
|
+
3: { x: 255, y: 150 },
|
|
196
|
+
4: { x: 225, y: 200 },
|
|
197
|
+
5: { x: 150, y: 240 },
|
|
198
|
+
6: { x: 75, y: 200 },
|
|
199
|
+
7: { x: 45, y: 150 },
|
|
200
|
+
8: { x: 75, y: 100 },
|
|
201
|
+
9: { x: 100, y: 80 },
|
|
202
|
+
10: { x: 150, y: 108 },
|
|
203
|
+
11: { x: 200, y: 80 },
|
|
204
|
+
12: { x: 200, y: 220 }
|
|
190
205
|
};
|
|
206
|
+
function renderSouthHouseGroup(h) {
|
|
207
|
+
const center = SOUTH_HOUSE_CENTERS[h.number];
|
|
208
|
+
const signPos = SOUTH_SIGN_POSITIONS[h.number];
|
|
209
|
+
if (!center || !signPos) return nothing;
|
|
210
|
+
const signAbbr = SIGN_ABBR[h.sign] ?? "";
|
|
211
|
+
const planets = h.planets;
|
|
212
|
+
return svg`
|
|
213
|
+
<g>
|
|
214
|
+
${h.isLagna ? svg`<rect
|
|
215
|
+
class="lagna-bg"
|
|
216
|
+
x=${center.x - 30} y=${center.y - 28}
|
|
217
|
+
width="60" height="56" rx="6"
|
|
218
|
+
/>` : nothing}
|
|
219
|
+
${signAbbr ? svg`<text class="sign-text" x=${signPos.x} y=${signPos.y} text-anchor="middle" dominant-baseline="central">${signAbbr}</text>` : nothing}
|
|
220
|
+
${h.isLagna ? svg`<text class="lagna-marker" x=${center.x} y=${center.y - 18} text-anchor="middle" dominant-baseline="central">LAGNA</text>` : nothing}
|
|
221
|
+
${planets.map((planet, j) => {
|
|
222
|
+
const abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);
|
|
223
|
+
const lineHeight = 13;
|
|
224
|
+
const baseY = h.isLagna ? center.y + 8 : center.y;
|
|
225
|
+
const startY = baseY - (planets.length - 1) * lineHeight / 2;
|
|
226
|
+
const yPos = startY + j * lineHeight;
|
|
227
|
+
return svg`<text class="planet-text" x=${center.x} y=${yPos} text-anchor="middle" dominant-baseline="central">${abbr}</text>`;
|
|
228
|
+
})}
|
|
229
|
+
</g>
|
|
230
|
+
`;
|
|
231
|
+
}
|
|
232
|
+
function renderNorthFrame() {
|
|
233
|
+
return svg`
|
|
234
|
+
<polygon class="line" points="150,10 290,150 150,290 10,150" stroke-width="1.5" />
|
|
235
|
+
<line class="line" x1="150" y1="10" x2="150" y2="290" stroke-width="1" />
|
|
236
|
+
<line class="line" x1="10" y1="150" x2="290" y2="150" stroke-width="1" />
|
|
237
|
+
<line class="line" x1="150" y1="10" x2="10" y2="150" stroke-width="0.6" stroke-dasharray="3,3" />
|
|
238
|
+
<line class="line" x1="150" y1="10" x2="290" y2="150" stroke-width="0.6" stroke-dasharray="3,3" />
|
|
239
|
+
<line class="line" x1="150" y1="290" x2="10" y2="150" stroke-width="0.6" stroke-dasharray="3,3" />
|
|
240
|
+
<line class="line" x1="150" y1="290" x2="290" y2="150" stroke-width="0.6" stroke-dasharray="3,3" />
|
|
241
|
+
`;
|
|
242
|
+
}
|
|
243
|
+
function renderNorthHouseGroup(h) {
|
|
244
|
+
const center = NORTH_HOUSE_CENTERS[h.number];
|
|
245
|
+
if (!center) return nothing;
|
|
246
|
+
const signAbbr = SIGN_ABBR[h.sign] ?? "";
|
|
247
|
+
const planets = h.planets;
|
|
248
|
+
return svg`
|
|
249
|
+
<g>
|
|
250
|
+
${h.isLagna ? svg`<circle class="lagna-bg" cx=${center.x} cy=${center.y} r="22" />` : nothing}
|
|
251
|
+
${signAbbr ? svg`<text class="sign-text" x=${center.x} y=${center.y - 10} text-anchor="middle" dominant-baseline="central">${signAbbr}</text>` : nothing}
|
|
252
|
+
<text class="house-num" x=${center.x} y=${center.y + 2} text-anchor="middle" dominant-baseline="central">${h.number}</text>
|
|
253
|
+
${planets.map((planet, j) => {
|
|
254
|
+
const abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);
|
|
255
|
+
const lineHeight = 11;
|
|
256
|
+
const startY = center.y + 14 - (planets.length - 1) * lineHeight / 2;
|
|
257
|
+
const yPos = startY + j * lineHeight;
|
|
258
|
+
return svg`<text class="planet-text" x=${center.x} y=${yPos} text-anchor="middle" dominant-baseline="central">${abbr}</text>`;
|
|
259
|
+
})}
|
|
260
|
+
</g>
|
|
261
|
+
`;
|
|
262
|
+
}
|
|
263
|
+
function renderSouthFrame() {
|
|
264
|
+
return svg`
|
|
265
|
+
<polygon class="line" points="150,10 290,150 150,290 10,150" stroke-width="1.5" />
|
|
266
|
+
<polygon class="line" points="220,80 220,220 80,220 80,80" stroke-width="1" fill="none" />
|
|
267
|
+
<line class="line" x1="150" y1="10" x2="80" y2="80" stroke-width="1" />
|
|
268
|
+
<line class="line" x1="150" y1="10" x2="220" y2="80" stroke-width="1" />
|
|
269
|
+
<line class="line" x1="290" y1="150" x2="220" y2="80" stroke-width="1" />
|
|
270
|
+
<line class="line" x1="290" y1="150" x2="220" y2="220" stroke-width="1" />
|
|
271
|
+
<line class="line" x1="150" y1="290" x2="220" y2="220" stroke-width="1" />
|
|
272
|
+
<line class="line" x1="150" y1="290" x2="80" y2="220" stroke-width="1" />
|
|
273
|
+
<line class="line" x1="10" y1="150" x2="80" y2="220" stroke-width="1" />
|
|
274
|
+
<line class="line" x1="10" y1="150" x2="80" y2="80" stroke-width="1" />
|
|
275
|
+
`;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// packages/ui/src/components/vedic-kundli.ts
|
|
191
279
|
var RoxyVedicKundli = class extends LitElement {
|
|
192
280
|
constructor() {
|
|
193
281
|
super(...arguments);
|
|
@@ -196,25 +284,19 @@ var RoxyVedicKundli = class extends LitElement {
|
|
|
196
284
|
}
|
|
197
285
|
buildHouses() {
|
|
198
286
|
if (!this.data) return [];
|
|
287
|
+
const data = this.data;
|
|
288
|
+
const lagnaSign = this.data?.meta?.Lagna?.rashi ?? "";
|
|
199
289
|
const houses = [];
|
|
200
|
-
if (Array.isArray(this.data.houses)) {
|
|
201
|
-
for (const h of this.data.houses) {
|
|
202
|
-
houses.push({
|
|
203
|
-
house: h.house ?? h.number ?? houses.length + 1,
|
|
204
|
-
sign: h.sign ?? "",
|
|
205
|
-
planets: h.planets ?? []
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
if (houses.length > 0) return houses;
|
|
209
|
-
}
|
|
210
290
|
for (let i = 0; i < 12; i++) {
|
|
211
291
|
const key = RASHI_KEYS[i];
|
|
212
|
-
const bucket =
|
|
213
|
-
const planets = (bucket?.signs ?? []).map((p) => p.
|
|
292
|
+
const bucket = data[key];
|
|
293
|
+
const planets = (bucket?.signs ?? []).map((p) => p.graha).filter(Boolean);
|
|
294
|
+
const sign = RASHI_TO_SIGN[key] ?? "";
|
|
214
295
|
houses.push({
|
|
215
|
-
|
|
216
|
-
sign
|
|
217
|
-
planets
|
|
296
|
+
number: i + 1,
|
|
297
|
+
sign,
|
|
298
|
+
planets,
|
|
299
|
+
isLagna: lagnaSign ? lagnaSign.toLowerCase() === sign.toLowerCase() : false
|
|
218
300
|
});
|
|
219
301
|
}
|
|
220
302
|
return houses;
|
|
@@ -223,6 +305,7 @@ var RoxyVedicKundli = class extends LitElement {
|
|
|
223
305
|
if (!this.data)
|
|
224
306
|
return html`<div class="roxy-empty" role="status">No kundli data</div>`;
|
|
225
307
|
const houses = this.buildHouses();
|
|
308
|
+
const isNorth = this.chartStyle === "north";
|
|
226
309
|
return html`<div class="wrap">
|
|
227
310
|
<h2 class="title">Vedic kundli</h2>
|
|
228
311
|
<svg
|
|
@@ -231,44 +314,11 @@ var RoxyVedicKundli = class extends LitElement {
|
|
|
231
314
|
aria-label="Vedic birth chart with twelve sign houses"
|
|
232
315
|
>
|
|
233
316
|
<title>Vedic kundli</title>
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
class="line"
|
|
237
|
-
points="220,80 220,220 80,220 80,80"
|
|
238
|
-
stroke-width="1"
|
|
239
|
-
fill="none"
|
|
240
|
-
/>
|
|
241
|
-
<line class="line" x1="150" y1="10" x2="80" y2="80" stroke-width="1" />
|
|
242
|
-
<line class="line" x1="150" y1="10" x2="220" y2="80" stroke-width="1" />
|
|
243
|
-
<line class="line" x1="290" y1="150" x2="220" y2="80" stroke-width="1" />
|
|
244
|
-
<line class="line" x1="290" y1="150" x2="220" y2="220" stroke-width="1" />
|
|
245
|
-
<line class="line" x1="150" y1="290" x2="220" y2="220" stroke-width="1" />
|
|
246
|
-
<line class="line" x1="150" y1="290" x2="80" y2="220" stroke-width="1" />
|
|
247
|
-
<line class="line" x1="10" y1="150" x2="80" y2="220" stroke-width="1" />
|
|
248
|
-
<line class="line" x1="10" y1="150" x2="80" y2="80" stroke-width="1" />
|
|
249
|
-
${houses.map((h) => this.renderHouseGroup(h))}
|
|
317
|
+
${isNorth ? renderNorthFrame() : renderSouthFrame()}
|
|
318
|
+
${isNorth ? houses.map((h) => renderNorthHouseGroup(h)) : houses.map((h) => renderSouthHouseGroup(h))}
|
|
250
319
|
</svg>
|
|
251
320
|
</div>`;
|
|
252
321
|
}
|
|
253
|
-
renderHouseGroup(h) {
|
|
254
|
-
const center = SOUTH_HOUSE_CENTERS[h.house];
|
|
255
|
-
const signPos = SOUTH_SIGN_POSITIONS[h.house];
|
|
256
|
-
if (!center || !signPos) return nothing;
|
|
257
|
-
const signAbbr = SIGN_ABBR[h.sign] ?? "";
|
|
258
|
-
const planets = h.planets ?? [];
|
|
259
|
-
return svg`
|
|
260
|
-
<g>
|
|
261
|
-
${signAbbr ? svg`<text class="sign-text" x=${signPos.x} y=${signPos.y} text-anchor="middle" dominant-baseline="central">${signAbbr}</text>` : nothing}
|
|
262
|
-
${planets.map((planet, j) => {
|
|
263
|
-
const abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);
|
|
264
|
-
const lineHeight = 13;
|
|
265
|
-
const startY = center.y - (planets.length - 1) * lineHeight / 2;
|
|
266
|
-
const yPos = startY + j * lineHeight;
|
|
267
|
-
return svg`<text class="planet-text" x=${center.x} y=${yPos} text-anchor="middle" dominant-baseline="central">${abbr}</text>`;
|
|
268
|
-
})}
|
|
269
|
-
</g>
|
|
270
|
-
`;
|
|
271
|
-
}
|
|
272
322
|
};
|
|
273
323
|
RoxyVedicKundli.styles = [
|
|
274
324
|
baseStyles,
|
|
@@ -304,6 +354,24 @@ RoxyVedicKundli.styles = [
|
|
|
304
354
|
font-weight: 600;
|
|
305
355
|
font-family: var(--roxy-font-sans);
|
|
306
356
|
}
|
|
357
|
+
.house-num {
|
|
358
|
+
fill: var(--roxy-muted, #71717a);
|
|
359
|
+
font-size: 9px;
|
|
360
|
+
font-weight: 400;
|
|
361
|
+
font-family: var(--roxy-font-sans);
|
|
362
|
+
}
|
|
363
|
+
.lagna-marker {
|
|
364
|
+
fill: var(--roxy-accent-fg, #b45309);
|
|
365
|
+
font-size: 8px;
|
|
366
|
+
font-weight: 700;
|
|
367
|
+
font-family: var(--roxy-font-sans);
|
|
368
|
+
letter-spacing: 0.05em;
|
|
369
|
+
}
|
|
370
|
+
.lagna-bg {
|
|
371
|
+
fill: color-mix(in srgb, var(--roxy-accent, #f59e0b) 12%, transparent);
|
|
372
|
+
stroke: color-mix(in srgb, var(--roxy-accent, #f59e0b) 45%, transparent);
|
|
373
|
+
stroke-width: 0.8;
|
|
374
|
+
}
|
|
307
375
|
`
|
|
308
376
|
];
|
|
309
377
|
__decorateClass([
|
|
@@ -315,10 +383,6 @@ __decorateClass([
|
|
|
315
383
|
RoxyVedicKundli = __decorateClass([
|
|
316
384
|
customElement("roxy-vedic-kundli")
|
|
317
385
|
], RoxyVedicKundli);
|
|
318
|
-
function capitalize(s) {
|
|
319
|
-
if (!s) return "";
|
|
320
|
-
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
|
|
321
|
-
}
|
|
322
386
|
export {
|
|
323
387
|
RoxyVedicKundli
|
|
324
388
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/vedic-kundli.ts", "../../src/tokens/index.ts", "../../src/utils/base-styles.ts"],
|
|
4
|
-
"sourcesContent": ["import { css, html, LitElement, nothing, svg } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { PLANET_ABBR, SIGN_ABBR } from '../tokens/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\n\ninterface KundliMeta {\n\t[planet: string]: {\n\t\tgraha?: string;\n\t\trashi?: string;\n\t\tlongitude?: number;\n\t\tnakshatra?: string;\n\t\tisRetrograde?: boolean;\n\t};\n}\n\ninterface RashiBucket {\n\trashi?: string;\n\tsigns?: Array<{\n\t\tplanet?: string;\n\t\tlongitude?: number;\n\t\tisRetrograde?: boolean;\n\t}>;\n}\n\ninterface KundliHouse {\n\thouse: number;\n\tsign: string;\n\tplanets: string[];\n}\n\ninterface KundliData {\n\tmeta?: KundliMeta;\n\thouses?: Array<{\n\t\thouse?: number;\n\t\tnumber?: number;\n\t\tsign?: string;\n\t\tplanets?: string[];\n\t}>;\n\tcombustion?: unknown[];\n\tplanetaryWar?: unknown[];\n\t[rashi: string]: unknown;\n}\n\nconst SOUTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 58 },\n\t2: { x: 205, y: 52 },\n\t3: { x: 253, y: 112 },\n\t4: { x: 243, y: 150 },\n\t5: { x: 253, y: 188 },\n\t6: { x: 205, y: 248 },\n\t7: { x: 150, y: 242 },\n\t8: { x: 95, y: 248 },\n\t9: { x: 47, y: 188 },\n\t10: { x: 57, y: 150 },\n\t11: { x: 47, y: 112 },\n\t12: { x: 95, y: 52 },\n};\n\nconst SOUTH_SIGN_POSITIONS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 35 },\n\t2: { x: 222, y: 40 },\n\t3: { x: 265, y: 100 },\n\t4: { x: 265, y: 150 },\n\t5: { x: 265, y: 200 },\n\t6: { x: 222, y: 260 },\n\t7: { x: 150, y: 265 },\n\t8: { x: 78, y: 260 },\n\t9: { x: 35, y: 200 },\n\t10: { x: 35, y: 150 },\n\t11: { x: 35, y: 100 },\n\t12: { x: 78, y: 40 },\n};\n\nconst RASHI_KEYS = [\n\t'aries',\n\t'taurus',\n\t'gemini',\n\t'cancer',\n\t'leo',\n\t'virgo',\n\t'libra',\n\t'scorpio',\n\t'sagittarius',\n\t'capricorn',\n\t'aquarius',\n\t'pisces',\n] as const;\n\nconst RASHI_TO_SIGN: Record<string, string> = {\n\taries: 'Aries',\n\ttaurus: 'Taurus',\n\tgemini: 'Gemini',\n\tcancer: 'Cancer',\n\tleo: 'Leo',\n\tvirgo: 'Virgo',\n\tlibra: 'Libra',\n\tscorpio: 'Scorpio',\n\tsagittarius: 'Sagittarius',\n\tcapricorn: 'Capricorn',\n\taquarius: 'Aquarius',\n\tpisces: 'Pisces',\n};\n\n/**\n * Vedic kundli (D1 Rashi chart). South Indian style by default. Pass `data`\n * from /vedic-astrology/birth-chart. North Indian style via style=\"north\".\n *\n * Lifted from jyotish-vedic-astrology-app/src/components/birth-chart.tsx,\n * keeping HOUSE_CENTERS + SIGN_POSITIONS + abbreviations, dropping the React\n * DOM color-probing hook in favor of CSS custom properties on :host.\n */\n@customElement('roxy-vedic-kundli')\nexport class RoxyVedicKundli extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.wrap {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.title {\n\t\t\t\tfont-size: var(--roxy-text-lg, 1.125rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\tsvg {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 100%;\n\t\t\t\tmax-width: 360px;\n\t\t\t\tmargin: 0 auto;\n\t\t\t}\n\t\t\t.line {\n\t\t\t\tfill: transparent;\n\t\t\t\tstroke: var(--roxy-border, #e4e4e7);\n\t\t\t}\n\t\t\t.sign-text {\n\t\t\t\tfill: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: 9px;\n\t\t\t\tfont-weight: 500;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.planet-text {\n\t\t\t\tfill: var(--roxy-fg, #0a0a0a);\n\t\t\t\tfont-size: 11px;\n\t\t\t\tfont-weight: 600;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t`,\n\t];\n\n\t@property({ attribute: false })\n\tdata: KundliData | null = null;\n\n\t@property({ type: String, reflect: true, attribute: 'chart-style' })\n\tchartStyle: 'south' | 'north' = 'south';\n\n\tprivate buildHouses(): KundliHouse[] {\n\t\tif (!this.data) return [];\n\t\tconst houses: KundliHouse[] = [];\n\t\t// Prefer normalized .houses array if present\n\t\tif (Array.isArray(this.data.houses)) {\n\t\t\tfor (const h of this.data.houses) {\n\t\t\t\thouses.push({\n\t\t\t\t\thouse: (h.house ?? h.number ?? houses.length + 1) as number,\n\t\t\t\t\tsign: h.sign ?? '',\n\t\t\t\t\tplanets: h.planets ?? [],\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (houses.length > 0) return houses;\n\t\t}\n\t\t// Otherwise read the rashi buckets and project them as houses 1..12\n\t\t// keyed by sign order. Lagna-anchored ordering would require knowing\n\t\t// the ascendant rashi; we render rashi buckets directly which is the\n\t\t// canonical South Indian layout.\n\t\tfor (let i = 0; i < 12; i++) {\n\t\t\tconst key = RASHI_KEYS[i];\n\t\t\tconst bucket = this.data[key] as RashiBucket | undefined;\n\t\t\tconst planets = (bucket?.signs ?? [])\n\t\t\t\t.map((p) => p.planet ?? '')\n\t\t\t\t.filter(Boolean);\n\t\t\thouses.push({\n\t\t\t\thouse: i + 1,\n\t\t\t\tsign: RASHI_TO_SIGN[key] ?? '',\n\t\t\t\tplanets,\n\t\t\t});\n\t\t}\n\t\treturn houses;\n\t}\n\n\trender() {\n\t\tif (!this.data)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No kundli data</div>`;\n\t\tconst houses = this.buildHouses();\n\n\t\treturn html`<div class=\"wrap\">\n\t\t\t<h2 class=\"title\">Vedic kundli</h2>\n\t\t\t<svg\n\t\t\t\tviewBox=\"0 0 300 300\"\n\t\t\t\trole=\"img\"\n\t\t\t\taria-label=\"Vedic birth chart with twelve sign houses\"\n\t\t\t>\n\t\t\t\t<title>Vedic kundli</title>\n\t\t\t\t<polygon class=\"line\" points=\"150,10 290,150 150,290 10,150\" stroke-width=\"1.5\" />\n\t\t\t\t<polygon\n\t\t\t\t\tclass=\"line\"\n\t\t\t\t\tpoints=\"220,80 220,220 80,220 80,80\"\n\t\t\t\t\tstroke-width=\"1\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"80\" y2=\"80\" stroke-width=\"1\" />\n\t\t\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"220\" y2=\"80\" stroke-width=\"1\" />\n\t\t\t\t<line class=\"line\" x1=\"290\" y1=\"150\" x2=\"220\" y2=\"80\" stroke-width=\"1\" />\n\t\t\t\t<line class=\"line\" x1=\"290\" y1=\"150\" x2=\"220\" y2=\"220\" stroke-width=\"1\" />\n\t\t\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"220\" y2=\"220\" stroke-width=\"1\" />\n\t\t\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"80\" y2=\"220\" stroke-width=\"1\" />\n\t\t\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"80\" y2=\"220\" stroke-width=\"1\" />\n\t\t\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"80\" y2=\"80\" stroke-width=\"1\" />\n\t\t\t\t${houses.map((h) => this.renderHouseGroup(h))}\n\t\t\t</svg>\n\t\t</div>`;\n\t}\n\n\tprivate renderHouseGroup(h: KundliHouse) {\n\t\tconst center = SOUTH_HOUSE_CENTERS[h.house];\n\t\tconst signPos = SOUTH_SIGN_POSITIONS[h.house];\n\t\tif (!center || !signPos) return nothing;\n\t\tconst signAbbr = SIGN_ABBR[h.sign] ?? '';\n\t\tconst planets = h.planets ?? [];\n\t\treturn svg`\n\t\t\t<g>\n\t\t\t\t${\n\t\t\t\t\tsignAbbr\n\t\t\t\t\t\t? svg`<text class=\"sign-text\" x=${signPos.x} y=${signPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${signAbbr}</text>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t\t${planets.map((planet, j) => {\n\t\t\t\t\tconst abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);\n\t\t\t\t\tconst lineHeight = 13;\n\t\t\t\t\tconst startY = center.y - ((planets.length - 1) * lineHeight) / 2;\n\t\t\t\t\tconst yPos = startY + j * lineHeight;\n\t\t\t\t\treturn svg`<text class=\"planet-text\" x=${center.x} y=${yPos} text-anchor=\"middle\" dominant-baseline=\"central\">${abbr}</text>`;\n\t\t\t\t})}\n\t\t\t</g>\n\t\t`;\n\t}\n}\n\nfunction capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-vedic-kundli': RoxyVedicKundli;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`\n\t:host {\n\t\tdisplay: block;\n\t\tcontainer-type: inline-size;\n\t\tfont-family: var(\n\t\t\t--roxy-font-sans,\n\t\t\tsystem-ui,\n\t\t\t-apple-system,\n\t\t\tBlinkMacSystemFont,\n\t\t\t'Segoe UI',\n\t\t\tRoboto,\n\t\t\tsans-serif\n\t\t);\n\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\tbackground: transparent;\n\t\tfont-size: var(--roxy-text-base, 1rem);\n\t\tline-height: var(--roxy-leading-normal, 1.5);\n\t\tanimation: roxy-fade-in var(--roxy-motion-duration, 200ms)\n\t\t\tvar(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;\n\t}\n\n\t*,\n\t*::before,\n\t*::after {\n\t\tbox-sizing: border-box;\n\t}\n\n\t@keyframes roxy-fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(2px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-skeleton {\n\t\tbackground: linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--roxy-border, #e4e4e7) 0%,\n\t\t\tcolor-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,\n\t\t\tvar(--roxy-border, #e4e4e7) 100%\n\t\t);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: roxy-shimmer 1.4s ease-in-out infinite;\n\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t}\n\n\t@keyframes roxy-shimmer {\n\t\t0% {\n\t\t\tbackground-position: 200% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -200% 0;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.roxy-skeleton {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-empty {\n\t\tpadding: var(--roxy-space-lg, 1.5rem);\n\t\tcolor: var(--roxy-muted, #71717a);\n\t\ttext-align: center;\n\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t}\n\n\t:host(:focus-within) .roxy-card {\n\t\toutline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));\n\t\toutline-offset: 2px;\n\t}\n`;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAAA,SAAS,OAAAA,MAAK,MAAM,
|
|
3
|
+
"sources": ["../../src/components/vedic-kundli.ts", "../../src/tokens/index.ts", "../../src/utils/base-styles.ts", "../../src/utils/kundli-render.ts", "../../src/utils/string.ts"],
|
|
4
|
+
"sourcesContent": ["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { RASHI_KEYS } from '../tokens/index.js';\nimport type { BirthChartResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport type { HouseDef } from '../utils/kundli-render.js';\nimport {\n\tRASHI_TO_SIGN,\n\trenderNorthFrame,\n\trenderNorthHouseGroup,\n\trenderSouthFrame,\n\trenderSouthHouseGroup,\n} from '../utils/kundli-render.js';\n\ntype RashiBucket = BirthChartResponse['aries'];\n\n// The /vedic-astrology/birth-chart response carries all 12 rashi keys\n// (aries, taurus, ..., pisces), each shaped like the spec-typed `aries`\n// bucket. This local alias indexes by rashi name without per-call casts.\ntype BirthChartByRashi = BirthChartResponse & Record<string, RashiBucket>;\n\n/**\n * Vedic kundli (D1 Rashi chart). South Indian style by default. Pass `data`\n * from /vedic-astrology/birth-chart. North Indian style via chartStyle=\"north\".\n *\n * Theming flows through CSS custom properties on :host, so the chart adopts\n * the host page palette without runtime color probing.\n */\n@customElement('roxy-vedic-kundli')\nexport class RoxyVedicKundli extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.wrap {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.title {\n\t\t\t\tfont-size: var(--roxy-text-lg, 1.125rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\tsvg {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 100%;\n\t\t\t\tmax-width: 360px;\n\t\t\t\tmargin: 0 auto;\n\t\t\t}\n\t\t\t.line {\n\t\t\t\tfill: transparent;\n\t\t\t\tstroke: var(--roxy-border, #e4e4e7);\n\t\t\t}\n\t\t\t.sign-text {\n\t\t\t\tfill: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: 9px;\n\t\t\t\tfont-weight: 500;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.planet-text {\n\t\t\t\tfill: var(--roxy-fg, #0a0a0a);\n\t\t\t\tfont-size: 11px;\n\t\t\t\tfont-weight: 600;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.house-num {\n\t\t\t\tfill: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: 9px;\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.lagna-marker {\n\t\t\t\tfill: var(--roxy-accent-fg, #b45309);\n\t\t\t\tfont-size: 8px;\n\t\t\t\tfont-weight: 700;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t\tletter-spacing: 0.05em;\n\t\t\t}\n\t\t\t.lagna-bg {\n\t\t\t\tfill: color-mix(in srgb, var(--roxy-accent, #f59e0b) 12%, transparent);\n\t\t\t\tstroke: color-mix(in srgb, var(--roxy-accent, #f59e0b) 45%, transparent);\n\t\t\t\tstroke-width: 0.8;\n\t\t\t}\n\t\t`,\n\t];\n\n\t@property({ attribute: false })\n\tdata: BirthChartResponse | null = null;\n\n\t@property({ type: String, reflect: true, attribute: 'chart-style' })\n\tchartStyle: 'south' | 'north' = 'south';\n\n\tprivate buildHouses(): HouseDef[] {\n\t\tif (!this.data) return [];\n\t\tconst data = this.data as BirthChartByRashi;\n\t\tconst lagnaSign = this.data?.meta?.Lagna?.rashi ?? '';\n\t\tconst houses: HouseDef[] = [];\n\t\tfor (let i = 0; i < 12; i++) {\n\t\t\tconst key = RASHI_KEYS[i];\n\t\t\tconst bucket = data[key];\n\t\t\tconst planets = (bucket?.signs ?? []).map((p) => p.graha).filter(Boolean);\n\t\t\tconst sign = RASHI_TO_SIGN[key] ?? '';\n\t\t\thouses.push({\n\t\t\t\tnumber: i + 1,\n\t\t\t\tsign,\n\t\t\t\tplanets,\n\t\t\t\tisLagna: lagnaSign\n\t\t\t\t\t? lagnaSign.toLowerCase() === sign.toLowerCase()\n\t\t\t\t\t: false,\n\t\t\t});\n\t\t}\n\t\treturn houses;\n\t}\n\n\trender() {\n\t\tif (!this.data)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No kundli data</div>`;\n\t\tconst houses = this.buildHouses();\n\t\tconst isNorth = this.chartStyle === 'north';\n\n\t\treturn html`<div class=\"wrap\">\n\t\t\t<h2 class=\"title\">Vedic kundli</h2>\n\t\t\t<svg\n\t\t\t\tviewBox=\"0 0 300 300\"\n\t\t\t\trole=\"img\"\n\t\t\t\taria-label=\"Vedic birth chart with twelve sign houses\"\n\t\t\t>\n\t\t\t\t<title>Vedic kundli</title>\n\t\t\t\t${isNorth ? renderNorthFrame() : renderSouthFrame()}\n\t\t\t\t${\n\t\t\t\t\tisNorth\n\t\t\t\t\t\t? houses.map((h) => renderNorthHouseGroup(h))\n\t\t\t\t\t\t: houses.map((h) => renderSouthHouseGroup(h))\n\t\t\t\t}\n\t\t\t</svg>\n\t\t</div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-vedic-kundli': RoxyVedicKundli;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`\n\t:host {\n\t\tdisplay: block;\n\t\tcontainer-type: inline-size;\n\t\tfont-family: var(\n\t\t\t--roxy-font-sans,\n\t\t\tsystem-ui,\n\t\t\t-apple-system,\n\t\t\tBlinkMacSystemFont,\n\t\t\t'Segoe UI',\n\t\t\tRoboto,\n\t\t\tsans-serif\n\t\t);\n\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\tbackground: transparent;\n\t\tfont-size: var(--roxy-text-base, 1rem);\n\t\tline-height: var(--roxy-leading-normal, 1.5);\n\t\tanimation: roxy-fade-in var(--roxy-motion-duration, 200ms)\n\t\t\tvar(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;\n\t}\n\n\t*,\n\t*::before,\n\t*::after {\n\t\tbox-sizing: border-box;\n\t}\n\n\t@keyframes roxy-fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(2px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-skeleton {\n\t\tbackground: linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--roxy-border, #e4e4e7) 0%,\n\t\t\tcolor-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,\n\t\t\tvar(--roxy-border, #e4e4e7) 100%\n\t\t);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: roxy-shimmer 1.4s ease-in-out infinite;\n\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t}\n\n\t@keyframes roxy-shimmer {\n\t\t0% {\n\t\t\tbackground-position: 200% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -200% 0;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.roxy-skeleton {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-empty {\n\t\tpadding: var(--roxy-space-lg, 1.5rem);\n\t\tcolor: var(--roxy-muted, #71717a);\n\t\ttext-align: center;\n\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t}\n\n\t:host(:focus-within) .roxy-card {\n\t\toutline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));\n\t\toutline-offset: 2px;\n\t}\n`;\n", "import type { TemplateResult } from 'lit';\nimport { nothing, svg } from 'lit';\nimport { PLANET_ABBR, SIGN_ABBR, SIGNS_ORDER } from '../tokens/index.js';\nimport { capitalize } from './string.js';\n\nexport const KUNDLI_SIZE = 300;\nexport const KUNDLI_CENTER = 150;\n\n/**\n * Maps a lowercase rashi key (e.g. \"aries\") back to its canonical sign name\n * (e.g. \"Aries\"). Used by every kundli consumer to bridge spec lowercase\n * rashi keys to the title-cased SIGNS_ORDER tokens.\n */\nexport const RASHI_TO_SIGN: Record<string, string> = Object.fromEntries(\n\tSIGNS_ORDER.map((s) => [s.toLowerCase(), s] as const),\n);\n\n/**\n * South Indian fixed-house square grid: house centers for planet text labels.\n * House 1 is fixed top-center; positions are in the 300x300 viewBox.\n */\nexport const SOUTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 58 },\n\t2: { x: 205, y: 52 },\n\t3: { x: 253, y: 112 },\n\t4: { x: 243, y: 150 },\n\t5: { x: 253, y: 188 },\n\t6: { x: 205, y: 248 },\n\t7: { x: 150, y: 242 },\n\t8: { x: 95, y: 248 },\n\t9: { x: 47, y: 188 },\n\t10: { x: 57, y: 150 },\n\t11: { x: 47, y: 112 },\n\t12: { x: 95, y: 52 },\n};\n\n/**\n * South Indian sign abbreviation positions (slightly outward from center).\n */\nexport const SOUTH_SIGN_POSITIONS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 35 },\n\t2: { x: 222, y: 40 },\n\t3: { x: 265, y: 100 },\n\t4: { x: 265, y: 150 },\n\t5: { x: 265, y: 200 },\n\t6: { x: 222, y: 260 },\n\t7: { x: 150, y: 265 },\n\t8: { x: 78, y: 260 },\n\t9: { x: 35, y: 200 },\n\t10: { x: 35, y: 150 },\n\t11: { x: 35, y: 100 },\n\t12: { x: 78, y: 40 },\n};\n\n/**\n * North Indian style: 12 triangular house positions.\n * Lagna (house 1) is the top diamond, numbered clockwise.\n * Centers represent the visual midpoint of each triangular cell.\n */\nexport const NORTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 60 },\n\t2: { x: 225, y: 100 },\n\t3: { x: 255, y: 150 },\n\t4: { x: 225, y: 200 },\n\t5: { x: 150, y: 240 },\n\t6: { x: 75, y: 200 },\n\t7: { x: 45, y: 150 },\n\t8: { x: 75, y: 100 },\n\t9: { x: 100, y: 80 },\n\t10: { x: 150, y: 108 },\n\t11: { x: 200, y: 80 },\n\t12: { x: 200, y: 220 },\n};\n\nexport interface HouseDef {\n\t/** 1-based house number. */\n\tnumber: number;\n\t/** Sign name (TitleCase, e.g. \"Aries\"). */\n\tsign: string;\n\t/** Planet abbreviation strings to display. */\n\tplanets: string[];\n\t/** Whether this house is the ascendant (Lagna). */\n\tisLagna: boolean;\n}\n\n/**\n * Render a single house group: lagna highlight, sign abbreviation, planet labels.\n * Returns an SVG fragment for use inside an `<svg>` element.\n */\nexport function renderSouthHouseGroup(\n\th: HouseDef,\n): TemplateResult | typeof nothing {\n\tconst center = SOUTH_HOUSE_CENTERS[h.number];\n\tconst signPos = SOUTH_SIGN_POSITIONS[h.number];\n\tif (!center || !signPos) return nothing;\n\tconst signAbbr = SIGN_ABBR[h.sign] ?? '';\n\tconst planets = h.planets;\n\treturn svg`\n\t\t<g>\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<rect\n\t\t\t\t\t\t\tclass=\"lagna-bg\"\n\t\t\t\t\t\t\tx=${center.x - 30} y=${center.y - 28}\n\t\t\t\t\t\t\twidth=\"60\" height=\"56\" rx=\"6\"\n\t\t\t\t\t\t/>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tsignAbbr\n\t\t\t\t\t? svg`<text class=\"sign-text\" x=${signPos.x} y=${signPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${signAbbr}</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<text class=\"lagna-marker\" x=${center.x} y=${center.y - 18} text-anchor=\"middle\" dominant-baseline=\"central\">LAGNA</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${planets.map((planet, j) => {\n\t\t\t\tconst abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);\n\t\t\t\tconst lineHeight = 13;\n\t\t\t\tconst baseY = h.isLagna ? center.y + 8 : center.y;\n\t\t\t\tconst startY = baseY - ((planets.length - 1) * lineHeight) / 2;\n\t\t\t\tconst yPos = startY + j * lineHeight;\n\t\t\t\treturn svg`<text class=\"planet-text\" x=${center.x} y=${yPos} text-anchor=\"middle\" dominant-baseline=\"central\">${abbr}</text>`;\n\t\t\t})}\n\t\t</g>\n\t`;\n}\n\n/**\n * Render a north-Indian-style kundli wheel frame (grid lines only).\n * Returns the SVG structural lines; call `renderNorthHouseGroup` for content.\n */\nexport function renderNorthFrame(): TemplateResult {\n\treturn svg`\n\t\t<polygon class=\"line\" points=\"150,10 290,150 150,290 10,150\" stroke-width=\"1.5\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"150\" y2=\"290\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"290\" y2=\"150\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"10\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"290\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"10\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"290\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t`;\n}\n\n/**\n * Render a north-Indian house group (sign abbr + house number + planets).\n */\nexport function renderNorthHouseGroup(\n\th: HouseDef,\n): TemplateResult | typeof nothing {\n\tconst center = NORTH_HOUSE_CENTERS[h.number];\n\tif (!center) return nothing;\n\tconst signAbbr = SIGN_ABBR[h.sign] ?? '';\n\tconst planets = h.planets;\n\treturn svg`\n\t\t<g>\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<circle class=\"lagna-bg\" cx=${center.x} cy=${center.y} r=\"22\" />`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tsignAbbr\n\t\t\t\t\t? svg`<text class=\"sign-text\" x=${center.x} y=${center.y - 10} text-anchor=\"middle\" dominant-baseline=\"central\">${signAbbr}</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t<text class=\"house-num\" x=${center.x} y=${center.y + 2} text-anchor=\"middle\" dominant-baseline=\"central\">${h.number}</text>\n\t\t\t${planets.map((planet, j) => {\n\t\t\t\tconst abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);\n\t\t\t\tconst lineHeight = 11;\n\t\t\t\tconst startY = center.y + 14 - ((planets.length - 1) * lineHeight) / 2;\n\t\t\t\tconst yPos = startY + j * lineHeight;\n\t\t\t\treturn svg`<text class=\"planet-text\" x=${center.x} y=${yPos} text-anchor=\"middle\" dominant-baseline=\"central\">${abbr}</text>`;\n\t\t\t})}\n\t\t</g>\n\t`;\n}\n\n/**\n * Render the south-Indian square frame (border diamond + inner square + radial lines).\n */\nexport function renderSouthFrame(): TemplateResult {\n\treturn svg`\n\t\t<polygon class=\"line\" points=\"150,10 290,150 150,290 10,150\" stroke-width=\"1.5\" />\n\t\t<polygon class=\"line\" points=\"220,80 220,220 80,220 80,80\" stroke-width=\"1\" fill=\"none\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"80\" y2=\"80\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"220\" y2=\"80\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"290\" y1=\"150\" x2=\"220\" y2=\"80\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"290\" y1=\"150\" x2=\"220\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"220\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"80\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"80\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"80\" y2=\"80\" stroke-width=\"1\" />\n\t`;\n}\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t.replace(/^\\w/, (c) => c.toUpperCase());\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAAA,SAAS,OAAAA,MAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;;;AC8BjC,IAAM,cAAsC;AAAA,EAClD,KAAK;AAAA,EACL,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW;AAAA,EACX,OAAO;AACR;AAiBO,IAAM,YAAoC;AAAA,EAChD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AACT;AAEO,IAAM,cAAc;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAOO,IAAM,aAAa,YAAY;AAAA,EAAI,CAAC,MAC1C,EAAE,YAAY;AACf;;;ACpGA,SAAS,WAAW;AAMb,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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MACJ,CAAC;AAAA,IACF;AACA,WAAO;AAAA,EACR;AAAA,EAEA,SAAS;AACR,QAAI,CAAC,KAAK;AACT,aAAO;AACR,UAAM,SAAS,KAAK,YAAY;AAChC,UAAM,UAAU,KAAK,eAAe;AAEpC,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQH,UAAU,iBAAiB,IAAI,iBAAiB,CAAC;AAAA,MAElD,UACG,OAAO,IAAI,CAAC,MAAM,sBAAsB,CAAC,CAAC,IAC1C,OAAO,IAAI,CAAC,MAAM,sBAAsB,CAAC,CAAC,CAC9C;AAAA;AAAA;AAAA,EAGH;AACD;AA3Ga,gBACL,SAAS;AAAA,EACf;AAAA,EACAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDD;AAGA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAxDlB,gBAyDZ;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc,CAAC;AAAA,GA3DvD,gBA4DZ;AA5DY,kBAAN;AAAA,EADN,cAAc,mBAAmB;AAAA,GACrB;",
|
|
6
6
|
"names": ["css", "css"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { GetYogaResponse, ListYogasResponse } from '../types/index.js';
|
|
3
|
+
type YogaListData = ListYogasResponse | GetYogaResponse | {
|
|
4
|
+
yogas: Array<GetYogaResponse>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Yoga catalog and detail renderer. Accepts three data modes:
|
|
8
|
+
* - Catalog: ListYogasResponse (yogas array of {id, name} + total)
|
|
9
|
+
* - Detail: GetYogaResponse (single yoga with description, result, quality)
|
|
10
|
+
* - Detail array: { yogas: Array<GetYogaResponse> } for pre-filtered sets
|
|
11
|
+
*
|
|
12
|
+
* Catalog and detail-array modes include a live search filter.
|
|
13
|
+
*/
|
|
14
|
+
export declare class RoxyYogaList extends LitElement {
|
|
15
|
+
static styles: import("lit").CSSResult[];
|
|
16
|
+
data: YogaListData | null;
|
|
17
|
+
private filter;
|
|
18
|
+
private readonly handleInput;
|
|
19
|
+
private renderQualityChip;
|
|
20
|
+
private renderDetailCard;
|
|
21
|
+
render(): import("lit").TemplateResult<1>;
|
|
22
|
+
}
|
|
23
|
+
declare global {
|
|
24
|
+
interface HTMLElementTagNameMap {
|
|
25
|
+
'roxy-yoga-list': RoxyYogaList;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=yoga-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yoga-list.d.ts","sourceRoot":"","sources":["../../src/components/yoga-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI5E,KAAK,YAAY,GACd,iBAAiB,GACjB,eAAe,GACf;IAAE,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;CAAE,CAAC;AAErC;;;;;;;GAOG;AACH,qBACa,YAAa,SAAQ,UAAU;IAC3C,MAAM,CAAC,MAAM,4BAuJX;IAGF,IAAI,EAAE,YAAY,GAAG,IAAI,CAAQ;IAGjC,OAAO,CAAC,MAAM,CAAM;IAEpB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAEpB;IAER,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,gBAAgB;IAsBxB,MAAM;CA8GN;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gBAAgB,EAAE,YAAY,CAAC;KAC/B;CACD"}
|