@roxyapi/ui 0.19.4 → 0.20.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.
Files changed (118) hide show
  1. package/AGENTS.md +10 -7
  2. package/README.md +9 -6
  3. package/components-catalog.json +166 -114
  4. package/dist/cdn/components/arudha-padas.js +313 -0
  5. package/dist/cdn/components/arudha-padas.js.map +7 -0
  6. package/dist/cdn/components/chara-karakas.js +313 -0
  7. package/dist/cdn/components/chara-karakas.js.map +7 -0
  8. package/dist/cdn/components/dasha-timeline.js +4 -4
  9. package/dist/cdn/components/dasha-timeline.js.map +4 -4
  10. package/dist/cdn/components/endpoint-form.js +1 -1
  11. package/dist/cdn/components/endpoint-form.js.map +1 -1
  12. package/dist/cdn/components/kp-chart.js +4 -4
  13. package/dist/cdn/components/kp-chart.js.map +4 -4
  14. package/dist/cdn/components/kp-ruling-planets.js +3 -3
  15. package/dist/cdn/components/kp-ruling-planets.js.map +4 -4
  16. package/dist/cdn/components/reference-card.js +3 -3
  17. package/dist/cdn/components/reference-card.js.map +2 -2
  18. package/dist/cdn/components/upagraha-table.js +313 -0
  19. package/dist/cdn/components/upagraha-table.js.map +7 -0
  20. package/dist/cdn/components/vedic-planets-table.js +2 -2
  21. package/dist/cdn/components/vedic-planets-table.js.map +2 -2
  22. package/dist/cdn/components/yoga-list.js +4 -4
  23. package/dist/cdn/components/yoga-list.js.map +3 -3
  24. package/dist/cdn/roxy-ui.js +78 -78
  25. package/dist/cdn/roxy-ui.js.map +4 -4
  26. package/dist/cdn/widgets.js +1 -1
  27. package/dist/components/arudha-padas.d.ts +22 -0
  28. package/dist/components/arudha-padas.d.ts.map +1 -0
  29. package/dist/components/arudha-padas.js +2 -0
  30. package/dist/components/arudha-padas.js.map +7 -0
  31. package/dist/components/chara-karakas.d.ts +22 -0
  32. package/dist/components/chara-karakas.d.ts.map +1 -0
  33. package/dist/components/chara-karakas.js +2 -0
  34. package/dist/components/chara-karakas.js.map +7 -0
  35. package/dist/components/dasha-timeline.d.ts +18 -13
  36. package/dist/components/dasha-timeline.d.ts.map +1 -1
  37. package/dist/components/dasha-timeline.js +1 -1
  38. package/dist/components/dasha-timeline.js.map +4 -4
  39. package/dist/components/endpoint-form.js +1 -1
  40. package/dist/components/endpoint-form.js.map +1 -1
  41. package/dist/components/kp-chart.d.ts +7 -0
  42. package/dist/components/kp-chart.d.ts.map +1 -1
  43. package/dist/components/kp-chart.js +1 -1
  44. package/dist/components/kp-chart.js.map +4 -4
  45. package/dist/components/kp-ruling-planets.d.ts +6 -0
  46. package/dist/components/kp-ruling-planets.d.ts.map +1 -1
  47. package/dist/components/kp-ruling-planets.js +1 -1
  48. package/dist/components/kp-ruling-planets.js.map +4 -4
  49. package/dist/components/reference-card.d.ts +2 -2
  50. package/dist/components/reference-card.d.ts.map +1 -1
  51. package/dist/components/reference-card.js +1 -1
  52. package/dist/components/reference-card.js.map +2 -2
  53. package/dist/components/upagraha-table.d.ts +22 -0
  54. package/dist/components/upagraha-table.d.ts.map +1 -0
  55. package/dist/components/upagraha-table.js +2 -0
  56. package/dist/components/upagraha-table.js.map +7 -0
  57. package/dist/components/vedic-planets-table.d.ts +10 -1
  58. package/dist/components/vedic-planets-table.d.ts.map +1 -1
  59. package/dist/components/vedic-planets-table.js +1 -1
  60. package/dist/components/vedic-planets-table.js.map +2 -2
  61. package/dist/components/yoga-list.d.ts +13 -2
  62. package/dist/components/yoga-list.d.ts.map +1 -1
  63. package/dist/components/yoga-list.js +1 -1
  64. package/dist/components/yoga-list.js.map +3 -3
  65. package/dist/generated/endpoint-bindings.d.ts.map +1 -1
  66. package/dist/index.cjs +46 -46
  67. package/dist/index.cjs.map +4 -4
  68. package/dist/index.d.ts +3 -0
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +51 -51
  71. package/dist/index.js.map +4 -4
  72. package/dist/manifest.d.ts.map +1 -1
  73. package/dist/manifest.json +3 -0
  74. package/dist/schemas/get--astrology-horoscope-sign-daily.json +1 -1
  75. package/dist/schemas/get--astrology-horoscope-sign-monthly.json +1 -1
  76. package/dist/schemas/get--astrology-horoscope-sign-weekly.json +1 -1
  77. package/dist/schemas/get--astrology-moon-phase-current.json +1 -1
  78. package/dist/schemas/get--vedic-astrology-avasthas-id.json +1 -0
  79. package/dist/schemas/get--vedic-astrology-avasthas.json +1 -0
  80. package/dist/schemas/get--vedic-astrology-kp-ayanamsa.json +1 -1
  81. package/dist/schemas/get--vedic-astrology-yoga-id.json +1 -1
  82. package/dist/schemas/post--vedic-astrology-arudha.json +1 -0
  83. package/dist/schemas/post--vedic-astrology-birth-chart.json +1 -1
  84. package/dist/schemas/post--vedic-astrology-chara-karakas.json +1 -0
  85. package/dist/schemas/post--vedic-astrology-dasha-current.json +1 -1
  86. package/dist/schemas/post--vedic-astrology-dasha-major.json +1 -1
  87. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha-pratyantardasha-sookshma.json +1 -0
  88. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha-pratyantardasha.json +1 -1
  89. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha.json +1 -1
  90. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha.json +1 -1
  91. package/dist/schemas/post--vedic-astrology-kp-chart.json +1 -1
  92. package/dist/schemas/post--vedic-astrology-kp-cusps.json +1 -1
  93. package/dist/schemas/post--vedic-astrology-kp-ruling-planets-interval.json +1 -1
  94. package/dist/schemas/post--vedic-astrology-kp-ruling-planets.json +1 -1
  95. package/dist/types/index.d.ts +1 -1
  96. package/dist/types/index.d.ts.map +1 -1
  97. package/dist/types/types.gen.d.ts +3228 -934
  98. package/dist/types/types.gen.d.ts.map +1 -1
  99. package/dist/utils/house-themes.d.ts +19 -0
  100. package/dist/utils/house-themes.d.ts.map +1 -0
  101. package/dist/version.d.ts +1 -1
  102. package/package.json +1 -1
  103. package/src/components/arudha-padas.ts +230 -0
  104. package/src/components/chara-karakas.ts +241 -0
  105. package/src/components/dasha-timeline.ts +129 -28
  106. package/src/components/kp-chart.ts +40 -5
  107. package/src/components/kp-ruling-planets.ts +29 -6
  108. package/src/components/reference-card.ts +3 -1
  109. package/src/components/upagraha-table.ts +182 -0
  110. package/src/components/vedic-planets-table.ts +34 -4
  111. package/src/components/yoga-list.ts +144 -20
  112. package/src/generated/endpoint-bindings.ts +13 -0
  113. package/src/index.ts +3 -0
  114. package/src/manifest.ts +48 -7
  115. package/src/types/index.ts +1 -1
  116. package/src/types/types.gen.ts +3133 -809
  117. package/src/utils/house-themes.ts +36 -0
  118. package/src/version.ts +1 -1
