@osrd-project/ui-core 0.0.83 → 0.0.85

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.
Files changed (59) hide show
  1. package/dist/index.d.ts +382 -20
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +2101 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/theme.css +1202 -983
  6. package/package.json +16 -16
  7. package/dist/components/Button.d.ts +0 -16
  8. package/dist/components/Checkbox/Checkbox.d.ts +0 -9
  9. package/dist/components/Checkbox/CheckboxList.d.ts +0 -12
  10. package/dist/components/Checkbox/CheckboxTree.d.ts +0 -11
  11. package/dist/components/Checkbox/__tests__/utils.spec.d.ts +0 -1
  12. package/dist/components/Checkbox/index.d.ts +0 -4
  13. package/dist/components/Checkbox/type.d.ts +0 -14
  14. package/dist/components/Checkbox/utils.d.ts +0 -15
  15. package/dist/components/ComboBox/ComboBox.d.ts +0 -34
  16. package/dist/components/ComboBox/index.d.ts +0 -2
  17. package/dist/components/ComboBox/useDefaultComboBox.d.ts +0 -6
  18. package/dist/components/DatePicker/Calendar.d.ts +0 -10
  19. package/dist/components/DatePicker/CalendarPicker.d.ts +0 -19
  20. package/dist/components/DatePicker/DatePicker.d.ts +0 -28
  21. package/dist/components/DatePicker/__tests__/useCalendar.spec.d.ts +0 -9
  22. package/dist/components/DatePicker/__tests__/useCalendarPicker.spec.d.ts +0 -1
  23. package/dist/components/DatePicker/__tests__/useDatePicker.spec.d.ts +0 -1
  24. package/dist/components/DatePicker/__tests__/utils.spec.d.ts +0 -1
  25. package/dist/components/DatePicker/index.d.ts +0 -2
  26. package/dist/components/DatePicker/type.d.ts +0 -4
  27. package/dist/components/DatePicker/useCalendar.d.ts +0 -7
  28. package/dist/components/DatePicker/useCalendarPicker.d.ts +0 -9
  29. package/dist/components/DatePicker/useDatePicker.d.ts +0 -18
  30. package/dist/components/DatePicker/utils.d.ts +0 -113
  31. package/dist/components/Dialog.d.ts +0 -22
  32. package/dist/components/FieldWrapper.d.ts +0 -22
  33. package/dist/components/Hint.d.ts +0 -6
  34. package/dist/components/Input.d.ts +0 -27
  35. package/dist/components/InputModal.d.ts +0 -10
  36. package/dist/components/InputStatusIcon.d.ts +0 -9
  37. package/dist/components/Label.d.ts +0 -11
  38. package/dist/components/PasswordInput.d.ts +0 -21
  39. package/dist/components/RadioButton.d.ts +0 -9
  40. package/dist/components/RadioGroup.d.ts +0 -17
  41. package/dist/components/SegmentedControl.d.ts +0 -12
  42. package/dist/components/Select.d.ts +0 -12
  43. package/dist/components/Slider.d.ts +0 -9
  44. package/dist/components/StatusMessage.d.ts +0 -17
  45. package/dist/components/Table/Table.d.ts +0 -15
  46. package/dist/components/Table/tableAmbientThemes.d.ts +0 -22
  47. package/dist/components/TextArea.d.ts +0 -5
  48. package/dist/components/TimePicker.d.ts +0 -16
  49. package/dist/components/TokenInput.d.ts +0 -7
  50. package/dist/components/TolerancePicker/TolerancePicker.d.ts +0 -14
  51. package/dist/components/TolerancePicker/ToleranceRangeGrid.d.ts +0 -8
  52. package/dist/components/TolerancePicker/consts.d.ts +0 -4
  53. package/dist/hooks/__tests__/useOutsideClick.spec.d.ts +0 -1
  54. package/dist/hooks/useFocusByTab.d.ts +0 -11
  55. package/dist/hooks/useModalPosition.d.ts +0 -7
  56. package/dist/hooks/useOutsideClick.d.ts +0 -2
  57. package/dist/index.esm.js +0 -1462
  58. package/dist/index.esm.js.map +0 -1
  59. package/dist/theme.css.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,20 +1,382 @@
