@texturehq/edges 2.4.3 → 2.4.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.
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { BreadcrumbProps, BreadcrumbsProps, DateValue, CalendarProps as CalendarProps$1, ValidationResult, DisclosureGroupProps, DisclosurePanelProps, ButtonProps, DisclosureProps, DateRangePickerProps as DateRangePickerProps$1, FormProps, TooltipTriggerComponentProps, TooltipProps as TooltipProps$1, ListBoxProps as ListBoxProps$1, ListBoxItemProps, ModalOverlayProps, Key, PopoverProps as PopoverProps$1, ProgressBarProps as ProgressBarProps$1, RangeCalendarProps as RangeCalendarProps$1, TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps, TabsProps as TabsProps$2 } from 'react-aria-components';
2
2
  export { BreadcrumbProps, BreadcrumbsProps, DialogTrigger } from 'react-aria-components';
3
- import { Virtualizer } from '@tanstack/react-virtual';
4
- import * as React$1 from 'react';
5
- import React__default, { RefObject, ComponentType, ReactNode, HTMLAttributes, ComponentProps, CSSProperties, Component, ErrorInfo } from 'react';
6
- import { U as FieldValue, V as BooleanFormat, W as FormattedValue, X as FieldFormat, Z as CurrentFormat, _ as DateFormat, $ as DistanceFormat, a0 as EnergyUnit, a1 as EnergyFormat, a2 as CurrencyFormat, a3 as NumberFormat, a4 as PhoneFormat, a5 as PowerFormat, a6 as FormatterFunction, a7 as ResistanceFormat, a8 as TemperatureFormat, a9 as TemperatureUnitString, aa as TemperatureUnit, ab as TextFormat, ac as VoltageFormat, B as BadgeProps, d as BaseDataPoint, u as YFormatType, q as TooltipData, ad as DeviceState, ae as GridState, af as ComponentFormatter, ag as LayerSpec, ah as CustomPinsSpec, ai as GeoJsonLayerSpec, aj as RasterLayerSpec, ak as VectorLayerSpec, al as ClusteredVectorLayerSpec } from './colors-DOYgrvZw.js';
7
- export { A as ActionItem, am as ActionMenu, a as ActionMenuProps, an as AppShell, b as AppShellProps, ao as Avatar, c as AvatarProps, ap as Badge, aq as BaseFormat, ar as ChartContext, C as ChartMargin, as as CodeEditor, e as CodeEditorProps, f as CodeLanguage, g as CodeTheme, at as ColorSpec, au as ComponentFormatOptions, av as CurrentUnit, aw as CustomFormat, ax as DEFAULT_MAP_TYPE, ay as DateFormatStyle, az as DistanceUnit, aA as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, aB as EntityCategory, aC as EntityCategoryConfig, h as EntityConfig, i as EntityType, aD as GRID_STATE_COLORS, aE as GridStateColor, H as Heading, aF as InteractiveMap, aG as InteractiveMapHandle, I as InteractiveMapProps, aH as LayerFeature, aI as LayerStyle, L as Loader, j as Logo, aJ as MAP_TYPES, M as MapPoint, aK as MapType, aL as Meter, k as MeterProps, aM as MetricFormat, aN as PercentageFormat, aO as PowerUnit, aP as RenderType, aQ as ResistanceUnit, S as SegmentOption, aR as SegmentedControl, l as SegmentedControlProps, m as SideNav, n as SideNavItem, o as SideNavProps, aS as StackNav, aT as StackNavGroup, aU as StackNavItem, aV as StackNavLinkComponentProps, aW as StackNavProps, aX as StackNavTheme, aY as StaticMap, p as StaticMapProps, T as TextLink, aZ as TextTransform, a_ as TextTruncatePosition, r as TooltipSeries, s as TopNav, t as TopNavProps, a$ as VoltageUnit, Y as YFormatSettings, b0 as ZoomStops, b1 as activeDeviceStates, b2 as baselineFromPoint, v as clearColorCache, w as createCategoryColorMap, x as createXScale, y as createYScale, z as defaultMargin, b3 as deviceStateLabels, b4 as deviceStateMetricFormats, b5 as formatComponentValue, D as getContrastingTextColor, F as getDefaultChartColor, G as getDefaultColors, b6 as getDeviceStateDisplayLabel, b6 as getDeviceStateLabel, b7 as getEntityCategory, J as getEntityConfig, K as getEntityIcon, N as getEntityLabel, b8 as getGridStateLabel, O as getResolvedColor, P as getThemeCategoricalColors, Q as getYFormatSettings, b9 as gridStateLabels, ba as isActiveDeviceState, ba as isActiveState, R as isLightColor, bb as mapValuesToCategoricalColors, bc as useChartContext, bd as useComponentFormatter } from './colors-DOYgrvZw.js';
3
+ import { B as BadgeProps, U as FieldValue, V as BooleanFormat, W as FormattedValue, X as FieldFormat, Z as CurrentFormat, _ as DateFormat, $ as DistanceFormat, a0 as EnergyUnit, a1 as EnergyFormat, a2 as CurrencyFormat, a3 as NumberFormat, a4 as PhoneFormat, a5 as PowerFormat, a6 as FormatterFunction, a7 as ResistanceFormat, a8 as TemperatureFormat, a9 as TemperatureUnitString, aa as TemperatureUnit, ab as TextFormat, ac as VoltageFormat, d as BaseDataPoint, u as YFormatType, q as TooltipData, ad as DeviceState, ae as GridState, af as ComponentFormatter, ag as LayerSpec, ah as CustomPinsSpec, ai as GeoJsonLayerSpec, aj as RasterLayerSpec, ak as VectorLayerSpec, al as ClusteredVectorLayerSpec } from './colors-B85aftHP.js';
4
+ export { A as ActionItem, am as ActionMenu, a as ActionMenuProps, an as AppShell, b as AppShellProps, ao as Avatar, c as AvatarProps, ap as Badge, aq as BaseFormat, ar as ChartContext, C as ChartMargin, as as CodeEditor, e as CodeEditorProps, f as CodeLanguage, g as CodeTheme, at as ColorSpec, au as ComponentFormatOptions, av as CurrentUnit, aw as CustomFormat, ax as DEFAULT_MAP_TYPE, ay as DateFormatStyle, az as DistanceUnit, aA as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, aB as EntityCategory, aC as EntityCategoryConfig, h as EntityConfig, i as EntityType, aD as GRID_STATE_COLORS, aE as GridStateColor, H as Heading, aF as InteractiveMap, aG as InteractiveMapHandle, I as InteractiveMapProps, aH as LayerFeature, aI as LayerStyle, L as Loader, j as Logo, aJ as MAP_TYPES, M as MapPoint, aK as MapType, aL as Meter, k as MeterProps, aM as MetricFormat, aN as PercentageFormat, aO as PowerUnit, aP as RenderType, aQ as ResistanceUnit, S as SegmentOption, aR as SegmentedControl, l as SegmentedControlProps, m as SideNav, n as SideNavItem, o as SideNavProps, aS as StackNav, aT as StackNavGroup, aU as StackNavItem, aV as StackNavLinkComponentProps, aW as StackNavProps, aX as StackNavTheme, aY as StaticMap, p as StaticMapProps, T as TextLink, aZ as TextTransform, a_ as TextTruncatePosition, r as TooltipSeries, s as TopNav, t as TopNavProps, a$ as VoltageUnit, Y as YFormatSettings, b0 as ZoomStops, b1 as activeDeviceStates, b2 as baselineFromPoint, v as clearColorCache, w as createCategoryColorMap, x as createXScale, y as createYScale, z as defaultMargin, b3 as deviceStateLabels, b4 as deviceStateMetricFormats, b5 as formatComponentValue, D as getContrastingTextColor, F as getDefaultChartColor, G as getDefaultColors, b6 as getDeviceStateDisplayLabel, b6 as getDeviceStateLabel, b7 as getEntityCategory, J as getEntityConfig, K as getEntityIcon, N as getEntityLabel, b8 as getGridStateLabel, O as getResolvedColor, P as getThemeCategoricalColors, Q as getYFormatSettings, b9 as gridStateLabels, ba as isActiveDeviceState, ba as isActiveState, R as isLightColor, bb as mapValuesToCategoricalColors, bc as useChartContext, bd as useComponentFormatter } from './colors-B85aftHP.js';
8
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
+ import * as React$1 from 'react';
7
+ import React__default, { ReactNode, RefObject, HTMLAttributes, ComponentProps, ComponentType, CSSProperties, Component, ErrorInfo } from 'react';
9
8
  import { I as Icon$1, S as Size, d as IconName$2, B as BaseInputProps } from './RichTextEditor-BNXNpG4s.js';
10
9
  export { e as BaseProps, C as CUSTOM_ICON_REGISTRY, f as ClearButton, g as CustomIconName, a as DateField, D as DateFieldProps, h as Description, i as DescriptionPlacement, j as DescriptionProps, k as FieldError, l as FieldErrorProps, m as FieldGroup, n as FieldGroupProps, b as FileUpload, F as FileUploadProps, o as Input, p as InputProps, q as InputStyleProps, r as InputWrapper, L as Label, s as LabelProps, P as PhosphorIconName, c as RichTextEditor, R as RichTextEditorProps, t as getFieldGroupStyles, u as getInputBackgroundStyles, v as getInputBaseStyles, w as getInputStateStyles, x as useInputFocus } from './RichTextEditor-BNXNpG4s.js';
10
+ import { Virtualizer } from '@tanstack/react-virtual';
11
11
  import { D as DialogAction, a as DialogHeaderConfig, b as DialogFooterConfig } from './index-dofSwYId.js';
12
12
  export { c as Dialog, d as DialogForm, e as DialogProps, f as Drawer, g as DrawerForm, h as DrawerProps, F as FormActions, i as FormDivider, j as FormGrid, k as FormSection, l as FormStepper, S as SaveBar, U as UnsavedChangesPrompt, u as useWizard } from './index-dofSwYId.js';
13
13
  export { A as Autocomplete, B as Button, g as ButtonProps, C as Checkbox, a as CheckboxGroup, b as ColorField, h as ColorFieldProps, N as NumberField, i as Radio, j as RadioCard, R as RadioCardGroup, k as RadioCardGroupProps, l as RadioCardProps, c as RadioGroup, S as Select, m as SelectItem, d as Switch, T as TextArea, e as TextField, n as TimeField } from './TimeField-2KuhWThm.js';
@@ -18,2392 +18,2331 @@ import '@visx/vendor/d3-scale';
18
18
  import 'react-map-gl';
19
19
 
20
20
  /**
21
- * Tailwind CSS default breakpoints
22
- * These match the standard Tailwind breakpoints used in your CSS
23
- */
24
- declare const BREAKPOINTS: {
25
- readonly sm: "640px";
26
- readonly md: "768px";
27
- readonly lg: "1024px";
28
- readonly xl: "1280px";
29
- readonly "2xl": "1536px";
30
- };
31
- type Breakpoint = keyof typeof BREAKPOINTS;
32
- interface BreakpointState {
33
- /** Current active breakpoint (highest matching breakpoint) */
34
- current: Breakpoint | "base";
35
- /** True if viewport is at least 640px (sm breakpoint or higher) */
36
- isSm: boolean;
37
- /** True if viewport is at least 768px (md breakpoint or higher) */
38
- isMd: boolean;
39
- /** True if viewport is at least 1024px (lg breakpoint or higher) */
40
- isLg: boolean;
41
- /** True if viewport is at least 1280px (xl breakpoint or higher) */
42
- isXl: boolean;
43
- /** True if viewport is at least 1536px (2xl breakpoint or higher) */
44
- is2Xl: boolean;
45
- /** True if viewport is smaller than 768px (mobile) */
46
- isMobile: boolean;
47
- /** True if viewport is 768px or larger (tablet/desktop) */
48
- isDesktop: boolean;
49
- }
50
- /**
51
- * Public return type alias for useBreakpoint hook
52
- * Provides a stable public API for barrel re-exports
53
- */
54
- type UseBreakpointReturn = BreakpointState;
55
- /**
56
- * Hook to detect which Tailwind breakpoint is currently active
21
+ * Factory for Texture-authored icons that are NOT available in Phosphor but
22
+ * must plug into the Edges `<Icon name="…" />` component with the exact same
23
+ * API (size / color / weight / className / mirrored / aria-*).
57
24
  *
58
- * Returns an object with boolean flags for each breakpoint and convenience helpers.
59
- * All breakpoints use min-width queries to match Tailwind's mobile-first approach.
25
+ * Each custom icon is authored as a Phosphor-compatible component:
26
+ * - 256×256 viewBox (matches Phosphor's optical grid so custom + stock icons
27
+ * sit at the same scale)
28
+ * - `fill={color}` defaulting to `currentColor` (inherits text color like Phosphor)
29
+ * - `size` drives both width and height
60
30
  *
61
- * @param defaultBreakpoint - The breakpoint to assume during SSR or before first render (defaults to "base" for mobile-first)
62
- * @returns An object containing breakpoint state information
31
+ * `weight` is accepted for API parity but is a no-op for single-weight custom
32
+ * glyphs. Author the `children` against the 256×256 grid.
63
33
  *
64
34
  * @example
65
35
  * ```tsx
66
- * const { isMobile, isDesktop, current } = useBreakpoint();
67
- *
68
- * // Conditional rendering based on screen size
69
- * return isMobile ? <MobileNav /> : <DesktopNav />;
70
- *
71
- * // Check specific breakpoint
72
- * if (isLg) {
73
- * // Show expanded view on large screens
74
- * }
75
- *
76
- * // Use current breakpoint
77
- * console.log(`Current breakpoint: ${current}`); // "md", "lg", etc.
36
+ * export const TextureRecloserIcon = createTextureIcon(
37
+ * "TextureRecloser",
38
+ * <path d="M48 128 ..." />,
39
+ * );
78
40
  * ```
79
41
  */
80
- declare function useBreakpoint(defaultBreakpoint?: Breakpoint | "base"): BreakpointState;
81
-
82
- /**
83
- * Data Controls Types
84
- *
85
- * Core type definitions for client-side and server-side data filtering,
86
- * sorting, faceting, and search operations.
87
- */
88
- type FilterOperator = "eq" | "neq" | "in" | "nin" | "gt" | "gte" | "lt" | "lte" | "contains" | "startsWith" | "endsWith";
89
- interface FilterCondition {
90
- /** Field name (supports nested paths like 'user.profile.name') */
91
- field: string;
92
- /** Comparison operator */
93
- operator: FilterOperator;
94
- /** Value to compare against */
95
- value: string | number | boolean | (string | number)[];
96
- }
97
- interface FilterGroup {
98
- /** Logical operator combining conditions */
99
- logic: "AND" | "OR";
100
- /** Conditions or nested filter groups */
101
- conditions: (FilterCondition | FilterGroup)[];
102
- }
103
- /** Root filter state - can be empty, a single group, or nested groups */
104
- type FilterState = FilterGroup | null;
105
- interface SortState {
106
- /** Field to sort by (supports nested paths) */
107
- field: string;
108
- /** Sort direction */
109
- direction: "asc" | "desc";
110
- }
111
- interface SearchConfig {
112
- /** Search query string */
113
- query: string;
114
- /** Fields to search across */
115
- fields: string[];
116
- /** Use fuzzy matching (Fuse.js) - default true */
117
- fuzzy?: boolean;
118
- /** Fuse.js matching threshold (0.0 = perfect, 1.0 = anything) - default 0.3 */
119
- threshold?: number;
120
- }
121
- type FacetType = "string" | "number" | "boolean" | "date";
122
- interface FacetConfig {
123
- /** Field name to facet on */
124
- field: string;
125
- /** Display label for the facet */
126
- label: string;
127
- /** Data type of the field */
128
- type?: FacetType;
129
- /** Optional: Provide predefined values for the facet (useful for enums) */
130
- values?: Array<{
131
- value: string | number;
132
- label: string;
133
- }>;
134
- /** Number of options to show before requiring search (default: 10) */
135
- searchThreshold?: number;
136
- /** Max options to show initially, with "Show all" button for rest (default: 50) */
137
- maxVisibleOptions?: number;
138
- /** Optional description text to show below the label */
139
- description?: string;
140
- /** Optional: Custom render function for option labels (e.g., to show Badges) */
141
- renderLabel?: (value: string, label: string) => React.ReactNode;
142
- /** Optional: Group name for organizing filters in FilterDialog */
143
- group?: string;
144
- }
145
- interface FacetCounts {
146
- [field: string]: {
147
- [value: string]: number;
148
- };
149
- }
150
- /**
151
- * Create a single filter condition
152
- */
153
- declare function createFilter(field: string, operator: FilterOperator, value: string | number | boolean | (string | number)[]): FilterCondition;
154
- /**
155
- * Create a filter group from multiple conditions with AND logic
156
- */
157
- declare function createFilters(conditions: FilterCondition[], logic?: "AND" | "OR"): FilterGroup;
158
- /**
159
- * Create an empty filter state
160
- */
161
- declare function createEmptyFilter(): FilterGroup;
162
- /**
163
- * Check if a filter state is empty (no conditions)
164
- */
165
- declare function isFilterEmpty(filter: FilterState): boolean;
166
- /**
167
- * Convert structured filter state to simple display chips
168
- * Used for backward compatibility with existing FilterChips component
169
- */
170
- interface FilterChip {
171
- id: string;
172
- label: string;
173
- value: string;
174
- }
175
- declare function filterToChips(filter: FilterState, facetConfigs?: FacetConfig[]): FilterChip[];
176
- /**
177
- * Add a condition to a filter state
178
- */
179
- declare function addFilterCondition(filter: FilterState, condition: FilterCondition): FilterGroup;
180
- /**
181
- * Remove a condition from a filter state by field
182
- */
183
- declare function removeFilterCondition(filter: FilterState, field: string): FilterGroup;
184
- /**
185
- * Get all unique fields being filtered on
186
- */
187
- declare function getFilterFields(filter: FilterState): string[];
42
+ declare function createTextureIcon(displayName: string, children: ReactNode): Icon;
188
43
 
189
- interface UseClientDataControlsOptions<T> {
190
- /** Raw data to process */
191
- data: T[];
192
- /** Filter state */
193
- filters?: FilterState;
194
- /** Sort state */
195
- sort?: SortState | null;
196
- /** Search configuration */
197
- search?: SearchConfig | null;
198
- /** Facet configurations */
199
- facetConfigs?: FacetConfig[];
44
+ type LoadingState = "idle" | "loading" | "loading-more" | "error";
45
+ interface UseInfiniteScrollOptions<T = unknown> {
46
+ /** Array of items being displayed */
47
+ items: T[];
48
+ /** Callback to load more items (optional - if not provided, no infinite scroll) */
49
+ onLoadMore?: () => void | Promise<void>;
50
+ /** Whether there are more items to load */
51
+ hasMore?: boolean;
52
+ /** Auto-detects initial vs loading-more from items.length */
53
+ isLoading?: boolean;
54
+ /** Explicit loading state override (takes precedence) */
55
+ loadingState?: LoadingState;
56
+ /** Enable virtualization (default: true for 100+ items) */
57
+ enableVirtualization?: boolean;
58
+ /** Estimated size of each item in pixels */
59
+ estimatedItemSize?: number;
60
+ /** Number of items to render outside viewport */
61
+ overscan?: number;
62
+ /** Custom scroll element (defaults to parent) */
63
+ scrollElement?: HTMLElement | null;
64
+ /** Distance from bottom in pixels to trigger load */
65
+ loadMoreThreshold?: number;
200
66
  }
201
- interface UseClientDataControlsResult<T> {
202
- /** Processed data (filtered, sorted, searched) */
203
- data: T[];
204
- /** Facet counts computed from filtered data */
205
- facetCounts: FacetCounts;
206
- /** Number of results after filtering/searching */
207
- resultCount: number;
67
+ interface UseInfiniteScrollReturn {
68
+ virtualizer: Virtualizer<HTMLElement, Element> | null;
69
+ virtualItems: ReturnType<Virtualizer<HTMLElement, Element>["getVirtualItems"]>;
70
+ computedLoadingState: LoadingState;
71
+ isInitialLoad: boolean;
72
+ isLoadingMore: boolean;
73
+ scrollRef: RefObject<HTMLDivElement | null>;
74
+ loadMoreRef: RefObject<HTMLDivElement | null>;
75
+ scrollToIndex: (index: number, options?: {
76
+ align?: "start" | "center" | "end";
77
+ }) => void;
78
+ scrollToTop: () => void;
208
79
  }
209
80
  /**
210
- * useClientDataControls
81
+ * useInfiniteScroll
211
82
  *
212
- * Client-side hook for filtering, sorting, searching, and faceting data.
213
- * Uses memoization to avoid unnecessary recomputation.
83
+ * Hook for implementing infinite scroll with optional virtualization.
84
+ * Intelligently detects initial vs loading-more states from context.
214
85
  *
215
- * Operations are applied in this order:
216
- * 1. Search (fuzzy or exact matching)
217
- * 2. Filter (structured conditions)
218
- * 3. Facet computation (on filtered data)
219
- * 4. Sort
86
+ * Features:
87
+ * - Smart loading state detection (initial vs loading-more)
88
+ * - Optional explicit state control
89
+ * - TanStack Virtual integration for performance
90
+ * - Intersection Observer for load triggering
91
+ * - Configurable virtualization threshold
220
92
  *
221
93
  * @example
222
94
  * ```tsx
223
- * const { data, facetCounts, resultCount } = useClientDataControls({
224
- * data: rawData,
225
- * filters: createFilters([
226
- * createFilter('department', 'in', ['Engineering', 'Sales'])
227
- * ]),
228
- * sort: { field: 'name', direction: 'asc' },
229
- * search: { query: searchQuery, fields: ['name', 'email'] },
230
- * facetConfigs: [
231
- * { field: 'department', label: 'Department' },
232
- * { field: 'status', label: 'Status' }
233
- * ]
95
+ * const { scrollRef, computedLoadingState, isLoadingMore } = useInfiniteScroll({
96
+ * items,
97
+ * onLoadMore: fetchNextPage,
98
+ * hasMore: hasNextPage,
99
+ * isLoading: isFetching,
234
100
  * });
235
101
  * ```
236
102
  */
237
- declare function useClientDataControls<T>({ data, filters, sort, search, facetConfigs, }: UseClientDataControlsOptions<T>): UseClientDataControlsResult<T>;
103
+ declare function useInfiniteScroll<T = unknown>({ items, onLoadMore, hasMore, isLoading, loadingState, enableVirtualization, estimatedItemSize, overscan, scrollElement, loadMoreThreshold, }: UseInfiniteScrollOptions<T>): UseInfiniteScrollReturn;
104
+
105
+ type ActivityFeedVariant = "timeline" | "stacked";
106
+ type ActivityFeedSize = "md" | "sm";
107
+ type ActivityItemTone = "neutral" | "brand" | "success" | "warning" | "danger" | "info";
108
+ type ActivityItemSurface = "minimal" | "subtle" | "solid";
109
+ interface ActivityFeedProps<T = unknown> extends HTMLAttributes<HTMLDivElement> {
110
+ /** Visual style for the feed */
111
+ variant?: ActivityFeedVariant;
112
+ /** Density of the feed */
113
+ size?: ActivityFeedSize;
114
+ /** Data-driven mode: array of items to render */
115
+ items?: T[];
116
+ /** Render function for each item (when using items array) */
117
+ renderItem?: (item: T, index: number) => ReactNode;
118
+ /** Children mode: manual ActivityItem components */
119
+ children?: ReactNode;
120
+ /** Loading & error UI gates */
121
+ isLoading?: boolean;
122
+ /** Explicit loading state override (takes precedence over auto-detection) */
123
+ loadingState?: LoadingState;
124
+ error?: string | null;
125
+ /** Custom skeleton for initial loading state - matches your activity item structure */
126
+ renderLoadingSkeleton?: () => ReactNode;
127
+ /** Number of skeleton items to show during initial loading */
128
+ loadingSkeletonCount?: number;
129
+ /** Empty state */
130
+ emptyMessage?: string;
131
+ /** Infinite scroll */
132
+ onLoadMore?: () => void | Promise<void>;
133
+ hasMore?: boolean;
134
+ /** Enable virtualization (default: true for 100+ items) */
135
+ enableVirtualization?: boolean;
136
+ /** Estimated size of each item in pixels */
137
+ estimatedItemSize?: number;
138
+ /** Custom loading indicator for loading-more state */
139
+ loadingIndicator?: ReactNode;
140
+ /** Height/maxHeight for scroll container */
141
+ height?: string | number;
142
+ maxHeight?: string | number;
143
+ }
144
+ declare function ActivityFeed<T = unknown>({ variant, size, className, children, items, renderItem, isLoading, loadingState, error, renderLoadingSkeleton, loadingSkeletonCount, emptyMessage, onLoadMore, hasMore, enableVirtualization, estimatedItemSize, loadingIndicator, height, maxHeight, ...rest }: ActivityFeedProps<T>): react_jsx_runtime.JSX.Element;
145
+ declare namespace ActivityFeed {
146
+ var displayName: string;
147
+ }
148
+ interface ActivityFeedGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
149
+ /** Heading shown above the grouped items */
150
+ title?: ReactNode;
151
+ /** Optional description that provides additional context */
152
+ description?: ReactNode;
153
+ /** Optional trailing actions for the group */
154
+ actions?: ReactNode;
155
+ /** Group content */
156
+ children: ReactNode;
157
+ }
158
+ interface ActivityFeedGroupInternalProps extends ActivityFeedGroupProps {
159
+ __isLastGroup?: boolean;
160
+ __isFirstGroup?: boolean;
161
+ }
162
+ declare function ActivityFeedGroup(props: ActivityFeedGroupInternalProps): react_jsx_runtime.JSX.Element;
163
+ declare namespace ActivityFeedGroup {
164
+ var displayName: string;
165
+ }
166
+ interface ActivityItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
167
+ /** Primary label describing the activity */
168
+ title: ReactNode;
169
+ /** Supplementary copy beneath the title */
170
+ description?: ReactNode;
171
+ /** Timestamp or contextual information shown opposite the title */
172
+ timestamp?: ReactNode;
173
+ /** Additional metadata shown below the description */
174
+ meta?: ReactNode;
175
+ /** Supplementary media such as attachments, badges, or chips */
176
+ media?: ReactNode;
177
+ /** Optional action buttons or controls */
178
+ actions?: ReactNode;
179
+ /** Visual element displayed inside the indicator */
180
+ visual?: ReactNode;
181
+ /** Shortcut for displaying an icon in the indicator */
182
+ icon?: ComponentProps<typeof Icon$1>["name"];
183
+ /** Icon weight for the indicator icon */
184
+ iconWeight?: ComponentProps<typeof Icon$1>["weight"];
185
+ /** Visual tone applied to the indicator */
186
+ tone?: ActivityItemTone;
187
+ /** Surface treatment for the content */
188
+ surface?: ActivityItemSurface;
189
+ /** Highlights the item using the tone color */
190
+ isHighlighted?: boolean;
191
+ /** Whether to render a connector line for timeline layouts */
192
+ showConnector?: boolean;
193
+ /** Whether to render the incoming connector line from previous item (internal) */
194
+ showIncomingConnector?: boolean;
195
+ /** Hides the indicator entirely */
196
+ hideIndicator?: boolean;
197
+ /** Marks the item as interactive, enabling keyboard semantics */
198
+ interactive?: boolean;
199
+ }
200
+ declare function ActivityItem(props: ActivityItemProps): react_jsx_runtime.JSX.Element;
201
+ declare namespace ActivityItem {
202
+ var displayName: string;
203
+ }
238
204
 
