@pos-360/horizon 0.13.0 → 0.15.0

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.
@@ -149,7 +149,15 @@ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimit
149
149
 
150
150
  declare const Select: React.FC<React.ComponentProps<typeof SelectPrimitive.Root>>;
151
151
  declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
152
- declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
152
+ interface SelectValueProps extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>, "children"> {
153
+ /**
154
+ * The label to display for the current value.
155
+ * Pass `options.find(o => o.value === value)?.label` here.
156
+ * When undefined (no value selected), `placeholder` is shown instead.
157
+ */
158
+ children?: React.ReactNode;
159
+ }
160
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
153
161
  declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
154
162
  declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
155
163
  declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -221,15 +229,33 @@ interface TableContextValue {
221
229
  registerRowId: (rowId: string) => void;
222
230
  unregisterRowId: (rowId: string) => void;
223
231
  }
224
- interface TableProps extends React.HTMLAttributes<HTMLTableElement> {
232
+ interface ColumnDef<T = any> {
233
+ key: string;
234
+ label: string;
235
+ cell: (row: T) => React.ReactNode;
236
+ sticky?: boolean;
237
+ /** Used by `useColumnVisibility` to set initial visible columns on desktop */
238
+ defaultVisible?: boolean;
239
+ /** Used by `useColumnVisibility` to set initial visible columns on mobile (viewport < 768px) */
240
+ mobileVisible?: boolean;
241
+ minWidth?: number;
242
+ }
243
+ interface TableProps<T = any> extends React.HTMLAttributes<HTMLTableElement> {
225
244
  selectable?: boolean;
226
245
  selectionMode?: SelectionMode;
227
246
  selectedRows?: string[];
228
247
  onSelectionChange?: (selectedRows: string[]) => void;
229
248
  getRowId?: (row: any) => string;
230
249
  rows?: any[];
231
- }
232
- declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
250
+ columns?: ColumnDef<T>[];
251
+ data?: T[];
252
+ visibleColumns?: string[];
253
+ showDividers?: boolean;
254
+ highlightMode?: "row" | "column" | "cross" | "none";
255
+ }
256
+ declare const Table: <T = any>(props: TableProps<T> & {
257
+ ref?: React.Ref<HTMLTableElement>;
258
+ }) => React.ReactElement | null;
233
259
  declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
234
260
  declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
235
261
  declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
@@ -239,7 +265,15 @@ interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
239
265
  }
240
266
  declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
241
267
  declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
242
- declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
268
+ interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
269
+ /**
270
+ * "default" — standard p-4 padding for text content.
271
+ * "embed" — compact p-1.5 padding for cells that contain interactive
272
+ * components (Input, Select, Toggle, etc.).
273
+ */
274
+ variant?: "default" | "embed";
275
+ }
276
+ declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableCellElement>>;
243
277
  declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