@@ -0,0 +1,182 @@
1
+ import { css, html, nothing } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+ import { SIGN_GLYPH } from '../tokens/index.js';
4
+ import type { UpagrahaResponse } from '../types/index.js';
5
+ import { RoxyDataElement } from '../utils/base-element.js';
6
+ import { baseStyles } from '../utils/base-styles.js';
7
+ import { formatSignPosition } from '../utils/degree.js';
8
+ import { formatNumber } from '../utils/format.js';
9
+ import { capitalize } from '../utils/string.js';
10
+
11
+ type Upagraha = UpagrahaResponse['timeBased'][number];
12
+
13
+ /**
14
+ * The two groups the response ships, each with the line a reader needs to know what it is looking at. Time-based positions depend on birth time, place and weekday; the Dhuma group is pure arithmetic from the Sun.
15
+ */
16
+ const GROUPS = [
17
+ {
18
+ key: 'timeBased',
19
+ title: 'Time based',
20
+ note: 'From the eightfold division of the day or night, so these depend on the birth time, the place and the weekday.',
21
+ },
22
+ {
23
+ key: 'sunBased',
24
+ title: 'Sun based',
25
+ note: 'The Dhuma group, derived by fixed arc from the Sun. Dhuma is the Sun plus 133 degrees 20 minutes, and each of the rest follows from the one before it.',
26
+ },
27
+ ] as const;
28
+
29
+ /**
30
+ * Upagraha positions. Renders /vedic-astrology/upagraha: the eleven upagrahas (shadowy sub-planets) in the two groups the tradition separates them into, each with its sidereal longitude, rashi, degree in sign, and nakshatra with pada.
31
+ *
32
+ * @remarks
33
+ * Gulika and Mandi are rendered as the two SEPARATE points they are. Several implementations treat the names as synonyms and print one row; the two are computed from different moments of the Saturn segment and sit a few degrees apart, which is exactly the difference a practitioner is checking when they open this table.
34
+ *
35
+ * Row order is the response order and is not re-sorted: the API returns each group in its classical derivation order, which is the order the positions are computed and taught in.
36
+ */
37
+ @customElement('roxy-upagraha-table')
38
+ export class RoxyUpagrahaTable extends RoxyDataElement<UpagrahaResponse> {
39
+ static styles = [
40
+ baseStyles,
41
+ css`
42
+ .wrap {
43
+ border: 1px solid var(--roxy-border, #e4e4e7);
44
+ border-radius: var(--roxy-radius-md, 8px);
45
+ background: var(--roxy-surface, #fff);
46
+ box-shadow: var(--roxy-shadow-sm);
47
+ overflow: hidden;
48
+ }
49
+ .head {
50
+ padding: var(--roxy-space-md, 1rem);
51
+ border-bottom: 1px solid var(--roxy-border, #e4e4e7);
52
+ }
53
+ .title {
54
+ margin: 0;
55
+ font-size: var(--roxy-text-lg, 1.125rem);
56
+ font-weight: var(--roxy-weight-bold, 600);
57
+ }
58
+ .group-head {
59
+ padding: var(--roxy-space-md, 1rem) var(--roxy-space-md, 1rem) 0;
60
+ display: grid;
61
+ gap: var(--roxy-space-xs, 0.25rem);
62
+ }
63
+ .group-title {
64
+ margin: 0;
65
+ font-size: var(--roxy-text-sm, 0.875rem);
66
+ font-weight: var(--roxy-weight-bold, 600);
67
+ }
68
+ .group-note {
69
+ margin: 0;
70
+ color: var(--roxy-muted, #71717a);
71
+ font-size: var(--roxy-text-xs, 0.75rem);
72
+ line-height: var(--roxy-leading-normal, 1.5);
73
+ }
74
+ .scroll {
75
+ overflow-x: auto;
76
+ min-width: 0;
77
+ }
78
+ table {
79
+ width: 100%;
80
+ border-collapse: collapse;
81
+ font-size: var(--roxy-text-sm, 0.875rem);
82
+ min-width: 520px;
83
+ }
84
+ thead {
85
+ background: color-mix(in srgb, var(--roxy-border, #e4e4e7) 20%, transparent);
86
+ }
87
+ th,
88
+ td {
89
+ padding: var(--roxy-space-sm, 0.5rem) var(--roxy-space-md, 1rem);
90
+ text-align: left;
91
+ white-space: nowrap;
92
+ }
93
+ th {
94
+ color: var(--roxy-muted, #71717a);
95
+ font-weight: var(--roxy-weight-bold, 600);
96
+ text-transform: uppercase;
97
+ font-size: var(--roxy-text-xs, 0.75rem);
98
+ letter-spacing: 0.04em;
99
+ }
100
+ tbody tr {
101
+ border-top: 1px solid var(--roxy-border, #e4e4e7);
102
+ }
103
+ td.name {
104
+ font-weight: var(--roxy-weight-bold, 600);
105
+ color: var(--roxy-fg, #0a0a0a);
106
+ }
107
+ .glyph {
108
+ margin-right: 0.4em;
109
+ color: var(--roxy-muted, #71717a);
110
+ }
111
+ .num {
112
+ font-variant-numeric: tabular-nums;
113
+ }
114
+ `,
115
+ ];
116
+
117
+ protected renderEmpty() {
118
+ return html`<div class="roxy-empty" role="status">No upagraha data</div>`;
119
+ }
120
+
121
+ protected renderData(d: UpagrahaResponse) {
122
+ const groups = GROUPS.filter((g) => d[g.key]?.length);
123
+ if (!groups.length) return this.renderEmpty();
124
+
125
+ return html`<div class="wrap" aria-label="Upagraha positions">
126
+ <header class="head">
127
+ <h2 class="title">Upagrahas</h2>
128
+ </header>
129
+ ${groups.map((g) => this.renderGroup(g, d[g.key]))}
130
+ </div>`;
131
+ }
132
+
133
+ private renderGroup(group: (typeof GROUPS)[number], rows: Upagraha[]) {
134
+ return html`<section>
135
+ <div class="group-head">
136
+ <h3 class="group-title">${group.title}</h3>
137
+ <p class="group-note">${group.note}</p>
138
+ </div>
139
+ <div class="scroll" tabindex="0">
140
+ <table role="table">
141
+ <caption class="roxy-sr-only">
142
+ ${group.title} upagrahas: each sub-planet with its rashi, degree in sign,
143
+ sidereal longitude, and nakshatra with pada.
144
+ </caption>
145
+ <thead>
146
+ <tr>
147
+ <th scope="col">Upagraha</th>
148
+ <th scope="col">Rashi</th>
149
+ <th scope="col">Degree</th>
150
+ <th scope="col">Longitude</th>
151
+ <th scope="col">Nakshatra</th>
152
+ <th scope="col">Pada</th>
153
+ </tr>
154
+ </thead>
155
+ <tbody>
156
+ ${rows.map((u) => {
157
+ const signGlyph = SIGN_GLYPH[capitalize(u.rashi ?? '')] ?? '';
158
+ return html`<tr>
159
+ <td class="name">${u.name}</td>
160
+ <td>
161
+ ${signGlyph ? html`<span class="glyph">${signGlyph}</span>` : nothing}${u.rashi ?? ''}
162
+ </td>
163
+ <td class="num">
164
+ ${typeof u.longitude === 'number' ? formatSignPosition(u.longitude) : ''}
165
+ </td>
166
+ <td class="num">${formatNumber(u.longitude, 2)}</td>
167
+ <td>${u.nakshatra ?? ''}</td>
168
+ <td class="num">${u.nakshatraPada ?? ''}</td>
169
+ </tr>`;
170
+ })}
171
+ </tbody>
172
+ </table>
173
+ </div>
174
+ </section>`;
175
+ }
176
+ }
177
+
178
+ declare global {
179
+ interface HTMLElementTagNameMap {
180
+ 'roxy-upagraha-table': RoxyUpagrahaTable;
181
+ }
182
+ }
@@ -32,9 +32,18 @@ type MetaEntry = BirthChartResponse['meta'][string];
32
32
  * Vedic planetary positions table. Renders /vedic-astrology/birth-chart `meta`