205
+ interface AlertProps {
206
+ /**
207
+ * Whether the alert is open
208
+ */
209
+ isOpen: boolean;
210
+ /**
211
+ * Callback when the alert is closed
212
+ */
213
+ onClose: () => void;
214
+ /**
215
+ * Alert title
216
+ */
217
+ title: string;
218
+ /**
219
+ * Alert message/content
220
+ */
221
+ message: React__default.ReactNode;
222
+ /**
223
+ * Label for the confirm button
224
+ * @default "OK"
225
+ */
226
+ confirmLabel?: string;
227
+ /**
228
+ * Variant for the confirm button
229
+ * @default "primary"
230
+ */
231
+ confirmVariant?: DialogAction["variant"];
232
+ /**
233
+ * Maximum width of the alert dialog
234
+ * @default "400px"
235
+ */
236
+ maxWidth?: string;
237
+ /**
238
+ * Minimum width of the alert dialog (desktop only)
239
+ * @default "320px"
240
+ */
241
+ minWidth?: string;
242
+ }
239
243
  /**
240
- * useContainerBreakpoint — measures a container element's width and returns
241
- * the same BreakpointState shape as useBreakpoint, but derived from the
242
- * container, not the window.
243
- *
244
- * Blocks that need to respond to their render width (not the viewport) should
245
- * use this hook instead of useBreakpoint. When rendered inside a
246
- * ContainerQueryProvider, the hook reads from context (no ref needed). When
247
- * no provider is present, it falls back to measuring its own ref, or
248
- * ultimately to window-based breakpoints.
244
+ * Alert
249
245
  *
250
- * @returns BreakpointState same shape as useBreakpoint
246
+ * A simple alert dialog with a single action button.
247
+ * Use for informational messages that require acknowledgment.
251
248
  */
252
- declare function useContainerBreakpoint(containerRef?: React.RefObject<HTMLElement | null>): BreakpointState;
249
+ declare function Alert({ isOpen, onClose, title, message, confirmLabel, confirmVariant, maxWidth, minWidth, }: AlertProps): react_jsx_runtime.JSX.Element;
253
250
 
254
- interface ServerDataState {
255
- filters: FilterState;
256
- sort: SortState | null;
257
- search: SearchConfig | null;
251
+ type BannerVariant = "info" | "success" | "warning" | "error" | "discovery";
252
+ type BannerAppearance = "subtle" | "bold";
253
+ interface BannerAction {
254
+ /** Label for the action button */
255
+ label: string;
256
+ /** Callback when the action is triggered */
257
+ onPress: () => void;
258
+ /** Whether to render as a link-style button */
259
+ asLink?: boolean;
258
260
  }
259
- interface UseServerDataControlsOptions {
260
- /** Filter state */
261
- filters: FilterState;
262
- /** Sort state */
263
- sort: SortState | null;
264
- /** Search configuration */
265
- search: SearchConfig | null;
266
- /** Callback when state changes (debounced for search) */
267
- onStateChange: (state: ServerDataState) => void;
268
- /** Search debounce delay in ms (default: 300) */
269
- searchDebounce?: number;
261
+ interface BannerProps {
262
+ /** Semantic variant of the banner */
263
+ variant?: BannerVariant;
264
+ /** Visual appearance style */
265
+ appearance?: BannerAppearance;
266
+ /** The main message/title to display */
267
+ title?: ReactNode;
268
+ /** Additional description or content */
269
+ children?: ReactNode;
270
+ /** Whether the banner can be dismissed */
271
+ dismissible?: boolean;
272
+ /** Callback when the banner is dismissed */
273
+ onDismiss?: () => void;
274
+ /** Primary action (rendered as button or link) */
275
+ primaryAction?: BannerAction;
276
+ /** Secondary action (rendered as button or link) */
277
+ secondaryAction?: BannerAction;
278
+ /** Custom icon to override default status icon */
279
+ icon?: ReactNode;
280
+ /** Hide the icon completely */
281
+ hideIcon?: boolean;
282
+ /** Additional CSS classes */
283
+ className?: string;
284
+ /** Test ID for automation */
285
+ testId?: string;
270
286
  }
271
287
  /**
272
- * useServerDataControls
288
+ * Banner
273
289
  *
274
- * Server-side hook that notifies the parent when filter/sort/search state changes.
275
- * Search queries are debounced to avoid excessive API calls.
290
+ * A prominent message component for displaying important information or system messages.
291
+ * Can be used inline within content sections or positioned at the page level.
276
292
  *
277
- * This hook doesn't manipulate data - it just provides a clean way to:
278
- * 1. Debounce search input
279
- * 2. Notify when any state changes
280
- * 3. Trigger server refetch
293
+ * Inspired by Atlassian's Section Message and Chakra UI's Alert, combining the best
294
+ * features of both: semantic variant colors, multiple appearances, inline actions, and
295
+ * flexible composition.
281
296
  *
282
297
  * @example
283
298
  * ```tsx
284
- * const [filters, setFilters] = useState(null);
285
- * const [sort, setSort] = useState({ field: 'name', direction: 'asc' });
286
- * const [search, setSearch] = useState({ query: '', fields: ['name'] });
299
+ * // Simple info banner
300
+ * <Banner variant="info" title="New features available">
301
+ * Check out the latest updates to improve your workflow.
302
+ * </Banner>
287
303
  *
288
- * useServerDataControls({
289
- * filters,
290
- * sort,
291
- * search,
292
- * onStateChange: (state) => {
293
- * // Refetch data with new parameters
294
- * refetch({
295
- * filters: state.filters,
296
- * sort: state.sort,
297
- * search: state.search?.query
298
- * });
299
- * }
300
- * });
301
- * ```
302
- */
303
- declare function useServerDataControls({ filters, sort, search, onStateChange, searchDebounce, }: UseServerDataControlsOptions): void;
304
-
305
- interface UseDataControlsClientOptions<T> {
306
- mode: "client";
307
- /** Raw data to process (required in client mode) */
308
- data: T[];
309
- /** Filter state */
310
- filters?: FilterState;
311
- /** Sort state */
312
- sort?: SortState | null;
313
- /** Search configuration */
314
- search?: SearchConfig | null;
315
- /** Facet configurations */
316
- facetConfigs?: FacetConfig[];
317
- }
318
- interface UseDataControlsServerOptions<T> {
319
- mode: "server";
320
- /** Data from server (already filtered/sorted) */
321
- data: T[];
322
- /** Filter state */
323
- filters: FilterState;
324
- /** Sort state */
325
- sort: SortState | null;
326
- /** Search configuration */
327
- search: SearchConfig | null;
328
- /** Callback when state changes (required in server mode) */
329
- onStateChange: (state: ServerDataState) => void;
330
- /** Search debounce delay in ms (default: 300) */
331
- searchDebounce?: number;
332
- /** Result count from server */
333
- resultCount?: number;
334
- /** Facet counts from server */
335
- facetCounts?: FacetCounts;
336
- }
337
- type UseDataControlsOptions<T> = UseDataControlsClientOptions<T> | UseDataControlsServerOptions<T>;
338
- interface UseDataControlsResult<T> {
339
- /** Processed data (client mode) or server data (server mode) */
340
- data: T[];
341
- /** Facet counts (computed in client mode, passed through in server mode) */
342
- facetCounts: FacetCounts;
343
- /** Result count (computed in client mode, passed through in server mode) */
344
- resultCount: number;
345
- }
346
- /**
347
- * useDataControls
348
- *
349
- * Unified hook for managing data filtering, sorting, searching, and faceting.
350
- * Supports both client-side and server-side modes.
351
- *
352
- * **Client Mode:**
353
- * - Processes data locally using pure functions
354
- * - Computes facet counts automatically
355
- * - Best for datasets < 5000 rows
356
- *
357
- * **Server Mode:**
358
- * - Notifies parent when state changes (debounced for search)
359
- * - Passes through server-provided data and counts
360
- * - Best for large datasets or complex queries
361
- *
362
- * @example Client Mode
363
- * ```tsx
364
- * const { data, facetCounts, resultCount } = useDataControls({
365
- * mode: 'client',
366
- * data: rawData,
367
- * filters: createFilters([...]),
368
- * sort: { field: 'name', direction: 'asc' },
369
- * search: { query: searchQuery, fields: ['name', 'email'] },
370
- * facetConfigs: [{ field: 'department', label: 'Department' }]
371
- * });
372
- * ```
304
+ * // With actions
305
+ * <Banner
306
+ * variant="warning"
307
+ * title="Your trial expires soon"
308
+ * primaryAction={{ label: "Upgrade now", onPress: () => {} }}
309
+ * secondaryAction={{ label: "Learn more", onPress: () => {}, asLink: true }}
310
+ * >
311
+ * Upgrade to continue using premium features.
312
+ * </Banner>
373
313
  *
374
- * @example Server Mode
375
- * ```tsx
376
- * const { data, facetCounts, resultCount } = useDataControls({
377
- * mode: 'server',
378
- * data: serverData, // Already filtered
379
- * filters,
380
- * sort,
381
- * search,
382
- * resultCount: totalCount,
383
- * facetCounts: serverFacets,
384
- * onStateChange: (state) => refetch(state)
385
- * });
314
+ * // Bold appearance
315
+ * <Banner
316
+ * variant="error"
317
+ * appearance="bold"
318
+ * title="Action required"
319
+ * dismissible
320
+ * onDismiss={() => {}}
321
+ * >
322
+ * Please update your payment information.
323
+ * </Banner>
386
324
  * ```
387
325
  */
388
- declare function useDataControls<T>(options: UseDataControlsOptions<T>): UseDataControlsResult<T>;
389
-
390
- declare function useDebounce<T>(value: T, delay?: number): T;
326
+ declare function Banner({ variant, appearance, title, children, dismissible, onDismiss, primaryAction, secondaryAction, icon, hideIcon, className, testId, }: BannerProps): react_jsx_runtime.JSX.Element;
391
327
 
392
- interface ElementSize {
393
- width: number;
394
- height: number;
395
- }
396
- interface UseElementSizeResult<T extends HTMLElement = HTMLElement> {
397
- ref: (node: T | null) => void;
398
- width: number;
399
- height: number;
328
+ interface PageBannerProps extends BannerProps {
329
+ /** Whether the banner is visible */
330
+ isOpen?: boolean;
331
+ /** Position relative to the navbar */
332
+ position?: "fixed" | "sticky";
400
333
  }
401
334
  /**
402
- * useElementSize
335
+ * PageBanner
403
336
  *
404
- * A performant hook that tracks the dimensions of a DOM element using ResizeObserver.
405
- * Returns a callback ref to attach to the element and its current width/height.
337
+ * A banner component designed for page-level announcements, positioned at the top
338
+ * of the page below the navbar. Automatically handles enter/exit animations and
339
+ * can be fixed or sticky positioned.
406
340
  *
407
- * Performance optimizations:
408
- * - Uses ResizeObserver for efficient resize detection
409
- * - Debounces updates using requestAnimationFrame
410
- * - Cleans up observer on unmount
341
+ * Use this for system-wide messages, announcements, or important alerts that need
342
+ * to be visible across the entire page.
411
343
  *
412
344
  * @example
413
345
  * ```tsx
414
- * const { ref, width, height } = useElementSize();
415
- *
416
- * return (
417
- * <div ref={ref}>
418
- * Width: {width}px, Height: {height}px
419
- * </div>
420
- * );
346
+ * <PageBanner
347
+ * isOpen={showBanner}
348
+ * variant="warning"
349
+ * title="Scheduled maintenance"
350
+ * dismissible
351
+ * onDismiss={() => setShowBanner(false)}
352
+ * >
353
+ * Our systems will be under maintenance on Friday from 2-4 PM EST.
354
+ * </PageBanner>
421
355
  * ```
422
356
  */
423
- declare function useElementSize<T extends HTMLElement = HTMLElement>(): UseElementSizeResult<T>;
357
+ declare function PageBanner({ isOpen, position, className, ...bannerProps }: PageBannerProps): react_jsx_runtime.JSX.Element;
424
358
 
425
- type LoadingState = "idle" | "loading" | "loading-more" | "error";
426
- interface UseInfiniteScrollOptions<T = unknown> {
427
- /** Array of items being displayed */
428
- items: T[];
429
- /** Callback to load more items (optional - if not provided, no infinite scroll) */
430
- onLoadMore?: () => void | Promise<void>;
431
- /** Whether there are more items to load */
432
- hasMore?: boolean;
433
- /** Auto-detects initial vs loading-more from items.length */
434
- isLoading?: boolean;
435
- /** Explicit loading state override (takes precedence) */
436
- loadingState?: LoadingState;
437
- /** Enable virtualization (default: true for 100+ items) */
438
- enableVirtualization?: boolean;
439
- /** Estimated size of each item in pixels */
440
- estimatedItemSize?: number;
441
- /** Number of items to render outside viewport */
442
- overscan?: number;
443
- /** Custom scroll element (defaults to parent) */
444
- scrollElement?: HTMLElement | null;
445
- /** Distance from bottom in pixels to trigger load */
446
- loadMoreThreshold?: number;
447
- }
448
- interface UseInfiniteScrollReturn {
449
- virtualizer: Virtualizer<HTMLElement, Element> | null;
450
- virtualItems: ReturnType<Virtualizer<HTMLElement, Element>["getVirtualItems"]>;
451
- computedLoadingState: LoadingState;
452
- isInitialLoad: boolean;
453
- isLoadingMore: boolean;
454
- scrollRef: RefObject<HTMLDivElement | null>;
455
- loadMoreRef: RefObject<HTMLDivElement | null>;
456
- scrollToIndex: (index: number, options?: {
457
- align?: "start" | "center" | "end";
458
- }) => void;
459
- scrollToTop: () => void;
460
- }
359
+ type BreadcrumbItemProps = BreadcrumbProps & {
360
+ href?: string;
361
+ /**
362
+ * When true, adds a copy-to-clipboard button next to the current (last) breadcrumb item.
363
+ * The value copied is determined by `copyValue` prop, or falls back to the text content.
364
+ */
365
+ copyable?: boolean;
366
+ /**
367
+ * The value to copy when the copy button is clicked.
368
+ * If not provided, the text content of the breadcrumb will be used.
369
+ */
370
+ copyValue?: string;
371
+ };
461
372
  /**
462
- * useInfiniteScroll
463
- *
464
- * Hook for implementing infinite scroll with optional virtualization.
465
- * Intelligently detects initial vs loading-more states from context.
373
+ * Breadcrumbs
466
374
  *
467
- * Features:
468
- * - Smart loading state detection (initial vs loading-more)
469
- * - Optional explicit state control
470
- * - TanStack Virtual integration for performance
471
- * - Intersection Observer for load triggering
472
- * - Configurable virtualization threshold
375
+ * Navigation breadcrumbs that show the user's current location in the hierarchy
376
+ * Automatically collapses middle items into an ellipsis dropdown when the container
377
+ * width exceeds the maxWidth threshold (default: 600px)
378
+ */
379
+ declare function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T> & {
380
+ maxWidth?: number;
381
+ }): react_jsx_runtime.JSX.Element;
382
+ /**
383
+ * BreadcrumbItem
473
384
  *
474
- * @example
475
- * ```tsx
476
- * const { scrollRef, computedLoadingState, isLoadingMore } = useInfiniteScroll({
477
- * items,
478
- * onLoadMore: fetchNextPage,
479
- * hasMore: hasNextPage,
480
- * isLoading: isFetching,
481
- * });
482
- * ```
385
+ * Individual breadcrumb item with optional link
386
+ * The last breadcrumb is automatically styled as the current page (non-interactive, bold)
387
+ * When `copyable` is true, adds a copy-to-clipboard button next to the current (last) breadcrumb
483
388
  */
484
- declare function useInfiniteScroll<T = unknown>({ items, onLoadMore, hasMore, isLoading, loadingState, enableVirtualization, estimatedItemSize, overscan, scrollElement, loadMoreThreshold, }: UseInfiniteScrollOptions<T>): UseInfiniteScrollReturn;
389
+ declare function BreadcrumbItem(props: BreadcrumbItemProps): react_jsx_runtime.JSX.Element;
485
390
 
486
391
  /**
487
- * Hook for managing localStorage values with React state synchronization
488
- * @param key - The localStorage key
489
- * @param initialValue - The initial value if nothing is stored
490
- * @returns [value, setValue, removeValue] - Current value, setter function, and remove function
392
+ * Calendar
393
+ *
394
+ * Single-date calendar primitive with Edges styling.
491
395
  */
492
- declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((val: T) => T)) => void, () => void];
396
+ interface CalendarProps<T extends DateValue> extends Omit<CalendarProps$1<T>, "visibleDuration"> {
397
+ errorMessage?: string;
398
+ }
399
+ declare function Calendar<T extends DateValue>({ errorMessage, ...props }: CalendarProps<T>): react_jsx_runtime.JSX.Element;
493
400
 