244
278
  interface TableSelectAllProps {
245
279
  className?: string;
@@ -253,6 +287,22 @@ interface TableRowCheckboxProps {
253
287
  declare const TableRowCheckbox: React.ForwardRefExoticComponent<TableRowCheckboxProps & React.RefAttributes<HTMLDivElement>>;
254
288
  declare const useTableSelection: () => TableContextValue;
255
289
 
290
+ interface UseColumnVisibilityOptions {
291
+ storageKey?: string;
292
+ }
293
+ declare function useColumnVisibility<T = any>(columns: ColumnDef<T>[], options?: UseColumnVisibilityOptions): {
294
+ visibleColumns: string[];
295
+ setVisibleColumns: (cols: string[]) => void;
296
+ };
297
+
298
+ interface ColumnPickerProps<T = any> {
299
+ columns: ColumnDef<T>[];
300
+ visibleColumns: string[];
301
+ onVisibleColumnsChange: (cols: string[]) => void;
302
+ triggerLabel?: string;
303
+ }
304
+ declare function ColumnPicker<T = any>({ columns, visibleColumns, onVisibleColumnsChange, triggerLabel, }: ColumnPickerProps<T>): react_jsx_runtime.JSX.Element;
305
+
256
306
  interface TabsProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> {
257
307
  defaultValue?: string;
258
308
  value?: string;
@@ -374,4 +424,4 @@ interface CodeProps extends Omit<React.HTMLAttributes<HTMLElement>, "color">, Va
374
424
  }
375
425
  declare const Code: React.ForwardRefExoticComponent<CodeProps & React.RefAttributes<HTMLElement>>;
376
426
 
377
- export { Badge, type BadgeProps, Button, type ButtonProps, Caption, type CaptionProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Code, type CodeProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, Heading, type HeadingProps, Label, type LabelProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, type SegmentedControlRadius, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Skeleton, SkeletonAvatar, SkeletonBadge, SkeletonButton, SkeletonCard, SkeletonIcon, SkeletonInput, SkeletonSubtitle, SkeletonTableRow, SkeletonTableRows, SkeletonText, SkeletonTitle, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableRowCheckbox, TableSelectAll, Tabs, TabsContent, TabsList, TabsTrigger, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, Toggle, type ToggleOption, type ToggleProps, type ToggleRadius, badgeVariants, buttonVariants, captionVariants, codeVariants, headingVariants, labelVariants, segmentedControlItemVariants, segmentedControlVariants, separatorVariants, switchLabelVariants, switchThumbVariants, switchTrackVariants, textVariants, toggleGroupVariants, toggleItemVariants, useFormContext, useFormFieldContext, useTableSelection };
427
+ export { Badge, type BadgeProps, Button, type ButtonProps, Caption, type CaptionProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Code, type CodeProps, type ColumnDef, ColumnPicker, type ColumnPickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, Heading, type HeadingProps, Label, type LabelProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, type SegmentedControlRadius, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Skeleton, SkeletonAvatar, SkeletonBadge, SkeletonButton, SkeletonCard, SkeletonIcon, SkeletonInput, SkeletonSubtitle, SkeletonTableRow, SkeletonTableRows, SkeletonText, SkeletonTitle, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, type TableCellProps, TableFooter, TableHead, TableHeader, TableRow, TableRowCheckbox, TableSelectAll, Tabs, TabsContent, TabsList, TabsTrigger, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, Toggle, type ToggleOption, type ToggleProps, type ToggleRadius, badgeVariants, buttonVariants, captionVariants, codeVariants, headingVariants, labelVariants, segmentedControlItemVariants, segmentedControlVariants, separatorVariants, switchLabelVariants, switchThumbVariants, switchTrackVariants, textVariants, toggleGroupVariants, toggleItemVariants, useColumnVisibility, useFormContext, useFormFieldContext, useTableSelection };
@@ -149,7 +149,15 @@ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimit
149
149
 
150
150
  declare const Select: React.FC<React.ComponentProps<typeof SelectPrimitive.Root>>;
151
151
  declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
152
- declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
152
+ interface SelectValueProps extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>, "children"> {
153
+ /**
154
+ * The label to display for the current value.
155
+ * Pass `options.find(o => o.value === value)?.label` here.
156
+ * When undefined (no value selected), `placeholder` is shown instead.
157
+ */
158
+ children?: React.ReactNode;
159
+ }
160
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
153
161
  declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
154
162
  declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
155
163
  declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -221,15 +229,33 @@ interface TableContextValue {
221
229
  registerRowId: (rowId: string) => void;
222
230
  unregisterRowId: (rowId: string) => void;
223
231
  }
224
- interface TableProps extends React.HTMLAttributes<HTMLTableElement> {
232
+ interface ColumnDef<T = any> {
233
+ key: string;
234
+ label: string;
235
+ cell: (row: T) => React.ReactNode;
236
+ sticky?: boolean;
237
+ /** Used by `useColumnVisibility` to set initial visible columns on desktop */
238
+ defaultVisible?: boolean;
239
+ /** Used by `useColumnVisibility` to set initial visible columns on mobile (viewport < 768px) */
240
+ mobileVisible?: boolean;
241
+ minWidth?: number;
242
+ }
243
+ interface TableProps<T = any> extends React.HTMLAttributes<HTMLTableElement> {
225
244
  selectable?: boolean;
226
245
  selectionMode?: SelectionMode;
227
246
  selectedRows?: string[];
228
247
  onSelectionChange?: (selectedRows: string[]) => void;
229
248
  getRowId?: (row: any) => string;
230
249
  rows?: any[];
231
- }
232
- declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
250
+ columns?: ColumnDef<T>[];
251
+ data?: T[];
252
+ visibleColumns?: string[];
253
+ showDividers?: boolean;
254
+ highlightMode?: "row" | "column" | "cross" | "none";
255
+ }
256
+ declare const Table: <T = any>(props: TableProps<T> & {
257
+ ref?: React.Ref<HTMLTableElement>;
258
+ }) => React.ReactElement | null;
233
259
  declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
234
260
  declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
235
261
  declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
@@ -239,7 +265,15 @@ interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
239
265
  }
240
266
  declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
241
267
  declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
242
- declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
268
+ interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
269
+ /**
270
+ * "default" — standard p-4 padding for text content.
271
+ * "embed" — compact p-1.5 padding for cells that contain interactive
272
+ * components (Input, Select, Toggle, etc.).
273
+ */
274
+ variant?: "default" | "embed";
275
+ }
276
+ declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableCellElement>>;
243
277
  declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
