@camstack/ui-library 1.2.320 → 1.2.322

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.
@@ -0,0 +1,17 @@
1
+ import { type ConfigAccountSignInField } from "@camstack/types";
2
+ import { type ReactElement } from "react";
3
+ export declare function AccountSignInField({ field, values, disabled, onAction, onChangeMany }: {
4
+ readonly field: ConfigAccountSignInField;
5
+ readonly values: Record<string, unknown>;
6
+ readonly disabled?: boolean;
7
+ readonly onAction?: (action: string, key: string, value?: unknown) => Promise<unknown>;
8
+ readonly onChangeMany?: (patch: Record<string, unknown>) => void;
9
+ }): ReactElement;
10
+ export declare function SecretPresenceField({ field, values }: {
11
+ readonly field: {
12
+ readonly sourceKey: string;
13
+ readonly yesLabel: string;
14
+ readonly noLabel: string;
15
+ };
16
+ readonly values: Record<string, unknown>;
17
+ }): ReactElement;
@@ -26,6 +26,13 @@ export declare function dishwasherOperationMeta(operationState: DishwasherOperat
26
26
  export declare function dishwasherHeadline(status: DishwasherStatus, t?: UiTextFn): DishwasherStateMeta;
27
27
  /** Last segment of a feature key, spaced out: `Dishcare.Dishwasher.Program.Eco50` -> `Eco50`. */
28
28
  export declare function featureLabel(key: string): string;
29
+ /**
30
+ * Salt and rinse aid are consumable items (D915). Their events must not
31
+ * reappear on the hero — the Consumables section is the only surface.
32
+ */
33
+ export declare function isConsumableDishwasherEvent(event: string): boolean;
34
+ /** Raised events the hero may name. Consumable events are dropped. */
35
+ export declare function visibleDishwasherEvents(events: readonly string[]): readonly string[];
29
36
  /** Whole seconds as a short duration: `1 h 24 min`, `42 min`, `30 s`. */
30
37
  export declare function formatDuration(seconds: number, t?: UiTextFn): string;
31
38
  export declare function DishwasherInlineControl(props: DeviceControlProps): ReactNode;
@@ -21,6 +21,7 @@
21
21
  * `NAME_COLUMN_TRUNCATE_BREAKPOINT` in device-list/columns.
22
22
  */
23
23
  import { type ReactNode } from "react";
24
+ import type { UseDeviceProxyTrpc } from "../../hooks/use-device-proxy";
24
25
  import type { DeviceItemDevice, DeviceItemParent, DeviceItemVariant, VariantDefaults } from "./helpers";
25
26
  /**
26
27
  * How the name behaves when it does not fit.
@@ -30,6 +31,7 @@ import type { DeviceItemDevice, DeviceItemParent, DeviceItemVariant, VariantDefa
30
31
  */
31
32
  export type DeviceNameOverflow = "truncate" | "scroll";
32
33
  export interface DeviceItemHeaderProps {
34
+ readonly trpc: UseDeviceProxyTrpc;
33
35
  readonly device: DeviceItemDevice;
34
36
  readonly variant: DeviceItemVariant;
35
37
  readonly flags: VariantDefaults;
@@ -53,4 +55,4 @@ export interface DeviceItemHeaderProps {
53
55
  */
54
56
  readonly nameOverflow?: DeviceNameOverflow;
55
57
  }
56
- export declare function DeviceItemHeader({ device, variant, flags, parent, integrationIcon, hasChildren, expanded, onToggleExpand, onNavigateToParent, stacked, nameOverflow }: DeviceItemHeaderProps): ReactNode;
58
+ export declare function DeviceItemHeader({ trpc, device, variant, flags, parent, integrationIcon, hasChildren, expanded, onToggleExpand, onNavigateToParent, stacked, nameOverflow }: DeviceItemHeaderProps): ReactNode;
@@ -38,9 +38,11 @@
38
38
  */
39
39
  import { type JSX } from "react";
40
40
  import type { PickerFleetView } from "./device-fleet-view";
41
- import { type PickerGroup, type PickerId, type PickerItem } from "./device-picker-model";
41
+ import { type PickerGroup, type PickerGroupBy, type PickerId, type PickerItem } from "./device-picker-model";
42
42
  import { type DeviceListState } from "./device-selection";
43
43
  import { type PickerNoun } from "./device-selection-rows";
44
+ /** One device, or the checklist every rule editor uses. */
45
+ export type DevicePickerSelection = "single" | "multiple";
44
46
  export interface DevicePickerProps<Id extends PickerId = number> {
45
47
  /** The devices the list DRAWS — the caller's answered list, `[]` otherwise. */
46
48
  readonly devices: readonly PickerItem<Id>[];
@@ -50,6 +52,16 @@ export interface DevicePickerProps<Id extends PickerId = number> {
50
52
  readonly fleet?: PickerFleetView<Id>;
51
53
  readonly value: readonly Id[];
52
54
  readonly onChange: (next: Id[]) => void;
55
+ /**
56
+ * `single`: one radio, no All/Clear, no "N selected". Choosing a row
57
+ * replaces `value` with that id. Default is the checklist.
58
+ */
59
+ readonly selection?: DevicePickerSelection;
60
+ /**
61
+ * Group this list by zone, location or none. Absent uses the remembered
62
+ * choice. A value here does not change that choice.
63
+ */
64
+ readonly groupBy?: PickerGroupBy;
53
65
  /** Empty selection means EVERY device: say so, and warn when it widens. */
54
66
  readonly emptyMeansAll?: boolean;
55
67
  /** Whether the saved rule had devices — the widening warning survives a remount. */
@@ -79,4 +91,4 @@ export interface DevicePickerProps<Id extends PickerId = number> {
79
91
  /** The line under a locked device. Default "Already added". */
80
92
  readonly lockedNote?: string;
81
93
  }
82
- export declare function DevicePicker<Id extends PickerId = number>({ devices: devicesIn, listState, fleet, value, onChange, emptyMeansAll, savedHadDevices, noun, groupTitle: groupTitleProp, emptyLabel, annotate, disabled, testId, showAll, lockedIds, lockedNote: lockedNoteProp }: DevicePickerProps<Id>): JSX.Element;
94
+ export declare function DevicePicker<Id extends PickerId = number>({ devices: devicesIn, listState, fleet, value, onChange, selection, groupBy: pinnedGroupBy, emptyMeansAll, savedHadDevices, noun, groupTitle: groupTitleProp, emptyLabel, annotate, disabled, testId, showAll, lockedIds, lockedNote: lockedNoteProp }: DevicePickerProps<Id>): JSX.Element;
@@ -1,4 +1,4 @@
1
- export { DevicePicker, type DevicePickerProps } from "./DevicePicker.js";
1
+ export { DevicePicker, type DevicePickerProps, type DevicePickerSelection } from "./DevicePicker.js";
2
2
  export { DeviceFilterBar, typeLabel, type DeviceFilterBarGrouping, type DeviceFilterBarProps } from "./device-filter-bar.js";
3
3
  export { fleetViewOf, type DeviceFleetView, type PickerFleetView } from "./device-fleet-view.js";
4
4
  export { DEVICE_PICKER_GROUP_STORAGE_KEY, readStoredGroupBy, writeStoredGroupBy, useStoredGroupBy, usePickerSiteZones, type StoredGroupBy } from "./device-picker-grouping.js";
@@ -14,6 +14,10 @@ export type { AudioWaveformProps } from "./audio-waveform";
14
14
  export { AudioWaveform } from "./audio-waveform";
15
15
  export type { BatteryBadgeProps, BatteryStatusLike } from "./battery-badge";
16
16
  export { BatteryBadge } from "./battery-badge";
17
+ export type { RunningBadgeProps, RunningStatusLineProps } from "./running-badge";
18
+ export { RunningBadge, RunningStatusLine } from "./running-badge";
19
+ export { runningDurationSince, runningStatusParts } from "./running-status";
20
+ export type { RunningDuration, RunningStatusKey, RunningStatusParts } from "./running-status";
17
21
  export type { ConsumableLevel, ConsumableLevelBadgeProps, ConsumableLevelFieldView } from "./consumable-level-badge";
18
22
  export { CONSUMABLE_LOW_PERCENT, ConsumableLevelBadge, consumableItemLevel, consumableLevelBarClass, consumableLevelLabel, consumableLevelVariant, isConsumableLevelField, parseConsumableLevel } from "./consumable-level-badge";
19
23
  export type { NetworkLinkBadgeProps, NetworkLinkStatusLike } from "./network-link-badge";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * RunningBadge — ring or idle mark around a device lead icon (D933).
3
+ * `null` = unknown (unanswered or cap reported null): children only.
4
+ */
5
+ import type { ReactNode } from "react";
6
+ export interface RunningBadgeProps {
7
+ /** true = running, false = idle, null = unknown. */
8
+ readonly running: boolean | null;
9
+ readonly children: ReactNode;
10
+ readonly className?: string;
11
+ }
12
+ export declare function RunningBadge({ running, children, className }: RunningBadgeProps): ReactNode;
13
+ export interface RunningStatusLineProps {
14
+ readonly running: boolean | null;
15
+ readonly since: number | null;
16
+ readonly phase: string | null;
17
+ readonly className?: string;
18
+ readonly now?: number;
19
+ }
20
+ export declare function RunningStatusLine({ running, since, phase, className, now }: RunningStatusLineProps): ReactNode;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Pure running-state duration helpers for {@link RunningStatusLine} (D933).
3
+ * `now` is always passed in so tests and screenshots stay deterministic.
4
+ */
5
+ export interface RunningDuration {
6
+ /** At least 1 when under 60 minutes. */
7
+ readonly minutes: number;
8
+ }
9
+ export interface RunningDurationHours {
10
+ readonly hours: number;
11
+ }
12
+ export type RunningStatusKey = "running" | "idle" | "unknown";
13
+ export interface RunningStatusParts {
14
+ readonly key: RunningStatusKey;
15
+ readonly duration?: RunningDuration | RunningDurationHours;
16
+ readonly phase?: string;
17
+ }
18
+ /** Minutes elapsed since `since`, at least 1; null when `since` is not usable. */
19
+ export declare function runningDurationSince(since: number | null, now: number): RunningDuration | RunningDurationHours | null;
20
+ export declare function runningStatusParts(running: boolean | null, since: number | null, phase: string | null, now: number): RunningStatusParts;
@@ -1949,6 +1949,8 @@ export declare const useRecordingOnboardSetSettings: typeof trpc.recordingOnboar
1949
1949
  export declare const useRecordingOnboardGetStatus: typeof trpc.recordingOnboard.getStatus.useQuery;
1950
1950
  /** Generated alias around `trpc.recordingSignal.getStatus.useQuery`. */
1951
1951
  export declare const useRecordingSignalGetStatus: typeof trpc.recordingSignal.getStatus.useQuery;
1952
+ /** Generated alias around `trpc.runningState.getStatus.useQuery`. */
1953
+ export declare const useRunningStateGetStatus: typeof trpc.runningState.getStatus.useQuery;
1952
1954
  /** Generated alias around `trpc.sceneMonitor.listScenes.useQuery`. */
1953
1955
  export declare const useSceneMonitorListScenes: typeof trpc.sceneMonitor.listScenes.useQuery;
1954
1956
  /** Generated alias around `trpc.sceneMonitor.listScenesBatch.useQuery`. */