494
401
  /**
495
- * Hook to check if a media query matches the current viewport
402
+ * Card - Enterprise surface container component
496
403
  *
497
- * @param query - A CSS media query string (e.g., "(min-width: 768px)")
498
- * @param defaultValue - The default value to return during SSR or before the first render
499
- * @returns A boolean indicating whether the media query matches
404
+ * A flexible, composable card component following enterprise design system best practices.
405
+ * Supports modular content sections with consistent styling and accessibility.
500
406
  *
501
- * @example
407
+ * Usage:
502
408
  * ```tsx
503
- * const isMobile = useMediaQuery('(max-width: 767px)');
504
- * const prefersReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');
505
- * const isLandscape = useMediaQuery('(orientation: landscape)');
506
- * ```
507
- */
508
- declare function useMediaQuery(query: string, defaultValue?: boolean): boolean;
509
-
510
- type SortDirection = "asc" | "desc";
511
- type CellAlignment = "left" | "center" | "right";
512
- type TableDensity = "compact" | "default" | "relaxed";
513
- type CellEmphasis = "strong" | "high" | "normal" | "low";
514
- type LinkBehavior = "none" | "hover" | "visible";
515
- type TableLayout = "auto" | "fixed" | "responsive";
516
- type TableWidth = "full" | "auto" | "contained";
517
- type MobileRenderer = "auto" | "cards" | "custom" | "none";
518
- type MobileBreakpoint = "sm" | "md" | "lg" | "xl";
519
- interface SortConfig {
520
- columnId: string;
521
- direction: SortDirection;
522
- }
523
- interface CellContext {
524
- isLoading: boolean;
525
- isSelected?: boolean;
526
- isHovered?: boolean;
527
- rowIndex: number;
528
- columnIndex: number;
529
- density: TableDensity;
409
+ * <Card variant="outlined" size="md">
410
+ * <Card.Header
411
+ * title="Card Title"
412
+ * subtitle="Optional subtitle"
413
+ * actions={<Button variant="ghost" icon="MoreHorizontal" />}
414
+ * />
415
+ * <Card.Media src="image.jpg" alt="Description" />
416
+ * <Card.Content>
417
+ * <p>Main content goes here</p>
418
+ * </Card.Content>
419
+ * <Card.Footer>
420
+ * <Button variant="primary">Action</Button>
421
+ * </Card.Footer>
422
+ * </Card>
423
+ * ```
424
+ */
425
+ type CardVariant = "outlined" | "elevated" | "filled" | "ghost";
426
+ interface CardProps {
427
+ variant?: CardVariant;
428
+ className?: string;
429
+ children?: React__default.ReactNode;
430
+ isLoading?: boolean;
431
+ /** Enable flex column layout so children can expand to fill space */
432
+ layout?: "default" | "flex";
530
433
  }
531
- interface CellComponentProps<T = any> {
532
- value: any;
533
- row: T;
534
- context: CellContext;
535
- [key: string]: any;
434
+ interface CardHeaderProps {
435
+ title?: React__default.ReactNode;
436
+ subtitle?: React__default.ReactNode;
437
+ actions?: React__default.ReactNode;
438
+ className?: string;
439
+ isLoading?: boolean;
536
440
  }
537
- type CellComponent<T = any> = ComponentType<CellComponentProps<T>>;
538
- interface MobileConfig {
539
- priority?: 1 | 2 | 3;
540
- format?: "primary" | "secondary" | "badge" | "inline";
541
- label?: boolean;
542
- icon?: string;
441
+ interface CardMediaProps {
442
+ src?: string;
443
+ alt?: string;
444
+ aspectRatio?: "square" | "video" | "wide" | "auto";
445
+ className?: string;
446
+ children?: React__default.ReactNode;
447
+ isLoading?: boolean;
543
448
  }
544
- interface Column<T> {
545
- id: string;
546
- label: string;
547
- accessor?: keyof T | ((row: T) => any);
548
- align?: CellAlignment;
549
- width?: string | number;
550
- minWidth?: string | number;
551
- maxWidth?: string | number;
552
- flex?: number;
553
- cell?: CellComponent<T>;
554
- cellProps?: Record<string, any> | ((value: any, row: T) => Record<string, any>);
555
- render?: (value: any, row: T, context: CellContext) => ReactNode;
556
- sortable?: boolean;
557
- /**
558
- * Whether this column can be reordered via drag-and-drop.
559
- * Defaults to true. Set to false to lock a column in place (e.g., sticky first column).
560
- */
561
- reorderable?: boolean;
562
- noCellPadding?: boolean;
563
- mobile?: MobileConfig | false;
564
- popover?: string | ((value: unknown, row: T) => ReactNode) | {
565
- content: string | ((value: unknown, row: T) => ReactNode);
566
- placement?: "top" | "bottom" | "left" | "right";
567
- showArrow?: boolean;
568
- trigger?: "hover" | "click";
569
- };
570
- /** Label to use for this column in CSV export headers. Falls back to `label` if not provided. */
571
- exportLabel?: string;
572
- /**
573
- * Custom function to transform the cell value for export.
574
- * If not provided, uses the raw accessor value converted to string.
575
- * @param value - The raw cell value from the accessor
576
- * @param row - The full row data
577
- * @returns The value to export (will be converted to string)
578
- */
579
- exportValue?: (value: unknown, row: T) => string | number | boolean | null;
580
- /**
581
- * Whether to include this column in CSV exports.
582
- * Defaults to true. Set to false to exclude columns like action buttons.
583
- */
584
- exportable?: boolean;
449
+ interface CardContentProps {
450
+ className?: string;
451
+ children?: React__default.ReactNode;
452
+ isLoading?: boolean;
453
+ /** When true and parent Card has layout="flex", content expands to fill available space */
454
+ fill?: boolean;
585
455
  }
586
- interface DataTableProps<T> {
587
- columns: Column<T>[];
588
- data: T[];
456
+ interface CardFooterProps {
589
457
  className?: string;
590
- density?: TableDensity;
591
- width?: TableWidth;
592
- height?: string | number;
593
- maxHeight?: string | number;
594
- layout?: TableLayout;
595
- mobileRenderer?: MobileRenderer;
596
- customMobileRowRender?: (row: T, index: number) => ReactNode;
597
- mobileBreakpoint?: MobileBreakpoint;
458
+ children?: React__default.ReactNode;
459
+ align?: "start" | "end" | "center" | "between";
598
460
  isLoading?: boolean;
599
- loadingState?: LoadingState;
600
- loadingRowCount?: number;
601
- onLoadMore?: () => void | Promise<void>;
602
- hasMore?: boolean;
603
- enableVirtualization?: boolean;
604
- estimatedRowHeight?: number;
605
- loadingIndicator?: ReactNode;
606
- stickyHeader?: boolean;
607
- /** Make the first column sticky on horizontal scroll */
608
- stickyFirstColumn?: boolean;
609
- onRowClick?: (row: T) => void;
610
- getRowId?: (row: T) => string;
611
- hideHeader?: boolean;
612
- /** Controlled sort configuration - when provided, DataTable becomes controlled */
613
- sortConfig?: SortConfig | null;
614
- onSort?: (sortConfig: SortConfig | null) => void;
615
- "aria-label"?: string;
616
- /**
617
- * Enable drag-and-drop column reordering (like Notion tables).
618
- * When enabled, users can drag column headers to reorder columns.
619
- */
620
- enableColumnReorder?: boolean;
621
- /**
622
- * Controlled column order - array of column IDs in display order.
623
- * When provided, DataTable uses this order instead of the columns array order.
624
- * Use with onColumnOrderChange for controlled behavior.
625
- */
626
- columnOrder?: string[];
627
- /**
628
- * Callback fired when column order changes via drag-and-drop.
629
- * Receives the new array of column IDs in their new order.
630
- */
631
- onColumnOrderChange?: (columnOrder: string[]) => void;
632
461
  }
462
+ declare function Card({ variant, className, children, isLoading, layout }: CardProps): react_jsx_runtime.JSX.Element;
463
+ declare namespace Card {
464
+ var Header: typeof CardHeader;
465
+ var Media: typeof CardMedia;
466
+ var Content: typeof CardContent;
467
+ var Footer: typeof CardFooter;
468
+ }
469
+ declare function CardHeader({ title, subtitle, actions, className, isLoading }: CardHeaderProps): react_jsx_runtime.JSX.Element | null;
470
+ declare function CardMedia({ src, alt, aspectRatio, className, children, isLoading }: CardMediaProps): react_jsx_runtime.JSX.Element | null;
471
+ declare function CardContent({ className, children, isLoading, fill }: CardContentProps): react_jsx_runtime.JSX.Element | null;
472
+ declare function CardFooter({ className, children, align, isLoading }: CardFooterProps): react_jsx_runtime.JSX.Element | null;
633
473
 
634
- /**
635
- * Table export utilities for CSV format
636
- * Provides export functionality for DataTable data
637
- */
638
-
639
- interface TableExportMetadata {
640
- /** Base filename for the exported file (without extension) */
641
- filename?: string;
642
- /** Whether to include timestamp in filename. Defaults to true */
643
- timestamp?: boolean;
474
+ interface CarouselRootProps extends React$1.HTMLAttributes<HTMLDivElement> {
475
+ /** Current active page (controlled) */
476
+ page?: number;
477
+ /** Default page for uncontrolled mode */
478
+ defaultPage?: number;
479
+ /** Called when page changes */
480
+ onPageChange?: (page: number) => void;
481
+ /** Orientation of the carousel */
482
+ orientation?: "horizontal" | "vertical";
483
+ /** Whether to loop back to start/end */
484
+ loop?: boolean;
485
+ /** Enable autoplay */
486
+ autoplay?: boolean | {
487
+ delay?: number;
488
+ };
489
+ /** Autoplay delay in milliseconds */
490
+ autoplayDelay?: number;
491
+ /** Allow mouse/touch dragging */
492
+ allowMouseDrag?: boolean;
493
+ /** Spacing between slides */
494
+ spacing?: string;
495
+ /** Number of slides to show at once */
496
+ slidesPerView?: number;
497
+ /** Number of slides to scroll at once */
498
+ slidesPerMove?: number;
499
+ children: React$1.ReactNode;
644
500
  }
645
- interface TableExportOptions<T> {
646
- /** Column definitions for the table */
647
- columns: Column<T>[];
648
- /** Data rows to export */
649
- data: T[];
650
- /** Export metadata */
651
- metadata?: TableExportMetadata;
501
+ interface CarouselItemProps extends React$1.HTMLAttributes<HTMLDivElement> {
502
+ /** Index of this item */
503
+ index: number;
504
+ children: React$1.ReactNode;
505
+ }
506
+ interface CarouselControlProps extends React$1.HTMLAttributes<HTMLDivElement> {
507
+ children: React$1.ReactNode;
508
+ }
509
+ interface CarouselTriggerProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
510
+ children?: React$1.ReactNode;
511
+ }
512
+ interface CarouselIndicatorProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
513
+ /** Index of the slide to navigate to */
514
+ index: number;
515
+ children?: React$1.ReactNode;
516
+ }
517
+ interface CarouselItemGroupProps extends React$1.HTMLAttributes<HTMLDivElement> {
518
+ children: React$1.ReactNode;
652
519
  }
653
520
  /**
654
- * Export table data as CSV
655
- *
656
- * @param options - Export configuration
657
- * @returns Promise that resolves when export is complete
658
- *
659
- * @example
660
- * ```typescript
661
- * await exportTableAsCSV({
662
- * columns: tableColumns,
663
- * data: tableData,
664
- * metadata: {
665
- * filename: "devices-export",
666
- * timestamp: true
667
- * }
668
- * });
669
- * ```
521
+ * CarouselRoot - Main carousel container with state management and navigation logic.
522
+ * Handles page state, autoplay, looping, and drag interactions.
670
523
  */
671
- declare function exportTableAsCSV<T>(options: TableExportOptions<T>): Promise<void>;
524
+ declare function CarouselRoot({ page: controlledPage, defaultPage, onPageChange, orientation, loop, autoplay, autoplayDelay, allowMouseDrag, spacing, slidesPerView, slidesPerMove, className, children, ...props }: CarouselRootProps): react_jsx_runtime.JSX.Element;
672
525
  /**
673
- * Prepare table data for export (without triggering download)
674
- * Useful for server-side export where you need the transformed data
675
- *
676
- * @param options - Export configuration
677
- * @returns Array of row objects ready for CSV generation
526
+ * CarouselItemGroup - Container for carousel items with scrolling behavior.
527
+ * Manages scroll snap, drag interactions, and layout spacing.
678
528
  */
679
- declare function prepareTableDataForExport<T>(options: Omit<TableExportOptions<T>, "metadata">): Record<string, string | number | boolean>[];
680
- /**
681
- * Get column headers for export
682
- * Useful for generating CSV headers on the server
683
- */
684
- declare function getExportHeaders<T>(columns: Column<T>[]): string[];
685
-
686
- interface UseTableExportOptions<T> {
687
- /** Column definitions for the table */
688
- columns: Column<T>[];
689
- /** Data rows to export */
690
- data: T[];
691
- /** Export metadata */
692
- metadata?: TableExportMetadata;
693
- }
694
- interface UseTableExportReturn {
695
- /** Trigger CSV export of the table data */
696
- exportCSV: () => Promise<void>;
697
- /** Whether export is available (has data and exportable columns) */
698
- canExport: boolean;
699
- }
700
- /**
701
- * Hook for exporting DataTable data as CSV.
702
- * Provides a stable callback for triggering exports with memoized dependencies.
703
- *
704
- * For client-side DataTables where all data is in the browser.
705
- * For server-side exports, use the `onExport` callback pattern instead.
706
- *
707
- * @param options - Configuration for table export
708
- * @returns Object with export function and status
709
- *
710
- * @example
711
- * ```tsx
712
- * const { exportCSV, canExport } = useTableExport({
713
- * columns: deviceColumns,
714
- * data: devices,
715
- * metadata: {
716
- * filename: "devices",
717
- * timestamp: true
718
- * }
719
- * });
720
- *
721
- * // In your DataControls actions
722
- * <DataControls
723
- * actions={{
724
- * items: [
725
- * {
726
- * id: "export",
727
- * label: "Export CSV",
728
- * icon: "Export",
729
- * onClick: exportCSV,
730
- * disabled: !canExport
731
- * }
732
- * ]
733
- * }}
734
- * />
735
- * ```
736
- */
737
- declare function useTableExport<T>({ columns, data, metadata }: UseTableExportOptions<T>): UseTableExportReturn;
738
-
739
- /**
740
- * Data Operations Utilities
741
- *
742
- * Pure functions for filtering, sorting, searching, and faceting data.
743
- * These functions are used by useClientDataControls but can also be used standalone.
744
- */
745
-
746
- interface ApplyDataOperationsOptions<T> {
747
- data: T[];
748
- filters?: FilterState;
749
- sort?: SortState | null;
750
- search?: SearchConfig | null;
751
- facetConfigs?: FacetConfig[];
752
- }
753
- interface ApplyDataOperationsResult<T> {
754
- data: T[];
755
- facetCounts: FacetCounts;
756
- resultCount: number;
757
- }
758
- /**
759
- * Apply all data operations in the correct order:
760
- * 1. Search
761
- * 2. Filter
762
- * 3. Compute facets (on filtered data)
763
- * 4. Sort
764
- */
765
- declare function applyDataOperations<T>({ data, filters, sort, search, facetConfigs, }: ApplyDataOperationsOptions<T>): ApplyDataOperationsResult<T>;
766
-
767
- /**
768
- * Boolean formatting utilities
769
- */
770
-
529
+ declare function CarouselItemGroup({ className, children, ...props }: CarouselItemGroupProps): react_jsx_runtime.JSX.Element;
771
530
  /**
772
- * Format boolean value with custom text
531
+ * Individual slide/item within the carousel.
532
+ * Handles sizing based on slidesPerView and applies snap alignment.
773
533
  */
774
- declare const toBoolean: (value: boolean | null | undefined, trueText?: string, falseText?: string) => string | null;
534
+ declare function CarouselItem({ index, className, children, ...props }: CarouselItemProps): react_jsx_runtime.JSX.Element;
775
535
  /**
776
- * Format boolean as enabled/disabled
536
+ * CarouselControl - Container for navigation controls and indicators.
537
+ * Typically holds prev/next buttons, indicators, and autoplay controls.
777
538
  */
778
- declare const toEnabledDisabled: (value: boolean | null | undefined) => string | null;
539
+ declare function CarouselControl({ className, children, ...props }: CarouselControlProps): react_jsx_runtime.JSX.Element;
779
540
  /**
780
- * Format boolean as on/off
541
+ * CarouselPrevTrigger - Button to navigate to the previous slide.
542
+ * Automatically disabled when at the first slide (unless loop is enabled).
781
543
  */
782
- declare const toOnOff: (value: boolean | null | undefined) => string | null;
544
+ declare function CarouselPrevTrigger({ className, children, ...props }: CarouselTriggerProps): react_jsx_runtime.JSX.Element;
783
545
  /**
784
- * Format boolean as active/inactive
546
+ * CarouselNextTrigger - Button to navigate to the next slide.
547
+ * Automatically disabled when at the last slide (unless loop is enabled).
785
548
  */
786
- declare const toActiveInactive: (value: boolean | null | undefined) => string | null;
549
+ declare function CarouselNextTrigger({ className, children, ...props }: CarouselTriggerProps): react_jsx_runtime.JSX.Element;
787
550
  /**
788
- * Format boolean as true/false
551
+ * CarouselIndicator - Dot indicator for a specific slide.
552
+ * Clicking navigates to the slide at the specified index.
789
553
  */
790
- declare const toTrueFalse: (value: boolean | null | undefined) => string | null;
554
+ declare function CarouselIndicator({ index, className, children, ...props }: CarouselIndicatorProps): react_jsx_runtime.JSX.Element;
791
555
  /**
792
- * Format boolean as checkmark/cross
556
+ * CarouselIndicatorGroup - Container for all page indicators.
557
+ * Automatically generates indicators for each page/slide.
793
558
  */
794
- declare const toCheckmark: (value: boolean | null | undefined) => string | null;
559
+ declare function CarouselIndicatorGroup({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
795
560
  /**
796
- * Parse various truthy/falsy values to boolean
561
+ * CarouselAutoplayTrigger - Toggle button for autoplay functionality.
562
+ * Allows users to pause and resume automatic slide transitions.
797
563
  */
798
- declare const parseBoolean: (value: FieldValue) => boolean | null;
564
+ declare function CarouselAutoplayTrigger({ className, children, ...props }: CarouselTriggerProps): react_jsx_runtime.JSX.Element;
799
565
  /**
800
- * Format boolean according to BooleanFormat specification
566
+ * CarouselProgressText - Displays current slide position (e.g., "1 / 5").
567
+ * Shows the current page number and total number of pages.
801
568
  */
802
- declare const formatBoolean: (value: FieldValue, format: BooleanFormat) => FormattedValue;
569
+ declare function CarouselProgressText({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
803
570
 
571
+ type ChipVariant = "primary" | "secondary" | "info";
572
+ type LegacyChipVariant = "default" | "brand";
573
+ interface ChipProps {
574
+ /** The content to display inside the chip */
575
+ children: React__default.ReactNode;
576
+ /** Callback when the remove button is clicked */
577
+ onRemove?: () => void;
578
+ /** Size variant of the chip */
579
+ size?: Size | "xs";
580
+ /** Visual variant of the chip */
581
+ /**
582
+ * Visual treatment. Use `primary` for selected/applied chips and
583
+ * `secondary` for available/lower-emphasis chips. `default` and `brand` are
584
+ * deprecated aliases for `secondary` and `primary`, respectively.
585
+ */
586
+ variant?: ChipVariant | LegacyChipVariant;
587
+ /** Whether the chip can be removed (shows X button) */
588
+ isRemovable?: boolean;
589
+ /** Whether the chip is disabled */
590
+ isDisabled?: boolean;
591
+ /** Additional CSS classes */
592
+ className?: string;
593
+ /** Click handler for the chip itself (not the remove button) */
594
+ onClick?: () => void;
595
+ }
804
596
  /**
805
- * Capacity formatting utilities for batteries and energy storage
806
- *
807
- * Domain-specific formatters for energy capacity (kWh) and power ratings (kW).
808
- * Auto-scales to appropriate units (MWh, MW for large values).
809
- */
810
- /**
811
- * Format battery capacity (kWh)
812
- *
813
- * @param value - Capacity in kWh
814
- * @param decimals - Number of decimal places (default: 1)
815
- * @returns Formatted capacity string or null
597
+ * Chip
816
598
  *
817
- * @example
818
- * ```typescript
819
- * formatCapacity(13.5); // "13.5 kWh"
820
- * formatCapacity(1500); // "1.5 MWh"
821
- * formatCapacity(null); // null
822
- * ```
599
+ * A compact element that represents an input, attribute, or action.
600
+ * Can be removable with an X button and supports different variants and sizes.
823
601
  */
824
- declare function formatCapacity(value: number | null | undefined, decimals?: number): string | null;
602
+ declare function Chip({ children, onRemove, size, variant, isRemovable, isDisabled, className, onClick, }: ChipProps): react_jsx_runtime.JSX.Element;
603
+
604
+ interface Item {
605
+ id: string;
606
+ name: string;
607
+ }
608
+ interface ChipInputFieldProps {
609
+ /** Field label */
610
+ label?: string;
611
+ /** Field description */
612
+ description?: string;
613
+ /** Error message to display */
614
+ errorMessage?: string | ((validation: ValidationResult) => string);
615
+ /** Size variant */
616
+ size?: Size;
617
+ /** Tooltip for the label */
618
+ tooltip?: string;
619
+ /** Whether the field is required */
620
+ isRequired?: boolean;
621
+ /** Whether the field is disabled */
622
+ isDisabled?: boolean;
623
+ /** Whether the field is invalid */
624
+ isInvalid?: boolean;
625
+ /** Validation result */
626
+ validationResult?: ValidationResult;
627
+ /** Placeholder text for the input */
628
+ placeholder?: string;
629
+ /** Selected items (array of item IDs) */
630
+ selectedItems?: string[];
631
+ /** Callback when selected items change */
632
+ onItemsChange?: (items: string[]) => void;
633
+ /** Static items for autocomplete suggestions */
634
+ staticItems?: Item[];
635
+ /** Async function to fetch suggestions (alternative to staticItems) */
636
+ fetchSuggestions?: (query: string) => Promise<string[]>;
637
+ /** Custom chip variant */
638
+ chipVariant?: "primary" | "secondary" | "info" | "default" | "brand";
639
+ /** Whether to show errors */
640
+ showErrors?: boolean;
641
+ /** Additional CSS classes */
642
+ className?: string;
643
+ }
825
644
  /**
826
- * Format power rating (kW)
827
- *
828
- * @param value - Power rating in kW
829
- * @param decimals - Number of decimal places (default: 1)
830
- * @returns Formatted power rating string or null
645
+ * ChipInputField
831
646
  *
832
- * @example
833
- * ```typescript
834
- * formatPowerRating(5.2); // "5.2 kW"
835
- * formatPowerRating(2500); // "2.5 MW"
836
- * formatPowerRating(null); // null
837
- * ```
647
+ * A tags input component with autocomplete suggestions.
648
+ * Press Enter or comma to add tags, Backspace when empty to remove last tag.
649
+ * Supports both static items and async fetching for suggestions.
838
650
  */
839
- declare function formatPowerRating(value: number | null | undefined, decimals?: number): string | null;
651
+ declare function ChipInputField({ label, description, errorMessage, size, tooltip, isRequired, isDisabled, isInvalid, validationResult, placeholder, selectedItems, onItemsChange, staticItems, fetchSuggestions, chipVariant, showErrors, className, }: ChipInputFieldProps): react_jsx_runtime.JSX.Element;
840
652
 
653
+ type CollapseVariant = "contained" | "bordered" | "plain";
654
+ type CollapseDensity = "comfortable" | "compact";
655
+ interface CollapseProps extends Omit<DisclosureGroupProps, "className"> {
656
+ variant?: CollapseVariant;
657
+ density?: CollapseDensity;
658
+ showDividers?: boolean;
659
+ className?: DisclosureGroupProps["className"];
660
+ }
841
661
  /**
842
- * Shared CSV export helpers for unit-bearing FieldFormats.
843
- *
844
- * CSV columns need one unit for the whole column, not per-row auto-scaling. The
845
- * on-screen display can happily render "12 kV" one row and "500 mV" the next
846
- * because a human reads them in context, but in a spreadsheet that mixes
847
- * magnitudes in a single column and makes the data unusable.
848
- *
849
- * These helpers pick a stable column-wide unit for a given FieldFormat and
850
- * return the bare number that matches that unit:
662
+ * Collapse
851
663
  *
852
- * - `csvUnitFor(format)` → the unit string to show in the column header,
853
- * or null when the format has no meaningful unit (text, number, date, …).
854
- * - `csvValueFor(raw, format)` the bare-number string for a cell in that
855
- * column. Returns null for non-numeric formats (caller falls back to the
856
- * regular display formatter), and "" when the display would be blank
857
- * (hideWhenNull / hideWhenZero / null value).
858
- *
859
- * Consumers:
860
- * - `apps/dashboard/components/Explorer/tables/deviceFieldExport.ts` (Explore CSV)
861
- * - `packages/edges/src/utils/chartExport.ts` (chart CSV export)
664
+ * A composable disclosure group built on `react-aria-components` that follows the
665
+ * Edges design system. Supports contained, bordered, and plain variants along
666
+ * with compact or comfortable density options.
862
667
  */
668
+ declare function Collapse({ variant, density, showDividers, className, ...props }: CollapseProps): react_jsx_runtime.JSX.Element;
669
+ interface CollapseItemProps extends Omit<DisclosureProps, "className" | "children"> {
670
+ className?: DisclosureProps["className"];
671
+ children?: React$1.ReactNode;
672
+ }
673
+ declare function CollapseItem({ className, children, ...props }: CollapseItemProps): react_jsx_runtime.JSX.Element;
674
+ declare namespace CollapseItem {
675
+ var displayName: string;
676
+ }
677
+ interface CollapseHeaderProps extends Omit<ButtonProps, "children" | "slot"> {
678
+ title?: React$1.ReactNode;
679
+ description?: React$1.ReactNode;
680
+ startContent?: React$1.ReactNode;
681
+ endContent?: React$1.ReactNode;
682
+ indicator?: React$1.ReactNode | ((state: {
683
+ isExpanded: boolean;
684
+ isDisabled: boolean;
685
+ }) => React$1.ReactNode);
686
+ indicatorPosition?: "start" | "end";
687
+ showIndicator?: boolean;
688
+ keepIndicatorSpace?: boolean;
689
+ children?: React$1.ReactNode;
690
+ }
691
+ declare function CollapseHeader({ title, description, startContent, endContent, indicator, indicatorPosition, showIndicator, keepIndicatorSpace, children, className, ...props }: CollapseHeaderProps): react_jsx_runtime.JSX.Element;
692
+ declare namespace CollapseHeader {
693
+ var displayName: string;
694
+ }
695
+ interface CollapseContentProps extends Omit<DisclosurePanelProps, "className"> {
696
+ className?: DisclosurePanelProps["className"];
697
+ }
698
+ declare function CollapseContent({ className, children, ...props }: CollapseContentProps): react_jsx_runtime.JSX.Element;
699
+ declare namespace CollapseContent {
700
+ var displayName: string;
701
+ }
863
702
 
703
+ interface ConfirmProps {
704
+ /**
705
+ * Whether the confirm dialog is open
706
+ */
707
+ isOpen: boolean;
708
+ /**
709
+ * Callback when the dialog is closed without confirming
710
+ */
711
+ onClose: () => void;
712
+ /**
713
+ * Callback when the confirm button is pressed
714
+ */
715
+ onConfirm: () => void;
716
+ /**
717
+ * Dialog title
718
+ */
719
+ title: string;
720
+ /**
721
+ * Confirmation message/content
722
+ */
723
+ message: React__default.ReactNode;
724
+ /**
725
+ * Label for the confirm button
726
+ * @default "Confirm"
727
+ */
728
+ confirmLabel?: string;
729
+ /**
730
+ * Label for the cancel button
731
+ * @default "Cancel"
732
+ */
733
+ cancelLabel?: string;
734
+ /**
735
+ * Variant for the confirm button
736
+ * @default "primary"
737
+ */
738
+ confirmVariant?: DialogAction["variant"];
739
+ /**
740
+ * Whether the confirm action is destructive (uses destructive styling)
741
+ * @default false
742
+ */
743
+ isDestructive?: boolean;
744
+ /**
745
+ * Whether the confirm button is in a loading state
746
+ * @default false
747
+ */
748
+ isLoading?: boolean;
749
+ /**
750
+ * Maximum width of the confirm dialog
751
+ * @default "500px"
752
+ */
753
+ maxWidth?: string;
754
+ /**
755
+ * Minimum width of the confirm dialog (desktop only)
756
+ * @default "400px"
757
+ */
758
+ minWidth?: string;
759
+ }
864
760
  /**
865
- * Pick the CSV column unit for a FieldFormat.
761
+ * Confirm
866
762
  *
867
- * Rules:
868
- * - Explicit `unit` on the format wins.
869
- * - Otherwise fall back to the format's canonical base unit
870
- * (`DEFAULT_BASE_UNIT` lookup) so every row in the column shares one unit
871
- * even if the on-screen display would auto-scale.
872
- * - Energy honours `sourceUnit` (e.g. meter consumption is stored in kWh) as
873
- * the natural stable unit when neither `unit` nor a base fallback would fit.
874
- * - Temperature symbols are normalised from `"C"`/`"CELSIUS"` etc. to `"°C"`.
875
- * - Formats with no meaningful unit (text, number, date, boolean, currency,
876
- * phone, custom) return null.
763
+ * A confirmation dialog with confirm and cancel actions.
764
+ * Use for actions that require user confirmation before proceeding.
877
765
  */
878
- declare function csvUnitFor(format: FieldFormat | undefined | null): string | null;
766
+ declare function Confirm({ isOpen, onClose, onConfirm, title, message, confirmLabel, cancelLabel, confirmVariant, isDestructive, isLoading, maxWidth, minWidth, }: ConfirmProps): react_jsx_runtime.JSX.Element;
767
+
768
+ interface ConnectionStatusBadgeProps extends Omit<BadgeProps, "variant" | "children"> {
769
+ /** Whether the device is currently connected */
770
+ isConnected: boolean;
771
+ /** Timestamp when the device last connected */
772
+ connectedAt?: Date | string | null;
773
+ /** Timestamp when the device disconnected */
774
+ disconnectedAt?: Date | string | null;
775
+ /** Show timestamp below the status */
776
+ showTimestamp?: boolean;
777
+ /** Loading state */
778
+ isLoading?: boolean;
779
+ }
879
780
  /**
880
- * Convert a raw value to a bare-number CSV string in the same unit
881
- * `csvUnitFor` reports.
781
+ * ConnectionStatusBadge
882
782
  *
883
- * Returns:
884
- * - `null` when the format is non-numeric (caller falls back to the display
885
- * formatter, e.g. text/date/enum).
886
- * - `""` when the display would suppress the value (hideWhenNull / hideWhenZero).
887
- * - a bare number string otherwise, with the trailing unit stripped so the
888
- * cell can be summed / charted in the spreadsheet.
783
+ * Displays device connection status with optional timestamps.
784
+ * - Green "Connected" badge with pulsing dot
785
+ * - Gray "Disconnected" badge with duration offline
786
+ * - Auto-calculates "offline for 2 hours" type strings
787
+ *
788
+ * @example
789
+ * ```tsx
790
+ * <ConnectionStatusBadge isConnected={true} />
791
+ * <ConnectionStatusBadge isConnected={false} disconnectedAt={new Date()} showTimestamp />
792
+ * <ConnectionStatusBadge isConnected={true} connectedAt={new Date()} />
793
+ * ```
889
794
  */
890
- declare function csvValueFor(raw: unknown, format: FieldFormat): string | null;
795
+ declare function ConnectionStatusBadge({ isConnected, connectedAt, disconnectedAt, showTimestamp, isLoading, size, shape, ...badgeProps }: ConnectionStatusBadgeProps): react_jsx_runtime.JSX.Element;
891
796
 
797
+ interface ContactCardProps {
798
+ /** First name */
799
+ firstName: string;
800
+ /** Last name */
801
+ lastName: string;
802
+ /** Email address (optional) */
803
+ email?: string;
804
+ /** Phone number (optional) */
805
+ phone?: string;
806
+ /** Avatar image URL (optional) */
807
+ avatarUrl?: string;
808
+ /** Link to contact detail page (optional) */
809
+ href?: string;
810
+ /** Custom link component (e.g., Next.js Link) */
811
+ LinkComponent?: LinkComponentType;
812
+ /** Card variant */
813
+ variant?: "outlined" | "elevated" | "filled" | "ghost";
814
+ /** Layout orientation
815
+ * @default "horizontal"
816
+ * - "horizontal": Avatar on left, info on right
817
+ * - "vertical": Avatar on top, info below (centered, better for narrow/square containers)
818
+ */
819
+ layout?: "horizontal" | "vertical";
820
+ /** Show email address
821
+ * @default true
822
+ */
823
+ showEmail?: boolean;
824
+ /** Show phone number
825
+ * @default false
826
+ */
827
+ showPhone?: boolean;
828
+ /** Loading state */
829
+ isLoading?: boolean;
830
+ /** Additional classes for the card */
831
+ className?: string;
832
+ /** Additional classes for the card content (for padding control, etc.) */
833
+ contentClassName?: string;
834
+ /**
835
+ * Entity identifier for PII masking (e.g., "contact:ctc_abc123")
836
+ * When provided, adds data-pii-* attributes for the Curtain extension
837
+ */
838
+ piiEntity?: string;
839
+ }
892
840
  /**
893
- * Electrical current formatting utilities (flow of electric charge)
841
+ * ContactCard
842
+ *
843
+ * A card component for displaying contact information with avatar.
844
+ * Includes name, optional email, and optional phone number.
845
+ *
846
+ * @example
847
+ * ```tsx
848
+ * <ContactCard
849
+ * firstName="John"
850
+ * lastName="Doe"
851
+ * email="john.doe@example.com"
852
+ * phone="+1 (555) 123-4567"
853
+ * showEmail
854
+ * showPhone
855
+ * href="/contacts/123"
856
+ * />
857
+ * ```
894
858
  */
859
+ declare function ContactCard({ firstName, lastName, email, phone, avatarUrl, href, LinkComponent, variant, layout, showEmail, showPhone, isLoading, className, contentClassName, piiEntity, }: ContactCardProps): react_jsx_runtime.JSX.Element;
895
860
 
896
861
  /**
897
- * Format as milliamps
898
- */
899
- declare const toMilliamps: (value: number | null | undefined, decimals?: number) => string | null;
900
- /**
901
- * Format as amperes
862
+ * Tailwind CSS default breakpoints
863
+ * These match the standard Tailwind breakpoints used in your CSS
902
864
  */
903
- declare const toAmps: (value: number | null | undefined, decimals?: number) => string | null;
865
+ declare const BREAKPOINTS: {
866
+ readonly sm: "640px";
867
+ readonly md: "768px";
868
+ readonly lg: "1024px";
869
+ readonly xl: "1280px";
870
+ readonly "2xl": "1536px";
871
+ };
872
+ type Breakpoint = keyof typeof BREAKPOINTS;
873
+ interface BreakpointState {
874
+ /** Current active breakpoint (highest matching breakpoint) */
875
+ current: Breakpoint | "base";
876
+ /** True if viewport is at least 640px (sm breakpoint or higher) */
877
+ isSm: boolean;
878
+ /** True if viewport is at least 768px (md breakpoint or higher) */
879
+ isMd: boolean;
880
+ /** True if viewport is at least 1024px (lg breakpoint or higher) */
881
+ isLg: boolean;
882
+ /** True if viewport is at least 1280px (xl breakpoint or higher) */
883
+ isXl: boolean;
884
+ /** True if viewport is at least 1536px (2xl breakpoint or higher) */
885
+ is2Xl: boolean;
886
+ /** True if viewport is smaller than 768px (mobile) */
887
+ isMobile: boolean;
888
+ /** True if viewport is 768px or larger (tablet/desktop) */
889
+ isDesktop: boolean;
890
+ }
904
891
  /**
905
- * Format as kiloamps (rarely used but included for completeness)
892
+ * Public return type alias for useBreakpoint hook
893
+ * Provides a stable public API for barrel re-exports
906
894
  */
907
- declare const toKiloamps: (value: number | null | undefined, decimals?: number) => string | null;
895
+ type UseBreakpointReturn = BreakpointState;
908
896
  /**
909
- * Auto-scale current to the most appropriate unit
910
- */
911
- declare const autoScaleCurrent: (value: number | null | undefined, decimals?: number) => string | null;
912
- /**
913
- * Format current according to CurrentFormat specification
914
- */
915
- declare const formatCurrent: (value: FieldValue, format: CurrentFormat) => FormattedValue;
916
- declare const toMA: (value: number | null | undefined, decimals?: number) => string | null;
917
- declare const toA: (value: number | null | undefined, decimals?: number) => string | null;
918
- declare const toKA: (value: number | null | undefined, decimals?: number) => string | null;
919
-
920
- /**
921
- * Date formatting utilities using Luxon
922
- */
923
-
924
- /**
925
- * Format date to a localized string with optional time and timezone.
897
+ * Hook to detect which Tailwind breakpoint is currently active
926
898
  *
927
- * @param value - Date value (string, Date object, or timestamp)
928
- * @param showTime - Whether to include time in the output (default: false)
929
- * @param timezone - Optional timezone for display (e.g., "America/New_York")
930
- * @returns Formatted date string or null
899
+ * Returns an object with boolean flags for each breakpoint and convenience helpers.
900
+ * All breakpoints use min-width queries to match Tailwind's mobile-first approach.
901
+ *
902
+ * @param defaultBreakpoint - The breakpoint to assume during SSR or before first render (defaults to "base" for mobile-first)
903
+ * @returns An object containing breakpoint state information
931
904
  *
932
905
  * @example
933
- * ```typescript
934
- * toDateString(new Date()); // "12/25/2023"
935
- * toDateString(new Date(), true); // "12/25/2023, 3:30 PM"
936
- * toDateString("2023-12-25T15:30:00Z", true, "America/New_York"); // "12/25/2023, 10:30 AM"
937
- * ```
938
- */
939
- declare const toDateString: (value: string | Date | number | null | undefined, showTime?: boolean, timezone?: string) => string | null;
940
- /**
941
- * Format date to relative time (e.g., "2 hours ago", "in 3 days").
942
- * Automatically chooses the most appropriate unit.
906
+ * ```tsx
907
+ * const { isMobile, isDesktop, current } = useBreakpoint();
943
908
  *
944
- * @param value - Date value (string, Date object, or timestamp)
945
- * @returns Relative time string or null
909
+ * // Conditional rendering based on screen size
910
+ * return isMobile ? <MobileNav /> : <DesktopNav />;
946
911
  *
947
- * @example
948
- * ```typescript
949
- * toRelativeTime(new Date(Date.now() - 3600000)); // "1 hour ago"
950
- * toRelativeTime(new Date(Date.now() + 86400000)); // "in 1 day"
951
- * toRelativeTime(new Date()); // "now"
912
+ * // Check specific breakpoint
913
+ * if (isLg) {
914
+ * // Show expanded view on large screens
915
+ * }
916
+ *
917
+ * // Use current breakpoint
918
+ * console.log(`Current breakpoint: ${current}`); // "md", "lg", etc.
952
919
  * ```
953
920
  */
954
- declare const toRelativeTime: (value: string | Date | number | null | undefined) => string | null;
955
- /**
956
- * Format date with full date and time including weekday
957
- */
958
- declare const toFullDateTime: (value: string | Date | number | null | undefined, timezone?: string) => string | null;
959
- /**
960
- * Format date to ISO string
961
- */
962
- declare const toISOString: (value: string | Date | number | null | undefined) => string | null;
963
- /**
964
- * Format date with custom format string
965
- */
966
- declare const toCustomDateFormat: (value: string | Date | number | null | undefined, format: string, timezone?: string) => string | null;
967
- /**
968
- * Get formatted date parts
969
- */
970
- declare const getDateParts: (value: string | Date | number | null | undefined) => {
971
- year: number;
972
- month: number;
973
- day: number;
974
- weekday: number;
975
- hour: number;
976
- minute: number;
977
- second: number;
978
- millisecond: number;
979
- weekdayShort: string | null;
980
- weekdayLong: string | null;
981
- monthShort: string | null;
982
- monthLong: string | null;
983
- } | null;
984
- /**
985
- * Format date according to DateFormat specification
986
- */
987
- declare const formatDate: (value: FieldValue, format: DateFormat) => FormattedValue;
921
+ declare function useBreakpoint(defaultBreakpoint?: Breakpoint | "base"): BreakpointState;
988
922
 
989
923
  /**
990
- * Distance and length formatting utilities
924
+ * Data Controls Types
925
+ *
926
+ * Core type definitions for client-side and server-side data filtering,
927
+ * sorting, faceting, and search operations.
991
928
  */
992
-
929
+ type FilterOperator = "eq" | "neq" | "in" | "nin" | "gt" | "gte" | "lt" | "lte" | "contains" | "startsWith" | "endsWith";
930
+ interface FilterCondition {
931
+ /** Field name (supports nested paths like 'user.profile.name') */
932
+ field: string;
933
+ /** Comparison operator */
934
+ operator: FilterOperator;
935
+ /** Value to compare against */
936
+ value: string | number | boolean | (string | number)[];
937
+ }
938
+ interface FilterGroup {
939
+ /** Logical operator combining conditions */
940
+ logic: "AND" | "OR";
941
+ /** Conditions or nested filter groups */
942
+ conditions: (FilterCondition | FilterGroup)[];
943
+ }
944
+ /** Root filter state - can be empty, a single group, or nested groups */
945
+ type FilterState = FilterGroup | null;
946
+ interface SortState {
947
+ /** Field to sort by (supports nested paths) */
948
+ field: string;
949
+ /** Sort direction */
950
+ direction: "asc" | "desc";
951
+ }
952
+ interface SearchConfig {
953
+ /** Search query string */
954
+ query: string;
955
+ /** Fields to search across */
956
+ fields: string[];
957
+ /** Use fuzzy matching (Fuse.js) - default true */
958
+ fuzzy?: boolean;
959
+ /** Fuse.js matching threshold (0.0 = perfect, 1.0 = anything) - default 0.3 */
960
+ threshold?: number;
961
+ }
962
+ type FacetType = "string" | "number" | "boolean" | "date";
963
+ interface FacetConfig {
964
+ /** Field name to facet on */
965
+ field: string;
966
+ /** Display label for the facet */
967
+ label: string;
968
+ /** Data type of the field */
969
+ type?: FacetType;
970
+ /** Optional: Provide predefined values for the facet (useful for enums) */
971
+ values?: Array<{
972
+ value: string | number;
973
+ label: string;
974
+ }>;
975
+ /** Number of options to show before requiring search (default: 10) */
976
+ searchThreshold?: number;
977
+ /** Max options to show initially, with "Show all" button for rest (default: 50) */
978
+ maxVisibleOptions?: number;
979
+ /** Optional description text to show below the label */
980
+ description?: string;
981
+ /** Optional: Custom render function for option labels (e.g., to show Badges) */
982
+ renderLabel?: (value: string, label: string) => React.ReactNode;
983
+ /** Optional: Group name for organizing filters in FilterDialog */
984
+ group?: string;
985
+ }
986
+ interface FacetCounts {
987
+ [field: string]: {
988
+ [value: string]: number;
989
+ };
990
+ }
993
991
  /**
994
- * Format as meters
992
+ * Create a single filter condition
995
993
  */
996
- declare const toMeters: (value: number | null | undefined, decimals?: number) => string | null;
994
+ declare function createFilter(field: string, operator: FilterOperator, value: string | number | boolean | (string | number)[]): FilterCondition;
997
995
  /**
998
- * Format as centimeters
996
+ * Create a filter group from multiple conditions with AND logic
999
997
  */
1000
- declare const toCentimeters: (value: number | null | undefined, decimals?: number) => string | null;
998
+ declare function createFilters(conditions: FilterCondition[], logic?: "AND" | "OR"): FilterGroup;
1001
999
  /**
1002
- * Format as millimeters
1000
+ * Create an empty filter state
1003
1001
  */
1004
- declare const toMillimeters: (value: number | null | undefined, decimals?: number) => string | null;
1002
+ declare function createEmptyFilter(): FilterGroup;
1005
1003
  /**
1006
- * Format as kilometers
1004
+ * Check if a filter state is empty (no conditions)
1007
1005
  */
1008
- declare const toKilometers: (value: number | null | undefined, decimals?: number) => string | null;
1006
+ declare function isFilterEmpty(filter: FilterState): boolean;
1009
1007
  /**
1010
- * Format as feet
1008
+ * Convert structured filter state to simple display chips
1009
+ * Used for backward compatibility with existing FilterChips component
1011
1010
  */
1012
- declare const toFeet: (value: number | null | undefined, decimals?: number) => string | null;
1011
+ interface FilterChip {
1012
+ id: string;
1013
+ label: string;
1014
+ value: string;
1015
+ }
1016
+ declare function filterToChips(filter: FilterState, facetConfigs?: FacetConfig[]): FilterChip[];
1013
1017
  /**
1014
- * Format as inches
1018
+ * Add a condition to a filter state
1015
1019
  */
1016
- declare const toInches: (value: number | null | undefined, decimals?: number) => string | null;
1020
+ declare function addFilterCondition(filter: FilterState, condition: FilterCondition): FilterGroup;
1017
1021
  /**
1018
- * Format as miles
1022
+ * Remove a condition from a filter state by field
1019
1023
  */
1020
- declare const toMiles: (value: number | null | undefined, decimals?: number) => string | null;
1024
+ declare function removeFilterCondition(filter: FilterState, field: string): FilterGroup;
1021
1025
  /**
1022
- * Format as yards
1026
+ * Get all unique fields being filtered on
1023
1027
  */
1024
- declare const toYards: (value: number | null | undefined, decimals?: number) => string | null;
1028
+ declare function getFilterFields(filter: FilterState): string[];
1029
+
1030
+ interface UseClientDataControlsOptions<T> {
1031
+ /** Raw data to process */
1032
+ data: T[];
1033
+ /** Filter state */
1034
+ filters?: FilterState;
1035
+ /** Sort state */
1036
+ sort?: SortState | null;
1037
+ /** Search configuration */
1038
+ search?: SearchConfig | null;
1039
+ /** Facet configurations */
1040
+ facetConfigs?: FacetConfig[];
1041
+ }
1042
+ interface UseClientDataControlsResult<T> {
1043
+ /** Processed data (filtered, sorted, searched) */
1044
+ data: T[];
1045
+ /** Facet counts computed from filtered data */
1046
+ facetCounts: FacetCounts;
1047
+ /** Number of results after filtering/searching */
1048
+ resultCount: number;
1049
+ }
1025
1050
  /**
1026
- * Format as nautical miles
1051
+ * useClientDataControls
1052
+ *
1053
+ * Client-side hook for filtering, sorting, searching, and faceting data.
1054
+ * Uses memoization to avoid unnecessary recomputation.
1055
+ *
1056
+ * Operations are applied in this order:
1057
+ * 1. Search (fuzzy or exact matching)
1058
+ * 2. Filter (structured conditions)
1059
+ * 3. Facet computation (on filtered data)
1060
+ * 4. Sort
1061
+ *
1062
+ * @example
1063
+ * ```tsx
1064
+ * const { data, facetCounts, resultCount } = useClientDataControls({
1065
+ * data: rawData,
1066
+ * filters: createFilters([
1067
+ * createFilter('department', 'in', ['Engineering', 'Sales'])
1068
+ * ]),
1069
+ * sort: { field: 'name', direction: 'asc' },
1070
+ * search: { query: searchQuery, fields: ['name', 'email'] },
1071
+ * facetConfigs: [
1072
+ * { field: 'department', label: 'Department' },
1073
+ * { field: 'status', label: 'Status' }
1074
+ * ]
1075
+ * });
1076
+ * ```
1027
1077
  */
1028
- declare const toNauticalMiles: (value: number | null | undefined, decimals?: number) => string | null;
1078
+ declare function useClientDataControls<T>({ data, filters, sort, search, facetConfigs, }: UseClientDataControlsOptions<T>): UseClientDataControlsResult<T>;
1079
+
1029
1080
  /**
1030
- * Conversion utilities
1031
- */
1032
- declare const metersToFeet: (meters: number) => number;
1033
- declare const feetToMeters: (feet: number) => number;
1034
- declare const milesToKilometers: (miles: number) => number;
1035
- declare const kilometersToMiles: (km: number) => number;
1036
- declare const feetToMiles: (feet: number) => number;
1037
- declare const milesToFeet: (miles: number) => number;
1038
- declare const metersToMiles: (meters: number) => number;
1039
- declare const milesToMeters: (miles: number) => number;
1040
- declare const yardsToMeters: (yards: number) => number;
1041
- declare const metersToYards: (meters: number) => number;
1042
- declare const inchesToCentimeters: (inches: number) => number;
1043
- declare const centimetersToInches: (cm: number) => number;
1044
- /**
1045
- * Auto-scale distance to the most appropriate unit
1046
- */
1047
- declare const autoScaleDistance: (value: number | null | undefined, metric?: boolean, decimals?: number) => string | null;
1048
- /**
1049
- * Format distance according to DistanceFormat specification
1081
+ * useContainerBreakpoint — measures a container element's width and returns
1082
+ * the same BreakpointState shape as useBreakpoint, but derived from the
1083
+ * container, not the window.
1084
+ *
1085
+ * Blocks that need to respond to their render width (not the viewport) should
1086
+ * use this hook instead of useBreakpoint. When rendered inside a
1087
+ * ContainerQueryProvider, the hook reads from context (no ref needed). When
1088
+ * no provider is present, it falls back to measuring its own ref, or
1089
+ * ultimately to window-based breakpoints.
1090
+ *
1091
+ * @returns BreakpointState same shape as useBreakpoint
1050
1092
  */
1051
- declare const formatDistance: (value: FieldValue, format: DistanceFormat) => FormattedValue;
1093
+ declare function useContainerBreakpoint(containerRef?: React.RefObject<HTMLElement | null>): BreakpointState;
1052
1094
 
1095
+ interface ServerDataState {
1096
+ filters: FilterState;
1097
+ sort: SortState | null;
1098
+ search: SearchConfig | null;
1099
+ }
1100
+ interface UseServerDataControlsOptions {
1101
+ /** Filter state */
1102
+ filters: FilterState;
1103
+ /** Sort state */
1104
+ sort: SortState | null;
1105
+ /** Search configuration */
1106
+ search: SearchConfig | null;
1107
+ /** Callback when state changes (debounced for search) */
1108
+ onStateChange: (state: ServerDataState) => void;
1109
+ /** Search debounce delay in ms (default: 300) */
1110
+ searchDebounce?: number;
1111
+ }
1053
1112
  /**
1054
- * Energy formatting utilities (stored or consumed energy)
1055
- * For power (rate of energy), use power.ts
1056
- * For electrical units (voltage, current), use voltage.ts and current.ts
1113
+ * useServerDataControls
1114
+ *
1115
+ * Server-side hook that notifies the parent when filter/sort/search state changes.
1116
+ * Search queries are debounced to avoid excessive API calls.
1117
+ *
1118
+ * This hook doesn't manipulate data - it just provides a clean way to:
1119
+ * 1. Debounce search input
1120
+ * 2. Notify when any state changes
1121
+ * 3. Trigger server refetch
1122
+ *
1123
+ * @example
1124
+ * ```tsx
1125
+ * const [filters, setFilters] = useState(null);
1126
+ * const [sort, setSort] = useState({ field: 'name', direction: 'asc' });
1127
+ * const [search, setSearch] = useState({ query: '', fields: ['name'] });
1128
+ *
1129
+ * useServerDataControls({
1130
+ * filters,
1131
+ * sort,
1132
+ * search,
1133
+ * onStateChange: (state) => {
1134
+ * // Refetch data with new parameters
1135
+ * refetch({
1136
+ * filters: state.filters,
1137
+ * sort: state.sort,
1138
+ * search: state.search?.query
1139
+ * });
1140
+ * }
1141
+ * });
1142
+ * ```
1057
1143
  */
1144
+ declare function useServerDataControls({ filters, sort, search, onStateChange, searchDebounce, }: UseServerDataControlsOptions): void;
1058
1145
 
1146
+ interface UseDataControlsClientOptions<T> {
1147
+ mode: "client";
1148
+ /** Raw data to process (required in client mode) */
1149
+ data: T[];
1150
+ /** Filter state */
1151
+ filters?: FilterState;
1152
+ /** Sort state */
1153
+ sort?: SortState | null;
1154
+ /** Search configuration */
1155
+ search?: SearchConfig | null;
1156
+ /** Facet configurations */
1157
+ facetConfigs?: FacetConfig[];
1158
+ }
1159
+ interface UseDataControlsServerOptions<T> {
1160
+ mode: "server";
1161
+ /** Data from server (already filtered/sorted) */
1162
+ data: T[];
1163
+ /** Filter state */
1164
+ filters: FilterState;
1165
+ /** Sort state */
1166
+ sort: SortState | null;
1167
+ /** Search configuration */
1168
+ search: SearchConfig | null;
1169
+ /** Callback when state changes (required in server mode) */
1170
+ onStateChange: (state: ServerDataState) => void;
1171
+ /** Search debounce delay in ms (default: 300) */
1172
+ searchDebounce?: number;
1173
+ /** Result count from server */
1174
+ resultCount?: number;
1175
+ /** Facet counts from server */
1176
+ facetCounts?: FacetCounts;
1177
+ }
1178
+ type UseDataControlsOptions<T> = UseDataControlsClientOptions<T> | UseDataControlsServerOptions<T>;
1179
+ interface UseDataControlsResult<T> {
1180
+ /** Processed data (client mode) or server data (server mode) */
1181
+ data: T[];
1182
+ /** Facet counts (computed in client mode, passed through in server mode) */
1183
+ facetCounts: FacetCounts;
1184
+ /** Result count (computed in client mode, passed through in server mode) */
1185
+ resultCount: number;
1186
+ }
1059
1187
  /**
1060
- * Format as Watt-hours
1061
- */
1062
- declare const toWh: (value: number | null | undefined, decimals?: number) => string | null;
1063
- /**
1064
- * Format as kilowatt-hours
1065
- */
1066
- declare const tokWh: (value: number | null | undefined, decimals?: number) => string | null;
1067
- /**
1068
- * Format as megawatt-hours
1069
- */
1070
- declare const toMWh: (value: number | null | undefined, decimals?: number) => string | null;
1071
- /**
1072
- * Format as gigawatt-hours
1073
- */
1074
- declare const toGWh: (value: number | null | undefined, decimals?: number) => string | null;
1075
- /**
1076
- * Pick the display unit auto-scaling would choose for a Wh magnitude.
1077
- */
1078
- declare const pickEnergyUnit: (whValue: number) => EnergyUnit;
1079
- /**
1080
- * Auto-scale energy to the most appropriate unit
1081
- */
1082
- declare const autoScaleEnergy: (value: number | null | undefined, decimals?: number) => string | null;
1083
- /**
1084
- * Format energy according to EnergyFormat specification
1085
- */
1086
- /**
1087
- * Multiplier from the named energy unit to Wh — the formatter's internal
1088
- * reference unit. Keep in sync with `EnergyUnit`.
1188
+ * useDataControls
1189
+ *
1190
+ * Unified hook for managing data filtering, sorting, searching, and faceting.
1191
+ * Supports both client-side and server-side modes.
1192
+ *
1193
+ * **Client Mode:**
1194
+ * - Processes data locally using pure functions
1195
+ * - Computes facet counts automatically
1196
+ * - Best for datasets < 5000 rows
1197
+ *
1198
+ * **Server Mode:**
1199
+ * - Notifies parent when state changes (debounced for search)
1200
+ * - Passes through server-provided data and counts
1201
+ * - Best for large datasets or complex queries
1202
+ *
1203
+ * @example Client Mode
1204
+ * ```tsx
1205
+ * const { data, facetCounts, resultCount } = useDataControls({
1206
+ * mode: 'client',
1207
+ * data: rawData,
1208
+ * filters: createFilters([...]),
1209
+ * sort: { field: 'name', direction: 'asc' },
1210
+ * search: { query: searchQuery, fields: ['name', 'email'] },
1211
+ * facetConfigs: [{ field: 'department', label: 'Department' }]
1212
+ * });
1213
+ * ```
1214
+ *
1215
+ * @example Server Mode
1216
+ * ```tsx
1217
+ * const { data, facetCounts, resultCount } = useDataControls({
1218
+ * mode: 'server',
1219
+ * data: serverData, // Already filtered
1220
+ * filters,
1221
+ * sort,
1222
+ * search,
1223
+ * resultCount: totalCount,
1224
+ * facetCounts: serverFacets,
1225
+ * onStateChange: (state) => refetch(state)
1226
+ * });
1227
+ * ```
1089
1228
  */
1090
- declare const SOURCE_UNIT_TO_WH: Record<EnergyUnit, number>;
1091
- declare const formatEnergy: (value: FieldValue, format: EnergyFormat) => FormattedValue;
1229
+ declare function useDataControls<T>(options: UseDataControlsOptions<T>): UseDataControlsResult<T>;
1092
1230
 
1231
+ declare function useDebounce<T>(value: T, delay?: number): T;
1232
+
1233
+ interface ElementSize {
1234
+ width: number;
1235
+ height: number;
1236
+ }
1237
+ interface UseElementSizeResult<T extends HTMLElement = HTMLElement> {
1238
+ ref: (node: T | null) => void;
1239
+ width: number;
1240
+ height: number;
1241
+ }
1093
1242
  /**
1094
- * `formatFieldValue` dispatcher — extracted from `./index.ts` into its own
1095
- * leaf module so downstream helpers (notably `csvUnit.ts`) can depend on the
1096
- * dispatcher without pulling the whole formatting barrel (and any of its
1097
- * transitively-imported React/PostHog side-effects) into a test setup.
1243
+ * useElementSize
1098
1244
  *
1099
- * `./index.ts` re-exports this module so the public API is unchanged.
1245
+ * A performant hook that tracks the dimensions of a DOM element using ResizeObserver.
1246
+ * Returns a callback ref to attach to the element and its current width/height.
1247
+ *
1248
+ * Performance optimizations:
1249
+ * - Uses ResizeObserver for efficient resize detection
1250
+ * - Debounces updates using requestAnimationFrame
1251
+ * - Cleans up observer on unmount
1252
+ *
1253
+ * @example
1254
+ * ```tsx
1255
+ * const { ref, width, height } = useElementSize();
1256
+ *
1257
+ * return (
1258
+ * <div ref={ref}>
1259
+ * Width: {width}px, Height: {height}px
1260
+ * </div>
1261
+ * );
1262
+ * ```
1100
1263
  */
1264
+ declare function useElementSize<T extends HTMLElement = HTMLElement>(): UseElementSizeResult<T>;
1101
1265
 
1102
1266
  /**
1103
- * Main formatting function that routes to the appropriate formatter based on
1104
- * the format type. See `./index.ts` for the fuller doc comment.
1267
+ * Hook for managing localStorage values with React state synchronization
1268
+ * @param key - The localStorage key
1269
+ * @param initialValue - The initial value if nothing is stored
1270
+ * @returns [value, setValue, removeValue] - Current value, setter function, and remove function
1105
1271
  */
1106
- declare const formatFieldValue: (value: FieldValue, format: FieldFormat) => FormattedValue;
1272
+ declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((val: T) => T)) => void, () => void];
1107
1273
 
