@sharadox/web-library 0.0.0-stage → 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.
Files changed (217) hide show
  1. package/LICENCA.md +76 -0
  2. package/LICENSE.md +76 -0
  3. package/NOTICE.md +3 -0
  4. package/README.md +37 -2
  5. package/distribution/animation/count-up/index.d.ts +6 -0
  6. package/distribution/animation/count-up/index.d.ts.map +1 -0
  7. package/distribution/animation/count-up/index.js +29 -0
  8. package/distribution/animation/count-up/index.js.map +1 -0
  9. package/distribution/animation/in-view/index.d.ts +3 -0
  10. package/distribution/animation/in-view/index.d.ts.map +1 -0
  11. package/distribution/animation/in-view/index.js +15 -0
  12. package/distribution/animation/in-view/index.js.map +1 -0
  13. package/distribution/animation/reveal/index.d.ts +4 -0
  14. package/distribution/animation/reveal/index.d.ts.map +1 -0
  15. package/distribution/animation/reveal/index.js +9 -0
  16. package/distribution/animation/reveal/index.js.map +1 -0
  17. package/distribution/animation/reveal/type.d.ts +14 -0
  18. package/distribution/animation/reveal/type.d.ts.map +1 -0
  19. package/distribution/animation/reveal/type.js +2 -0
  20. package/distribution/animation/reveal/type.js.map +1 -0
  21. package/distribution/animation/scroll-word/index.d.ts +4 -0
  22. package/distribution/animation/scroll-word/index.d.ts.map +1 -0
  23. package/distribution/animation/scroll-word/index.js +16 -0
  24. package/distribution/animation/scroll-word/index.js.map +1 -0
  25. package/distribution/animation/scroll-word/type.d.ts +11 -0
  26. package/distribution/animation/scroll-word/type.d.ts.map +1 -0
  27. package/distribution/animation/scroll-word/type.js +2 -0
  28. package/distribution/animation/scroll-word/type.js.map +1 -0
  29. package/distribution/animation/scroll-word/word/index.d.ts +4 -0
  30. package/distribution/animation/scroll-word/word/index.d.ts.map +1 -0
  31. package/distribution/animation/scroll-word/word/index.js +10 -0
  32. package/distribution/animation/scroll-word/word/index.js.map +1 -0
  33. package/distribution/animation/scroll-word/word/type.d.ts +14 -0
  34. package/distribution/animation/scroll-word/word/type.d.ts.map +1 -0
  35. package/distribution/animation/scroll-word/word/type.js +2 -0
  36. package/distribution/animation/scroll-word/word/type.js.map +1 -0
  37. package/distribution/animation/smooth-scroll/index.d.ts +4 -0
  38. package/distribution/animation/smooth-scroll/index.d.ts.map +1 -0
  39. package/distribution/animation/smooth-scroll/index.js +33 -0
  40. package/distribution/animation/smooth-scroll/index.js.map +1 -0
  41. package/distribution/animation/smooth-scroll/type.d.ts +7 -0
  42. package/distribution/animation/smooth-scroll/type.d.ts.map +1 -0
  43. package/distribution/animation/smooth-scroll/type.js +2 -0
  44. package/distribution/animation/smooth-scroll/type.js.map +1 -0
  45. package/distribution/class-name/index.d.ts +3 -0
  46. package/distribution/class-name/index.d.ts.map +1 -0
  47. package/distribution/class-name/index.js +5 -0
  48. package/distribution/class-name/index.js.map +1 -0
  49. package/distribution/form/bot-check/index.d.ts +4 -0
  50. package/distribution/form/bot-check/index.d.ts.map +1 -0
  51. package/distribution/form/bot-check/index.js +6 -0
  52. package/distribution/form/bot-check/index.js.map +1 -0
  53. package/distribution/form/bot-check/type.d.ts +11 -0
  54. package/distribution/form/bot-check/type.d.ts.map +1 -0
  55. package/distribution/form/bot-check/type.js +2 -0
  56. package/distribution/form/bot-check/type.js.map +1 -0
  57. package/distribution/form/field/index.d.ts +3 -0
  58. package/distribution/form/field/index.d.ts.map +1 -0
  59. package/distribution/form/field/index.js +7 -0
  60. package/distribution/form/field/index.js.map +1 -0
  61. package/distribution/form/rate-limit/index.d.ts +4 -0
  62. package/distribution/form/rate-limit/index.d.ts.map +1 -0
  63. package/distribution/form/rate-limit/index.js +14 -0
  64. package/distribution/form/rate-limit/index.js.map +1 -0
  65. package/distribution/form/rate-limit/type.d.ts +9 -0
  66. package/distribution/form/rate-limit/type.d.ts.map +1 -0
  67. package/distribution/form/rate-limit/type.js +2 -0
  68. package/distribution/form/rate-limit/type.js.map +1 -0
  69. package/distribution/html/escape/index.d.ts +3 -0
  70. package/distribution/html/escape/index.d.ts.map +1 -0
  71. package/distribution/html/escape/index.js +6 -0
  72. package/distribution/html/escape/index.js.map +1 -0
  73. package/distribution/internationalization/locale/index.d.ts +7 -0
  74. package/distribution/internationalization/locale/index.d.ts.map +1 -0
  75. package/distribution/internationalization/locale/index.js +17 -0
  76. package/distribution/internationalization/locale/index.js.map +1 -0
  77. package/distribution/internationalization/locale/type.d.ts +3 -0
  78. package/distribution/internationalization/locale/type.d.ts.map +1 -0
  79. package/distribution/internationalization/locale/type.js +2 -0
  80. package/distribution/internationalization/locale/type.js.map +1 -0
  81. package/distribution/internationalization/locale-preference/index.d.ts +5 -0
  82. package/distribution/internationalization/locale-preference/index.d.ts.map +1 -0
  83. package/distribution/internationalization/locale-preference/index.js +9 -0
  84. package/distribution/internationalization/locale-preference/index.js.map +1 -0
  85. package/distribution/internationalization/locale-redirect/index.d.ts +8 -0
  86. package/distribution/internationalization/locale-redirect/index.d.ts.map +1 -0
  87. package/distribution/internationalization/locale-redirect/index.js +24 -0
  88. package/distribution/internationalization/locale-redirect/index.js.map +1 -0
  89. package/distribution/internationalization/locale-redirect/type.d.ts +12 -0
  90. package/distribution/internationalization/locale-redirect/type.d.ts.map +1 -0
  91. package/distribution/internationalization/locale-redirect/type.js +2 -0
  92. package/distribution/internationalization/locale-redirect/type.js.map +1 -0
  93. package/distribution/internationalization/translate/index.d.ts +4 -0
  94. package/distribution/internationalization/translate/index.d.ts.map +1 -0
  95. package/distribution/internationalization/translate/index.js +5 -0
  96. package/distribution/internationalization/translate/index.js.map +1 -0
  97. package/distribution/math/clamp/index.d.ts +3 -0
  98. package/distribution/math/clamp/index.d.ts.map +1 -0
  99. package/distribution/math/clamp/index.js +5 -0
  100. package/distribution/math/clamp/index.js.map +1 -0
  101. package/distribution/math/pseudo-random/index.d.ts +3 -0
  102. package/distribution/math/pseudo-random/index.d.ts.map +1 -0
  103. package/distribution/math/pseudo-random/index.js +6 -0
  104. package/distribution/math/pseudo-random/index.js.map +1 -0
  105. package/distribution/math/radians/index.d.ts +3 -0
  106. package/distribution/math/radians/index.d.ts.map +1 -0
  107. package/distribution/math/radians/index.js +5 -0
  108. package/distribution/math/radians/index.js.map +1 -0
  109. package/distribution/pointer/spotlight/index.d.ts +3 -0
  110. package/distribution/pointer/spotlight/index.d.ts.map +1 -0
  111. package/distribution/pointer/spotlight/index.js +20 -0
  112. package/distribution/pointer/spotlight/index.js.map +1 -0
  113. package/distribution/pointer/tilt/index.d.ts +7 -0
  114. package/distribution/pointer/tilt/index.d.ts.map +1 -0
  115. package/distribution/pointer/tilt/index.js +34 -0
  116. package/distribution/pointer/tilt/index.js.map +1 -0
  117. package/distribution/search-engine/robots/index.d.ts +4 -0
  118. package/distribution/search-engine/robots/index.d.ts.map +1 -0
  119. package/distribution/search-engine/robots/index.js +7 -0
  120. package/distribution/search-engine/robots/index.js.map +1 -0
  121. package/distribution/search-engine/robots/type.d.ts +17 -0
  122. package/distribution/search-engine/robots/type.d.ts.map +1 -0
  123. package/distribution/search-engine/robots/type.js +2 -0
  124. package/distribution/search-engine/robots/type.js.map +1 -0
  125. package/distribution/search-engine/sitemap/index.d.ts +4 -0
  126. package/distribution/search-engine/sitemap/index.d.ts.map +1 -0
  127. package/distribution/search-engine/sitemap/index.js +12 -0
  128. package/distribution/search-engine/sitemap/index.js.map +1 -0
  129. package/distribution/search-engine/sitemap/type.d.ts +22 -0
  130. package/distribution/search-engine/sitemap/type.d.ts.map +1 -0
  131. package/distribution/search-engine/sitemap/type.js +2 -0
  132. package/distribution/search-engine/sitemap/type.js.map +1 -0
  133. package/distribution/search-engine/structured-data/index.d.ts +4 -0
  134. package/distribution/search-engine/structured-data/index.d.ts.map +1 -0
  135. package/distribution/search-engine/structured-data/index.js +6 -0
  136. package/distribution/search-engine/structured-data/index.js.map +1 -0
  137. package/distribution/search-engine/structured-data/type.d.ts +5 -0
  138. package/distribution/search-engine/structured-data/type.d.ts.map +1 -0
  139. package/distribution/search-engine/structured-data/type.js +2 -0
  140. package/distribution/search-engine/structured-data/type.js.map +1 -0
  141. package/distribution/style/apply/index.d.ts +11 -0
  142. package/distribution/style/apply/index.d.ts.map +1 -0
  143. package/distribution/style/apply/index.js +46 -0
  144. package/distribution/style/apply/index.js.map +1 -0
  145. package/distribution/style/apply/type.d.ts +10 -0
  146. package/distribution/style/apply/type.d.ts.map +1 -0
  147. package/distribution/style/apply/type.js +2 -0
  148. package/distribution/style/apply/type.js.map +1 -0
  149. package/distribution/style/definition/index.d.ts +12 -0
  150. package/distribution/style/definition/index.d.ts.map +1 -0
  151. package/distribution/style/definition/index.js +21 -0
  152. package/distribution/style/definition/index.js.map +1 -0
  153. package/distribution/style/definition/type.d.ts +24 -0
  154. package/distribution/style/definition/type.d.ts.map +1 -0
  155. package/distribution/style/definition/type.js +2 -0
  156. package/distribution/style/definition/type.js.map +1 -0
  157. package/distribution/style/style-script/index.d.ts +10 -0
  158. package/distribution/style/style-script/index.d.ts.map +1 -0
  159. package/distribution/style/style-script/index.js +16 -0
  160. package/distribution/style/style-script/index.js.map +1 -0
  161. package/distribution/style/style-script/type.d.ts +5 -0
  162. package/distribution/style/style-script/type.d.ts.map +1 -0
  163. package/distribution/style/style-script/type.js +2 -0
  164. package/distribution/style/style-script/type.js.map +1 -0
  165. package/distribution/style/style-sheet/index.d.ts +7 -0
  166. package/distribution/style/style-sheet/index.d.ts.map +1 -0
  167. package/distribution/style/style-sheet/index.js +19 -0
  168. package/distribution/style/style-sheet/index.js.map +1 -0
  169. package/distribution/style/use-style/index.d.ts +5 -0
  170. package/distribution/style/use-style/index.d.ts.map +1 -0
  171. package/distribution/style/use-style/index.js +34 -0
  172. package/distribution/style/use-style/index.js.map +1 -0
  173. package/distribution/style/use-style/type.d.ts +9 -0
  174. package/distribution/style/use-style/type.d.ts.map +1 -0
  175. package/distribution/style/use-style/type.js +2 -0
  176. package/distribution/style/use-style/type.js.map +1 -0
  177. package/distribution/test/visual-snapshot/index.d.ts +8 -0
  178. package/distribution/test/visual-snapshot/index.d.ts.map +1 -0
  179. package/distribution/test/visual-snapshot/index.js +20 -0
  180. package/distribution/test/visual-snapshot/index.js.map +1 -0
  181. package/distribution/test/visual-snapshot/type.d.ts +7 -0
  182. package/distribution/test/visual-snapshot/type.d.ts.map +1 -0
  183. package/distribution/test/visual-snapshot/type.js +2 -0
  184. package/distribution/test/visual-snapshot/type.js.map +1 -0
  185. package/distribution/time/format-time/index.d.ts +3 -0
  186. package/distribution/time/format-time/index.d.ts.map +1 -0
  187. package/distribution/time/format-time/index.js +5 -0
  188. package/distribution/time/format-time/index.js.map +1 -0
  189. package/distribution/time/open-state/index.d.ts +4 -0
  190. package/distribution/time/open-state/index.d.ts.map +1 -0
  191. package/distribution/time/open-state/index.js +11 -0
  192. package/distribution/time/open-state/index.js.map +1 -0
  193. package/distribution/time/open-state/type.d.ts +5 -0
  194. package/distribution/time/open-state/type.d.ts.map +1 -0
  195. package/distribution/time/open-state/type.js +2 -0
  196. package/distribution/time/open-state/type.js.map +1 -0
  197. package/distribution/time/sun-time/index.d.ts +4 -0
  198. package/distribution/time/sun-time/index.d.ts.map +1 -0
  199. package/distribution/time/sun-time/index.js +27 -0
  200. package/distribution/time/sun-time/index.js.map +1 -0
  201. package/distribution/time/sun-time/type.d.ts +6 -0
  202. package/distribution/time/sun-time/type.d.ts.map +1 -0
  203. package/distribution/time/sun-time/type.js +2 -0
  204. package/distribution/time/sun-time/type.js.map +1 -0
  205. package/distribution/time/sun-today/index.d.ts +4 -0
  206. package/distribution/time/sun-today/index.d.ts.map +1 -0
  207. package/distribution/time/sun-today/index.js +25 -0
  208. package/distribution/time/sun-today/index.js.map +1 -0
  209. package/distribution/time/sun-today/type.d.ts +9 -0
  210. package/distribution/time/sun-today/type.d.ts.map +1 -0
  211. package/distribution/time/sun-today/type.js +2 -0
  212. package/distribution/time/sun-today/type.js.map +1 -0
  213. package/distribution/time/zone-minute/index.d.ts +3 -0
  214. package/distribution/time/zone-minute/index.d.ts.map +1 -0
  215. package/distribution/time/zone-minute/index.js +13 -0
  216. package/distribution/time/zone-minute/index.js.map +1 -0
  217. package/package.json +99 -3
