@circadian/sol 0.2.9 → 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 +107 -1
- package/dist/devtools/index.js +1 -1
- package/dist/index.d.ts +111 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -7
- package/dist/index.js.map +1 -1
- package/dist/{solar-theme-provider-CSustvmw.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-CSustvmw.js.map +0 -1
package/README.md
CHANGED
|
@@ -58,6 +58,7 @@ deno add npm:@circadian/sol
|
|
|
58
58
|
- **2 widget variants** — `SolarWidget` (full card) and `CompactWidget` (slim pill/bar)
|
|
59
59
|
- **10 skins** — `foundry`, `paper`, `signal`, `meridian`, `mineral`, `aurora`, `tide`, `void`, `sundial`, `parchment`
|
|
60
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
|
|
61
62
|
- **Built-in fallback strategy** — geolocation → browser timezone → timezone centroid
|
|
62
63
|
- **Optional live weather** — powered by Open-Meteo (no API key required)
|
|
63
64
|
- **Dev preview tooling** — `SolarDevTools` lets you scrub through the day and preview phase colors
|
|
@@ -537,6 +538,105 @@ Each `bg` is a 3-stop gradient: `[top, middle, bottom]`. Only the phases you spe
|
|
|
537
538
|
|
|
538
539
|
---
|
|
539
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
|
+
|
|
540
640
|
## SolarDevTools
|
|
541
641
|
|
|
542
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.
|
|
@@ -612,6 +712,9 @@ function DebugPanel() {
|
|
|
612
712
|
| `activeSkin` | `SkinDefinition` | Full skin definition object |
|
|
613
713
|
| `setOverridePhase` | `(phase \| null) => void` | Set/clear phase override |
|
|
614
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 |
|
|
615
718
|
|
|
616
719
|
---
|
|
617
720
|
|
|
@@ -644,6 +747,9 @@ import type {
|
|
|
644
747
|
WidgetPalette,
|
|
645
748
|
CustomPalettes,
|
|
646
749
|
SolarTheme,
|
|
750
|
+
Season,
|
|
751
|
+
SeasonalBlend,
|
|
752
|
+
SeasonalModifier,
|
|
647
753
|
} from '@circadian/sol';
|
|
648
754
|
```
|
|
649
755
|
|
|
@@ -655,6 +761,7 @@ import type {
|
|
|
655
761
|
|---|---|
|
|
656
762
|
| ✅ | Full widget + compact widget |
|
|
657
763
|
| ✅ | 10 skins with full + compact variants |
|
|
764
|
+
| ✅ | Automatic seasonal palette blending (4 seasons) |
|
|
658
765
|
| ✅ | Solar math (NOAA equations, no external API) |
|
|
659
766
|
| ✅ | Timezone fallback logic |
|
|
660
767
|
| ✅ | Optional live weather (Open-Meteo) |
|
|
@@ -673,7 +780,6 @@ import type {
|
|
|
673
780
|
|
|
674
781
|
Sol is actively being developed. Things in progress:
|
|
675
782
|
|
|
676
|
-
- **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
|
|
677
783
|
- More skins
|
|
678
784
|
- Vue and Svelte adapters
|
|
679
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,24 @@ 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;
|
|
368
471
|
//#endregion
|
|
369
472
|
//#region src/shared/solar-shader-bg.d.ts
|
|
370
473
|
type ShaderVariant = 'showcase' | 'dashboard' | 'editorial';
|
|
@@ -383,8 +486,8 @@ declare function SolarShaderBg({
|
|
|
383
486
|
variant: variantProp,
|
|
384
487
|
className,
|
|
385
488
|
style
|
|
386
|
-
}?: SolarShaderBgProps):
|
|
387
|
-
declare function SolarShaderBgFull(props?: SolarShaderBgProps):
|
|
489
|
+
}?: SolarShaderBgProps): react_jsx_runtime4.JSX.Element;
|
|
490
|
+
declare function SolarShaderBgFull(props?: SolarShaderBgProps): react_jsx_runtime4.JSX.Element;
|
|
388
491
|
//#endregion
|
|
389
|
-
export { type CompactSize, CompactWidget, type DesignMode, type ExpandDirection, type SkinDefinition, type SolarBlend, type SolarPhase, SolarShaderBg, SolarShaderBgFull, 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 };
|
|
390
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","../src/shared/solar-shader-bg.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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A;EAAQ;;;;mBI2ET;;;AH/SnB;AAWA;EAEY,oBAAe,CAAA,EAAA,OAAA;AAY3B;AAA4C,iBG8R5B,kBAAA,CH9R4B;EAAA,QAAA;EAAA,aAAA;EAAA,QAAA;EAAA,cAAA,EGkS1B,kBHlS0B;EAAA;AAAA,CAAA,EGoSzC,KHpSyC,CAAA,EGoSpC,kBAAA,CAAA,GAAA,CAAA,OHpSoC;;;KIhBhC,aAAA;UAyZK,kBAAA;iBACA;kBACC;ENxaN,eAAM,CAAA,EAAA,MAAA;EAED,OAAA,CAAA,EMwaL,aNxakB;EAsFd,SAAA,CAAA,EAAA,MAAA;EACR,KAAA,CAAA,EMmVE,KAAA,CAAM,aNnVR;;AAGL,iBMqVa,aAAA,CNrVb;EAAA,YAAA;EAAA,aAAA;EAAA,eAAA;EAAA,OAAA,EMyVQ,WNzVR;EAAA,SAAA;EAAA;AAAA,CAAA,CAAA,EM4VA,kBN5VA,CAAA,EM4VuB,kBAAA,CAAA,GAAA,CAAA,ON5VvB;AAAa,iBM4dA,iBAAA,CN5dA,KAAA,CAAA,EM4dyB,kBN5dzB,CAAA,EM4dgD,kBAAA,CAAA,GAAA,CAAA,ON5dhD"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as resolveSeasonalModifier, a as useSeason, d as lerpColor, f as lerpHex, g as lerpModifier, h as applySeasonalModifier, i as getSeasonalBlend, m as UNIVERSAL_SEASON_MODIFIERS, n as useSolarTheme, p as IDENTITY_MODIFIER, r as SKINS, t as SolarThemeProvider } from "./solar-theme-provider-BcP2n4b7.js";
|
|
2
2
|
import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -1028,11 +1028,19 @@ function resolveMotionProfile(skin) {
|
|
|
1028
1028
|
function resolveImage(skin, palette) {
|
|
1029
1029
|
return palette.image ?? skin.defaultImage;
|
|
1030
1030
|
}
|
|
1031
|
-
function computeConfig(skin, blend) {
|
|
1031
|
+
function computeConfig(skin, blend, seasonal) {
|
|
1032
1032
|
const motionProfile = resolveMotionProfile(skin);
|
|
1033
1033
|
const { phase, nextPhase, t } = blend;
|
|
1034
|
+
let palette = lerpPalette(skin.shaderPalettes[phase], skin.shaderPalettes[nextPhase], t);
|
|
1035
|
+
if (seasonal && !seasonal.disabled) {
|
|
1036
|
+
const mod = resolveSeasonalModifier(seasonal.blend, {
|
|
1037
|
+
...UNIVERSAL_SEASON_MODIFIERS,
|
|
1038
|
+
...skin.seasonalModifiers
|
|
1039
|
+
});
|
|
1040
|
+
palette = applySeasonalModifier(palette, mod);
|
|
1041
|
+
}
|
|
1034
1042
|
return {
|
|
1035
|
-
palette
|
|
1043
|
+
palette,
|
|
1036
1044
|
motion: lerpMotion(motionProfile[phase], motionProfile[nextPhase], t)
|
|
1037
1045
|
};
|
|
1038
1046
|
}
|
|
@@ -1258,16 +1266,22 @@ function SolarFlareCanvas({ backgroundColor, colors, speed, intensity, spread, p
|
|
|
1258
1266
|
}
|
|
1259
1267
|
let _hasHydrated = false;
|
|
1260
1268
|
function SolarShaderBg({ skinOverride, blendOverride, opacityOverride, variant: variantProp, className, style } = {}) {
|
|
1261
|
-
const { activeSkin, blend: contextBlend } = useSolarTheme();
|
|
1269
|
+
const { activeSkin, blend: contextBlend, seasonalBlend } = useSolarTheme();
|
|
1262
1270
|
const contextVariant = useShaderVariant();
|
|
1263
1271
|
const skin = skinOverride ?? activeSkin;
|
|
1264
1272
|
const blend = blendOverride ?? contextBlend;
|
|
1265
1273
|
const variant = variantProp ?? contextVariant;
|
|
1266
|
-
const
|
|
1274
|
+
const seasonal = {
|
|
1275
|
+
blend: seasonalBlend,
|
|
1276
|
+
disabled: false
|
|
1277
|
+
};
|
|
1278
|
+
const { palette, motion: rawMotion } = useMemo(() => computeConfig(skin, blend, seasonal), [
|
|
1267
1279
|
blend.phase,
|
|
1268
1280
|
blend.nextPhase,
|
|
1269
1281
|
blend.t,
|
|
1270
|
-
skin
|
|
1282
|
+
skin,
|
|
1283
|
+
seasonalBlend.season,
|
|
1284
|
+
seasonalBlend.t
|
|
1271
1285
|
]);
|
|
1272
1286
|
const variantPalette = variant === "editorial" ? applyEditorialPalette(palette) : palette;
|
|
1273
1287
|
const shaderMotion = variant === "dashboard" ? applyDashboardMotion(rawMotion) : variant === "editorial" ? applyEditorialMotion(rawMotion) : rawMotion;
|
|
@@ -1352,5 +1366,5 @@ function SolarShaderBgFull(props = {}) {
|
|
|
1352
1366
|
}
|
|
1353
1367
|
|
|
1354
1368
|
//#endregion
|
|
1355
|
-
export { CompactWidget, SolarShaderBg, SolarShaderBgFull, SolarThemeProvider, SolarWidget, useSolarTheme };
|
|
1369
|
+
export { CompactWidget, IDENTITY_MODIFIER, SolarShaderBg, SolarShaderBgFull, SolarThemeProvider, SolarWidget, UNIVERSAL_SEASON_MODIFIERS, applySeasonalModifier, getSeasonalBlend, lerpModifier, resolveSeasonalModifier, useSeason, useSolarTheme };
|
|
1356
1370
|
//# sourceMappingURL=index.js.map
|