Skip to content

Commit

Permalink
fix(components): fix checkbox types (sdds-serv, caldera-online, plasm…
Browse files Browse the repository at this point in the history
…a-asdk)
  • Loading branch information
iljs committed May 24, 2024
1 parent 98cc2a9 commit deac947
Show file tree
Hide file tree
Showing 13 changed files with 140 additions and 27 deletions.
53 changes: 49 additions & 4 deletions packages/caldera-online/api/caldera-online.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { addFocus } from '@salutejs/plasma-new-hope/styled-components';
import { AnchorHTMLAttributes } from 'react';
import type { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';
import { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';
import { bodyL } from '@salutejs/caldera-online-themes/tokens';
import { bodyLBold } from '@salutejs/caldera-online-themes/tokens';
import { bodyM } from '@salutejs/caldera-online-themes/tokens';
Expand All @@ -22,6 +22,7 @@ import { bodyXXSBold } from '@salutejs/caldera-online-themes/tokens';
import { BoldProps } from '@salutejs/plasma-new-hope/types/components/Typography/Typography.types';
import { ButtonHTMLAttributes } from 'react';
import { ButtonProps as ButtonProps_2 } from '@salutejs/plasma-new-hope/styled-components';
import { CheckboxProps as CheckboxProps_2 } from '@salutejs/plasma-new-hope/types/components/Checkbox/Checkbox.types';
import { CustomToastProps } from '@salutejs/plasma-new-hope/types/components/Toast/Toast.types';
import { DropdownProps } from '@salutejs/plasma-new-hope/styled-components';
import { dsplL } from '@salutejs/caldera-online-themes/tokens';
Expand All @@ -45,7 +46,7 @@ import { h4Bold } from '@salutejs/caldera-online-themes/tokens';
import { h5 } from '@salutejs/caldera-online-themes/tokens';
import { h5Bold } from '@salutejs/caldera-online-themes/tokens';
import { HTMLAttributes } from 'react';
import type { InputHTMLAttributes } from 'react';
import { InputHTMLAttributes } from 'react';
import { LinkCustomProps } from '@salutejs/plasma-new-hope/types/components/Link/Link';
import { mediaQuery } from '@salutejs/plasma-new-hope/styled-components';
import { modalClasses } from '@salutejs/plasma-new-hope/styled-components';
Expand Down Expand Up @@ -195,7 +196,29 @@ fixed: string;
export type ButtonProps = typeof ButtonComponent;

// @public
export const Checkbox: FunctionComponent<BaseboxProps>;
export const Checkbox: FunctionComponent<PropsType< {
size: {
s: string;
m: string;
};
view: {
default: string;
primary: string;
secondary: string;
tertiary: string;
paragraph: string;
accent: string;
positive: string;
warning: string;
negative: string;
};
disabled: {
true: string;
};
focused: {
true: string;
};
}> & CheckboxProps_2 & RefAttributes<HTMLInputElement>>;

// Warning: (ae-forgotten-export) The symbol "CheckboxComponent" needs to be exported by the entry point index.d.ts
//
Expand Down Expand Up @@ -371,7 +394,29 @@ export { PopupProps }
export { PopupProvider }

// @public
export const Radiobox: FunctionComponent<Omit<BaseboxProps, "indeterminate">>;
export const Radiobox: FunctionComponent<PropsType< {
size: {
s: string;
m: string;
};
view: {
default: string;
primary: string;
secondary: string;
tertiary: string;
paragraph: string;
accent: string;
positive: string;
warning: string;
negative: string;
};
disabled: {
true: string;
};
focused: {
true: string;
};
}> & Filter<InputHTMLAttributes<HTMLInputElement>, "size"> & Omit<BaseboxProps, "indeterminate"> & RefAttributes<HTMLInputElement>>;

// Warning: (ae-forgotten-export) The symbol "RadioboxComponent" needs to be exported by the entry point index.d.ts
//
Expand Down
3 changes: 1 addition & 2 deletions packages/caldera-online/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { checkboxConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';
import type { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';

import { config } from './Checkbox.config';

const mergedConfig = mergeConfig(checkboxConfig, config);
const CheckboxComponent = component(mergedConfig) as React.FunctionComponent<BaseboxProps>;
const CheckboxComponent = component(mergedConfig);

export type CheckboxProps = typeof CheckboxComponent;

Expand Down
3 changes: 1 addition & 2 deletions packages/caldera-online/src/components/Radiobox/Radiobox.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { radioboxConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';
import type { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';

import { config } from './Radiobox.config';

const mergedConfig = mergeConfig(radioboxConfig, config);
const RadioboxComponent = component(mergedConfig) as React.FunctionComponent<Omit<BaseboxProps, 'indeterminate'>>;
const RadioboxComponent = component(mergedConfig);

export type RadioboxProps = typeof RadioboxComponent;

Expand Down
37 changes: 33 additions & 4 deletions packages/plasma-asdk/api/plasma-asdk.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
/// <reference types="react" />

import { AnchorHTMLAttributes } from 'react';
import type { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';
import { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';
import { BoldProps } from '@salutejs/plasma-new-hope/types/components/Typography/Typography.types';
import { ButtonProps as ButtonProps_2 } from '@salutejs/plasma-new-hope/styled-components';
import { CheckboxProps as CheckboxProps_2 } from '@salutejs/plasma-new-hope/types/components/Checkbox/Checkbox.types';
import { Filter } from '@salutejs/plasma-new-hope/types/engines/types';
import { FocusProps } from '@salutejs/plasma-new-hope/styled-components';
import { FunctionComponent } from 'react';
import { HTMLAttributes } from 'react';
import type { InputHTMLAttributes } from 'react';
import { InputHTMLAttributes } from 'react';
import { LinkCustomProps } from '@salutejs/plasma-new-hope/types/components/Link/Link';
import { PropsType } from '@salutejs/plasma-new-hope/types/engines/types';
import { RadioGroup } from '@salutejs/plasma-new-hope/styled-components';
Expand Down Expand Up @@ -155,7 +156,21 @@ m: string;
}> & TypographyOldProps & RefAttributes<HTMLDivElement>>;

// @public
export const Checkbox: FunctionComponent<BaseboxProps>;
export const Checkbox: FunctionComponent<PropsType< {
size: {
s: string;
m: string;
};
view: {
accent: string;
};
disabled: {
true: string;
};
focused: {
true: string;
};
}> & CheckboxProps_2 & RefAttributes<HTMLInputElement>>;

// Warning: (ae-forgotten-export) The symbol "CheckboxComponent" needs to be exported by the entry point index.d.ts
//
Expand Down Expand Up @@ -312,7 +327,21 @@ paragraph2: string;
}> & TypographyOldProps & RefAttributes<HTMLDivElement>>;

// @public
export const Radiobox: FunctionComponent<Omit<BaseboxProps, "indeterminate">>;
export const Radiobox: FunctionComponent<PropsType< {
size: {
s: string;
m: string;
};
view: {
accent: string;
};
disabled: {
true: string;
};
focused: {
true: string;
};
}> & Filter<InputHTMLAttributes<HTMLInputElement>, "size"> & Omit<BaseboxProps, "indeterminate"> & RefAttributes<HTMLInputElement>>;

// Warning: (ae-forgotten-export) The symbol "RadioboxComponent" needs to be exported by the entry point index.d.ts
//
Expand Down
3 changes: 1 addition & 2 deletions packages/plasma-asdk/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { checkboxConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';
import type { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';

import { config } from './Checkbox.config';

const mergedConfig = mergeConfig(checkboxConfig, config);
const CheckboxComponent = component(mergedConfig) as React.FunctionComponent<BaseboxProps>;
const CheckboxComponent = component(mergedConfig);

export type CheckboxProps = typeof CheckboxComponent;

Expand Down
3 changes: 1 addition & 2 deletions packages/plasma-asdk/src/components/Radiobox/Radiobox.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { radioboxConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';
import type { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';

import { config } from './Radiobox.config';

const mergedConfig = mergeConfig(radioboxConfig, config);
const RadioboxComponent = component(mergedConfig) as React.FunctionComponent<Omit<BaseboxProps, 'indeterminate'>>;
const RadioboxComponent = component(mergedConfig);

export type RadioboxProps = typeof RadioboxComponent;

Expand Down
3 changes: 2 additions & 1 deletion packages/plasma-b2c/api/plasma-b2c.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ import { ImageProps } from '@salutejs/plasma-new-hope/styled-components';
import { ImgHTMLAttributes } from 'react';
import { IndicatorProps } from '@salutejs/plasma-new-hope/styled-components';
import { InputHTMLAttributes } from '@salutejs/plasma-core';
import { InputHTMLAttributes as InputHTMLAttributes_2 } from 'react';
import { JSXElementConstructor } from 'react';
import { LineSkeletonProps } from '@salutejs/plasma-new-hope/styled-components';
import { LinkCustomProps } from '@salutejs/plasma-new-hope/types/components/Link/Link';
Expand Down Expand Up @@ -1478,7 +1479,7 @@ true: string;
focused: {
true: string;
};
}> & Filter<InputHTMLAttributes<HTMLInputElement>, "size"> & Omit<BaseboxProps, "indeterminate"> & RefAttributes<HTMLInputElement>>;
}> & Filter<InputHTMLAttributes_2<HTMLInputElement>, "size"> & Omit<BaseboxProps, "indeterminate"> & RefAttributes<HTMLInputElement>>;

// Warning: (ae-forgotten-export) The symbol "RadioboxComponent" needs to be exported by the entry point index.d.ts
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const StyledInput = styled.input`
outline: 0 none;
}
/* Спрятать от IE */
/* Спрятaть от IE */
width: 1px;
height: 1px;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { forwardRef, useMemo } from 'react';
import { safeUseId, extractTextFrom } from '@salutejs/plasma-core';
import type { InputHTMLAttributes } from '@salutejs/plasma-core';
import type { InputHTMLAttributes } from 'react';

import type { Filter, RootProps } from '../../engines/types';
import {
Expand Down
3 changes: 2 additions & 1 deletion packages/plasma-web/api/plasma-web.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ import { ImageProps } from '@salutejs/plasma-new-hope/styled-components';
import { ImgHTMLAttributes } from 'react';
import { IndicatorProps } from '@salutejs/plasma-new-hope/styled-components';
import { InputHTMLAttributes } from '@salutejs/plasma-core';
import { InputHTMLAttributes as InputHTMLAttributes_2 } from 'react';
import { JSXElementConstructor } from 'react';
import { LineSkeletonProps } from '@salutejs/plasma-new-hope/styled-components';
import { LinkCustomProps } from '@salutejs/plasma-new-hope/types/components/Link/Link';
Expand Down Expand Up @@ -1480,7 +1481,7 @@ true: string;
focused: {
true: string;
};
}> & Filter<InputHTMLAttributes<HTMLInputElement>, "size"> & Omit<BaseboxProps, "indeterminate"> & RefAttributes<HTMLInputElement>>;
}> & Filter<InputHTMLAttributes_2<HTMLInputElement>, "size"> & Omit<BaseboxProps, "indeterminate"> & RefAttributes<HTMLInputElement>>;

// Warning: (ae-forgotten-export) The symbol "RadioboxComponent" needs to be exported by the entry point index.d.ts
//
Expand Down
49 changes: 46 additions & 3 deletions packages/sdds-serv/api/sdds-serv.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { AsProps } from '@salutejs/plasma-new-hope/types/types';
import { AvatarGroupProps } from '@salutejs/plasma-new-hope/styled-components';
import { AvatarProps } from '@salutejs/plasma-new-hope/styled-components';
import { BadgeProps } from '@salutejs/plasma-new-hope/styled-components';
import type { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';
import { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';
import { bodyL } from '@salutejs/sdds-themes/tokens';
import { bodyLBold } from '@salutejs/sdds-themes/tokens';
import { bodyM } from '@salutejs/sdds-themes/tokens';
Expand All @@ -33,6 +33,7 @@ import { CellTextbox } from '@salutejs/plasma-new-hope/styled-components';
import { CellTextboxLabel } from '@salutejs/plasma-new-hope/styled-components';
import { CellTextboxSubtitle } from '@salutejs/plasma-new-hope/styled-components';
import { CellTextboxTitle } from '@salutejs/plasma-new-hope/styled-components';
import { CheckboxProps as CheckboxProps_2 } from '@salutejs/plasma-new-hope/types/components/Checkbox/Checkbox.types';
import { ChipProps } from '@salutejs/plasma-new-hope/styled-components';
import { ClosePlacementType } from '@salutejs/plasma-new-hope/styled-components';
import { Col } from '@salutejs/plasma-new-hope/styled-components';
Expand Down Expand Up @@ -434,7 +435,28 @@ export { CellTextboxSubtitle }
export { CellTextboxTitle }

// @public
export const Checkbox: FunctionComponent<BaseboxProps>;
export const Checkbox: FunctionComponent<PropsType< {
size: {
s: string;
m: string;
};
view: {
default: string;
secondary: string;
tertiary: string;
paragraph: string;
accent: string;
positive: string;
warning: string;
negative: string;
};
disabled: {
true: string;
};
focused: {
true: string;
};
}> & CheckboxProps_2 & RefAttributes<HTMLInputElement>>;

// Warning: (ae-forgotten-export) The symbol "CheckboxComponent" needs to be exported by the entry point index.d.ts
//
Expand Down Expand Up @@ -906,7 +928,28 @@ m: string;
export { ProgressProps }

// @public
export const Radiobox: FunctionComponent<Omit<BaseboxProps, "indeterminate">>;
export const Radiobox: FunctionComponent<PropsType< {
size: {
s: string;
m: string;
};
view: {
default: string;
secondary: string;
tertiary: string;
paragraph: string;
accent: string;
positive: string;
warning: string;
negative: string;
};
disabled: {
true: string;
};
focused: {
true: string;
};
}> & Filter<InputHTMLAttributes<HTMLInputElement>, "size"> & Omit<BaseboxProps, "indeterminate"> & RefAttributes<HTMLInputElement>>;

// Warning: (ae-forgotten-export) The symbol "RadioboxComponent" needs to be exported by the entry point index.d.ts
//
Expand Down
3 changes: 1 addition & 2 deletions packages/sdds-serv/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { checkboxConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';
import type { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';

import { config } from './Checkbox.config';

const mergedConfig = mergeConfig(checkboxConfig, config);
const CheckboxComponent = component(mergedConfig) as React.FunctionComponent<BaseboxProps>;
const CheckboxComponent = component(mergedConfig);

export type CheckboxProps = typeof CheckboxComponent;

Expand Down
3 changes: 1 addition & 2 deletions packages/sdds-serv/src/components/Radiobox/Radiobox.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { radioboxConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';
import type { BaseboxProps } from '@salutejs/plasma-new-hope/styled-components';

import { config } from './Radiobox.config';

const mergedConfig = mergeConfig(radioboxConfig, config);
const RadioboxComponent = component(mergedConfig) as React.FunctionComponent<Omit<BaseboxProps, 'indeterminate'>>;
const RadioboxComponent = component(mergedConfig);

export type RadioboxProps = typeof RadioboxComponent;

Expand Down

0 comments on commit deac947

Please sign in to comment.