@roxyapi/ui 0.1.2 → 0.2.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 +6 -0
- package/README.md +327 -14
- package/THEMING.md +24 -7
- package/dist/cdn/components/ashtakavarga-grid.js +349 -0
- package/dist/cdn/components/ashtakavarga-grid.js.map +7 -0
- package/dist/cdn/components/biorhythm-chart.js +15 -22
- package/dist/cdn/components/biorhythm-chart.js.map +3 -3
- package/dist/cdn/components/choghadiya-grid.js +239 -0
- package/dist/cdn/components/choghadiya-grid.js.map +7 -0
- package/dist/cdn/components/compatibility-card.js +36 -34
- package/dist/cdn/components/compatibility-card.js.map +4 -4
- package/dist/cdn/components/dasha-timeline.js +35 -39
- package/dist/cdn/components/dasha-timeline.js.map +4 -4
- package/dist/cdn/components/data.js +9 -9
- package/dist/cdn/components/data.js.map +4 -4
- package/dist/cdn/components/divisional-chart.js +279 -0
- package/dist/cdn/components/divisional-chart.js.map +7 -0
- package/dist/cdn/components/dosha-card.js +49 -49
- package/dist/cdn/components/dosha-card.js.map +3 -3
- package/dist/cdn/components/endpoint-form.js +47 -28
- package/dist/cdn/components/endpoint-form.js.map +4 -4
- package/dist/cdn/components/guna-milan.js +66 -24
- package/dist/cdn/components/guna-milan.js.map +4 -4
- package/dist/cdn/components/hexagram.js +26 -26
- package/dist/cdn/components/hexagram.js.map +3 -3
- package/dist/cdn/components/horoscope-card.js +47 -40
- package/dist/cdn/components/horoscope-card.js.map +4 -4
- package/dist/cdn/components/kp-planets-table.js +10 -10
- package/dist/cdn/components/kp-planets-table.js.map +4 -4
- package/dist/cdn/components/location-search.js +6 -6
- package/dist/cdn/components/location-search.js.map +3 -3
- package/dist/cdn/components/moon-phase.js +18 -18
- package/dist/cdn/components/moon-phase.js.map +4 -4
- package/dist/cdn/components/natal-chart.js +240 -24
- package/dist/cdn/components/natal-chart.js.map +4 -4
- package/dist/cdn/components/numerology-card.js +40 -31
- package/dist/cdn/components/numerology-card.js.map +4 -4
- package/dist/cdn/components/panchang-table.js +30 -30
- package/dist/cdn/components/panchang-table.js.map +4 -4
- package/dist/cdn/components/shadbala-table.js +312 -0
- package/dist/cdn/components/shadbala-table.js.map +7 -0
- package/dist/cdn/components/synastry-chart.js +129 -39
- package/dist/cdn/components/synastry-chart.js.map +4 -4
- package/dist/cdn/components/tarot-card.js +49 -20
- package/dist/cdn/components/tarot-card.js.map +3 -3
- package/dist/cdn/components/tarot-spread.js +43 -27
- package/dist/cdn/components/tarot-spread.js.map +3 -3
- package/dist/cdn/components/transits-table.js +391 -0
- package/dist/cdn/components/transits-table.js.map +7 -0
- package/dist/cdn/components/vedic-kundli.js +63 -27
- package/dist/cdn/components/vedic-kundli.js.map +4 -4
- package/dist/cdn/components/yoga-list.js +334 -0
- package/dist/cdn/components/yoga-list.js.map +7 -0
- package/dist/cdn/roxy-ui.js +2104 -544
- package/dist/cdn/roxy-ui.js.map +4 -4
- package/dist/components/ashtakavarga-grid.d.ts +26 -0
- package/dist/components/ashtakavarga-grid.d.ts.map +1 -0
- package/dist/components/ashtakavarga-grid.js +457 -0
- package/dist/components/ashtakavarga-grid.js.map +7 -0
- package/dist/components/biorhythm-chart.d.ts +2 -46
- package/dist/components/biorhythm-chart.d.ts.map +1 -1
- package/dist/components/biorhythm-chart.js +24 -23
- package/dist/components/biorhythm-chart.js.map +2 -2
- package/dist/components/choghadiya-grid.d.ts +19 -0
- package/dist/components/choghadiya-grid.d.ts.map +1 -0
- package/dist/components/choghadiya-grid.js +304 -0
- package/dist/components/choghadiya-grid.js.map +7 -0
- package/dist/components/compatibility-card.d.ts +2 -27
- package/dist/components/compatibility-card.d.ts.map +1 -1
- package/dist/components/compatibility-card.js +50 -29
- package/dist/components/compatibility-card.js.map +3 -3
- package/dist/components/dasha-timeline.d.ts +2 -31
- package/dist/components/dasha-timeline.d.ts.map +1 -1
- package/dist/components/dasha-timeline.js +32 -30
- package/dist/components/dasha-timeline.js.map +3 -3
- package/dist/components/data.d.ts +11 -7
- package/dist/components/data.d.ts.map +1 -1
- package/dist/components/data.js +16 -6
- package/dist/components/data.js.map +3 -3
- package/dist/components/divisional-chart.d.ts +20 -0
- package/dist/components/divisional-chart.d.ts.map +1 -0
- package/dist/components/divisional-chart.js +471 -0
- package/dist/components/divisional-chart.js.map +7 -0
- package/dist/components/dosha-card.d.ts +2 -16
- package/dist/components/dosha-card.d.ts.map +1 -1
- package/dist/components/dosha-card.js +45 -43
- package/dist/components/dosha-card.js.map +2 -2
- package/dist/components/endpoint-form.d.ts +2 -0
- package/dist/components/endpoint-form.d.ts.map +1 -1
- package/dist/components/endpoint-form.js +71 -11
- package/dist/components/endpoint-form.js.map +3 -3
- package/dist/components/guna-milan.d.ts +2 -20
- package/dist/components/guna-milan.d.ts.map +1 -1
- package/dist/components/guna-milan.js +79 -20
- package/dist/components/guna-milan.js.map +4 -4
- package/dist/components/hexagram.d.ts +3 -27
- package/dist/components/hexagram.d.ts.map +1 -1
- package/dist/components/hexagram.js +48 -15
- package/dist/components/hexagram.js.map +2 -2
- package/dist/components/horoscope-card.d.ts +2 -20
- package/dist/components/horoscope-card.d.ts.map +1 -1
- package/dist/components/horoscope-card.js +54 -18
- package/dist/components/horoscope-card.js.map +3 -3
- package/dist/components/kp-planets-table.d.ts +2 -21
- package/dist/components/kp-planets-table.d.ts.map +1 -1
- package/dist/components/kp-planets-table.js +10 -4
- package/dist/components/kp-planets-table.js.map +3 -3
- package/dist/components/location-search.d.ts +5 -14
- package/dist/components/location-search.d.ts.map +1 -1
- package/dist/components/location-search.js +45 -5
- package/dist/components/location-search.js.map +2 -2
- package/dist/components/moon-phase.d.ts +4 -21
- package/dist/components/moon-phase.d.ts.map +1 -1
- package/dist/components/moon-phase.js +34 -4
- package/dist/components/moon-phase.js.map +3 -3
- package/dist/components/natal-chart.d.ts +9 -43
- package/dist/components/natal-chart.d.ts.map +1 -1
- package/dist/components/natal-chart.js +346 -79
- package/dist/components/natal-chart.js.map +3 -3
- package/dist/components/numerology-card.d.ts +5 -37
- package/dist/components/numerology-card.d.ts.map +1 -1
- package/dist/components/numerology-card.js +58 -30
- package/dist/components/numerology-card.js.map +3 -3
- package/dist/components/panchang-table.d.ts +3 -62
- package/dist/components/panchang-table.d.ts.map +1 -1
- package/dist/components/panchang-table.js +62 -32
- package/dist/components/panchang-table.js.map +3 -3
- package/dist/components/shadbala-table.d.ts +18 -0
- package/dist/components/shadbala-table.d.ts.map +1 -0
- package/dist/components/shadbala-table.js +400 -0
- package/dist/components/shadbala-table.js.map +7 -0
- package/dist/components/synastry-chart.d.ts +9 -28
- package/dist/components/synastry-chart.d.ts.map +1 -1
- package/dist/components/synastry-chart.js +201 -56
- package/dist/components/synastry-chart.js.map +3 -3
- package/dist/components/tarot-card.d.ts +5 -29
- package/dist/components/tarot-card.d.ts.map +1 -1
- package/dist/components/tarot-card.js +59 -20
- package/dist/components/tarot-card.js.map +2 -2
- package/dist/components/tarot-spread.d.ts +2 -24
- package/dist/components/tarot-spread.d.ts.map +1 -1
- package/dist/components/tarot-spread.js +39 -13
- package/dist/components/tarot-spread.js.map +2 -2
- package/dist/components/transits-table.d.ts +21 -0
- package/dist/components/transits-table.d.ts.map +1 -0
- package/dist/components/transits-table.js +515 -0
- package/dist/components/transits-table.js.map +7 -0
- package/dist/components/vedic-kundli.d.ts +5 -28
- package/dist/components/vedic-kundli.d.ts.map +1 -1
- package/dist/components/vedic-kundli.js +147 -83
- package/dist/components/vedic-kundli.js.map +3 -3
- package/dist/components/yoga-list.d.ts +29 -0
- package/dist/components/yoga-list.d.ts.map +1 -0
- package/dist/components/yoga-list.js +389 -0
- package/dist/components/yoga-list.js.map +7 -0
- package/dist/index.cjs +3693 -1180
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3709 -1196
- package/dist/index.js.map +4 -4
- package/dist/manifest.d.ts +43 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.json +7 -2
- package/dist/styles/tokens.css +73 -1
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types.gen.d.ts +27811 -0
- package/dist/types/types.gen.d.ts.map +1 -0
- package/dist/utils/debounce.d.ts +9 -1
- package/dist/utils/debounce.d.ts.map +1 -1
- package/dist/utils/format.d.ts +29 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/kundli-render.d.ts +63 -0
- package/dist/utils/kundli-render.d.ts.map +1 -0
- package/dist/utils/string.d.ts +14 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +7 -1
- package/src/components/ashtakavarga-grid.ts +354 -0
- package/src/components/biorhythm-chart.ts +39 -84
- package/src/components/choghadiya-grid.ts +185 -0
- package/src/components/compatibility-card.ts +85 -52
- package/src/components/dasha-timeline.ts +55 -73
- package/src/components/data.ts +28 -16
- package/src/components/divisional-chart.ts +214 -0
- package/src/components/dosha-card.ts +72 -68
- package/src/components/endpoint-form.ts +80 -18
- package/src/components/guna-milan.ts +87 -47
- package/src/components/hexagram.ts +53 -43
- package/src/components/horoscope-card.ts +59 -43
- package/src/components/kp-planets-table.ts +8 -27
- package/src/components/location-search.ts +47 -23
- package/src/components/moon-phase.ts +28 -25
- package/src/components/natal-chart.ts +364 -110
- package/src/components/numerology-card.ts +86 -84
- package/src/components/panchang-table.ts +40 -78
- package/src/components/shadbala-table.ts +286 -0
- package/src/components/synastry-chart.ts +213 -97
- package/src/components/tarot-card.ts +76 -62
- package/src/components/tarot-spread.ts +72 -45
- package/src/components/transits-table.ts +350 -0
- package/src/components/vedic-kundli.ts +59 -173
- package/src/components/yoga-list.ts +328 -0
- package/src/index.ts +18 -26
- package/src/manifest.ts +340 -0
- package/src/styles/tokens.css +73 -1
- package/src/tokens/index.ts +14 -0
- package/src/types/types.gen.ts +3 -3
- package/src/utils/debounce.ts +23 -4
- package/src/utils/format.ts +75 -0
- package/src/utils/kundli-render.ts +197 -0
- package/src/utils/string.ts +23 -0
- package/src/version.ts +2 -0
- package/dist/utils/motion.d.ts +0 -13
- package/dist/utils/motion.d.ts.map +0 -1
- package/src/utils/motion.ts +0 -18
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit';
|
|
2
|
+
import { nothing, svg } from 'lit';
|
|
3
|
+
import { PLANET_ABBR, SIGN_ABBR, SIGNS_ORDER } from '../tokens/index.js';
|
|
4
|
+
import { capitalize } from './string.js';
|
|
5
|
+
|
|
6
|
+
export const KUNDLI_SIZE = 300;
|
|
7
|
+
export const KUNDLI_CENTER = 150;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Maps a lowercase rashi key (e.g. "aries") back to its canonical sign name
|
|
11
|
+
* (e.g. "Aries"). Used by every kundli consumer to bridge spec lowercase
|
|
12
|
+
* rashi keys to the title-cased SIGNS_ORDER tokens.
|
|
13
|
+
*/
|
|
14
|
+
export const RASHI_TO_SIGN: Record<string, string> = Object.fromEntries(
|
|
15
|
+
SIGNS_ORDER.map((s) => [s.toLowerCase(), s] as const),
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* South Indian fixed-house square grid: house centers for planet text labels.
|
|
20
|
+
* House 1 is fixed top-center; positions are in the 300x300 viewBox.
|
|
21
|
+
*/
|
|
22
|
+
export const SOUTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {
|
|
23
|
+
1: { x: 150, y: 58 },
|
|
24
|
+
2: { x: 205, y: 52 },
|
|
25
|
+
3: { x: 253, y: 112 },
|
|
26
|
+
4: { x: 243, y: 150 },
|
|
27
|
+
5: { x: 253, y: 188 },
|
|
28
|
+
6: { x: 205, y: 248 },
|
|
29
|
+
7: { x: 150, y: 242 },
|
|
30
|
+
8: { x: 95, y: 248 },
|
|
31
|
+
9: { x: 47, y: 188 },
|
|
32
|
+
10: { x: 57, y: 150 },
|
|
33
|
+
11: { x: 47, y: 112 },
|
|
34
|
+
12: { x: 95, y: 52 },
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* South Indian sign abbreviation positions (slightly outward from center).
|
|
39
|
+
*/
|
|
40
|
+
export const SOUTH_SIGN_POSITIONS: Record<number, { x: number; y: number }> = {
|
|
41
|
+
1: { x: 150, y: 35 },
|
|
42
|
+
2: { x: 222, y: 40 },
|
|
43
|
+
3: { x: 265, y: 100 },
|
|
44
|
+
4: { x: 265, y: 150 },
|
|
45
|
+
5: { x: 265, y: 200 },
|
|
46
|
+
6: { x: 222, y: 260 },
|
|
47
|
+
7: { x: 150, y: 265 },
|
|
48
|
+
8: { x: 78, y: 260 },
|
|
49
|
+
9: { x: 35, y: 200 },
|
|
50
|
+
10: { x: 35, y: 150 },
|
|
51
|
+
11: { x: 35, y: 100 },
|
|
52
|
+
12: { x: 78, y: 40 },
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* North Indian style: 12 triangular house positions.
|
|
57
|
+
* Lagna (house 1) is the top diamond, numbered clockwise.
|
|
58
|
+
* Centers represent the visual midpoint of each triangular cell.
|
|
59
|
+
*/
|
|
60
|
+
export const NORTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {
|
|
61
|
+
1: { x: 150, y: 60 },
|
|
62
|
+
2: { x: 225, y: 100 },
|
|
63
|
+
3: { x: 255, y: 150 },
|
|
64
|
+
4: { x: 225, y: 200 },
|
|
65
|
+
5: { x: 150, y: 240 },
|
|
66
|
+
6: { x: 75, y: 200 },
|
|
67
|
+
7: { x: 45, y: 150 },
|
|
68
|
+
8: { x: 75, y: 100 },
|
|
69
|
+
9: { x: 100, y: 80 },
|
|
70
|
+
10: { x: 150, y: 108 },
|
|
71
|
+
11: { x: 200, y: 80 },
|
|
72
|
+
12: { x: 200, y: 220 },
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export interface HouseDef {
|
|
76
|
+
/** 1-based house number. */
|
|
77
|
+
number: number;
|
|
78
|
+
/** Sign name (TitleCase, e.g. "Aries"). */
|
|
79
|
+
sign: string;
|
|
80
|
+
/** Planet abbreviation strings to display. */
|
|
81
|
+
planets: string[];
|
|
82
|
+
/** Whether this house is the ascendant (Lagna). */
|
|
83
|
+
isLagna: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Render a single house group: lagna highlight, sign abbreviation, planet labels.
|
|
88
|
+
* Returns an SVG fragment for use inside an `<svg>` element.
|
|
89
|
+
*/
|
|
90
|
+
export function renderSouthHouseGroup(
|
|
91
|
+
h: HouseDef,
|
|
92
|
+
): TemplateResult | typeof nothing {
|
|
93
|
+
const center = SOUTH_HOUSE_CENTERS[h.number];
|
|
94
|
+
const signPos = SOUTH_SIGN_POSITIONS[h.number];
|
|
95
|
+
if (!center || !signPos) return nothing;
|
|
96
|
+
const signAbbr = SIGN_ABBR[h.sign] ?? '';
|
|
97
|
+
const planets = h.planets;
|
|
98
|
+
return svg`
|
|
99
|
+
<g>
|
|
100
|
+
${
|
|
101
|
+
h.isLagna
|
|
102
|
+
? svg`<rect
|
|
103
|
+
class="lagna-bg"
|
|
104
|
+
x=${center.x - 30} y=${center.y - 28}
|
|
105
|
+
width="60" height="56" rx="6"
|
|
106
|
+
/>`
|
|
107
|
+
: nothing
|
|
108
|
+
}
|
|
109
|
+
${
|
|
110
|
+
signAbbr
|
|
111
|
+
? svg`<text class="sign-text" x=${signPos.x} y=${signPos.y} text-anchor="middle" dominant-baseline="central">${signAbbr}</text>`
|
|
112
|
+
: nothing
|
|
113
|
+
}
|
|
114
|
+
${
|
|
115
|
+
h.isLagna
|
|
116
|
+
? svg`<text class="lagna-marker" x=${center.x} y=${center.y - 18} text-anchor="middle" dominant-baseline="central">LAGNA</text>`
|
|
117
|
+
: nothing
|
|
118
|
+
}
|
|
119
|
+
${planets.map((planet, j) => {
|
|
120
|
+
const abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);
|
|
121
|
+
const lineHeight = 13;
|
|
122
|
+
const baseY = h.isLagna ? center.y + 8 : center.y;
|
|
123
|
+
const startY = baseY - ((planets.length - 1) * lineHeight) / 2;
|
|
124
|
+
const yPos = startY + j * lineHeight;
|
|
125
|
+
return svg`<text class="planet-text" x=${center.x} y=${yPos} text-anchor="middle" dominant-baseline="central">${abbr}</text>`;
|
|
126
|
+
})}
|
|
127
|
+
</g>
|
|
128
|
+
`;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Render a north-Indian-style kundli wheel frame (grid lines only).
|
|
133
|
+
* Returns the SVG structural lines; call `renderNorthHouseGroup` for content.
|
|
134
|
+
*/
|
|
135
|
+
export function renderNorthFrame(): TemplateResult {
|
|
136
|
+
return svg`
|
|
137
|
+
<polygon class="line" points="150,10 290,150 150,290 10,150" stroke-width="1.5" />
|
|
138
|
+
<line class="line" x1="150" y1="10" x2="150" y2="290" stroke-width="1" />
|
|
139
|
+
<line class="line" x1="10" y1="150" x2="290" y2="150" stroke-width="1" />
|
|
140
|
+
<line class="line" x1="150" y1="10" x2="10" y2="150" stroke-width="0.6" stroke-dasharray="3,3" />
|
|
141
|
+
<line class="line" x1="150" y1="10" x2="290" y2="150" stroke-width="0.6" stroke-dasharray="3,3" />
|
|
142
|
+
<line class="line" x1="150" y1="290" x2="10" y2="150" stroke-width="0.6" stroke-dasharray="3,3" />
|
|
143
|
+
<line class="line" x1="150" y1="290" x2="290" y2="150" stroke-width="0.6" stroke-dasharray="3,3" />
|
|
144
|
+
`;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Render a north-Indian house group (sign abbr + house number + planets).
|
|
149
|
+
*/
|
|
150
|
+
export function renderNorthHouseGroup(
|
|
151
|
+
h: HouseDef,
|
|
152
|
+
): TemplateResult | typeof nothing {
|
|
153
|
+
const center = NORTH_HOUSE_CENTERS[h.number];
|
|
154
|
+
if (!center) return nothing;
|
|
155
|
+
const signAbbr = SIGN_ABBR[h.sign] ?? '';
|
|
156
|
+
const planets = h.planets;
|
|
157
|
+
return svg`
|
|
158
|
+
<g>
|
|
159
|
+
${
|
|
160
|
+
h.isLagna
|
|
161
|
+
? svg`<circle class="lagna-bg" cx=${center.x} cy=${center.y} r="22" />`
|
|
162
|
+
: nothing
|
|
163
|
+
}
|
|
164
|
+
${
|
|
165
|
+
signAbbr
|
|
166
|
+
? svg`<text class="sign-text" x=${center.x} y=${center.y - 10} text-anchor="middle" dominant-baseline="central">${signAbbr}</text>`
|
|
167
|
+
: nothing
|
|
168
|
+
}
|
|
169
|
+
<text class="house-num" x=${center.x} y=${center.y + 2} text-anchor="middle" dominant-baseline="central">${h.number}</text>
|
|
170
|
+
${planets.map((planet, j) => {
|
|
171
|
+
const abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);
|
|
172
|
+
const lineHeight = 11;
|
|
173
|
+
const startY = center.y + 14 - ((planets.length - 1) * lineHeight) / 2;
|
|
174
|
+
const yPos = startY + j * lineHeight;
|
|
175
|
+
return svg`<text class="planet-text" x=${center.x} y=${yPos} text-anchor="middle" dominant-baseline="central">${abbr}</text>`;
|
|
176
|
+
})}
|
|
177
|
+
</g>
|
|
178
|
+
`;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Render the south-Indian square frame (border diamond + inner square + radial lines).
|
|
183
|
+
*/
|
|
184
|
+
export function renderSouthFrame(): TemplateResult {
|
|
185
|
+
return svg`
|
|
186
|
+
<polygon class="line" points="150,10 290,150 150,290 10,150" stroke-width="1.5" />
|
|
187
|
+
<polygon class="line" points="220,80 220,220 80,220 80,80" stroke-width="1" fill="none" />
|
|
188
|
+
<line class="line" x1="150" y1="10" x2="80" y2="80" stroke-width="1" />
|
|
189
|
+
<line class="line" x1="150" y1="10" x2="220" y2="80" stroke-width="1" />
|
|
190
|
+
<line class="line" x1="290" y1="150" x2="220" y2="80" stroke-width="1" />
|
|
191
|
+
<line class="line" x1="290" y1="150" x2="220" y2="220" stroke-width="1" />
|
|
192
|
+
<line class="line" x1="150" y1="290" x2="220" y2="220" stroke-width="1" />
|
|
193
|
+
<line class="line" x1="150" y1="290" x2="80" y2="220" stroke-width="1" />
|
|
194
|
+
<line class="line" x1="10" y1="150" x2="80" y2="220" stroke-width="1" />
|
|
195
|
+
<line class="line" x1="10" y1="150" x2="80" y2="80" stroke-width="1" />
|
|
196
|
+
`;
|
|
197
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared string helpers used across components. Single source of truth so the
|
|
3
|
+
* same formatting rules apply to every key/label/title that surfaces in the
|
|
4
|
+
* shadow tree.
|
|
5
|
+
*
|
|
6
|
+
* - `capitalize`: title-cases the first character, lowercases the rest. Used
|
|
7
|
+
* when matching API-supplied planet/sign names against the glyph maps in
|
|
8
|
+
* `tokens/index.ts`, which use canonical TitleCase keys.
|
|
9
|
+
* - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)
|
|
10
|
+
* into a label suitable for display ("Birth date", "Mahadasha end").
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export function capitalize(s: string): string {
|
|
14
|
+
if (!s) return '';
|
|
15
|
+
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function humanize(s: string): string {
|
|
19
|
+
return s
|
|
20
|
+
.replace(/[_-]+/g, ' ')
|
|
21
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
22
|
+
.replace(/^\w/, (c) => c.toUpperCase());
|
|
23
|
+
}
|
package/src/version.ts
ADDED
package/dist/utils/motion.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Motion guard. All component animations honor:
|
|
3
|
-
* 1. --roxy-motion-duration CSS variable (set to 0ms to disable)
|
|
4
|
-
* 2. prefers-reduced-motion: reduce media query (forces 0ms regardless)
|
|
5
|
-
*
|
|
6
|
-
* Components apply transitions and entry animations using the duration var
|
|
7
|
-
* directly. The reduced-motion override is enforced at the tokens.css layer.
|
|
8
|
-
*/
|
|
9
|
-
export declare function prefersReducedMotion(): boolean;
|
|
10
|
-
/** CSS snippet that components paste into their styles to read the motion duration. */
|
|
11
|
-
export declare const MOTION_DURATION = "var(--roxy-motion-duration, 200ms)";
|
|
12
|
-
export declare const MOTION_EASING = "var(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1))";
|
|
13
|
-
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/utils/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED,uFAAuF;AACvF,eAAO,MAAM,eAAe,uCAAuC,CAAC;AACpE,eAAO,MAAM,aAAa,4DACgC,CAAC"}
|
package/src/utils/motion.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Motion guard. All component animations honor:
|
|
3
|
-
* 1. --roxy-motion-duration CSS variable (set to 0ms to disable)
|
|
4
|
-
* 2. prefers-reduced-motion: reduce media query (forces 0ms regardless)
|
|
5
|
-
*
|
|
6
|
-
* Components apply transitions and entry animations using the duration var
|
|
7
|
-
* directly. The reduced-motion override is enforced at the tokens.css layer.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export function prefersReducedMotion(): boolean {
|
|
11
|
-
if (typeof window === 'undefined' || !window.matchMedia) return false;
|
|
12
|
-
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** CSS snippet that components paste into their styles to read the motion duration. */
|
|
16
|
-
export const MOTION_DURATION = 'var(--roxy-motion-duration, 200ms)';
|
|
17
|
-
export const MOTION_EASING =
|
|
18
|
-
'var(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1))';
|