33
33
  * as the full reference-grade positions grid a practitioner reads alongside
34
34
  * the kundli wheel: graha, rashi, exact degree, nakshatra and pada, nakshatra
35
- * lord, bhava (house), Baladi avastha, and retrograde.
35
+ * lord, bhava (house), all three avastha systems, and retrograde.
36
36
  *
37
37
  * @remarks
38
+ * The three avastha systems each get their own column rather than one merged
39
+ * state, because they answer different questions and a reader looks up exactly
40
+ * one of them at a time: Baladi is the age state read from the degree, Jagradadi
41
+ * the waking state and Deeptadi the dispositional state, both read from sign
42
+ * dignity. Dignity is a relationship to a sign lord, which Rahu, Ketu and the
43
+ * Lagna do not have, so the API returns only `awastha` for those three and their
44
+ * last two cells are deliberately EMPTY. They are not rendered as a dash or a
45
+ * placeholder: both read as data that failed to arrive.
46
+ *
38
47
  * The positions grid is the default view. The same birth-chart response also
39
48
  * carries chart-wide conditions and readings, surfaced as collapsed accordions
40
49
  * below the grid so they never crowd the table: combust grahas (astangata),
@@ -73,7 +82,9 @@ export class RoxyVedicPlanetsTable extends RoxyDataElement<BirthChartResponse> {
73
82
  width: 100%;
74
83
  border-collapse: collapse;
75
84
  font-size: var(--roxy-text-sm, 0.875rem);
76
- min-width: 620px;
85
+ /* Three avastha columns rather than one, so the grid needs the room
86
+ * before the scroll container takes over. */
87
+ min-width: 760px;
77
88
  }