@@ -0,0 +1,46 @@
1
+ /** The configuration reduced to what `applyStyle` needs. */
2
+ export function styleApplyData(configuration) {
3
+ return {
4
+ storageKey: configuration.storageKey,
5
+ schemes: Object.fromEntries(configuration.styles.map((style) => [style.name, style.scheme])),
6
+ defaults: { ...configuration.defaults },
7
+ fallback: configuration.fallback,
8
+ };
9
+ }
10
+ /**
11
+ * Writes the style to `<html>`: `data-style` (the style in use), `data-style-choice` and `color-scheme`.
12
+ * Without a `choice` it reads the remembered one (or "system"). It is self-contained on purpose: the inline
13
+ * script in `<head>` embeds its source, so the page never shows the wrong style before React loads.
14
+ */
15
+ export function applyStyle(data, choice) {
16
+ let wanted = choice;
17
+ if (wanted === undefined) {
18
+ try {
19
+ wanted = localStorage.getItem(data.storageKey) || "system";
20
+ }
21
+ catch {
22
+ wanted = "system";
23
+ }
24
+ }
25
+ if (wanted !== "system" && !data.schemes[wanted])
26
+ wanted = "system";
27
+ let name = wanted;
28
+ if (wanted === "system") {
29
+ let scheme = data.fallback;
30
+ try {
31
+ if (matchMedia("(prefers-color-scheme: light)").matches)
32
+ scheme = "light";
33
+ else if (matchMedia("(prefers-color-scheme: dark)").matches)
34
+ scheme = "dark";
35
+ }
36
+ catch {
37
+ // No media queries: keep the fallback.
38
+ }
39
+ name = data.defaults[scheme];
40
+ }
41
+ const root = document.documentElement;
42
+ root.setAttribute("data-style", name);
43
+ root.setAttribute("data-style-choice", wanted);
44
+ root.style.colorScheme = data.schemes[name] ?? data.fallback;
45
+ }
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/style/apply/index.ts"],"names":[],"mappings":"AAGA,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAAC,aAAiC;IAC9D,OAAO;QACL,UAAU,EAAE,aAAa,CAAC,UAAU;QACpC,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5F,QAAQ,EAAE,EAAE,GAAG,aAAa,CAAC,QAAQ,EAAE;QACvC,QAAQ,EAAE,aAAa,CAAC,QAAQ;KACjC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAoB,EAAE,MAAe;IAC9D,IAAI,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC;QAC7D,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,GAAG,QAAQ,CAAC;QACpB,CAAC;IACH,CAAC;IACD,IAAI,MAAM,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,MAAM,GAAG,QAAQ,CAAC;IACpE,IAAI,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC3B,IAAI,CAAC;YACH,IAAI,UAAU,CAAC,+BAA+B,CAAC,CAAC,OAAO;gBAAE,MAAM,GAAG,OAAO,CAAC;iBACrE,IAAI,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO;gBAAE,MAAM,GAAG,MAAM,CAAC;QAC/E,CAAC;QAAC,MAAM,CAAC;YACP,uCAAuC;QACzC,CAAC;QACD,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;IACtC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAC/C,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ColorScheme } from "@sharadox/web-library/style/definition/type";
2
+ /** The plain data `applyStyle` needs; it is serialized into the inline script, so it holds no functions. */
3
+ export interface StyleApplyData {
4
+ storageKey: string;
5
+ /** Style name → scheme. */
6
+ schemes: Record<string, ColorScheme>;
7
+ defaults: Record<ColorScheme, string>;
8
+ fallback: ColorScheme;
9
+ }
10
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/style/apply/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE/E,4GAA4G;AAC5G,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACtC,QAAQ,EAAE,WAAW,CAAC;CACvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../source/style/apply/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import type { ColorScheme, StyleConfiguration, StyleDefinition } from "@sharadox/web-library/style/definition/type";
2
+ /** The choice that follows the device's light or dark setting. It is the default and is never stored. */
3
+ export declare const SYSTEM_STYLE = "system";
4
+ /** `<html>` attribute holding the style in use, for CSS (`[data-style="black"]`). */
5
+ export declare const STYLE_ATTRIBUTE = "data-style";
6
+ /** `<html>` attribute holding the visitor's choice ("system" or a style name), for the picker. */
7
+ export declare const STYLE_CHOICE_ATTRIBUTE = "data-style-choice";
8
+ /** Finds a style by name. */
9
+ export declare function findStyle(configuration: StyleConfiguration, name: string): StyleDefinition | undefined;
10
+ /** The style shown for a choice: the chosen style, or for "system" (and unknown names) the default for the scheme. */
11
+ export declare function resolveStyle(configuration: StyleConfiguration, choice: string, systemScheme: ColorScheme | undefined): StyleDefinition;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/style/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAEpH,yGAAyG;AACzG,eAAO,MAAM,YAAY,WAAW,CAAC;AACrC,qFAAqF;AACrF,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,kGAAkG;AAClG,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAE1D,6BAA6B;AAC7B,wBAAgB,SAAS,CAAC,aAAa,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAEtG;AAED,sHAAsH;AACtH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,kBAAkB,EACjC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,GAAG,SAAS,GACpC,eAAe,CASjB"}
@@ -0,0 +1,21 @@
1
+ /** The choice that follows the device's light or dark setting. It is the default and is never stored. */
2
+ export const SYSTEM_STYLE = "system";
3
+ /** `<html>` attribute holding the style in use, for CSS (`[data-style="black"]`). */
4
+ export const STYLE_ATTRIBUTE = "data-style";
5
+ /** `<html>` attribute holding the visitor's choice ("system" or a style name), for the picker. */
6
+ export const STYLE_CHOICE_ATTRIBUTE = "data-style-choice";
7
+ /** Finds a style by name. */
8
+ export function findStyle(configuration, name) {
9
+ return configuration.styles.find((style) => style.name === name);
10
+ }
11
+ /** The style shown for a choice: the chosen style, or for "system" (and unknown names) the default for the scheme. */
12
+ export function resolveStyle(configuration, choice, systemScheme) {
13
+ const chosen = choice === SYSTEM_STYLE ? undefined : findStyle(configuration, choice);
14
+ if (chosen)
15
+ return chosen;
16
+ const style = findStyle(configuration, configuration.defaults[systemScheme ?? configuration.fallback]);
17
+ if (!style)
18
+ throw new Error(`style configuration: no style named "${configuration.defaults[systemScheme ?? configuration.fallback]}"`);
19
+ return style;
20
+ }
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/style/definition/index.ts"],"names":[],"mappings":"AAEA,yGAAyG;AACzG,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC;AACrC,qFAAqF;AACrF,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;AAC5C,kGAAkG;AAClG,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAE1D,6BAA6B;AAC7B,MAAM,UAAU,SAAS,CAAC,aAAiC,EAAE,IAAY;IACvE,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,sHAAsH;AACtH,MAAM,UAAU,YAAY,CAC1B,aAAiC,EACjC,MAAc,EACd,YAAqC;IAErC,MAAM,MAAM,GAAG,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACtF,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,MAAM,KAAK,GAAG,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC,YAAY,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvG,IAAI,CAAC,KAAK;QACR,MAAM,IAAI,KAAK,CACb,wCAAwC,aAAa,CAAC,QAAQ,CAAC,YAAY,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAC1G,CAAC;IACJ,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,24 @@
1
+ /** Whether a style is dark or light. The system preference (`prefers-color-scheme`) is one of these. */
2
+ export type ColorScheme = "dark" | "light";
3
+ /** One style (what other projects call a theme): a name, its scheme and the CSS custom properties it sets. */
4
+ export interface StyleDefinition {
5
+ /** Lower-case identifier, stored and written to `<html data-style>`, for example `black`. */
6
+ name: string;
7
+ scheme: ColorScheme;
8
+ /** CSS custom properties without the leading dashes, for example `{ background: "#000" }` → `--background`. */
9
+ palette: Readonly<Record<string, string>>;
10
+ }
11
+ /** Every style a site offers, and how one is picked when the visitor hasn't chosen. */
12
+ export interface StyleConfiguration {
13
+ /** Any number of dark and light styles. */
14
+ styles: readonly StyleDefinition[];
15
+ /** The style used for each system scheme when the choice is "system". */
16
+ defaults: Readonly<Record<ColorScheme, string>>;
17
+ /** The scheme used when the system preference is unknown, and before scripts run. */
18
+ fallback: ColorScheme;
19
+ /** Browser storage key that remembers a manual choice. */
20
+ storageKey: string;
21
+ }
22
+ /** What the visitor picked: "system" (follow the device) or a style name. */
23
+ export type StyleChoice = string;
24
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/style/definition/type.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3C,8GAA8G;AAC9G,MAAM,WAAW,eAAe;IAC9B,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB,+GAA+G;IAC/G,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC3C;AAED,uFAAuF;AACvF,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IACnC,yEAAyE;IACzE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,qFAAqF;IACrF,QAAQ,EAAE,WAAW,CAAC;IACtB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../source/style/definition/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { StyleConfiguration } from "@sharadox/web-library/style/definition/type";
2
+ import type { StyleScriptProperties } from "@sharadox/web-library/style/style-script/type";
3
+ /** The inline script: applies the remembered style, then follows the device and other tabs while the page is open. */
4
+ export declare function styleScript(configuration: StyleConfiguration): string;
5
+ /**
6
+ * Put in `<head>` (and add `suppressHydrationWarning` to `<html>`): every style's CSS custom properties, and the
7
+ * script that picks the style before the first paint.
8
+ */
9
+ export declare function StyleScript({ configuration }: StyleScriptProperties): import("react").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/style/style-script/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAE3F,sHAAsH;AACtH,wBAAgB,WAAW,CAAC,aAAa,EAAE,kBAAkB,GAAG,MAAM,CAGrE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,EAAE,qBAAqB,+BAOnE"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { applyStyle, styleApplyData } from "@sharadox/web-library/style/apply";
3
+ import { styleSheet } from "@sharadox/web-library/style/style-sheet";
4
+ /** The inline script: applies the remembered style, then follows the device and other tabs while the page is open. */
5
+ export function styleScript(configuration) {
6
+ const data = JSON.stringify(styleApplyData(configuration)).replace(/</g, "\\u003c");
7
+ return `(function(){var apply=${applyStyle.toString()};var data=${data};apply(data);try{matchMedia("(prefers-color-scheme: light)").addEventListener("change",function(){apply(data)});addEventListener("storage",function(event){if(event.key===data.storageKey)apply(data)})}catch(error){}})();`;
8
+ }
9
+ /**
10
+ * Put in `<head>` (and add `suppressHydrationWarning` to `<html>`): every style's CSS custom properties, and the
11
+ * script that picks the style before the first paint.
12
+ */
13
+ export function StyleScript({ configuration }) {
14
+ return (_jsxs(_Fragment, { children: [_jsx("style", { dangerouslySetInnerHTML: { __html: styleSheet(configuration) } }), _jsx("script", { dangerouslySetInnerHTML: { __html: styleScript(configuration) } })] }));
15
+ }
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/style/style-script/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAIrE,sHAAsH;AACtH,MAAM,UAAU,WAAW,CAAC,aAAiC;IAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACpF,OAAO,yBAAyB,UAAU,CAAC,QAAQ,EAAE,aAAa,IAAI,6NAA6N,CAAC;AACtS,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,aAAa,EAAyB;IAClE,OAAO,CACL,8BACE,gBAAO,uBAAuB,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,aAAa,CAAC,EAAE,GAAI,EACzE,iBAAQ,uBAAuB,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,EAAE,GAAI,IAC1E,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { StyleConfiguration } from "@sharadox/web-library/style/definition/type";
2
+ export interface StyleScriptProperties {
3
+ configuration: StyleConfiguration;
4
+ }
5
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/style/style-script/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,kBAAkB,CAAC;CACnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../source/style/style-script/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { StyleConfiguration } from "@sharadox/web-library/style/definition/type";
2
+ /**
3
+ * The CSS for every style, from the configuration alone: `[data-style="<name>"]` for each style, plus a fallback for
4
+ * the moment before the inline script runs (or when scripts are off) that still follows the device's scheme.
5
+ */
6
+ export declare function styleSheet(configuration: StyleConfiguration): string;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/style/style-sheet/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAmB,MAAM,6CAA6C,CAAC;AAOvG;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,kBAAkB,GAAG,MAAM,CAUpE"}
@@ -0,0 +1,19 @@
1
+ import { findStyle } from "@sharadox/web-library/style/definition";
2
+ const declarations = (style) => [...Object.entries(style.palette).map(([key, value]) => `--${key}:${value}`), `color-scheme:${style.scheme}`].join(";");
3
+ /**
4
+ * The CSS for every style, from the configuration alone: `[data-style="<name>"]` for each style, plus a fallback for
5
+ * the moment before the inline script runs (or when scripts are off) that still follows the device's scheme.
6
+ */
7
+ export function styleSheet(configuration) {
8
+ const fallback = findStyle(configuration, configuration.defaults[configuration.fallback]);
9
+ const other = configuration.fallback === "dark" ? "light" : "dark";
10
+ const otherDefault = findStyle(configuration, configuration.defaults[other]);
11
+ if (!fallback || !otherDefault)
12
+ throw new Error("style configuration: a default style is missing");
13
+ return [
14
+ `:root{${declarations(fallback)}}`,
15
+ `@media (prefers-color-scheme:${other}){:root:not([data-style]){${declarations(otherDefault)}}}`,
16
+ ...configuration.styles.map((style) => `:root[data-style="${style.name}"]{${declarations(style)}}`),
17
+ ].join("\n");
18
+ }
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/style/style-sheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAGnE,MAAM,YAAY,GAAG,CAAC,KAAsB,EAAE,EAAE,CAC9C,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,EAAE,gBAAgB,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAChH,GAAG,CACJ,CAAC;AAEJ;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,aAAiC;IAC1D,MAAM,QAAQ,GAAG,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1F,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IACnE,MAAM,YAAY,GAAG,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7E,IAAI,CAAC,QAAQ,IAAI,CAAC,YAAY;QAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACnG,OAAO;QACL,SAAS,YAAY,CAAC,QAAQ,CAAC,GAAG;QAClC,gCAAgC,KAAK,6BAA6B,YAAY,CAAC,YAAY,CAAC,IAAI;QAChG,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,KAAK,CAAC,IAAI,MAAM,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC;KACpG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { StyleConfiguration } from "@sharadox/web-library/style/definition/type";
2
+ import type { StyleState } from "@sharadox/web-library/style/use-style/type";
3
+ /** The visitor's style choice and the style in use, kept in sync with `<html>`; `choose` remembers a new choice. */
4
+ export declare function useStyle(configuration: StyleConfiguration): StyleState;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/style/use-style/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAa7E,oHAAoH;AACpH,wBAAgB,QAAQ,CAAC,aAAa,EAAE,kBAAkB,GAAG,UAAU,CAkBtE"}
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import { useCallback, useMemo, useSyncExternalStore } from "react";
3
+ import { applyStyle, styleApplyData } from "@sharadox/web-library/style/apply";
4
+ import { STYLE_ATTRIBUTE, STYLE_CHOICE_ATTRIBUTE, SYSTEM_STYLE } from "@sharadox/web-library/style/definition";
5
+ const subscribe = (notify) => {
6
+ const observer = new MutationObserver(notify);
7
+ observer.observe(document.documentElement, {
8
+ attributes: true,
9
+ attributeFilter: [STYLE_ATTRIBUTE, STYLE_CHOICE_ATTRIBUTE],
10
+ });
11
+ return () => observer.disconnect();
12
+ };
13
+ const read = (attribute, fallback) => () => document.documentElement.getAttribute(attribute) ?? fallback;
14
+ /** The visitor's style choice and the style in use, kept in sync with `<html>`; `choose` remembers a new choice. */
15
+ export function useStyle(configuration) {
16
+ const fallbackStyle = configuration.defaults[configuration.fallback];
17
+ const choice = useSyncExternalStore(subscribe, read(STYLE_CHOICE_ATTRIBUTE, SYSTEM_STYLE), () => SYSTEM_STYLE);
18
+ const style = useSyncExternalStore(subscribe, read(STYLE_ATTRIBUTE, fallbackStyle), () => fallbackStyle);
19
+ const data = useMemo(() => styleApplyData(configuration), [configuration]);
20
+ const choose = useCallback((next) => {
21
+ try {
22
+ if (next === SYSTEM_STYLE)
23
+ localStorage.removeItem(data.storageKey);
24
+ else
25
+ localStorage.setItem(data.storageKey, next);
26
+ }
27
+ catch {
28
+ // Storage blocked (private mode): the choice still applies until the page closes.
29
+ }
30
+ applyStyle(data, next);
31
+ }, [data]);
32
+ return { choice, style, choose };
33
+ }
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/style/use-style/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAI/G,MAAM,SAAS,GAAG,CAAC,MAAkB,EAAE,EAAE;IACvC,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC9C,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE;QACzC,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,CAAC,eAAe,EAAE,sBAAsB,CAAC;KAC3D,CAAC,CAAC;IACH,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;AACrC,CAAC,CAAC;AACF,MAAM,IAAI,GAAG,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,GAAG,EAAE,CACzD,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC;AAE/D,oHAAoH;AACpH,MAAM,UAAU,QAAQ,CAAC,aAAiC;IACxD,MAAM,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACrE,MAAM,MAAM,GAAG,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC;IAC/G,MAAM,KAAK,GAAG,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;IACzG,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,WAAW,CACxB,CAAC,IAAY,EAAE,EAAE;QACf,IAAI,CAAC;YACH,IAAI,IAAI,KAAK,YAAY;gBAAE,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;;gBAC/D,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACnD,CAAC;QAAC,MAAM,CAAC;YACP,kFAAkF;QACpF,CAAC;QACD,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACzB,CAAC,EACD,CAAC,IAAI,CAAC,CACP,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACnC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface StyleState {
2
+ /** What the visitor picked: "system" or a style name. */
3
+ choice: string;
4
+ /** The style in use right now. Before hydration (and on the server) it is the fallback default. */
5
+ style: string;
6
+ /** Picks a style (or "system"), remembers it and applies it at once. */
7
+ choose: (choice: string) => void;
8
+ }
9
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/style/use-style/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,mGAAmG;IACnG,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../source/style/use-style/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { Page } from "@playwright/test";
2
+ import type { VisualSnapshotOptions } from "@sharadox/web-library/test/visual-snapshot/type";
3
+ /**
4
+ * Prepares a page for a deterministic full-page screenshot: freezes the clock, opens the url, waits for fonts,
5
+ * scrolls through so every reveal-on-scroll fires, then returns to the top and lets animations finish.
6
+ */
7
+ export declare function prepareVisualSnapshot(page: Page, url: string, { time, step }?: VisualSnapshotOptions): Promise<void>;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/test/visual-snapshot/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAE7F;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,EACX,EAAE,IAAuC,EAAE,IAAU,EAAE,GAAE,qBAA0B,GAClF,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Prepares a page for a deterministic full-page screenshot: freezes the clock, opens the url, waits for fonts,
3
+ * scrolls through so every reveal-on-scroll fires, then returns to the top and lets animations finish.
4
+ */
5
+ export async function prepareVisualSnapshot(page, url, { time = new Date("2026-11-08T12:00:00Z"), step = 400 } = {}) {
6
+ await page.clock.install({ time });
7
+ await page.clock.pauseAt(new Date(time.getTime() + 1000));
8
+ await page.goto(url);
9
+ await page.evaluate(() => document.fonts.ready);
10
+ const height = await page.evaluate(() => document.documentElement.scrollHeight);
11
+ for (let y = 0; y <= height; y += step) {
12
+ await page.evaluate((top) => window.scrollTo(0, top), y);
13
+ await page.waitForTimeout(60);
14
+ await page.clock.runFor(400);
15
+ }
16
+ await page.evaluate(() => window.scrollTo(0, 0));
17
+ await page.waitForTimeout(60);
18
+ await page.clock.runFor(4000);
19
+ }
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/test/visual-snapshot/index.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAU,EACV,GAAW,EACX,EAAE,IAAI,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,EAAE,IAAI,GAAG,GAAG,KAA4B,EAAE;IAEnF,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACnC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAC1D,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAChF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;QACvC,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QAC9B,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IACD,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,MAAM,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IAC9B,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface VisualSnapshotOptions {
2
+ /** The moment the page believes it is; animations and timers only move when the test advances the clock. */
3
+ time?: Date;
4
+ /** Pixels per scroll step while settling. Defaults to 400. */
5
+ step?: number;
6
+ }
7
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/test/visual-snapshot/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,4GAA4G;IAC5G,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../source/test/visual-snapshot/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /** "HH:MM" on a 24-hour clock in a time zone, for example "17:28". */
2
+ export declare function formatTime(date: Date, timeZone: string): string;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/time/format-time/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI/D"}
@@ -0,0 +1,5 @@
1
+ /** "HH:MM" on a 24-hour clock in a time zone, for example "17:28". */
2
+ export function formatTime(date, timeZone) {
3
+ return new Intl.DateTimeFormat("en-GB", { timeZone, hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).format(date);
4
+ }
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/time/format-time/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,UAAU,UAAU,CAAC,IAAU,EAAE,QAAgB;IACrD,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAChH,IAAI,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { OpenState, TimeOfDay } from "@sharadox/web-library/time/open-state/type";
2
+ /** Whether a place with daily hours `from`–`to` is open at `now`, in the place's time zone. */
3
+ export declare function openState(now: Date, from: TimeOfDay, to: TimeOfDay, timeZone: string): OpenState;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/time/open-state/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAGvF,+FAA+F;AAC/F,wBAAgB,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAKhG"}
@@ -0,0 +1,11 @@
1
+ import { minutesInZone } from "@sharadox/web-library/time/zone-minute";
2
+ /** Whether a place with daily hours `from`–`to` is open at `now`, in the place's time zone. */
3
+ export function openState(now, from, to, timeZone) {
4
+ const minutes = minutesInZone(now, timeZone);
5
+ if (minutes < from[0] * 60 + from[1])
6
+ return "before";
7
+ if (minutes >= to[0] * 60 + to[1])
8
+ return "after";
9
+ return "open";
10
+ }
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/time/open-state/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,+FAA+F;AAC/F,MAAM,UAAU,SAAS,CAAC,GAAS,EAAE,IAAe,EAAE,EAAa,EAAE,QAAgB;IACnF,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC7C,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,QAAQ,CAAC;IACtD,IAAI,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QAAE,OAAO,OAAO,CAAC;IAClD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Before opening, open, or after closing — today, in the place's time zone. */
2
+ export type OpenState = "open" | "before" | "after";
3
+ /** A time of day as [hours, minutes]. */
4
+ export type TimeOfDay = readonly [number, number];
5
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/time/open-state/type.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD,yCAAyC;AACzC,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../source/time/open-state/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { SunTimes } from "@sharadox/web-library/time/sun-time/type";
2
+ /** Sunrise and sunset for a date and place (NOAA solar position approximation, ±1–2 minutes). */
3
+ export declare function sunTimes(date: Date, latitude: number, longitude: number): SunTimes;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/time/sun-time/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAIzE,iGAAiG;AACjG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,CA4BlF"}
@@ -0,0 +1,27 @@
1
+ const RADIANS_PER_DEGREE = Math.PI / 180;
2
+ /** Sunrise and sunset for a date and place (NOAA solar position approximation, ±1–2 minutes). */
3
+ export function sunTimes(date, latitude, longitude) {
4
+ const year = date.getUTCFullYear();
5
+ const midnight = Date.UTC(year, date.getUTCMonth(), date.getUTCDate());
6
+ const day = Math.floor((midnight - Date.UTC(year, 0, 0)) / 864e5);
7
+ const yearAngle = ((2 * Math.PI) / 365) * (day - 1 + 0.5);
8
+ const equationOfTime = 229.18 *
9
+ (0.000075 +
10
+ 0.001868 * Math.cos(yearAngle) -
11
+ 0.032077 * Math.sin(yearAngle) -
12
+ 0.014615 * Math.cos(2 * yearAngle) -
13
+ 0.040849 * Math.sin(2 * yearAngle));
14
+ const declination = 0.006918 -
15
+ 0.399912 * Math.cos(yearAngle) +
16
+ 0.070257 * Math.sin(yearAngle) -
17
+ 0.006758 * Math.cos(2 * yearAngle) +
18
+ 0.000907 * Math.sin(2 * yearAngle) -
19
+ 0.002697 * Math.cos(3 * yearAngle) +
20
+ 0.00148 * Math.sin(3 * yearAngle);
21
+ const hourAngle = Math.acos(Math.cos(90.833 * RADIANS_PER_DEGREE) / (Math.cos(latitude * RADIANS_PER_DEGREE) * Math.cos(declination)) -
22
+ Math.tan(latitude * RADIANS_PER_DEGREE) * Math.tan(declination)) / RADIANS_PER_DEGREE;
23
+ const riseMinutes = 720 - 4 * (longitude + hourAngle) - equationOfTime;
24
+ const setMinutes = 720 - 4 * (longitude - hourAngle) - equationOfTime;
25
+ return { rise: new Date(midnight + riseMinutes * 6e4), set: new Date(midnight + setMinutes * 6e4) };
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/time/sun-time/index.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;AAEzC,iGAAiG;AACjG,MAAM,UAAU,QAAQ,CAAC,IAAU,EAAE,QAAgB,EAAE,SAAiB;IACtE,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACvE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;IAC1D,MAAM,cAAc,GAClB,MAAM;QACN,CAAC,QAAQ;YACP,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;YAC9B,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;YAC9B,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;YAClC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IACxC,MAAM,WAAW,GACf,QAAQ;QACR,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;QAC9B,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;QAC9B,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;QAClC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;QAClC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;QAClC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IACpC,MAAM,SAAS,GACb,IAAI,CAAC,IAAI,CACP,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,kBAAkB,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACvG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,kBAAkB,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAClE,GAAG,kBAAkB,CAAC;IACzB,MAAM,WAAW,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,cAAc,CAAC;IACvE,MAAM,UAAU,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,cAAc,CAAC;IACtE,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,QAAQ,GAAG,WAAW,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;AACtG,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** Sunrise and sunset as real instants, so they can be formatted in any timezone. */
2
+ export interface SunTimes {
3
+ rise: Date;
4
+ set: Date;
5
+ }
6
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/time/sun-time/type.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,IAAI,CAAC;CACX"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../source/time/sun-time/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { SunToday } from "@sharadox/web-library/time/sun-today/type";
2
+ /** Today's sunrise and sunset at a place (tomorrow's once the sun has set), refreshed every minute. Null until mounted. */
3
+ export declare function useSunToday(latitude: number, longitude: number): SunToday | null;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/time/sun-today/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAE1E,2HAA2H;AAC3H,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAkB9D"}
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { useEffect, useState } from "react";
3
+ import { sunTimes } from "@sharadox/web-library/time/sun-time";
4
+ /** Today's sunrise and sunset at a place (tomorrow's once the sun has set), refreshed every minute. Null until mounted. */
5
+ export function useSunToday(latitude, longitude) {
6
+ const [sun, setSun] = useState(null);
7
+ useEffect(() => {
8
+ const tick = () => {
9
+ const now = new Date();
10
+ let times = sunTimes(now, latitude, longitude);
11
+ const tomorrow = now > times.set;
12
+ if (tomorrow)
13
+ times = sunTimes(new Date(now.getTime() + 864e5), latitude, longitude);
14
+ setSun({ ...times, now, tomorrow });
15
+ };
16
+ const first = setTimeout(tick, 0);
17
+ const timer = setInterval(tick, 60_000);
18
+ return () => {
19
+ clearTimeout(first);
20
+ clearInterval(timer);
21
+ };
22
+ }, [latitude, longitude]);
23
+ return sun;
24
+ }
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/time/sun-today/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAG/D,2HAA2H;AAC3H,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,SAAiB;IAC7D,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAkB,IAAI,CAAC,CAAC;IACtD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,GAAG,EAAE;YAChB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;YAC/C,MAAM,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;YACjC,IAAI,QAAQ;gBAAE,KAAK,GAAG,QAAQ,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;YACrF,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;QACtC,CAAC,CAAC;QACF,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IAC1B,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Sun times for the relevant evening, plus the moment they were computed for. */
2
+ export interface SunToday {
3
+ rise: Date;
4
+ set: Date;
5
+ now: Date;
6
+ /** After today's sunset these are tomorrow's times. */
7
+ tomorrow: boolean;
8
+ }
9
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../source/time/sun-today/type.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,IAAI,CAAC;IACV,GAAG,EAAE,IAAI,CAAC;IACV,uDAAuD;IACvD,QAAQ,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../source/time/sun-today/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /** Minutes since midnight in a time zone for an instant, whatever the visitor's own time zone. */
2
+ export declare function minutesInZone(date: Date, timeZone: string): number;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/time/zone-minute/index.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUlE"}