244
278
  interface TableSelectAllProps {
245
279
  className?: string;
@@ -253,6 +287,22 @@ interface TableRowCheckboxProps {
253
287
  declare const TableRowCheckbox: React.ForwardRefExoticComponent<TableRowCheckboxProps & React.RefAttributes<HTMLDivElement>>;
254
288
  declare const useTableSelection: () => TableContextValue;
255
289
 
290
+ interface UseColumnVisibilityOptions {
291
+ storageKey?: string;
292
+ }
293
+ declare function useColumnVisibility<T = any>(columns: ColumnDef<T>[], options?: UseColumnVisibilityOptions): {
294
+ visibleColumns: string[];
295
+ setVisibleColumns: (cols: string[]) => void;
296
+ };
297
+
298
+ interface ColumnPickerProps<T = any> {
299
+ columns: ColumnDef<T>[];
300
+ visibleColumns: string[];
301
+ onVisibleColumnsChange: (cols: string[]) => void;
302
+ triggerLabel?: string;
303
+ }
304
+ declare function ColumnPicker<T = any>({ columns, visibleColumns, onVisibleColumnsChange, triggerLabel, }: ColumnPickerProps<T>): react_jsx_runtime.JSX.Element;
305
+
256
306
  interface TabsProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> {
257
307
  defaultValue?: string;
258
308
  value?: string;
@@ -374,4 +424,4 @@ interface CodeProps extends Omit<React.HTMLAttributes<HTMLElement>, "color">, Va
374
424
  }
375
425
  declare const Code: React.ForwardRefExoticComponent<CodeProps & React.RefAttributes<HTMLElement>>;
376
426
 
377
- export { Badge, type BadgeProps, Button, type ButtonProps, Caption, type CaptionProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Code, type CodeProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, Heading, type HeadingProps, Label, type LabelProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, type SegmentedControlRadius, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Skeleton, SkeletonAvatar, SkeletonBadge, SkeletonButton, SkeletonCard, SkeletonIcon, SkeletonInput, SkeletonSubtitle, SkeletonTableRow, SkeletonTableRows, SkeletonText, SkeletonTitle, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableRowCheckbox, TableSelectAll, Tabs, TabsContent, TabsList, TabsTrigger, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, Toggle, type ToggleOption, type ToggleProps, type ToggleRadius, badgeVariants, buttonVariants, captionVariants, codeVariants, headingVariants, labelVariants, segmentedControlItemVariants, segmentedControlVariants, separatorVariants, switchLabelVariants, switchThumbVariants, switchTrackVariants, textVariants, toggleGroupVariants, toggleItemVariants, useFormContext, useFormFieldContext, useTableSelection };
427
+ export { Badge, type BadgeProps, Button, type ButtonProps, Caption, type CaptionProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Code, type CodeProps, type ColumnDef, ColumnPicker, type ColumnPickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, Heading, type HeadingProps, Label, type LabelProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, type SegmentedControlRadius, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Skeleton, SkeletonAvatar, SkeletonBadge, SkeletonButton, SkeletonCard, SkeletonIcon, SkeletonInput, SkeletonSubtitle, SkeletonTableRow, SkeletonTableRows, SkeletonText, SkeletonTitle, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, type TableCellProps, TableFooter, TableHead, TableHeader, TableRow, TableRowCheckbox, TableSelectAll, Tabs, TabsContent, TabsList, TabsTrigger, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, Toggle, type ToggleOption, type ToggleProps, type ToggleRadius, badgeVariants, buttonVariants, captionVariants, codeVariants, headingVariants, labelVariants, segmentedControlItemVariants, segmentedControlVariants, separatorVariants, switchLabelVariants, switchThumbVariants, switchTrackVariants, textVariants, toggleGroupVariants, toggleItemVariants, useColumnVisibility, useFormContext, useFormFieldContext, useTableSelection };