1108
1274
  /**
1109
- * Number and currency formatting utilities
1275
+ * Hook to check if a media query matches the current viewport
1276
+ *
1277
+ * @param query - A CSS media query string (e.g., "(min-width: 768px)")
1278
+ * @param defaultValue - The default value to return during SSR or before the first render
1279
+ * @returns A boolean indicating whether the media query matches
1280
+ *
1281
+ * @example
1282
+ * ```tsx
1283
+ * const isMobile = useMediaQuery('(max-width: 767px)');
1284
+ * const prefersReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');
1285
+ * const isLandscape = useMediaQuery('(orientation: landscape)');
1286
+ * ```
1110
1287
  */
1288
+ declare function useMediaQuery(query: string, defaultValue?: boolean): boolean;
1111
1289
 
1112
1290
  /**
1113
- * Check if a value is null or undefined
1114
- */
1115
- declare const isNil: (value: unknown) => value is null | undefined;
1116
- /**
1117
- * Format as percentage
1118
- */
1119
- declare const toPercentage: (value: number | null | undefined, decimals?: number) => string | null;
1120
- /**
1121
- * Format percentage (simple wrapper for consistency with other formatters)
1122
- *
1123
- * @param value - Numeric value (0-100 range)
1124
- * @param precision - Number of decimal places (default: 0)
1125
- * @returns Formatted percentage string with % symbol
1126
- */
1127
- declare const formatPercent: (value: number | null | undefined, precision?: number) => string;
1128
- /**
1129
- * Format as integer
1130
- */
1131
- declare const toInteger: (value: number | null | undefined) => string | null;
1132
- /**
1133
- * Format as float with specified decimals
1134
- */
1135
- declare const toFloat: (value: number | null | undefined, decimals?: number) => string | null;
1136
- /**
1137
- * Format number with thousands separator
1138
- */
1139
- declare const toFormattedNumber: (value: number | null | undefined, decimals?: number, thousandsSeparator?: boolean) => string | null;
1140
- /**
1141
- * Format number with compact notation (1K, 1M, etc.)
1142
- */
1143
- declare const toCompactNumber: (value: number | null | undefined, display?: "short" | "long") => string | null;
1144
- /**
1145
- * Format number with scientific notation
1146
- */
1147
- declare const toScientificNotation: (value: number | null | undefined, decimals?: number) => string | null;
1148
- /**
1149
- * Format as currency
1150
- */
1151
- declare const toCurrency: (value: number | null | undefined, currency?: string, options?: Partial<CurrencyFormat>) => string | null;
1152
- /**
1153
- * Format number according to NumberFormat specification
1154
- */
1155
- declare const formatNumber: (value: FieldValue, format: NumberFormat) => FormattedValue;
1156
- /**
1157
- * Format currency according to CurrencyFormat specification
1158
- */
1159
- declare const formatCurrency: (value: FieldValue, format: CurrencyFormat) => FormattedValue;
1160
-
1161
- /**
1162
- * Phone number formatting utilities
1163
- */
1164
-
1165
- /**
1166
- * Format US phone number
1167
- */
1168
- declare const formatUSPhone: (phone: string | null | undefined) => string | null;
1169
- /**
1170
- * Format international phone number
1171
- */
1172
- declare const formatInternationalPhone: (phone: string | null | undefined) => string | null;
1173
- /**
1174
- * Format phone number with basic formatting
1175
- */
1176
- declare const formatPhoneNumber: (phone: string | null | undefined) => string | null;
1177
- /**
1178
- * Format phone according to PhoneFormat specification
1179
- */
1180
- declare const formatPhone: (value: FieldValue, format: PhoneFormat) => FormattedValue;
1181
-
1182
- /**
1183
- * Power formatting utilities (rate of energy transfer)
1291
+ * Table export utilities for CSV format
1292
+ * Provides export functionality for DataTable data
1184
1293
  */
