@roxyapi/ui 0.40.0 → 0.40.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.
Files changed (63) hide show
  1. package/components-catalog.json +149 -149
  2. package/dist/cdn/components/endpoint-form.js +1 -1
  3. package/dist/cdn/components/endpoint-form.js.map +1 -1
  4. package/dist/cdn/components/horoscope-card.js +3 -3
  5. package/dist/cdn/components/horoscope-card.js.map +3 -3
  6. package/dist/cdn/locales/de.js +1 -1
  7. package/dist/cdn/locales/de.js.map +2 -2
  8. package/dist/cdn/locales/es.js +1 -1
  9. package/dist/cdn/locales/es.js.map +2 -2
  10. package/dist/cdn/locales/fr.js +1 -1
  11. package/dist/cdn/locales/fr.js.map +2 -2
  12. package/dist/cdn/locales/hi.js +1 -1
  13. package/dist/cdn/locales/hi.js.map +2 -2
  14. package/dist/cdn/locales/pt.js +1 -1
  15. package/dist/cdn/locales/pt.js.map +2 -2
  16. package/dist/cdn/locales/ru.js +1 -1
  17. package/dist/cdn/locales/ru.js.map +2 -2
  18. package/dist/cdn/locales/tr.js +1 -1
  19. package/dist/cdn/locales/tr.js.map +2 -2
  20. package/dist/cdn/roxy-ui.js +16 -16
  21. package/dist/cdn/roxy-ui.js.map +3 -3
  22. package/dist/components/endpoint-form.js +1 -1
  23. package/dist/components/endpoint-form.js.map +1 -1
  24. package/dist/components/horoscope-card.d.ts +10 -0
  25. package/dist/components/horoscope-card.d.ts.map +1 -1
  26. package/dist/components/horoscope-card.js +1 -1
  27. package/dist/components/horoscope-card.js.map +3 -3
  28. package/dist/index.cjs +14 -14
  29. package/dist/index.cjs.map +3 -3
  30. package/dist/index.js +15 -15
  31. package/dist/index.js.map +3 -3
  32. package/dist/locales/de.js +1 -1
  33. package/dist/locales/de.js.map +2 -2
  34. package/dist/locales/es.js +1 -1
  35. package/dist/locales/es.js.map +2 -2
  36. package/dist/locales/fr.js +1 -1
  37. package/dist/locales/fr.js.map +2 -2
  38. package/dist/locales/hi.js +1 -1
  39. package/dist/locales/hi.js.map +2 -2
  40. package/dist/locales/pt.js +1 -1
  41. package/dist/locales/pt.js.map +2 -2
  42. package/dist/locales/ru.js +1 -1
  43. package/dist/locales/ru.js.map +2 -2
  44. package/dist/locales/tr.js +1 -1
  45. package/dist/locales/tr.js.map +2 -2
  46. package/dist/schemas/post--vedic-astrology-kp-rasi-changes.json +1 -1
  47. package/dist/schemas/post--vedic-astrology-kp-sublord-changes.json +1 -1
  48. package/dist/styles/themes/practitioner.css +5 -5
  49. package/dist/types/types.gen.d.ts +56 -160
  50. package/dist/types/types.gen.d.ts.map +1 -1
  51. package/dist/version.d.ts +1 -1
  52. package/package.json +1 -1
  53. package/src/components/horoscope-card.ts +79 -61
  54. package/src/locales/field-labels/de.ts +2 -0
  55. package/src/locales/field-labels/es.ts +2 -0
  56. package/src/locales/field-labels/fr.ts +2 -0
  57. package/src/locales/field-labels/hi.ts +2 -0
  58. package/src/locales/field-labels/pt.ts +2 -0
  59. package/src/locales/field-labels/ru.ts +2 -0
  60. package/src/locales/field-labels/tr.ts +2 -0
  61. package/src/styles/themes/practitioner.css +5 -5
  62. package/src/types/types.gen.ts +56 -160
  63. package/src/version.ts +1 -1
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const ROXY_UI_VERSION = "0.40.0";
1
+ export declare const ROXY_UI_VERSION = "0.40.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roxyapi/ui",
3
- "version": "0.40.0",
3
+ "version": "0.40.1",
4
4
  "description": "Web components for the RoxyAPI catalog. Drop-in charts, tables, cards, forms for astrology, tarot, numerology, biorhythm, I Ching, crystals, dreams, angel numbers, and more. One key, beautiful in 30 minutes.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -60,6 +60,24 @@ const EVENT_TYPE_LABEL: Record<SkyEventType, ChromeString> = {
60
60
  'solar-season': 'Solar season',
61
61
  };
62
62
 
