@roxyapi/ui 0.4.1 → 0.6.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 (235) hide show
  1. package/AGENTS.md +21 -0
  2. package/README.md +17 -1
  3. package/dist/cdn/components/ashtakavarga-grid.js +3 -362
  4. package/dist/cdn/components/ashtakavarga-grid.js.map +4 -4
  5. package/dist/cdn/components/biorhythm-chart.js +3 -226
  6. package/dist/cdn/components/biorhythm-chart.js.map +4 -4
  7. package/dist/cdn/components/choghadiya-grid.js +3 -232
  8. package/dist/cdn/components/choghadiya-grid.js.map +4 -4
  9. package/dist/cdn/components/compatibility-card.js +3 -231
  10. package/dist/cdn/components/compatibility-card.js.map +4 -4
  11. package/dist/cdn/components/dasha-timeline.js +3 -283
  12. package/dist/cdn/components/dasha-timeline.js.map +4 -4
  13. package/dist/cdn/components/data.js +3 -230
  14. package/dist/cdn/components/data.js.map +4 -4
  15. package/dist/cdn/components/divisional-chart.js +3 -356
  16. package/dist/cdn/components/divisional-chart.js.map +4 -4
  17. package/dist/cdn/components/dosha-card.js +3 -226
  18. package/dist/cdn/components/dosha-card.js.map +4 -4
  19. package/dist/cdn/components/endpoint-form.js +2 -243
  20. package/dist/cdn/components/endpoint-form.js.map +2 -2
  21. package/dist/cdn/components/guna-milan.js +3 -270
  22. package/dist/cdn/components/guna-milan.js.map +4 -4
  23. package/dist/cdn/components/hexagram.js +3 -247
  24. package/dist/cdn/components/hexagram.js.map +4 -4
  25. package/dist/cdn/components/horoscope-card.js +3 -281
  26. package/dist/cdn/components/horoscope-card.js.map +4 -4
  27. package/dist/cdn/components/kp-chart.js +3 -278
  28. package/dist/cdn/components/kp-chart.js.map +4 -4
  29. package/dist/cdn/components/kp-planets-table.js +3 -196
  30. package/dist/cdn/components/kp-planets-table.js.map +4 -4
  31. package/dist/cdn/components/kp-ruling-planets.js +3 -241
  32. package/dist/cdn/components/kp-ruling-planets.js.map +4 -4
  33. package/dist/cdn/components/location-search.js +2 -240
  34. package/dist/cdn/components/location-search.js.map +2 -2
  35. package/dist/cdn/components/moon-phase.js +3 -223
  36. package/dist/cdn/components/moon-phase.js.map +4 -4
  37. package/dist/cdn/components/nakshatra-card.js +3 -201
  38. package/dist/cdn/components/nakshatra-card.js.map +4 -4
  39. package/dist/cdn/components/natal-chart.js +3 -563
  40. package/dist/cdn/components/natal-chart.js.map +4 -4
  41. package/dist/cdn/components/numerology-card.js +3 -233
  42. package/dist/cdn/components/numerology-card.js.map +4 -4
  43. package/dist/cdn/components/panchang-table.js +3 -220
  44. package/dist/cdn/components/panchang-table.js.map +4 -4
  45. package/dist/cdn/components/shadbala-table.js +3 -284
  46. package/dist/cdn/components/shadbala-table.js.map +4 -4
  47. package/dist/cdn/components/synastry-chart.js +3 -399
  48. package/dist/cdn/components/synastry-chart.js.map +4 -4
  49. package/dist/cdn/components/tarot-card.js +3 -261
  50. package/dist/cdn/components/tarot-card.js.map +4 -4
  51. package/dist/cdn/components/tarot-spread.js +3 -249
  52. package/dist/cdn/components/tarot-spread.js.map +4 -4
  53. package/dist/cdn/components/transits-table.js +3 -382
  54. package/dist/cdn/components/transits-table.js.map +4 -4
  55. package/dist/cdn/components/vedic-kundli.js +3 -305
  56. package/dist/cdn/components/vedic-kundli.js.map +4 -4
  57. package/dist/cdn/components/vedic-planets-table.js +3 -203
  58. package/dist/cdn/components/vedic-planets-table.js.map +4 -4
  59. package/dist/cdn/components/western-planets-table.js +3 -192
  60. package/dist/cdn/components/western-planets-table.js.map +4 -4
  61. package/dist/cdn/components/yoga-list.js +3 -306
  62. package/dist/cdn/components/yoga-list.js.map +4 -4
  63. package/dist/cdn/roxy-ui.js +3 -5102
  64. package/dist/cdn/roxy-ui.js.map +4 -4
  65. package/dist/cdn/widgets.js +1 -114
  66. package/dist/components/ashtakavarga-grid.d.ts +1 -0
  67. package/dist/components/ashtakavarga-grid.d.ts.map +1 -1
  68. package/dist/components/ashtakavarga-grid.js +1 -531
  69. package/dist/components/ashtakavarga-grid.js.map +4 -4
  70. package/dist/components/biorhythm-chart.d.ts +1 -0
  71. package/dist/components/biorhythm-chart.d.ts.map +1 -1
  72. package/dist/components/biorhythm-chart.js +1 -332
  73. package/dist/components/biorhythm-chart.js.map +4 -4
  74. package/dist/components/choghadiya-grid.d.ts +1 -0
  75. package/dist/components/choghadiya-grid.d.ts.map +1 -1
  76. package/dist/components/choghadiya-grid.js +1 -351
  77. package/dist/components/choghadiya-grid.js.map +4 -4
  78. package/dist/components/compatibility-card.d.ts +1 -0
  79. package/dist/components/compatibility-card.d.ts.map +1 -1
  80. package/dist/components/compatibility-card.js +1 -313
  81. package/dist/components/compatibility-card.js.map +4 -4
  82. package/dist/components/dasha-timeline.d.ts +1 -0
  83. package/dist/components/dasha-timeline.d.ts.map +1 -1
  84. package/dist/components/dasha-timeline.js +1 -401
  85. package/dist/components/dasha-timeline.js.map +4 -4
  86. package/dist/components/data.d.ts +1 -0
  87. package/dist/components/data.d.ts.map +1 -1
  88. package/dist/components/data.js +1 -362
  89. package/dist/components/data.js.map +4 -4
  90. package/dist/components/divisional-chart.d.ts +1 -0
  91. package/dist/components/divisional-chart.d.ts.map +1 -1
  92. package/dist/components/divisional-chart.js +1 -886
  93. package/dist/components/divisional-chart.js.map +4 -4
  94. package/dist/components/dosha-card.d.ts +1 -0
  95. package/dist/components/dosha-card.d.ts.map +1 -1
  96. package/dist/components/dosha-card.js +1 -293
  97. package/dist/components/dosha-card.js.map +4 -4
  98. package/dist/components/endpoint-form.js +1 -505
  99. package/dist/components/endpoint-form.js.map +3 -3
  100. package/dist/components/guna-milan.d.ts +1 -0
  101. package/dist/components/guna-milan.d.ts.map +1 -1
  102. package/dist/components/guna-milan.js +1 -374
  103. package/dist/components/guna-milan.js.map +4 -4
  104. package/dist/components/hexagram.d.ts +1 -0
  105. package/dist/components/hexagram.d.ts.map +1 -1
  106. package/dist/components/hexagram.js +1 -380
  107. package/dist/components/hexagram.js.map +4 -4
  108. package/dist/components/horoscope-card.d.ts +1 -0
  109. package/dist/components/horoscope-card.d.ts.map +1 -1
  110. package/dist/components/horoscope-card.js +1 -381
  111. package/dist/components/horoscope-card.js.map +4 -4
  112. package/dist/components/kp-chart.d.ts +1 -0
  113. package/dist/components/kp-chart.d.ts.map +1 -1
  114. package/dist/components/kp-chart.js +1 -395
  115. package/dist/components/kp-chart.js.map +4 -4
  116. package/dist/components/kp-planets-table.d.ts +1 -0
  117. package/dist/components/kp-planets-table.d.ts.map +1 -1
  118. package/dist/components/kp-planets-table.js +1 -246
  119. package/dist/components/kp-planets-table.js.map +4 -4
  120. package/dist/components/kp-ruling-planets.d.ts +1 -0
  121. package/dist/components/kp-ruling-planets.d.ts.map +1 -1
  122. package/dist/components/kp-ruling-planets.js +1 -288
  123. package/dist/components/kp-ruling-planets.js.map +4 -4
  124. package/dist/components/location-search.js +1 -461
  125. package/dist/components/location-search.js.map +3 -3
  126. package/dist/components/moon-phase.d.ts +1 -0
  127. package/dist/components/moon-phase.d.ts.map +1 -1
  128. package/dist/components/moon-phase.js +1 -327
  129. package/dist/components/moon-phase.js.map +4 -4
  130. package/dist/components/nakshatra-card.d.ts +1 -0
  131. package/dist/components/nakshatra-card.d.ts.map +1 -1
  132. package/dist/components/nakshatra-card.js +1 -244
  133. package/dist/components/nakshatra-card.js.map +4 -4
  134. package/dist/components/natal-chart.d.ts +1 -1
  135. package/dist/components/natal-chart.d.ts.map +1 -1
  136. package/dist/components/natal-chart.js +1 -1040
  137. package/dist/components/natal-chart.js.map +4 -4
  138. package/dist/components/numerology-card.d.ts +1 -0
  139. package/dist/components/numerology-card.d.ts.map +1 -1
  140. package/dist/components/numerology-card.js +1 -315
  141. package/dist/components/numerology-card.js.map +4 -4
  142. package/dist/components/panchang-table.d.ts +1 -0
  143. package/dist/components/panchang-table.d.ts.map +1 -1
  144. package/dist/components/panchang-table.js +1 -350
  145. package/dist/components/panchang-table.js.map +4 -4
  146. package/dist/components/shadbala-table.d.ts +1 -0
  147. package/dist/components/shadbala-table.d.ts.map +1 -1
  148. package/dist/components/shadbala-table.js +1 -413
  149. package/dist/components/shadbala-table.js.map +4 -4
  150. package/dist/components/synastry-chart.d.ts +1 -0
  151. package/dist/components/synastry-chart.d.ts.map +1 -1
  152. package/dist/components/synastry-chart.js +1 -658
  153. package/dist/components/synastry-chart.js.map +4 -4
  154. package/dist/components/tarot-card.d.ts +1 -0
  155. package/dist/components/tarot-card.d.ts.map +1 -1
  156. package/dist/components/tarot-card.js +1 -333
  157. package/dist/components/tarot-card.js.map +4 -4
  158. package/dist/components/tarot-spread.d.ts +1 -0
  159. package/dist/components/tarot-spread.d.ts.map +1 -1
  160. package/dist/components/tarot-spread.js +1 -310
  161. package/dist/components/tarot-spread.js.map +4 -4
  162. package/dist/components/transits-table.d.ts +3 -0
  163. package/dist/components/transits-table.d.ts.map +1 -1
  164. package/dist/components/transits-table.js +1 -548
  165. package/dist/components/transits-table.js.map +4 -4
  166. package/dist/components/vedic-kundli.d.ts +1 -0
  167. package/dist/components/vedic-kundli.d.ts.map +1 -1
  168. package/dist/components/vedic-kundli.js +1 -802
  169. package/dist/components/vedic-kundli.js.map +4 -4
  170. package/dist/components/vedic-planets-table.d.ts +1 -0
  171. package/dist/components/vedic-planets-table.d.ts.map +1 -1
  172. package/dist/components/vedic-planets-table.js +1 -368
  173. package/dist/components/vedic-planets-table.js.map +4 -4
  174. package/dist/components/western-planets-table.d.ts +1 -0
  175. package/dist/components/western-planets-table.d.ts.map +1 -1
  176. package/dist/components/western-planets-table.js +1 -363
  177. package/dist/components/western-planets-table.js.map +4 -4
  178. package/dist/components/yoga-list.d.ts +1 -0
  179. package/dist/components/yoga-list.d.ts.map +1 -1
  180. package/dist/components/yoga-list.js +1 -383
  181. package/dist/components/yoga-list.js.map +4 -4
  182. package/dist/index.cjs +1 -8653
  183. package/dist/index.cjs.map +4 -4
  184. package/dist/index.js +1 -8633
  185. package/dist/index.js.map +4 -4
  186. package/dist/types/index.d.ts +1 -1
  187. package/dist/types/index.d.ts.map +1 -1
  188. package/dist/types/types.gen.d.ts +590 -202
  189. package/dist/types/types.gen.d.ts.map +1 -1
  190. package/dist/utils/disclosure.d.ts +16 -0
  191. package/dist/utils/disclosure.d.ts.map +1 -0
  192. package/dist/utils/kundli-render.d.ts.map +1 -1
  193. package/dist/utils/kundli-styles.d.ts.map +1 -1
  194. package/dist/utils/markup-data.d.ts +57 -0
  195. package/dist/utils/markup-data.d.ts.map +1 -0
  196. package/dist/utils/tablist.d.ts +44 -0
  197. package/dist/utils/tablist.d.ts.map +1 -0
  198. package/dist/version.d.ts +1 -1
  199. package/package.json +3 -1
  200. package/src/components/ashtakavarga-grid.ts +9 -0
  201. package/src/components/biorhythm-chart.ts +9 -0
  202. package/src/components/choghadiya-grid.ts +9 -0
  203. package/src/components/compatibility-card.ts +9 -0
  204. package/src/components/dasha-timeline.ts +19 -1
  205. package/src/components/data.ts +9 -0
  206. package/src/components/divisional-chart.ts +11 -0
  207. package/src/components/dosha-card.ts +9 -0
  208. package/src/components/guna-milan.ts +9 -0
  209. package/src/components/hexagram.ts +9 -0
  210. package/src/components/horoscope-card.ts +9 -0
  211. package/src/components/kp-chart.ts +9 -0
  212. package/src/components/kp-planets-table.ts +9 -0
  213. package/src/components/kp-ruling-planets.ts +9 -0
  214. package/src/components/moon-phase.ts +9 -0
  215. package/src/components/nakshatra-card.ts +9 -0
  216. package/src/components/natal-chart.ts +46 -62
  217. package/src/components/numerology-card.ts +9 -0
  218. package/src/components/panchang-table.ts +9 -0
  219. package/src/components/shadbala-table.ts +9 -0
  220. package/src/components/synastry-chart.ts +9 -0
  221. package/src/components/tarot-card.ts +9 -0
  222. package/src/components/tarot-spread.ts +9 -0
  223. package/src/components/transits-table.ts +54 -18
  224. package/src/components/vedic-kundli.ts +11 -1
  225. package/src/components/vedic-planets-table.ts +9 -0
  226. package/src/components/western-planets-table.ts +9 -0
  227. package/src/components/yoga-list.ts +9 -0
  228. package/src/types/index.ts +1 -1
  229. package/src/types/types.gen.ts +602 -200
  230. package/src/utils/disclosure.ts +62 -0
  231. package/src/utils/kundli-render.ts +21 -35
  232. package/src/utils/kundli-styles.ts +0 -31
  233. package/src/utils/markup-data.ts +115 -0
  234. package/src/utils/tablist.ts +124 -0
  235. package/src/version.ts +1 -1
