@roxyapi/ui 0.5.0 → 0.6.1
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/README.md +1 -1
- package/dist/cdn/components/ashtakavarga-grid.js +3 -362
- package/dist/cdn/components/ashtakavarga-grid.js.map +2 -2
- package/dist/cdn/components/biorhythm-chart.js +2 -225
- package/dist/cdn/components/biorhythm-chart.js.map +2 -2
- package/dist/cdn/components/choghadiya-grid.js +2 -231
- package/dist/cdn/components/choghadiya-grid.js.map +2 -2
- package/dist/cdn/components/compatibility-card.js +2 -230
- package/dist/cdn/components/compatibility-card.js.map +2 -2
- package/dist/cdn/components/dasha-timeline.js +2 -282
- package/dist/cdn/components/dasha-timeline.js.map +2 -2
- package/dist/cdn/components/data.js +3 -230
- package/dist/cdn/components/data.js.map +2 -2
- package/dist/cdn/components/divisional-chart.js +34 -321
- package/dist/cdn/components/divisional-chart.js.map +4 -4
- package/dist/cdn/components/dosha-card.js +2 -225
- package/dist/cdn/components/dosha-card.js.map +2 -2
- package/dist/cdn/components/endpoint-form.js +2 -243
- package/dist/cdn/components/endpoint-form.js.map +2 -2
- package/dist/cdn/components/guna-milan.js +2 -269
- package/dist/cdn/components/guna-milan.js.map +2 -2
- package/dist/cdn/components/hexagram.js +3 -247
- package/dist/cdn/components/hexagram.js.map +2 -2
- package/dist/cdn/components/horoscope-card.js +3 -281
- package/dist/cdn/components/horoscope-card.js.map +2 -2
- package/dist/cdn/components/kp-chart.js +2 -277
- package/dist/cdn/components/kp-chart.js.map +2 -2
- package/dist/cdn/components/kp-planets-table.js +2 -195
- package/dist/cdn/components/kp-planets-table.js.map +2 -2
- package/dist/cdn/components/kp-ruling-planets.js +2 -240
- package/dist/cdn/components/kp-ruling-planets.js.map +2 -2
- package/dist/cdn/components/location-search.js +2 -240
- package/dist/cdn/components/location-search.js.map +2 -2
- package/dist/cdn/components/moon-phase.js +3 -223
- package/dist/cdn/components/moon-phase.js.map +2 -2
- package/dist/cdn/components/nakshatra-card.js +2 -200
- package/dist/cdn/components/nakshatra-card.js.map +2 -2
- package/dist/cdn/components/natal-chart.js +9 -560
- package/dist/cdn/components/natal-chart.js.map +4 -4
- package/dist/cdn/components/numerology-card.js +2 -232
- package/dist/cdn/components/numerology-card.js.map +2 -2
- package/dist/cdn/components/panchang-table.js +3 -220
- package/dist/cdn/components/panchang-table.js.map +2 -2
- package/dist/cdn/components/shadbala-table.js +3 -284
- package/dist/cdn/components/shadbala-table.js.map +2 -2
- package/dist/cdn/components/synastry-chart.js +5 -395
- package/dist/cdn/components/synastry-chart.js.map +2 -2
- package/dist/cdn/components/tarot-card.js +3 -261
- package/dist/cdn/components/tarot-card.js.map +2 -2
- package/dist/cdn/components/tarot-spread.js +2 -248
- package/dist/cdn/components/tarot-spread.js.map +2 -2
- package/dist/cdn/components/transits-table.js +3 -382
- package/dist/cdn/components/transits-table.js.map +4 -4
- package/dist/cdn/components/vedic-kundli.js +35 -271
- package/dist/cdn/components/vedic-kundli.js.map +4 -4
- package/dist/cdn/components/vedic-planets-table.js +2 -202
- package/dist/cdn/components/vedic-planets-table.js.map +2 -2
- package/dist/cdn/components/western-planets-table.js +3 -192
- package/dist/cdn/components/western-planets-table.js.map +2 -2
- package/dist/cdn/components/yoga-list.js +2 -305
- package/dist/cdn/components/yoga-list.js.map +2 -2
- package/dist/cdn/roxy-ui.js +41 -5059
- package/dist/cdn/roxy-ui.js.map +4 -4
- package/dist/cdn/widgets.js +1 -114
- package/dist/components/ashtakavarga-grid.js +1 -577
- package/dist/components/ashtakavarga-grid.js.map +3 -3
- package/dist/components/biorhythm-chart.js +1 -378
- package/dist/components/biorhythm-chart.js.map +3 -3
- package/dist/components/choghadiya-grid.js +1 -397
- package/dist/components/choghadiya-grid.js.map +3 -3
- package/dist/components/compatibility-card.js +1 -359
- package/dist/components/compatibility-card.js.map +3 -3
- package/dist/components/dasha-timeline.js +1 -447
- package/dist/components/dasha-timeline.js.map +3 -3
- package/dist/components/data.js +1 -408
- package/dist/components/data.js.map +3 -3
- package/dist/components/divisional-chart.d.ts.map +1 -1
- package/dist/components/divisional-chart.js +64 -929
- package/dist/components/divisional-chart.js.map +4 -4
- package/dist/components/dosha-card.js +1 -339
- package/dist/components/dosha-card.js.map +3 -3
- package/dist/components/endpoint-form.js +1 -505
- package/dist/components/endpoint-form.js.map +3 -3
- package/dist/components/guna-milan.js +1 -420
- package/dist/components/guna-milan.js.map +3 -3
- package/dist/components/hexagram.js +1 -426
- package/dist/components/hexagram.js.map +3 -3
- package/dist/components/horoscope-card.js +1 -427
- package/dist/components/horoscope-card.js.map +3 -3
- package/dist/components/kp-chart.js +1 -441
- package/dist/components/kp-chart.js.map +3 -3
- package/dist/components/kp-planets-table.js +1 -292
- package/dist/components/kp-planets-table.js.map +3 -3
- package/dist/components/kp-ruling-planets.js +1 -334
- package/dist/components/kp-ruling-planets.js.map +3 -3
- package/dist/components/location-search.js +1 -461
- package/dist/components/location-search.js.map +3 -3
- package/dist/components/moon-phase.js +1 -373
- package/dist/components/moon-phase.js.map +3 -3
- package/dist/components/nakshatra-card.js +1 -290
- package/dist/components/nakshatra-card.js.map +3 -3
- package/dist/components/natal-chart.d.ts +0 -1
- package/dist/components/natal-chart.d.ts.map +1 -1
- package/dist/components/natal-chart.js +8 -1084
- package/dist/components/natal-chart.js.map +4 -4
- package/dist/components/numerology-card.js +1 -361
- package/dist/components/numerology-card.js.map +3 -3
- package/dist/components/panchang-table.js +1 -396
- package/dist/components/panchang-table.js.map +3 -3
- package/dist/components/shadbala-table.js +1 -459
- package/dist/components/shadbala-table.js.map +3 -3
- package/dist/components/synastry-chart.js +7 -704
- package/dist/components/synastry-chart.js.map +3 -3
- package/dist/components/tarot-card.js +1 -379
- package/dist/components/tarot-card.js.map +3 -3
- package/dist/components/tarot-spread.js +1 -356
- package/dist/components/tarot-spread.js.map +3 -3
- package/dist/components/transits-table.d.ts +2 -0
- package/dist/components/transits-table.d.ts.map +1 -1
- package/dist/components/transits-table.js +1 -594
- package/dist/components/transits-table.js.map +4 -4
- package/dist/components/vedic-kundli.d.ts.map +1 -1
- package/dist/components/vedic-kundli.js +64 -845
- package/dist/components/vedic-kundli.js.map +4 -4
- package/dist/components/vedic-planets-table.js +1 -414
- package/dist/components/vedic-planets-table.js.map +3 -3
- package/dist/components/western-planets-table.js +1 -409
- package/dist/components/western-planets-table.js.map +3 -3
- package/dist/components/yoga-list.js +1 -429
- package/dist/components/yoga-list.js.map +3 -3
- package/dist/index.cjs +77 -8721
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +77 -8701
- package/dist/index.js.map +4 -4
- package/dist/utils/disclosure.d.ts +16 -0
- package/dist/utils/disclosure.d.ts.map +1 -0
- package/dist/utils/kundli-render.d.ts.map +1 -1
- package/dist/utils/kundli-styles.d.ts.map +1 -1
- package/dist/utils/tablist.d.ts +44 -0
- package/dist/utils/tablist.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -1
- package/src/components/dasha-timeline.ts +7 -7
- package/src/components/divisional-chart.ts +2 -0
- package/src/components/natal-chart.ts +37 -62
- package/src/components/transits-table.ts +45 -18
- package/src/components/vedic-kundli.ts +2 -1
- package/src/utils/disclosure.ts +62 -0
- package/src/utils/kundli-render.ts +21 -35
- package/src/utils/kundli-styles.ts +0 -31
- package/src/utils/tablist.ts +124 -0
- package/src/version.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/biorhythm-chart.ts", "../../src/utils/base-styles.ts", "../../src/utils/markup-data.ts"],
|
|
4
|
-
"sourcesContent": ["import { css, html, LitElement, nothing, svg } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tGetCriticalDaysResponse,\n\tGetDailyBiorhythmResponse,\n\tGetForecastResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype BiorhythmData =\n\t| GetDailyBiorhythmResponse\n\t| GetForecastResponse\n\t| GetCriticalDaysResponse;\n\nconst CYCLE_COLOR: Record<string, string> = {\n\tphysical: '#dc2626',\n\temotional: '#0284c7',\n\tintellectual: '#16a34a',\n\tintuitive: '#a855f7',\n\taesthetic: '#f59e0b',\n\tawareness: '#ec4899',\n\tspiritual: '#14b8a6',\n\tpassion: '#ef4444',\n\tmastery: '#6366f1',\n\twisdom: '#475569',\n};\n\n/**\n * Biorhythm chart. Renders /biorhythm/{daily,forecast,critical-days}.\n */\n@customElement('roxy-biorhythm-chart')\nexport class RoxyBiorhythmChart extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.wrap {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.head {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\talign-items: center;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tgap: var(--roxy-space-sm, 0.5rem);\n\t\t\t}\n\t\t\t.title {\n\t\t\t\tmargin: 0;\n\t\t\t\tfont-size: var(--roxy-text-lg, 1.125rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t}\n\t\t\t.energy {\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\tcolor: var(--roxy-accent-fg, #b45309);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t}\n\t\t\t.bars {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgap: var(--roxy-space-xs, 0.25rem);\n\t\t\t}\n\t\t\t.bar {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: 8rem 1fr 3.5rem;\n\t\t\t\tgap: var(--roxy-space-sm, 0.5rem);\n\t\t\t\talign-items: center;\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t}\n\t\t\t.track {\n\t\t\t\theight: 14px;\n\t\t\t\tbackground: var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-full, 9999px);\n\t\t\t\toverflow: hidden;\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t\t.fill {\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 100%;\n\t\t\t\ttransition:\n\t\t\t\t\twidth var(--roxy-motion-duration, 200ms)\n\t\t\t\t\tvar(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1));\n\t\t\t}\n\t\t\t.value {\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\ttext-align: right;\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t}\n\t\t\t.advice {\n\t\t\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\t\t}\n\t\t\t.alert {\n\t\t\t\tbackground: color-mix(in srgb, var(--roxy-warning, #ea580c) 12%, transparent);\n\t\t\t\tborder: 1px solid color-mix(in srgb, var(--roxy-warning, #ea580c) 32%, transparent);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-sm, 0.5rem);\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\tsvg {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: auto;\n\t\t\t}\n\t\t\t.crit {\n\t\t\t\tbackground: color-mix(in srgb, var(--roxy-danger, #dc2626) 12%, transparent);\n\t\t\t\tborder-radius: var(--roxy-radius-sm, 4px);\n\t\t\t\tpadding: 4px 8px;\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmargin: 2px;\n\t\t\t}\n\t\t`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: BiorhythmData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tmode: 'daily' | 'forecast' | 'critical-days' = 'daily';\n\n\trender() {\n\t\tconst d = this.data;\n\t\tif (!d)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No biorhythm data</div>`;\n\n\t\tif (this.mode === 'critical-days' && 'criticalDays' in d) {\n\t\t\treturn this.renderCritical(d as GetCriticalDaysResponse);\n\t\t}\n\t\tif (this.mode === 'forecast' && 'days' in d) {\n\t\t\treturn this.renderForecast(d as GetForecastResponse);\n\t\t}\n\t\treturn this.renderDaily(d as GetDailyBiorhythmResponse);\n\t}\n\n\tprivate renderDaily(d: GetDailyBiorhythmResponse) {\n\t\tconst raw = d.quickRead ?? {};\n\t\tconst entries = Object.entries(raw).map(([cycle, value]) => {\n\t\t\tconst v = typeof value === 'number' ? value : 0;\n\t\t\tconst normalized = Math.abs(v) > 1 ? v / 100 : v;\n\t\t\treturn [cycle, normalized] as const;\n\t\t});\n\t\treturn html`<section class=\"wrap\" aria-label=\"Daily biorhythm\">\n\t\t\t<header class=\"head\">\n\t\t\t\t<h2 class=\"title\">Biorhythm</h2>\n\t\t\t\t${\n\t\t\t\t\ttypeof d.energyRating === 'number'\n\t\t\t\t\t\t? html`<span class=\"energy\">Energy ${d.energyRating}/10</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t</header>\n\t\t\t<div class=\"bars\" role=\"list\">\n\t\t\t\t${entries.map(([cycle, v]) => {\n\t\t\t\t\tconst pct = ((v + 1) / 2) * 100; // -1..1 -> 0..100\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? 'var(--roxy-accent, #f59e0b)';\n\t\t\t\t\treturn html`<div class=\"bar\" role=\"listitem\">\n\t\t\t\t\t\t<span style=\"text-transform: capitalize\">${cycle}</span>\n\t\t\t\t\t\t<span class=\"track\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"fill\"\n\t\t\t\t\t\t\t\tstyle=\"width: ${pct}%; background: ${color}\"\n\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"value\">${Math.round(v * 100)}%</span>\n\t\t\t\t\t</div>`;\n\t\t\t\t})}\n\t\t\t</div>\n\t\t\t${d.dailyMessage ? html`<p class=\"advice\">${d.dailyMessage}</p>` : nothing}\n\t\t\t${d.advice ? html`<p class=\"advice\">${d.advice}</p>` : nothing}\n\t\t</section>`;\n\t}\n\n\tprivate renderForecast(d: GetForecastResponse) {\n\t\tconst days = d.days ?? [];\n\t\tif (days.length === 0)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No forecast</div>`;\n\t\tconst w = 600;\n\t\tconst h = 160;\n\t\tconst xStep = w / Math.max(days.length - 1, 1);\n\t\tconst cycleKeys = [\n\t\t\t'physical',\n\t\t\t'emotional',\n\t\t\t'intellectual',\n\t\t\t'intuitive',\n\t\t] as const;\n\t\treturn html`<section class=\"wrap\" aria-label=\"Biorhythm forecast\">\n\t\t\t<header class=\"head\">\n\t\t\t\t<h2 class=\"title\">Forecast</h2>\n\t\t\t\t<span class=\"energy\">${d.startDate} - ${d.endDate}</span>\n\t\t\t</header>\n\t\t\t<svg\n\t\t\t\tviewBox=\"0 0 ${w} ${h}\"\n\t\t\t\trole=\"img\"\n\t\t\t\taria-label=\"Biorhythm cycle lines across the forecast window\"\n\t\t\t>\n\t\t\t\t<title>Biorhythm forecast</title>\n\t\t\t\t<line\n\t\t\t\t\tx1=\"0\"\n\t\t\t\t\ty1=${h / 2}\n\t\t\t\t\tx2=${w}\n\t\t\t\t\ty2=${h / 2}\n\t\t\t\t\tstroke=\"var(--roxy-border, #e4e4e7)\"\n\t\t\t\t\tstroke-width=\"1\"\n\t\t\t\t/>\n\t\t\t\t${cycleKeys.map((cycle) => {\n\t\t\t\t\tconst points = days\n\t\t\t\t\t\t.map((day, i) => {\n\t\t\t\t\t\t\tconst v = day[cycle] ?? 0;\n\t\t\t\t\t\t\tconst x = i * xStep;\n\t\t\t\t\t\t\tconst y = h / 2 - (v / 100) * (h / 2 - 8);\n\t\t\t\t\t\t\treturn `${x.toFixed(2)},${y.toFixed(2)}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(' ');\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? '#475569';\n\t\t\t\t\treturn svg`<polyline points=${points} fill=\"none\" stroke=${color} stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />`;\n\t\t\t\t})}\n\t\t\t</svg>\n\t\t\t${\n\t\t\t\td.summary?.periodAdvice\n\t\t\t\t\t? html`<p class=\"advice\">${d.summary.periodAdvice}</p>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t</section>`;\n\t}\n\n\tprivate renderCritical(d: GetCriticalDaysResponse) {\n\t\treturn html`<section class=\"wrap\" aria-label=\"Critical days\">\n\t\t\t<header class=\"head\">\n\t\t\t\t<h2 class=\"title\">Critical days</h2>\n\t\t\t\t<span class=\"energy\">${d.totalCriticalDays} total</span>\n\t\t\t</header>\n\t\t\t<div>\n\t\t\t\t${d.criticalDays.map(\n\t\t\t\t\t(day) => html`<span class=\"crit\"\n\t\t\t\t\t\t>${day.date} \u00B7 ${day.cycle} ${day.severity}</span\n\t\t\t\t\t>`,\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</section>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-biorhythm-chart': RoxyBiorhythmChart;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`\n\t:host {\n\t\tdisplay: block;\n\t\tcontainer-type: inline-size;\n\t\tfont-family: var(\n\t\t\t--roxy-font-sans,\n\t\t\tsystem-ui,\n\t\t\t-apple-system,\n\t\t\tBlinkMacSystemFont,\n\t\t\t'Segoe UI',\n\t\t\tRoboto,\n\t\t\tsans-serif\n\t\t);\n\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\tbackground: transparent;\n\t\tfont-size: var(--roxy-text-base, 1rem);\n\t\tline-height: var(--roxy-leading-normal, 1.5);\n\t\tanimation: roxy-fade-in var(--roxy-motion-duration, 200ms)\n\t\t\tvar(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;\n\t}\n\n\t*,\n\t*::before,\n\t*::after {\n\t\tbox-sizing: border-box;\n\t}\n\n\t@keyframes roxy-fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(2px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-skeleton {\n\t\tbackground: linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--roxy-border, #e4e4e7) 0%,\n\t\t\tcolor-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,\n\t\t\tvar(--roxy-border, #e4e4e7) 100%\n\t\t);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: roxy-shimmer 1.4s ease-in-out infinite;\n\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t}\n\n\t@keyframes roxy-shimmer {\n\t\t0% {\n\t\t\tbackground-position: 200% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -200% 0;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.roxy-skeleton {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-empty {\n\t\tpadding: var(--roxy-space-lg, 1.5rem);\n\t\tcolor: var(--roxy-muted, #71717a);\n\t\ttext-align: center;\n\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t}\n\n\t:host(:focus-within) .roxy-card {\n\t\toutline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));\n\t\toutline-offset: 2px;\n\t}\n\n\t/* Force the text-style variant on every Unicode glyph in the component.\n\t * macOS and iOS substitute coloured emoji glyphs for the planetary and\n\t * gender Unicode code points (Mars, Venus, Mercury, etc.) when the\n\t * system colour-emoji font wins font selection. The text-style variant\n\t * keeps glyphs monochrome so they inherit the surrounding fill colour\n\t * and match the brand palette consistently across platforms.\n\t *\n\t * font-variant-emoji is part of CSS Fonts 4 (Safari 17+, Chrome 134+,\n\t * Firefox 139+). On older browsers the rule is silently ignored.\n\t */\n\t:host {\n\t\tfont-variant-emoji: text;\n\t}\n`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * 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.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * 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.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 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.\n *\n * 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.\n *\n * 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.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * 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.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * 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.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["css", "css"]
|
|
4
|
+
"sourcesContent": ["import { css, html, LitElement, nothing, svg } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tGetCriticalDaysResponse,\n\tGetDailyBiorhythmResponse,\n\tGetForecastResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype BiorhythmData =\n\t| GetDailyBiorhythmResponse\n\t| GetForecastResponse\n\t| GetCriticalDaysResponse;\n\nconst CYCLE_COLOR: Record<string, string> = {\n\tphysical: '#dc2626',\n\temotional: '#0284c7',\n\tintellectual: '#16a34a',\n\tintuitive: '#a855f7',\n\taesthetic: '#f59e0b',\n\tawareness: '#ec4899',\n\tspiritual: '#14b8a6',\n\tpassion: '#ef4444',\n\tmastery: '#6366f1',\n\twisdom: '#475569',\n};\n\n/**\n * Biorhythm chart. Renders /biorhythm/{daily,forecast,critical-days}.\n */\n@customElement('roxy-biorhythm-chart')\nexport class RoxyBiorhythmChart extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.energy{font-variant-numeric:tabular-nums;color:var(--roxy-accent-fg,#b45309);font-weight:var(--roxy-weight-bold,600)}.bars{gap:var(--roxy-space-xs,.25rem);display:grid}.bar{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.track{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:14px;position:relative;overflow:hidden}.fill{height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.value{font-variant-numeric:tabular-nums;text-align:right;color:var(--roxy-muted,#71717a)}.advice{color:var(--roxy-fg,#0a0a0a)}.alert{background:color-mix(in srgb, var(--roxy-warning,#ea580c) 12%, transparent);border:1px solid color-mix(in srgb, var(--roxy-warning,#ea580c) 32%, transparent);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);margin:0}svg{width:100%;height:auto;display:block}.crit{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);margin:2px;padding:4px 8px;display:inline-block}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: BiorhythmData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tmode: 'daily' | 'forecast' | 'critical-days' = 'daily';\n\n\trender() {\n\t\tconst d = this.data;\n\t\tif (!d)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No biorhythm data</div>`;\n\n\t\tif (this.mode === 'critical-days' && 'criticalDays' in d) {\n\t\t\treturn this.renderCritical(d as GetCriticalDaysResponse);\n\t\t}\n\t\tif (this.mode === 'forecast' && 'days' in d) {\n\t\t\treturn this.renderForecast(d as GetForecastResponse);\n\t\t}\n\t\treturn this.renderDaily(d as GetDailyBiorhythmResponse);\n\t}\n\n\tprivate renderDaily(d: GetDailyBiorhythmResponse) {\n\t\tconst raw = d.quickRead ?? {};\n\t\tconst entries = Object.entries(raw).map(([cycle, value]) => {\n\t\t\tconst v = typeof value === 'number' ? value : 0;\n\t\t\tconst normalized = Math.abs(v) > 1 ? v / 100 : v;\n\t\t\treturn [cycle, normalized] as const;\n\t\t});\n\t\treturn html`<section class=\"wrap\" aria-label=\"Daily biorhythm\"><header class=\"head\"><h2 class=\"title\">Biorhythm</h2>${\n\t\t\t\t\ttypeof d.energyRating === 'number'\n\t\t\t\t\t\t? html`<span class=\"energy\">Energy ${d.energyRating}/10</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</header><div class=\"bars\" role=\"list\">${entries.map(([cycle, v]) => {\n\t\t\t\t\tconst pct = ((v + 1) / 2) * 100; // -1..1 -> 0..100\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? 'var(--roxy-accent, #f59e0b)';\n\t\t\t\t\treturn html`<div class=\"bar\" role=\"listitem\"><span style=\"text-transform:capitalize\">${cycle}</span> <span class=\"track\"><span class=\"fill\" style=\"width:${pct}%;background:${color}\"></span> </span><span class=\"value\">${Math.round(v * 100)}%</span></div>`;\n\t\t\t\t})}</div>${d.dailyMessage ? html`<p class=\"advice\">${d.dailyMessage}</p>` : nothing} ${d.advice ? html`<p class=\"advice\">${d.advice}</p>` : nothing}</section>`;\n\t}\n\n\tprivate renderForecast(d: GetForecastResponse) {\n\t\tconst days = d.days ?? [];\n\t\tif (days.length === 0)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No forecast</div>`;\n\t\tconst w = 600;\n\t\tconst h = 160;\n\t\tconst xStep = w / Math.max(days.length - 1, 1);\n\t\tconst cycleKeys = [\n\t\t\t'physical',\n\t\t\t'emotional',\n\t\t\t'intellectual',\n\t\t\t'intuitive',\n\t\t] as const;\n\t\treturn html`<section class=\"wrap\" aria-label=\"Biorhythm forecast\"><header class=\"head\"><h2 class=\"title\">Forecast</h2><span class=\"energy\">${d.startDate} - ${d.endDate}</span></header><svg viewBox=\"0 0 ${w} ${h}\" role=\"img\" aria-label=\"Biorhythm cycle lines across the forecast window\"><title>Biorhythm forecast</title><line x1=\"0\" y1=\"${h / 2}\" x2=\"${w}\" y2=\"${h / 2}\" stroke=\"var(--roxy-border, #e4e4e7)\" stroke-width=\"1\"/>${cycleKeys.map((cycle) => {\n\t\t\t\t\tconst points = days\n\t\t\t\t\t\t.map((day, i) => {\n\t\t\t\t\t\t\tconst v = day[cycle] ?? 0;\n\t\t\t\t\t\t\tconst x = i * xStep;\n\t\t\t\t\t\t\tconst y = h / 2 - (v / 100) * (h / 2 - 8);\n\t\t\t\t\t\t\treturn `${x.toFixed(2)},${y.toFixed(2)}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(' ');\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? '#475569';\n\t\t\t\t\treturn svg`<polyline points=${points} fill=\"none\" stroke=${color} stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />`;\n\t\t\t\t})}</svg> ${\n\t\t\t\td.summary?.periodAdvice\n\t\t\t\t\t? html`<p class=\"advice\">${d.summary.periodAdvice}</p>`\n\t\t\t\t\t: nothing\n\t\t\t}</section>`;\n\t}\n\n\tprivate renderCritical(d: GetCriticalDaysResponse) {\n\t\treturn html`<section class=\"wrap\" aria-label=\"Critical days\"><header class=\"head\"><h2 class=\"title\">Critical days</h2><span class=\"energy\">${d.totalCriticalDays} total</span></header><div>${d.criticalDays.map(\n\t\t\t\t\t(day) => html`<span class=\"crit\">${day.date} \u00B7 ${day.cycle} ${day.severity}</span>`,\n\t\t\t\t)}</div></section>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-biorhythm-chart': RoxyBiorhythmChart;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * 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.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * 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.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 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.\n *\n * 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.\n *\n * 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.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * 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.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * 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.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["css", "html", "LitElement", "nothing", "svg", "customElement", "property", "css", "baseStyles", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "text", "CYCLE_COLOR", "RoxyBiorhythmChart", "LitElement", "MarkupDataController", "d", "html", "raw", "entries", "cycle", "value", "v", "normalized", "nothing", "pct", "color", "days", "w", "h", "xStep", "cycleKeys", "points", "day", "i", "x", "y", "svg", "baseStyles", "css", "__decorateClass", "property", "customElement"]
|
|
7
7
|
}
|
|
@@ -1,398 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
-
if (decorator = decorators[i])
|
|
7
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result) __defProp(target, key, result);
|
|
9
|
-
return result;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// packages/ui/src/components/choghadiya-grid.ts
|
|
13
|
-
import { css as css2, html, LitElement, nothing } from "lit";
|
|
14
|
-
import { customElement, property } from "lit/decorators.js";
|
|
15
|
-
|
|
16
|
-
// packages/ui/src/tokens/index.ts
|
|
17
|
-
var PLANET_GLYPH = {
|
|
18
|
-
Sun: "\u2609",
|
|
19
|
-
Moon: "\u263D",
|
|
20
|
-
Mercury: "\u263F",
|
|
21
|
-
Venus: "\u2640",
|
|
22
|
-
Earth: "\u2641",
|
|
23
|
-
Mars: "\u2642",
|
|
24
|
-
Jupiter: "\u2643",
|
|
25
|
-
Saturn: "\u2644",
|
|
26
|
-
Uranus: "\u2645",
|
|
27
|
-
Neptune: "\u2646",
|
|
28
|
-
Pluto: "\u2647",
|
|
29
|
-
Rahu: "\u260A",
|
|
30
|
-
Ketu: "\u260B",
|
|
31
|
-
Ascendant: "Asc",
|
|
32
|
-
Lagna: "La",
|
|
33
|
-
NorthNode: "\u260A",
|
|
34
|
-
SouthNode: "\u260B",
|
|
35
|
-
"North node": "\u260A",
|
|
36
|
-
"South node": "\u260B",
|
|
37
|
-
Chiron: "\u26B7",
|
|
38
|
-
Lilith: "\u26B8",
|
|
39
|
-
"Black moon lilith": "\u26B8"
|
|
40
|
-
};
|
|
41
|
-
var SIGNS_ORDER = [
|
|
42
|
-
"Aries",
|
|
43
|
-
"Taurus",
|
|
44
|
-
"Gemini",
|
|
45
|
-
"Cancer",
|
|
46
|
-
"Leo",
|
|
47
|
-
"Virgo",
|
|
48
|
-
"Libra",
|
|
49
|
-
"Scorpio",
|
|
50
|
-
"Sagittarius",
|
|
51
|
-
"Capricorn",
|
|
52
|
-
"Aquarius",
|
|
53
|
-
"Pisces"
|
|
54
|
-
];
|
|
55
|
-
var RASHI_KEYS = SIGNS_ORDER.map(
|
|
56
|
-
(s) => s.toLowerCase()
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
// packages/ui/src/utils/base-styles.ts
|
|
60
|
-
import { css } from "lit";
|
|
61
|
-
var baseStyles = css`
|
|
62
|
-
:host {
|
|
63
|
-
display: block;
|
|
64
|
-
container-type: inline-size;
|
|
65
|
-
font-family: var(
|
|
66
|
-
--roxy-font-sans,
|
|
67
|
-
system-ui,
|
|
68
|
-
-apple-system,
|
|
69
|
-
BlinkMacSystemFont,
|
|
70
|
-
'Segoe UI',
|
|
71
|
-
Roboto,
|
|
72
|
-
sans-serif
|
|
73
|
-
);
|
|
74
|
-
color: var(--roxy-fg, #0a0a0a);
|
|
75
|
-
background: transparent;
|
|
76
|
-
font-size: var(--roxy-text-base, 1rem);
|
|
77
|
-
line-height: var(--roxy-leading-normal, 1.5);
|
|
78
|
-
animation: roxy-fade-in var(--roxy-motion-duration, 200ms)
|
|
79
|
-
var(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
*,
|
|
83
|
-
*::before,
|
|
84
|
-
*::after {
|
|
85
|
-
box-sizing: border-box;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
@keyframes roxy-fade-in {
|
|
89
|
-
from {
|
|
90
|
-
opacity: 0;
|
|
91
|
-
transform: translateY(2px);
|
|
92
|
-
}
|
|
93
|
-
to {
|
|
94
|
-
opacity: 1;
|
|
95
|
-
transform: translateY(0);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@media (prefers-reduced-motion: reduce) {
|
|
100
|
-
:host {
|
|
101
|
-
animation: none;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.roxy-skeleton {
|
|
106
|
-
background: linear-gradient(
|
|
107
|
-
90deg,
|
|
108
|
-
var(--roxy-border, #e4e4e7) 0%,
|
|
109
|
-
color-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,
|
|
110
|
-
var(--roxy-border, #e4e4e7) 100%
|
|
111
|
-
);
|
|
112
|
-
background-size: 200% 100%;
|
|
113
|
-
animation: roxy-shimmer 1.4s ease-in-out infinite;
|
|
114
|
-
border-radius: var(--roxy-radius-md, 8px);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@keyframes roxy-shimmer {
|
|
118
|
-
0% {
|
|
119
|
-
background-position: 200% 0;
|
|
120
|
-
}
|
|
121
|
-
100% {
|
|
122
|
-
background-position: -200% 0;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
@media (prefers-reduced-motion: reduce) {
|
|
127
|
-
.roxy-skeleton {
|
|
128
|
-
animation: none;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.roxy-empty {
|
|
133
|
-
padding: var(--roxy-space-lg, 1.5rem);
|
|
134
|
-
color: var(--roxy-muted, #71717a);
|
|
135
|
-
text-align: center;
|
|
136
|
-
font-size: var(--roxy-text-sm, 0.875rem);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
:host(:focus-within) .roxy-card {
|
|
140
|
-
outline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));
|
|
141
|
-
outline-offset: 2px;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/* Force the text-style variant on every Unicode glyph in the component.
|
|
145
|
-
* macOS and iOS substitute coloured emoji glyphs for the planetary and
|
|
146
|
-
* gender Unicode code points (Mars, Venus, Mercury, etc.) when the
|
|
147
|
-
* system colour-emoji font wins font selection. The text-style variant
|
|
148
|
-
* keeps glyphs monochrome so they inherit the surrounding fill colour
|
|
149
|
-
* and match the brand palette consistently across platforms.
|
|
150
|
-
*
|
|
151
|
-
* font-variant-emoji is part of CSS Fonts 4 (Safari 17+, Chrome 134+,
|
|
152
|
-
* Firefox 139+). On older browsers the rule is silently ignored.
|
|
153
|
-
*/
|
|
154
|
-
:host {
|
|
155
|
-
font-variant-emoji: text;
|
|
156
|
-
}
|
|
157
|
-
`;
|
|
158
|
-
|
|
159
|
-
// packages/ui/src/utils/markup-data.ts
|
|
160
|
-
var ROXY_DATA_CLASS = "roxy-data";
|
|
161
|
-
function isJsonScript(el) {
|
|
162
|
-
return el.nodeName === "SCRIPT" && el.getAttribute("type") === "application/json";
|
|
163
|
-
}
|
|
164
|
-
var MarkupDataController = class {
|
|
165
|
-
constructor(host) {
|
|
166
|
-
this.host = host;
|
|
167
|
-
host.addController(this);
|
|
168
|
-
}
|
|
169
|
-
hostConnected() {
|
|
170
|
-
if (this.host.data != null) return;
|
|
171
|
-
const parsed = this.read();
|
|
172
|
-
if (parsed === void 0) return;
|
|
173
|
-
this.host.data = parsed;
|
|
174
|
-
this.host.requestUpdate();
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.
|
|
178
|
-
*/
|
|
179
|
-
read() {
|
|
180
|
-
const inline = this.findInlineScript();
|
|
181
|
-
return inline ? this.parse(inline.textContent) : void 0;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* 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.
|
|
185
|
-
*/
|
|
186
|
-
findInlineScript() {
|
|
187
|
-
for (const child of Array.from(this.host.children)) {
|
|
188
|
-
if (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {
|
|
189
|
-
return child;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
return null;
|
|
193
|
-
}
|
|
194
|
-
parse(text) {
|
|
195
|
-
if (!text?.trim()) return void 0;
|
|
196
|
-
try {
|
|
197
|
-
return JSON.parse(text);
|
|
198
|
-
} catch {
|
|
199
|
-
return void 0;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
// packages/ui/src/utils/string.ts
|
|
205
|
-
function capitalize(s) {
|
|
206
|
-
if (!s) return "";
|
|
207
|
-
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// packages/ui/src/components/choghadiya-grid.ts
|
|
211
|
-
function fmtTime(iso) {
|
|
212
|
-
try {
|
|
213
|
-
const d = new Date(iso);
|
|
214
|
-
if (Number.isNaN(d.getTime())) return iso;
|
|
215
|
-
return d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
216
|
-
} catch {
|
|
217
|
-
return iso;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
var RoxyChoghadiyaGrid = class extends LitElement {
|
|
221
|
-
constructor() {
|
|
222
|
-
super();
|
|
223
|
-
this.data = null;
|
|
224
|
-
new MarkupDataController(this);
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* True when the current wall-clock time falls inside this period. Both
|
|
228
|
-
* `start` and `end` are ISO 8601 with timezone, so the comparison is
|
|
229
|
-
* timezone-aware via the host's `Date` parsing.
|
|
230
|
-
*/
|
|
231
|
-
isCurrent(period) {
|
|
232
|
-
const now = Date.now();
|
|
233
|
-
const start = Date.parse(period.start);
|
|
234
|
-
const end = Date.parse(period.end);
|
|
235
|
-
if (Number.isNaN(start) || Number.isNaN(end)) return false;
|
|
236
|
-
return now >= start && now < end;
|
|
237
|
-
}
|
|
238
|
-
renderTile(period) {
|
|
239
|
-
const effectClass = period.effect === "Good" ? "good" : period.effect === "Bad" ? "bad" : "neutral";
|
|
240
|
-
const current = this.isCurrent(period);
|
|
241
|
-
const lordGlyph = PLANET_GLYPH[capitalize(period.lord)] ?? "";
|
|
242
|
-
const timeRange = `${fmtTime(period.start)} - ${fmtTime(period.end)}`;
|
|
243
|
-
return html`<div
|
|
244
|
-
class="cho-tile ${effectClass}${current ? " now" : ""}"
|
|
245
|
-
role="listitem"
|
|
246
|
-
aria-current=${current ? "time" : "false"}
|
|
247
|
-
>
|
|
248
|
-
<span class="tile-name">
|
|
249
|
-
${period.name}${current ? html`<span class="now-badge">Now</span>` : nothing}
|
|
250
|
-
</span>
|
|
251
|
-
<span class="tile-time" aria-label="Time range">${timeRange}</span>
|
|
252
|
-
<span class="tile-lord">
|
|
253
|
-
${lordGlyph ? html`<span aria-hidden="true">${lordGlyph}</span>` : nothing}
|
|
254
|
-
${period.lord}
|
|
255
|
-
</span>
|
|
256
|
-
</div>`;
|
|
257
|
-
}
|
|
258
|
-
render() {
|
|
259
|
-
if (!this.data)
|
|
260
|
-
return html`<div class="roxy-empty" role="status">No choghadiya data</div>`;
|
|
261
|
-
const { date, dayChoghadiya, nightChoghadiya } = this.data;
|
|
262
|
-
return html`<div class="wrap">
|
|
263
|
-
<div class="header">
|
|
264
|
-
<h2 class="title">Choghadiya</h2>
|
|
265
|
-
${date ? html`<p class="subtitle">${date}</p>` : nothing}
|
|
266
|
-
</div>
|
|
267
|
-
|
|
268
|
-
<div class="cho-grid">
|
|
269
|
-
<section class="period-col" aria-label="Day muhurta periods">
|
|
270
|
-
<h3 class="period-heading">Day</h3>
|
|
271
|
-
<div role="list" aria-label="Daytime choghadiya">
|
|
272
|
-
${dayChoghadiya && dayChoghadiya.length > 0 ? dayChoghadiya.map((p) => this.renderTile(p)) : html`<p class="roxy-empty" role="status">No daytime periods</p>`}
|
|
273
|
-
</div>
|
|
274
|
-
</section>
|
|
275
|
-
|
|
276
|
-
<section class="period-col" aria-label="Night muhurta periods">
|
|
277
|
-
<h3 class="period-heading">Night</h3>
|
|
278
|
-
<div role="list" aria-label="Nighttime choghadiya">
|
|
279
|
-
${nightChoghadiya && nightChoghadiya.length > 0 ? nightChoghadiya.map((p) => this.renderTile(p)) : html`<p class="roxy-empty" role="status">No nighttime periods</p>`}
|
|
280
|
-
</div>
|
|
281
|
-
</section>
|
|
282
|
-
</div>
|
|
283
|
-
</div>`;
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
RoxyChoghadiyaGrid.styles = [
|
|
287
|
-
baseStyles,
|
|
288
|
-
css2`
|
|
289
|
-
.wrap {
|
|
290
|
-
display: grid;
|
|
291
|
-
gap: var(--roxy-space-md, 1rem);
|
|
292
|
-
}
|
|
293
|
-
.header {
|
|
294
|
-
display: grid;
|
|
295
|
-
gap: var(--roxy-space-xs, 0.25rem);
|
|
296
|
-
}
|
|
297
|
-
.title {
|
|
298
|
-
font-size: var(--roxy-text-lg, 1.125rem);
|
|
299
|
-
font-weight: var(--roxy-weight-bold, 600);
|
|
300
|
-
margin: 0;
|
|
301
|
-
}
|
|
302
|
-
.subtitle {
|
|
303
|
-
font-size: var(--roxy-text-sm, 0.875rem);
|
|
304
|
-
color: var(--roxy-muted, #71717a);
|
|
305
|
-
margin: 0;
|
|
306
|
-
}
|
|
307
|
-
.cho-grid {
|
|
308
|
-
display: grid;
|
|
309
|
-
grid-template-columns: 1fr;
|
|
310
|
-
gap: var(--roxy-space-md, 1rem);
|
|
311
|
-
}
|
|
312
|
-
@media (min-width: 720px) {
|
|
313
|
-
.cho-grid {
|
|
314
|
-
grid-template-columns: 1fr 1fr;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
.period-col {
|
|
318
|
-
display: grid;
|
|
319
|
-
gap: var(--roxy-space-xs, 0.25rem);
|
|
320
|
-
}
|
|
321
|
-
.period-heading {
|
|
322
|
-
font-size: var(--roxy-text-base, 1rem);
|
|
323
|
-
font-weight: var(--roxy-weight-bold, 600);
|
|
324
|
-
margin: 0 0 var(--roxy-space-xs, 0.25rem);
|
|
325
|
-
color: var(--roxy-fg, #0a0a0a);
|
|
326
|
-
}
|
|
327
|
-
.cho-tile {
|
|
328
|
-
display: grid;
|
|
329
|
-
grid-template-columns: 1fr auto;
|
|
330
|
-
align-items: center;
|
|
331
|
-
gap: 0.25em 0.75em;
|
|
332
|
-
padding: 0.55em 0.85em;
|
|
333
|
-
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
334
|
-
border-radius: var(--roxy-radius-md, 8px);
|
|
335
|
-
}
|
|
336
|
-
.cho-tile.good {
|
|
337
|
-
background: color-mix(in srgb, var(--roxy-success, #22c55e) 18%, transparent);
|
|
338
|
-
border-color: color-mix(in srgb, var(--roxy-success, #22c55e) 45%, transparent);
|
|
339
|
-
color: var(--roxy-fg, #0a0a0a);
|
|
340
|
-
}
|
|
341
|
-
.cho-tile.bad {
|
|
342
|
-
background: color-mix(in srgb, var(--roxy-danger, #ef4444) 18%, transparent);
|
|
343
|
-
border-color: color-mix(in srgb, var(--roxy-danger, #ef4444) 45%, transparent);
|
|
344
|
-
color: var(--roxy-fg, #0a0a0a);
|
|
345
|
-
}
|
|
346
|
-
.cho-tile.neutral {
|
|
347
|
-
background: transparent;
|
|
348
|
-
color: var(--roxy-fg, #0a0a0a);
|
|
349
|
-
}
|
|
350
|
-
.cho-tile.now {
|
|
351
|
-
outline: 2px solid var(--roxy-accent, #f59e0b);
|
|
352
|
-
outline-offset: 1px;
|
|
353
|
-
box-shadow: 0 0 0 4px
|
|
354
|
-
color-mix(in srgb, var(--roxy-accent, #f59e0b) 18%, transparent);
|
|
355
|
-
}
|
|
356
|
-
.now-badge {
|
|
357
|
-
display: inline-block;
|
|
358
|
-
margin-left: 0.4em;
|
|
359
|
-
font-size: var(--roxy-text-xs, 0.75rem);
|
|
360
|
-
font-weight: var(--roxy-weight-bold, 600);
|
|
361
|
-
color: var(--roxy-accent-fg, #b45309);
|
|
362
|
-
text-transform: uppercase;
|
|
363
|
-
letter-spacing: 0.06em;
|
|
364
|
-
}
|
|
365
|
-
.tile-name {
|
|
366
|
-
font-size: var(--roxy-text-base, 1rem);
|
|
367
|
-
font-weight: var(--roxy-weight-bold, 600);
|
|
368
|
-
grid-column: 1;
|
|
369
|
-
}
|
|
370
|
-
.tile-time {
|
|
371
|
-
font-size: var(--roxy-text-xs, 0.75rem);
|
|
372
|
-
opacity: 0.8;
|
|
373
|
-
white-space: nowrap;
|
|
374
|
-
grid-column: 2;
|
|
375
|
-
grid-row: 1 / 3;
|
|
376
|
-
text-align: right;
|
|
377
|
-
align-self: center;
|
|
378
|
-
}
|
|
379
|
-
.tile-lord {
|
|
380
|
-
font-size: var(--roxy-text-sm, 0.875rem);
|
|
381
|
-
opacity: 0.85;
|
|
382
|
-
grid-column: 1;
|
|
383
|
-
display: flex;
|
|
384
|
-
align-items: center;
|
|
385
|
-
gap: 0.25em;
|
|
386
|
-
}
|
|
387
|
-
`
|
|
388
|
-
];
|
|
389
|
-
__decorateClass([
|
|
390
|
-
property({ attribute: false })
|
|
391
|
-
], RoxyChoghadiyaGrid.prototype, "data", 2);
|
|
392
|
-
RoxyChoghadiyaGrid = __decorateClass([
|
|
393
|
-
customElement("roxy-choghadiya-grid")
|
|
394
|
-
], RoxyChoghadiyaGrid);
|
|
395
|
-
export {
|
|
396
|
-
RoxyChoghadiyaGrid
|
|
397
|
-
};
|
|
1
|
+
var x=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var d=(a,e,r,o)=>{for(var t=o>1?void 0:o?y(e,r):e,i=a.length-1,c;i>=0;i--)(c=a[i])&&(t=(o?c(e,r,t):c(t))||t);return o&&t&&x(e,r,t),t};import{css as w,html as n,LitElement as N,nothing as p}from"lit";import{customElement as C,property as L}from"lit/decorators.js";var u={Sun:"\u2609",Moon:"\u263D",Mercury:"\u263F",Venus:"\u2640",Earth:"\u2641",Mars:"\u2642",Jupiter:"\u2643",Saturn:"\u2644",Uranus:"\u2645",Neptune:"\u2646",Pluto:"\u2647",Rahu:"\u260A",Ketu:"\u260B",Ascendant:"Asc",Lagna:"La",NorthNode:"\u260A",SouthNode:"\u260B","North node":"\u260A","South node":"\u260B",Chiron:"\u26B7",Lilith:"\u26B8","Black moon lilith":"\u26B8"};var f=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"],T=f.map(a=>a.toLowerCase());import{css as b}from"lit";var m=b`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var v="roxy-data";function S(a){return a.nodeName==="SCRIPT"&&a.getAttribute("type")==="application/json"}var l=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(S(e)&&e.classList.contains(v))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};function g(a){return a?a.charAt(0).toUpperCase()+a.slice(1).toLowerCase():""}function h(a){try{let e=new Date(a);return Number.isNaN(e.getTime())?a:e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return a}}var s=class extends N{constructor(){super();this.data=null;new l(this)}isCurrent(r){let o=Date.now(),t=Date.parse(r.start),i=Date.parse(r.end);return Number.isNaN(t)||Number.isNaN(i)?!1:o>=t&&o<i}renderTile(r){let o=r.effect==="Good"?"good":r.effect==="Bad"?"bad":"neutral",t=this.isCurrent(r),i=u[g(r.lord)]??"",c=`${h(r.start)} - ${h(r.end)}`;return n`<div class="cho-tile ${o}${t?" now":""}" role="listitem" aria-current="${t?"time":"false"}"><span class="tile-name">${r.name}${t?n`<span class="now-badge">Now</span>`:p} </span><span class="tile-time" aria-label="Time range">${c}</span> <span class="tile-lord">${i?n`<span aria-hidden="true">${i}</span>`:p} ${r.lord}</span></div>`}render(){if(!this.data)return n`<div class="roxy-empty" role="status">No choghadiya data</div>`;let{date:r,dayChoghadiya:o,nightChoghadiya:t}=this.data;return n`<div class="wrap"><div class="header"><h2 class="title">Choghadiya</h2>${r?n`<p class="subtitle">${r}</p>`:p}</div><div class="cho-grid"><section class="period-col" aria-label="Day muhurta periods"><h3 class="period-heading">Day</h3><div role="list" aria-label="Daytime choghadiya">${o&&o.length>0?o.map(i=>this.renderTile(i)):n`<p class="roxy-empty" role="status">No daytime periods</p>`}</div></section><section class="period-col" aria-label="Night muhurta periods"><h3 class="period-heading">Night</h3><div role="list" aria-label="Nighttime choghadiya">${t&&t.length>0?t.map(i=>this.renderTile(i)):n`<p class="roxy-empty" role="status">No nighttime periods</p>`}</div></section></div></div>`}};s.styles=[m,w`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.header{gap:var(--roxy-space-xs,.25rem);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);margin:0}.cho-grid{gap:var(--roxy-space-md,1rem);grid-template-columns:1fr;display:grid}@media (width>=720px){.cho-grid{grid-template-columns:1fr 1fr}}.period-col{gap:var(--roxy-space-xs,.25rem);display:grid}.period-heading{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);margin:0 0 var(--roxy-space-xs,.25rem);color:var(--roxy-fg,#0a0a0a)}.cho-tile{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);grid-template-columns:1fr auto;align-items:center;gap:.25em .75em;padding:.55em .85em;display:grid}.cho-tile.good{background:color-mix(in srgb, var(--roxy-success,#22c55e) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-success,#22c55e) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.bad{background:color-mix(in srgb, var(--roxy-danger,#ef4444) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-danger,#ef4444) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.neutral{color:var(--roxy-fg,#0a0a0a);background:0 0}.cho-tile.now{outline:2px solid var(--roxy-accent,#f59e0b);outline-offset:1px;box-shadow:0 0 0 4px color-mix(in srgb, var(--roxy-accent,#f59e0b) 18%, transparent)}.now-badge{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-fg,#b45309);text-transform:uppercase;letter-spacing:.06em;margin-left:.4em;display:inline-block}.tile-name{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);grid-column:1}.tile-time{font-size:var(--roxy-text-xs,.75rem);opacity:.8;white-space:nowrap;text-align:right;grid-area:1/2/3;align-self:center}.tile-lord{font-size:var(--roxy-text-sm,.875rem);opacity:.85;grid-column:1;align-items:center;gap:.25em;display:flex}`],d([L({attribute:!1})],s.prototype,"data",2),s=d([C("roxy-choghadiya-grid")],s);export{s as RoxyChoghadiyaGrid};
|
|
398
2
|
//# sourceMappingURL=choghadiya-grid.js.map
|