import { css, html, LitElement, nothing } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import type { KpPlanetsResponse } from '../types/index.js'; import { baseStyles } from '../utils/base-styles.js'; import { formatNumber } from '../utils/format.js'; /** * KP planets table with sub-lord and sub-sub-lord columns. Renders * /vedic-astrology/kp/planets. */ @customElement('roxy-kp-planets-table') export class RoxyKpPlanetsTable extends LitElement { static styles = [ baseStyles, css` .wrap { border: 1px solid var(--roxy-border, #e4e4e7); border-radius: var(--roxy-radius-md, 8px); background: var(--roxy-bg, #fff); overflow: auto; box-shadow: var(--roxy-shadow-sm); } .head { padding: var(--roxy-space-md, 1rem); border-bottom: 1px solid var(--roxy-border, #e4e4e7); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--roxy-space-sm, 0.5rem); } .title { margin: 0; font-size: var(--roxy-text-lg, 1.125rem); font-weight: var(--roxy-weight-bold, 600); } .ayanamsa { color: var(--roxy-muted, #71717a); font-size: var(--roxy-text-sm, 0.875rem); } table { width: 100%; border-collapse: collapse; font-size: var(--roxy-text-sm, 0.875rem); min-width: 560px; } thead { background: color-mix(in srgb, var(--roxy-border, #e4e4e7) 20%, transparent); } th, td { padding: var(--roxy-space-sm, 0.5rem) var(--roxy-space-md, 1rem); text-align: left; white-space: nowrap; } th { color: var(--roxy-muted, #71717a); font-weight: var(--roxy-weight-bold, 600); text-transform: uppercase; font-size: var(--roxy-text-xs, 0.75rem); letter-spacing: 0.04em; } tbody tr { border-top: 1px solid var(--roxy-border, #e4e4e7); } td.planet { font-weight: var(--roxy-weight-bold, 600); color: var(--roxy-fg, #0a0a0a); } .retro { color: var(--roxy-warning-fg, #9a3412); font-size: var(--roxy-text-xs, 0.75rem); margin-left: 4px; } `, ]; @property({ attribute: false }) data: KpPlanetsResponse | null = null; render() { if (!this.data) return html`
| Planet | Sign | Sign lord | Nakshatra | Star lord | Sub lord | Sub sub lord | KP no. |
|---|---|---|---|---|---|---|---|
| ${p.planet} ${p.retrograde ? html`R` : nothing} | ${p.sign ?? ''} | ${p.signLord ?? ''} | ${p.nakshatra ?? ''} | ${p.nakshatraLord ?? ''} | ${p.subLord ?? ''} | ${p.subSubLord ?? ''} | ${p.kpNumber ?? ''} |