@circadian/sol 0.2.8 → 0.2.10
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 +185 -3
- package/dist/devtools/index.js +1 -1
- package/dist/index.d.ts +129 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1050 -4
- package/dist/index.js.map +1 -1
- package/dist/{solar-theme-provider-6-EJ4jGB.js → solar-theme-provider-BcP2n4b7.js} +299 -12
- package/dist/solar-theme-provider-BcP2n4b7.js.map +1 -0
- package/package.json +1 -1
- package/dist/solar-theme-provider-6-EJ4jGB.js.map +0 -1
package/README.md
CHANGED
|
@@ -45,6 +45,8 @@ Sol is the flagship package from [Circadian](https://circadian.dev) — a platfo
|
|
|
45
45
|
bun add @circadian/sol
|
|
46
46
|
# or
|
|
47
47
|
npm install @circadian/sol
|
|
48
|
+
# or (Deno / Fresh)
|
|
49
|
+
deno add npm:@circadian/sol
|
|
48
50
|
```
|
|
49
51
|
|
|
50
52
|
`@circadian/sol` gives you a full `SolarWidget`, a `CompactWidget`, 10 skins, 9 solar phases, optional live weather, optional flag display, and a dev-only timeline scrubber via `SolarDevTools`. Solar position is computed locally from latitude, longitude, timezone, and current time — no solar API required.
|
|
@@ -56,10 +58,11 @@ npm install @circadian/sol
|
|
|
56
58
|
- **2 widget variants** — `SolarWidget` (full card) and `CompactWidget` (slim pill/bar)
|
|
57
59
|
- **10 skins** — `foundry`, `paper`, `signal`, `meridian`, `mineral`, `aurora`, `tide`, `void`, `sundial`, `parchment`
|
|
58
60
|
- **9 solar phases** — `midnight`, `night`, `dawn`, `sunrise`, `morning`, `solar-noon`, `afternoon`, `sunset`, `dusk`
|
|
61
|
+
- **4 seasons** — automatic seasonal palette blending computed from date + hemisphere, with smooth crossfades at solstice/equinox boundaries
|
|
59
62
|
- **Built-in fallback strategy** — geolocation → browser timezone → timezone centroid
|
|
60
63
|
- **Optional live weather** — powered by Open-Meteo (no API key required)
|
|
61
64
|
- **Dev preview tooling** — `SolarDevTools` lets you scrub through the day and preview phase colors
|
|
62
|
-
- **SSR-safe** — works in Next.js, Remix, TanStack Start, Blade, and Vite
|
|
65
|
+
- **SSR-safe** — works in Next.js, Remix, TanStack Start, Blade, Fresh, and Vite
|
|
63
66
|
|
|
64
67
|
---
|
|
65
68
|
|
|
@@ -285,6 +288,80 @@ export default function Page() {
|
|
|
285
288
|
|
|
286
289
|
---
|
|
287
290
|
|
|
291
|
+
### Fresh (v2)
|
|
292
|
+
|
|
293
|
+
Fresh uses Preact, so Sol works via `preact/compat`. Add the React compatibility aliases to your `vite.config.ts` and `deno.json`, then create an [island](https://fresh.deno.dev/docs/concepts/islands) for the widget.
|
|
294
|
+
|
|
295
|
+
**1. Install**
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
deno add npm:@circadian/sol
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**2. Configure Vite aliases** — add `resolve.alias` to `vite.config.ts`:
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
// vite.config.ts
|
|
305
|
+
import { defineConfig } from "vite";
|
|
306
|
+
import { fresh } from "@fresh/plugin-vite";
|
|
307
|
+
|
|
308
|
+
export default defineConfig({
|
|
309
|
+
plugins: [fresh()],
|
|
310
|
+
resolve: {
|
|
311
|
+
alias: {
|
|
312
|
+
"react": "preact/compat",
|
|
313
|
+
"react-dom": "preact/compat",
|
|
314
|
+
"react/jsx-runtime": "preact/jsx-runtime",
|
|
315
|
+
"react/jsx-dev-runtime": "preact/jsx-runtime",
|
|
316
|
+
"react-dom/client": "preact/compat/client",
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**3. Add import map entries** — add to the `"imports"` in `deno.json`:
|
|
323
|
+
|
|
324
|
+
```jsonc
|
|
325
|
+
// deno.json (imports section)
|
|
326
|
+
{
|
|
327
|
+
"imports": {
|
|
328
|
+
"react": "npm:preact@^10.27.2/compat",
|
|
329
|
+
"react-dom": "npm:preact@^10.27.2/compat",
|
|
330
|
+
"react/jsx-runtime": "npm:preact@^10.27.2/jsx-runtime",
|
|
331
|
+
"react-dom/client": "npm:preact@^10.27.2/compat/client"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**4. Create an island** — islands are client-hydrated in Fresh, which is what Sol needs:
|
|
337
|
+
|
|
338
|
+
```tsx
|
|
339
|
+
// islands/SolWidget.tsx
|
|
340
|
+
import { SolarThemeProvider, SolarWidget } from '@circadian/sol';
|
|
341
|
+
|
|
342
|
+
export default function SolWidget() {
|
|
343
|
+
return (
|
|
344
|
+
<SolarThemeProvider initialDesign="foundry">
|
|
345
|
+
<SolarWidget showWeather showFlag />
|
|
346
|
+
</SolarThemeProvider>
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**5. Use it in a route:**
|
|
352
|
+
|
|
353
|
+
```tsx
|
|
354
|
+
// routes/index.tsx
|
|
355
|
+
import { define } from "../utils.ts";
|
|
356
|
+
import SolWidget from "../islands/SolWidget.tsx";
|
|
357
|
+
|
|
358
|
+
export default define.page(function Home() {
|
|
359
|
+
return <SolWidget />;
|
|
360
|
+
});
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
288
365
|
## Provider Props
|
|
289
366
|
|
|
290
367
|
`SolarThemeProvider` is the shared runtime for solar phase computation, timezone, coordinates, and skin selection.
|
|
@@ -461,6 +538,105 @@ Each `bg` is a 3-stop gradient: `[top, middle, bottom]`. Only the phases you spe
|
|
|
461
538
|
|
|
462
539
|
---
|
|
463
540
|
|
|
541
|
+
## Seasonal Blending
|
|
542
|
+
|
|
543
|
+
Sol automatically adjusts every skin's palette based on the current astronomical season. Spring shifts greener and brighter, summer pushes warm and saturated, autumn mutes toward amber, winter desaturates toward icy blue. The effect is subtle by design — visible but never harsh.
|
|
544
|
+
|
|
545
|
+
Season is computed from the current date and the user's latitude (southern hemisphere seasons are flipped). Near each solstice and equinox, a smooth 14-day crossfade blends between adjacent seasons.
|
|
546
|
+
|
|
547
|
+
**Zero config — it just works:**
|
|
548
|
+
|
|
549
|
+
```tsx
|
|
550
|
+
<SolarThemeProvider initialDesign="foundry">
|
|
551
|
+
<SolarWidget showWeather showFlag />
|
|
552
|
+
</SolarThemeProvider>
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
**Force a season:**
|
|
556
|
+
|
|
557
|
+
```tsx
|
|
558
|
+
<SolarThemeProvider initialDesign="foundry" seasonOverride="autumn">
|
|
559
|
+
<SolarWidget showWeather showFlag />
|
|
560
|
+
</SolarThemeProvider>
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
**Disable seasonal blending entirely:**
|
|
564
|
+
|
|
565
|
+
```tsx
|
|
566
|
+
<SolarThemeProvider initialDesign="foundry" disableSeasonalBlend>
|
|
567
|
+
<SolarWidget showWeather showFlag />
|
|
568
|
+
</SolarThemeProvider>
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
**Read the current season in your own components:**
|
|
572
|
+
|
|
573
|
+
```tsx
|
|
574
|
+
import { useSolarTheme } from '@circadian/sol';
|
|
575
|
+
|
|
576
|
+
function SeasonBadge() {
|
|
577
|
+
const { season } = useSolarTheme();
|
|
578
|
+
return <span>{season}</span>; // 'spring' | 'summer' | 'autumn' | 'winter'
|
|
579
|
+
}
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
### How it works
|
|
583
|
+
|
|
584
|
+
Rather than defining 36 full palettes (9 phases × 4 seasons), each skin only needs 4 small seasonal modifier objects that describe _deltas_ — saturation scale, lightness shift, hue rotation, and an optional tint wash. The final palette is computed as:
|
|
585
|
+
|
|
586
|
+
```
|
|
587
|
+
rawPalette = lerp(phasePalette, nextPhasePalette, phaseT)
|
|
588
|
+
seasonalMod = lerp(seasonModifier, nextSeasonModifier, seasonT)
|
|
589
|
+
finalPalette = applySeasonalModifier(rawPalette, seasonalMod)
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
### Custom skin seasonal modifiers
|
|
593
|
+
|
|
594
|
+
Skins can define their own per-season modifiers. Any season not defined falls back to the built-in universal defaults.
|
|
595
|
+
|
|
596
|
+
```ts
|
|
597
|
+
import type { SkinDefinition } from '@circadian/sol';
|
|
598
|
+
|
|
599
|
+
const mySkin: SkinDefinition = {
|
|
600
|
+
// ... existing skin definition ...
|
|
601
|
+
seasonalModifiers: {
|
|
602
|
+
autumn: {
|
|
603
|
+
saturationScale: 0.85, // slightly muted
|
|
604
|
+
lightnessShift: -0.05, // darker
|
|
605
|
+
hueRotateDeg: -22, // shift toward amber
|
|
606
|
+
tintColor: '#b85c1a',
|
|
607
|
+
tintStrength: 0.12,
|
|
608
|
+
},
|
|
609
|
+
winter: {
|
|
610
|
+
saturationScale: 0.78,
|
|
611
|
+
lightnessShift: -0.06,
|
|
612
|
+
hueRotateDeg: -30,
|
|
613
|
+
tintColor: '#6a9fc0',
|
|
614
|
+
tintStrength: 0.09,
|
|
615
|
+
},
|
|
616
|
+
// spring and summer use UNIVERSAL_SEASON_MODIFIERS automatically
|
|
617
|
+
},
|
|
618
|
+
};
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
### SeasonalModifier shape
|
|
622
|
+
|
|
623
|
+
| Field | Type | Description |
|
|
624
|
+
|---|---|---|
|
|
625
|
+
| `saturationScale` | `number` | Multiply saturation. `1.0` = unchanged, `1.2` = +20% |
|
|
626
|
+
| `lightnessShift` | `number` | Add to lightness. `-0.05` = slightly darker |
|
|
627
|
+
| `hueRotateDeg` | `number` | Rotate hue in degrees. `+15` = warmer, `-15` = cooler |
|
|
628
|
+
| `tintColor` | `string?` | Optional hex color to blend toward |
|
|
629
|
+
| `tintStrength` | `number` | `0–1`. How strongly to apply tintColor |
|
|
630
|
+
|
|
631
|
+
### Provider props
|
|
632
|
+
|
|
633
|
+
| Prop | Type | Default | Description |
|
|
634
|
+
|---|---|---|---|
|
|
635
|
+
| `seasonOverride` | `Season` | — | Force a specific season (`'spring'` \| `'summer'` \| `'autumn'` \| `'winter'`) |
|
|
636
|
+
| `disableSeasonalBlend` | `boolean` | `false` | Opt out of seasonal palette blending entirely |
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
464
640
|
## SolarDevTools
|
|
465
641
|
|
|
466
642
|
When your interface depends on live solar time, manual testing breaks down fast — you can't wait until sunset to test sunset. `SolarDevTools` lets you scrub through the full day in seconds, preview every one of the **9 phases**, test every skin against every time of day, and catch phase-specific visual bugs before your users do.
|
|
@@ -536,6 +712,9 @@ function DebugPanel() {
|
|
|
536
712
|
| `activeSkin` | `SkinDefinition` | Full skin definition object |
|
|
537
713
|
| `setOverridePhase` | `(phase \| null) => void` | Set/clear phase override |
|
|
538
714
|
| `setDesign` | `(skin: DesignMode) => void` | Change active skin |
|
|
715
|
+
| `season` | `Season` | Current dominant season |
|
|
716
|
+
| `seasonalBlend` | `SeasonalBlend` | Season blend state (season, nextSeason, t) |
|
|
717
|
+
| `setSeasonOverride` | `(season \| null) => void` | Set/clear season override |
|
|
539
718
|
|
|
540
719
|
---
|
|
541
720
|
|
|
@@ -568,6 +747,9 @@ import type {
|
|
|
568
747
|
WidgetPalette,
|
|
569
748
|
CustomPalettes,
|
|
570
749
|
SolarTheme,
|
|
750
|
+
Season,
|
|
751
|
+
SeasonalBlend,
|
|
752
|
+
SeasonalModifier,
|
|
571
753
|
} from '@circadian/sol';
|
|
572
754
|
```
|
|
573
755
|
|
|
@@ -579,13 +761,14 @@ import type {
|
|
|
579
761
|
|---|---|
|
|
580
762
|
| ✅ | Full widget + compact widget |
|
|
581
763
|
| ✅ | 10 skins with full + compact variants |
|
|
764
|
+
| ✅ | Automatic seasonal palette blending (4 seasons) |
|
|
582
765
|
| ✅ | Solar math (NOAA equations, no external API) |
|
|
583
766
|
| ✅ | Timezone fallback logic |
|
|
584
767
|
| ✅ | Optional live weather (Open-Meteo) |
|
|
585
768
|
| ✅ | Skin-aware country flags |
|
|
586
769
|
| ✅ | Dev timeline scrubber |
|
|
587
770
|
| ✅ | Self-contained CSS (no Tailwind required in host app) |
|
|
588
|
-
| ✅ | SSR-safe (Next.js, Remix, TanStack Start, Blade, Vite) |
|
|
771
|
+
| ✅ | SSR-safe (Next.js, Remix, TanStack Start, Blade, Fresh, Vite) |
|
|
589
772
|
| ❌ | No solar API key needed |
|
|
590
773
|
| ❌ | No weather API key needed |
|
|
591
774
|
| ❌ | No Tailwind needed in your app |
|
|
@@ -597,7 +780,6 @@ import type {
|
|
|
597
780
|
|
|
598
781
|
Sol is actively being developed. Things in progress:
|
|
599
782
|
|
|
600
|
-
- **Seasonal theme system** — 4 seasons (Summer, Autumn, Winter, Spring) that blend automatically with the existing 9-phase system, computed from date and location with no configuration required
|
|
601
783
|
- More skins
|
|
602
784
|
- Vue and Svelte adapters
|
|
603
785
|
- Deep token override system
|
package/dist/devtools/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as getSessionTimeMinutes, l as setSessionLive, n as useSolarTheme, o as clearSessionTimeMinutes, s as getSessionIsLive, u as setSessionTimeMinutes } from "../solar-theme-provider-BcP2n4b7.js";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { createPortal } from "react-dom";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/hooks/useSolarPosition.d.ts
|
|
5
5
|
|
|
@@ -48,6 +48,85 @@ interface SolarBlend {
|
|
|
48
48
|
t: number;
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
|
+
//#region src/lib/useSeason.d.ts
|
|
52
|
+
type Season = 'spring' | 'summer' | 'autumn' | 'winter';
|
|
53
|
+
interface SeasonalBlend {
|
|
54
|
+
/** The current dominant season. */
|
|
55
|
+
season: Season;
|
|
56
|
+
/** The season being crossfaded toward (equals season outside transition windows). */
|
|
57
|
+
nextSeason: Season;
|
|
58
|
+
/**
|
|
59
|
+
* 0–1 interpolation between season → nextSeason.
|
|
60
|
+
* 0.0 = fully current season, 1.0 = fully next season.
|
|
61
|
+
* Non-zero only within the final CROSSFADE_DAYS before a solstice/equinox.
|
|
62
|
+
*/
|
|
63
|
+
t: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Pure function — compute the SeasonalBlend for a given date and latitude.
|
|
67
|
+
*
|
|
68
|
+
* @param date The date to evaluate (default: now)
|
|
69
|
+
* @param latitudeN Decimal degrees, positive = north (default: 0)
|
|
70
|
+
* @param override Force a fixed season, bypassing computation
|
|
71
|
+
*/
|
|
72
|
+
declare function getSeasonalBlend(date?: Date, latitudeN?: number, override?: Season): SeasonalBlend;
|
|
73
|
+
/**
|
|
74
|
+
* Hook — returns the current SeasonalBlend, re-evaluated once per hour.
|
|
75
|
+
*
|
|
76
|
+
* @param latitudeN Decimal degrees, positive = north.
|
|
77
|
+
* Pass null while coordinates are still loading.
|
|
78
|
+
* @param override Force a specific season (for dev previews / user settings).
|
|
79
|
+
* @param simulatedDate Use a specific date instead of now (for SolarDevTools).
|
|
80
|
+
*/
|
|
81
|
+
declare function useSeason(latitudeN: number | null, override?: Season, simulatedDate?: Date): SeasonalBlend;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/lib/seasonal-blend.d.ts
|
|
84
|
+
/**
|
|
85
|
+
* Describes how a season shifts the phase palette.
|
|
86
|
+
* All fields are deltas/scales applied on top of the base palette.
|
|
87
|
+
* Using HSL math under the hood — no full palette replacement needed.
|
|
88
|
+
*/
|
|
89
|
+
interface SeasonalModifier {
|
|
90
|
+
/** Multiply saturation. 1.0 = unchanged, 1.2 = +20%, 0.8 = −20%. */
|
|
91
|
+
saturationScale: number;
|
|
92
|
+
/** Add to lightness (−1.0 to +1.0). −0.05 = slightly darker. */
|
|
93
|
+
lightnessShift: number;
|
|
94
|
+
/** Rotate hue by degrees. 0 = unchanged, +15 = warmer, −15 = cooler. */
|
|
95
|
+
hueRotateDeg: number;
|
|
96
|
+
/**
|
|
97
|
+
* Optional hex color to tint toward. Applied at tintStrength opacity
|
|
98
|
+
* over the entire palette. Useful for strong seasonal washes
|
|
99
|
+
* (e.g., amber-gold for autumn) that go beyond simple HSL shifts.
|
|
100
|
+
*/
|
|
101
|
+
tintColor?: string;
|
|
102
|
+
/** 0–1. How strongly to apply tintColor. 0 = no tint. */
|
|
103
|
+
tintStrength: number;
|
|
104
|
+
}
|
|
105
|
+
declare const IDENTITY_MODIFIER: SeasonalModifier;
|
|
106
|
+
declare const UNIVERSAL_SEASON_MODIFIERS: Record<Season, SeasonalModifier>;
|
|
107
|
+
/**
|
|
108
|
+
* Linearly interpolate between two SeasonalModifiers.
|
|
109
|
+
* Used for smooth crossfades at solstice/equinox boundaries.
|
|
110
|
+
*/
|
|
111
|
+
declare function lerpModifier(a: SeasonalModifier, b: SeasonalModifier, t: number): SeasonalModifier;
|
|
112
|
+
/**
|
|
113
|
+
* Apply a SeasonalModifier to every color in a ShaderPalette.
|
|
114
|
+
* Returns a new palette — the original is not mutated.
|
|
115
|
+
*
|
|
116
|
+
* The modifier shifts hue, saturation, and lightness then applies a tint wash.
|
|
117
|
+
* The result is blended back toward the original at `strength` 0→1:
|
|
118
|
+
* 0 = identity, 1 = fully modified.
|
|
119
|
+
*/
|
|
120
|
+
declare function applySeasonalModifier(palette: ShaderPalette, mod: SeasonalModifier, strength?: number): ShaderPalette;
|
|
121
|
+
/**
|
|
122
|
+
* Given a SeasonalBlend and a modifier map, return the interpolated modifier
|
|
123
|
+
* ready to pass to applySeasonalModifier.
|
|
124
|
+
*
|
|
125
|
+
* @param blend The SeasonalBlend from useSeason()
|
|
126
|
+
* @param modifiers Per-season modifier map (skin's or universal default)
|
|
127
|
+
*/
|
|
128
|
+
declare function resolveSeasonalModifier(blend: SeasonalBlend, modifiers?: Record<Season, SeasonalModifier>): SeasonalModifier;
|
|
129
|
+
//#endregion
|
|
51
130
|
//#region src/widgets/solar-widget.shell.d.ts
|
|
52
131
|
type ExpandDirection = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
53
132
|
type WidgetSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -82,7 +161,7 @@ declare function SolarWidget({
|
|
|
82
161
|
weatherCategoryOverride,
|
|
83
162
|
simulatedDate: simulatedDateProp,
|
|
84
163
|
forceExpanded
|
|
85
|
-
}: SolarWidgetProps):
|
|
164
|
+
}: SolarWidgetProps): react_jsx_runtime4.JSX.Element;
|
|
86
165
|
//#endregion
|
|
87
166
|
//#region src/widgets/compact-widget.shell.d.ts
|
|
88
167
|
type WeatherCategory$1 = 'clear' | 'partly-cloudy' | 'overcast' | 'fog' | 'drizzle' | 'rain' | 'heavy-rain' | 'snow' | 'heavy-snow' | 'thunder';
|
|
@@ -149,7 +228,7 @@ declare function CompactWidget({
|
|
|
149
228
|
customPalettes,
|
|
150
229
|
simulatedDate: simulatedDateProp,
|
|
151
230
|
className
|
|
152
|
-
}: CompactWidgetProps):
|
|
231
|
+
}: CompactWidgetProps): react_jsx_runtime4.JSX.Element;
|
|
153
232
|
//#endregion
|
|
154
233
|
//#region src/skins/types/widget-skin.types.d.ts
|
|
155
234
|
interface ShaderImage {
|
|
@@ -284,6 +363,12 @@ interface SkinDefinition {
|
|
|
284
363
|
* }
|
|
285
364
|
*/
|
|
286
365
|
defaultImage?: ShaderImage;
|
|
366
|
+
/**
|
|
367
|
+
* Optional per-season palette modifiers.
|
|
368
|
+
* If omitted, UNIVERSAL_SEASON_MODIFIERS is used automatically.
|
|
369
|
+
* Define only the seasons you want to customise — the rest fall back.
|
|
370
|
+
*/
|
|
371
|
+
seasonalModifiers?: Partial<Record<Season, SeasonalModifier>>;
|
|
287
372
|
/**
|
|
288
373
|
* The React component that renders the actual widget pill + expanded card.
|
|
289
374
|
* Receives WidgetSkinProps and is fully responsible for its own visual output.
|
|
@@ -347,6 +432,12 @@ interface SolarTheme {
|
|
|
347
432
|
/** Custom palette overrides registered by the nearest widget. */
|
|
348
433
|
customPalettes: CustomPalettes | undefined;
|
|
349
434
|
setCustomPalettes: (palettes: CustomPalettes | undefined) => void;
|
|
435
|
+
/** Current dominant season. */
|
|
436
|
+
season: Season;
|
|
437
|
+
/** Full seasonal blend state (season, nextSeason, crossfade t). */
|
|
438
|
+
seasonalBlend: SeasonalBlend;
|
|
439
|
+
/** Override the auto-detected season, or pass null to restore auto-detection. */
|
|
440
|
+
setSeasonOverride: (season: Season | null) => void;
|
|
350
441
|
}
|
|
351
442
|
declare function useSolarTheme(): SolarTheme;
|
|
352
443
|
interface Props {
|
|
@@ -359,12 +450,44 @@ interface Props {
|
|
|
359
450
|
* (e.g. a skin showcase / test page). Defaults to false.
|
|
360
451
|
*/
|
|
361
452
|
isolated?: boolean;
|
|
453
|
+
/**
|
|
454
|
+
* Force a specific season, bypassing astronomical computation.
|
|
455
|
+
* Useful for testing, user preferences, or themed marketing pages.
|
|
456
|
+
*/
|
|
457
|
+
seasonOverride?: Season;
|
|
458
|
+
/**
|
|
459
|
+
* Opt out of seasonal palette blending entirely.
|
|
460
|
+
* When true, palettes are exactly as defined in the skin. Default: false.
|
|
461
|
+
*/
|
|
462
|
+
disableSeasonalBlend?: boolean;
|
|
362
463
|
}
|
|
363
464
|
declare function SolarThemeProvider({
|
|
364
465
|
children,
|
|
365
466
|
initialDesign,
|
|
366
|
-
isolated
|
|
367
|
-
|
|
467
|
+
isolated,
|
|
468
|
+
seasonOverride: seasonOverrideProp,
|
|
469
|
+
disableSeasonalBlend
|
|
470
|
+
}: Props): react_jsx_runtime4.JSX.Element;
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/shared/solar-shader-bg.d.ts
|
|
473
|
+
type ShaderVariant = 'showcase' | 'dashboard' | 'editorial';
|
|
474
|
+
interface SolarShaderBgProps {
|
|
475
|
+
skinOverride?: SkinDefinition;
|
|
476
|
+
blendOverride?: SolarBlend;
|
|
477
|
+
opacityOverride?: number;
|
|
478
|
+
variant?: ShaderVariant;
|
|
479
|
+
className?: string;
|
|
480
|
+
style?: React.CSSProperties;
|
|
481
|
+
}
|
|
482
|
+
declare function SolarShaderBg({
|
|
483
|
+
skinOverride,
|
|
484
|
+
blendOverride,
|
|
485
|
+
opacityOverride,
|
|
486
|
+
variant: variantProp,
|
|
487
|
+
className,
|
|
488
|
+
style
|
|
489
|
+
}?: SolarShaderBgProps): react_jsx_runtime4.JSX.Element;
|
|
490
|
+
declare function SolarShaderBgFull(props?: SolarShaderBgProps): react_jsx_runtime4.JSX.Element;
|
|
368
491
|
//#endregion
|
|
369
|
-
export { type CompactSize, CompactWidget, type DesignMode, type ExpandDirection, type SkinDefinition, type SolarBlend, type SolarPhase, type SolarTheme, SolarThemeProvider, SolarWidget, type WeatherCategory, type WidgetPalette, type WidgetSize, useSolarTheme };
|
|
492
|
+
export { type CompactSize, CompactWidget, type DesignMode, type ExpandDirection, IDENTITY_MODIFIER, type Season, type SeasonalBlend, type SeasonalModifier, type SkinDefinition, type SolarBlend, type SolarPhase, SolarShaderBg, SolarShaderBgFull, type SolarTheme, SolarThemeProvider, SolarWidget, UNIVERSAL_SEASON_MODIFIERS, type WeatherCategory, type WidgetPalette, type WidgetSize, applySeasonalModifier, getSeasonalBlend, lerpModifier, resolveSeasonalModifier, useSeason, useSolarTheme };
|
|
370
493
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/hooks/useSolarPosition.tsx","../src/widgets/solar-widget.shell.tsx","../src/widgets/compact-widget.shell.tsx","../src/skins/types/widget-skin.types.ts","../src/provider/solar-theme-provider.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAgBA;AAWA;AAWA;AAmBA;;UAzCiB,UAAA;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/hooks/useSolarPosition.tsx","../src/lib/useSeason.ts","../src/lib/seasonal-blend.ts","../src/widgets/solar-widget.shell.tsx","../src/widgets/compact-widget.shell.tsx","../src/skins/types/widget-skin.types.ts","../src/provider/solar-theme-provider.tsx","../src/shared/solar-shader-bg.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAgBA;AAWA;AAWA;AAmBA;;UAzCiB,UAAA;;ECIL,OAAA,EAAM,MAAA;EAED,SAAA,EAAA,MAAa;EAsFd,MAAA,EAAA,MAAA;EACR;EAEK,SAAA,EAAA,MAAA;EACV;EAAa,SAAA,EAAA,MAAA;AAuBhB;AAEa,KD9GD,UAAA,GC8GC,OAAA,GAAA,MAAA,GAAA,SAAA,GAAA,SAAA,GAAA,YAAA,GAAA,WAAA,GAAA,QAAA,GAAA,MAAA,GAAA,UAAA;AACK,UDpGD,aAAA,CCoGC;EACf;EAAa,QAAA,EAAA,MAAA;;;;ECjHC,WAAA,EAAA,MAAgB;EAmBpB;EAWA,aAAA,EAAA,MAAA;EAAmC;EAAQ,SAAA,EAAA,OAAA;EAAf;EAAM,KAAA,EFNtC,UEMsC;EA4I/B;EACX,KAAA,EFjJI,UEiJJ;EACA;EAEF,YAAA,EAAA,MAAA;;AAqBa,UFpKC,UAAA,CEoKoB;EAC1B,KAAA,EFpKF,UEoKE;EACJ,SAAA,EFpKM,UEoKN;EAEJ;EAAa,CAAA,EAAA,MAAA;AAyBhB;;;KDtOY,MAAA;UAEK,aAAA;;UAEP;EDRO;EAWL,UAAA,ECDE,MDCQ;EAWL;AAmBjB;;;;ECrCY,CAAA,EAAA,MAAM;AAElB;AAsFA;;;;;AA2BA;;AAGkB,iBA9BF,gBAAA,CA8BE,IAAA,CAAA,EA7BV,IA6BU,EAAA,SAAA,CAAA,EAAA,MAAA,EAAA,Q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