@dragunio/fe-libs 0.1.3 → 0.1.5

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.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
- import { ButtonHTMLAttributes, ReactNode, SVGProps, TableHTMLAttributes, HTMLAttributes, InputHTMLAttributes, KeyboardEventHandler, TextareaHTMLAttributes, ReactElement } from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, TableHTMLAttributes, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, KeyboardEventHandler, ReactElement } from 'react';
3
+ export { ChevronDownIcon, CloseIcon, IconProps, 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.mjs';
3
4
 
4
5
  type ButtonHierarchy = 'primary' | 'secondary-gray' | 'secondary-color' | 'tertiary-gray' | 'tertiary-color';
5
6
  type ButtonSize = '24' | '32' | '40';
@@ -43,14 +44,6 @@ declare const Button: react.ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<
43
44
  variant?: ButtonVariant;
44
45
  } & react.RefAttributes<HTMLButtonElement>>;
45
46
 
46
- type IconProps = SVGProps<SVGSVGElement> & {
47
- size?: number | string;
48
- };
49
- declare function PlusIcon(props: IconProps): react.JSX.Element;
50
- declare function ChevronDownIcon(props: IconProps): react.JSX.Element;
51
- declare function CloseIcon(props: IconProps): react.JSX.Element;
52
- declare function SearchIcon(props: IconProps): react.JSX.Element;
53
-
54
47
  type TableData = readonly (readonly ReactNode[])[];
55
48
  type ColumnResizeHandler = (columnSizes: number[], columnIndex: number) => void;
56
49
  type TablePaginationPosition = 'top-right' | 'bottom-right' | 'bottom-center' | 'middle-bottom';