1185
1294
 
1295
+ interface TableExportMetadata {
1296
+ /** Base filename for the exported file (without extension) */
1297
+ filename?: string;
1298
+ /** Whether to include timestamp in filename. Defaults to true */
1299
+ timestamp?: boolean;
1300
+ }
1301
+ interface TableExportOptions<T> {
1302
+ /** Column definitions for the table */
1303
+ columns: Column<T>[];
1304
+ /** Data rows to export */
1305
+ data: T[];
1306
+ /** Export metadata */
1307
+ metadata?: TableExportMetadata;
1308
+ }
1186
1309
  /**
1187
- * Format as Watts
1188
- */
1189
- declare const toWatts: (value: number | null | undefined, decimals?: number) => string | null;
1190
- /**
1191
- * Format as kilowatts
1192
- */
1193
- declare const toKilowatts: (value: number | null | undefined, decimals?: number) => string | null;
1194
- /**
1195
- * Format as megawatts
1196
- */
1197
- declare const toMegawatts: (value: number | null | undefined, decimals?: number) => string | null;
1198
- /**
1199
- * Format as gigawatts
1310
+ * Export table data as CSV
1311
+ *
1312
+ * @param options - Export configuration
1313
+ * @returns Promise that resolves when export is complete
1314
+ *
1315
+ * @example
1316
+ * ```typescript
1317
+ * await exportTableAsCSV({
1318
+ * columns: tableColumns,
1319
+ * data: tableData,
1320
+ * metadata: {
1321
+ * filename: "devices-export",
1322
+ * timestamp: true
1323
+ * }
1324
+ * });
1325
+ * ```
1200
1326
  */
1201
- declare const toGigawatts: (value: number | null | undefined, decimals?: number) => string | null;
1327
+ declare function exportTableAsCSV<T>(options: TableExportOptions<T>): Promise<void>;
1202
1328
  /**
1203
- * Auto-scale power to the most appropriate unit
1329
+ * Prepare table data for export (without triggering download)
1330
+ * Useful for server-side export where you need the transformed data
1331
+ *
1332
+ * @param options - Export configuration
1333
+ * @returns Array of row objects ready for CSV generation
1204
1334
  */
1205
- declare const autoScalePower: (value: number | null | undefined, decimals?: number) => string | null;
1335
+ declare function prepareTableDataForExport<T>(options: Omit<TableExportOptions<T>, "metadata">): Record<string, string | number | boolean>[];
1206
1336
  /**
1207
- * Format power according to PowerFormat specification
1337
+ * Get column headers for export
1338
+ * Useful for generating CSV headers on the server
1208
1339
  */
1209
- declare const formatPower: (value: FieldValue, format: PowerFormat) => FormattedValue;
1210
- declare const toW: (value: number | null | undefined, decimals?: number) => string | null;
1211
- declare const toKW: (value: number | null | undefined, decimals?: number) => string | null;
1212
- declare const toMW: (value: number | null | undefined, decimals?: number) => string | null;
1213
- declare const toGW: (value: number | null | undefined, decimals?: number) => string | null;
1340
+ declare function getExportHeaders<T>(columns: Column<T>[]): string[];
1214
1341
 
1342
+ interface UseTableExportOptions<T> {
1343
+ /** Column definitions for the table */
1344
+ columns: Column<T>[];
1345
+ /** Data rows to export */
1346
+ data: T[];
1347
+ /** Export metadata */
1348
+ metadata?: TableExportMetadata;
1349
+ }
1350
+ interface UseTableExportReturn {
1351
+ /** Trigger CSV export of the table data */
1352
+ exportCSV: () => Promise<void>;
1353
+ /** Whether export is available (has data and exportable columns) */
1354
+ canExport: boolean;
1355
+ }
1215
1356
  /**
1216
- * FormatRegistry - A singleton pattern for managing formatters
1217
- * Allows registration and retrieval of formatting functions by key
1357
+ * Hook for exporting DataTable data as CSV.
1358
+ * Provides a stable callback for triggering exports with memoized dependencies.
1359
+ *
1360
+ * For client-side DataTables where all data is in the browser.
1361
+ * For server-side exports, use the `onExport` callback pattern instead.
1362
+ *
1363
+ * @param options - Configuration for table export
1364
+ * @returns Object with export function and status
1365
+ *
1366
+ * @example
1367
+ * ```tsx
1368
+ * const { exportCSV, canExport } = useTableExport({
1369
+ * columns: deviceColumns,
1370
+ * data: devices,
1371
+ * metadata: {
1372
+ * filename: "devices",
1373
+ * timestamp: true
1374
+ * }
1375
+ * });
1376
+ *
1377
+ * // In your DataControls actions
1378
+ * <DataControls
1379
+ * actions={{
1380
+ * items: [
1381
+ * {
1382
+ * id: "export",
1383
+ * label: "Export CSV",
1384
+ * icon: "Export",
1385
+ * onClick: exportCSV,
1386
+ * disabled: !canExport
1387
+ * }
1388
+ * ]
1389
+ * }}
1390
+ * />
1391
+ * ```
1218
1392
  */
1393
+ declare function useTableExport<T>({ columns, data, metadata }: UseTableExportOptions<T>): UseTableExportReturn;
1219
1394
 