78
89
  thead {
79
90
  background: color-mix(in srgb, var(--roxy-border, #e4e4e7) 20%, transparent);
@@ -254,7 +265,10 @@ export class RoxyVedicPlanetsTable extends RoxyDataElement<BirthChartResponse> {
254
265
  <table role="table">
255
266
  <caption class="roxy-sr-only">
256
267
  Vedic planetary positions: each graha with its rashi, degree, nakshatra, pada,
257
- nakshatra lord, house, avastha and retrograde state.
268
+ nakshatra lord, house, its state in all three avastha systems, and retrograde
269
+ state. Jagradadi and Deeptadi are read from sign dignity, which the nodes and
270
+ the Lagna do not have, so those two cells are blank on the Rahu, Ketu and
271
+ Lagna rows.
258
272
  </caption>
259
273
  <thead>
260
274
  <tr>
@@ -265,7 +279,21 @@ export class RoxyVedicPlanetsTable extends RoxyDataElement<BirthChartResponse> {
265
279
  <th scope="col">Pada</th>
266
280
  <th scope="col">Nak. lord</th>
267
281
  <th scope="col">House</th>
268
- <th scope="col">Avastha</th>
282
+ <th scope="col" title="Baladi: the five age states, set by degree within the sign">
283
+ Baladi
284
+ </th>
285
+ <th
286
+ scope="col"
287
+ title="Jagradadi: the three waking states, set by sign dignity. The seven classical grahas only"
288
+ >
289
+ Jagradadi
290
+ </th>
291
+ <th
292
+ scope="col"
293
+ title="Deeptadi: the nine dispositional states, set by sign dignity. The seven classical grahas only"
294
+ >
295
+ Deeptadi
296
+ </th>
269
297
  <th scope="col">Retro</th>
270
298
  </tr>
271
299
  </thead>
@@ -289,6 +317,8 @@ export class RoxyVedicPlanetsTable extends RoxyDataElement<BirthChartResponse> {
289
317
  <td>${p.nakshatra?.lord ?? ''}</td>
290
318
  <td class="num">${typeof p.house === 'number' ? p.house : ''}</td>
291
319
  <td>${p.awastha ?? ''}</td>
320
+ <td>${p.jagradadi ?? ''}</td>
321
+ <td>${p.deeptadi ?? ''}</td>
292
322
  <td>${p.isRetrograde ? html`<span class="retro">R</span>` : nothing}</td>
293
323
  </tr>`;
294
324
  })}
@@ -14,14 +14,52 @@ type YogaListData =
14
14
  | DetectYogasResponse
15
15
  | { yogas: Array<GetYogaResponse> };
16
16
 
17
+ type DetectedYoga = DetectYogasResponse['yogas'][number];
18
+
19
+ /**
20
+ * True when a yoga matched its own rule but a stronger family silenced it under the classical precedence norms, rather than failing the rule outright. The response states which in its `evidence`.
21
+ *
22
+ * The two are genuinely different to a reader: a failed rule says nothing about the chart, while "Kedara would apply but Pasa outranks it" is a real feature of it.
23
+ */
24
+ function isOutranked(y: DetectedYoga): boolean {
25
+ return /classically (outranks|suppresses)/i.test(y.evidence ?? '');
26
+ }
27
+
28
+ /** The three detect verdicts in reading order, each with the note that explains the group. Ordered by what a reader wants first: what fired, what nearly fired, then the rest as reference. */
29
+ const VERDICTS = [
30
+ {
31
+ id: 'present',
32
+ label: 'Present',
33
+ open: true,
34
+ note: 'Every classical condition is satisfied by this chart.',
35
+ },
36
+ {
37
+ id: 'outranked',
38
+ label: 'Outranked',
39
+ open: true,
40
+ note: 'The rule matched, but a stronger family silences it under the classical precedence norms.',
41
+ },
42
+ {
43
+ id: 'absent',
44
+ label: 'Not present',
45
+ open: false,
46
+ note: 'At least one classical condition fails. Read the evidence for which.',
47
+ },
48
+ ] as const;
49
+
50
+ type Verdict = (typeof VERDICTS)[number]['id'];
51
+
17
52
  /**
18
53
  * Yoga catalog and detail renderer. Accepts four data modes:
19
54
  * - Catalog: ListYogasResponse (yogas array of {id, name} + total)
20
55
  * - Detail: GetYogaResponse (single yoga with description, result, quality)
21
56
  * - Detail array: { yogas: Array<GetYogaResponse> } for pre-filtered sets
22
- * - Detect: DetectYogasResponse (each yoga carries a present verdict + evidence); present yogas render first, each badged present/absent with its classical evidence
57
+ * - Detect: DetectYogasResponse (each yoga carries a present verdict + evidence); grouped by verdict, each badged present, outranked or not present, with its classical evidence
23
58
  *
24
59
  * All multi-item modes include a live search filter.
60
+ *
61
+ * @remarks
62
+ * Detect returns a verdict for every yoga in the detected set on every chart, of which a real chart fires low single digits, so a flat list buries the handful a reader came for. They are grouped by verdict, in reading order: what fired, what would have fired but was outranked, then everything that failed its rule, collapsed because it is reference rather than result. Every grouping and every label is read from the response, so this component holds no table of yoga data of its own.
25
63
  */
26
64
  @customElement('roxy-yoga-list')
27
65
  export class RoxyYogaList extends RoxyDataElement<YogaListData> {
@@ -151,9 +189,60 @@ export class RoxyYogaList extends RoxyDataElement<YogaListData> {
151
189
  background: color-mix(in srgb, var(--roxy-border, #e4e4e7) 55%, transparent);
152
190
  color: var(--roxy-fg, #0a0a0a);
153
191
  }
192
+ .present-badge.is-outranked {
193
+ background: color-mix(in srgb, var(--roxy-warning, #f59e0b) 16%, transparent);
194
+ color: var(--roxy-warning-fg, #b45309);
195
+ }
154
196
  .detail-card.absent {
155
197
  opacity: 0.72;
156
198
  }
199
+ /* An outranked yoga DID match its own rule, so it stays more legible than
200
+ * one that simply failed: it is a real feature of the chart that a
201
+ * stronger family silenced. */
202
+ .detail-card.outranked {
203
+ opacity: 0.88;
204
+ }
205
+ .group-stack {
206
+ display: grid;
207
+ gap: var(--roxy-space-md, 1rem);
208
+ }
209
+ .group {
210
+ display: grid;
211
+ gap: var(--roxy-space-sm, 0.5rem);
212
+ }
213
+ .group-summary {
214
+ display: flex;
215
+ align-items: baseline;
216
+ gap: var(--roxy-space-sm, 0.5rem);
217
+ cursor: pointer;
218
+ list-style: none;
219
+ color: var(--roxy-muted, #71717a);
220
+ }
221
+ .group-summary::before {
222
+ content: '+';
223
+ font-size: 1.1em;
224
+ line-height: 1;
225
+ color: var(--roxy-accent-ink, #b45309);
226
+ }
227
+ .group[open] > .group-summary::before {
228
+ content: '-';
229
+ }
230
+ .group-label {
231
+ font-size: var(--roxy-text-xs, 0.75rem);
232
+ font-weight: var(--roxy-weight-bold, 600);
233
+ text-transform: uppercase;
234
+ letter-spacing: 0.06em;
235
+ }
236
+ .group-count {
237
+ font-size: var(--roxy-text-xs, 0.75rem);
238
+ font-variant-numeric: tabular-nums;
239
+ }
240
+ .group-note {
241
+ margin: 0;
242
+ font-size: var(--roxy-text-xs, 0.75rem);
243
+ color: var(--roxy-muted, #71717a);
244
+ line-height: var(--roxy-leading-normal, 1.5);
245
+ }
157
246
  .evidence {
158
247
  font-size: var(--roxy-text-xs, 0.75rem);
159
248
  color: var(--roxy-muted, #71717a);
@@ -166,10 +255,13 @@ export class RoxyYogaList extends RoxyDataElement<YogaListData> {
166
255
  margin: 0;
167
256
  line-height: var(--roxy-leading-normal, 1.5);
168
257
  }
169
- details {
258
+ /* Scoped to the card, never a bare details summary rule: a verdict group
259
+ * is itself a details element, so an unscoped details[open] summary rule
260
+ * would flip every card's Effects marker the moment its group opened. */
261
+ .detail-card details {
170
262
  font-size: var(--roxy-text-sm, 0.875rem);
171
263
  }
172
- details summary {
264
+ .detail-card details > summary {
173
265
  cursor: pointer;
174
266
  color: var(--roxy-accent-ink, #b45309);
175
267
  font-weight: 500;
@@ -179,15 +271,15 @@ export class RoxyYogaList extends RoxyDataElement<YogaListData> {
179
271
  align-items: center;
180
272
  gap: 0.4em;
181
273
  }
182
- details summary::before {
274
+ .detail-card details > summary::before {
183
275
  content: '+';
184
276
  font-size: 1.1em;
185
277
  line-height: 1;
186
278
  }
187
- details[open] summary::before {
279
+ .detail-card details[open] > summary::before {
188
280
  content: '-';
189
281
  }
190
- details .result-body {
282
+ .detail-card details .result-body {
191
283
  padding-top: var(--roxy-space-xs, 0.25rem);
192
284
  color: var(--roxy-fg, #0a0a0a);
193
285
  line-height: var(--roxy-leading-normal, 1.5);
@@ -212,6 +304,31 @@ export class RoxyYogaList extends RoxyDataElement<YogaListData> {
212
304
  this.filter = (e.target as HTMLInputElement).value;
213
305
  };
214
306
 
307
+ /** The verdict a detected yoga falls under. The one grouping the response itself supports, so nothing about the classical scheme is duplicated here. */
308
+ private verdictOf(y: DetectedYoga): Verdict {
309
+ return y.present ? 'present' : isOutranked(y) ? 'outranked' : 'absent';
310
+ }
311
+
312
+ /**
313
+ * One verdict group, or nothing when no yoga fell under it (a chart with no outranked yoga shows no Outranked heading).
314
+ *
315
+ * A `<details>` rather than a plain section: the rule-failed group is thirty-odd cards of reference on a real chart, and collapsing keeps it in the DOM, searchable and indexed, while the result stays at the top. A group forces itself open while a filter is active, so a match can never hide inside a collapsed heading.
316
+ */
317
+ private renderVerdictGroup(
318
+ verdict: (typeof VERDICTS)[number],
319
+ yogas: DetectedYoga[],
320
+ ) {
321
+ if (!yogas.length) return nothing;
322
+ return html`<details class="group" ?open=${verdict.open || !!this.filter}>
323
+ <summary class="group-summary">
324
+ <span class="group-label">${verdict.label}</span>
325
+ <span class="group-count">${yogas.length}</span>
326
+ </summary>
327
+ <p class="group-note">${verdict.note}</p>
328
+ <div class="detail-grid">${yogas.map((y) => this.renderDetectCard(y))}</div>
329
+ </details>`;
330
+ }
331
+
215
332
  private renderQualityChip(quality: string) {
216
333
  const cls = `quality-chip quality-${quality}`;
217
334
  return html`<span class=${cls}>${quality}</span>`;
@@ -239,13 +356,19 @@ export class RoxyYogaList extends RoxyDataElement<YogaListData> {
239
356
  </div>`;
240
357
  }
241
358
 
242
- /** Detect-mode card: shows the present/absent verdict and the classical evidence that triggered or failed it. */
243
- private renderDetectCard(y: DetectYogasResponse['yogas'][number]) {
244
- return html`<div class="detail-card ${y.present ? '' : 'absent'}">
359
+ /** Detect-mode card: shows the three-way verdict (present, outranked, not present) and the classical evidence behind it. */
360
+ private renderDetectCard(y: DetectedYoga) {
361
+ const outranked = !y.present && isOutranked(y);
362
+ const [cls, label] = y.present
363
+ ? ['is-present', 'Present']
364
+ : outranked
365
+ ? ['is-outranked', 'Outranked']
366
+ : ['is-absent', 'Not present'];
367
+ return html`<div class="detail-card ${y.present ? '' : outranked ? 'outranked' : 'absent'}">
245
368
  <p class="detail-name">
246
369
  ${y.name}
247
370
  ${y.quality ? this.renderQualityChip(y.quality) : nothing}
248
- <span class="present-badge ${y.present ? 'is-present' : 'is-absent'}">${y.present ? 'Present' : 'Not present'}</span>
371
+ <span class="present-badge ${cls}">${label}</span>
249
372
  </p>
250
373
  ${y.description ? html`<p class="description">${y.description}</p>` : nothing}
251
374
  ${
@@ -282,19 +405,15 @@ export class RoxyYogaList extends RoxyDataElement<YogaListData> {
282
405
  d as { yogas: Array<GetYogaResponse | { id: string; name: string }> }
283
406
  ).yogas;
284
407
 
285
- // Detect mode: every entry carries a `present` verdict. Render present
286
- // yogas first, mark each present/absent, and surface the classical
408
+ // Detect mode: every entry carries a `present` verdict. Group by verdict,
409
+ // badge each present, outranked or not present, and surface the classical
287
410
  // evidence. Must precede the detail-array check because detect entries
288
411
  // also carry `description`.
289
412
  if (allYogas.length > 0 && 'present' in allYogas[0]) {
290
- const detected = allYogas as DetectYogasResponse['yogas'];
413
+ const detected = allYogas as DetectedYoga[];
291
414
  const filtered = lc
292
415
  ? detected.filter((y) => y.name.toLowerCase().includes(lc))
293
416
  : detected;
294
- const ordered = [
295
- ...filtered.filter((y) => y.present),
296
- ...filtered.filter((y) => !y.present),
297
- ];
298
417
  const presentCount =
299
418
  (d as DetectYogasResponse).total ??
300
419
  detected.filter((y) => y.present).length;
@@ -314,14 +433,19 @@ export class RoxyYogaList extends RoxyDataElement<YogaListData> {
314
433
  />
315
434
  </div>
316
435
  <div
317
- class="detail-grid"
436
+ class="group-stack"
318
437
  role="region"
319
438
  aria-live="polite"
320
439
  aria-label="Detected yogas"
321
440
  >
322
441
  ${
323
- ordered.length > 0
324
- ? ordered.map((y) => this.renderDetectCard(y))
442
+ filtered.length > 0
443
+ ? VERDICTS.map((v) =>
444
+ this.renderVerdictGroup(
445
+ v,
446
+ filtered.filter((y) => this.verdictOf(y) === v.id),
447
+ ),
448
+ )
325
449
  : html`<p class="no-results">No yogas match your search.</p>`
326
450
  }
327
451
  </div>
@@ -191,6 +191,14 @@ export const ENDPOINT_BINDINGS: Record<string, EndpointBinding[]> = {
191
191
  period: 'sookshma',
192
192
  },
193
193
  },
194
+ {
195
+ operationId: 'getPranaDashas',
196
+ method: 'POST',
197
+ path: '/vedic-astrology/dasha/sub/{mahadasha}/{antardasha}/{pratyantardasha}/{sookshma}',
198
+ attrs: {
199
+ period: 'prana',
200
+ },
201
+ },
194
202
  ],
195
203
  'roxy-divisional-chart': [
196
204
  {
@@ -601,6 +609,11 @@ export const ENDPOINT_BINDINGS: Record<string, EndpointBinding[]> = {
601
609
  method: 'GET',
602
610
  path: '/numerology/meanings/{number}',
603
611
  },
612
+ {
613
+ operationId: 'getAvastha',
614
+ method: 'GET',
615
+ path: '/vedic-astrology/avasthas/{id}',
616
+ },
604
617
  {
605
618
  operationId: 'getRashi',
606
619
  method: 'GET',
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@
8
8
  // Angel numbers
9
9
  export { RoxyAngelNumberCard } from './components/angel-number-card.js';
10
10
  export { RoxyAngelNumberLookup } from './components/angel-number-lookup.js';
11
+ export { RoxyArudhaPadas } from './components/arudha-padas.js';
11
12
  export { RoxyAshtakavargaGrid } from './components/ashtakavarga-grid.js';
12
13
  // Western astrology
13
14
  export { RoxyAspectsTable } from './components/aspects-table.js';
@@ -16,6 +17,7 @@ export { RoxyAstrocartographyMap } from './components/astrocartography-map.js';
16
17
  export { RoxyBiorhythmChart } from './components/biorhythm-chart.js';
17
18
  // Human Design
18
19
  export { RoxyBodygraph } from './components/bodygraph.js';
20
+ export { RoxyCharaKarakas } from './components/chara-karakas.js';
19
21
  export { RoxyChoghadiyaGrid } from './components/choghadiya-grid.js';
20
22
  export { RoxyCompatibilityCard } from './components/compatibility-card.js';
21
23
  // Crystals
@@ -68,6 +70,7 @@ export { RoxyTarotCard } from './components/tarot-card.js';
68
70
  export { RoxyTarotCatalog } from './components/tarot-catalog.js';
69
71
  export { RoxyTarotSpread } from './components/tarot-spread.js';
70
72
  export { RoxyTransitsTable } from './components/transits-table.js';
73
+ export { RoxyUpagrahaTable } from './components/upagraha-table.js';
71
74
  // Vedic astrology
72
75
  export { RoxyVedicAspects } from './components/vedic-aspects.js';
73
76
  export { RoxyVedicKundli } from './components/vedic-kundli.js';
package/src/manifest.ts CHANGED
@@ -252,7 +252,7 @@ export const ROXY_COMPONENTS: readonly RoxyComponent[] = [
252
252
  docsLabel: 'Vedic (KP)',
253
253
  endpointLabel: 'POST /vedic-astrology/kp/chart',
254
254
  docsSummary:
255
- 'Ascendant, cusps, planets and nodes with KP stellar hierarchy',
255
+ 'Ascendant, cusps, planets and nodes with KP stellar hierarchy and house meanings',
256
256
  topic: 'Vedic',
257
257
  },
258
258
  {
@@ -261,10 +261,11 @@ export const ROXY_COMPONENTS: readonly RoxyComponent[] = [
261
261
  slug: 'vedic-planets-table',
262
262
  heading: 'Vedic planets',
263
263
  description:
264
- 'Vedic planetary positions table with degree, nakshatra, pada, nakshatra lord, bhava, and avastha',
264
+ 'Vedic planetary positions table with degree, nakshatra, pada, nakshatra lord, bhava, and all three avastha systems',
265
265
  docsLabel: 'Vedic',
266
266
  endpointLabel: 'POST /vedic-astrology/birth-chart',
267
- docsSummary: 'Degree, nakshatra, pada, lord, bhava, avastha columns',
267
+ docsSummary:
268
+ 'Degree, nakshatra, pada, lord, bhava, Baladi, Jagradadi and Deeptadi columns',
268
269
  topic: 'Vedic',
269
270
  },
270
271
  {
@@ -288,7 +289,7 @@ export const ROXY_COMPONENTS: readonly RoxyComponent[] = [
288
289
  docsLabel: 'Vedic (KP)',
289
290
  endpointLabel: 'POST /vedic-astrology/kp/ruling-planets',
290
291
  docsSummary:
291
- 'Day lord, Moon/Lagna hierarchies, ruling planets, significators',
292
+ 'Day lord, Moon/Lagna hierarchies, ruling planets, significators with house meanings',
292
293
  topic: 'Vedic',
293
294
  },
294
295
  {
@@ -320,11 +321,11 @@ export const ROXY_COMPONENTS: readonly RoxyComponent[] = [
320
321
  slug: 'dasha-timeline',
321
322
  heading: 'Vimshottari dasha',
322
323
  description:
323
- 'Vimshottari dasha timeline, mahadasha through sookshma, with the active period highlighted',
324
+ 'Vimshottari dasha timeline, mahadasha through prana, with the active period highlighted',
324
325
  docsLabel: 'Vedic',
325
326
  endpointLabel: 'POST /vedic-astrology/dasha/{current,major,sub/...}',
326
327
  docsSummary:
327
- 'Vimshottari mahadasha, antardasha, pratyantardasha and sookshma, drill-down at every level',
328
+ 'Vimshottari mahadasha, antardasha, pratyantardasha, sookshma and prana, drill-down at every level',
328
329
  topic: 'Vedic',
329
330
  },
330
331
  {
@@ -386,6 +387,45 @@ export const ROXY_COMPONENTS: readonly RoxyComponent[] = [
386
387
  docsSummary: 'Day and night Choghadiya muhurta tiles colored by effect',
387
388
  topic: 'Vedic',
388
389
  },
390
+ {
391
+ pascal: 'RoxyUpagrahaTable',
392
+ tag: 'roxy-upagraha-table',
393
+ slug: 'upagraha-table',
394
+ heading: 'Upagrahas',
395
+ description:
396
+ 'The eleven upagrahas in their time-based and Sun-based groups, with rashi, degree, and nakshatra',
397
+ docsLabel: 'Vedic',
398
+ endpointLabel: 'POST /vedic-astrology/upagraha',
399
+ docsSummary:
400
+ 'Time-based and Sun-based upagrahas with rashi, degree, longitude and nakshatra',
401
+ topic: 'Vedic',
402
+ },
403
+ {
404
+ pascal: 'RoxyCharaKarakas',
405
+ tag: 'roxy-chara-karakas',
406
+ slug: 'chara-karakas',
407
+ heading: 'Chara karakas',
408
+ description:
409
+ 'Jaimini chara karakas ranked Atmakaraka first, with the scheme that produced the ranking',
410
+ docsLabel: 'Vedic',
411
+ endpointLabel: 'POST /vedic-astrology/chara-karakas',
412
+ docsSummary:
413
+ 'Karaka offices in rank order with graha, degree, scheme, and what each is read for',
414
+ topic: 'Vedic',
415
+ },
416
+ {
417
+ pascal: 'RoxyArudhaPadas',
418
+ tag: 'roxy-arudha-padas',
419
+ slug: 'arudha-padas',
420
+ heading: 'Arudha padas',
421
+ description:
422
+ 'The twelve Jaimini arudha padas with their derivation, the Arudha Lagna and the Upapada marked',
423
+ docsLabel: 'Vedic',
424
+ endpointLabel: 'POST /vedic-astrology/arudha',
425
+ docsSummary:
426
+ 'Twelve padas with bhava, lord, pada rashi, house from Lagna, and the classical exception marked',
427
+ topic: 'Vedic',
428
+ },
389
429
  {
390
430
  pascal: 'RoxyYogaList',
391
431
  tag: 'roxy-yoga-list',
@@ -396,7 +436,8 @@ export const ROXY_COMPONENTS: readonly RoxyComponent[] = [
396
436
  docsLabel: 'Vedic',
397
437
  endpointLabel:
398
438
  'GET /vedic-astrology/yoga, POST /vedic-astrology/yoga/detect',
399
- docsSummary: 'Filterable yoga cards from the 300 plus yoga catalog',
439
+ docsSummary:
440
+ 'Filterable yoga cards from the 300 plus yoga catalog, grouped by verdict in detect mode',
400
441
  topic: 'Vedic',
401
442
  },
402
443
  {