63
+ /**
64
+ * The five topic fields that follow the standfirst, in the order the endpoint documents them.
65
+ *
66
+ * @remarks
67
+ * Typed against the daily response so a field renamed upstream fails to compile here, and typed
68
+ * {@link ChromeString} so the compiler is what proves each heading is catalogued. `overview` is
69
+ * deliberately absent: it is the standfirst the other five run under, not a sixth peer.
70
+ */
71
+ const SECTION_FIELDS = [
72
+ ['love', 'Love'],
73
+ ['career', 'Career'],
74
+ ['health', 'Health'],
75
+ ['finance', 'Finance'],
76
+ ['advice', 'Advice'],
77
+ ] as const satisfies ReadonlyArray<
78
+ readonly [keyof GetDailyHoroscopeResponse, ChromeString]
79
+ >;
80
+
63
81
  /** The four life areas `bestPeriods` names a month for, in the order the sections above use. */
64
82
  const BEST_AREAS = [
65
83
  ['love', 'Love'],
@@ -164,20 +182,46 @@ export class RoxyHoroscopeCard extends RoxyDataElement<HoroscopeData> {
164
182
  var(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1));
165
183
  }
166
184
 
185
+ /* Every written field reads start to finish rather than being scanned, so
186
+ * all three shapes take the same wider leading and the same paragraph
187
+ * break; only the size differs. */
188
+ .column p,
189
+ .overview p,
190
+ .section p {
191
+ margin: 0;
192
+ line-height: 1.7;
193
+ color: var(--roxy-fg, #0a0a0a);
194
+ }
195
+
196
+ /* The standfirst over the topic sections: one size up from them and
197
+ * spanning the whole card, the way a magazine runs a standfirst across
198
+ * the columns it introduces. */
167
199
  .overview {
200
+ display: grid;
201
+ gap: var(--roxy-space-sm, 0.5rem);
202
+ }
203
+ .overview p {
168
204
  font-size: var(--roxy-text-base, 1rem);
169
- color: var(--roxy-fg, #0a0a0a);
170
- margin: 0;
171
205
  }
172
206
 
207
+ /* Each topic field is a column of prose rather than a phrase, so the
208
+ * track floor is the narrowest one that still holds a readable line at
209
+ * this size: a 250 word section takes about 24 lines in the track this
210
+ * floor produces. The min() keeps the layout on a single column once
211
+ * the card itself is narrower than the floor. */
173
212
  .sections {
174
213
  display: grid;
175
- grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
176
- gap: var(--roxy-space-md, 1rem);
214
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
215
+ gap: var(--roxy-space-lg, 1.5rem) var(--roxy-space-md, 1rem);
177
216
  }
178
217
 
218
+ .section {
219
+ display: grid;
220
+ align-content: start;
221
+ gap: var(--roxy-space-sm, 0.5rem);
222
+ }
179
223
  .section h3 {
180
- margin: 0 0 var(--roxy-space-xs, 0.25rem) 0;
224
+ margin: 0;
181
225
  font-size: var(--roxy-text-xs, 0.75rem);
182
226
  color: var(--roxy-muted, #71717a);
183
227
  font-weight: var(--roxy-weight-bold, 600);
@@ -185,9 +229,7 @@ export class RoxyHoroscopeCard extends RoxyDataElement<HoroscopeData> {
185
229
  letter-spacing: 0.06em;
186
230
  }
187
231
  .section p {
188
- margin: 0;
189
232
  font-size: var(--roxy-text-sm, 0.875rem);
190
- color: var(--roxy-fg, #0a0a0a);
191
233
  }
192
234
 
193
235
  .lucky {
@@ -346,18 +388,13 @@ export class RoxyHoroscopeCard extends RoxyDataElement<HoroscopeData> {
346
388
  color: var(--roxy-fg, #0a0a0a);
347
389
  }
348
390
 
349
- /* The column: the same reading as the topic sections, run as one piece.
350
- * Wider leading than the sections, because it is read start to finish
351
- * rather than scanned. */
391
+ /* The column: the same reading as the topic sections, run as one piece. */
352
392
  .column {
353
393
  display: grid;
354
394
  gap: var(--roxy-space-md, 1rem);
355
395
  }
356
396
  .column p {
357
- margin: 0;
358
397
  font-size: var(--roxy-text-base, 1rem);
359
- line-height: 1.7;
360
- color: var(--roxy-fg, #0a0a0a);
361
398
  }
362
399
 
363
400
  /* One row shape for the events trail and the four yearly lists, so a
@@ -605,65 +642,46 @@ export class RoxyHoroscopeCard extends RoxyDataElement<HoroscopeData> {
605
642
  if (asColumn) {
606
643
  return d.column ? this.renderColumn(d.column) : nothing;
607
644
  }
645
+ const overview = this.paragraphs(d.overview);
608
646
  return html`${
609
- d.overview
610
- ? html`<p class="overview" part="section overview">${d.overview}</p>`
647
+ overview.length
648
+ ? html`<div class="overview" part="section overview">${overview}</div>`
611
649
  : nothing
612
650
  }
613
651
  <div class="sections" part="section outlook">
614
- ${
615
- d.love
616
- ? html`<div class="section">
617
- <h3>${this.t('Love')}</h3>
618
- <p>${d.love}</p>
619
- </div>`
620
- : nothing
621
- }
622
- ${
623
- d.career
624
- ? html`<div class="section">
625
- <h3>${this.t('Career')}</h3>
626
- <p>${d.career}</p>
627
- </div>`
628
- : nothing
629
- }
630
- ${
631
- d.health
632
- ? html`<div class="section">
633
- <h3>${this.t('Health')}</h3>
634
- <p>${d.health}</p>
635
- </div>`
636
- : nothing
637
- }
638
- ${
639
- d.finance
640
- ? html`<div class="section">
641
- <h3>${this.t('Finance')}</h3>
642
- <p>${d.finance}</p>
643
- </div>`
644
- : nothing
645
- }
646
- ${
647
- d.advice
648
- ? html`<div class="section">
649
- <h3>${this.t('Advice')}</h3>
650
- <p>${d.advice}</p>
651
- </div>`
652
- : nothing
653
- }
652
+ ${SECTION_FIELDS.map(([key, label]) => {
653
+ const paragraphs = this.paragraphs(d[key]);
654
+ if (!paragraphs.length) return nothing;
655
+ return html`<div class="section">
656
+ <h3>${this.t(label)}</h3>
657
+ ${paragraphs}
658
+ </div>`;
659
+ })}
654
660
  </div>`;
655
661
  }
656
662
 
657
663
  /** The column as the API set it: one paragraph per blank-line break, never one wall of text. */
658
664
  private renderColumn(column: string) {
659
- const paragraphs = column
665
+ const paragraphs = this.paragraphs(column);
666
+ if (paragraphs.length === 0) return nothing;
667
+ return html`<div class="column" part="section column">${paragraphs}</div>`;
668
+ }
669
+
670
+ /**
671
+ * A written field as the paragraphs the API set in it.
672
+ *
673
+ * @remarks
674
+ * Every long field separates its paragraphs with a blank line, and a blank line inside a text
675
+ * node collapses to a single space, so a field rendered as one node loses every break the
676
+ * editor made. The column and each topic section are the same reading split two ways, so both
677
+ * go through here rather than the column alone.
678
+ */
679
+ private paragraphs(text: string | undefined) {
680
+ return (text ?? '')
660
681
  .split(/\n\s*\n/)
661
682
  .map((p) => p.trim())
662
- .filter(Boolean);
663
- if (paragraphs.length === 0) return nothing;
664
- return html`<div class="column" part="section column">
665
- ${paragraphs.map((p) => html`<p>${p}</p>`)}
666
- </div>`;
683
+ .filter(Boolean)
684
+ .map((p) => html`<p>${p}</p>`);
667
685
  }
668
686
 
669
687
  /**
@@ -247,7 +247,9 @@ registerFieldLabels('de', {
247
247
  'planet.Jupiter': 'Jupiter',
248
248
  'planet.Mars': 'Mars',
249
249
  'planet.Mercury': 'Merkur',
250
+ 'planet.Moon': 'Mond',
250
251
  'planet.Saturn': 'Saturn',
252
+ 'planet.Sun': 'Sonne',
251
253
  'planet.Venus': 'Venus',
252
254
  'scheme.eight': 'Acht Karakas',
253
255
  'scheme.seven': 'Sieben Karakas',
@@ -246,7 +246,9 @@ registerFieldLabels('es', {
246
246
  'planet.Jupiter': 'Júpiter',
247
247
  'planet.Mars': 'Marte',
248
248
  'planet.Mercury': 'Mercurio',
249
+ 'planet.Moon': 'Luna',
249
250
  'planet.Saturn': 'Saturno',
251
+ 'planet.Sun': 'Sol',
250
252
  'planet.Venus': 'Venus',
251
253
  'scheme.eight': 'Ocho karakas',
252
254
  'scheme.seven': 'Siete karakas',
@@ -246,7 +246,9 @@ registerFieldLabels('fr', {
246
246
  'planet.Jupiter': 'Jupiter',
247
247
  'planet.Mars': 'Mars',
248
248
  'planet.Mercury': 'Mercure',
249
+ 'planet.Moon': 'Lune',
249
250
  'planet.Saturn': 'Saturne',
251
+ 'planet.Sun': 'Soleil',
250
252
  'planet.Venus': 'Vénus',
251
253
  'scheme.eight': 'Huit karakas',
252
254
  'scheme.seven': 'Sept karakas',
@@ -246,7 +246,9 @@ registerFieldLabels('hi', {
246
246
  'planet.Jupiter': 'बृहस्पति',
247
247
  'planet.Mars': 'मंगल',
248
248
  'planet.Mercury': 'बुध',
249
+ 'planet.Moon': 'चंद्रमा',
249
250
  'planet.Saturn': 'शनि',
251
+ 'planet.Sun': 'सूर्य',
250
252
  'planet.Venus': 'शुक्र',
251
253
  'scheme.eight': 'आठ कारक',
252
254
  'scheme.seven': 'सात कारक',
@@ -246,7 +246,9 @@ registerFieldLabels('pt', {
246
246
  'planet.Jupiter': 'Júpiter',
247
247
  'planet.Mars': 'Marte',
248
248
  'planet.Mercury': 'Mercúrio',
249
+ 'planet.Moon': 'Lua',
249
250
  'planet.Saturn': 'Saturno',
251
+ 'planet.Sun': 'Sol',
250
252
  'planet.Venus': 'Vênus',
251
253
  'scheme.eight': 'Oito karakas',
252
254
  'scheme.seven': 'Sete karakas',
@@ -247,7 +247,9 @@ registerFieldLabels('ru', {
247
247
  'planet.Jupiter': 'Юпитер',
248
248
  'planet.Mars': 'Марс',
249
249
  'planet.Mercury': 'Меркурий',
250
+ 'planet.Moon': 'Луна',
250
251
  'planet.Saturn': 'Сатурн',
252
+ 'planet.Sun': 'Солнце',
251
253
  'planet.Venus': 'Венера',
252
254
  'scheme.eight': 'Восемь карак',
253
255
  'scheme.seven': 'Семь карак',
@@ -247,7 +247,9 @@ registerFieldLabels('tr', {
247
247
  'planet.Jupiter': 'Jüpiter',
248
248
  'planet.Mars': 'Mars',
249
249
  'planet.Mercury': 'Merkür',
250
+ 'planet.Moon': 'Ay',
250
251
  'planet.Saturn': 'Satürn',
252
+ 'planet.Sun': 'Güneş',
251
253
  'planet.Venus': 'Venüs',
252
254
  'scheme.eight': 'Eight karakas',
253
255
  'scheme.seven': 'Seven karakas',
@@ -27,7 +27,7 @@
27
27
  font-style: normal;
28
28
  font-weight: 400 600;
29
29
  font-display: swap;
30
- src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.0/dist/styles/fonts/fraunces/fraunces-latin.woff2")
30
+ src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.1/dist/styles/fonts/fraunces/fraunces-latin.woff2")
31
31
  format("woff2");
32
32
  unicode-range:
33
33
  U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
@@ -38,7 +38,7 @@
38
38
  font-style: normal;
39
39
  font-weight: 400 600;
40
40
  font-display: swap;
41
- src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.0/dist/styles/fonts/fraunces/fraunces-latin-ext.woff2")
41
+ src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.1/dist/styles/fonts/fraunces/fraunces-latin-ext.woff2")
42
42
  format("woff2");
43
43
  unicode-range:
44
44
  U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
@@ -49,7 +49,7 @@
49
49
  font-style: normal;
50
50
  font-weight: 400 600;
51
51
  font-display: swap;
52
- src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.0/dist/styles/fonts/jost/jost-latin.woff2")
52
+ src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.1/dist/styles/fonts/jost/jost-latin.woff2")
53
53
  format("woff2");
54
54
  unicode-range:
55
55
  U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
@@ -60,7 +60,7 @@
60
60
  font-style: normal;
61
61
  font-weight: 400 600;
62
62
  font-display: swap;
63
- src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.0/dist/styles/fonts/jost/jost-latin-ext.woff2")
63
+ src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.1/dist/styles/fonts/jost/jost-latin-ext.woff2")
64
64
  format("woff2");
65
65
  unicode-range:
66
66
  U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
@@ -71,7 +71,7 @@
71
71
  font-style: normal;
72
72
  font-weight: 400 600;
73
73
  font-display: swap;
74
- src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.0/dist/styles/fonts/jost/jost-cyrillic.woff2")
74
+ src: url("https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.40.1/dist/styles/fonts/jost/jost-cyrillic.woff2")
75
75
  format("woff2");
76
76
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
77
77
  }