@dragunio/fe-libs 0.1.10 → 0.1.12

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,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, MouseEvent, KeyboardEvent, TableHTMLAttributes, InputHTMLAttributes, RefObject, TextareaHTMLAttributes, KeyboardEventHandler, ChangeEvent, ReactElement } from 'react';
3
- export { ChevronDownIcon, ChevronUpIcon, CloseIcon, EyeIcon, EyeOffIcon, IconProps, MailboxIcon, MoreHorizontalIcon, MoreVerticalIcon, PhoneIcon, PlusIcon, SearchIcon, arrow_left, check_square_fill, chevron_down, chevron_left, chevron_right, chevron_up, copy, key, lock, lock_unlocked, log_out, minus_square, plus, plus_square, search, trash, x_close } from './icons.js';
3
+ export { ChevronDownIcon, ChevronUpIcon, CloseIcon, EyeIcon, EyeOffIcon, IconProps, MailboxIcon, MoreHorizontalIcon, MoreVerticalIcon, PhoneIcon, PlusIcon, SearchIcon, arrow_left, check_square_fill, chevron_down, chevron_left, chevron_right, chevron_up, copy, key, lock, lock_unlocked, log_out, minus_square, pin_02, plus, plus_square, search, settings, trash, unpin_02, x_close } from './icons.js';
4
4
 
5
5
  type ButtonHierarchy = 'primary' | 'secondary-gray' | 'secondary-color' | 'tertiary-gray' | 'tertiary-color';
6
6
  type ButtonSize = '24' | '32' | '40';
@@ -126,7 +126,21 @@ declare const Tabs: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivE
126
126
  type TableData = readonly (readonly ReactNode[])[];
127
127
  type ColumnResizeHandler = (columnSizes: number[], columnIndex: number) => void;
128
128
  type TablePaginationPosition = 'top-right' | 'bottom-right' | 'bottom-center' | 'middle-bottom';
