@bravotango/circadian-current-conditions 0.1.3 → 0.1.4

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.
@@ -19,5 +19,8 @@ export const currentConditions = (tokens) => {
19
19
  // Wind
20
20
  cssVars[`${cssPrefix}-wind-speed`] = windSpeedToDuration(tokens.wind.speed);
21
21
  cssVars[`${cssPrefix}-wind-speed-text`] = tokens.wind.speed.toString();
22
+ cssVars[`${cssPrefix}-wind-precipitation-degrees`] =
23
+ `${tokens.wind.precipitationDegree.toString()}deg`;
24
+ cssVars[`${cssPrefix}-wind-degrees`] = `${tokens.wind.degrees.toString()}deg`;
22
25
  return cssVars;
23
26
  };
@@ -1,7 +1,10 @@
1
+ // circadian-current-conditions/src/skin/index.ts
1
2
  import { currentConditions } from "../maps/current-conditions";
2
3
  export const currentConditionsSkin = {
3
4
  apply(tokens) {
5
+ // console.log("SKIN RECEIVED:", tokens.wind);
4
6
  const vars = currentConditions(tokens);
7
+ // console.log("CSS VARS:", vars);
5
8
  Object.entries(vars).forEach(([key, value]) => {
6
9
  document.documentElement.style.setProperty(key, value);
7
10
  });
@@ -1,8 +1,8 @@
1
1
  export const TIME_OF_DAY_COLOR_MAP = {
2
- day: { clear: "#3987fc", default: "#a5a5a5" },
2
+ day: { clear: "#3987fc", default: "#9ea1bb" },
3
3
  night: { clear: "#0a2b4d", default: "#141414" },
4
- sunrise: { clear: "#d64400", default: "#818181" },
5
- sunset: { clear: "#6f00d6", default: "#222222" },
4
+ sunrise: { clear: "#d64400", default: "#bb7758" },
5
+ sunset: { clear: "#6f00d6", default: "#7a688a" },
6
6
  };
7
7
  export const getTimeOfDayColor = (timeOfDay, condition) => {
8
8
  const entry = TIME_OF_DAY_COLOR_MAP[timeOfDay];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bravotango/circadian-current-conditions",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "",
@@ -8,7 +8,7 @@
8
8
  "author": "",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "@bravotango/circadian-ui": "0.1.1"
11
+ "@bravotango/circadian-ui": "0.2.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@types/jest": "^30.0.0",
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- // circadian-skins/src/index.ts
1
+ // circadian-current-conditions/src/index.ts
2
2
  import type { CircadianTokens } from "@bravotango/circadian-ui";
3
3
  import { currentConditionsSkin } from "./skin/";
4
4
  export const applyCircadianSkin = (tokens: CircadianTokens) => {
@@ -30,9 +30,6 @@ export const currentConditions = (
30
30
  if (currentConditionImage)
31
31
  cssVars[`${cssPrefix}-img`] = `url("${currentConditionImage}")`;
32
32
 
33
- cssVars[`${cssPrefix}-precipitation-degrees`] =
34
- `${tokens.wind.precipitationDegree.toString()}deg`;
35
-
36
33
  // Weather color
37
34
  cssVars[`${cssPrefix}-color`] = getWeatherColor(tokens.current.condition);
38
35
 
@@ -43,6 +40,8 @@ export const currentConditions = (
43
40
  // Wind
44
41
  cssVars[`${cssPrefix}-wind-speed`] = windSpeedToDuration(tokens.wind.speed);
45
42
  cssVars[`${cssPrefix}-wind-speed-text`] = tokens.wind.speed.toString();
43
+ cssVars[`${cssPrefix}-wind-precipitation-degrees`] =
44
+ `${tokens.wind.precipitationDegree.toString()}deg`;
46
45
  cssVars[`${cssPrefix}-wind-degrees`] = `${tokens.wind.degrees.toString()}deg`;
47
46
 
48
47
  return cssVars;
package/src/skin/index.ts CHANGED
@@ -1,9 +1,12 @@
1
+ // circadian-current-conditions/src/skin/index.ts
1
2
  import { currentConditions } from "../maps/current-conditions";
2
3
  import type { CircadianSkin } from "../types";
3
4
 
4
5
  export const currentConditionsSkin: CircadianSkin = {
5
6
  apply(tokens) {
7
+ // console.log("SKIN RECEIVED:", tokens.wind);
6
8
  const vars = currentConditions(tokens);
9
+ // console.log("CSS VARS:", vars);
7
10
  Object.entries(vars).forEach(([key, value]) => {
8
11
  document.documentElement.style.setProperty(key, value);
9
12
  });
@@ -4,10 +4,10 @@ export const TIME_OF_DAY_COLOR_MAP: Record<
4
4
  TimeOfDay,
5
5
  { clear: string; default: string }
6
6
  > = {
7
- day: { clear: "#3987fc", default: "#a5a5a5" },
7
+ day: { clear: "#3987fc", default: "#9ea1bb" },
8
8
  night: { clear: "#0a2b4d", default: "#141414" },
9
- sunrise: { clear: "#d64400", default: "#818181" },
10
- sunset: { clear: "#6f00d6", default: "#222222" },
9
+ sunrise: { clear: "#d64400", default: "#bb7758" },
10
+ sunset: { clear: "#6f00d6", default: "#7a688a" },
11
11
  };
12
12
 
13
13
  export const getTimeOfDayColor = (