@@ -125,35 +118,72 @@ type DrawerProps = Omit<HTMLAttributes<HTMLElement>, 'title'> & {
125
118
  declare function Drawer({ open, onClose, title, footer, side, width, fullScreen, children, closeOnBackdropClick, className, style, ...props }: DrawerProps): react.ReactPortal | null;
126
119
 
127
120
  type FieldError = boolean | ReactNode;
128
- type TextFieldBaseProps = {
121
+ type DescriptionDisplay = 'inline' | 'tooltip';
122
+ type FieldBaseProps = {
129
123
  label?: ReactNode;
124
+ /** Marks the field as required and displays a red asterisk. */
125
+ isRequired?: boolean;
126
+ /** Supporting text below the field. Takes precedence over helperText. */
127
+ description?: ReactNode;
128
+ /** Displays description below the field or from the label's information icon. */
129
+ descriptionDisplay?: DescriptionDisplay;
130
+ /** @deprecated Use description instead. Kept for backwards compatibility. */
130
131
  helperText?: ReactNode;
131
- /** A string/node is displayed beneath the control; `true` uses a default message. */
132
+ /** A string/node is displayed beneath the control; true uses a default message. */
132
133
  error?: FieldError;
133
134
  errorMessage?: ReactNode;
135
+ };
136
+ type TextFieldBaseProps = FieldBaseProps & {
134
137
  clearable?: boolean;
135
138
  onClear?: () => void;
136
139
  onValueChange?: (value: string) => void;
137
140
  clearLabel?: string;
138
141
  };
139
- type TextInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'value' | 'defaultValue'> & TextFieldBaseProps & {
142
+
143
+ /** A text field with helper/error text and a Button-powered clear action. */
144
+ declare const TextInput: react.ForwardRefExoticComponent<Omit<react.InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "value" | "defaultValue"> & FieldBaseProps & {
145
+ clearable?: boolean;
146
+ onClear?: () => void;
147
+ onValueChange?: (value: string) => void;
148
+ clearLabel?: string;
149
+ } & {
140
150
  value?: string;
141
151
  defaultValue?: string;
142
- };
143
- type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'defaultValue'> & TextFieldBaseProps & {
152
+ prefix?: react.ReactNode;
153
+ suffix?: react.ReactNode;
154
+ Prefix?: react.ReactNode;
155
+ Suffix?: react.ReactNode;
156
+ } & react.RefAttributes<HTMLInputElement>>;
157
+
158
+ type TextInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'value' | 'defaultValue' | 'prefix'> & TextFieldBaseProps & {
144
159
  value?: string;
145
160
  defaultValue?: string;
161
+ /** Content rendered inside the control before the input value. */
162
+ prefix?: ReactNode;
163
+ /** Content rendered inside the control after the input value. */
164
+ suffix?: ReactNode;
165
+ /** Alias for prefix. */
166
+ Prefix?: ReactNode;
167
+ /** Alias for suffix. */
168
+ Suffix?: ReactNode;
146
169
  };
147
- /** A text field with helper/error text and a Button-powered clear action. */
148
- declare const TextInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "defaultValue"> & TextFieldBaseProps & {
149
- value?: string;
150
- defaultValue?: string;
151
- } & react.RefAttributes<HTMLInputElement>>;
170
+
152
171
  /** A multi-line text field with helper/error text and a Button-powered clear action. */
153
- declare const TextArea: react.ForwardRefExoticComponent<Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue"> & TextFieldBaseProps & {
172
+ declare const TextArea: react.ForwardRefExoticComponent<Omit<react.TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue"> & FieldBaseProps & {
173
+ clearable?: boolean;
174
+ onClear?: () => void;
175
+ onValueChange?: (value: string) => void;
176
+ clearLabel?: string;
177
+ } & {
154
178
  value?: string;
155
179
  defaultValue?: string;
156
180
  } & react.RefAttributes<HTMLTextAreaElement>>;
181
+
182
+ type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'defaultValue'> & TextFieldBaseProps & {
183
+ value?: string;
184
+ defaultValue?: string;
185
+ };
186
+
157
187
  type SelectionOption = {
158
188
  label: ReactNode;
159
189
  value: string | number;
@@ -163,8 +193,13 @@ type SelectionOption = {
163
193
  type SelectionValue = string | number | Array<string | number>;
164
194
  type SelectionProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'value' | 'onKeyDown'> & {
165
195
  label?: ReactNode;
196
+ /** Marks the field as required and displays a red asterisk. */
197
+ isRequired?: boolean;
198
+ description?: ReactNode;
199
+ descriptionDisplay?: DescriptionDisplay;
166
200
  helperText?: ReactNode;
167
- error?: boolean;
201
+ error?: FieldError;
202
+ errorMessage?: ReactNode;
168
203
  options: SelectionOption[];
169
204
  placeholder?: string;
170
205
  size?: 'small' | 'medium';
@@ -179,11 +214,16 @@ type SelectionProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'default
179
214
  name?: string;
180
215
  onKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
181
216
  };
217
+
182
218
  /** A rounded, searchable custom dropdown with single, multiple, and tag modes. */
183
- declare const Selection: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "value" | "defaultValue" | "onChange" | "onKeyDown"> & {
184
- label?: ReactNode;
185
- helperText?: ReactNode;
186
- error?: boolean;
219
+ declare const Selection: react.ForwardRefExoticComponent<Omit<react.HTMLAttributes<HTMLDivElement>, "value" | "defaultValue" | "onChange" | "onKeyDown"> & {
220
+ label?: react.ReactNode;
221
+ isRequired?: boolean;
222
+ description?: react.ReactNode;
223
+ descriptionDisplay?: DescriptionDisplay;
224
+ helperText?: react.ReactNode;
225
+ error?: FieldError;
226
+ errorMessage?: react.ReactNode;
187
227
  options: SelectionOption[];
188
228
  placeholder?: string;
189
229
  size?: "small" | "medium";
@@ -196,30 +236,25 @@ declare const Selection: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTM
196
236
  clearable?: boolean;
197
237
  disabled?: boolean;
198
238
  name?: string;
199
- onKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
239
+ onKeyDown?: react.KeyboardEventHandler<HTMLButtonElement>;
200
240
  } & react.RefAttributes<HTMLDivElement>>;
201
- type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max'> & {
241
+
242
+ declare function formatNumber(value: number, decimals?: number, thousandSeparator?: string, decimalSeparator?: string): string;
243
+ /** A text input that displays numbers as 1,000.05 by default. */
244
+ declare const NumberInput: react.ForwardRefExoticComponent<Omit<react.InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "max" | "min"> & {
202
245
  value?: number | null;
203
246
  defaultValue?: number | null;
204
247
  onValueChange?: (value: number | null) => void;
205
- /** Allows the decimal separator and fractional digits. Defaults to true. */
206
248
  allowDecimal?: boolean;
207
- /** Maximum number of fractional digits when allowDecimal is enabled. Defaults to 2. */
208
249
  decimals?: number;
209
- /** Numeric limits applied immediately as the value changes. */
210
250
  min?: number;
211
251
  max?: number;
212
252
  decimalSeparator?: string;
213
253
  thousandSeparator?: string;
214
- label?: ReactNode;
215
- helperText?: ReactNode;
216
- /** A string/node is displayed beneath the control; `true` uses a default message. */
217
- error?: FieldError;
218
- errorMessage?: ReactNode;
219
- };
220
- declare function formatNumber(value: number, decimals?: number, thousandSeparator?: string, decimalSeparator?: string): string;
221
- /** A text input that displays numbers as 1,000.05 by default. */
222
- declare const NumberInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "max" | "min"> & {
254
+ endAdornment?: react.ReactNode;
255
+ } & FieldBaseProps & react.RefAttributes<HTMLInputElement>>;
256
+
257
+ type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max'> & {
223
258
  value?: number | null;
224
259
  defaultValue?: number | null;
225
260
  onValueChange?: (value: number | null) => void;
@@ -232,29 +267,28 @@ declare const NumberInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttribu
232
267
  max?: number;
233
268
  decimalSeparator?: string;
234
269
  thousandSeparator?: string;
235
- label?: ReactNode;
236
- helperText?: ReactNode;
237
- /** A string/node is displayed beneath the control; `true` uses a default message. */
238
- error?: FieldError;
239
- errorMessage?: ReactNode;
240
- } & react.RefAttributes<HTMLInputElement>>;
270
+ /** Content rendered inside the control after the numeric value. */
271
+ endAdornment?: ReactNode;
272
+ } & FieldBaseProps;
273
+
241
274
  type Currency = {
242
275
  code: string;
243
276
  label?: string;
244
277
  suffix?: string;
245
278
  };
246
- type CurrencyInputProps = Omit<NumberInputProps, 'suffix'> & {
279
+ type CurrencyInputProps = Omit<NumberInputProps, 'suffix' | 'endAdornment'> & {
247
280
  suffix?: ReactNode;
248
281
  currencies?: Currency[];
249
282
  currency?: string;
250
283
  defaultCurrency?: string;
251
284
  onCurrencyChange?: (currency: Currency) => void;
252
285
  };
286
+
253
287
  /** NumberInput with an optional currency suffix or currency list dropdown. */
254
- declare function CurrencyInput({ suffix, currencies, currency, defaultCurrency, onCurrencyChange, className, ...props }: CurrencyInputProps): react.JSX.Element;
288
+ declare function CurrencyInput({ suffix, currencies, currency, defaultCurrency, onCurrencyChange, className, disabled, ...props }: CurrencyInputProps): react.JSX.Element;
289
+
255
290
  type DateRange = [Date | null, Date | null];
256
- type DateTimeBaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & {
257
- label?: ReactNode;
291
+ type DateTimeBaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & FieldBaseProps & {
258
292
  format?: string;
259
293
  disabled?: boolean;
260
294
  placeholder?: string;
@@ -273,6 +307,7 @@ type DateTimePickerRangeProps = DateTimeBaseProps & {
273
307
  onChange?: (value: DateRange) => void;
274
308
  };
275
309
  type DateTimePickerProps = DateTimePickerSingleProps | DateTimePickerRangeProps;
310
+
276
311
  /** Calendar and time picker. Supports a single Date or [start, end] range. */
277
312
  declare function DateTimePicker(props: DateTimePickerProps): react.JSX.Element;
278
313
 
@@ -478,4 +513,4 @@ type SnackbarProps = Omit<HTMLAttributes<HTMLDivElement>, 'onClose'> & {
478
513
  /** A controlled, temporary notification surface. */
479
514
  declare function Snackbar({ open, message, autoHideDuration, onClose, action, anchorOrigin, closeLabel, className, ...props }: SnackbarProps): react.JSX.Element | null;
480
515
 
481
- export { Button, type ButtonColor, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, ChevronDownIcon, Chip, type ChipProps, type ChipStatus, type ChipVariant, CloseIcon, type ColumnResizeHandler, type Currency, CurrencyInput, type CurrencyInputProps, type DateRange, DateTimePicker, type DateTimePickerProps, type DateTimePickerRangeProps, type DateTimePickerSingleProps, Drawer, type DrawerProps, ExpandableSection, type ExpandableSectionProps, type FieldError, type IconProps, Loading, type LoadingProps, type LoadingSize, Message, type MessageOptions, type MessageProps, type MessageSeverity, Modal, type ModalAction, type ModalProps, type ModalSize, NumberInput, type NumberInputProps, Pagination, type PaginationProps, PlusIcon, ProgressBar, type ProgressBarProps, type ProgressBarSize, SearchIcon, 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, Table, TableBody, TableCaption, TableCell, type TableData, TableHead, TableHeader, type TablePaginationPosition, type TableProps, TableRow, TextArea, type TextAreaProps, TextInput, type TextInputProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, formatNumber, getIconSize, message };
516
+ export { Button, type ButtonColor, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, Chip, type ChipProps, type ChipStatus, type ChipVariant, type ColumnResizeHandler, type Currency, CurrencyInput, type CurrencyInputProps, type DateRange, DateTimePicker, type DateTimePickerProps, type DateTimePickerRangeProps, type DateTimePickerSingleProps, type DescriptionDisplay, Drawer, type DrawerProps, ExpandableSection, type ExpandableSectionProps, type FieldError, Loading, type LoadingProps, type LoadingSize, Message, type MessageOptions, type MessageProps, type MessageSeverity, Modal, type ModalAction, type ModalProps, type ModalSize, NumberInput, type NumberInputProps, Pagination, type PaginationProps, ProgressBar, type ProgressBarProps, type ProgressBarSize, 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, Table, TableBody, TableCaption, TableCell, type TableData, TableHead, TableHeader, type TablePaginationPosition, type TableProps, TableRow, TextArea, type TextAreaProps, TextInput, type TextInputProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, formatNumber, getIconSize, message };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
- import { ButtonHTMLAttributes, ReactNode, SVGProps, TableHTMLAttributes, HTMLAttributes, InputHTMLAttributes, KeyboardEventHandler, TextareaHTMLAttributes, ReactElement } from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, TableHTMLAttributes, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, KeyboardEventHandler, ReactElement } from 'react';
3
+ export { ChevronDownIcon, CloseIcon, IconProps, 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
4
 
4
5
  type ButtonHierarchy = 'primary' | 'secondary-gray' | 'secondary-color' | 'tertiary-gray' | 'tertiary-color';
5
6
  type ButtonSize = '24' | '32' | '40';
@@ -43,14 +44,6 @@ declare const Button: react.ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<
43
44
  variant?: ButtonVariant;
44
45
  } & react.RefAttributes<HTMLButtonElement>>;
45
46
 
46
- type IconProps = SVGProps<SVGSVGElement> & {
47
- size?: number | string;
48
- };
49
- declare function PlusIcon(props: IconProps): react.JSX.Element;
50
- declare function ChevronDownIcon(props: IconProps): react.JSX.Element;
51
- declare function CloseIcon(props: IconProps): react.JSX.Element;
52
- declare function SearchIcon(props: IconProps): react.JSX.Element;
53
-
54
47
  type TableData = readonly (readonly ReactNode[])[];
55
48
  type ColumnResizeHandler = (columnSizes: number[], columnIndex: number) => void;
56
49
  type TablePaginationPosition = 'top-right' | 'bottom-right' | 'bottom-center' | 'middle-bottom';
@@ -125,35 +118,72 @@ type DrawerProps = Omit<HTMLAttributes<HTMLElement>, 'title'> & {
125
118
  declare function Drawer({ open, onClose, title, footer, side, width, fullScreen, children, closeOnBackdropClick, className, style, ...props }: DrawerProps): react.ReactPortal | null;
126
119
 
127
120
  type FieldError = boolean | ReactNode;
128
- type TextFieldBaseProps = {
121
+ type DescriptionDisplay = 'inline' | 'tooltip';
122
+ type FieldBaseProps = {
129
123
  label?: ReactNode;
124
+ /** Marks the field as required and displays a red asterisk. */
125
+ isRequired?: boolean;
126
+ /** Supporting text below the field. Takes precedence over helperText. */
127
+ description?: ReactNode;
128
+ /** Displays description below the field or from the label's information icon. */
129
+ descriptionDisplay?: DescriptionDisplay;
130
+ /** @deprecated Use description instead. Kept for backwards compatibility. */
130
131
  helperText?: ReactNode;
131
- /** A string/node is displayed beneath the control; `true` uses a default message. */
132
+ /** A string/node is displayed beneath the control; true uses a default message. */
132
133
  error?: FieldError;
133
134
  errorMessage?: ReactNode;
135
+ };
136
+ type TextFieldBaseProps = FieldBaseProps & {
134
137
  clearable?: boolean;
135
138
  onClear?: () => void;
136
139
  onValueChange?: (value: string) => void;
137
140
  clearLabel?: string;
138
141
  };
139
- type TextInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'value' | 'defaultValue'> & TextFieldBaseProps & {
142
+
143
+ /** A text field with helper/error text and a Button-powered clear action. */
144
+ declare const TextInput: react.ForwardRefExoticComponent<Omit<react.InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "value" | "defaultValue"> & FieldBaseProps & {
145
+ clearable?: boolean;
146
+ onClear?: () => void;
147
+ onValueChange?: (value: string) => void;
148
+ clearLabel?: string;
149
+ } & {
140
150
  value?: string;
141
151
  defaultValue?: string;
142
- };
143
- type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'defaultValue'> & TextFieldBaseProps & {
152
+ prefix?: react.ReactNode;
153
+ suffix?: react.ReactNode;
154
+ Prefix?: react.ReactNode;
155
+ Suffix?: react.ReactNode;
156
+ } & react.RefAttributes<HTMLInputElement>>;
157
+
158
+ type TextInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'value' | 'defaultValue' | 'prefix'> & TextFieldBaseProps & {
144
159
  value?: string;
145
160
  defaultValue?: string;
161
+ /** Content rendered inside the control before the input value. */
162
+ prefix?: ReactNode;
163
+ /** Content rendered inside the control after the input value. */
164
+ suffix?: ReactNode;
165
+ /** Alias for prefix. */
166
+ Prefix?: ReactNode;
167
+ /** Alias for suffix. */
168
+ Suffix?: ReactNode;
146
169
  };
147
- /** A text field with helper/error text and a Button-powered clear action. */
148
- declare const TextInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "defaultValue"> & TextFieldBaseProps & {
149
- value?: string;
150
- defaultValue?: string;
151
- } & react.RefAttributes<HTMLInputElement>>;
170
+
152
171
  /** A multi-line text field with helper/error text and a Button-powered clear action. */
153
- declare const TextArea: react.ForwardRefExoticComponent<Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue"> & TextFieldBaseProps & {
172
+ declare const TextArea: react.ForwardRefExoticComponent<Omit<react.TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue"> & FieldBaseProps & {
173
+ clearable?: boolean;
174
+ onClear?: () => void;
175
+ onValueChange?: (value: string) => void;
176
+ clearLabel?: string;
177
+ } & {
154
178
  value?: string;
155
179
  defaultValue?: string;
156
180
  } & react.RefAttributes<HTMLTextAreaElement>>;
181
+
182
+ type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'defaultValue'> & TextFieldBaseProps & {
183
+ value?: string;
184
+ defaultValue?: string;
185
+ };
186
+
157
187
  type SelectionOption = {
158
188
  label: ReactNode;
159
189
  value: string | number;
@@ -163,8 +193,13 @@ type SelectionOption = {
163
193
  type SelectionValue = string | number | Array<string | number>;
164
194
  type SelectionProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'value' | 'onKeyDown'> & {
165
195
  label?: ReactNode;
196
+ /** Marks the field as required and displays a red asterisk. */
197
+ isRequired?: boolean;
198
+ description?: ReactNode;
199
+ descriptionDisplay?: DescriptionDisplay;
166
200
  helperText?: ReactNode;
167
- error?: boolean;
201
+ error?: FieldError;
202
+ errorMessage?: ReactNode;
168
203
  options: SelectionOption[];
169
204
  placeholder?: string;
170
205
  size?: 'small' | 'medium';
@@ -179,11 +214,16 @@ type SelectionProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'default
179
214
  name?: string;
180
215
  onKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
181
216
  };
217
+
182
218
  /** A rounded, searchable custom dropdown with single, multiple, and tag modes. */
183
- declare const Selection: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "value" | "defaultValue" | "onChange" | "onKeyDown"> & {
184
- label?: ReactNode;
185
- helperText?: ReactNode;
186
- error?: boolean;
219
+ declare const Selection: react.ForwardRefExoticComponent<Omit<react.HTMLAttributes<HTMLDivElement>, "value" | "defaultValue" | "onChange" | "onKeyDown"> & {
220
+ label?: react.ReactNode;
221
+ isRequired?: boolean;
222
+ description?: react.ReactNode;
223
+ descriptionDisplay?: DescriptionDisplay;
224
+ helperText?: react.ReactNode;
225
+ error?: FieldError;
226
+ errorMessage?: react.ReactNode;
187
227
  options: SelectionOption[];
188
228
  placeholder?: string;
189
229
  size?: "small" | "medium";
@@ -196,30 +236,25 @@ declare const Selection: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTM
196
236
  clearable?: boolean;
197
237
  disabled?: boolean;
198
238
  name?: string;
199
- onKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
239
+ onKeyDown?: react.KeyboardEventHandler<HTMLButtonElement>;
200
240
  } & react.RefAttributes<HTMLDivElement>>;
201
- type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max'> & {
241
+
242
+ declare function formatNumber(value: number, decimals?: number, thousandSeparator?: string, decimalSeparator?: string): string;
243
+ /** A text input that displays numbers as 1,000.05 by default. */
244
+ declare const NumberInput: react.ForwardRefExoticComponent<Omit<react.InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "max" | "min"> & {
202
245
  value?: number | null;
203
246
  defaultValue?: number | null;
204
247
  onValueChange?: (value: number | null) => void;
205
- /** Allows the decimal separator and fractional digits. Defaults to true. */
206
248
  allowDecimal?: boolean;
207
- /** Maximum number of fractional digits when allowDecimal is enabled. Defaults to 2. */
208
249
  decimals?: number;
209
- /** Numeric limits applied immediately as the value changes. */
210
250
  min?: number;
211
251
  max?: number;
212
252
  decimalSeparator?: string;
213
253
  thousandSeparator?: string;
214
- label?: ReactNode;
215
- helperText?: ReactNode;
216
- /** A string/node is displayed beneath the control; `true` uses a default message. */
217
- error?: FieldError;
218
- errorMessage?: ReactNode;
219
- };
220
- declare function formatNumber(value: number, decimals?: number, thousandSeparator?: string, decimalSeparator?: string): string;
221
- /** A text input that displays numbers as 1,000.05 by default. */
222
- declare const NumberInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "max" | "min"> & {
254
+ endAdornment?: react.ReactNode;
255
+ } & FieldBaseProps & react.RefAttributes<HTMLInputElement>>;
256
+
257
+ type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max'> & {
223
258
  value?: number | null;
224
259
  defaultValue?: number | null;
225
260
  onValueChange?: (value: number | null) => void;
@@ -232,29 +267,28 @@ declare const NumberInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttribu
232
267
  max?: number;
233
268
  decimalSeparator?: string;
234
269
  thousandSeparator?: string;
235
- label?: ReactNode;
236
- helperText?: ReactNode;
237
- /** A string/node is displayed beneath the control; `true` uses a default message. */
238
- error?: FieldError;
239
- errorMessage?: ReactNode;
240
- } & react.RefAttributes<HTMLInputElement>>;
270
+ /** Content rendered inside the control after the numeric value. */
271
+ endAdornment?: ReactNode;
272
+ } & FieldBaseProps;
273
+
241
274
  type Currency = {
242
275
  code: string;
243
276
  label?: string;
244
277
  suffix?: string;
245
278
  };
246
- type CurrencyInputProps = Omit<NumberInputProps, 'suffix'> & {
279
+ type CurrencyInputProps = Omit<NumberInputProps, 'suffix' | 'endAdornment'> & {
247
280
  suffix?: ReactNode;
248
281
  currencies?: Currency[];
249
282
  currency?: string;
250
283
  defaultCurrency?: string;
251
284
  onCurrencyChange?: (currency: Currency) => void;
252
285
  };
286
+
253
287
  /** NumberInput with an optional currency suffix or currency list dropdown. */
254
- declare function CurrencyInput({ suffix, currencies, currency, defaultCurrency, onCurrencyChange, className, ...props }: CurrencyInputProps): react.JSX.Element;
288
+ declare function CurrencyInput({ suffix, currencies, currency, defaultCurrency, onCurrencyChange, className, disabled, ...props }: CurrencyInputProps): react.JSX.Element;
289
+
255
290
  type DateRange = [Date | null, Date | null];
256
- type DateTimeBaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & {
257
- label?: ReactNode;
291
+ type DateTimeBaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & FieldBaseProps & {
258
292
  format?: string;
259
293
  disabled?: boolean;
260
294
  placeholder?: string;
@@ -273,6 +307,7 @@ type DateTimePickerRangeProps = DateTimeBaseProps & {
273
307
  onChange?: (value: DateRange) => void;
274
308
  };
275
309
  type DateTimePickerProps = DateTimePickerSingleProps | DateTimePickerRangeProps;
310
+
276
311
  /** Calendar and time picker. Supports a single Date or [start, end] range. */
277
312
  declare function DateTimePicker(props: DateTimePickerProps): react.JSX.Element;
278
313
 
@@ -478,4 +513,4 @@ type SnackbarProps = Omit<HTMLAttributes<HTMLDivElement>, 'onClose'> & {
478
513
  /** A controlled, temporary notification surface. */
479
514
  declare function Snackbar({ open, message, autoHideDuration, onClose, action, anchorOrigin, closeLabel, className, ...props }: SnackbarProps): react.JSX.Element | null;
480
515
 
481
- export { Button, type ButtonColor, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, ChevronDownIcon, Chip, type ChipProps, type ChipStatus, type ChipVariant, CloseIcon, type ColumnResizeHandler, type Currency, CurrencyInput, type CurrencyInputProps, type DateRange, DateTimePicker, type DateTimePickerProps, type DateTimePickerRangeProps, type DateTimePickerSingleProps, Drawer, type DrawerProps, ExpandableSection, type ExpandableSectionProps, type FieldError, type IconProps, Loading, type LoadingProps, type LoadingSize, Message, type MessageOptions, type MessageProps, type MessageSeverity, Modal, type ModalAction, type ModalProps, type ModalSize, NumberInput, type NumberInputProps, Pagination, type PaginationProps, PlusIcon, ProgressBar, type ProgressBarProps, type ProgressBarSize, SearchIcon, 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, Table, TableBody, TableCaption, TableCell, type TableData, TableHead, TableHeader, type TablePaginationPosition, type TableProps, TableRow, TextArea, type TextAreaProps, TextInput, type TextInputProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, formatNumber, getIconSize, message };
516
+ export { Button, type ButtonColor, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, Chip, type ChipProps, type ChipStatus, type ChipVariant, type ColumnResizeHandler, type Currency, CurrencyInput, type CurrencyInputProps, type DateRange, DateTimePicker, type DateTimePickerProps, type DateTimePickerRangeProps, type DateTimePickerSingleProps, type DescriptionDisplay, Drawer, type DrawerProps, ExpandableSection, type ExpandableSectionProps, type FieldError, Loading, type LoadingProps, type LoadingSize, Message, type MessageOptions, type MessageProps, type MessageSeverity, Modal, type ModalAction, type ModalProps, type ModalSize, NumberInput, type NumberInputProps, Pagination, type PaginationProps, ProgressBar, type ProgressBarProps, type ProgressBarSize, 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, Table, TableBody, TableCaption, TableCell, type TableData, TableHead, TableHeader, type TablePaginationPosition, type TableProps, TableRow, TextArea, type TextAreaProps, TextInput, type TextInputProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, formatNumber, getIconSize, message };