@@ -0,0 +1,16 @@
1
+ import type { TemplateResult } from 'lit';
2
+ /**
3
+ * Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the
4
+ * browser default triangle with a thin chevron that rotates when the host
5
+ * `<details>` opens. Render it inside the `<summary>` and pair with
6
+ * {@link disclosureStyles}.
7
+ */
8
+ export declare function chevron(): TemplateResult;
9
+ /**
10
+ * Shared `<details>` accordion styling: hides the native disclosure triangle
11
+ * and rotates the {@link chevron} 180 degrees when the accordion is open.
12
+ * Import into any component that renders disclosure accordions so the chevron
13
+ * looks and behaves identically.
14
+ */
15
+ export declare const disclosureStyles: import("lit").CSSResult;
16
+ //# sourceMappingURL=disclosure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../../src/utils/disclosure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C;;;;;GAKG;AACH,wBAAgB,OAAO,IAAI,cAAc,CAiBxC;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,yBA2B5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"kundli-render.d.ts","sourceRoot":"","sources":["../../src/utils/kundli-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AA+B1C;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAA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EAAE,UAAU,KAAK,IAAI,GAClC,cAAc,CAQhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"kundli-styles.d.ts","sourceRoot":"","sources":["../../src/utils/kundli-styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,yBA8GxB,CAAC"}
1
+ {"version":3,"file":"kundli-styles.d.ts","sourceRoot":"","sources":["../../src/utils/kundli-styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,yBA+ExB,CAAC"}
@@ -0,0 +1,57 @@
1
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ /**
3
+ * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.
4
+ */
5
+ interface DataHost extends ReactiveControllerHost, HTMLElement {
6
+ data?: unknown;
7
+ }
8
+ /**
9
+ * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.
10
+ *
11
+ * @remarks
12
+ * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type="application/json" class="roxy-data">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.
13
+ *
14
+ * Source resolution order on connect, first hit wins:
15
+ *
16
+ * 1. `host.data` already set in JavaScript -> leave it, read nothing.
17
+ * 2. A direct-child `<script type="application/json" class="roxy-data">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.
18
+ *
19
+ * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.
20
+ *
21
+ * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.
22
+ *
23
+ * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.
24
+ *
25
+ * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * import { MarkupDataController } from '../utils/markup-data.js';
30
+ *
31
+ * export class RoxyExample extends LitElement {
32
+ * constructor() {
33
+ * super();
34
+ * new MarkupDataController(this);
35
+ * }
36
+ *
37
+ * @property({ attribute: false })
38
+ * data: ExampleResponse | null = null;
39
+ * }
40
+ * ```
41
+ */
42
+ export declare class MarkupDataController<T = unknown> implements ReactiveController {
43
+ private readonly host;
44
+ constructor(host: DataHost);
45
+ hostConnected(): void;
46
+ /**
47
+ * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.
48
+ */
49
+ private read;
50
+ /**
51
+ * Direct-child `<script type="application/json" class="roxy-data">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.
52
+ */
53
+ private findInlineScript;
54
+ private parse;
55
+ }
56
+ export {};
57
+ //# sourceMappingURL=markup-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markup-data.d.ts","sourceRoot":"","sources":["../../src/utils/markup-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAuBtE;;GAEG;AACH,UAAU,QAAS,SAAQ,sBAAsB,EAAE,WAAW;IAC7D,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,oBAAoB,CAAC,CAAC,GAAG,OAAO,CAAE,YAAW,kBAAkB;IAC3E,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;gBAEpB,IAAI,EAAE,QAAQ;IAK1B,aAAa;IAYb;;OAEG;IACH,OAAO,CAAC,IAAI;IAKZ;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,KAAK;CAUb"}
@@ -0,0 +1,44 @@
1
+ import type { TemplateResult } from 'lit';
2
+ /** A single tab in a {@link renderTablist} strip. */
3
+ export interface TablistItem<T extends string = string> {
4
+ id: T;
5
+ label: string;
6
+ }
7
+ /**
8
+ * Shared styling for every horizontal tab strip in the library (natal chart
9
+ * views, transits, kundli styles). Keeping one rule set means the tabs look
10
+ * identical everywhere and theme through the same --roxy-* tokens.
11
+ */
12
+ export declare const tablistStyles: import("lit").CSSResult;
13
+ /**
14
+ * Render a WAI-ARIA tablist. The host component owns the active-tab state; this
15
+ * helper draws the buttons, wires click plus Left/Right arrow navigation with a
16
+ * roving tabindex, and moves focus to the newly selected tab. Pair with
17
+ * {@link tablistStyles}.
18
+ *
19
+ * Pass `controls: true` when each tab governs a sibling
20
+ * `<div role="tabpanel" id="${idPrefix}-panel-${id}">` so the buttons advertise
21
+ * `aria-controls`. Omit it for tablists that swap a single rendered view in
22
+ * place with no separate panel element (the kundli style switch).
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * renderTablist({
27
+ * items: [{ id: 'wheel', label: 'Wheel' }, { id: 'grid', label: 'Aspect grid' }],
28
+ * active: this.view,
29
+ * onSelect: (v) => { this.view = v; },
30
+ * label: 'Natal chart views',
31
+ * idPrefix: 'natal',
32
+ * controls: true,
33
+ * })
34
+ * ```
35
+ */
36
+ export declare function renderTablist<T extends string>(opts: {
37
+ items: ReadonlyArray<TablistItem<T>>;
38
+ active: T;
39
+ onSelect: (id: T) => void;
40
+ label: string;
41
+ idPrefix: string;
42
+ controls?: boolean;
43
+ }): TemplateResult;
44
+ //# sourceMappingURL=tablist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tablist.d.ts","sourceRoot":"","sources":["../../src/utils/tablist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C,qDAAqD;AACrD,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACrD,EAAE,EAAE,CAAC,CAAC;IACN,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,yBAgCzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE;IACrD,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,cAAc,CA6CjB"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const ROXY_UI_VERSION = "0.4.1";
1
+ export declare const ROXY_UI_VERSION = "0.6.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@roxyapi/ui",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "Web components for the RoxyAPI catalog. Drop-in charts, tables, cards, forms for astrology, tarot, numerology, biorhythm, I Ching, crystals, dreams, angel numbers, and more. One key, beautiful in 30 minutes.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
+ "jsdelivr": "./dist/cdn/roxy-ui.js",
10
+ "unpkg": "./dist/cdn/roxy-ui.js",
9
11
  "exports": {
10
12
  ".": {
11
13
  "types": "./dist/index.d.ts",
@@ -3,6 +3,7 @@ import { customElement, property, state } from 'lit/decorators.js';
3
3
  import { SIGN_GLYPH } from '../tokens/index.js';
4
4
  import type { AshtakavargaResponse } from '../types/index.js';
5
5
  import { baseStyles } from '../utils/base-styles.js';
6
+ import { MarkupDataController } from '../utils/markup-data.js';
6
7
 
7
8
  type Tab = 'sarva' | 'bhinna' | 'pinda';
8
9
 
@@ -194,6 +195,14 @@ export class RoxyAshtakavargaGrid extends LitElement {
194
195
  `,
195
196
  ];
196
197
 
198
+ constructor() {
199
+ super();
200
+ // Enables hydrating `data` from a direct-child
201
+ // <script type="application/json" class="roxy-data"> for server-rendered
202
+ // and cached consumers. The JavaScript `data` property still wins.
203
+ new MarkupDataController(this);
204
+ }
205
+
197
206
  @property({ attribute: false })
198
207
  data: AshtakavargaResponse | null = null;
199
208
 
@@ -6,6 +6,7 @@ import type {
6
6
  GetForecastResponse,
7
7
  } from '../types/index.js';
8
8
  import { baseStyles } from '../utils/base-styles.js';
9
+ import { MarkupDataController } from '../utils/markup-data.js';
9
10
 
10
11
  type BiorhythmData =
11
12
  | GetDailyBiorhythmResponse
@@ -111,6 +112,14 @@ export class RoxyBiorhythmChart extends LitElement {
111
112
  `,
112
113
  ];
113
114
 
115
+ constructor() {
116
+ super();
117
+ // Enables hydrating `data` from a direct-child
118
+ // <script type="application/json" class="roxy-data"> for server-rendered
119
+ // and cached consumers. The JavaScript `data` property still wins.
120
+ new MarkupDataController(this);
121
+ }
122
+
114
123
  @property({ attribute: false })
115
124
  data: BiorhythmData | null = null;
116
125
 
@@ -3,6 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
3
3
  import { PLANET_GLYPH } from '../tokens/index.js';
4
4
  import type { GetChoghadiyaResponse } from '../types/index.js';
5
5
  import { baseStyles } from '../utils/base-styles.js';
6
+ import { MarkupDataController } from '../utils/markup-data.js';
6
7
  import { capitalize } from '../utils/string.js';
7
8
 
8
9
  type ChoghadiyaPeriod = GetChoghadiyaResponse['dayChoghadiya'][number];
@@ -132,6 +133,14 @@ export class RoxyChoghadiyaGrid extends LitElement {
132
133
  `,
133
134
  ];
134
135
 
136
+ constructor() {
137
+ super();
138
+ // Enables hydrating `data` from a direct-child
139
+ // <script type="application/json" class="roxy-data"> for server-rendered
140
+ // and cached consumers. The JavaScript `data` property still wins.
141
+ new MarkupDataController(this);
142
+ }
143
+
135
144
  @property({ attribute: false })
136
145
  data: GetChoghadiyaResponse | null = null;
137
146
 
@@ -7,6 +7,7 @@ import type {
7
7
  } from '../types/index.js';
8
8
  import { baseStyles } from '../utils/base-styles.js';
9
9
  import { formatNumber } from '../utils/format.js';
10
+ import { MarkupDataController } from '../utils/markup-data.js';
10
11
 
11
12
  type CompatibilityData =
12
13
  | CalculateCompatibilityResponse
@@ -108,6 +109,14 @@ export class RoxyCompatibilityCard extends LitElement {
108
109
  `,
109
110
  ];
110
111
 
112
+ constructor() {
113
+ super();
114
+ // Enables hydrating `data` from a direct-child
115
+ // <script type="application/json" class="roxy-data"> for server-rendered
116
+ // and cached consumers. The JavaScript `data` property still wins.
117
+ new MarkupDataController(this);
118
+ }
119
+
111
120
  @property({ attribute: false })
112
121
  data: CompatibilityData | null = null;
113
122
 
@@ -6,7 +6,9 @@ import type {
6
6
  GetSubDashasResponse,
7
7
  } from '../types/index.js';
8
8
  import { baseStyles } from '../utils/base-styles.js';
9
+ import { chevron, disclosureStyles } from '../utils/disclosure.js';
9
10
  import { formatNumber } from '../utils/format.js';
11
+ import { MarkupDataController } from '../utils/markup-data.js';
10
12
 
11
13
  type DashaData =
12
14
  | GetCurrentDashaResponse
@@ -24,6 +26,7 @@ type DashaPeriod = GetMajorDashasResponse['mahadashas'][number];
24
26
  export class RoxyDashaTimeline extends LitElement {
25
27
  static styles = [
26
28
  baseStyles,
29
+ disclosureStyles,
27
30
  css`
28
31
  .wrap {
29
32
  display: grid;
@@ -143,6 +146,10 @@ export class RoxyDashaTimeline extends LitElement {
143
146
  cursor: pointer;
144
147
  font-size: var(--roxy-text-sm, 0.875rem);
145
148
  font-weight: var(--roxy-weight-bold, 600);
149
+ display: flex;
150
+ align-items: center;
151
+ justify-content: space-between;
152
+ gap: var(--roxy-space-md, 1rem);
146
153
  }
147
154
  details.interp p {
148
155
  margin: var(--roxy-space-sm, 0.5rem) 0 0;
@@ -152,6 +159,14 @@ export class RoxyDashaTimeline extends LitElement {
152
159
  `,
153
160
  ];
154
161
 
162
+ constructor() {
163
+ super();
164
+ // Enables hydrating `data` from a direct-child
165
+ // <script type="application/json" class="roxy-data"> for server-rendered
166
+ // and cached consumers. The JavaScript `data` property still wins.
167
+ new MarkupDataController(this);
168
+ }
169
+
155
170
  @property({ attribute: false })
156
171
  data: DashaData | null = null;
157
172
 
@@ -224,7 +239,10 @@ export class RoxyDashaTimeline extends LitElement {
224
239
  const active = periods.find((p) => this.isCurrent(p));
225
240
  if (!active?.interpretation) return nothing;
226
241
  return html`<details class="interp">
227
- <summary>${active.planet} mahadasha interpretation</summary>
242
+ <summary>
243
+ <span>${active.planet} mahadasha interpretation</span>
244
+ ${chevron()}
245
+ </summary>
228
246
  <p>${active.interpretation}</p>
229
247
  </details>`;
230
248
  }
@@ -1,6 +1,7 @@
1
1
  import { css, html, LitElement, nothing, type TemplateResult } from 'lit';
2
2
  import { customElement, property } from 'lit/decorators.js';
3
3
  import { baseStyles } from '../utils/base-styles.js';
4
+ import { MarkupDataController } from '../utils/markup-data.js';
4
5
  import { humanize } from '../utils/string.js';
5
6
 
6
7
  /**
@@ -134,6 +135,14 @@ export class RoxyData extends LitElement {
134
135
  `,
135
136
  ];
136
137
 
138
+ constructor() {
139
+ super();
140
+ // Enables hydrating `data` from a direct-child
141
+ // <script type="application/json" class="roxy-data"> for server-rendered
142
+ // and cached consumers. The JavaScript `data` property still wins.
143
+ new MarkupDataController(this);
144
+ }
145
+
137
146
  @property({ attribute: false })
138
147
  data: Json = null;
139
148
 
@@ -11,6 +11,8 @@ import {
11
11
  toKundliViewModel,
12
12
  } from '../utils/kundli-render.js';
13
13
  import { kundliStyles } from '../utils/kundli-styles.js';
14
+ import { MarkupDataController } from '../utils/markup-data.js';
15
+ import { tablistStyles } from '../utils/tablist.js';
14
16
 
15
17
  /**
16
18
  * Divisional chart renderer (D2-D60). Accepts a DivisionalChartResponse and
@@ -25,6 +27,7 @@ export class RoxyDivisionalChart extends LitElement {
25
27
  static styles = [
26
28
  baseStyles,
27
29
  kundliStyles,
30
+ tablistStyles,
28
31
  css`
29
32
  .division-meta {
30
33
  font-size: var(--roxy-text-sm, 0.875rem);
@@ -65,6 +68,14 @@ export class RoxyDivisionalChart extends LitElement {
65
68
  `,
66
69
  ];
67
70
 
71
+ constructor() {
72
+ super();
73
+ // Enables hydrating `data` from a direct-child
74
+ // <script type="application/json" class="roxy-data"> for server-rendered
75
+ // and cached consumers. The JavaScript `data` property still wins.
76
+ new MarkupDataController(this);
77
+ }
78
+
68
79
  @property({ attribute: false })
69
80
  data: DivisionalChartResponse | null = null;
70
81
 
@@ -6,6 +6,7 @@ import type {
6
6
  SadhesatiResponse,
7
7
  } from '../types/index.js';
8
8
  import { baseStyles } from '../utils/base-styles.js';
9
+ import { MarkupDataController } from '../utils/markup-data.js';
9
10
 
10
11
  type DoshaData = ManglikResponse | KalsarpaResponse | SadhesatiResponse;
11
12
 
@@ -114,6 +115,14 @@ export class RoxyDoshaCard extends LitElement {
114
115
  `,
115
116
  ];
116
117
 
118
+ constructor() {
119
+ super();
120
+ // Enables hydrating `data` from a direct-child
121
+ // <script type="application/json" class="roxy-data"> for server-rendered
122
+ // and cached consumers. The JavaScript `data` property still wins.
123
+ new MarkupDataController(this);
124
+ }
125
+
117
126
  @property({ attribute: false })
118
127
  data: DoshaData | null = null;
119
128
 
@@ -3,6 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
3
3
  import type { CompatibilityResponse } from '../types/index.js';
4
4
  import { baseStyles } from '../utils/base-styles.js';
5
5
  import { formatNumber, formatPercent } from '../utils/format.js';
6
+ import { MarkupDataController } from '../utils/markup-data.js';
6
7
 
7
8
  const STANDARD_CATEGORIES = [
8
9
  'Varna',
@@ -146,6 +147,14 @@ export class RoxyGunaMilan extends LitElement {
146
147
  `,
147
148
  ];
148
149
 
150
+ constructor() {
151
+ super();
152
+ // Enables hydrating `data` from a direct-child
153
+ // <script type="application/json" class="roxy-data"> for server-rendered
154
+ // and cached consumers. The JavaScript `data` property still wins.
155
+ new MarkupDataController(this);
156
+ }
157
+
149
158
  @property({ attribute: false })
150
159
  data: CompatibilityResponse | null = null;
151
160
 
@@ -10,6 +10,7 @@ import type {
10
10
  LookupHexagramResponse,
11
11
  } from '../types/index.js';
12
12
  import { baseStyles } from '../utils/base-styles.js';
13
+ import { MarkupDataController } from '../utils/markup-data.js';
13
14
 
14
15
  type HexagramData =
15
16
  | GetHexagramResponse
@@ -136,6 +137,14 @@ export class RoxyHexagram extends LitElement {
136
137
  `,
137
138
  ];
138
139
 
140
+ constructor() {
141
+ super();
142
+ // Enables hydrating `data` from a direct-child
143
+ // <script type="application/json" class="roxy-data"> for server-rendered
144
+ // and cached consumers. The JavaScript `data` property still wins.
145
+ new MarkupDataController(this);
146
+ }
147
+
139
148
  @property({ attribute: false })
140
149
  data: HexagramData | null = null;
141
150
 
@@ -7,6 +7,7 @@ import type {
7
7
  GetWeeklyHoroscopeResponse,
8
8
  } from '../types/index.js';
9
9
  import { baseStyles } from '../utils/base-styles.js';
10
+ import { MarkupDataController } from '../utils/markup-data.js';
10
11
  import { capitalize } from '../utils/string.js';
11
12
 
12
13
  type HoroscopeData =
@@ -147,6 +148,14 @@ export class RoxyHoroscopeCard extends LitElement {
147
148
  `,
148
149
  ];
149
150
 
151
+ constructor() {
152
+ super();
153
+ // Enables hydrating `data` from a direct-child
154
+ // <script type="application/json" class="roxy-data"> for server-rendered
155
+ // and cached consumers. The JavaScript `data` property still wins.
156
+ new MarkupDataController(this);
157
+ }
158
+
150
159
  @property({ attribute: false })
151
160
  data: HoroscopeData | null = null;
152
161
 
@@ -3,6 +3,7 @@ import { customElement, property, state } from 'lit/decorators.js';
3
3
  import type { KpChartResponse } from '../types/index.js';
4
4
  import { baseStyles } from '../utils/base-styles.js';
5
5
  import { formatNumber } from '../utils/format.js';
6
+ import { MarkupDataController } from '../utils/markup-data.js';
6
7
 
7
8
  type Tab = 'planets' | 'cusps';
8
9
 
@@ -123,6 +124,14 @@ export class RoxyKpChart extends LitElement {
123
124
  `,
124
125
  ];
125
126
 
127
+ constructor() {
128
+ super();
129
+ // Enables hydrating `data` from a direct-child
130
+ // <script type="application/json" class="roxy-data"> for server-rendered
131
+ // and cached consumers. The JavaScript `data` property still wins.
132
+ new MarkupDataController(this);
133
+ }
134
+
126
135
  @property({ attribute: false })
127
136
  data: KpChartResponse | null = null;
128
137
 
@@ -3,6 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
3
3
  import type { KpPlanetsResponse } from '../types/index.js';
4
4
  import { baseStyles } from '../utils/base-styles.js';
5
5
  import { formatNumber } from '../utils/format.js';
6
+ import { MarkupDataController } from '../utils/markup-data.js';
6
7
 
7
8
  /**
8
9
  * KP planets table with sub-lord and sub-sub-lord columns. Renders
@@ -74,6 +75,14 @@ export class RoxyKpPlanetsTable extends LitElement {
74
75
  `,
75
76
  ];
76
77
 
78
+ constructor() {
79
+ super();
80
+ // Enables hydrating `data` from a direct-child
81
+ // <script type="application/json" class="roxy-data"> for server-rendered
82
+ // and cached consumers. The JavaScript `data` property still wins.
83
+ new MarkupDataController(this);
84
+ }
85
+
77
86
  @property({ attribute: false })
78
87
  data: KpPlanetsResponse | null = null;
79
88
 
@@ -2,6 +2,7 @@ import { css, html, LitElement, nothing } from 'lit';
2
2
  import { customElement, property } from 'lit/decorators.js';
3
3
  import type { KpRulingPlanetsResponse } from '../types/index.js';
4
4
  import { baseStyles } from '../utils/base-styles.js';
5
+ import { MarkupDataController } from '../utils/markup-data.js';
5
6
 
6
7
  /**
7
8
  * KP ruling planets card. Renders /vedic-astrology/kp/ruling-planets: the day
@@ -113,6 +114,14 @@ export class RoxyKpRulingPlanets extends LitElement {
113
114
  `,
114
115
  ];
115
116
 
117
+ constructor() {
118
+ super();
119
+ // Enables hydrating `data` from a direct-child
120
+ // <script type="application/json" class="roxy-data"> for server-rendered
121
+ // and cached consumers. The JavaScript `data` property still wins.
122
+ new MarkupDataController(this);
123
+ }
124
+
116
125
  @property({ attribute: false })
117
126
  data: KpRulingPlanetsResponse | null = null;
118
127
 
@@ -8,6 +8,7 @@ import type {
8
8
  } from '../types/index.js';
9
9
  import { baseStyles } from '../utils/base-styles.js';
10
10
  import { formatNumber } from '../utils/format.js';
11
+ import { MarkupDataController } from '../utils/markup-data.js';
11
12
 
12
13
  type MoonPhaseData =
13
14
  | GetCurrentMoonPhaseResponse
@@ -109,6 +110,14 @@ export class RoxyMoonPhase extends LitElement {
109
110
  `,
110
111
  ];
111
112
 
113
+ constructor() {
114
+ super();
115
+ // Enables hydrating `data` from a direct-child
116
+ // <script type="application/json" class="roxy-data"> for server-rendered
117
+ // and cached consumers. The JavaScript `data` property still wins.
118
+ new MarkupDataController(this);
119
+ }
120
+
112
121
  @property({ attribute: false })
113
122
  data: MoonPhaseData | null = null;
114
123
 
@@ -2,6 +2,7 @@ import { css, html, LitElement, nothing } from 'lit';
2
2
  import { customElement, property } from 'lit/decorators.js';
3
3
  import type { NakshatraResponse } from '../types/index.js';
4
4
  import { baseStyles } from '../utils/base-styles.js';
5
+ import { MarkupDataController } from '../utils/markup-data.js';
5
6
 
6
7
  /**
7
8
  * Nakshatra reference card. Renders /vedic-astrology/nakshatras/{id}: the
@@ -91,6 +92,14 @@ export class RoxyNakshatraCard extends LitElement {
91
92
  `,
92
93
  ];
93
94
 
95
+ constructor() {
96
+ super();
97
+ // Enables hydrating `data` from a direct-child
98
+ // <script type="application/json" class="roxy-data"> for server-rendered
99
+ // and cached consumers. The JavaScript `data` property still wins.
100
+ new MarkupDataController(this);
101
+ }
102
+
94
103
  @property({ attribute: false })
95
104
  data: NakshatraResponse | null = null;
96
105