@camstack/ui-library 1.2.226 → 1.2.228

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,6 @@
1
+ import { ReactNode } from 'react';
2
+ export interface DeviceQuickDetailActionProps {
3
+ readonly deviceId: number;
4
+ readonly className?: string;
5
+ }
6
+ export declare function DeviceQuickDetailAction({ deviceId, className, }: DeviceQuickDetailActionProps): ReactNode;
@@ -65,6 +65,11 @@ export interface DeviceListGenericProps<T> {
65
65
  readonly filterOptions?: readonly MultiSelectOption[];
66
66
  /** Label for the type multi-select trigger. Default 'Type'. */
67
67
  readonly filterLabel?: string;
68
+ /**
69
+ * Initial type-filter selection. Empty (default) = no filter. Used once at
70
+ * mount — later changes to this prop are ignored (local state owns it).
71
+ */
72
+ readonly initialTypeFilters?: readonly string[];
68
73
  readonly isLoading?: boolean;
69
74
  readonly searchPlaceholder?: string;
70
75
  readonly emptyLabel?: string;
@@ -6,7 +6,9 @@ export interface SelectedChipProps {
6
6
  /** A selection the hub no longer has — drawn in warning colour. */
7
7
  readonly warning?: boolean;
8
8
  readonly iconId?: string;
9
+ /** Brand / raster icon URL (e.g. notifier kind icon). */
10
+ readonly iconUrl?: string;
9
11
  readonly testId?: string;
10
12
  }
11
13
  /** One selected entry as a removable chip. */
12
- export declare function SelectedChip({ label, onRemove, warning, iconId, testId, }: SelectedChipProps): import("react").JSX.Element;
14
+ export declare function SelectedChip({ label, onRemove, warning, iconId, iconUrl, testId, }: SelectedChipProps): import("react").JSX.Element;
@@ -79,6 +79,8 @@ export { DeviceBatchToolbar } from './device-list/batch-toolbar';
79
79
  export * from './device-meta';
80
80
  export * from './icon-picker';
81
81
  export { DeviceMultiSelectField, DeviceSelectField } from './device-select-field';
82
+ export type { NotificationTargetOption, NotificationTargetSelectFieldProps, NotificationTargetsFieldProps, } from './notification-targets-field';
83
+ export { ConfigNotificationTargetMultiSelectFieldView, ConfigNotificationTargetSelectFieldView, NotificationTargetSelectField, NotificationTargetsField, } from './notification-targets-field';
82
84
  export type { DeviceSelectCandidate } from './device-select-filter';
83
85
  export { deviceMatchesFilter, deviceOptionLabel, devicesToOptions, filterDeviceOptions, selectedDeviceOptions, } from './device-select-filter';
84
86
  export type { DeviceSelectorTab, SelectorDevice } from './device-selector-picker';
@@ -170,6 +172,8 @@ export * from './version-badge';
170
172
  export * from './widget-panel.js';
171
173
  export type { WidgetSlotProps } from './widget-slot';
172
174
  export { WidgetSlot } from './widget-slot';
175
+ export type { OptionSelectMultiProps, OptionSelectOption, OptionSelectProps, OptionSelectSingleProps, } from './option-select/index.js';
176
+ export { OptionSelect, OPTION_SELECT_SEARCH_MIN_OPTIONS, catalogHasDraft, draftFromQuery, filterOptions as filterOptionSelectOptions, optionSearchText as optionSelectSearchText, partitionSelected as partitionOptionSelectSelected, resolveSearchable as resolveOptionSelectSearchable, shouldShowAddNewFooter, shouldShowUseQueryRow, } from './option-select/index.js';
173
177
  export * from './device-picker/index.js';
174
178
  export * from './unit-picker/index.js';
175
179
  export * from './placeholder-field/index.js';
@@ -0,0 +1,66 @@
1
+ import { ConfigNotificationTargetMultiSelectField, ConfigNotificationTargetSelectField } from '@camstack/types';
2
+ import { TranslationFn } from './config-form-builder';
3
+ import { NotificationTargetOption } from './notification-targets-options';
4
+ export type { NotificationTargetOption } from './notification-targets-options';
5
+ export interface NotificationTargetsFieldProps {
6
+ readonly targets: readonly NotificationTargetOption[];
7
+ readonly value: readonly string[];
8
+ readonly onChange: (next: string[]) => void;
9
+ readonly disabled?: boolean;
10
+ /** Cap on how many targets may be selected. */
11
+ readonly maxItems?: number;
12
+ /** Per-target test id is `<prefix>-<id>`. Default `notification-target`. */
13
+ readonly testIdPrefix?: string;
14
+ /** What an empty catalog says. */
15
+ readonly emptyMessage?: string;
16
+ /** Target ids that carry an extra note badge (e.g. already covered by a rule). */
17
+ readonly noteIds?: ReadonlySet<string>;
18
+ /** Label on the note badge. Default `note`. */
19
+ readonly noteLabel?: string;
20
+ readonly label?: string;
21
+ readonly description?: string;
22
+ /** Kind brand icons keyed as `addonId:kind`. */
23
+ readonly kindIconUrls?: ReadonlyMap<string, string>;
24
+ }
25
+ export interface NotificationTargetSelectFieldProps {
26
+ readonly targets: readonly NotificationTargetOption[];
27
+ readonly value: string;
28
+ readonly onChange: (next: string) => void;
29
+ readonly disabled?: boolean;
30
+ readonly emptyMessage?: string;
31
+ readonly placeholder?: string;
32
+ readonly testId?: string;
33
+ readonly label?: string;
34
+ readonly description?: string;
35
+ readonly kindIconUrls?: ReadonlyMap<string, string>;
36
+ }
37
+ /**
38
+ * Multi-select of delivery targets (NC Summaries / Timelapses / Rules shape).
39
+ */
40
+ export declare function NotificationTargetsField({ targets, value, onChange, disabled, maxItems, testIdPrefix, emptyMessage, noteIds, noteLabel, label, description, kindIconUrls: kindIconUrlsProp, }: NotificationTargetsFieldProps): import("react").JSX.Element;
41
+ /**
42
+ * Single-select of one delivery target (Calendar events / script settings).
43
+ */
44
+ export declare function NotificationTargetSelectField({ targets, value, onChange, disabled, emptyMessage, placeholder, testId, label, description, kindIconUrls: kindIconUrlsProp, }: NotificationTargetSelectFieldProps): import("react").JSX.Element;
45
+ /**
46
+ * ConfigUISchema `notification-target-multiselect` — fetches listTargets and
47
+ * stores a `string[]` of target ids.
48
+ */
49
+ export declare function ConfigNotificationTargetMultiSelectFieldView({ field, value, onChange, disabled, translationFn, }: {
50
+ readonly field: ConfigNotificationTargetMultiSelectField;
51
+ readonly value: unknown;
52
+ readonly onChange: (v: unknown) => void;
53
+ readonly disabled?: boolean;
54
+ readonly translationFn?: TranslationFn;
55
+ }): import("react").JSX.Element;
56
+ /**
57
+ * ConfigUISchema `notification-target-select` — fetches listTargets and stores
58
+ * one target id string.
59
+ */
60
+ export declare function ConfigNotificationTargetSelectFieldView({ field, value, onChange, disabled, translationFn, }: {
61
+ readonly field: ConfigNotificationTargetSelectField;
62
+ readonly value: unknown;
63
+ readonly onChange: (v: unknown) => void;
64
+ readonly disabled?: boolean;
65
+ readonly translationFn?: TranslationFn;
66
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { OptionSelectOption } from './option-select/option-select-model';
2
+ export type NotificationTargetOption = {
3
+ readonly id: string;
4
+ readonly name: string;
5
+ readonly enabled: boolean;
6
+ readonly kind?: string;
7
+ readonly addonId?: string;
8
+ };
9
+ export declare function targetsToOptions(targets: readonly NotificationTargetOption[], kindIconUrls: ReadonlyMap<string, string>, noteIds: ReadonlySet<string> | undefined, noteLabel: string): readonly OptionSelectOption[];
10
+ export declare function buildKindIconMap(rows: unknown): ReadonlyMap<string, string>;
11
+ export declare function toTargetOptions(rows: unknown): readonly NotificationTargetOption[];
@@ -0,0 +1,30 @@
1
+ import { OptionSelectOption } from './option-select-model';
2
+ type OptionSelectSharedProps = {
3
+ readonly options: readonly OptionSelectOption[];
4
+ readonly placeholder?: string;
5
+ readonly searchable?: boolean;
6
+ readonly disabled?: boolean;
7
+ readonly emptyMessage?: string;
8
+ readonly creatable?: boolean;
9
+ readonly createLabel?: string;
10
+ readonly onCreateRequest?: (draft: string) => void;
11
+ readonly label?: string;
12
+ readonly description?: string;
13
+ readonly testId?: string;
14
+ readonly optionTestIdPrefix?: string;
15
+ readonly listboxId?: string;
16
+ };
17
+ export type OptionSelectSingleProps = OptionSelectSharedProps & {
18
+ readonly mode: 'single';
19
+ readonly value: string;
20
+ readonly onChange: (next: string) => void;
21
+ };
22
+ export type OptionSelectMultiProps = OptionSelectSharedProps & {
23
+ readonly mode: 'multi';
24
+ readonly value: readonly string[];
25
+ readonly onChange: (next: string[]) => void;
26
+ readonly maxItems?: number;
27
+ };
28
+ export type OptionSelectProps = OptionSelectSingleProps | OptionSelectMultiProps;
29
+ export declare function OptionSelect(props: OptionSelectProps): import("react").JSX.Element;
30
+ export {};
@@ -0,0 +1,4 @@
1
+ export type { OptionSelectOption } from './option-select-model';
2
+ export { OPTION_SELECT_SEARCH_MIN_OPTIONS, catalogHasDraft, draftFromQuery, filterOptions, optionSearchText, partitionSelected, resolveSearchable, shouldShowAddNewFooter, shouldShowUseQueryRow, } from './option-select-model';
3
+ export type { OptionSelectMultiProps, OptionSelectProps, OptionSelectSingleProps, } from './OptionSelect';
4
+ export { OptionSelect } from './OptionSelect';
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Pure filter/partition helpers for OptionSelect.
3
+ *
4
+ * Search is a case-insensitive substring match folded over each option's
5
+ * `value`, `label`, and `description`. Multi-token queries require every
6
+ * token to match (AND).
7
+ */
8
+ export type OptionSelectOption = {
9
+ value: string;
10
+ label: string;
11
+ description?: string;
12
+ iconUrl?: string;
13
+ iconId?: string;
14
+ disabled?: boolean;
15
+ badge?: string;
16
+ };
17
+ /** Number of options at/above which search is enabled by default (unless creatable). */
18
+ export declare const OPTION_SELECT_SEARCH_MIN_OPTIONS = 8;
19
+ /** Fold an option into a single lower-cased haystack (value + label + description). */
20
+ export declare function optionSearchText(opt: OptionSelectOption): string;
21
+ /**
22
+ * Filter options by a free-text query. An empty / whitespace-only query
23
+ * returns every option (identity, preserving order).
24
+ */
25
+ export declare function filterOptions(options: readonly OptionSelectOption[], query: string): readonly OptionSelectOption[];
26
+ /**
27
+ * Split options into the currently-selected set (in selection order) and the
28
+ * rest. Selected values with no matching option are surfaced as synthetic
29
+ * options whose label falls back to the raw value.
30
+ */
31
+ export declare function partitionSelected(options: readonly OptionSelectOption[], selected: readonly string[]): {
32
+ readonly selectedOptions: readonly OptionSelectOption[];
33
+ readonly unselected: readonly OptionSelectOption[];
34
+ };
35
+ export declare function resolveSearchable(optionCount: number, creatable: boolean, searchable: boolean | undefined): boolean;
36
+ /** Trimmed non-empty draft from the search box, or null when absent. */
37
+ export declare function draftFromQuery(query: string): string | null;
38
+ /**
39
+ * True when an existing catalog option already represents this draft (value or
40
+ * label, case-insensitive). Used to hide the “Use «query»” row when redundant.
41
+ */
42
+ export declare function catalogHasDraft(options: readonly OptionSelectOption[], draft: string): boolean;
43
+ /**
44
+ * Show the footer “Add new…” action only when creatable AND the caller
45
+ * provided `onCreateRequest` (e.g. open a dedicated create dialog).
46
+ *
47
+ * Without that hook the footer was a no-op (it only focused the search box),
48
+ * which read as “Add new is broken”. Free-form create already works via the
49
+ * “Use «query»” row once the operator types — no footer needed.
50
+ */
51
+ export declare function shouldShowAddNewFooter(creatable: boolean, hasCreateRequest: boolean): boolean;
52
+ /**
53
+ * Show the “Use «query»” commit row: creatable, a non-empty draft, and no
54
+ * catalog option that already matches the draft.
55
+ */
56
+ export declare function shouldShowUseQueryRow(creatable: boolean, query: string, options: readonly OptionSelectOption[]): boolean;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ export type DeviceQuickDetailOpen = (deviceId: number) => void;
3
+ export interface DeviceQuickDetailProviderProps {
4
+ readonly open: DeviceQuickDetailOpen;
5
+ readonly children: ReactNode;
6
+ }
7
+ export declare function DeviceQuickDetailProvider({ open, children, }: DeviceQuickDetailProviderProps): ReactNode;
8
+ /** The host's open callback, or null when no provider is mounted. */
9
+ export declare function useDeviceQuickDetailOpen(): DeviceQuickDetailOpen | null;
@@ -243,8 +243,10 @@ export declare const useButtonPress: typeof trpc.button.press.useMutation;
243
243
  export declare const useCalendarsListCalendars: typeof trpc.calendars.listCalendars.useQuery;
244
244
  /** Generated alias around `trpc.calendars.listEvents.useQuery`. */
245
245
  export declare const useCalendarsListEvents: typeof trpc.calendars.listEvents.useQuery;
246
- /** Generated alias around `trpc.calendars.importFromHomeAssistant.useMutation`. */
247
- export declare const useCalendarsImportFromHomeAssistant: typeof trpc.calendars.importFromHomeAssistant.useMutation;
246
+ /** Generated alias around `trpc.calendars.getPreferences.useQuery`. */
247
+ export declare const useCalendarsGetPreferences: typeof trpc.calendars.getPreferences.useQuery;
248
+ /** Generated alias around `trpc.calendars.setCalendarPreference.useMutation`. */
249
+ export declare const useCalendarsSetCalendarPreference: typeof trpc.calendars.setCalendarPreference.useMutation;
248
250
  /** Generated alias around `trpc.cameraCredentials.getCredentials.useQuery`. */
249
251
  export declare const useCameraCredentialsGetCredentials: typeof trpc.cameraCredentials.getCredentials.useQuery;
250
252
  /** Generated alias around `trpc.cameraCredentials.getStatus.useQuery`. */
@@ -331,6 +333,10 @@ export declare const useCoreBlocksSetEnabled: typeof trpc.coreBlocks.setEnabled.
331
333
  export declare const useCoreBlocksRestart: typeof trpc.coreBlocks.restart.useMutation;
332
334
  /** Generated alias around `trpc.coreBlocks.compile.useMutation`. */
333
335
  export declare const useCoreBlocksCompile: typeof trpc.coreBlocks.compile.useMutation;
336
+ /** Generated alias around `trpc.coreBlocks.getBlockSettings.useQuery`. */
337
+ export declare const useCoreBlocksGetBlockSettings: typeof trpc.coreBlocks.getBlockSettings.useQuery;
338
+ /** Generated alias around `trpc.coreBlocks.updateBlockSettings.useMutation`. */
339
+ export declare const useCoreBlocksUpdateBlockSettings: typeof trpc.coreBlocks.updateBlockSettings.useMutation;
334
340
  /** Generated alias around `trpc.coreBlocks.getTypeDefs.useQuery`. */
335
341
  export declare const useCoreBlocksGetTypeDefs: typeof trpc.coreBlocks.getTypeDefs.useQuery;
336
342
  /** Generated alias around `trpc.coreBlocks.createComposition.useMutation`. */
@@ -1071,8 +1077,12 @@ export declare const useNodesExecuteQuery: typeof trpc.nodes.executeQuery.useMut
1071
1077
  export declare const useNotificationOutputListTargetKinds: typeof trpc.notificationOutput.listTargetKinds.useQuery;
1072
1078
  /** Generated alias around `trpc.notificationOutput.listTargets.useQuery`. */
1073
1079
  export declare const useNotificationOutputListTargets: typeof trpc.notificationOutput.listTargets.useQuery;
1080
+ /** Generated alias around `trpc.notificationOutput.getTarget.useQuery`. */
1081
+ export declare const useNotificationOutputGetTarget: typeof trpc.notificationOutput.getTarget.useQuery;
1074
1082
  /** Generated alias around `trpc.notificationOutput.discoverTargets.useQuery`. */
1075
1083
  export declare const useNotificationOutputDiscoverTargets: typeof trpc.notificationOutput.discoverTargets.useQuery;
1084
+ /** Generated alias around `trpc.notificationOutput.probeTargetConfig.useMutation`. */
1085
+ export declare const useNotificationOutputProbeTargetConfig: typeof trpc.notificationOutput.probeTargetConfig.useMutation;
1076
1086
  /** Generated alias around `trpc.notificationOutput.send.useMutation`. */
1077
1087
  export declare const useNotificationOutputSend: typeof trpc.notificationOutput.send.useMutation;
1078
1088
  /** Generated alias around `trpc.notificationOutput.testTarget.useMutation`. */
@@ -1095,6 +1105,16 @@ export declare const useNotificationRulesUpdateRule: typeof trpc.notificationRul
1095
1105
  export declare const useNotificationRulesDeleteRule: typeof trpc.notificationRules.deleteRule.useMutation;
1096
1106
  /** Generated alias around `trpc.notificationRules.setRuleEnabled.useMutation`. */
1097
1107
  export declare const useNotificationRulesSetRuleEnabled: typeof trpc.notificationRules.setRuleEnabled.useMutation;
1108
+ /** Generated alias around `trpc.notificationRules.listSequences.useQuery`. */
1109
+ export declare const useNotificationRulesListSequences: typeof trpc.notificationRules.listSequences.useQuery;
1110
+ /** Generated alias around `trpc.notificationRules.getSequence.useQuery`. */
1111
+ export declare const useNotificationRulesGetSequence: typeof trpc.notificationRules.getSequence.useQuery;
1112
+ /** Generated alias around `trpc.notificationRules.createSequence.useMutation`. */
1113
+ export declare const useNotificationRulesCreateSequence: typeof trpc.notificationRules.createSequence.useMutation;
1114
+ /** Generated alias around `trpc.notificationRules.updateSequence.useMutation`. */
1115
+ export declare const useNotificationRulesUpdateSequence: typeof trpc.notificationRules.updateSequence.useMutation;
1116
+ /** Generated alias around `trpc.notificationRules.deleteSequence.useMutation`. */
1117
+ export declare const useNotificationRulesDeleteSequence: typeof trpc.notificationRules.deleteSequence.useMutation;
1098
1118
  /** Generated alias around `trpc.notificationRules.getClipRetentionAsks.useQuery`. */
1099
1119
  export declare const useNotificationRulesGetClipRetentionAsks: typeof trpc.notificationRules.getClipRetentionAsks.useQuery;
1100
1120
  /** Generated alias around `trpc.notificationRules.listDeviceMutes.useQuery`. */
@@ -1,3 +1,4 @@
1
+ export { useUrlQueryParam } from './use-url-query';
1
2
  export type { ClusterNode, ClusterTopologyNode, ClusterTopologyResult, } from './use-cluster-nodes';
2
3
  export { useClusterNodes, useClusterTopology } from './use-cluster-nodes';
3
4
  export { useDebouncedString } from './use-debounced-string';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * One query param as React state. `null` means absent.
3
+ * Changing it replaces the URL without a navigation.
4
+ */
5
+ export declare function useUrlQueryParam(key: string): readonly [string | null, (next: string | null) => void];