1220
- declare class FormatRegistryClass {
1221
- private formatters;
1395
+ type SortDirection = "asc" | "desc";
1396
+ type CellAlignment = "left" | "center" | "right";
1397
+ type TableDensity = "compact" | "default" | "relaxed";
1398
+ type CellEmphasis = "strong" | "high" | "normal" | "low";
1399
+ type LinkBehavior = "none" | "hover" | "visible";
1400
+ type TableLayout = "auto" | "fixed" | "responsive";
1401
+ type TableWidth = "full" | "auto" | "contained";
1402
+ type MobileRenderer = "auto" | "cards" | "custom" | "none";
1403
+ type MobileBreakpoint = "sm" | "md" | "lg" | "xl";
1404
+ interface SortConfig {
1405
+ columnId: string;
1406
+ direction: SortDirection;
1407
+ }
1408
+ interface CellContext {
1409
+ isLoading: boolean;
1410
+ isSelected?: boolean;
1411
+ isHovered?: boolean;
1412
+ rowIndex: number;
1413
+ columnIndex: number;
1414
+ density: TableDensity;
1415
+ }
1416
+ interface CellComponentProps<T = any> {
1417
+ value: any;
1418
+ row: T;
1419
+ context: CellContext;
1420
+ [key: string]: any;
1421
+ }
1422
+ type CellComponent<T = any> = ComponentType<CellComponentProps<T>>;
1423
+ interface MobileConfig {
1424
+ priority?: 1 | 2 | 3;
1425
+ format?: "primary" | "secondary" | "badge" | "inline";
1426
+ label?: boolean;
1427
+ icon?: string;
1428
+ }
1429
+ interface Column<T> {
1430
+ id: string;
1431
+ label: string;
1432
+ accessor?: keyof T | ((row: T) => any);
1433
+ align?: CellAlignment;
1434
+ width?: string | number;
1435
+ minWidth?: string | number;
1436
+ maxWidth?: string | number;
1437
+ flex?: number;
1438
+ cell?: CellComponent<T>;
1439
+ cellProps?: Record<string, any> | ((value: any, row: T) => Record<string, any>);
1440
+ render?: (value: any, row: T, context: CellContext) => ReactNode;
1441
+ sortable?: boolean;
1222
1442
  /**
1223
- * Register a new formatter
1224
- * @param key - Unique identifier for the formatter
1225
- * @param formatter - The formatting function
1443
+ * Whether this column can be reordered via drag-and-drop.
1444
+ * Defaults to true. Set to false to lock a column in place (e.g., sticky first column).
1226
1445
  */
1227
- register(key: string, formatter: FormatterFunction): void;
1446
+ reorderable?: boolean;
1447
+ noCellPadding?: boolean;
1448
+ mobile?: MobileConfig | false;
1449
+ popover?: string | ((value: unknown, row: T) => ReactNode) | {
1450
+ content: string | ((value: unknown, row: T) => ReactNode);
1451
+ placement?: "top" | "bottom" | "left" | "right";
1452
+ showArrow?: boolean;
1453
+ trigger?: "hover" | "click";
1454
+ };
1455
+ /** Label to use for this column in CSV export headers. Falls back to `label` if not provided. */
1456
+ exportLabel?: string;
1228
1457
  /**
1229
- * Format a value using a registered formatter
1230
- * @param key - The formatter key
1231
- * @param value - The value to format
1232
- * @param args - Additional arguments to pass to the formatter
1233
- * @returns The formatted value or null
1458
+ * Custom function to transform the cell value for export.
1459
+ * If not provided, uses the raw accessor value converted to string.
1460
+ * @param value - The raw cell value from the accessor
1461
+ * @param row - The full row data
1462
+ * @returns The value to export (will be converted to string)
1234
1463
  */
1235
- format(key: string, value: FieldValue, ...args: unknown[]): FormattedValue;
1464
+ exportValue?: (value: unknown, row: T) => string | number | boolean | null;
1236
1465
  /**
1237
- * Check if a formatter is registered
1238
- * @param key - The formatter key
1239
- * @returns True if the formatter exists
1466
+ * Whether to include this column in CSV exports.
1467
+ * Defaults to true. Set to false to exclude columns like action buttons.
1240
1468
  */
1241
- has(key: string): boolean;
1469
+ exportable?: boolean;
1470
+ }
1471
+ interface DataTableProps<T> {
1472
+ columns: Column<T>[];
1473
+ data: T[];
1474
+ className?: string;
1475
+ density?: TableDensity;
1476
+ width?: TableWidth;
1477
+ height?: string | number;
1478
+ maxHeight?: string | number;
1479
+ layout?: TableLayout;
1480
+ mobileRenderer?: MobileRenderer;
1481
+ customMobileRowRender?: (row: T, index: number) => ReactNode;
1482
+ mobileBreakpoint?: MobileBreakpoint;
1483
+ isLoading?: boolean;
1484
+ loadingState?: LoadingState;
1485
+ loadingRowCount?: number;
1486
+ onLoadMore?: () => void | Promise<void>;
1487
+ hasMore?: boolean;
1488
+ enableVirtualization?: boolean;
1489
+ estimatedRowHeight?: number;
1490
+ loadingIndicator?: ReactNode;
1491
+ stickyHeader?: boolean;
1492
+ /** Make the first column sticky on horizontal scroll */
1493
+ stickyFirstColumn?: boolean;
1494
+ onRowClick?: (row: T) => void;
1495
+ getRowId?: (row: T) => string;
1496
+ hideHeader?: boolean;
1497
+ /** Controlled sort configuration - when provided, DataTable becomes controlled */
1498
+ sortConfig?: SortConfig | null;
1499
+ onSort?: (sortConfig: SortConfig | null) => void;
1500
+ "aria-label"?: string;
1242
1501
  /**
1243
- * Get all registered formatter keys
1244
- * @returns Array of formatter keys
1502
+ * Enable drag-and-drop column reordering (like Notion tables).
1503
+ * When enabled, users can drag column headers to reorder columns.
1245
1504
  */
1246
- keys(): string[];
1505
+ enableColumnReorder?: boolean;
1247
1506
  /**
1248
- * Remove a formatter
1249
- * @param key - The formatter key to remove
1507
+ * Controlled column order - array of column IDs in display order.
1508
+ * When provided, DataTable uses this order instead of the columns array order.
1509
+ * Use with onColumnOrderChange for controlled behavior.
1250
1510
  */
1251
- unregister(key: string): void;
1511
+ columnOrder?: string[];
1252
1512
  /**
1253
- * Clear all registered formatters
1513
+ * Callback fired when column order changes via drag-and-drop.
1514
+ * Receives the new array of column IDs in their new order.
1254
1515
  */
1255
- clear(): void;
1516
+ onColumnOrderChange?: (columnOrder: string[]) => void;
1256
1517
  }
1257
- declare const FormatRegistry: FormatRegistryClass;
1258
1518
 
1519
+ interface ContactMetaDisplayProps {
1520
+ /** First name */
1521
+ firstName: string;
1522
+ /** Last name */
1523
+ lastName: string;
1524
+ /** Email address (optional) */
1525
+ email?: string;
1526
+ /** Avatar image URL (optional) */
1527
+ avatarUrl?: string;
1528
+ /** Layout variant - stacked (vertical) or inline (horizontal) */
1529
+ layout?: "stacked" | "inline";
1530
+ /** Size variant */
1531
+ size?: "xs" | "sm" | "md" | "lg";
1532
+ /** Link to contact detail page (optional) */
1533
+ href?: string;
1534
+ /** Custom link component (e.g., Next.js Link) */
1535
+ LinkComponent?: LinkComponentType;
1536
+ /** Link variant for the name */
1537
+ linkVariant?: "primary" | "secondary" | "muted" | "unstyled" | "default" | "brand";
1538
+ /** Text emphasis level - "strong"/"high" for bold, "normal" for regular, "low" for muted */
1539
+ emphasis?: CellEmphasis;
1540
+ /** Show email address (only for stacked layout) */
1541
+ showEmail?: boolean;
1542
+ /** Badge element to display next to the name (e.g., Owner, Admin badge) */
1543
+ badge?: React.ReactNode;
1544
+ /** Avatar shape (default: "square") */
1545
+ avatarShape?: "circle" | "square";
1546
+ /** Loading state */
1547
+ isLoading?: boolean;
1548
+ /** Additional classes */
1549
+ className?: string;
1550
+ /**
1551
+ * Entity identifier for PII masking (e.g., "contact:ctc_abc123")
1552
+ * When provided, adds data-pii-* attributes for the Curtain extension
1553
+ */
1554
+ piiEntity?: string;
1555
+ }
1259
1556
  /**
1260
- * Electrical resistance formatting utilities
1557
+ * ContactMetaDisplay
1558
+ *
1559
+ * Reusable component for displaying contact information with avatar.
1560
+ * Supports stacked and inline layouts with size variants and optional linking.
1561
+ *
1562
+ * **Stacked layout**: Avatar, name above, optional email below
1563
+ * **Inline layout**: Avatar + name only (horizontal)
1564
+ *
1565
+ * Use this component directly in cards, lists, or other layouts.
1566
+ * For DataTable cells, use ContactMetaCell which wraps this component.
1567
+ *
1568
+ * @example
1569
+ * ```tsx
1570
+ * // Stacked layout (default)
1571
+ * <ContactMetaDisplay
1572
+ * firstName="John"
1573
+ * lastName="Doe"
1574
+ * email="john@example.com"
1575
+ * layout="stacked"
1576
+ * size="md"
1577
+ * showEmail
1578
+ * href="/contacts/123"
1579
+ * />
1580
+ *
1581
+ * // Inline layout
1582
+ * <ContactMetaDisplay
1583
+ * firstName="John"
1584
+ * lastName="Doe"
1585
+ * layout="inline"
1586
+ * size="sm"
1587
+ * href="/contacts/123"
1588
+ * />
1589
+ * ```
1261
1590
  */
1591
+ declare function ContactMetaDisplay({ firstName, lastName, email, avatarUrl, layout, size, href, LinkComponent, linkVariant, emphasis, showEmail, badge, avatarShape, isLoading, className, piiEntity, }: ContactMetaDisplayProps): react_jsx_runtime.JSX.Element;
1262
1592
 
1263
1593
  /**
1264
- * Format as milliohms
1265
- */
1266
- declare const toMilliohms: (value: number | null | undefined, decimals?: number) => string | null;
1267
- /**
1268
- * Format as ohms
1269
- */
1270
- declare const toOhms: (value: number | null | undefined, decimals?: number) => string | null;
1271
- /**
1272
- * Format as kilohms
1273
- */
1274
- declare const toKilohms: (value: number | null | undefined, decimals?: number) => string | null;
1275
- /**
1276
- * Format as megohms
1277
- */
1278
- declare const toMegohms: (value: number | null | undefined, decimals?: number) => string | null;
1279
- /**
1280
- * Auto-scale resistance to the most appropriate unit
1281
- */
1282
- declare const autoScaleResistance: (value: number | null | undefined, decimals?: number) => string | null;
1283
- /**
1284
- * Format resistance according to ResistanceFormat specification
1594
+ * ContainerQueryProvider measures its own width via ResizeObserver and
1595
+ * provides breakpoint state to all descendant blocks via context.
1596
+ *
1597
+ * Wrap block previews (or board surfaces) in this provider so blocks that
1598
+ * use `useContainerBreakpoint` respond to their actual render width, not
1599
+ * the browser viewport.
1600
+ *
1601
+ * Renders a transparent div wrapper — apply className to control layout.
1285
1602
  */
1286
- declare const formatResistance: (value: FieldValue, format: ResistanceFormat) => FormattedValue;
1603
+ declare function ContainerQueryProvider({ children, className }: {
1604
+ children: React.ReactNode;
1605
+ className?: string;
1606
+ }): react_jsx_runtime.JSX.Element;
1607
+
1608
+ interface CopyToClipboardProps {
1609
+ /**
1610
+ * The value to copy to clipboard. If not provided, will use the text content of children
1611
+ */
1612
+ value?: string;
1613
+ /**
1614
+ * The content to display
1615
+ */
1616
+ children: React__default.ReactNode;
1617
+ /**
1618
+ * Optional className for the container
1619
+ */
1620
+ className?: string;
1621
+ /**
1622
+ * Size of the copy button, defaults to "sm"
1623
+ */
1624
+ size?: "sm" | "md";
1625
+ /**
1626
+ * Position of the copy icon relative to children, defaults to "right"
1627
+ */
1628
+ iconPosition?: "left" | "right";
1629
+ }
1630
+ declare function CopyToClipboard({ value, children, className, size, iconPosition, }: CopyToClipboardProps): react_jsx_runtime.JSX.Element;
1287
1631
 
1288
1632
  /**
1289
- * Temperature formatting utilities
1633
+ * Boolean formatting utilities
1290
1634
  */
1291
1635
 
1292
1636
  /**
1293
- * Convert temperature unit string to symbol
1637
+ * Format boolean value with custom text
1294
1638
  */
1295
- declare const temperatureStringToSymbol: (unit: TemperatureUnitString) => TemperatureUnit;
1639
+ declare const toBoolean: (value: boolean | null | undefined, trueText?: string, falseText?: string) => string | null;
1296
1640
  /**
1297
- * Format as Fahrenheit
1641
+ * Format boolean as enabled/disabled
1298
1642
  */
1299
- declare const toFahrenheit: (value: number | null | undefined, decimals?: number) => string | null;
1643
+ declare const toEnabledDisabled: (value: boolean | null | undefined) => string | null;
1300
1644
  /**
1301
- * Format as Celsius
1645
+ * Format boolean as on/off
1302
1646
  */
1303
- declare const toCelsius: (value: number | null | undefined, fromFahrenheit?: boolean, decimals?: number) => string | null;
1647
+ declare const toOnOff: (value: boolean | null | undefined) => string | null;
1304
1648
  /**
1305
- * Format as Kelvin
1649
+ * Format boolean as active/inactive
1306
1650
  */
1307
- declare const toKelvin: (value: number | null | undefined, fromFahrenheit?: boolean, decimals?: number) => string | null;
1651
+ declare const toActiveInactive: (value: boolean | null | undefined) => string | null;
1308
1652
  /**
1309
- * Convert Celsius to Fahrenheit
1653
+ * Format boolean as true/false
1310
1654
  */
1311
- declare const celsiusToFahrenheit: (celsius: number) => number;
1655
+ declare const toTrueFalse: (value: boolean | null | undefined) => string | null;
1312
1656
  /**
1313
- * Convert Fahrenheit to Celsius
1657
+ * Format boolean as checkmark/cross
1314
1658
  */
1315
- declare const fahrenheitToCelsius: (fahrenheit: number) => number;
1659
+ declare const toCheckmark: (value: boolean | null | undefined) => string | null;
1316
1660
  /**
1317
- * Convert Celsius to Kelvin
1661
+ * Parse various truthy/falsy values to boolean
1318
1662
  */
1319
- declare const celsiusToKelvin: (celsius: number) => number;
1663
+ declare const parseBoolean: (value: FieldValue) => boolean | null;
1320
1664
  /**
1321
- * Convert Kelvin to Celsius
1665
+ * Format boolean according to BooleanFormat specification
1322
1666
  */
1323
- declare const kelvinToCelsius: (kelvin: number) => number;
1667
+ declare const formatBoolean: (value: FieldValue, format: BooleanFormat) => FormattedValue;
1668
+
1324
1669
  /**
1325
- * Convert Fahrenheit to Kelvin
1670
+ * Capacity formatting utilities for batteries and energy storage
1671
+ *
1672
+ * Domain-specific formatters for energy capacity (kWh) and power ratings (kW).
1673
+ * Auto-scales to appropriate units (MWh, MW for large values).
1326
1674
  */
1327
- declare const fahrenheitToKelvin: (fahrenheit: number) => number;
1328
1675
  /**
1329
- * Convert Kelvin to Fahrenheit
1676
+ * Format battery capacity (kWh)
1677
+ *
1678
+ * @param value - Capacity in kWh
1679
+ * @param decimals - Number of decimal places (default: 1)
1680
+ * @returns Formatted capacity string or null
1681
+ *
1682
+ * @example
1683
+ * ```typescript
1684
+ * formatCapacity(13.5); // "13.5 kWh"
1685
+ * formatCapacity(1500); // "1.5 MWh"
1686
+ * formatCapacity(null); // null
1687
+ * ```
1330
1688
  */
1331
- declare const kelvinToFahrenheit: (kelvin: number) => number;
1689
+ declare function formatCapacity(value: number | null | undefined, decimals?: number): string | null;
1332
1690
  /**
1333
- * Format temperature with specified unit
1691
+ * Format power rating (kW)
1692
+ *
1693
+ * @param value - Power rating in kW
1694
+ * @param decimals - Number of decimal places (default: 1)
1695
+ * @returns Formatted power rating string or null
1696
+ *
1697
+ * @example
1698
+ * ```typescript
1699
+ * formatPowerRating(5.2); // "5.2 kW"
1700
+ * formatPowerRating(2500); // "2.5 MW"
1701
+ * formatPowerRating(null); // null
1702
+ * ```
1334
1703
  */
1335
- declare const toTemperature: (value: number | null | undefined, unit?: TemperatureUnit | TemperatureUnitString, decimals?: number) => string | null;
1704
+ declare function formatPowerRating(value: number | null | undefined, decimals?: number): string | null;
1705
+
1336
1706
  /**
1337
- * Format temperature according to TemperatureFormat specification
1707
+ * Shared CSV export helpers for unit-bearing FieldFormats.
1708
+ *
1709
+ * CSV columns need one unit for the whole column, not per-row auto-scaling. The
1710
+ * on-screen display can happily render "12 kV" one row and "500 mV" the next
1711
+ * because a human reads them in context, but in a spreadsheet that mixes
1712
+ * magnitudes in a single column and makes the data unusable.
1713
+ *
1714
+ * These helpers pick a stable column-wide unit for a given FieldFormat and
1715
+ * return the bare number that matches that unit:
1716
+ *
1717
+ * - `csvUnitFor(format)` → the unit string to show in the column header,
1718
+ * or null when the format has no meaningful unit (text, number, date, …).
1719
+ * - `csvValueFor(raw, format)` → the bare-number string for a cell in that
1720
+ * column. Returns null for non-numeric formats (caller falls back to the
1721
+ * regular display formatter), and "" when the display would be blank
1722
+ * (hideWhenNull / hideWhenZero / null value).
1723
+ *
1724
+ * Consumers:
1725
+ * - `apps/dashboard/components/Explorer/tables/deviceFieldExport.ts` (Explore CSV)
1726
+ * - `packages/edges/src/utils/chartExport.ts` (chart CSV export)
1338
1727
  */
1339
- declare const formatTemperature: (value: FieldValue, format: TemperatureFormat) => FormattedValue;
1340
1728
 
1341
1729
  /**
1342
- * Text formatting utilities
1730
+ * Pick the CSV column unit for a FieldFormat.
1731
+ *
1732
+ * Rules:
1733
+ * - Explicit `unit` on the format wins.
1734
+ * - Otherwise fall back to the format's canonical base unit
1735
+ * (`DEFAULT_BASE_UNIT` lookup) so every row in the column shares one unit
1736
+ * even if the on-screen display would auto-scale.
1737
+ * - Energy honours `sourceUnit` (e.g. meter consumption is stored in kWh) as
1738
+ * the natural stable unit when neither `unit` nor a base fallback would fit.
1739
+ * - Temperature symbols are normalised from `"C"`/`"CELSIUS"` etc. to `"°C"`.
1740
+ * - Formats with no meaningful unit (text, number, date, boolean, currency,
1741
+ * phone, custom) return null.
1343
1742
  */
1344
-
1743
+ declare function csvUnitFor(format: FieldFormat | undefined | null): string | null;
1345
1744
  /**
1346
- * Convert text to uppercase
1745
+ * Convert a raw value to a bare-number CSV string in the same unit
1746
+ * `csvUnitFor` reports.
1747
+ *
1748
+ * Returns:
1749
+ * - `null` when the format is non-numeric (caller falls back to the display
1750
+ * formatter, e.g. text/date/enum).
1751
+ * - `""` when the display would suppress the value (hideWhenNull / hideWhenZero).
1752
+ * - a bare number string otherwise, with the trailing unit stripped so the
1753
+ * cell can be summed / charted in the spreadsheet.
1347
1754
  */
1348
- declare const toUpperCase: (text: string | null | undefined) => string;
1755
+ declare function csvValueFor(raw: unknown, format: FieldFormat): string | null;
1756
+
1349
1757
  /**
1350
- * Convert text to lowercase
1758
+ * Electrical current formatting utilities (flow of electric charge)
1351
1759
  */
1352
- declare const toLowerCase: (text: string | null | undefined) => string;
1760
+
1353
1761
  /**
1354
- * Convert text to sentence case (first letter capitalized, rest lowercase).
1355
- *
1356
- * @param text - Text to convert
1357
- * @returns Sentence-cased text
1358
- *
1359
- * @example
1360
- * ```typescript
1361
- * toSentenceCase("HELLO WORLD"); // "Hello world"
1362
- * toSentenceCase("hello world"); // "Hello world"
1363
- * ```
1762
+ * Format as milliamps
1364
1763
  */
1365
- declare const toSentenceCase: (text: string | null | undefined) => string;
1764
+ declare const toMilliamps: (value: number | null | undefined, decimals?: number) => string | null;
1366
1765
  /**
1367
- * Convert text to title case with proper handling of articles and prepositions.
1368
- * Capitalizes the first letter of each word except common articles/prepositions
1369
- * (unless they're the first word).
1370
- *
1371
- * @param text - Text to convert
1372
- * @returns Title-cased text
1373
- *
1374
- * @example
1375
- * ```typescript
1376
- * toTitleCase("the quick brown fox"); // "The Quick Brown Fox"
1377
- * toTitleCase("war and peace"); // "War and Peace"
1378
- * toTitleCase("to be or not to be"); // "To Be or Not to Be"
1379
- * ```
1766
+ * Format as amperes
1380
1767
  */
1381
- declare const toTitleCase: (text: string | null | undefined) => string;
1768
+ declare const toAmps: (value: number | null | undefined, decimals?: number) => string | null;
1382
1769
  /**
1383
- * Capitalize first letter of each word
1770
+ * Format as kiloamps (rarely used but included for completeness)
1384
1771
  */
1385
- declare const capitalize: (text: string | null | undefined) => string;
1772
+ declare const toKiloamps: (value: number | null | undefined, decimals?: number) => string | null;
1386
1773
  /**
1387
- * Uppercase first letter only
1774
+ * Auto-scale current to the most appropriate unit
1388
1775
  */
1389
- declare const ucFirst: (text: string | null | undefined) => string;
1776
+ declare const autoScaleCurrent: (value: number | null | undefined, decimals?: number) => string | null;
1390
1777
  /**
1391
- * Convert camelCase to words
1778
+ * Format current according to CurrentFormat specification
1392
1779
  */
1393
- declare const camelCaseToWords: (text: string | null | undefined) => string;
1780
+ declare const formatCurrent: (value: FieldValue, format: CurrentFormat) => FormattedValue;
1781
+ declare const toMA: (value: number | null | undefined, decimals?: number) => string | null;
1782
+ declare const toA: (value: number | null | undefined, decimals?: number) => string | null;
1783
+ declare const toKA: (value: number | null | undefined, decimals?: number) => string | null;
1784
+
1394
1785
  /**
1395
- * Convert snake_case to words
1786
+ * Date formatting utilities using Luxon
1396
1787
  */
1397
- declare const snakeCaseToWords: (text: string | null | undefined) => string;
1788
+
1398
1789
  /**
1399
- * Convert enum-style text to sentence case
1790
+ * Format date to a localized string with optional time and timezone.
1791
+ *
1792
+ * @param value - Date value (string, Date object, or timestamp)
1793
+ * @param showTime - Whether to include time in the output (default: false)
1794
+ * @param timezone - Optional timezone for display (e.g., "America/New_York")
1795
+ * @returns Formatted date string or null
1796
+ *
1797
+ * @example
1798
+ * ```typescript
1799
+ * toDateString(new Date()); // "12/25/2023"
1800
+ * toDateString(new Date(), true); // "12/25/2023, 3:30 PM"
1801
+ * toDateString("2023-12-25T15:30:00Z", true, "America/New_York"); // "12/25/2023, 10:30 AM"
1802
+ * ```
1400
1803
  */
1401
- declare const enumToSentenceCase: (text: string | null | undefined) => string;
1804
+ declare const toDateString: (value: string | Date | number | null | undefined, showTime?: boolean, timezone?: string) => string | null;
1402
1805
  /**
1403
- * Truncate text in the middle
1806
+ * Format date to relative time (e.g., "2 hours ago", "in 3 days").
1807
+ * Automatically chooses the most appropriate unit.
1808
+ *
1809
+ * @param value - Date value (string, Date object, or timestamp)
1810
+ * @returns Relative time string or null
1811
+ *
1812
+ * @example
1813
+ * ```typescript
1814
+ * toRelativeTime(new Date(Date.now() - 3600000)); // "1 hour ago"
1815
+ * toRelativeTime(new Date(Date.now() + 86400000)); // "in 1 day"
1816
+ * toRelativeTime(new Date()); // "now"
1817
+ * ```
1404
1818
  */
1405
- declare const truncateMiddle: (value: string | null | undefined, length?: number) => string;
1819
+ declare const toRelativeTime: (value: string | Date | number | null | undefined) => string | null;
1406
1820
  /**
1407
- * Truncate text at the start
1821
+ * Format date with full date and time including weekday
1408
1822
  */
1409
- declare const truncateStart: (value: string | null | undefined, length?: number) => string;
1823
+ declare const toFullDateTime: (value: string | Date | number | null | undefined, timezone?: string) => string | null;
1410
1824
  /**
1411
- * Truncate text at the end
1825
+ * Format date to ISO string
1412
1826
  */
1413
- declare const truncateEnd: (value: string | null | undefined, length?: number, ellipsis?: string) => string;
1827
+ declare const toISOString: (value: string | Date | number | null | undefined) => string | null;
1414
1828
  /**
1415
- * Mask sensitive text (e.g., secrets, API keys)
1829
+ * Format date with custom format string
1416
1830
  */
1417
- declare const toSecret: (value: string | null | undefined) => string;
1831
+ declare const toCustomDateFormat: (value: string | Date | number | null | undefined, format: string, timezone?: string) => string | null;
1418
1832
  /**
1419
- * Format text according to TextFormat specification
1833
+ * Get formatted date parts
1420
1834
  */
1421
- declare const formatText: (value: FieldValue, format: TextFormat) => FormattedValue;
1422
-
1835
+ declare const getDateParts: (value: string | Date | number | null | undefined) => {
1836
+ year: number;
1837
+ month: number;
1838
+ day: number;
1839
+ weekday: number;
1840
+ hour: number;
1841
+ minute: number;
1842
+ second: number;
1843
+ millisecond: number;
1844
+ weekdayShort: string | null;
1845
+ weekdayLong: string | null;
1846
+ monthShort: string | null;
1847
+ monthLong: string | null;
1848
+ } | null;
1423
1849
  /**
1424
- * Voltage formatting utilities (electrical potential)
1850
+ * Format date according to DateFormat specification
1425
1851
  */
1852
+ declare const formatDate: (value: FieldValue, format: DateFormat) => FormattedValue;
1426
1853
 
1427
1854
  /**
1428
- * Format as millivolts
1855
+ * Distance and length formatting utilities
1429
1856
  */
1430
- declare const toMillivolts: (value: number | null | undefined, decimals?: number) => string | null;
1857
+
1431
1858
  /**
1432
- * Format as volts
1859
+ * Format as meters
1433
1860
  */
1434
- declare const toVolts: (value: number | null | undefined, decimals?: number) => string | null;
1861
+ declare const toMeters: (value: number | null | undefined, decimals?: number) => string | null;
1435
1862
  /**
1436
- * Format as kilovolts
1863
+ * Format as centimeters
1437
1864
  */
1438
- declare const toKilovolts: (value: number | null | undefined, decimals?: number) => string | null;
1865
+ declare const toCentimeters: (value: number | null | undefined, decimals?: number) => string | null;
1439
1866
  /**
1440
- * Auto-scale voltage to the most appropriate unit
1867
+ * Format as millimeters
1441
1868
  */
1442
- declare const autoScaleVoltage: (value: number | null | undefined, decimals?: number) => string | null;
1869
+ declare const toMillimeters: (value: number | null | undefined, decimals?: number) => string | null;
1443
1870
  /**
1444
- * Format voltage according to VoltageFormat specification
1871
+ * Format as kilometers
1445
1872
  */
1446
- declare const formatVoltage: (value: FieldValue, format: VoltageFormat) => FormattedValue;
1447
- declare const toMV: (value: number | null | undefined, decimals?: number) => string | null;
1448
- declare const toV: (value: number | null | undefined, decimals?: number) => string | null;
1449
- declare const toKV: (value: number | null | undefined, decimals?: number) => string | null;
1450
-
1873
+ declare const toKilometers: (value: number | null | undefined, decimals?: number) => string | null;
1451
1874
  /**
1452
- * Comprehensive formatting utilities for the Edges design system
1453
- *
1454
- * This module provides a unified formatting system with support for:
1455
- * - Text formatting (case conversion, truncation, etc.)
1456
- * - Number formatting (decimals, thousands separators, compact notation)
1457
- * - Currency formatting (multiple currencies and display options)
1458
- * - Date formatting (relative time, custom formats, timezones)
1459
- * - Boolean formatting (custom true/false text)
1460
- * - Energy units (Wh, kWh, MWh, GWh with auto-scaling)
1461
- * - Temperature units (Celsius, Fahrenheit, Kelvin)
1462
- * - Distance units (meters, kilometers, miles, feet)
1463
- * - Phone number formatting (US and international)
1464
- * - Custom formatters via the FormatRegistry
1875
+ * Format as feet
1465
1876
  */
1466
-
1877
+ declare const toFeet: (value: number | null | undefined, decimals?: number) => string | null;
1467
1878
  /**
1468
- * Convenience function to create a format object
1469
- *
1470
- * @example
1471
- * ```typescript
1472
- * const currencyFormat = createFormat("currency", { currency: "EUR" });
1473
- * const dateFormat = createFormat("date", { relative: true });
1474
- * ```
1879
+ * Format as inches
1475
1880
  */
1476
- declare const createFormat: <T extends FieldFormat["type"]>(type: T, options?: Omit<Extract<FieldFormat, {
1477
- type: T;
1478
- }>, "type">) => Extract<FieldFormat, {
1479
- type: T;
1480
- }>;
1481
-
1881
+ declare const toInches: (value: number | null | undefined, decimals?: number) => string | null;
1482
1882
  /**
1483
- * Semantic typography role classes generated by @texturehq/edges-tokens.
1484
- *
1485
- * These classes apply the full type role — family, size, line-height,
1486
- * weight, and letter-spacing. Pair them with explicit semantic text-color
1487
- * utilities at the callsite.
1883
+ * Format as miles
1488
1884
  */
1489
- declare const typographyRole: {
1490
- readonly displayXl: "text-display-xl";
1491
- readonly displayLg: "text-display-lg";
1492
- readonly displayMd: "text-display-md";
1493
- readonly displaySm: "text-display-sm";
1494
- readonly headingXl: "text-heading-xl";
1495
- readonly headingLg: "text-heading-lg";
1496
- readonly headingMd: "text-heading-md";
1497
- readonly headingSm: "text-heading-sm";
1498
- readonly bodyLg: "text-body-lg";
1499
- readonly bodyMd: "text-body-md";
1500
- readonly bodySm: "text-body-sm";
1501
- readonly labelLg: "text-label-lg";
1502
- readonly labelMd: "text-label-md";
1503
- readonly labelSm: "text-label-sm";
1504
- readonly code: "text-code";
1505
- readonly agent: "text-agent";
1506
- };
1507
- type TypographyRole = keyof typeof typographyRole;
1885
+ declare const toMiles: (value: number | null | undefined, decimals?: number) => string | null;
1508
1886
  /**
1509
- * Merge a semantic typography role with semantic color utilities and any
1510
- * component-specific layout classes. This keeps components from hand-composing
1511
- * `text-sm font-medium leading-*` whenever a role exists.
1887
+ * Format as yards
1512
1888
  */
1513
- declare function typeRole(role: TypographyRole, ...classNames: Array<string | false | null | undefined>): string;
1514
-
1889
+ declare const toYards: (value: number | null | undefined, decimals?: number) => string | null;
1515
1890
  /**
1516
- * Factory for Texture-authored icons that are NOT available in Phosphor but
1517
- * must plug into the Edges `<Icon name="…" />` component with the exact same
1518
- * API (size / color / weight / className / mirrored / aria-*).
1519
- *
1520
- * Each custom icon is authored as a Phosphor-compatible component:
1521
- * - 256×256 viewBox (matches Phosphor's optical grid so custom + stock icons
1522
- * sit at the same scale)
1523
- * - `fill={color}` defaulting to `currentColor` (inherits text color like Phosphor)
1524
- * - `size` drives both width and height
1525
- *
1526
- * `weight` is accepted for API parity but is a no-op for single-weight custom
1527
- * glyphs. Author the `children` against the 256×256 grid.
1528
- *
1529
- * @example
1530
- * ```tsx
1531
- * export const TextureRecloserIcon = createTextureIcon(
1532
- * "TextureRecloser",
1533
- * <path d="M48 128 ..." />,
1534
- * );
1535
- * ```
1891
+ * Format as nautical miles
1536
1892
  */
1537
- declare function createTextureIcon(displayName: string, children: ReactNode): Icon;
1538
-
1539
- type ActivityFeedVariant = "timeline" | "stacked";
1540
- type ActivityFeedSize = "md" | "sm";
1541
- type ActivityItemTone = "neutral" | "brand" | "success" | "warning" | "danger" | "info";
1542
- type ActivityItemSurface = "minimal" | "subtle" | "solid";
1543
- interface ActivityFeedProps<T = unknown> extends HTMLAttributes<HTMLDivElement> {
1544
- /** Visual style for the feed */
1545
- variant?: ActivityFeedVariant;
1546
- /** Density of the feed */
1547
- size?: ActivityFeedSize;
1548
- /** Data-driven mode: array of items to render */
1549
- items?: T[];
1550
- /** Render function for each item (when using items array) */
1551
- renderItem?: (item: T, index: number) => ReactNode;
1552
- /** Children mode: manual ActivityItem components */
1553
- children?: ReactNode;
1554
- /** Loading & error UI gates */
1555
- isLoading?: boolean;
1556
- /** Explicit loading state override (takes precedence over auto-detection) */
1557
- loadingState?: LoadingState;
1558
- error?: string | null;
1559
- /** Custom skeleton for initial loading state - matches your activity item structure */
1560
- renderLoadingSkeleton?: () => ReactNode;
1561
- /** Number of skeleton items to show during initial loading */
1562
- loadingSkeletonCount?: number;
1563
- /** Empty state */
1564
- emptyMessage?: string;
1565
- /** Infinite scroll */
1566
- onLoadMore?: () => void | Promise<void>;
1567
- hasMore?: boolean;
1568
- /** Enable virtualization (default: true for 100+ items) */
1569
- enableVirtualization?: boolean;
1570
- /** Estimated size of each item in pixels */
1571
- estimatedItemSize?: number;
1572
- /** Custom loading indicator for loading-more state */
1573
- loadingIndicator?: ReactNode;
1574
- /** Height/maxHeight for scroll container */
1575
- height?: string | number;
1576
- maxHeight?: string | number;
1577
- }
1578
- declare function ActivityFeed<T = unknown>({ variant, size, className, children, items, renderItem, isLoading, loadingState, error, renderLoadingSkeleton, loadingSkeletonCount, emptyMessage, onLoadMore, hasMore, enableVirtualization, estimatedItemSize, loadingIndicator, height, maxHeight, ...rest }: ActivityFeedProps<T>): react_jsx_runtime.JSX.Element;
1579
- declare namespace ActivityFeed {
1580
- var displayName: string;
1581
- }
1582
- interface ActivityFeedGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
1583
- /** Heading shown above the grouped items */
1584
- title?: ReactNode;
1585
- /** Optional description that provides additional context */
1586
- description?: ReactNode;
1587
- /** Optional trailing actions for the group */
1588
- actions?: ReactNode;
1589
- /** Group content */
1590
- children: ReactNode;
1591
- }
1592
- interface ActivityFeedGroupInternalProps extends ActivityFeedGroupProps {
1593
- __isLastGroup?: boolean;
1594
- __isFirstGroup?: boolean;
1595
- }
1596
- declare function ActivityFeedGroup(props: ActivityFeedGroupInternalProps): react_jsx_runtime.JSX.Element;
1597
- declare namespace ActivityFeedGroup {
1598
- var displayName: string;
1599
- }
1600
- interface ActivityItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
1601
- /** Primary label describing the activity */
1602
- title: ReactNode;
1603
- /** Supplementary copy beneath the title */
1604
- description?: ReactNode;
1605
- /** Timestamp or contextual information shown opposite the title */
1606
- timestamp?: ReactNode;
1607
- /** Additional metadata shown below the description */
1608
- meta?: ReactNode;
1609
- /** Supplementary media such as attachments, badges, or chips */
1610
- media?: ReactNode;
1611
- /** Optional action buttons or controls */
1612
- actions?: ReactNode;
1613
- /** Visual element displayed inside the indicator */
1614
- visual?: ReactNode;
1615
- /** Shortcut for displaying an icon in the indicator */
1616
- icon?: ComponentProps<typeof Icon$1>["name"];
1617
- /** Icon weight for the indicator icon */
1618
- iconWeight?: ComponentProps<typeof Icon$1>["weight"];
1619
- /** Visual tone applied to the indicator */
1620
- tone?: ActivityItemTone;
1621
- /** Surface treatment for the content */
1622
- surface?: ActivityItemSurface;
1623
- /** Highlights the item using the tone color */
1624
- isHighlighted?: boolean;
1625
- /** Whether to render a connector line for timeline layouts */
1626
- showConnector?: boolean;
1627
- /** Whether to render the incoming connector line from previous item (internal) */
1628
- showIncomingConnector?: boolean;
1629
- /** Hides the indicator entirely */
1630
- hideIndicator?: boolean;
1631
- /** Marks the item as interactive, enabling keyboard semantics */
1632
- interactive?: boolean;
1633
- }
1634
- declare function ActivityItem(props: ActivityItemProps): react_jsx_runtime.JSX.Element;
1635
- declare namespace ActivityItem {
1636
- var displayName: string;
1637
- }
1638
-
1639
- interface AlertProps {
1640
- /**
1641
- * Whether the alert is open
1642
- */
1643
- isOpen: boolean;
1644
- /**
1645
- * Callback when the alert is closed
1646
- */
1647
- onClose: () => void;
1648
- /**
1649
- * Alert title
1650
- */
1651
- title: string;
1652
- /**
1653
- * Alert message/content
1654
- */
1655
- message: React__default.ReactNode;
1656
- /**
1657
- * Label for the confirm button
1658
- * @default "OK"
1659
- */
1660
- confirmLabel?: string;
1661
- /**
1662
- * Variant for the confirm button
1663
- * @default "primary"
1664
- */
1665
- confirmVariant?: DialogAction["variant"];
1666
- /**
1667
- * Maximum width of the alert dialog
1668
- * @default "400px"
1669
- */
1670
- maxWidth?: string;
1671
- /**
1672
- * Minimum width of the alert dialog (desktop only)
1673
- * @default "320px"
1674
- */
1675
- minWidth?: string;
1676
- }
1893
+ declare const toNauticalMiles: (value: number | null | undefined, decimals?: number) => string | null;
1677
1894
  /**
1678
- * Alert
1679
- *
1680
- * A simple alert dialog with a single action button.
1681
- * Use for informational messages that require acknowledgment.
1895
+ * Conversion utilities
1682
1896
  */
