Skip to content

Commit

Permalink
Merge pull request #828 from vrk-kpa/hotfix/typing-overlap
Browse files Browse the repository at this point in the history
[Hotfix] Typing in callback function props
  • Loading branch information
LJKaski authored Feb 16, 2024
2 parents 4ca7b72 + 33b86ca commit bc3a9fa
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 102 deletions.
110 changes: 18 additions & 92 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suomifi-ui-components",
"version": "13.0.0",
"version": "13.0.1",
"description": "Suomi.fi UI component library",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/core/Form/DateInput/DateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export interface DateInputProps
extends DatePickerProps,
MarginProps,
StatusTextCommonProps,
Omit<HtmlInputProps, 'type' | 'onChange'> {
Omit<HtmlInputProps, 'type' | 'onChange' | 'onClick' | 'onBlur'> {
/** DateInput container div class name for custom styling. */
className?: string;
/** Disable input usage */
Expand Down
4 changes: 3 additions & 1 deletion src/core/Form/RadioButton/RadioButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const radioButtonClassNames = {
checked: `${baseClassName}--checked`,
};

export interface RadioButtonProps extends MarginProps, HtmlInputProps {
export interface RadioButtonProps
extends MarginProps,
Omit<HtmlInputProps, 'onChange'> {
/** CSS class for custom styles */
className?: string;
/** RadioButton text content (label) */
Expand Down
2 changes: 2 additions & 0 deletions src/core/Form/SearchInput/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export interface SearchInputProps
| 'type'
| 'disabled'
| 'onChange'
| 'onBlur'
| 'onSearch'
| 'children'
| 'onClick'
| 'value'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export type MultiSelectProps<T> = InternalMultiSelectProps<
AriaOptionChipRemovedProps &
AriaSelectedAmountProps &
MarginProps &
HtmlDivProps &
Omit<HtmlDivProps, 'onChange' | 'onBlur'> &
LoadingProps;

interface MultiSelectState<T extends MultiSelectData> {
Expand Down
2 changes: 1 addition & 1 deletion src/core/Form/Select/SingleSelect/SingleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ type AllowItemAdditionProps =
export type SingleSelectProps<T> = InternalSingleSelectProps<
T & SingleSelectData
> &
HtmlDivProps &
Omit<HtmlDivProps, 'onChange' | 'onBlur'> &
AllowItemAdditionProps &
AriaOptionsAvailableProps &
MarginProps &
Expand Down
2 changes: 1 addition & 1 deletion src/core/Form/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type TextInputValue = string | number | undefined;
interface BaseTextInputProps
extends StatusTextCommonProps,
MarginProps,
Omit<HtmlInputProps, 'type' | 'onChange'> {
Omit<HtmlInputProps, 'type' | 'onChange' | 'onClick' | 'onBlur'> {
/** CSS class for custom styles */
className?: string;
/** Disables the input */
Expand Down
5 changes: 4 additions & 1 deletion src/core/Form/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ type TextareaStatus = Exclude<InputStatus, 'success'>;
interface BaseTextareaProps
extends StatusTextCommonProps,
MarginProps,
Omit<HtmlTextareaProps, 'placeholder' | 'forwardedRef'> {
Omit<
HtmlTextareaProps,
'placeholder' | 'forwardedRef' | 'onChange' | 'onBlur'
> {
/** CSS class for custom styles */
className?: string;
/** Disables the input */
Expand Down
5 changes: 4 additions & 1 deletion src/core/Form/TimeInput/TimeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export const timeInputClassNames = {
export interface TimeInputProps
extends StatusTextCommonProps,
MarginProps,
Omit<HtmlInputProps, 'type' | 'onChange' | 'onBlur' | 'defaultValue'> {
Omit<
HtmlInputProps,
'type' | 'onChange' | 'onBlur' | 'defaultValue' | 'onClick'
> {
/** CSS class for custom styles */
className?: string;
/** Disables the input */
Expand Down
4 changes: 3 additions & 1 deletion src/core/LanguageMenu/LanguageMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export type MenuContent =
| Array<ReactElement<LanguageMenuItemProps>>
| ReactElement<LanguageMenuItemProps>;

export interface LanguageMenuProps extends MarginProps, HtmlButtonProps {
export interface LanguageMenuProps
extends MarginProps,
Omit<HtmlButtonProps, 'onBlur'> {
/** Content for the menu button. Should indicate the currently selected language */
buttonText: ReactNode;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ interface InternalPaginationProps {

export type PaginationProps = ShowInputProps &
InternalPaginationProps &
HtmlNavProps &
Omit<HtmlNavProps, 'onChange'> &
MarginProps;

const baseClassName = 'fi-pagination';
Expand Down

0 comments on commit bc3a9fa

Please sign in to comment.