129
- type TableProps = TableHTMLAttributes<HTMLTableElement> & {
129
+ type TableColumn = {
130
+ /** Stable identifier shared by a TableHeader and its TableCell values. */
131
+ id: string;
132
+ /** Starting width in pixels when columnWidths does not provide an override. */
133
+ width?: number;
134
+ /** Overrides the table-level minimum width for this column. */
135
+ minWidth?: number;
136
+ /** Overrides the table-level maximum width for this column. */
137
+ maxWidth?: number;
138
+ /** Set false to suppress the resize handle for this column. */
139
+ resizable?: boolean;
140
+ };
141
+ type TableColumnWidths = Readonly<Record<string, number>>;
142
+ type TableResizeHandler = (columnId: string, width: number, columnWidths: TableColumnWidths) => void;
143
+ type TableProps = Omit<TableHTMLAttributes<HTMLTableElement>, 'onResize'> & {
130
144
  /** Enables alternating background colors for body rows. */
131
145
  striped?: boolean;
132
146
  /** Column labels. Passing headers or data enables the data-driven table API. */
@@ -153,17 +167,41 @@ type TableProps = TableHTMLAttributes<HTMLTableElement> & {
153
167
  onPageChange?: (page: number) => void;
154
168
  /** Location of the built-in Pagination. Defaults to bottom-right. */
155
169
  paginationPosition?: TablePaginationPosition;
170
+ /**
171
+ * Ordered columns for the composable Table API. Each TableHeader and
172
+ * TableCell should receive a matching columnId. This also renders colgroup
173
+ * widths so frozen columns remain aligned while scrolling.
174
+ */
175
+ columns?: readonly TableColumn[];
176
+ /** Controlled widths for columns from columns, keyed by column id. */
177
+ columnWidths?: TableColumnWidths;
178
+ /** IDs to freeze at the leading edge of a horizontal scroll container. */
179
+ fixedColumnIds?: readonly string[];
180
+ /** Called whenever a composable table column changes width. */
181
+ onResize?: TableResizeHandler;
182
+ /** Called when pointer resizing finishes, or immediately after keyboard resizing. */
183
+ onResizeEnd?: TableResizeHandler;
184
+ /** Largest width for composable table columns. Defaults to 1200. */
185
+ maxColumnWidth?: number;
186
+ };
187
+ type TableHeaderProps = HTMLAttributes<HTMLTableCellElement> & {
188
+ /** Matches a TableColumn id to enable sizing, resizing and freezing. */
189
+ columnId?: string;
190
+ };
191
+ type TableCellProps = HTMLAttributes<HTMLTableCellElement> & {
192
+ /** Matches a TableColumn id to enable frozen-column positioning. */
193
+ columnId?: string;
156
194
  };
157
195
  /**
158
- * A semantic table. Use its child primitives for custom markup, or pass headers
159
- * and data for an automatically sized, striped and resizable table.
196
+ * A semantic table. Use its child primitives for custom markup, or pass
197
+ * headers and data for an automatically sized, striped and resizable table.
160
198
  */
161
- declare function Table({ headers, data, striped, children, pagination, pageSize, page, defaultPage, onPageChange, paginationPosition, ...props }: TableProps): react.JSX.Element;
199
+ declare function Table({ headers, data, ...props }: TableProps): react.JSX.Element;
162
200
  declare function TableHead(props: HTMLAttributes<HTMLTableSectionElement>): react.JSX.Element;
163
201
  declare function TableBody(props: HTMLAttributes<HTMLTableSectionElement>): react.JSX.Element;
164
202
  declare function TableRow({ children, ...props }: HTMLAttributes<HTMLTableRowElement>): react.JSX.Element;
165
- declare function TableCell({ children, ...props }: HTMLAttributes<HTMLTableCellElement>): react.JSX.Element;
166
- declare function TableHeader({ children, ...props }: HTMLAttributes<HTMLTableCellElement>): react.JSX.Element;
203
+ declare function TableCell({ children, columnId, className, style, ...props }: TableCellProps): react.JSX.Element;
204
+ declare function TableHeader({ children, columnId, className, style, ...props }: TableHeaderProps): react.JSX.Element;
167
205
  declare function TableCaption(props: HTMLAttributes<HTMLTableCaptionElement>): react.JSX.Element;
168
206
 
169
207
  type ToggleProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'color' | 'type'> & {
@@ -373,7 +411,21 @@ type SelectionProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'default
373
411
  disabled?: boolean;
374
412
  name?: string;
375
413
  onKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
414
+ /**
415
+ * Caps the field width. Numbers are pixels (`240` → `240px`); strings are
416
+ * any CSS length (`'16rem'`, `'50%'`). The field still shrinks inside
417
+ * narrower containers.
418
+ */
419
+ maxWidth?: number | string;
420
+ /**
421
+ * How a selected label longer than the field is shown:
422
+ * - `'ellipsis'` (default): one line ending in `…`; the full text appears
423
+ * in a tooltip on hover or focus.
424
+ * - `'wrap'`: the label wraps onto more lines and the field grows taller.
425
+ */
426
+ overflow?: SelectionOverflow;
376
427
  };
428
+ type SelectionOverflow = 'ellipsis' | 'wrap';
377
429
 
378
430
  /** A rounded, searchable custom dropdown with single, multiple, and tag modes. */
379
431
  declare const Selection: react.ForwardRefExoticComponent<Omit<react.HTMLAttributes<HTMLDivElement>, "value" | "defaultValue" | "onChange" | "onKeyDown"> & {
@@ -397,6 +449,8 @@ declare const Selection: react.ForwardRefExoticComponent<Omit<react.HTMLAttribut
397
449
  disabled?: boolean;
398
450
  name?: string;
399
451
  onKeyDown?: react.KeyboardEventHandler<HTMLButtonElement>;
452
+ maxWidth?: number | string;
453
+ overflow?: SelectionOverflow;
400
454
  } & react.RefAttributes<HTMLDivElement>>;
401
455
 
402
456
  declare function formatNumber(value: number, decimals?: number, thousandSeparator?: string, decimalSeparator?: string): string;
@@ -963,4 +1017,4 @@ declare function NotFoundLost(props: NotFoundSceneProps): react.JSX.Element;
963
1017
  /** A 404 page with a stable random design, or an explicitly selected variant. */
964
1018
  declare function NotFound({ variant, ...props }: NotFoundProps): react.JSX.Element;
965
1019
 
966
- export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarShape, type AvatarSize, Button, ButtonBar, type ButtonBarAction, type ButtonBarItem, type ButtonBarProps, type ButtonColor, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipStatus, type ChipVariant, type ColumnResizeHandler, type ControlLabelPosition, type Currency, CurrencyInput, type CurrencyInputProps, type DateRange, DateTimePicker, type DateTimePickerProps, type DateTimePickerRangeProps, type DateTimePickerSingleProps, type DescriptionDisplay, Drawer, type DrawerProps, type DrawerSide, type DrawerWidth, type DrawerWidthPreset, DrawerWidths, EmailInput, type EmailInputProps, ExpandableSection, type ExpandableSectionProps, FILE_UPLOAD_ACCEPTS, type FieldError, FilePreview, type FilePreviewActionHandler, type FilePreviewCloseReason, type FilePreviewKind, type FilePreviewProps, FileUpload, type FileUploadAccept, type FileUploadFileType, type FileUploadProps, type FileUploadRejection, type FileUploadRejectionCode, type InputValidator, Loading, type LoadingProps, type LoadingSize, Message, type MessageOptions, type MessageProps, type MessageSeverity, Modal, type ModalAction, type ModalProps, type ModalSize, NotFound, NotFoundCaveman, NotFoundLost, type NotFoundProps, type NotFoundSceneProps, type NotFoundVariant, NotFoundYeti, NumberInput, type NumberInputProps, Pagination, type PaginationProps, PasswordInput, type PasswordInputProps, PhoneNumberInput, type PhoneNumberInputProps, ProgressBar, type ProgressBarProps, type ProgressBarSize, RadioButton, type RadioButtonProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioValue, Selection, type SelectionOption, type SelectionProps, type SelectionValue, Skeleton, SkeletonBox, type SkeletonBoxProps, SkeletonCircle, SkeletonLine, type SkeletonProps, type SkeletonSizeProps, SkeletonSquare, type SkeletonVariant, Snackbar, type SnackbarAnchorOrigin, type SnackbarProps, type TabChangeEvent, type TabItem, Table, TableBody, TableCaption, TableCell, type TableData, TableHead, TableHeader, type TablePaginationPosition, type TableProps, TableRow, Tabs, type TabsProps, type TabsScrollButtons, type TabsVariant, TextArea, type TextAreaProps, TextInput, type TextInputProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, type ValidatedTextInputProps, type ValidationTiming, formatFileSize, formatNumber, getFilePreviewKind, getIconSize, message, normalizePhoneNumber, validateEmail, validatePassword, validatePhoneNumber };
1020
+ export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarShape, type AvatarSize, Button, ButtonBar, type ButtonBarAction, type ButtonBarItem, type ButtonBarProps, type ButtonColor, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipStatus, type ChipVariant, type ColumnResizeHandler, type ControlLabelPosition, type Currency, CurrencyInput, type CurrencyInputProps, type DateRange, DateTimePicker, type DateTimePickerProps, type DateTimePickerRangeProps, type DateTimePickerSingleProps, type DescriptionDisplay, Drawer, type DrawerProps, type DrawerSide, type DrawerWidth, type DrawerWidthPreset, DrawerWidths, EmailInput, type EmailInputProps, ExpandableSection, type ExpandableSectionProps, FILE_UPLOAD_ACCEPTS, type FieldError, FilePreview, type FilePreviewActionHandler, type FilePreviewCloseReason, type FilePreviewKind, type FilePreviewProps, FileUpload, type FileUploadAccept, type FileUploadFileType, type FileUploadProps, type FileUploadRejection, type FileUploadRejectionCode, type InputValidator, Loading, type LoadingProps, type LoadingSize, Message, type MessageOptions, type MessageProps, type MessageSeverity, Modal, type ModalAction, type ModalProps, type ModalSize, NotFound, NotFoundCaveman, NotFoundLost, type NotFoundProps, type NotFoundSceneProps, type NotFoundVariant, NotFoundYeti, NumberInput, type NumberInputProps, Pagination, type PaginationProps, PasswordInput, type PasswordInputProps, PhoneNumberInput, type PhoneNumberInputProps, ProgressBar, type ProgressBarProps, type ProgressBarSize, RadioButton, type RadioButtonProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioValue, Selection, type SelectionOption, type SelectionOverflow, type SelectionProps, type SelectionValue, Skeleton, SkeletonBox, type SkeletonBoxProps, SkeletonCircle, SkeletonLine, type SkeletonProps, type SkeletonSizeProps, SkeletonSquare, type SkeletonVariant, Snackbar, type SnackbarAnchorOrigin, type SnackbarProps, type TabChangeEvent, type TabItem, Table, TableBody, TableCaption, TableCell, type TableCellProps, type TableColumn, type TableColumnWidths, type TableData, TableHead, TableHeader, type TableHeaderProps, type TablePaginationPosition, type TableProps, type TableResizeHandler, TableRow, Tabs, type TabsProps, type TabsScrollButtons, type TabsVariant, TextArea, type TextAreaProps, TextInput, type TextInputProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, type ValidatedTextInputProps, type ValidationTiming, formatFileSize, formatNumber, getFilePreviewKind, getIconSize, message, normalizePhoneNumber, validateEmail, validatePassword, validatePhoneNumber };