@glasshome/widget-sdk 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/framework/hooks/index.d.ts +2 -0
- package/dist/framework/hooks/use-intersection-pause.d.ts +7 -0
- package/dist/framework/hooks/use-reduced-motion.d.ts +7 -0
- package/dist/framework/index.d.ts +2 -2
- package/dist/framework/theming/index.d.ts +1 -0
- package/dist/framework/theming/svg-colors.d.ts +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +493 -425
- package/dist/shared/spline.d.ts +5 -0
- package/package.json +1 -1
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
* Hooks for widget development: context, dialog, entity group.
|
|
5
5
|
*/
|
|
6
6
|
export { type ReactiveWidgetContext, useWidgetContext, WidgetCtx, } from "./use-widget-context";
|
|
7
|
+
export { useIntersectionPause } from "./use-intersection-pause";
|
|
8
|
+
export { useReducedMotion } from "./use-reduced-motion";
|
|
7
9
|
export { useWidgetDialog, type WidgetDialogReturn } from "./use-widget-dialog";
|
|
8
10
|
export { type AggregationPreset, type UseWidgetEntityGroupOptions, type UseWidgetEntityGroupResult, useWidgetEntityGroup, } from "./use-widget-entity-group";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
/**
|
|
3
|
+
* True while `el` is outside the viewport, so callers can pause animation.
|
|
4
|
+
*
|
|
5
|
+
* SSR-safe: returns a constant `false` when `IntersectionObserver` is absent.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useIntersectionPause(el: Accessor<Element | undefined>): Accessor<boolean>;
|
|
@@ -37,9 +37,9 @@ export { WidgetTitle } from "./components/WidgetTitle";
|
|
|
37
37
|
export { WidgetValue } from "./components/WidgetValue";
|
|
38
38
|
export { WidgetSliderFill } from "./backgrounds/WidgetSliderFill";
|
|
39
39
|
export { WidgetDialog, type WidgetDialogProps, type WidgetDialogTab } from "./dialogs";
|
|
40
|
-
export { type AggregationPreset, type ReactiveWidgetContext, type UseWidgetEntityGroupOptions, type UseWidgetEntityGroupResult, useWidgetContext, useWidgetDialog, useWidgetEntityGroup, WidgetCtx, type WidgetDialogReturn, } from "./hooks";
|
|
40
|
+
export { type AggregationPreset, type ReactiveWidgetContext, type UseWidgetEntityGroupOptions, type UseWidgetEntityGroupResult, useIntersectionPause, useReducedMotion, useWidgetContext, useWidgetDialog, useWidgetEntityGroup, WidgetCtx, type WidgetDialogReturn, } from "./hooks";
|
|
41
41
|
export { type GestureHandlers, useWidgetGestures } from "./gestures/use-widget-gestures";
|
|
42
|
-
export { injectTokens, type Tone, ToneSchema, } from "./theming";
|
|
42
|
+
export { injectTokens, type SvgColorKey, svgColors, type Tone, ToneSchema, } from "./theming";
|
|
43
43
|
export { widgetFields } from "./fields";
|
|
44
44
|
export { calculateLightGroup, calculateSensorGroup, countActiveEntities, getEntityAttribute, isEntityActive, type LightGroupResult, type SensorGroupResult, type SensorGroupType, } from "./utils";
|
|
45
45
|
export type { EntityView, WidgetStyles, WidgetVariantConfig, } from "./types";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy design tokens for SVG charts.
|
|
3
|
+
*
|
|
4
|
+
* Each entry resolves to colors directly usable in SVG `fill`/`stroke`
|
|
5
|
+
* attributes: `solid`/`stroke` at full opacity, `fill` reduced for area fills.
|
|
6
|
+
*/
|
|
7
|
+
declare const base: {
|
|
8
|
+
readonly solar: "oklch(0.74 0.18 60)";
|
|
9
|
+
readonly grid: "oklch(0.62 0.12 245)";
|
|
10
|
+
readonly battery: "oklch(0.70 0.18 145)";
|
|
11
|
+
readonly ev: "oklch(0.70 0.14 190)";
|
|
12
|
+
readonly home: "oklch(0.68 0.06 250)";
|
|
13
|
+
readonly positive: "oklch(0.70 0.14 160)";
|
|
14
|
+
readonly negative: "oklch(0.64 0.22 27)";
|
|
15
|
+
};
|
|
16
|
+
export type SvgColorKey = keyof typeof base;
|
|
17
|
+
interface SvgColorEntry {
|
|
18
|
+
fill: string;
|
|
19
|
+
stroke: string;
|
|
20
|
+
solid: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const svgColors: Record<SvgColorKey, SvgColorEntry>;
|
|
23
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { defineWidget } from "./define-widget";
|
|
2
2
|
export * from "./framework";
|
|
3
|
+
export { monotoneCubicPath } from "./shared/spline";
|
|
3
4
|
export { formatSchemaError, WidgetManifestSchema } from "./schemas";
|
|
4
5
|
export { isDark } from "./theme";
|
|
5
6
|
export type { GridSize, WidgetContext, WidgetDefinition, WidgetManifest, } from "./types";
|