@osrd-project/ui-core 0.0.76 → 0.0.79
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/components/Modal.d.ts +3 -2
- package/dist/components/buttons/Button.d.ts +2 -1
- package/dist/components/inputs/ComboBox/ComboBox.d.ts +2 -1
- package/dist/components/inputs/Input.d.ts +2 -0
- package/dist/components/inputs/PasswordInput.d.ts +1 -0
- package/dist/components/inputs/RadioGroup.d.ts +2 -1
- package/dist/components/inputs/StatusMessage.d.ts +2 -1
- package/dist/components/inputs/TimePicker.d.ts +2 -1
- package/dist/components/inputs/datePicker/CalendarPicker.d.ts +1 -1
- package/dist/components/inputs/datePicker/DatePicker.d.ts +2 -1
- package/dist/components/inputs/datePicker/useCalendar.d.ts +1 -1
- package/dist/components/inputs/datePicker/useDatePicker.d.ts +2 -2
- package/dist/components/inputs/tolerancePicker/TolerancePicker.d.ts +2 -1
- package/dist/hooks/useModalPosition.d.ts +1 -1
- package/dist/hooks/useOutsideClick.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.esm.js +101 -80
- package/dist/index.esm.js.map +1 -1
- package/dist/theme.css +1314 -1597
- package/dist/theme.css.map +1 -1
- package/package.json +13 -13
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type ModalProps = {
|
|
3
|
-
inputRef: React.RefObject<HTMLInputElement>;
|
|
3
|
+
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
+
testIdPrefix?: string;
|
|
7
8
|
};
|
|
8
|
-
declare const InputModal: ({ inputRef, isOpen, onClose, children }: ModalProps) => React.JSX.Element | null;
|
|
9
|
+
declare const InputModal: ({ inputRef, isOpen, onClose, children, testIdPrefix }: ModalProps) => React.JSX.Element | null;
|
|
9
10
|
export default InputModal;
|
|
@@ -9,7 +9,8 @@ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick
|
|
|
9
9
|
leadingIcon?: ReactNode;
|
|
10
10
|
counter?: number | null;
|
|
11
11
|
size?: ButtonSize;
|
|
12
|
+
dataTestID?: string;
|
|
12
13
|
onClick: () => void;
|
|
13
14
|
};
|
|
14
|
-
declare const Button: ({ label, variant, isLoading, isDisabled, leadingIcon, counter, size, onClick, ...btnAttrs }: ButtonProps) => React.JSX.Element;
|
|
15
|
+
declare const Button: ({ label, variant, isLoading, isDisabled, leadingIcon, counter, size, onClick, dataTestID, ...btnAttrs }: ButtonProps) => React.JSX.Element;
|
|
15
16
|
export default Button;
|
|
@@ -8,6 +8,7 @@ export type ComboBoxProps<T> = Omit<InputProps, 'value'> & {
|
|
|
8
8
|
getSuggestionLabel: (option: T) => string;
|
|
9
9
|
onSelectSuggestion: (option: T | undefined) => void;
|
|
10
10
|
resetSuggestions: () => void;
|
|
11
|
+
testIdPrefix?: string;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* ComboBox component
|
|
@@ -15,5 +16,5 @@ export type ComboBoxProps<T> = Omit<InputProps, 'value'> & {
|
|
|
15
16
|
* You can use the hook useDefaultComboBox to get the default behavior.
|
|
16
17
|
* See the stories.
|
|
17
18
|
*/
|
|
18
|
-
declare const ComboBox: <T>({ suggestions, customLabel, numberOfSuggestionsToShow, value, small, getSuggestionLabel, onChange, onSelectSuggestion, resetSuggestions, ...inputProps }: ComboBoxProps<T>) => React.JSX.Element;
|
|
19
|
+
declare const ComboBox: <T>({ suggestions, customLabel, numberOfSuggestionsToShow, value, small, getSuggestionLabel, onChange, onSelectSuggestion, resetSuggestions, testIdPrefix, ...inputProps }: ComboBoxProps<T>) => React.JSX.Element;
|
|
19
20
|
export default ComboBox;
|
|
@@ -15,11 +15,13 @@ export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & Omit<Fiel
|
|
|
15
15
|
trailingContent?: InputAffixContent | InputAffixContentWithCallback;
|
|
16
16
|
inputFieldWrapperClassname?: string;
|
|
17
17
|
withIcons?: IconConfig[];
|
|
18
|
+
testIdPrefix?: string;
|
|
18
19
|
};
|
|
19
20
|
declare const Input: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & Omit<FieldWrapperProps, "children"> & {
|
|
20
21
|
leadingContent?: InputAffixContent | InputAffixContentWithCallback;
|
|
21
22
|
trailingContent?: InputAffixContent | InputAffixContentWithCallback;
|
|
22
23
|
inputFieldWrapperClassname?: string;
|
|
23
24
|
withIcons?: IconConfig[];
|
|
25
|
+
testIdPrefix?: string;
|
|
24
26
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
25
27
|
export default Input;
|
|
@@ -11,6 +11,7 @@ export type RadioGroupProps = {
|
|
|
11
11
|
value?: string;
|
|
12
12
|
options: RadioButtonProps[];
|
|
13
13
|
statusWithMessage?: StatusWithMessage;
|
|
14
|
+
onChange?: (value: string) => void;
|
|
14
15
|
};
|
|
15
|
-
declare const RadioGroup: ({ label, value, subtitle, readOnly, disabled, options, statusWithMessage, required, small, }: RadioGroupProps) => React.JSX.Element;
|
|
16
|
+
declare const RadioGroup: ({ label, value, subtitle, readOnly, disabled, options, statusWithMessage, required, small, onChange, }: RadioGroupProps) => React.JSX.Element;
|
|
16
17
|
export default RadioGroup;
|
|
@@ -11,6 +11,7 @@ export type StatusMessageProps = {
|
|
|
11
11
|
showIcon?: boolean;
|
|
12
12
|
small?: boolean;
|
|
13
13
|
onClose?: () => void;
|
|
14
|
+
testIdPrefix?: string;
|
|
14
15
|
};
|
|
15
|
-
declare const StatusMessage: ({ statusWithMessage, showIcon, small, onClose }: StatusMessageProps) => React.JSX.Element | null;
|
|
16
|
+
declare const StatusMessage: ({ statusWithMessage, showIcon, small, onClose, testIdPrefix, }: StatusMessageProps) => React.JSX.Element | null;
|
|
16
17
|
export default StatusMessage;
|
|
@@ -10,6 +10,7 @@ export type TimePickerProps = Omit<InputProps, 'type' | 'name' | 'value' | 'onCl
|
|
|
10
10
|
minutes: number;
|
|
11
11
|
seconds?: number;
|
|
12
12
|
}) => void;
|
|
13
|
+
testIdPrefix?: string;
|
|
13
14
|
};
|
|
14
|
-
declare const TimePicker: ({ onTimeChange, hours, minutes, seconds, displaySeconds, ...otherProps }: TimePickerProps) => React.JSX.Element;
|
|
15
|
+
declare const TimePicker: ({ onTimeChange, hours, minutes, seconds, displaySeconds, testIdPrefix, ...otherProps }: TimePickerProps) => React.JSX.Element;
|
|
15
16
|
export default TimePicker;
|
|
@@ -7,7 +7,7 @@ export type CalendarPickerPrivateProps = {
|
|
|
7
7
|
top: number;
|
|
8
8
|
left: number;
|
|
9
9
|
};
|
|
10
|
-
calendarPickerRef: React.RefObject<HTMLDivElement>;
|
|
10
|
+
calendarPickerRef: React.RefObject<HTMLDivElement | null>;
|
|
11
11
|
selectableSlot?: CalendarSlot;
|
|
12
12
|
};
|
|
13
13
|
export type CalendarPickerPublicProps = {
|
|
@@ -11,10 +11,11 @@ type BaseDatePickerProps = {
|
|
|
11
11
|
invalidDate?: string;
|
|
12
12
|
};
|
|
13
13
|
width?: number;
|
|
14
|
+
testIdPrefix?: string;
|
|
14
15
|
};
|
|
15
16
|
export type SingleDatePickerProps = BaseDatePickerProps & {
|
|
16
17
|
isRangeMode?: false;
|
|
17
|
-
onDateChange: (nextDate
|
|
18
|
+
onDateChange: (nextDate?: Date) => void;
|
|
18
19
|
value?: Date;
|
|
19
20
|
};
|
|
20
21
|
export type RangeDatePickerProps = BaseDatePickerProps & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CalendarProps } from './Calendar';
|
|
2
2
|
export default function useCalendar({ displayedMonthStartDate, selectableSlot, selectedSlot, }: CalendarProps): {
|
|
3
3
|
days: Date[];
|
|
4
|
-
|
|
4
|
+
isToday: (date: Date) => boolean;
|
|
5
5
|
buildDayWrapperClassName: (date: Date) => string;
|
|
6
6
|
isDateSelectable: (date: Date) => boolean;
|
|
7
7
|
};
|
|
@@ -9,8 +9,8 @@ export default function useDatePicker(datePickerProps: DatePickerProps): {
|
|
|
9
9
|
top: number;
|
|
10
10
|
left: number;
|
|
11
11
|
};
|
|
12
|
-
inputRef: import("react").RefObject<HTMLInputElement>;
|
|
13
|
-
calendarPickerRef: import("react").RefObject<HTMLDivElement>;
|
|
12
|
+
inputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
13
|
+
calendarPickerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
14
14
|
setShowPicker: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
15
15
|
handleDayClick: (clickedDate: Date) => void;
|
|
16
16
|
handleInputClick: () => void;
|
|
@@ -8,6 +8,7 @@ export type TolerancePickerProps = Omit<InputProps, 'value'> & {
|
|
|
8
8
|
onToleranceChange: (toleranceValues: ToleranceValues) => void;
|
|
9
9
|
toleranceValues?: ToleranceValues;
|
|
10
10
|
translateWarningMessage?: (invalidTolerance: number) => string;
|
|
11
|
+
testIdPrefix?: string;
|
|
11
12
|
};
|
|
12
|
-
declare const TolerancePicker: ({ onToleranceChange, toleranceValues: { minusTolerance, plusTolerance }, translateWarningMessage, ...inputProps }: TolerancePickerProps) => React.JSX.Element;
|
|
13
|
+
declare const TolerancePicker: ({ onToleranceChange, toleranceValues: { minusTolerance, plusTolerance }, translateWarningMessage, testIdPrefix, ...inputProps }: TolerancePickerProps) => React.JSX.Element;
|
|
13
14
|
export default TolerancePicker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useModalPosition: (inputRef: React.RefObject<HTMLInputElement>, modalRef: React.RefObject<HTMLDivElement>, offset?: number) => {
|
|
1
|
+
export declare const useModalPosition: (inputRef: React.RefObject<HTMLInputElement | null>, modalRef: React.RefObject<HTMLDivElement | null>, offset?: number) => {
|
|
2
2
|
modalPosition: {
|
|
3
3
|
top: number;
|
|
4
4
|
left: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useOutsideClick: (ref: React.RefObject<HTMLElement>, handler: (event: MouseEvent) => void) => void;
|
|
1
|
+
declare const useOutsideClick: (ref: React.RefObject<HTMLElement | null>, handler: (event: MouseEvent) => void) => void;
|
|
2
2
|
export default useOutsideClick;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import './styles/main.css';
|
|
2
2
|
export { default as Button, ButtonProps } from './components/buttons/Button';
|
|
3
3
|
export { default as ComboBox, type ComboBoxProps, useDefaultComboBox, } from './components/inputs/ComboBox';
|
|
4
|
-
export { Checkbox, CheckboxList, CheckboxListProps, CheckboxProps, CheckboxesTree, CheckboxesTreeProps, } from './components/inputs/Checkbox';
|
|
4
|
+
export { Checkbox, CheckboxList, CheckboxListProps, CheckboxProps, CheckboxesTree, CheckboxesTreeProps, CheckboxTreeItem, } from './components/inputs/Checkbox';
|
|
5
5
|
export { DatePicker, type CalendarSlot, type DatePickerProps, type RangeDatePickerProps, type SingleDatePickerProps, } from './components/inputs/datePicker';
|
|
6
6
|
export { default as Input, InputProps } from './components/inputs/Input';
|
|
7
7
|
export { default as PasswordInput, PasswordInputProps } from './components/inputs/PasswordInput';
|
|
8
8
|
export { default as RadioButton, RadioButtonProps } from './components/inputs/RadioButton';
|
|
9
9
|
export { default as RadioGroup, RadioGroupProps } from './components/inputs/RadioGroup';
|
|
10
|
+
export { type StatusWithMessage } from './components/inputs/StatusMessage';
|
|
10
11
|
export { default as Select, SelectProps } from './components/Select';
|
|
11
12
|
export { default as TextArea, TextAreaProps } from './components/inputs/TextArea';
|
|
12
|
-
export { default as TimePicker } from './components/inputs/TimePicker';
|
|
13
|
-
export { default as Slider } from './components/inputs/Slider';
|
|
14
|
-
export { default as TolerancePicker, type TolerancePickerProps, } from './components/inputs/tolerancePicker/TolerancePicker';
|
|
13
|
+
export { default as TimePicker, type TimePickerProps } from './components/inputs/TimePicker';
|
|
14
|
+
export { default as Slider, SliderProps } from './components/inputs/Slider';
|
|
15
|
+
export { default as TolerancePicker, type TolerancePickerProps, type ToleranceValues, } from './components/inputs/tolerancePicker/TolerancePicker';
|
|
15
16
|
export { default as TokenInput, TokenInputProps } from './components/inputs/TokenInput';
|