1683
- declare function Alert({ isOpen, onClose, title, message, confirmLabel, confirmVariant, maxWidth, minWidth, }: AlertProps): react_jsx_runtime.JSX.Element;
1684
-
1685
- type BannerVariant = "info" | "success" | "warning" | "error" | "discovery";
1686
- type BannerAppearance = "subtle" | "bold";
1687
- interface BannerAction {
1688
- /** Label for the action button */
1689
- label: string;
1690
- /** Callback when the action is triggered */
1691
- onPress: () => void;
1692
- /** Whether to render as a link-style button */
1693
- asLink?: boolean;
1694
- }
1695
- interface BannerProps {
1696
- /** Semantic variant of the banner */
1697
- variant?: BannerVariant;
1698
- /** Visual appearance style */
1699
- appearance?: BannerAppearance;
1700
- /** The main message/title to display */
1701
- title?: ReactNode;
1702
- /** Additional description or content */
1703
- children?: ReactNode;
1704
- /** Whether the banner can be dismissed */
1705
- dismissible?: boolean;
1706
- /** Callback when the banner is dismissed */
1707
- onDismiss?: () => void;
1708
- /** Primary action (rendered as button or link) */
1709
- primaryAction?: BannerAction;
1710
- /** Secondary action (rendered as button or link) */
1711
- secondaryAction?: BannerAction;
1712
- /** Custom icon to override default status icon */
1713
- icon?: ReactNode;
1714
- /** Hide the icon completely */
1715
- hideIcon?: boolean;
1716
- /** Additional CSS classes */
1717
- className?: string;
1718
- /** Test ID for automation */
1719
- testId?: string;
1720
- }
1897
+ declare const metersToFeet: (meters: number) => number;
1898
+ declare const feetToMeters: (feet: number) => number;
1899
+ declare const milesToKilometers: (miles: number) => number;
1900
+ declare const kilometersToMiles: (km: number) => number;
1901
+ declare const feetToMiles: (feet: number) => number;
1902
+ declare const milesToFeet: (miles: number) => number;
1903
+ declare const metersToMiles: (meters: number) => number;
1904
+ declare const milesToMeters: (miles: number) => number;
1905
+ declare const yardsToMeters: (yards: number) => number;
1906
+ declare const metersToYards: (meters: number) => number;
1907
+ declare const inchesToCentimeters: (inches: number) => number;
1908
+ declare const centimetersToInches: (cm: number) => number;
1721
1909
  /**
1722
- * Banner
1723
- *
1724
- * A prominent message component for displaying important information or system messages.
1725
- * Can be used inline within content sections or positioned at the page level.
1726
- *
1727
- * Inspired by Atlassian's Section Message and Chakra UI's Alert, combining the best
1728
- * features of both: semantic variant colors, multiple appearances, inline actions, and
1729
- * flexible composition.
1730
- *
1731
- * @example
1732
- * ```tsx
1733
- * // Simple info banner
1734
- * <Banner variant="info" title="New features available">
1735
- * Check out the latest updates to improve your workflow.
1736
- * </Banner>
1737
- *
1738
- * // With actions
1739
- * <Banner
1740
- * variant="warning"
1741
- * title="Your trial expires soon"
1742
- * primaryAction={{ label: "Upgrade now", onPress: () => {} }}
1743
- * secondaryAction={{ label: "Learn more", onPress: () => {}, asLink: true }}
1744
- * >
1745
- * Upgrade to continue using premium features.
1746
- * </Banner>
1747
- *
1748
- * // Bold appearance
1749
- * <Banner
1750
- * variant="error"
1751
- * appearance="bold"
1752
- * title="Action required"
1753
- * dismissible
1754
- * onDismiss={() => {}}
1755
- * >
1756
- * Please update your payment information.
1757
- * </Banner>
1758
- * ```
1910
+ * Auto-scale distance to the most appropriate unit
1759
1911
  */
1760
- declare function Banner({ variant, appearance, title, children, dismissible, onDismiss, primaryAction, secondaryAction, icon, hideIcon, className, testId, }: BannerProps): react_jsx_runtime.JSX.Element;
1912
+ declare const autoScaleDistance: (value: number | null | undefined, metric?: boolean, decimals?: number) => string | null;
1913
+ /**
1914
+ * Format distance according to DistanceFormat specification
1915
+ */
1916
+ declare const formatDistance: (value: FieldValue, format: DistanceFormat) => FormattedValue;
1761
1917
 
1762
- interface PageBannerProps extends BannerProps {
1763
- /** Whether the banner is visible */
1764
- isOpen?: boolean;
1765
- /** Position relative to the navbar */
1766
- position?: "fixed" | "sticky";
1767
- }
1768
1918
  /**
1769
- * PageBanner
1770
- *
1771
- * A banner component designed for page-level announcements, positioned at the top
1772
- * of the page below the navbar. Automatically handles enter/exit animations and
1773
- * can be fixed or sticky positioned.
1774
- *
1775
- * Use this for system-wide messages, announcements, or important alerts that need
1776
- * to be visible across the entire page.
1777
- *
1778
- * @example
1779
- * ```tsx
1780
- * <PageBanner
1781
- * isOpen={showBanner}
1782
- * variant="warning"
1783
- * title="Scheduled maintenance"
1784
- * dismissible
1785
- * onDismiss={() => setShowBanner(false)}
1786
- * >
1787
- * Our systems will be under maintenance on Friday from 2-4 PM EST.
1788
- * </PageBanner>
1789
- * ```
1919
+ * Energy formatting utilities (stored or consumed energy)
1920
+ * For power (rate of energy), use power.ts
1921
+ * For electrical units (voltage, current), use voltage.ts and current.ts
1790
1922
  */
1791
- declare function PageBanner({ isOpen, position, className, ...bannerProps }: PageBannerProps): react_jsx_runtime.JSX.Element;
1792
1923
 
1793
- type BreadcrumbItemProps = BreadcrumbProps & {
1794
- href?: string;
1795
- /**
1796
- * When true, adds a copy-to-clipboard button next to the current (last) breadcrumb item.
1797
- * The value copied is determined by `copyValue` prop, or falls back to the text content.
1798
- */
1799
- copyable?: boolean;
1800
- /**
1801
- * The value to copy when the copy button is clicked.
1802
- * If not provided, the text content of the breadcrumb will be used.
1803
- */
1804
- copyValue?: string;
1805
- };
1806
1924
  /**
1807
- * Breadcrumbs
1808
- *
1809
- * Navigation breadcrumbs that show the user's current location in the hierarchy
1810
- * Automatically collapses middle items into an ellipsis dropdown when the container
1811
- * width exceeds the maxWidth threshold (default: 600px)
1925
+ * Format as Watt-hours
1812
1926
  */
1813
- declare function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T> & {
1814
- maxWidth?: number;
1815
- }): react_jsx_runtime.JSX.Element;
1927
+ declare const toWh: (value: number | null | undefined, decimals?: number) => string | null;
1816
1928
  /**
1817
- * BreadcrumbItem
1818
- *
1819
- * Individual breadcrumb item with optional link
1820
- * The last breadcrumb is automatically styled as the current page (non-interactive, bold)
1821
- * When `copyable` is true, adds a copy-to-clipboard button next to the current (last) breadcrumb
1929
+ * Format as kilowatt-hours
1822
1930
  */
1823
- declare function BreadcrumbItem(props: BreadcrumbItemProps): react_jsx_runtime.JSX.Element;
1824
-
1931
+ declare const tokWh: (value: number | null | undefined, decimals?: number) => string | null;
1825
1932
  /**
1826
- * Calendar
1827
- *
1828
- * Single-date calendar primitive with Edges styling.
1933
+ * Format as megawatt-hours
1829
1934
  */
1830
- interface CalendarProps<T extends DateValue> extends Omit<CalendarProps$1<T>, "visibleDuration"> {
1831
- errorMessage?: string;
1832
- }
1833
- declare function Calendar<T extends DateValue>({ errorMessage, ...props }: CalendarProps<T>): react_jsx_runtime.JSX.Element;
1834
-
1935
+ declare const toMWh: (value: number | null | undefined, decimals?: number) => string | null;
1835
1936
  /**
1836
- * Card - Enterprise surface container component
1837
- *
1838
- * A flexible, composable card component following enterprise design system best practices.
1839
- * Supports modular content sections with consistent styling and accessibility.
1840
- *
1841
- * Usage:
1842
- * ```tsx
1843
- * <Card variant="outlined" size="md">
1844
- * <Card.Header
1845
- * title="Card Title"
1846
- * subtitle="Optional subtitle"
1847
- * actions={<Button variant="ghost" icon="MoreHorizontal" />}
1848
- * />
1849
- * <Card.Media src="image.jpg" alt="Description" />
1850
- * <Card.Content>
1851
- * <p>Main content goes here</p>
1852
- * </Card.Content>
1853
- * <Card.Footer>
1854
- * <Button variant="primary">Action</Button>
1855
- * </Card.Footer>
1856
- * </Card>
1857
- * ```
1937
+ * Format as gigawatt-hours
1938
+ */
1939
+ declare const toGWh: (value: number | null | undefined, decimals?: number) => string | null;
1940
+ /**
1941
+ * Pick the display unit auto-scaling would choose for a Wh magnitude.
1942
+ */
1943
+ declare const pickEnergyUnit: (whValue: number) => EnergyUnit;
1944
+ /**
1945
+ * Auto-scale energy to the most appropriate unit
1946
+ */
1947
+ declare const autoScaleEnergy: (value: number | null | undefined, decimals?: number) => string | null;
1948
+ /**
1949
+ * Format energy according to EnergyFormat specification
1950
+ */
1951
+ /**
1952
+ * Multiplier from the named energy unit to Wh — the formatter's internal
1953
+ * reference unit. Keep in sync with `EnergyUnit`.
1954
+ */
1955
+ declare const SOURCE_UNIT_TO_WH: Record<EnergyUnit, number>;
1956
+ declare const formatEnergy: (value: FieldValue, format: EnergyFormat) => FormattedValue;
1957
+
1958
+ /**
1959
+ * `formatFieldValue` dispatcher — extracted from `./index.ts` into its own
1960
+ * leaf module so downstream helpers (notably `csvUnit.ts`) can depend on the
1961
+ * dispatcher without pulling the whole formatting barrel (and any of its
1962
+ * transitively-imported React/PostHog side-effects) into a test setup.
1963
+ *
1964
+ * `./index.ts` re-exports this module so the public API is unchanged.
1858
1965
  */
1859
- type CardVariant = "outlined" | "elevated" | "filled" | "ghost";
1860
- interface CardProps {
1861
- variant?: CardVariant;
1862
- className?: string;
1863
- children?: React__default.ReactNode;
1864
- isLoading?: boolean;
1865
- /** Enable flex column layout so children can expand to fill space */
1866
- layout?: "default" | "flex";
1867
- }
1868
- interface CardHeaderProps {
1869
- title?: React__default.ReactNode;
1870
- subtitle?: React__default.ReactNode;
1871
- actions?: React__default.ReactNode;
1872
- className?: string;
1873
- isLoading?: boolean;
1874
- }
1875
- interface CardMediaProps {
1876
- src?: string;
1877
- alt?: string;
1878
- aspectRatio?: "square" | "video" | "wide" | "auto";
1879
- className?: string;
1880
- children?: React__default.ReactNode;
1881
- isLoading?: boolean;
1882
- }
1883
- interface CardContentProps {
1884
- className?: string;
1885
- children?: React__default.ReactNode;
1886
- isLoading?: boolean;
1887
- /** When true and parent Card has layout="flex", content expands to fill available space */
1888
- fill?: boolean;
1889
- }
1890
- interface CardFooterProps {
1891
- className?: string;
1892
- children?: React__default.ReactNode;
1893
- align?: "start" | "end" | "center" | "between";
1894
- isLoading?: boolean;
1895
- }
1896
- declare function Card({ variant, className, children, isLoading, layout }: CardProps): react_jsx_runtime.JSX.Element;
1897
- declare namespace Card {
1898
- var Header: typeof CardHeader;
1899
- var Media: typeof CardMedia;
1900
- var Content: typeof CardContent;
1901
- var Footer: typeof CardFooter;
1902
- }
1903
- declare function CardHeader({ title, subtitle, actions, className, isLoading }: CardHeaderProps): react_jsx_runtime.JSX.Element | null;
1904
- declare function CardMedia({ src, alt, aspectRatio, className, children, isLoading }: CardMediaProps): react_jsx_runtime.JSX.Element | null;
1905
- declare function CardContent({ className, children, isLoading, fill }: CardContentProps): react_jsx_runtime.JSX.Element | null;
1906
- declare function CardFooter({ className, children, align, isLoading }: CardFooterProps): react_jsx_runtime.JSX.Element | null;
1907
1966
 
1908
- interface CarouselRootProps extends React$1.HTMLAttributes<HTMLDivElement> {
1909
- /** Current active page (controlled) */
1910
- page?: number;
1911
- /** Default page for uncontrolled mode */
1912
- defaultPage?: number;
1913
- /** Called when page changes */
1914
- onPageChange?: (page: number) => void;
1915
- /** Orientation of the carousel */
1916
- orientation?: "horizontal" | "vertical";
1917
- /** Whether to loop back to start/end */
1918
- loop?: boolean;
1919
- /** Enable autoplay */
1920
- autoplay?: boolean | {
1921
- delay?: number;
1922
- };
1923
- /** Autoplay delay in milliseconds */
1924
- autoplayDelay?: number;
1925
- /** Allow mouse/touch dragging */
1926
- allowMouseDrag?: boolean;
1927
- /** Spacing between slides */
1928
- spacing?: string;
1929
- /** Number of slides to show at once */
1930
- slidesPerView?: number;
1931
- /** Number of slides to scroll at once */
1932
- slidesPerMove?: number;
1933
- children: React$1.ReactNode;
1934
- }
1935
- interface CarouselItemProps extends React$1.HTMLAttributes<HTMLDivElement> {
1936
- /** Index of this item */
1937
- index: number;
1938
- children: React$1.ReactNode;
1939
- }
1940
- interface CarouselControlProps extends React$1.HTMLAttributes<HTMLDivElement> {
1941
- children: React$1.ReactNode;
1942
- }
1943
- interface CarouselTriggerProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
1944
- children?: React$1.ReactNode;
1945
- }
1946
- interface CarouselIndicatorProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
1947
- /** Index of the slide to navigate to */
1948
- index: number;
1949
- children?: React$1.ReactNode;
1950
- }
1951
- interface CarouselItemGroupProps extends React$1.HTMLAttributes<HTMLDivElement> {
1952
- children: React$1.ReactNode;
1953
- }
1954
1967
  /**
1955
- * CarouselRoot - Main carousel container with state management and navigation logic.
1956
- * Handles page state, autoplay, looping, and drag interactions.
1968
+ * Main formatting function that routes to the appropriate formatter based on
1969
+ * the format type. See `./index.ts` for the fuller doc comment.
1957
1970
  */
1958
- declare function CarouselRoot({ page: controlledPage, defaultPage, onPageChange, orientation, loop, autoplay, autoplayDelay, allowMouseDrag, spacing, slidesPerView, slidesPerMove, className, children, ...props }: CarouselRootProps): react_jsx_runtime.JSX.Element;
1971
+ declare const formatFieldValue: (value: FieldValue, format: FieldFormat) => FormattedValue;
1972
+
1959
1973
  /**
1960
- * CarouselItemGroup - Container for carousel items with scrolling behavior.
1961
- * Manages scroll snap, drag interactions, and layout spacing.
1974
+ * Number and currency formatting utilities
1962
1975
  */
1963
- declare function CarouselItemGroup({ className, children, ...props }: CarouselItemGroupProps): react_jsx_runtime.JSX.Element;
1976
+
1964
1977
  /**
1965
- * Individual slide/item within the carousel.
1966
- * Handles sizing based on slidesPerView and applies snap alignment.
1978
+ * Check if a value is null or undefined
1967
1979
  */
1968
- declare function CarouselItem({ index, className, children, ...props }: CarouselItemProps): react_jsx_runtime.JSX.Element;
1980
+ declare const isNil: (value: unknown) => value is null | undefined;
1969
1981
  /**
1970
- * CarouselControl - Container for navigation controls and indicators.
1971
- * Typically holds prev/next buttons, indicators, and autoplay controls.
1982
+ * Format as percentage
1972
1983
  */
1973
- declare function CarouselControl({ className, children, ...props }: CarouselControlProps): react_jsx_runtime.JSX.Element;
1984
+ declare const toPercentage: (value: number | null | undefined, decimals?: number) => string | null;
1974
1985
  /**
1975
- * CarouselPrevTrigger - Button to navigate to the previous slide.
1976
- * Automatically disabled when at the first slide (unless loop is enabled).
1986
+ * Format percentage (simple wrapper for consistency with other formatters)
1987
+ *
1988
+ * @param value - Numeric value (0-100 range)
1989
+ * @param precision - Number of decimal places (default: 0)
1990
+ * @returns Formatted percentage string with % symbol
1977
1991
  */
1978
- declare function CarouselPrevTrigger({ className, children, ...props }: CarouselTriggerProps): react_jsx_runtime.JSX.Element;
1992
+ declare const formatPercent: (value: number | null | undefined, precision?: number) => string;
1979
1993
  /**
1980
- * CarouselNextTrigger - Button to navigate to the next slide.
1981
- * Automatically disabled when at the last slide (unless loop is enabled).
1994
+ * Format as integer
1982
1995
  */
1983
- declare function CarouselNextTrigger({ className, children, ...props }: CarouselTriggerProps): react_jsx_runtime.JSX.Element;
1996
+ declare const toInteger: (value: number | null | undefined) => string | null;
1984
1997
  /**
1985
- * CarouselIndicator - Dot indicator for a specific slide.
1986
- * Clicking navigates to the slide at the specified index.
1998
+ * Format as float with specified decimals
1987
1999
  */
1988
- declare function CarouselIndicator({ index, className, children, ...props }: CarouselIndicatorProps): react_jsx_runtime.JSX.Element;
2000
+ declare const toFloat: (value: number | null | undefined, decimals?: number) => string | null;
1989
2001
  /**
1990
- * CarouselIndicatorGroup - Container for all page indicators.
1991
- * Automatically generates indicators for each page/slide.
2002
+ * Format number with thousands separator
1992
2003
  */