1
- import './styles/main.css';
2
- export { default as Button, ButtonProps } from './components/Button';
3
- export { default as ComboBox, type ComboBoxProps, useDefaultComboBox } from './components/ComboBox';
4
- export { Checkbox, CheckboxList, CheckboxListProps, CheckboxProps, CheckboxesTree, CheckboxesTreeProps, CheckboxTreeItem, } from './components/Checkbox';
5
- export { DatePicker, type CalendarSlot, type DatePickerProps, type RangeDatePickerProps, type SingleDatePickerProps, } from './components/DatePicker';
6
- export { default as Input, InputProps } from './components/Input';
7
- export { default as PasswordInput, PasswordInputProps } from './components/PasswordInput';
8
- export { default as RadioButton, RadioButtonProps } from './components/RadioButton';
9
- export { default as RadioGroup, RadioGroupProps } from './components/RadioGroup';
10
- export { type StatusWithMessage } from './components/StatusMessage';
11
- export { default as Select, SelectProps } from './components/Select';
12
- export { default as TextArea, TextAreaProps } from './components/TextArea';
13
- export { default as TimePicker, type TimePickerProps } from './components/TimePicker';
14
- export { default as Slider, SliderProps } from './components/Slider';
15
- export { default as TolerancePicker, type TolerancePickerProps, type ToleranceValues, } from './components/TolerancePicker/TolerancePicker';
16
- export { default as TokenInput, TokenInputProps } from './components/TokenInput';
17
- export { default as Table } from './components/Table/Table';
18
- export { default as Dialog } from './components/Dialog';
19
- export { default as SegmentedControl, SegmentedControlProps } from './components/SegmentedControl';
20
- export { default as useOutsideClick } from './hooks/useOutsideClick';
1
+ import React$1, { ButtonHTMLAttributes, DialogHTMLAttributes, InputHTMLAttributes, KeyboardEvent, MouseEvent as MouseEvent$1, ReactNode } from "react";
2
+ type ButtonVariant = 'Normal' | 'Cancel' | 'Quiet' | 'Destructive' | 'Primary';
3
+ type ButtonSize = 'large' | 'medium' | 'small';
4
+ type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'> & {
5
+ label: string;
6
+ variant?: ButtonVariant;
7
+ isLoading?: boolean;
8
+ isDisabled?: boolean;
9
+ leadingIcon?: ReactNode;
10
+ counter?: number | null;
11
+ size?: ButtonSize;
12
+ dataTestID?: string;
13
+ onClick: () => void;
14
+ };
15
+ declare const Button: ({ label, variant, isLoading, isDisabled, leadingIcon, counter, size, onClick, dataTestID, ...btnAttrs }: ButtonProps) => React$1.JSX.Element;
16
+ type Status = 'success' | 'info' | 'error' | 'warning' | 'loading';
17
+ type TooltipType = 'left' | 'right';
18
+ type StatusWithMessage = {
19
+ tooltip?: TooltipType;
20
+ status: Status;
21
+ message?: string;
22
+ };
23
+ type FieldWrapperProps = {
24
+ id: string;
25
+ label?: string;
26
+ hint?: string;
27
+ required?: boolean;
28
+ disabled?: boolean;
29
+ statusWithMessage?: StatusWithMessage;
30
+ statusIconPosition?: 'next-to-field' | 'before-status-message';
31
+ /**
32
+ * Input without any wrapper padding.
33
+ * Should not be used with required or statusWithMessage with no tooltip.
34
+ */
35
+ narrow?: boolean;
36
+ small?: boolean;
37
+ children?: React$1.ReactNode;
38
+ className?: string;
39
+ onCloseStatusMessage?: () => void;
40
+ };
41
+ type InputAffixContent = string | React$1.ReactNode;
42
+ type InputAffixContentWithCallback = {
43
+ content: string | React$1.ReactNode;
44
+ onClickCallback: () => void;
45
+ };
46
+ type IconConfig = {
47
+ icon: React$1.ReactNode;
48
+ action: () => void;
49
+ className?: string;
50
+ testId?: string;
51
+ };
52
+ type InputProps = React$1.InputHTMLAttributes<HTMLInputElement> & Omit<FieldWrapperProps, 'children'> & {
53
+ leadingContent?: InputAffixContent | InputAffixContentWithCallback;
54
+ trailingContent?: InputAffixContent | InputAffixContentWithCallback;
55
+ inputFieldWrapperClassname?: string;
56
+ withIcons?: IconConfig[];
57
+ testIdPrefix?: string;
58
+ };
59
+ declare const Input: React$1.ForwardRefExoticComponent<React$1.InputHTMLAttributes<HTMLInputElement> & Omit<FieldWrapperProps, "children"> & {
60
+ leadingContent?: InputAffixContent | InputAffixContentWithCallback;
61
+ trailingContent?: InputAffixContent | InputAffixContentWithCallback;
62
+ inputFieldWrapperClassname?: string;
63
+ withIcons?: IconConfig[];
64
+ testIdPrefix?: string;
65
+ } & React$1.RefAttributes<HTMLInputElement>>;
66
+ type ComboBoxProps<T> = Omit<InputProps, 'value' | 'onChange'> & {
67
+ value?: T;
68
+ suggestions: Array<T>;
69
+ customLabel?: ReactNode;
70
+ numberOfSuggestionsToShow?: number;
71
+ getSuggestionLabel: (option: T) => string;
72
+ onSelectSuggestion: (option: T | undefined) => void;
73
+ resetSuggestions: () => void;
74
+ testIdPrefix?: string;
75
+ renderListElementComponent?: (params: {
76
+ suggestion: T;
77
+ index: number;
78
+ isActive: boolean;
79
+ isSelected: boolean;
80
+ }) => ReactNode;
81
+ renderFooterItem?: () => ReactNode;
82
+ onChange: (inputValue: string) => void;
83
+ allowCustomValue?: boolean;
84
+ onAddCustomValue?: (value: string) => void;
85
+ addCustomValueLabel?: string;
86
+ emptyValue?: T;
87
+ };
88
+ /**
89
+ * ComboBox component
90
+ *
91
+ * You can use the hook useDefaultComboBox to get the default behavior.
92
+ * See the stories.
93
+ *
94
+ * When `allowCustomValue` is true, an option appears at the bottom of the dropdown
95
+ * when the typed value doesn't match any existing suggestion.
96
+ * Defocusing without selecting cancels the input.
97
+ *
98
+ * When `emptyValue` is given (ex: a "None" option), it is displayed when there is no value,
99
+ * so the field is never left empty. The clear icon on a real value goes back to `emptyValue`.
100
+ */
101
+ declare const ComboBox: <T>({ suggestions, customLabel, numberOfSuggestionsToShow, value, small, getSuggestionLabel, onChange, onSelectSuggestion, resetSuggestions, testIdPrefix, renderListElementComponent, renderFooterItem, allowCustomValue, onAddCustomValue, addCustomValueLabel, emptyValue, ...inputProps }: ComboBoxProps<T>) => React$1.JSX.Element;
102
+ /**
103
+ * Create relevant props for a basic combo box with suggestions, ready to be spread in a `ComboBox`
104
+ * component. Suggestions are filtered and ordered using a very simple algorithm: options with
105
+ * a labels that starts with the query are shown first, and other options that contains the query
106
+ * follows, trimming spaces, accents and ignoring case.
107
+ *
108
+ * The second parameter, `getSuggestionLabel`, should be stable to prevent rerender and useless
109
+ * recomputations (see `useCallback`).
110
+ */
111
+ declare const useDefaultComboBox: <T>(suggestions: T[], getSuggestionLabel: (suggestion: T) => string) => {
112
+ suggestions: T[];
113
+ onChange: (newValue: string) => void;
114
+ resetSuggestions: () => void;
115
+ };
116
+ type CheckboxProps = React$1.PropsWithChildren<Omit<InputHTMLAttributes<HTMLInputElement>, 'children'> & {
117
+ label?: string;
118
+ small?: boolean;
119
+ hint?: string;
120
+ isIndeterminate?: boolean;
121
+ ref?: React$1.RefObject<HTMLInputElement | null>;
122
+ }>;
123
+ declare const Checkbox: ({ label, small, hint, disabled, checked, readOnly, isIndeterminate, onClick, children, ref, ...rest }: CheckboxProps) => React$1.JSX.Element;
124
+ type CheckboxTreeItem = {
125
+ id: number;
126
+ props: CheckboxProps;
127
+ items?: CheckboxTreeItem[];
128
+ };
129
+ type CheckboxListProps = {
130
+ items: CheckboxTreeItem[];
131
+ onClickItem: (e: React$1.MouseEvent<HTMLInputElement>, item: CheckboxTreeItem) => void;
132
+ small?: boolean;
133
+ label?: string;
134
+ readOnly?: boolean;
135
+ disabled?: boolean;
136
+ };
137
+ declare const CheckboxList: (checkBoxListprops: CheckboxListProps) => React$1.JSX.Element;
138
+ type CheckboxesTreeProps = Omit<FieldWrapperProps, 'children'> & {
139
+ readOnly?: boolean;
140
+ items: CheckboxTreeItem[];
141
+ onChange?: (newItems: CheckboxTreeItem[], item: CheckboxTreeItem) => void;
142
+ computeNewItemsTree?: (prevItemsTree: CheckboxTreeItem[], item: CheckboxTreeItem) => CheckboxTreeItem[];
143
+ };
144
+ declare const CheckboxesTree: ({ items, small, id, label, hint, statusWithMessage, disabled, required, readOnly, onChange, computeNewItemsTree }: CheckboxesTreeProps) => React$1.JSX.Element;
145
+ type CalendarSlot = {
146
+ start: Date | null;
147
+ end: Date | null;
148
+ };
149
+ type CalendarPickerPublicProps = {
150
+ initialDate?: Date;
151
+ numberOfMonths?: 1 | 2 | 3;
152
+ locale?: string;
153
+ };
154
+ type BaseDatePickerProps = {
155
+ selectableSlot?: CalendarSlot;
156
+ inputProps: InputProps;
157
+ calendarPickerProps?: CalendarPickerPublicProps;
158
+ errorMessages?: {
159
+ invalidInput?: string;
160
+ invalidDate?: string;
161
+ };
162
+ width?: number;
163
+ testIdPrefix?: string;
164
+ };
165
+ type SingleDatePickerProps = BaseDatePickerProps & {
166
+ isRangeMode?: false;
167
+ onDateChange: (nextDate?: Date) => void;
168
+ value?: Date;
169
+ };
170
+ type RangeDatePickerProps = BaseDatePickerProps & {
171
+ isRangeMode: true;
172
+ onDateChange: (clickedDate: Date, nextSelectedSlot?: CalendarSlot) => void;
173
+ value?: CalendarSlot;
174
+ };
175
+ type DatePickerProps = SingleDatePickerProps | RangeDatePickerProps;
176
+ export declare const DatePicker: (props: DatePickerProps) => React$1.JSX.Element;
177
+ type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & {
178
+ label?: string;
179
+ size?: 'xs' | 'sm' | 'md';
180
+ dataTestId?: string;
181
+ };
182
+ declare const Switch: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
183
+ label?: string;
184
+ size?: "xs" | "sm" | "md";
185
+ dataTestId?: string;
186
+ } & React$1.RefAttributes<HTMLInputElement>>;
187
+ type UnitConfig = {
188
+ key: string;
189
+ label: string;
190
+ msPerUnit: number;
191
+ digits?: number;
192
+ };
193
+ type Units = 'h' | 'm' | 's' | 'ms';
194
+ type UnitProps = Units | (Partial<UnitConfig> & Pick<UnitConfig, 'key'>) | (Partial<UnitConfig> & Pick<UnitConfig, 'label'>);
195
+ type DurationInputProps = {
196
+ id: string;
197
+ units: UnitProps[];
198
+ value: number;
199
+ padChar: string;
200
+ onChange?: (ms: number) => void;
201
+ max?: number;
202
+ small?: boolean;
203
+ hint?: string;
204
+ label?: string;
205
+ statusWithMessage?: FieldWrapperProps['statusWithMessage'];
206
+ dataTestId?: string;
207
+ } & Omit<React$1.ComponentPropsWithoutRef<'div'>, 'onChange'>;
208
+ /**
209
+ * Duration units can be set up via their shorthand strings (h, m, s, ms)
210
+ * or more precisely through objects.
211
+ * The value of the component is a number representing the milliseconds of the duration.
212
+ */
213
+ export declare const DurationInput: ({ id, units, value, onChange, padChar, small, max, label, hint, statusWithMessage, dataTestId, ...rest }: DurationInputProps) => React$1.JSX.Element;
214
+ type PasswordInputProps = InputProps;
215
+ declare const PasswordInput: React$1.ForwardRefExoticComponent<React$1.InputHTMLAttributes<HTMLInputElement> & Omit<FieldWrapperProps, "children"> & {
216
+ leadingContent?: React$1.ReactNode | {
217
+ content: string | React$1.ReactNode;
218
+ onClickCallback: () => void;
219
+ };
220
+ trailingContent?: React$1.ReactNode | {
221
+ content: string | React$1.ReactNode;
222
+ onClickCallback: () => void;
223
+ };
224
+ inputFieldWrapperClassname?: string;
225
+ withIcons?: {
226
+ icon: React$1.ReactNode;
227
+ action: () => void;
228
+ className?: string;
229
+ testId?: string;
230
+ }[];
231
+ testIdPrefix?: string;
232
+ } & React$1.RefAttributes<HTMLInputElement>>;
233
+ type RadioButtonProps = React$1.PropsWithChildren<Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'children'> & {
234
+ label: string;
235
+ value: string;
236
+ hint?: string;
237
+ small?: boolean;
238
+ ref?: React$1.RefObject<HTMLInputElement | null>;
239
+ }>;
240
+ declare const RadioButton: ({ id, label, value, hint, readOnly, onClick, small, children, ref, ...rest }: RadioButtonProps) => React$1.JSX.Element;
241
+ type RadioGroupProps = {
242
+ label?: string;
243
+ subtitle?: string;
244
+ readOnly?: boolean;
245
+ disabled?: boolean;
246
+ required?: boolean;
247
+ small?: boolean;
248
+ value?: string;
249
+ options: RadioButtonProps[];
250
+ statusWithMessage?: StatusWithMessage;
251
+ onChange?: (value: string) => void;
252
+ };
253
+ declare const RadioGroup: ({ label, value, subtitle, readOnly, disabled, options, statusWithMessage, required, small, onChange }: RadioGroupProps) => React$1.JSX.Element;
254
+ type SelectProps<T> = Omit<React$1.InputHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange'> & Omit<FieldWrapperProps, 'children'> & {
255
+ options: Array<T>;
256
+ value?: T;
257
+ dataTestId?: string;
258
+ getOptionLabel: (option: T) => string;
259
+ getOptionValue: (option: T) => string;
260
+ onChange: (option?: T) => void;
261
+ };
262
+ declare const Select: <T>({ id, label, hint, value, options, placeholder, statusWithMessage, required, disabled, narrow, readOnly, small, getOptionLabel, getOptionValue, onChange, dataTestId, ...props }: SelectProps<T>) => React$1.JSX.Element;
263
+ type TextAreaProps = React$1.InputHTMLAttributes<HTMLTextAreaElement> & Omit<FieldWrapperProps, 'children'>;
264
+ declare const TextArea: ({ id, label, value, hint, required, disabled, statusWithMessage, maxLength, onChange, onKeyUp, onBlur, ...rest }: TextAreaProps) => React$1.JSX.Element;
265
+ type TimePickerProps = Omit<InputProps, 'type' | 'name' | 'value' | 'onClick' | 'onChange' | 'ref' | 'step'> & {
266
+ hours?: number;
267
+ minutes?: number;
268
+ seconds?: number;
269
+ displaySeconds?: boolean;
270
+ onTimeChange: ({ hours, minutes, seconds }: {
271
+ hours: number;
272
+ minutes: number;
273
+ seconds?: number;
274
+ }) => void;
275
+ testIdPrefix?: string;
276
+ };
277
+ declare const TimePicker: ({ onTimeChange, hours, minutes, seconds, displaySeconds, testIdPrefix, ...otherProps }: TimePickerProps) => React$1.JSX.Element;
278
+ type SliderProps = InputHTMLAttributes<HTMLInputElement> & {
279
+ width?: number;
280
+ onChangeCommitted?: (e: MouseEvent$1<HTMLInputElement> | KeyboardEvent<HTMLInputElement>) => void;
281
+ containerClassName?: string;
282
+ };
283
+ declare const Slider: ({ id, value: initialValue, min, max, step, width, onChange, onChangeCommitted, disabled, className, containerClassName, ...rest }: SliderProps) => React$1.JSX.Element;
284
+ type ToleranceValues = {
285
+ minusTolerance: number;
286
+ plusTolerance: number;
287
+ };
288
+ type TolerancePickerProps = Omit<InputProps, 'value'> & {
289
+ onToleranceChange: (toleranceValues: ToleranceValues) => void;
290
+ toleranceValues?: ToleranceValues;
291
+ translateWarningMessage?: (invalidTolerance: number) => string;
292
+ testIdPrefix?: string;
293
+ };
294
+ declare const TolerancePicker: ({ onToleranceChange, toleranceValues: { minusTolerance, plusTolerance }, translateWarningMessage, testIdPrefix, ...inputProps }: TolerancePickerProps) => React$1.JSX.Element;
295
+ type TokenInputProps = {
296
+ label: string;
297
+ tokens: string[];
298
+ small?: boolean;
299
+ onChange?: (tokens: string[]) => void;
300
+ onBlur?: () => void;
301
+ className?: string;
302
+ dataTestId?: string;
303
+ autoFocus?: boolean;
304
+ };
305
+ declare const TokenInput: ({ label, tokens: initialTokens, small, onChange, onBlur, className, dataTestId, autoFocus }: TokenInputProps) => React$1.JSX.Element;
306
+ type AmbientVariant = 'A' | 'B' | 'C' | 'D';
307
+ declare const colors: {
308
+ ambientA5: string;
309
+ ambientA10: string;
310
+ ambientA15: string;
311
+ ambientB5: string;
312
+ ambientB10: string;
313
+ ambientB15: string;
314
+ ambientC5: string;
315
+ ambientC10: string;
316
+ ambientC15: string;
317
+ ambientD5: string;
318
+ ambientD10: string;
319
+ ambientD15: string;
320
+ blackAlpha: string;
321
+ };
322
+ interface TableColumn {
323
+ key: string;
324
+ label: string;
325
+ className?: string;
326
+ }
327
+ type TableValue = string | number | boolean | null | undefined;
328
+ interface TableProps {
329
+ columns: Array<TableColumn>;
330
+ data: Array<Record<string, TableValue>>;
331
+ ambientVariant?: AmbientVariant;
332
+ }
333
+ declare const Table: ({ columns, data, ambientVariant }: TableProps) => React$1.JSX.Element;
334
+ type ModalProps = DialogHTMLAttributes<HTMLDialogElement> & {
335
+ fullscreen?: boolean;
336
+ headerClassname?: string;
337
+ bodyClassname?: string;
338
+ footerClassname?: string;
339
+ header: React$1.ReactNode;
340
+ footer: React$1.ReactNode;
341
+ };
342
+ /**
343
+ * Display a styled dialog box.
344
+ * You are in charge of its lifecycle (open & close), this componant just display it.
345
+ *
346
+ * Children must be an array of 3 items, where :
347
+ * - the first one is for the header
348
+ * - the second one is for the content
349
+ * - the last is for the footer
350
+ *
351
+ * NB: Inside header, only title tags have the good style (font weight and size)
352
+ */
353
+ declare const Dialog: ({ children, className, fullscreen, header, headerClassname, footer, footerClassname, bodyClassname, ...dialogProps }: ModalProps) => React$1.JSX.Element;
354
+ type OptionGroupItem<T> = {
355
+ value: T;
356
+ label: string;
357
+ };
358
+ type OptionGroupSection<T> = {
359
+ title: string;
360
+ items: OptionGroupItem<T>[];
361
+ icon?: ReactNode;
362
+ };
363
+ type OptionGroupProps<T> = {
364
+ sections: OptionGroupSection<T>[];
365
+ selectedValue?: T;
366
+ onSelect: (value: T) => void;
367
+ getItemKey: (value: T) => string;
368
+ };
369
+ declare const OptionGroup: <T>({ sections, selectedValue, onSelect, getItemKey }: OptionGroupProps<T>) => React$1.JSX.Element;
370
+ type SegmentedControlProps<T> = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'checked'> & {
371
+ options: Array<T>;
372
+ onChange: (option: T) => void;
373
+ value: T;
374
+ getOptionLabel: (option: T) => string;
375
+ getOptionValue: (option: T) => string;
376
+ getOptionIcon?: (option: T) => React$1.ReactNode;
377
+ small?: boolean;
378
+ };
379
+ declare const SegmentedControl: <T>({ options, onChange, value, getOptionLabel, getOptionValue, getOptionIcon, small, ...inputProps }: SegmentedControlProps<T>) => React$1.JSX.Element;
380
+ declare const useOutsideClick: (ref: React.RefObject<HTMLElement | null> | null, handler: (event: MouseEvent) => void) => void;
381
+ export { colors as AMBIENT_COLORS, Button, type ButtonProps, type CalendarSlot, Checkbox, CheckboxList, type CheckboxListProps, type CheckboxProps, type CheckboxTreeItem, CheckboxesTree, type CheckboxesTreeProps, ComboBox, type ComboBoxProps, type DatePickerProps, Dialog, type DurationInputProps, Input, type InputProps, OptionGroup, type OptionGroupItem, type OptionGroupProps, type OptionGroupSection, PasswordInput, type PasswordInputProps, RadioButton, type RadioButtonProps, RadioGroup, type RadioGroupProps, type RangeDatePickerProps, SegmentedControl, type SegmentedControlProps, Select, type SelectProps, type SingleDatePickerProps, Slider, type SliderProps, type StatusWithMessage, Switch, type SwitchProps, Table, TextArea, type TextAreaProps, TimePicker, type TimePickerProps, TokenInput, type TokenInputProps, TolerancePicker, type TolerancePickerProps, type ToleranceValues, useDefaultComboBox, useOutsideClick };
382
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":["React","React","React","React","React","React","React","React","React","React","React","_$__FieldWrapper0.FieldWrapperProps","React","React","React","React","React","MouseEvent","React","React","React","React","React","React","React"],"sources":["../src/components/Button.tsx","../src/components/StatusMessage.tsx","../src/components/FieldWrapper.tsx","../src/components/Input.tsx","../src/components/ComboBox/ComboBox.tsx","../src/components/ComboBox/useDefaultComboBox.ts","../src/components/Checkbox/Checkbox.tsx","../src/components/Checkbox/type.ts","../src/components/Checkbox/CheckboxList.tsx","../src/components/Checkbox/CheckboxTree.tsx","../src/components/DatePicker/type.ts","../src/components/DatePicker/CalendarPicker.tsx","../src/components/DatePicker/DatePicker.tsx","../src/components/Switch.tsx","../src/components/DurationInput/DurationInput.tsx","../src/components/PasswordInput.tsx","../src/components/RadioButton.tsx","../src/components/RadioGroup.tsx","../src/components/Select.tsx","../src/components/TextArea.tsx","../src/components/TimePicker.tsx","../src/components/Slider.tsx","../src/components/TolerancePicker/TolerancePicker.tsx","../src/components/TokenInput.tsx","../src/components/Table/tableAmbientThemes.ts","../src/components/Table/Table.tsx","../src/components/Dialog.tsx","../src/components/OptionGroup.tsx","../src/components/SegmentedControl.tsx","../src/hooks/useOutsideClick.tsx"],"mappings":";KAIK;KACA;KAEO,cAAc,KAAK,qBAAqB;EAClD;EACA,UAAU;EACV;EACA;EACA,cAAc;EACd;EACA,OAAO;EACP;EACA;;cAGI,WAAU,OAAA,SAAA,WAAA,YAAA,aAAA,SAAA,MAAA,SAAA,eAAA,YAWb,gBAAWA,QAAA,IAAA;KCvBF;KACA;KAEA;EACV,UAAU;EACV,QAAQ;EACR;;KCJU;EACV;EACA;EACA;EACA;EACA;EACA,oBAAoB;EACpB;;;;;EAKA;EACA;EACA,WAAWC,QAAM;EACjB;EACA;;KCSG,6BAA6BC,QAAM;KAEnC;EACH,kBAAkBA,QAAM;EACxB;;KAGG;EACH,MAAMA,QAAM;EACZ;EACA;EACA;;KAGU,aAAaA,QAAM,oBAAoB,oBACjD,KAAK;EACH,iBAAiB,oBAAoB;EACrC,kBAAkB,oBAAoB;EACtC;EACA,YAAY;EACZ;;cAKE,OAAKA,QAA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