@roxyapi/ui 0.9.0 → 0.11.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 +53 -27
- package/README.md +42 -12
- package/components-catalog.json +1022 -0
- package/dist/cdn/components/angel-number-card.js +52 -0
- package/dist/cdn/components/angel-number-card.js.map +7 -0
- package/dist/cdn/components/angel-number-lookup.js +52 -0
- package/dist/cdn/components/angel-number-lookup.js.map +7 -0
- package/dist/cdn/components/ashtakavarga-grid.js +10 -3
- package/dist/cdn/components/ashtakavarga-grid.js.map +4 -4
- package/dist/cdn/components/aspects-table.js +52 -0
- package/dist/cdn/components/aspects-table.js.map +7 -0
- package/dist/cdn/components/biorhythm-chart.js +10 -3
- package/dist/cdn/components/biorhythm-chart.js.map +4 -4
- package/dist/cdn/components/bodygraph.js +17 -10
- package/dist/cdn/components/bodygraph.js.map +4 -4
- package/dist/cdn/components/choghadiya-grid.js +10 -3
- package/dist/cdn/components/choghadiya-grid.js.map +4 -4
- package/dist/cdn/components/compatibility-card.js +10 -3
- package/dist/cdn/components/compatibility-card.js.map +4 -4
- package/dist/cdn/components/crystal-card.js +52 -0
- package/dist/cdn/components/crystal-card.js.map +7 -0
- package/dist/cdn/components/crystal-grid.js +52 -0
- package/dist/cdn/components/crystal-grid.js.map +7 -0
- package/dist/cdn/components/dasha-timeline.js +10 -3
- package/dist/cdn/components/dasha-timeline.js.map +4 -4
- package/dist/cdn/components/data.js +10 -3
- package/dist/cdn/components/data.js.map +4 -4
- package/dist/cdn/components/divisional-chart.js +31 -24
- package/dist/cdn/components/divisional-chart.js.map +4 -4
- package/dist/cdn/components/dosha-card.js +10 -3
- package/dist/cdn/components/dosha-card.js.map +4 -4
- package/dist/cdn/components/dream-card.js +52 -0
- package/dist/cdn/components/dream-card.js.map +7 -0
- package/dist/cdn/components/dream-search.js +52 -0
- package/dist/cdn/components/dream-search.js.map +7 -0
- package/dist/cdn/components/endpoint-form.js +3 -3
- package/dist/cdn/components/endpoint-form.js.map +3 -3
- package/dist/cdn/components/forecast-digest.js +52 -0
- package/dist/cdn/components/forecast-digest.js.map +7 -0
- package/dist/cdn/components/forecast-timeline.js +10 -3
- package/dist/cdn/components/forecast-timeline.js.map +4 -4
- package/dist/cdn/components/guna-milan.js +10 -3
- package/dist/cdn/components/guna-milan.js.map +4 -4
- package/dist/cdn/components/hd-connection.js +52 -0
- package/dist/cdn/components/hd-connection.js.map +7 -0
- package/dist/cdn/components/hd-penta.js +52 -0
- package/dist/cdn/components/hd-penta.js.map +7 -0
- package/dist/cdn/components/hd-variables.js +52 -0
- package/dist/cdn/components/hd-variables.js.map +7 -0
- package/dist/cdn/components/hexagram.js +10 -3
- package/dist/cdn/components/hexagram.js.map +4 -4
- package/dist/cdn/components/hora-table.js +52 -0
- package/dist/cdn/components/hora-table.js.map +7 -0
- package/dist/cdn/components/horoscope-card.js +10 -3
- package/dist/cdn/components/horoscope-card.js.map +4 -4
- package/dist/cdn/components/kp-chart.js +10 -3
- package/dist/cdn/components/kp-chart.js.map +4 -4
- package/dist/cdn/components/kp-planets-table.js +10 -3
- package/dist/cdn/components/kp-planets-table.js.map +4 -4
- package/dist/cdn/components/kp-ruling-planets.js +10 -3
- package/dist/cdn/components/kp-ruling-planets.js.map +4 -4
- package/dist/cdn/components/location-search.js +3 -3
- package/dist/cdn/components/location-search.js.map +2 -2
- package/dist/cdn/components/moon-phase.js +10 -3
- package/dist/cdn/components/moon-phase.js.map +4 -4
- package/dist/cdn/components/nakshatra-card.js +10 -3
- package/dist/cdn/components/nakshatra-card.js.map +4 -4
- package/dist/cdn/components/natal-chart.js +16 -9
- package/dist/cdn/components/natal-chart.js.map +4 -4
- package/dist/cdn/components/numerology-card.js +10 -3
- package/dist/cdn/components/numerology-card.js.map +4 -4
- package/dist/cdn/components/panchang-table.js +10 -3
- package/dist/cdn/components/panchang-table.js.map +4 -4
- package/dist/cdn/components/reference-card.js +52 -0
- package/dist/cdn/components/reference-card.js.map +7 -0
- package/dist/cdn/components/shadbala-table.js +10 -3
- package/dist/cdn/components/shadbala-table.js.map +4 -4
- package/dist/cdn/components/synastry-chart.js +16 -9
- package/dist/cdn/components/synastry-chart.js.map +4 -4
- package/dist/cdn/components/tarot-card.js +10 -3
- package/dist/cdn/components/tarot-card.js.map +4 -4
- package/dist/cdn/components/tarot-catalog.js +52 -0
- package/dist/cdn/components/tarot-catalog.js.map +7 -0
- package/dist/cdn/components/tarot-spread.js +10 -3
- package/dist/cdn/components/tarot-spread.js.map +4 -4
- package/dist/cdn/components/transits-table.js +10 -3
- package/dist/cdn/components/transits-table.js.map +4 -4
- package/dist/cdn/components/vedic-aspects.js +52 -0
- package/dist/cdn/components/vedic-aspects.js.map +7 -0
- package/dist/cdn/components/vedic-kundli.js +31 -24
- package/dist/cdn/components/vedic-kundli.js.map +4 -4
- package/dist/cdn/components/vedic-planets-table.js +10 -3
- package/dist/cdn/components/vedic-planets-table.js.map +4 -4
- package/dist/cdn/components/western-planets-table.js +10 -3
- package/dist/cdn/components/western-planets-table.js.map +4 -4
- package/dist/cdn/components/yoga-list.js +10 -3
- package/dist/cdn/components/yoga-list.js.map +4 -4
- package/dist/cdn/roxy-ui.js +92 -81
- package/dist/cdn/roxy-ui.js.map +4 -4
- package/dist/components/angel-number-card.d.ts +17 -0
- package/dist/components/angel-number-card.d.ts.map +1 -0
- package/dist/components/angel-number-card.js +2 -0
- package/dist/components/angel-number-card.js.map +7 -0
- package/dist/components/angel-number-lookup.d.ts +21 -0
- package/dist/components/angel-number-lookup.d.ts.map +1 -0
- package/dist/components/angel-number-lookup.js +2 -0
- package/dist/components/angel-number-lookup.js.map +7 -0
- package/dist/components/ashtakavarga-grid.d.ts +4 -5
- package/dist/components/ashtakavarga-grid.d.ts.map +1 -1
- package/dist/components/ashtakavarga-grid.js +1 -1
- package/dist/components/ashtakavarga-grid.js.map +4 -4
- package/dist/components/aspects-table.d.ts +23 -0
- package/dist/components/aspects-table.d.ts.map +1 -0
- package/dist/components/aspects-table.js +2 -0
- package/dist/components/aspects-table.js.map +7 -0
- package/dist/components/biorhythm-chart.d.ts +4 -5
- package/dist/components/biorhythm-chart.d.ts.map +1 -1
- package/dist/components/biorhythm-chart.js +1 -1
- package/dist/components/biorhythm-chart.js.map +4 -4
- package/dist/components/bodygraph.d.ts +4 -5
- package/dist/components/bodygraph.d.ts.map +1 -1
- package/dist/components/bodygraph.js +9 -9
- package/dist/components/bodygraph.js.map +4 -4
- package/dist/components/choghadiya-grid.d.ts +4 -5
- package/dist/components/choghadiya-grid.d.ts.map +1 -1
- package/dist/components/choghadiya-grid.js +1 -1
- package/dist/components/choghadiya-grid.js.map +4 -4
- package/dist/components/compatibility-card.d.ts +4 -5
- package/dist/components/compatibility-card.d.ts.map +1 -1
- package/dist/components/compatibility-card.js +1 -1
- package/dist/components/compatibility-card.js.map +4 -4
- package/dist/components/crystal-card.d.ts +19 -0
- package/dist/components/crystal-card.d.ts.map +1 -0
- package/dist/components/crystal-card.js +2 -0
- package/dist/components/crystal-card.js.map +7 -0
- package/dist/components/crystal-grid.d.ts +26 -0
- package/dist/components/crystal-grid.d.ts.map +1 -0
- package/dist/components/crystal-grid.js +2 -0
- package/dist/components/crystal-grid.js.map +7 -0
- package/dist/components/dasha-timeline.d.ts +4 -5
- package/dist/components/dasha-timeline.d.ts.map +1 -1
- package/dist/components/dasha-timeline.js +1 -1
- package/dist/components/dasha-timeline.js.map +4 -4
- package/dist/components/data.d.ts +5 -8
- package/dist/components/data.d.ts.map +1 -1
- package/dist/components/data.js +1 -1
- package/dist/components/data.js.map +4 -4
- package/dist/components/divisional-chart.d.ts +4 -5
- package/dist/components/divisional-chart.d.ts.map +1 -1
- package/dist/components/divisional-chart.js +59 -59
- package/dist/components/divisional-chart.js.map +4 -4
- package/dist/components/dosha-card.d.ts +4 -5
- package/dist/components/dosha-card.d.ts.map +1 -1
- package/dist/components/dosha-card.js +1 -1
- package/dist/components/dosha-card.js.map +4 -4
- package/dist/components/dream-card.d.ts +16 -0
- package/dist/components/dream-card.d.ts.map +1 -0
- package/dist/components/dream-card.js +2 -0
- package/dist/components/dream-card.js.map +7 -0
- package/dist/components/dream-search.d.ts +18 -0
- package/dist/components/dream-search.d.ts.map +1 -0
- package/dist/components/dream-search.js +2 -0
- package/dist/components/dream-search.js.map +7 -0
- package/dist/components/endpoint-form.d.ts +10 -5
- package/dist/components/endpoint-form.d.ts.map +1 -1
- package/dist/components/endpoint-form.js +1 -1
- package/dist/components/endpoint-form.js.map +3 -3
- package/dist/components/forecast-digest.d.ts +19 -0
- package/dist/components/forecast-digest.d.ts.map +1 -0
- package/dist/components/forecast-digest.js +2 -0
- package/dist/components/forecast-digest.js.map +7 -0
- package/dist/components/forecast-timeline.d.ts +8 -6
- package/dist/components/forecast-timeline.d.ts.map +1 -1
- package/dist/components/forecast-timeline.js +1 -1
- package/dist/components/forecast-timeline.js.map +4 -4
- package/dist/components/guna-milan.d.ts +4 -5
- package/dist/components/guna-milan.d.ts.map +1 -1
- package/dist/components/guna-milan.js +1 -1
- package/dist/components/guna-milan.js.map +4 -4
- package/dist/components/hd-connection.d.ts +18 -0
- package/dist/components/hd-connection.d.ts.map +1 -0
- package/dist/components/hd-connection.js +2 -0
- package/dist/components/hd-connection.js.map +7 -0
- package/dist/components/hd-penta.d.ts +18 -0
- package/dist/components/hd-penta.d.ts.map +1 -0
- package/dist/components/hd-penta.js +2 -0
- package/dist/components/hd-penta.js.map +7 -0
- package/dist/components/hd-variables.d.ts +17 -0
- package/dist/components/hd-variables.d.ts.map +1 -0
- package/dist/components/hd-variables.js +2 -0
- package/dist/components/hd-variables.js.map +7 -0
- package/dist/components/hexagram.d.ts +4 -5
- package/dist/components/hexagram.d.ts.map +1 -1
- package/dist/components/hexagram.js +1 -1
- package/dist/components/hexagram.js.map +4 -4
- package/dist/components/hora-table.d.ts +17 -0
- package/dist/components/hora-table.d.ts.map +1 -0
- package/dist/components/hora-table.js +2 -0
- package/dist/components/hora-table.js.map +7 -0
- package/dist/components/horoscope-card.d.ts +4 -5
- package/dist/components/horoscope-card.d.ts.map +1 -1
- package/dist/components/horoscope-card.js +1 -1
- package/dist/components/horoscope-card.js.map +4 -4
- package/dist/components/kp-chart.d.ts +4 -5
- package/dist/components/kp-chart.d.ts.map +1 -1
- package/dist/components/kp-chart.js +1 -1
- package/dist/components/kp-chart.js.map +4 -4
- package/dist/components/kp-planets-table.d.ts +4 -5
- package/dist/components/kp-planets-table.d.ts.map +1 -1
- package/dist/components/kp-planets-table.js +1 -1
- package/dist/components/kp-planets-table.js.map +4 -4
- package/dist/components/kp-ruling-planets.d.ts +4 -5
- package/dist/components/kp-ruling-planets.d.ts.map +1 -1
- package/dist/components/kp-ruling-planets.js +1 -1
- package/dist/components/kp-ruling-planets.js.map +4 -4
- package/dist/components/location-search.js +1 -1
- package/dist/components/location-search.js.map +2 -2
- package/dist/components/moon-phase.d.ts +5 -5
- package/dist/components/moon-phase.d.ts.map +1 -1
- package/dist/components/moon-phase.js +1 -1
- package/dist/components/moon-phase.js.map +4 -4
- package/dist/components/nakshatra-card.d.ts +4 -5
- package/dist/components/nakshatra-card.d.ts.map +1 -1
- package/dist/components/nakshatra-card.js +1 -1
- package/dist/components/nakshatra-card.js.map +4 -4
- package/dist/components/natal-chart.d.ts +4 -5
- package/dist/components/natal-chart.d.ts.map +1 -1
- package/dist/components/natal-chart.js +8 -8
- package/dist/components/natal-chart.js.map +4 -4
- package/dist/components/numerology-card.d.ts +15 -10
- package/dist/components/numerology-card.d.ts.map +1 -1
- package/dist/components/numerology-card.js +1 -1
- package/dist/components/numerology-card.js.map +4 -4
- package/dist/components/panchang-table.d.ts +4 -5
- package/dist/components/panchang-table.d.ts.map +1 -1
- package/dist/components/panchang-table.js +1 -1
- package/dist/components/panchang-table.js.map +4 -4
- package/dist/components/reference-card.d.ts +19 -0
- package/dist/components/reference-card.d.ts.map +1 -0
- package/dist/components/reference-card.js +2 -0
- package/dist/components/reference-card.js.map +7 -0
- package/dist/components/shadbala-table.d.ts +4 -5
- package/dist/components/shadbala-table.d.ts.map +1 -1
- package/dist/components/shadbala-table.js +1 -1
- package/dist/components/shadbala-table.js.map +4 -4
- package/dist/components/synastry-chart.d.ts +4 -5
- package/dist/components/synastry-chart.d.ts.map +1 -1
- package/dist/components/synastry-chart.js +7 -7
- package/dist/components/synastry-chart.js.map +4 -4
- package/dist/components/tarot-card.d.ts +4 -5
- package/dist/components/tarot-card.d.ts.map +1 -1
- package/dist/components/tarot-card.js +1 -1
- package/dist/components/tarot-card.js.map +4 -4
- package/dist/components/tarot-catalog.d.ts +20 -0
- package/dist/components/tarot-catalog.d.ts.map +1 -0
- package/dist/components/tarot-catalog.js +2 -0
- package/dist/components/tarot-catalog.js.map +7 -0
- package/dist/components/tarot-spread.d.ts +7 -8
- package/dist/components/tarot-spread.d.ts.map +1 -1
- package/dist/components/tarot-spread.js +1 -1
- package/dist/components/tarot-spread.js.map +4 -4
- package/dist/components/transits-table.d.ts +4 -5
- package/dist/components/transits-table.d.ts.map +1 -1
- package/dist/components/transits-table.js +1 -1
- package/dist/components/transits-table.js.map +4 -4
- package/dist/components/vedic-aspects.d.ts +16 -0
- package/dist/components/vedic-aspects.d.ts.map +1 -0
- package/dist/components/vedic-aspects.js +2 -0
- package/dist/components/vedic-aspects.js.map +7 -0
- package/dist/components/vedic-kundli.d.ts +22 -5
- package/dist/components/vedic-kundli.d.ts.map +1 -1
- package/dist/components/vedic-kundli.js +63 -63
- package/dist/components/vedic-kundli.js.map +4 -4
- package/dist/components/vedic-planets-table.d.ts +4 -5
- package/dist/components/vedic-planets-table.d.ts.map +1 -1
- package/dist/components/vedic-planets-table.js +1 -1
- package/dist/components/vedic-planets-table.js.map +4 -4
- package/dist/components/western-planets-table.d.ts +4 -5
- package/dist/components/western-planets-table.d.ts.map +1 -1
- package/dist/components/western-planets-table.js +1 -1
- package/dist/components/western-planets-table.js.map +4 -4
- package/dist/components/yoga-list.d.ts +6 -7
- package/dist/components/yoga-list.d.ts.map +1 -1
- package/dist/components/yoga-list.js +1 -1
- package/dist/components/yoga-list.js.map +4 -4
- package/dist/generated/endpoint-bindings.d.ts +15 -0
- package/dist/generated/endpoint-bindings.d.ts.map +1 -0
- package/dist/index.cjs +73 -73
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -71
- package/dist/index.js.map +4 -4
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.json +39 -24
- package/dist/styles/tokens-css.d.ts +1 -1
- package/dist/styles/tokens-css.d.ts.map +1 -1
- package/dist/styles/tokens.css +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.gen.d.ts +1103 -164
- package/dist/types/types.gen.d.ts.map +1 -1
- package/dist/utils/angel-sections.d.ts +14 -0
- package/dist/utils/angel-sections.d.ts.map +1 -0
- package/dist/utils/base-element.d.ts +73 -0
- package/dist/utils/base-element.d.ts.map +1 -0
- package/dist/utils/base-styles.d.ts.map +1 -1
- package/dist/utils/fetch-controller.d.ts +60 -0
- package/dist/utils/fetch-controller.d.ts.map +1 -0
- package/dist/utils/kundli-render.d.ts +2 -1
- package/dist/utils/kundli-render.d.ts.map +1 -1
- package/dist/utils/kundli-styles.d.ts.map +1 -1
- package/dist/utils/markup-data.d.ts +34 -0
- package/dist/utils/markup-data.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/components/angel-number-card.ts +210 -0
- package/src/components/angel-number-lookup.ts +207 -0
- package/src/components/ashtakavarga-grid.ts +15 -20
- package/src/components/aspects-table.ts +329 -0
- package/src/components/biorhythm-chart.ts +14 -18
- package/src/components/bodygraph.ts +9 -20
- package/src/components/choghadiya-grid.ts +15 -19
- package/src/components/compatibility-card.ts +9 -19
- package/src/components/crystal-card.ts +242 -0
- package/src/components/crystal-grid.ts +182 -0
- package/src/components/dasha-timeline.ts +9 -20
- package/src/components/data.ts +8 -27
- package/src/components/divisional-chart.ts +10 -18
- package/src/components/dosha-card.ts +8 -19
- package/src/components/dream-card.ts +88 -0
- package/src/components/dream-search.ts +135 -0
- package/src/components/endpoint-form.ts +149 -55
- package/src/components/forecast-digest.ts +213 -0
- package/src/components/forecast-timeline.ts +24 -19
- package/src/components/guna-milan.ts +8 -19
- package/src/components/hd-connection.ts +188 -0
- package/src/components/hd-penta.ts +165 -0
- package/src/components/hd-variables.ts +128 -0
- package/src/components/hexagram.ts +10 -18
- package/src/components/hora-table.ts +149 -0
- package/src/components/horoscope-card.ts +9 -19
- package/src/components/kp-chart.ts +11 -20
- package/src/components/kp-planets-table.ts +11 -20
- package/src/components/kp-ruling-planets.ts +8 -18
- package/src/components/moon-phase.ts +10 -19
- package/src/components/nakshatra-card.ts +11 -20
- package/src/components/natal-chart.ts +20 -23
- package/src/components/numerology-card.ts +90 -31
- package/src/components/panchang-table.ts +9 -19
- package/src/components/reference-card.ts +212 -0
- package/src/components/shadbala-table.ts +15 -18
- package/src/components/synastry-chart.ts +17 -20
- package/src/components/tarot-card.ts +9 -20
- package/src/components/tarot-catalog.ts +129 -0
- package/src/components/tarot-spread.ts +20 -21
- package/src/components/transits-table.ts +17 -20
- package/src/components/vedic-aspects.ts +188 -0
- package/src/components/vedic-kundli.ts +46 -19
- package/src/components/vedic-planets-table.ts +11 -19
- package/src/components/western-planets-table.ts +11 -19
- package/src/components/yoga-list.ts +17 -23
- package/src/generated/endpoint-bindings.ts +655 -0
- package/src/index.ts +27 -0
- package/src/manifest.ts +198 -6
- package/src/styles/tokens-css.ts +4 -0
- package/src/styles/tokens.css +4 -0
- package/src/types/index.ts +1 -1
- package/src/types/types.gen.ts +1123 -164
- package/src/utils/angel-sections.ts +38 -0
- package/src/utils/base-element.ts +183 -0
- package/src/utils/base-styles.ts +33 -0
- package/src/utils/fetch-controller.ts +166 -0
- package/src/utils/kundli-render.ts +9 -2
- package/src/utils/kundli-styles.ts +7 -1
- package/src/utils/markup-data.ts +45 -0
- package/src/version.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css, html,
|
|
1
|
+
import { css, html, nothing } from 'lit';
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import { SIGN_GLYPH } from '../tokens/index.js';
|
|
4
4
|
import type {
|
|
@@ -6,8 +6,8 @@ import type {
|
|
|
6
6
|
GetMonthlyHoroscopeResponse,
|
|
7
7
|
GetWeeklyHoroscopeResponse,
|
|
8
8
|
} from '../types/index.js';
|
|
9
|
+
import { RoxyDataElement } from '../utils/base-element.js';
|
|
9
10
|
import { baseStyles } from '../utils/base-styles.js';
|
|
10
|
-
import { MarkupDataController } from '../utils/markup-data.js';
|
|
11
11
|
import { capitalize } from '../utils/string.js';
|
|
12
12
|
|
|
13
13
|
type HoroscopeData =
|
|
@@ -20,12 +20,13 @@ type HoroscopeData =
|
|
|
20
20
|
* /astrology/horoscope/{sign}/{daily|weekly|monthly}.
|
|
21
21
|
*/
|
|
22
22
|
@customElement('roxy-horoscope-card')
|
|
23
|
-
export class RoxyHoroscopeCard extends
|
|
23
|
+
export class RoxyHoroscopeCard extends RoxyDataElement<HoroscopeData> {
|
|
24
24
|
static styles = [
|
|
25
25
|
baseStyles,
|
|
26
26
|
css`
|
|
27
27
|
.card {
|
|
28
|
-
background: var(--roxy-
|
|
28
|
+
background: var(--roxy-surface, #fff);
|
|
29
|
+
color: var(--roxy-fg, #0a0a0a);
|
|
29
30
|
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
30
31
|
border-radius: var(--roxy-radius-md, 8px);
|
|
31
32
|
padding: var(--roxy-space-lg, 1.5rem);
|
|
@@ -148,25 +149,14 @@ export class RoxyHoroscopeCard extends LitElement {
|
|
|
148
149
|
`,
|
|
149
150
|
];
|
|
150
151
|
|
|
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
|
-
|
|
159
|
-
@property({ attribute: false })
|
|
160
|
-
data: HoroscopeData | null = null;
|
|
161
|
-
|
|
162
152
|
@property({ type: String, reflect: true })
|
|
163
153
|
period: 'daily' | 'weekly' | 'monthly' = 'daily';
|
|
164
154
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return html`<div class="roxy-empty" role="status">No horoscope data</div>`;
|
|
155
|
+
protected renderEmpty() {
|
|
156
|
+
return html`<div class="roxy-empty" role="status">No horoscope data</div>`;
|
|
157
|
+
}
|
|
169
158
|
|
|
159
|
+
protected renderData(d: HoroscopeData) {
|
|
170
160
|
const sign = d.sign ?? '';
|
|
171
161
|
const glyph = sign ? (SIGN_GLYPH[capitalize(sign)] ?? '') : '';
|
|
172
162
|
const energy =
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { css, html,
|
|
2
|
-
import { customElement,
|
|
1
|
+
import { css, html, nothing } from 'lit';
|
|
2
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
3
3
|
import type { KpChartResponse } from '../types/index.js';
|
|
4
|
+
import { RoxyDataElement } from '../utils/base-element.js';
|
|
4
5
|
import { baseStyles } from '../utils/base-styles.js';
|
|
5
6
|
import { formatNumber } from '../utils/format.js';
|
|
6
|
-
import { MarkupDataController } from '../utils/markup-data.js';
|
|
7
7
|
|
|
8
8
|
type Tab = 'planets' | 'cusps';
|
|
9
9
|
|
|
@@ -28,16 +28,17 @@ interface KpBody {
|
|
|
28
28
|
* sub-sub lord, and KP number (1-249).
|
|
29
29
|
*/
|
|
30
30
|
@customElement('roxy-kp-chart')
|
|
31
|
-
export class RoxyKpChart extends
|
|
31
|
+
export class RoxyKpChart extends RoxyDataElement<KpChartResponse> {
|
|
32
32
|
static styles = [
|
|
33
33
|
baseStyles,
|
|
34
34
|
css`
|
|
35
35
|
.wrap {
|
|
36
36
|
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
37
37
|
border-radius: var(--roxy-radius-md, 8px);
|
|
38
|
-
background: var(--roxy-
|
|
38
|
+
background: var(--roxy-surface, #fff);
|
|
39
39
|
overflow: auto;
|
|
40
40
|
box-shadow: var(--roxy-shadow-sm);
|
|
41
|
+
width: 100%;
|
|
41
42
|
}
|
|
42
43
|
.head {
|
|
43
44
|
padding: var(--roxy-space-md, 1rem);
|
|
@@ -124,17 +125,6 @@ export class RoxyKpChart extends LitElement {
|
|
|
124
125
|
`,
|
|
125
126
|
];
|
|
126
127
|
|
|
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
|
-
|
|
135
|
-
@property({ attribute: false })
|
|
136
|
-
data: KpChartResponse | null = null;
|
|
137
|
-
|
|
138
128
|
@state()
|
|
139
129
|
private activeTab: Tab = 'planets';
|
|
140
130
|
|
|
@@ -186,10 +176,11 @@ export class RoxyKpChart extends LitElement {
|
|
|
186
176
|
});
|
|
187
177
|
}
|
|
188
178
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
179
|
+
protected renderEmpty() {
|
|
180
|
+
return html`<div class="roxy-empty" role="status">No KP chart data</div>`;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
protected renderData(d: KpChartResponse) {
|
|
193
184
|
const asc = d.ascendant;
|
|
194
185
|
|
|
195
186
|
return html`<div class="wrap" aria-label="KP chart" tabindex="0">
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { css, html,
|
|
2
|
-
import { customElement
|
|
1
|
+
import { css, html, nothing } from 'lit';
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import type { KpPlanetsResponse } from '../types/index.js';
|
|
4
|
+
import { RoxyDataElement } from '../utils/base-element.js';
|
|
4
5
|
import { baseStyles } from '../utils/base-styles.js';
|
|
5
6
|
import { formatNumber } from '../utils/format.js';
|
|
6
|
-
import { MarkupDataController } from '../utils/markup-data.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* KP planets table with sub-lord and sub-sub-lord columns. Renders
|
|
10
10
|
* /vedic-astrology/kp/planets.
|
|
11
11
|
*/
|
|
12
12
|
@customElement('roxy-kp-planets-table')
|
|
13
|
-
export class RoxyKpPlanetsTable extends
|
|
13
|
+
export class RoxyKpPlanetsTable extends RoxyDataElement<KpPlanetsResponse> {
|
|
14
14
|
static styles = [
|
|
15
15
|
baseStyles,
|
|
16
16
|
css`
|
|
17
17
|
.wrap {
|
|
18
18
|
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
19
19
|
border-radius: var(--roxy-radius-md, 8px);
|
|
20
|
-
background: var(--roxy-
|
|
20
|
+
background: var(--roxy-surface, #fff);
|
|
21
21
|
overflow: auto;
|
|
22
22
|
box-shadow: var(--roxy-shadow-sm);
|
|
23
23
|
}
|
|
@@ -75,21 +75,12 @@ export class RoxyKpPlanetsTable extends LitElement {
|
|
|
75
75
|
`,
|
|
76
76
|
];
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
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);
|
|
78
|
+
protected renderEmpty() {
|
|
79
|
+
return html`<div class="roxy-empty" role="status">No KP data</div>`;
|
|
84
80
|
}
|
|
85
81
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
render() {
|
|
90
|
-
if (!this.data)
|
|
91
|
-
return html`<div class="roxy-empty" role="status">No KP data</div>`;
|
|
92
|
-
const planets = this.data.planets ?? [];
|
|
82
|
+
protected renderData(d: KpPlanetsResponse) {
|
|
83
|
+
const planets = d.planets ?? [];
|
|
93
84
|
|
|
94
85
|
return html`<div
|
|
95
86
|
class="wrap"
|
|
@@ -99,8 +90,8 @@ export class RoxyKpPlanetsTable extends LitElement {
|
|
|
99
90
|
<header class="head">
|
|
100
91
|
<h2 class="title">KP planets</h2>
|
|
101
92
|
${
|
|
102
|
-
typeof
|
|
103
|
-
? html`<span class="ayanamsa">Ayanamsa: ${formatNumber(
|
|
93
|
+
typeof d.ayanamsa === 'number'
|
|
94
|
+
? html`<span class="ayanamsa">Ayanamsa: ${formatNumber(d.ayanamsa, 2)}°</span>`
|
|
104
95
|
: nothing
|
|
105
96
|
}
|
|
106
97
|
</header>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { css, html,
|
|
2
|
-
import { customElement
|
|
1
|
+
import { css, html, nothing } from 'lit';
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import type { KpRulingPlanetsResponse } from '../types/index.js';
|
|
4
|
+
import { RoxyDataElement } from '../utils/base-element.js';
|
|
4
5
|
import { baseStyles } from '../utils/base-styles.js';
|
|
5
|
-
import { MarkupDataController } from '../utils/markup-data.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* KP ruling planets card. Renders /vedic-astrology/kp/ruling-planets: the day
|
|
@@ -12,14 +12,14 @@ import { MarkupDataController } from '../utils/markup-data.js';
|
|
|
12
12
|
* planet. The primary horary timing tool in KP astrology.
|
|
13
13
|
*/
|
|
14
14
|
@customElement('roxy-kp-ruling-planets')
|
|
15
|
-
export class RoxyKpRulingPlanets extends
|
|
15
|
+
export class RoxyKpRulingPlanets extends RoxyDataElement<KpRulingPlanetsResponse> {
|
|
16
16
|
static styles = [
|
|
17
17
|
baseStyles,
|
|
18
18
|
css`
|
|
19
19
|
.wrap {
|
|
20
20
|
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
21
21
|
border-radius: var(--roxy-radius-md, 8px);
|
|
22
|
-
background: var(--roxy-
|
|
22
|
+
background: var(--roxy-surface, #fff);
|
|
23
23
|
padding: var(--roxy-space-md, 1rem);
|
|
24
24
|
display: grid;
|
|
25
25
|
gap: var(--roxy-space-md, 1rem);
|
|
@@ -114,21 +114,11 @@ export class RoxyKpRulingPlanets extends LitElement {
|
|
|
114
114
|
`,
|
|
115
115
|
];
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
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);
|
|
117
|
+
protected renderEmpty() {
|
|
118
|
+
return html`<div class="roxy-empty" role="status">No ruling planets data</div>`;
|
|
123
119
|
}
|
|
124
120
|
|
|
125
|
-
|
|
126
|
-
data: KpRulingPlanetsResponse | null = null;
|
|
127
|
-
|
|
128
|
-
render() {
|
|
129
|
-
if (!this.data)
|
|
130
|
-
return html`<div class="roxy-empty" role="status">No ruling planets data</div>`;
|
|
131
|
-
const d = this.data;
|
|
121
|
+
protected renderData(d: KpRulingPlanetsResponse) {
|
|
132
122
|
const significators = d.significators ?? [];
|
|
133
123
|
|
|
134
124
|
return html`<div class="wrap" aria-label="KP ruling planets">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css, html,
|
|
1
|
+
import { css, html, nothing } from 'lit';
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import { MOON_PHASE_EMOJI } from '../tokens/index.js';
|
|
4
4
|
import type {
|
|
@@ -6,9 +6,9 @@ import type {
|
|
|
6
6
|
GetMoonCalendarResponse,
|
|
7
7
|
GetUpcomingMoonPhasesResponse,
|
|
8
8
|
} from '../types/index.js';
|
|
9
|
+
import { RoxyDataElement } from '../utils/base-element.js';
|
|
9
10
|
import { baseStyles } from '../utils/base-styles.js';
|
|
10
11
|
import { formatNumber } from '../utils/format.js';
|
|
11
|
-
import { MarkupDataController } from '../utils/markup-data.js';
|
|
12
12
|
|
|
13
13
|
type MoonPhaseData =
|
|
14
14
|
| GetCurrentMoonPhaseResponse
|
|
@@ -22,12 +22,13 @@ type MoonListEntry =
|
|
|
22
22
|
* Moon phase card. Renders /astrology/moon-phase/{current,upcoming,calendar/...}.
|
|
23
23
|
*/
|
|
24
24
|
@customElement('roxy-moon-phase')
|
|
25
|
-
export class RoxyMoonPhase extends
|
|
25
|
+
export class RoxyMoonPhase extends RoxyDataElement<MoonPhaseData> {
|
|
26
26
|
static styles = [
|
|
27
27
|
baseStyles,
|
|
28
28
|
css`
|
|
29
29
|
.card {
|
|
30
|
-
background: var(--roxy-
|
|
30
|
+
background: var(--roxy-surface, #fff);
|
|
31
|
+
color: var(--roxy-fg, #0a0a0a);
|
|
31
32
|
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
32
33
|
border-radius: var(--roxy-radius-md, 8px);
|
|
33
34
|
padding: var(--roxy-space-lg, 1.5rem);
|
|
@@ -110,24 +111,14 @@ export class RoxyMoonPhase extends LitElement {
|
|
|
110
111
|
`,
|
|
111
112
|
];
|
|
112
113
|
|
|
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
|
-
|
|
121
|
-
@property({ attribute: false })
|
|
122
|
-
data: MoonPhaseData | null = null;
|
|
123
|
-
|
|
124
114
|
@property({ type: String, reflect: true })
|
|
125
115
|
mode: 'current' | 'upcoming' | 'calendar' = 'current';
|
|
126
116
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
117
|
+
protected renderEmpty() {
|
|
118
|
+
return html`<div class="roxy-empty" role="status">No moon phase data</div>`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
protected renderData(d: MoonPhaseData) {
|
|
131
122
|
const list: MoonListEntry[] =
|
|
132
123
|
'phases' in d ? d.phases : 'calendar' in d ? d.calendar : [];
|
|
133
124
|
if (this.mode !== 'current' && list.length > 0) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { css, html,
|
|
2
|
-
import { customElement
|
|
1
|
+
import { css, html, nothing } from 'lit';
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import type { NakshatraResponse } from '../types/index.js';
|
|
4
|
+
import { RoxyDataElement } from '../utils/base-element.js';
|
|
4
5
|
import { baseStyles } from '../utils/base-styles.js';
|
|
5
|
-
import { MarkupDataController } from '../utils/markup-data.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Nakshatra reference card. Renders /vedic-astrology/nakshatras/{id}: the
|
|
@@ -10,14 +10,15 @@ import { MarkupDataController } from '../utils/markup-data.js';
|
|
|
10
10
|
* symbol, native characteristics, and traditional remedies.
|
|
11
11
|
*/
|
|
12
12
|
@customElement('roxy-nakshatra-card')
|
|
13
|
-
export class RoxyNakshatraCard extends
|
|
13
|
+
export class RoxyNakshatraCard extends RoxyDataElement<NakshatraResponse> {
|
|
14
14
|
static styles = [
|
|
15
15
|
baseStyles,
|
|
16
16
|
css`
|
|
17
17
|
.wrap {
|
|
18
18
|
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
19
19
|
border-radius: var(--roxy-radius-md, 8px);
|
|
20
|
-
background: var(--roxy-
|
|
20
|
+
background: var(--roxy-surface, #fff);
|
|
21
|
+
color: var(--roxy-fg, #0a0a0a);
|
|
21
22
|
padding: var(--roxy-space-md, 1rem);
|
|
22
23
|
display: grid;
|
|
23
24
|
gap: var(--roxy-space-md, 1rem);
|
|
@@ -92,21 +93,7 @@ export class RoxyNakshatraCard extends LitElement {
|
|
|
92
93
|
`,
|
|
93
94
|
];
|
|
94
95
|
|
|
95
|
-
|
|
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
|
-
|
|
103
|
-
@property({ attribute: false })
|
|
104
|
-
data: NakshatraResponse | null = null;
|
|
105
|
-
|
|
106
|
-
render() {
|
|
107
|
-
if (!this.data)
|
|
108
|
-
return html`<div class="roxy-empty" role="status">No nakshatra data</div>`;
|
|
109
|
-
const n = this.data;
|
|
96
|
+
protected renderData(n: NakshatraResponse) {
|
|
110
97
|
const remedies = n.remedies;
|
|
111
98
|
|
|
112
99
|
return html`<article class="wrap" aria-label=${`Nakshatra ${n.name}`}>
|
|
@@ -149,6 +136,10 @@ export class RoxyNakshatraCard extends LitElement {
|
|
|
149
136
|
}
|
|
150
137
|
</article>`;
|
|
151
138
|
}
|
|
139
|
+
|
|
140
|
+
protected renderEmpty() {
|
|
141
|
+
return html`<div class="roxy-empty" role="status">No nakshatra data</div>`;
|
|
142
|
+
}
|
|
152
143
|
}
|
|
153
144
|
|
|
154
145
|
declare global {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css, html,
|
|
1
|
+
import { css, html, nothing, svg } from 'lit';
|
|
2
2
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
3
3
|
import {
|
|
4
4
|
ASPECT_SYMBOL,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
SIGNS_ORDER,
|
|
8
8
|
} from '../tokens/index.js';
|
|
9
9
|
import type { NatalChartResponse } from '../types/index.js';
|
|
10
|
+
import { RoxyDataElement } from '../utils/base-element.js';
|
|
10
11
|
import { baseStyles } from '../utils/base-styles.js';
|
|
11
12
|
import {
|
|
12
13
|
arcMidpoint,
|
|
@@ -21,7 +22,6 @@ import {
|
|
|
21
22
|
formatNumber,
|
|
22
23
|
normalizeAspect,
|
|
23
24
|
} from '../utils/format.js';
|
|
24
|
-
import { MarkupDataController } from '../utils/markup-data.js';
|
|
25
25
|
import { capitalize } from '../utils/string.js';
|
|
26
26
|
import { renderTablist, tablistStyles } from '../utils/tablist.js';
|
|
27
27
|
|
|
@@ -42,7 +42,7 @@ const ANGLE_LABEL_R = 196;
|
|
|
42
42
|
* markers, and aspect lines from a /astrology/natal-chart response.
|
|
43
43
|
*/
|
|
44
44
|
@customElement('roxy-natal-chart')
|
|
45
|
-
export class RoxyNatalChart extends
|
|
45
|
+
export class RoxyNatalChart extends RoxyDataElement<NatalChartResponse> {
|
|
46
46
|
static styles = [
|
|
47
47
|
baseStyles,
|
|
48
48
|
tablistStyles,
|
|
@@ -50,6 +50,12 @@ export class RoxyNatalChart extends LitElement {
|
|
|
50
50
|
css`
|
|
51
51
|
.wrap {
|
|
52
52
|
width: 100%;
|
|
53
|
+
background: var(--roxy-surface, #fff);
|
|
54
|
+
color: var(--roxy-fg, #0a0a0a);
|
|
55
|
+
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
56
|
+
border-radius: var(--roxy-radius-md, 8px);
|
|
57
|
+
padding: var(--roxy-space-lg, 1.5rem);
|
|
58
|
+
box-shadow: var(--roxy-shadow-sm);
|
|
53
59
|
display: grid;
|
|
54
60
|
gap: var(--roxy-space-md, 1rem);
|
|
55
61
|
}
|
|
@@ -69,7 +75,7 @@ export class RoxyNatalChart extends LitElement {
|
|
|
69
75
|
svg {
|
|
70
76
|
display: block;
|
|
71
77
|
width: 100%;
|
|
72
|
-
max-width: 560px;
|
|
78
|
+
max-width: var(--roxy-chart-max-width, 560px);
|
|
73
79
|
aspect-ratio: 1 / 1;
|
|
74
80
|
height: auto;
|
|
75
81
|
margin: 0 auto;
|
|
@@ -369,17 +375,6 @@ export class RoxyNatalChart extends LitElement {
|
|
|
369
375
|
`,
|
|
370
376
|
];
|
|
371
377
|
|
|
372
|
-
constructor() {
|
|
373
|
-
super();
|
|
374
|
-
// Enables hydrating `data` from a direct-child
|
|
375
|
-
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
376
|
-
// and cached consumers. The JavaScript `data` property still wins.
|
|
377
|
-
new MarkupDataController(this);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
@property({ attribute: false })
|
|
381
|
-
data: NatalChartResponse | null = null;
|
|
382
|
-
|
|
383
378
|
@property({ type: String, attribute: 'house-system', reflect: true })
|
|
384
379
|
houseSystem: 'placidus' | 'whole-sign' | 'equal' | 'koch' = 'placidus';
|
|
385
380
|
|
|
@@ -404,20 +399,22 @@ export class RoxyNatalChart extends LitElement {
|
|
|
404
399
|
return 180 + this.getAscendant() - lon;
|
|
405
400
|
}
|
|
406
401
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
402
|
+
protected renderEmpty() {
|
|
403
|
+
return html`<div class="roxy-empty" role="status">No chart data</div>`;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
protected renderData(data: NatalChartResponse) {
|
|
410
407
|
const planets = this.getPlanets();
|
|
411
|
-
const aspects =
|
|
408
|
+
const aspects = data.aspects ?? [];
|
|
412
409
|
const view = this.view;
|
|
413
410
|
|
|
414
411
|
return html`<div class="wrap">
|
|
415
412
|
<header>
|
|
416
413
|
<h2 class="title">Natal chart</h2>
|
|
417
414
|
${
|
|
418
|
-
|
|
415
|
+
data.birthDetails
|
|
419
416
|
? html`<div class="meta">
|
|
420
|
-
${[
|
|
417
|
+
${[data.birthDetails.date, data.birthDetails.time]
|
|
421
418
|
.filter(Boolean)
|
|
422
419
|
.join(' · ')}
|
|
423
420
|
</div>`
|
|
@@ -448,8 +445,8 @@ export class RoxyNatalChart extends LitElement {
|
|
|
448
445
|
<span>${planets.length} planets</span>
|
|
449
446
|
<span>${aspects.length} aspects</span>
|
|
450
447
|
${
|
|
451
|
-
|
|
452
|
-
? html`<span>${
|
|
448
|
+
data.houseSystem
|
|
449
|
+
? html`<span>${data.houseSystem} houses</span>`
|
|
453
450
|
: nothing
|
|
454
451
|
}
|
|
455
452
|
<span><span class="legend-swatch" style="background: var(--roxy-success)"></span>harmonious</span>
|
|
@@ -1,32 +1,53 @@
|
|
|
1
|
-
import { css, html,
|
|
1
|
+
import { css, html, nothing } from 'lit';
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import type {
|
|
4
|
+
CalculateBirthDayResponse,
|
|
4
5
|
CalculateExpressionResponse,
|
|
5
6
|
CalculateLifePathResponse,
|
|
7
|
+
CalculateMaturityResponse,
|
|
8
|
+
CalculatePersonalDayResponse,
|
|
9
|
+
CalculatePersonalityResponse,
|
|
10
|
+
CalculatePersonalMonthResponse,
|
|
6
11
|
CalculatePersonalYearResponse,
|
|
12
|
+
CalculateSoulUrgeResponse,
|
|
7
13
|
GenerateNumerologyChartResponse,
|
|
14
|
+
GetDailyNumberResponse,
|
|
8
15
|
} from '../types/index.js';
|
|
16
|
+
import { RoxyDataElement } from '../utils/base-element.js';
|
|
9
17
|
import { baseStyles } from '../utils/base-styles.js';
|
|
10
|
-
import { MarkupDataController } from '../utils/markup-data.js';
|
|
11
18
|
import { humanize } from '../utils/string.js';
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Single-number numerology responses that share the number + meaning + calculation + karmic-debt shape. {@link RoxyNumerologyCard.renderNumberCard} renders any of them; the `type` attribute selects only the heading label.
|
|
22
|
+
*/
|
|
23
|
+
type NumberCardData =
|
|
14
24
|
| CalculateLifePathResponse
|
|
15
25
|
| CalculateExpressionResponse
|
|
26
|
+
| CalculateSoulUrgeResponse
|
|
27
|
+
| CalculatePersonalityResponse
|
|
28
|
+
| CalculateBirthDayResponse
|
|
29
|
+
| CalculateMaturityResponse;
|
|
30
|
+
|
|
31
|
+
type NumerologyData =
|
|
32
|
+
| NumberCardData
|
|
16
33
|
| CalculatePersonalYearResponse
|
|
34
|
+
| CalculatePersonalDayResponse
|
|
35
|
+
| CalculatePersonalMonthResponse
|
|
36
|
+
| GetDailyNumberResponse
|
|
17
37
|
| GenerateNumerologyChartResponse;
|
|
18
38
|
|
|
19
39
|
/**
|
|
20
|
-
* Numerology card. Renders /numerology/{life-path,expression,personal-year,chart}.
|
|
21
|
-
* Use the `type` attribute to switch the layout.
|
|
40
|
+
* Numerology card. Renders /numerology/{life-path,expression,soul-urge,personality,birth-day,maturity,personal-year,chart}.
|
|
41
|
+
* Use the `type` attribute to switch the heading; the single-number types all share one layout.
|
|
22
42
|
*/
|
|
23
43
|
@customElement('roxy-numerology-card')
|
|
24
|
-
export class RoxyNumerologyCard extends
|
|
44
|
+
export class RoxyNumerologyCard extends RoxyDataElement<NumerologyData> {
|
|
25
45
|
static styles = [
|
|
26
46
|
baseStyles,
|
|
27
47
|
css`
|
|
28
48
|
.card {
|
|
29
|
-
background: var(--roxy-
|
|
49
|
+
background: var(--roxy-surface, #fff);
|
|
50
|
+
color: var(--roxy-fg, #0a0a0a);
|
|
30
51
|
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
31
52
|
border-radius: var(--roxy-radius-md, 8px);
|
|
32
53
|
padding: var(--roxy-space-lg, 1.5rem);
|
|
@@ -123,39 +144,70 @@ export class RoxyNumerologyCard extends LitElement {
|
|
|
123
144
|
`,
|
|
124
145
|
];
|
|
125
146
|
|
|
126
|
-
constructor() {
|
|
127
|
-
super();
|
|
128
|
-
// Enables hydrating `data` from a direct-child
|
|
129
|
-
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
130
|
-
// and cached consumers. The JavaScript `data` property still wins.
|
|
131
|
-
new MarkupDataController(this);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@property({ attribute: false })
|
|
135
|
-
data: NumerologyData | null = null;
|
|
136
|
-
|
|
137
147
|
@property({ type: String, reflect: true })
|
|
138
|
-
type:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
type:
|
|
149
|
+
| 'life-path'
|
|
150
|
+
| 'expression'
|
|
151
|
+
| 'soul-urge'
|
|
152
|
+
| 'personality'
|
|
153
|
+
| 'birth-day'
|
|
154
|
+
| 'maturity'
|
|
155
|
+
| 'daily'
|
|
156
|
+
| 'personal-day'
|
|
157
|
+
| 'personal-month'
|
|
158
|
+
| 'personal-year'
|
|
159
|
+
| 'chart' = 'life-path';
|
|
144
160
|
|
|
161
|
+
protected renderData(d: NumerologyData) {
|
|
145
162
|
const headerLabel = LABELS[this.type] ?? this.type;
|
|
146
|
-
|
|
147
163
|
if ('coreNumbers' in d) return this.renderChart(d, headerLabel);
|
|
164
|
+
// Period reads share a number+theme+body shape but differ in field names;
|
|
165
|
+
// check the most specific key first (a personal-day response also carries
|
|
166
|
+
// personalMonth/personalYear), so the order is day -> month -> year.
|
|
167
|
+
if ('personalDay' in d) {
|
|
168
|
+
return this.renderPeriod(headerLabel, d.personalDay, d.theme, d.guidance);
|
|
169
|
+
}
|
|
170
|
+
if ('personalMonth' in d) {
|
|
171
|
+
return this.renderPeriod(headerLabel, d.personalMonth, d.theme, d.focus);
|
|
172
|
+
}
|
|
148
173
|
if ('personalYear' in d) return this.renderPersonalYear(d, headerLabel);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
174
|
+
// Daily number: number + meaning, no calculation/karmic-debt; show the
|
|
175
|
+
// meaning title as the heading and the daily message as the body.
|
|
176
|
+
if ('dailyMessage' in d) {
|
|
177
|
+
return this.renderPeriod(
|
|
178
|
+
headerLabel,
|
|
179
|
+
d.number,
|
|
180
|
+
d.meaning?.title,
|
|
181
|
+
d.dailyMessage,
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
return this.renderNumberCard(d as NumberCardData, headerLabel);
|
|
153
185
|
}
|
|
154
186
|
|
|
155
|
-
|
|
156
|
-
|
|
187
|
+
/** Shared layout for a single period number (day/month): a hero numeral, theme heading, and guidance/focus body. */
|
|
188
|
+
private renderPeriod(
|
|
157
189
|
headerLabel: string,
|
|
190
|
+
num: number | undefined,
|
|
191
|
+
theme: string | undefined,
|
|
192
|
+
body: string | undefined,
|
|
158
193
|
) {
|
|
194
|
+
return html`<article class="card" aria-label=${headerLabel}>
|
|
195
|
+
<div class="hero">
|
|
196
|
+
${typeof num === 'number' ? html`<div class="numeral">${num}</div>` : nothing}
|
|
197
|
+
<div>
|
|
198
|
+
<p class="label">${headerLabel}</p>
|
|
199
|
+
${theme ? html`<h2 class="title">${theme}</h2>` : nothing}
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
${body ? html`<p class="meaning">${body}</p>` : nothing}
|
|
203
|
+
</article>`;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
protected renderEmpty() {
|
|
207
|
+
return html`<div class="roxy-empty" role="status">No numerology data</div>`;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
private renderNumberCard(d: NumberCardData, headerLabel: string) {
|
|
159
211
|
const keywords = d.meaning?.keywords ?? [];
|
|
160
212
|
return html`<article class="card" aria-label=${headerLabel}>
|
|
161
213
|
<div class="hero">
|
|
@@ -230,6 +282,13 @@ export class RoxyNumerologyCard extends LitElement {
|
|
|
230
282
|
const LABELS: Record<string, string> = {
|
|
231
283
|
'life-path': 'Life Path',
|
|
232
284
|
expression: 'Expression',
|
|
285
|
+
'soul-urge': 'Soul Urge',
|
|
286
|
+
personality: 'Personality',
|
|
287
|
+
'birth-day': 'Birth Day',
|
|
288
|
+
maturity: 'Maturity',
|
|
289
|
+
daily: 'Daily Number',
|
|
290
|
+
'personal-day': 'Personal Day',
|
|
291
|
+
'personal-month': 'Personal Month',
|
|
233
292
|
'personal-year': 'Personal Year',
|
|
234
293
|
chart: 'Numerology chart',
|
|
235
294
|
};
|