1993
- declare function CarouselIndicatorGroup({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
2004
+ declare const toFormattedNumber: (value: number | null | undefined, decimals?: number, thousandsSeparator?: boolean) => string | null;
1994
2005
  /**
1995
- * CarouselAutoplayTrigger - Toggle button for autoplay functionality.
1996
- * Allows users to pause and resume automatic slide transitions.
2006
+ * Format number with compact notation (1K, 1M, etc.)
1997
2007
  */
1998
- declare function CarouselAutoplayTrigger({ className, children, ...props }: CarouselTriggerProps): react_jsx_runtime.JSX.Element;
2008
+ declare const toCompactNumber: (value: number | null | undefined, display?: "short" | "long") => string | null;
1999
2009
  /**
2000
- * CarouselProgressText - Displays current slide position (e.g., "1 / 5").
2001
- * Shows the current page number and total number of pages.
2010
+ * Format number with scientific notation
2002
2011
  */
2003
- declare function CarouselProgressText({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
2012
+ declare const toScientificNotation: (value: number | null | undefined, decimals?: number) => string | null;
2013
+ /**
2014
+ * Format as currency
2015
+ */
2016
+ declare const toCurrency: (value: number | null | undefined, currency?: string, options?: Partial<CurrencyFormat>) => string | null;
2017
+ /**
2018
+ * Format number according to NumberFormat specification
2019
+ */
2020
+ declare const formatNumber: (value: FieldValue, format: NumberFormat) => FormattedValue;
2021
+ /**
2022
+ * Format currency according to CurrencyFormat specification
2023
+ */
2024
+ declare const formatCurrency: (value: FieldValue, format: CurrencyFormat) => FormattedValue;
2004
2025
 
2005
- type ChipVariant = "primary" | "secondary" | "info";
2006
- type LegacyChipVariant = "default" | "brand";
2007
- interface ChipProps {
2008
- /** The content to display inside the chip */
2009
- children: React__default.ReactNode;
2010
- /** Callback when the remove button is clicked */
2011
- onRemove?: () => void;
2012
- /** Size variant of the chip */
2013
- size?: Size | "xs";
2014
- /** Visual variant of the chip */
2015
- /**
2016
- * Visual treatment. Use `primary` for selected/applied chips and
2017
- * `secondary` for available/lower-emphasis chips. `default` and `brand` are
2018
- * deprecated aliases for `secondary` and `primary`, respectively.
2019
- */
2020
- variant?: ChipVariant | LegacyChipVariant;
2021
- /** Whether the chip can be removed (shows X button) */
2022
- isRemovable?: boolean;
2023
- /** Whether the chip is disabled */
2024
- isDisabled?: boolean;
2025
- /** Additional CSS classes */
2026
- className?: string;
2027
- /** Click handler for the chip itself (not the remove button) */
2028
- onClick?: () => void;
2029
- }
2030
2026
  /**
2031
- * Chip
2032
- *
2033
- * A compact element that represents an input, attribute, or action.
2034
- * Can be removable with an X button and supports different variants and sizes.
2027
+ * Phone number formatting utilities
2035
2028
  */
2036
- declare function Chip({ children, onRemove, size, variant, isRemovable, isDisabled, className, onClick, }: ChipProps): react_jsx_runtime.JSX.Element;
2037
2029
 
2038
- interface Item {
2039
- id: string;
2040
- name: string;
2041
- }
2042
- interface ChipInputFieldProps {
2043
- /** Field label */
2044
- label?: string;
2045
- /** Field description */
2046
- description?: string;
2047
- /** Error message to display */
2048
- errorMessage?: string | ((validation: ValidationResult) => string);
2049
- /** Size variant */
2050
- size?: Size;
2051
- /** Tooltip for the label */
2052
- tooltip?: string;
2053
- /** Whether the field is required */
2054
- isRequired?: boolean;
2055
- /** Whether the field is disabled */
2056
- isDisabled?: boolean;
2057
- /** Whether the field is invalid */
2058
- isInvalid?: boolean;
2059
- /** Validation result */
2060
- validationResult?: ValidationResult;
2061
- /** Placeholder text for the input */
2062
- placeholder?: string;
2063
- /** Selected items (array of item IDs) */
2064
- selectedItems?: string[];
2065
- /** Callback when selected items change */
2066
- onItemsChange?: (items: string[]) => void;
2067
- /** Static items for autocomplete suggestions */
2068
- staticItems?: Item[];
2069
- /** Async function to fetch suggestions (alternative to staticItems) */
2070
- fetchSuggestions?: (query: string) => Promise<string[]>;
2071
- /** Custom chip variant */
2072
- chipVariant?: "primary" | "secondary" | "info" | "default" | "brand";
2073
- /** Whether to show errors */
2074
- showErrors?: boolean;
2075
- /** Additional CSS classes */
2076
- className?: string;
2077
- }
2078
2030
  /**
2079
- * ChipInputField
2080
- *
2081
- * A tags input component with autocomplete suggestions.
2082
- * Press Enter or comma to add tags, Backspace when empty to remove last tag.
2083
- * Supports both static items and async fetching for suggestions.
2031
+ * Format US phone number
2084
2032
  */
2085
- declare function ChipInputField({ label, description, errorMessage, size, tooltip, isRequired, isDisabled, isInvalid, validationResult, placeholder, selectedItems, onItemsChange, staticItems, fetchSuggestions, chipVariant, showErrors, className, }: ChipInputFieldProps): react_jsx_runtime.JSX.Element;
2033
+ declare const formatUSPhone: (phone: string | null | undefined) => string | null;
2034
+ /**
2035
+ * Format international phone number
2036
+ */
2037
+ declare const formatInternationalPhone: (phone: string | null | undefined) => string | null;
2038
+ /**
2039
+ * Format phone number with basic formatting
2040
+ */
2041
+ declare const formatPhoneNumber: (phone: string | null | undefined) => string | null;
2042
+ /**
2043
+ * Format phone according to PhoneFormat specification
2044
+ */
2045
+ declare const formatPhone: (value: FieldValue, format: PhoneFormat) => FormattedValue;
2086
2046
 
2087
- type CollapseVariant = "contained" | "bordered" | "plain";
2088
- type CollapseDensity = "comfortable" | "compact";
2089
- interface CollapseProps extends Omit<DisclosureGroupProps, "className"> {
2090
- variant?: CollapseVariant;
2091
- density?: CollapseDensity;
2092
- showDividers?: boolean;
2093
- className?: DisclosureGroupProps["className"];
2094
- }
2095
2047
  /**
2096
- * Collapse
2097
- *
2098
- * A composable disclosure group built on `react-aria-components` that follows the
2099
- * Edges design system. Supports contained, bordered, and plain variants along
2100
- * with compact or comfortable density options.
2048
+ * Power formatting utilities (rate of energy transfer)
2101
2049
  */
2102
- declare function Collapse({ variant, density, showDividers, className, ...props }: CollapseProps): react_jsx_runtime.JSX.Element;
2103
- interface CollapseItemProps extends Omit<DisclosureProps, "className" | "children"> {
2104
- className?: DisclosureProps["className"];
2105
- children?: React$1.ReactNode;
2106
- }
2107
- declare function CollapseItem({ className, children, ...props }: CollapseItemProps): react_jsx_runtime.JSX.Element;
2108
- declare namespace CollapseItem {
2109
- var displayName: string;
2110
- }
2111
- interface CollapseHeaderProps extends Omit<ButtonProps, "children" | "slot"> {
2112
- title?: React$1.ReactNode;
2113
- description?: React$1.ReactNode;
2114
- startContent?: React$1.ReactNode;
2115
- endContent?: React$1.ReactNode;
2116
- indicator?: React$1.ReactNode | ((state: {
2117
- isExpanded: boolean;
2118
- isDisabled: boolean;
2119
- }) => React$1.ReactNode);
2120
- indicatorPosition?: "start" | "end";
2121
- showIndicator?: boolean;
2122
- keepIndicatorSpace?: boolean;
2123
- children?: React$1.ReactNode;
2124
- }
2125
- declare function CollapseHeader({ title, description, startContent, endContent, indicator, indicatorPosition, showIndicator, keepIndicatorSpace, children, className, ...props }: CollapseHeaderProps): react_jsx_runtime.JSX.Element;
2126
- declare namespace CollapseHeader {
2127
- var displayName: string;
2128
- }
2129
- interface CollapseContentProps extends Omit<DisclosurePanelProps, "className"> {
2130
- className?: DisclosurePanelProps["className"];
2131
- }
2132
- declare function CollapseContent({ className, children, ...props }: CollapseContentProps): react_jsx_runtime.JSX.Element;
2133
- declare namespace CollapseContent {
2134
- var displayName: string;
2135
- }
2136
2050
 
2137
- interface ConfirmProps {
2138
- /**
2139
- * Whether the confirm dialog is open
2140
- */
2141
- isOpen: boolean;
2142
- /**
2143
- * Callback when the dialog is closed without confirming
2144
- */
2145
- onClose: () => void;
2146
- /**
2147
- * Callback when the confirm button is pressed
2148
- */
2149
- onConfirm: () => void;
2150
- /**
2151
- * Dialog title
2152
- */
2153
- title: string;
2154
- /**
2155
- * Confirmation message/content
2156
- */
2157
- message: React__default.ReactNode;
2158
- /**
2159
- * Label for the confirm button
2160
- * @default "Confirm"
2161
- */
2162
- confirmLabel?: string;
2051
+ /**
2052
+ * Format as Watts
2053
+ */
2054
+ declare const toWatts: (value: number | null | undefined, decimals?: number) => string | null;
2055
+ /**
2056
+ * Format as kilowatts
2057
+ */
2058
+ declare const toKilowatts: (value: number | null | undefined, decimals?: number) => string | null;
2059
+ /**
2060
+ * Format as megawatts
2061
+ */
2062
+ declare const toMegawatts: (value: number | null | undefined, decimals?: number) => string | null;
2063
+ /**
2064
+ * Format as gigawatts
2065
+ */
2066
+ declare const toGigawatts: (value: number | null | undefined, decimals?: number) => string | null;
2067
+ /**
2068
+ * Auto-scale power to the most appropriate unit
2069
+ */
2070
+ declare const autoScalePower: (value: number | null | undefined, decimals?: number) => string | null;
2071
+ /**
2072
+ * Format power according to PowerFormat specification
2073
+ */
2074
+ declare const formatPower: (value: FieldValue, format: PowerFormat) => FormattedValue;
2075
+ declare const toW: (value: number | null | undefined, decimals?: number) => string | null;
2076
+ declare const toKW: (value: number | null | undefined, decimals?: number) => string | null;
2077
+ declare const toMW: (value: number | null | undefined, decimals?: number) => string | null;
2078
+ declare const toGW: (value: number | null | undefined, decimals?: number) => string | null;
2079
+
2080
+ /**
2081
+ * FormatRegistry - A singleton pattern for managing formatters
2082
+ * Allows registration and retrieval of formatting functions by key
2083
+ */
2084
+
2085
+ declare class FormatRegistryClass {
2086
+ private formatters;
2163
2087
  /**
2164
- * Label for the cancel button
2165
- * @default "Cancel"
2088
+ * Register a new formatter
2089
+ * @param key - Unique identifier for the formatter
2090
+ * @param formatter - The formatting function
2166
2091
  */
2167
- cancelLabel?: string;
2092
+ register(key: string, formatter: FormatterFunction): void;
2168
2093
  /**
2169
- * Variant for the confirm button
2170
- * @default "primary"
2094
+ * Format a value using a registered formatter
2095
+ * @param key - The formatter key
2096
+ * @param value - The value to format
2097
+ * @param args - Additional arguments to pass to the formatter
2098
+ * @returns The formatted value or null
2171
2099
  */
2172
- confirmVariant?: DialogAction["variant"];
2100
+ format(key: string, value: FieldValue, ...args: unknown[]): FormattedValue;
2173
2101
  /**
2174
- * Whether the confirm action is destructive (uses destructive styling)
2175
- * @default false
2102
+ * Check if a formatter is registered
2103
+ * @param key - The formatter key
2104
+ * @returns True if the formatter exists
2176
2105
  */
2177
- isDestructive?: boolean;
2106
+ has(key: string): boolean;
2178
2107
  /**
2179
- * Whether the confirm button is in a loading state
2180
- * @default false
2108
+ * Get all registered formatter keys
2109
+ * @returns Array of formatter keys
2181
2110
  */
2182
- isLoading?: boolean;
2111
+ keys(): string[];
2183
2112
  /**
2184
- * Maximum width of the confirm dialog
2185
- * @default "500px"
2113
+ * Remove a formatter
2114
+ * @param key - The formatter key to remove
2186
2115
  */
2187
- maxWidth?: string;
2116
+ unregister(key: string): void;
2188
2117
  /**
2189
- * Minimum width of the confirm dialog (desktop only)
2190
- * @default "400px"
2118
+ * Clear all registered formatters
2191
2119
  */
2192
- minWidth?: string;
2120
+ clear(): void;
2193
2121
  }
2122
+ declare const FormatRegistry: FormatRegistryClass;
2123
+
2194
2124
  /**
2195
- * Confirm
2196
- *
2197
- * A confirmation dialog with confirm and cancel actions.
2198
- * Use for actions that require user confirmation before proceeding.
2125
+ * Electrical resistance formatting utilities
2199
2126
  */
2200
- declare function Confirm({ isOpen, onClose, onConfirm, title, message, confirmLabel, cancelLabel, confirmVariant, isDestructive, isLoading, maxWidth, minWidth, }: ConfirmProps): react_jsx_runtime.JSX.Element;
2201
2127
 
2202
- interface ConnectionStatusBadgeProps extends Omit<BadgeProps, "variant" | "children"> {
2203
- /** Whether the device is currently connected */
2204
- isConnected: boolean;
2205
- /** Timestamp when the device last connected */
2206
- connectedAt?: Date | string | null;
2207
- /** Timestamp when the device disconnected */
2208
- disconnectedAt?: Date | string | null;
2209
- /** Show timestamp below the status */
2210
- showTimestamp?: boolean;
2211
- /** Loading state */
2212
- isLoading?: boolean;
2213
- }
2214
2128
  /**
2215
- * ConnectionStatusBadge
2216
- *
2217
- * Displays device connection status with optional timestamps.
2218
- * - Green "Connected" badge with pulsing dot
2219
- * - Gray "Disconnected" badge with duration offline
2220
- * - Auto-calculates "offline for 2 hours" type strings
2221
- *
2222
- * @example
2223
- * ```tsx
2224
- * <ConnectionStatusBadge isConnected={true} />
2225
- * <ConnectionStatusBadge isConnected={false} disconnectedAt={new Date()} showTimestamp />
2226
- * <ConnectionStatusBadge isConnected={true} connectedAt={new Date()} />
2227
- * ```
2129
+ * Format as milliohms
2228
2130
  */
2229
- declare function ConnectionStatusBadge({ isConnected, connectedAt, disconnectedAt, showTimestamp, isLoading, size, shape, ...badgeProps }: ConnectionStatusBadgeProps): react_jsx_runtime.JSX.Element;
2131
+ declare const toMilliohms: (value: number | null | undefined, decimals?: number) => string | null;
2132
+ /**
2133
+ * Format as ohms
2134
+ */
2135
+ declare const toOhms: (value: number | null | undefined, decimals?: number) => string | null;
2136
+ /**
2137
+ * Format as kilohms
2138
+ */
2139
+ declare const toKilohms: (value: number | null | undefined, decimals?: number) => string | null;
2140
+ /**
2141
+ * Format as megohms
2142
+ */
2143
+ declare const toMegohms: (value: number | null | undefined, decimals?: number) => string | null;
2144
+ /**
2145
+ * Auto-scale resistance to the most appropriate unit
2146
+ */
2147
+ declare const autoScaleResistance: (value: number | null | undefined, decimals?: number) => string | null;
2148
+ /**
2149
+ * Format resistance according to ResistanceFormat specification
2150
+ */
2151
+ declare const formatResistance: (value: FieldValue, format: ResistanceFormat) => FormattedValue;
2230
2152
 
2231
- interface ContactCardProps {
2232
- /** First name */
2233
- firstName: string;
2234
- /** Last name */
2235
- lastName: string;
2236
- /** Email address (optional) */
2237
- email?: string;
2238
- /** Phone number (optional) */
2239
- phone?: string;
2240
- /** Avatar image URL (optional) */
2241
- avatarUrl?: string;
2242
- /** Link to contact detail page (optional) */
2243
- href?: string;
2244
- /** Custom link component (e.g., Next.js Link) */
2245
- LinkComponent?: LinkComponentType;
2246
- /** Card variant */
2247
- variant?: "outlined" | "elevated" | "filled" | "ghost";
2248
- /** Layout orientation
2249
- * @default "horizontal"
2250
- * - "horizontal": Avatar on left, info on right
2251
- * - "vertical": Avatar on top, info below (centered, better for narrow/square containers)
2252
- */
2253
- layout?: "horizontal" | "vertical";
2254
- /** Show email address
2255
- * @default true
2256
- */
2257
- showEmail?: boolean;
2258
- /** Show phone number
2259
- * @default false
2260
- */
2261
- showPhone?: boolean;
2262
- /** Loading state */
2263
- isLoading?: boolean;
2264
- /** Additional classes for the card */
2265
- className?: string;
2266
- /** Additional classes for the card content (for padding control, etc.) */
2267
- contentClassName?: string;
2268
- /**
2269
- * Entity identifier for PII masking (e.g., "contact:ctc_abc123")
2270
- * When provided, adds data-pii-* attributes for the Curtain extension
2271
- */
2272
- piiEntity?: string;
2273
- }
2274
2153
  /**
2275
- * ContactCard
2276
- *
2277
- * A card component for displaying contact information with avatar.
2278
- * Includes name, optional email, and optional phone number.
2279
- *
2280
- * @example
2281
- * ```tsx
2282
- * <ContactCard
2283
- * firstName="John"
2284
- * lastName="Doe"
2285
- * email="john.doe@example.com"
2286
- * phone="+1 (555) 123-4567"
2287
- * showEmail
2288
- * showPhone
2289
- * href="/contacts/123"
2290
- * />
2291
- * ```
2154
+ * Temperature formatting utilities
2292
2155
  */
2293
- declare function ContactCard({ firstName, lastName, email, phone, avatarUrl, href, LinkComponent, variant, layout, showEmail, showPhone, isLoading, className, contentClassName, piiEntity, }: ContactCardProps): react_jsx_runtime.JSX.Element;
2294
2156
 
2295
- interface ContactMetaDisplayProps {
2296
- /** First name */
2297
- firstName: string;
2298
- /** Last name */
2299
- lastName: string;
2300
- /** Email address (optional) */
2301
- email?: string;
2302
- /** Avatar image URL (optional) */
2303
- avatarUrl?: string;
2304
- /** Layout variant - stacked (vertical) or inline (horizontal) */
2305
- layout?: "stacked" | "inline";
2306
- /** Size variant */
2307
- size?: "xs" | "sm" | "md" | "lg";
2308
- /** Link to contact detail page (optional) */
2309
- href?: string;
2310
- /** Custom link component (e.g., Next.js Link) */
2311
- LinkComponent?: LinkComponentType;
2312
- /** Link variant for the name */
2313
- linkVariant?: "primary" | "secondary" | "muted" | "unstyled" | "default" | "brand";
2314
- /** Text emphasis level - "strong"/"high" for bold, "normal" for regular, "low" for muted */
2315
- emphasis?: CellEmphasis;
2316
- /** Show email address (only for stacked layout) */
2317
- showEmail?: boolean;
2318
- /** Badge element to display next to the name (e.g., Owner, Admin badge) */
2319
- badge?: React.ReactNode;
2320
- /** Avatar shape (default: "square") */
2321
- avatarShape?: "circle" | "square";
2322
- /** Loading state */
2323
- isLoading?: boolean;
2324
- /** Additional classes */
2325
- className?: string;
2326
- /**
2327
- * Entity identifier for PII masking (e.g., "contact:ctc_abc123")
2328
- * When provided, adds data-pii-* attributes for the Curtain extension
2329
- */
2330
- piiEntity?: string;
2331
- }
2332
2157
  /**
2333
- * ContactMetaDisplay
2158
+ * Convert temperature unit string to symbol
2159
+ */
2160
+ declare const temperatureStringToSymbol: (unit: TemperatureUnitString) => TemperatureUnit;
2161
+ /**
2162
+ * Format as Fahrenheit
2163
+ */
2164
+ declare const toFahrenheit: (value: number | null | undefined, decimals?: number) => string | null;
2165
+ /**
2166
+ * Format as Celsius
2167
+ */
2168
+ declare const toCelsius: (value: number | null | undefined, fromFahrenheit?: boolean, decimals?: number) => string | null;
2169
+ /**
2170
+ * Format as Kelvin
2171
+ */
2172
+ declare const toKelvin: (value: number | null | undefined, fromFahrenheit?: boolean, decimals?: number) => string | null;
2173
+ /**
2174
+ * Convert Celsius to Fahrenheit
2175
+ */
2176
+ declare const celsiusToFahrenheit: (celsius: number) => number;
2177
+ /**
2178
+ * Convert Fahrenheit to Celsius
2179
+ */
2180
+ declare const fahrenheitToCelsius: (fahrenheit: number) => number;
2181
+ /**
2182
+ * Convert Celsius to Kelvin
2183
+ */
2184
+ declare const celsiusToKelvin: (celsius: number) => number;
2185
+ /**
2186
+ * Convert Kelvin to Celsius
2187
+ */
2188
+ declare const kelvinToCelsius: (kelvin: number) => number;
2189
+ /**
2190
+ * Convert Fahrenheit to Kelvin
2191
+ */
2192
+ declare const fahrenheitToKelvin: (fahrenheit: number) => number;
2193
+ /**
2194
+ * Convert Kelvin to Fahrenheit
2195
+ */
2196
+ declare const kelvinToFahrenheit: (kelvin: number) => number;
2197
+ /**
2198
+ * Format temperature with specified unit
2199
+ */
2200
+ declare const toTemperature: (value: number | null | undefined, unit?: TemperatureUnit | TemperatureUnitString, decimals?: number) => string | null;
2201
+ /**
2202
+ * Format temperature according to TemperatureFormat specification
2203
+ */
2204
+ declare const formatTemperature: (value: FieldValue, format: TemperatureFormat) => FormattedValue;
2205
+
2206
+ /**
2207
+ * Text formatting utilities
2208
+ */
2209
+
2210
+ /**
2211
+ * Convert text to uppercase
2212
+ */
2213
+ declare const toUpperCase: (text: string | null | undefined) => string;
2214
+ /**
2215
+ * Convert text to lowercase
2216
+ */
2217
+ declare const toLowerCase: (text: string | null | undefined) => string;
2218
+ /**
2219
+ * Convert text to sentence case (first letter capitalized, rest lowercase).
2334
2220
  *
2335
- * Reusable component for displaying contact information with avatar.
2336
- * Supports stacked and inline layouts with size variants and optional linking.
2221
+ * @param text - Text to convert
2222
+ * @returns Sentence-cased text
2337
2223
  *
2338
- * **Stacked layout**: Avatar, name above, optional email below
2339
- * **Inline layout**: Avatar + name only (horizontal)
2224
+ * @example
2225
+ * ```typescript
2226
+ * toSentenceCase("HELLO WORLD"); // "Hello world"
2227
+ * toSentenceCase("hello world"); // "Hello world"
2228
+ * ```
2229
+ */
2230
+ declare const toSentenceCase: (text: string | null | undefined) => string;
2231
+ /**
2232
+ * Convert text to title case with proper handling of articles and prepositions.
2233
+ * Capitalizes the first letter of each word except common articles/prepositions
2234
+ * (unless they're the first word).
2340
2235
  *
2341
- * Use this component directly in cards, lists, or other layouts.
2342
- * For DataTable cells, use ContactMetaCell which wraps this component.
2236
+ * @param text - Text to convert
2237
+ * @returns Title-cased text
2343
2238
  *
2344
2239
  * @example
2345
- * ```tsx
2346
- * // Stacked layout (default)
2347
- * <ContactMetaDisplay
2348
- * firstName="John"
2349
- * lastName="Doe"
2350
- * email="john@example.com"
2351
- * layout="stacked"
2352
- * size="md"
2353
- * showEmail
2354
- * href="/contacts/123"
2355
- * />
2356
- *
2357
- * // Inline layout
2358
- * <ContactMetaDisplay
2359
- * firstName="John"
2360
- * lastName="Doe"
2361
- * layout="inline"
2362
- * size="sm"
2363
- * href="/contacts/123"
2364
- * />
2240
+ * ```typescript
2241
+ * toTitleCase("the quick brown fox"); // "The Quick Brown Fox"
2242
+ * toTitleCase("war and peace"); // "War and Peace"
2243
+ * toTitleCase("to be or not to be"); // "To Be or Not to Be"
2365
2244
  * ```
2366
2245
  */
2367
- declare function ContactMetaDisplay({ firstName, lastName, email, avatarUrl, layout, size, href, LinkComponent, linkVariant, emphasis, showEmail, badge, avatarShape, isLoading, className, piiEntity, }: ContactMetaDisplayProps): react_jsx_runtime.JSX.Element;
2246
+ declare const toTitleCase: (text: string | null | undefined) => string;
2247
+ /**
2248
+ * Capitalize first letter of each word
2249
+ */
2250
+ declare const capitalize: (text: string | null | undefined) => string;
2251
+ /**
2252
+ * Uppercase first letter only
2253
+ */
2254
+ declare const ucFirst: (text: string | null | undefined) => string;
2255
+ /**
2256
+ * Convert camelCase to words
2257
+ */
2258
+ declare const camelCaseToWords: (text: string | null | undefined) => string;
2259
+ /**
2260
+ * Convert snake_case to words
2261
+ */
2262
+ declare const snakeCaseToWords: (text: string | null | undefined) => string;
2263
+ /**
2264
+ * Convert enum-style text to sentence case
2265
+ */
2266
+ declare const enumToSentenceCase: (text: string | null | undefined) => string;
2267
+ /**
2268
+ * Truncate text in the middle
2269
+ */
2270
+ declare const truncateMiddle: (value: string | null | undefined, length?: number) => string;
2271
+ /**
2272
+ * Truncate text at the start
2273
+ */
2274
+ declare const truncateStart: (value: string | null | undefined, length?: number) => string;
2275
+ /**
2276
+ * Truncate text at the end
2277
+ */
2278
+ declare const truncateEnd: (value: string | null | undefined, length?: number, ellipsis?: string) => string;
2279
+ /**
2280
+ * Mask sensitive text (e.g., secrets, API keys)
2281
+ */
2282
+ declare const toSecret: (value: string | null | undefined) => string;
2283
+ /**
2284
+ * Format text according to TextFormat specification
2285
+ */
2286
+ declare const formatText: (value: FieldValue, format: TextFormat) => FormattedValue;
2368
2287
 
2369
2288
  /**
2370
- * ContainerQueryProvider measures its own width via ResizeObserver and
2371
- * provides breakpoint state to all descendant blocks via context.
2372
- *
2373
- * Wrap block previews (or board surfaces) in this provider so blocks that
2374
- * use `useContainerBreakpoint` respond to their actual render width, not
2375
- * the browser viewport.
2289
+ * Voltage formatting utilities (electrical potential)
2290
+ */
2291
+
2292
+ /**
2293
+ * Format as millivolts
2294
+ */
2295
+ declare const toMillivolts: (value: number | null | undefined, decimals?: number) => string | null;
2296
+ /**
2297
+ * Format as volts
2298
+ */
2299
+ declare const toVolts: (value: number | null | undefined, decimals?: number) => string | null;
2300
+ /**
2301
+ * Format as kilovolts
2302
+ */
2303
+ declare const toKilovolts: (value: number | null | undefined, decimals?: number) => string | null;
2304
+ /**
2305
+ * Auto-scale voltage to the most appropriate unit
2306
+ */
2307
+ declare const autoScaleVoltage: (value: number | null | undefined, decimals?: number) => string | null;
2308
+ /**
2309
+ * Format voltage according to VoltageFormat specification
2310
+ */
2311
+ declare const formatVoltage: (value: FieldValue, format: VoltageFormat) => FormattedValue;
2312
+ declare const toMV: (value: number | null | undefined, decimals?: number) => string | null;
2313
+ declare const toV: (value: number | null | undefined, decimals?: number) => string | null;
2314
+ declare const toKV: (value: number | null | undefined, decimals?: number) => string | null;
2315
+
2316
+ /**
2317
+ * Comprehensive formatting utilities for the Edges design system
2376
2318
  *
2377
- * Renders a transparent div wrapper apply className to control layout.
2319
+ * This module provides a unified formatting system with support for:
2320
+ * - Text formatting (case conversion, truncation, etc.)
2321
+ * - Number formatting (decimals, thousands separators, compact notation)
2322
+ * - Currency formatting (multiple currencies and display options)
2323
+ * - Date formatting (relative time, custom formats, timezones)
2324
+ * - Boolean formatting (custom true/false text)
2325
+ * - Energy units (Wh, kWh, MWh, GWh with auto-scaling)
2326
+ * - Temperature units (Celsius, Fahrenheit, Kelvin)
2327
+ * - Distance units (meters, kilometers, miles, feet)
2328
+ * - Phone number formatting (US and international)
2329
+ * - Custom formatters via the FormatRegistry
2378
2330
  */
2379
- declare function ContainerQueryProvider({ children, className }: {
2380
- children: React.ReactNode;
2381
- className?: string;
2382
- }): react_jsx_runtime.JSX.Element;
2383
2331
 
2384
- interface CopyToClipboardProps {
2385
- /**
2386
- * The value to copy to clipboard. If not provided, will use the text content of children
2387
- */
2388
- value?: string;
2389
- /**
2390
- * The content to display
2391
- */
2392
- children: React__default.ReactNode;
2393
- /**
2394
- * Optional className for the container
2395
- */
2396
- className?: string;
2397
- /**
2398
- * Size of the copy button, defaults to "sm"
2399
- */
2400
- size?: "sm" | "md";
2401
- /**
2402
- * Position of the copy icon relative to children, defaults to "right"
2403
- */
2404
- iconPosition?: "left" | "right";
2405
- }
2406
- declare function CopyToClipboard({ value, children, className, size, iconPosition, }: CopyToClipboardProps): react_jsx_runtime.JSX.Element;
2332
+ /**
2333
+ * Convenience function to create a format object
2334
+ *
2335
+ * @example
2336
+ * ```typescript
2337
+ * const currencyFormat = createFormat("currency", { currency: "EUR" });
2338
+ * const dateFormat = createFormat("date", { relative: true });
2339
+ * ```
2340
+ */
2341
+ declare const createFormat: <T extends FieldFormat["type"]>(type: T, options?: Omit<Extract<FieldFormat, {
2342
+ type: T;
2343
+ }>, "type">) => Extract<FieldFormat, {
2344
+ type: T;
2345
+ }>;
2407
2346
 
2408
2347
  type AreaSeriesBaseline = number | ((point: BaseDataPoint, index: number) => number);
2409
2348
  interface AreaSeriesProps {
@@ -7432,6 +7371,67 @@ interface ColorModeProviderProps {
7432
7371
  }
7433
7372
  declare const ColorModeProvider: React.FC<ColorModeProviderProps>;
7434
7373
 
7374
+ /**
7375
+ * Semantic typography role classes generated by @texturehq/edges-tokens.
7376
+ *
7377
+ * These classes apply the full type role — family, size, line-height,
7378
+ * weight, and letter-spacing. Pair them with explicit semantic text-color
7379
+ * utilities at the callsite.
7380
+ */
7381
+ declare const typographyRole: {
7382
+ readonly displayXl: "text-display-xl";
7383
+ readonly displayLg: "text-display-lg";
7384
+ readonly displayMd: "text-display-md";
7385
+ readonly displaySm: "text-display-sm";
7386
+ readonly headingXl: "text-heading-xl";
7387
+ readonly headingLg: "text-heading-lg";
7388
+ readonly headingMd: "text-heading-md";
7389
+ readonly headingSm: "text-heading-sm";
7390
+ readonly bodyLg: "text-body-lg";
7391
+ readonly bodyMd: "text-body-md";
7392
+ readonly bodySm: "text-body-sm";
7393
+ readonly labelLg: "text-label-lg";
7394
+ readonly labelMd: "text-label-md";
7395
+ readonly labelSm: "text-label-sm";
7396
+ readonly code: "text-code";
7397
+ readonly agent: "text-agent";
7398
+ };
7399
+ type TypographyRole = keyof typeof typographyRole;
7400
+ /**
7401
+ * Merge a semantic typography role with semantic color utilities and any
7402
+ * component-specific layout classes. This keeps components from hand-composing
7403
+ * `text-sm font-medium leading-*` whenever a role exists.
7404
+ */
7405
+ declare function typeRole(role: TypographyRole, ...classNames: Array<string | false | null | undefined>): string;
7406
+
7407
+ /**
7408
+ * Data Operations Utilities
7409
+ *
7410
+ * Pure functions for filtering, sorting, searching, and faceting data.
7411
+ * These functions are used by useClientDataControls but can also be used standalone.
7412
+ */
7413
+
7414
+ interface ApplyDataOperationsOptions<T> {
7415
+ data: T[];
7416
+ filters?: FilterState;
7417
+ sort?: SortState | null;
7418
+ search?: SearchConfig | null;
7419
+ facetConfigs?: FacetConfig[];
7420
+ }
7421
+ interface ApplyDataOperationsResult<T> {
7422
+ data: T[];
7423
+ facetCounts: FacetCounts;
7424
+ resultCount: number;
7425
+ }
7426
+ /**
7427
+ * Apply all data operations in the correct order:
7428
+ * 1. Search
7429
+ * 2. Filter
7430
+ * 3. Compute facets (on filtered data)
7431
+ * 4. Sort
7432
+ */
7433
+ declare function applyDataOperations<T>({ data, filters, sort, search, facetConfigs, }: ApplyDataOperationsOptions<T>): ApplyDataOperationsResult<T>;
7434
+
7435
7435
  /**
7436
7436
  * Device state helper utilities
7437
7437
  *