@ssa-ui-kit/core 0.0.25-alpha → 0.0.26-alpha

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 (127) hide show
  1. package/dist/components/AccordionGroup/AccordionContext.d.ts +3 -3
  2. package/dist/components/AccordionGroup/types.d.ts +1 -1
  3. package/dist/components/Badge/helpers.d.ts +2 -2
  4. package/dist/components/Button/Button.d.ts +2 -2
  5. package/dist/components/Button/ButtonText.d.ts +6 -6
  6. package/dist/components/Button/fixtures.d.ts +6 -6
  7. package/dist/components/Button/helpers.d.ts +2 -2
  8. package/dist/components/Button/types.d.ts +5 -5
  9. package/dist/components/Checkbox/Checkbox.d.ts +2 -2
  10. package/dist/components/Checkbox/CheckboxBase.d.ts +2 -2
  11. package/dist/components/Checkbox/types.d.ts +2 -2
  12. package/dist/components/Dropdown/Dropdown.d.ts +3 -3
  13. package/dist/components/Dropdown/types.d.ts +3 -3
  14. package/dist/components/DropdownOption/DropdownOption.d.ts +2 -2
  15. package/dist/components/DropdownOptions/DropdownOptions.d.ts +2 -2
  16. package/dist/components/DropdownOptions/index.d.ts +1 -1
  17. package/dist/components/DropdownOptions/types.d.ts +2 -2
  18. package/dist/components/DropdownToggle/DropdownToggle.d.ts +3 -3
  19. package/dist/components/DropdownToggle/types.d.ts +1 -1
  20. package/dist/components/FormCheckbox/FormCheckbox.d.ts +2 -2
  21. package/dist/components/FormCheckbox/types.d.ts +2 -2
  22. package/dist/components/FormHelperText/FormHelperText.d.ts +2 -2
  23. package/dist/components/FormHelperText/types.d.ts +1 -1
  24. package/dist/components/FormRadioGroup/FormRadioGroup.d.ts +2 -2
  25. package/dist/components/FormRadioGroup/types.d.ts +2 -2
  26. package/dist/components/Icon/types.d.ts +2 -2
  27. package/dist/components/LargeTab/LargeTab.d.ts +2 -2
  28. package/dist/components/LargeTab/LargeTabBase.d.ts +2 -2
  29. package/dist/components/MultipleDropdown/MultipleDropdown.context.d.ts +3 -3
  30. package/dist/components/MultipleDropdown/MultipleDropdown.d.ts +3 -3
  31. package/dist/components/MultipleDropdown/types.d.ts +3 -3
  32. package/dist/components/MultipleDropdown/utils.d.ts +2 -2
  33. package/dist/components/MultipleDropdownOptions/MultipleDropdownOptions.d.ts +2 -2
  34. package/dist/components/MultipleDropdownOptions/index.d.ts +1 -1
  35. package/dist/components/MultipleDropdownOptions/types.d.ts +2 -2
  36. package/dist/components/Popover/PopoverTrigger.d.ts +2 -2
  37. package/dist/components/Radio/Radio.d.ts +2 -2
  38. package/dist/components/Radio/types.d.ts +1 -1
  39. package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
  40. package/dist/components/RadioGroup/types.d.ts +3 -3
  41. package/dist/components/ResponsiveImage/ResponsiveImage.d.ts +2 -2
  42. package/dist/components/ResponsiveImage/types.d.ts +1 -1
  43. package/dist/components/Switch/Switch.d.ts +2 -2
  44. package/dist/components/Switch/SwitchContext.d.ts +3 -3
  45. package/dist/components/Switch/types.d.ts +1 -1
  46. package/dist/components/Tab/Tab.d.ts +2 -2
  47. package/dist/components/Tab/TabBase.d.ts +2 -2
  48. package/dist/components/TabBar/TabBar.d.ts +2 -2
  49. package/dist/components/TabBar/TabBarContext.d.ts +4 -4
  50. package/dist/components/TabBar/stories/helpers.d.ts +2 -2
  51. package/dist/components/TabBar/types.d.ts +9 -11
  52. package/dist/components/Tooltip/ProgressChartTooltip.d.ts +2 -2
  53. package/dist/components/Tooltip/Tooltip.d.ts +2 -2
  54. package/dist/components/Tooltip/types.d.ts +11 -11
  55. package/dist/components/Tooltip/utils.d.ts +2 -2
  56. package/dist/components/TooltipContent/TooltipContent.d.ts +2 -2
  57. package/dist/components/TooltipTrigger/TooltipTrigger.d.ts +2 -2
  58. package/dist/components/index.d.ts +1 -1
  59. package/dist/index.js.map +1 -1
  60. package/package.json +3 -3
  61. package/src/components/AccordionGroup/AccordionContext.tsx +4 -4
  62. package/src/components/AccordionGroup/types.ts +1 -1
  63. package/src/components/Badge/helpers.ts +18 -16
  64. package/src/components/Button/Button.spec.tsx +8 -8
  65. package/src/components/Button/Button.tsx +3 -3
  66. package/src/components/Button/ButtonText.tsx +6 -6
  67. package/src/components/Button/fixtures.ts +14 -14
  68. package/src/components/Button/helpers.ts +2 -2
  69. package/src/components/Button/types.ts +5 -5
  70. package/src/components/Checkbox/Checkbox.spec.tsx +2 -2
  71. package/src/components/Checkbox/Checkbox.stories.tsx +2 -2
  72. package/src/components/Checkbox/Checkbox.tsx +2 -2
  73. package/src/components/Checkbox/CheckboxBase.tsx +2 -2
  74. package/src/components/Checkbox/types.ts +2 -2
  75. package/src/components/Dropdown/Dropdown.stories.tsx +3 -3
  76. package/src/components/Dropdown/Dropdown.tsx +4 -4
  77. package/src/components/Dropdown/types.ts +4 -3
  78. package/src/components/DropdownOption/DropdownOption.tsx +2 -2
  79. package/src/components/DropdownOptions/DropdownOptions.tsx +2 -2
  80. package/src/components/DropdownOptions/index.ts +1 -1
  81. package/src/components/DropdownOptions/types.ts +2 -2
  82. package/src/components/DropdownToggle/DropdownToggle.tsx +3 -3
  83. package/src/components/DropdownToggle/types.ts +1 -1
  84. package/src/components/FormCheckbox/FormCheckbox.tsx +2 -2
  85. package/src/components/FormCheckbox/types.ts +3 -3
  86. package/src/components/FormHelperText/FormHelperText.tsx +2 -2
  87. package/src/components/FormHelperText/types.ts +1 -1
  88. package/src/components/FormRadioGroup/FormRadioGroup.stories.tsx +2 -2
  89. package/src/components/FormRadioGroup/FormRadioGroup.tsx +2 -2
  90. package/src/components/FormRadioGroup/types.ts +3 -3
  91. package/src/components/Icon/Icons.spec.tsx +6 -6
  92. package/src/components/Icon/icons/index.tsx +3 -3
  93. package/src/components/Icon/types.ts +2 -2
  94. package/src/components/LargeTab/LargeTab.tsx +2 -2
  95. package/src/components/LargeTab/LargeTabBase.tsx +2 -2
  96. package/src/components/MultipleDropdown/MultipleDropdown.context.ts +3 -3
  97. package/src/components/MultipleDropdown/MultipleDropdown.tsx +7 -7
  98. package/src/components/MultipleDropdown/types.ts +3 -3
  99. package/src/components/MultipleDropdown/utils.ts +2 -2
  100. package/src/components/MultipleDropdownOptions/MultipleDropdownOptions.tsx +2 -2
  101. package/src/components/MultipleDropdownOptions/index.ts +1 -1
  102. package/src/components/MultipleDropdownOptions/types.ts +2 -2
  103. package/src/components/Popover/PopoverTrigger.tsx +3 -3
  104. package/src/components/Radio/Radio.tsx +2 -2
  105. package/src/components/Radio/types.ts +1 -1
  106. package/src/components/RadioGroup/RadioGroup.tsx +2 -2
  107. package/src/components/RadioGroup/types.ts +3 -3
  108. package/src/components/ResponsiveImage/ResponsiveImage.tsx +2 -2
  109. package/src/components/ResponsiveImage/types.ts +1 -1
  110. package/src/components/Switch/Switch.tsx +2 -2
  111. package/src/components/Switch/SwitchContext.tsx +2 -2
  112. package/src/components/Switch/types.ts +1 -1
  113. package/src/components/Tab/Tab.tsx +2 -2
  114. package/src/components/Tab/TabBase.tsx +2 -3
  115. package/src/components/TabBar/TabBar.spec.tsx +5 -5
  116. package/src/components/TabBar/TabBar.tsx +2 -2
  117. package/src/components/TabBar/TabBarContext.tsx +6 -6
  118. package/src/components/TabBar/stories/helpers.tsx +4 -4
  119. package/src/components/TabBar/types.ts +9 -12
  120. package/src/components/Tooltip/ProgressChartTooltip.tsx +2 -2
  121. package/src/components/Tooltip/Tooltip.tsx +2 -2
  122. package/src/components/Tooltip/types.ts +11 -11
  123. package/src/components/Tooltip/utils.tsx +2 -2
  124. package/src/components/TooltipContent/TooltipContent.tsx +2 -2
  125. package/src/components/TooltipTrigger/TooltipTrigger.tsx +2 -2
  126. package/src/components/index.ts +1 -1
  127. package/tsbuildcache +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssa-ui-kit/core",
3
- "version": "0.0.25-alpha",
3
+ "version": "0.0.26-alpha",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "private": false,
@@ -41,8 +41,8 @@
41
41
  "loose-envify": "^1.4.0",
42
42
  "scheduler": "^0.23.0",
43
43
  "uuid": "^9.0.0",
44
- "@ssa-ui-kit/hooks": "^0.0.1-alpha",
45
- "@ssa-ui-kit/utils": "^0.0.1-alpha"
44
+ "@ssa-ui-kit/utils": "^0.0.1-alpha",
45
+ "@ssa-ui-kit/hooks": "^0.0.2-alpha"
46
46
  },
47
47
  "browserslist": [
48
48
  ">0.1%",
@@ -1,13 +1,13 @@
1
1
  import { createContext, useState, useContext } from 'react';
2
- import { AccordionProps, IAccordionGroupContext } from './types';
2
+ import { AccordionProps, AccordionGroupContextProps } from './types';
3
3
 
4
- export const AccordionGroupContext = createContext<IAccordionGroupContext>(
5
- {} as IAccordionGroupContext,
4
+ export const AccordionGroupContext = createContext<AccordionGroupContextProps>(
5
+ {} as AccordionGroupContextProps,
6
6
  );
7
7
 
8
8
  export const useAccordionGroupContext = () => useContext(AccordionGroupContext);
9
9
 
10
- const useAccordionGroup = (): IAccordionGroupContext => {
10
+ const useAccordionGroup = (): AccordionGroupContextProps => {
11
11
  const [openedAccordions, setOpenedAccordions] = useState<AccordionProps[]>(
12
12
  [],
13
13
  );
@@ -51,7 +51,7 @@ export interface AccordionViewProps extends AccordionProps {
51
51
  contentProps?: Record<string, any>;
52
52
  }
53
53
 
54
- export interface IAccordionGroupContext {
54
+ export interface AccordionGroupContextProps {
55
55
  openedAccordions: Array<AccordionProps> | [];
56
56
  stayOpen: boolean;
57
57
  setOpenedAccordions: (accordions: Array<AccordionProps>) => void;
@@ -1,4 +1,4 @@
1
- import { IMapIcons } from '@components/Icon/types';
1
+ import { MapIconsType } from '@components/Icon/types';
2
2
  import styled from '@emotion/styled';
3
3
 
4
4
  export const sizes: Array<keyof MainSizes> = ['small', 'medium', 'large'];
@@ -13,21 +13,23 @@ export const colors: Array<keyof MainColors> = [
13
13
  'yellowWarm',
14
14
  ];
15
15
 
16
- export const icons: Array<{ color: keyof MainColors; icon: keyof IMapIcons }> =
17
- [
18
- {
19
- color: 'blueLight',
20
- icon: 'information',
21
- },
22
- {
23
- color: 'yellowWarm',
24
- icon: 'warning',
25
- },
26
- {
27
- color: 'pink',
28
- icon: 'attention',
29
- },
30
- ];
16
+ export const icons: Array<{
17
+ color: keyof MainColors;
18
+ icon: keyof MapIconsType;
19
+ }> = [
20
+ {
21
+ color: 'blueLight',
22
+ icon: 'information',
23
+ },
24
+ {
25
+ color: 'yellowWarm',
26
+ icon: 'warning',
27
+ },
28
+ {
29
+ color: 'pink',
30
+ icon: 'attention',
31
+ },
32
+ ];
31
33
 
32
34
  export const HeaderTitle = styled.span`
33
35
  text-align: center;
@@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event';
3
3
  import Icon from '@components/Icon';
4
4
 
5
5
  import Button from './index';
6
- import { IButtonProps } from './types';
6
+ import { ButtonProps } from './types';
7
7
  import {
8
8
  primaryBtnSpecs,
9
9
  secondaryBtnSpecs,
@@ -23,7 +23,7 @@ function setup(component: JSX.Element) {
23
23
  const getElTestId = (
24
24
  elType: string,
25
25
  isDisabled?: boolean,
26
- variant?: IButtonProps['variant'],
26
+ variant?: ButtonProps['variant'],
27
27
  isHovered?: boolean,
28
28
  ) => {
29
29
  const prefix = isDisabled
@@ -60,9 +60,9 @@ const testButton = async (spec: TestPropsType) => {
60
60
 
61
61
  const { user, getByRole, getByTestId, findByTitle } = setup(
62
62
  <Button
63
- type={type as IButtonProps['type']}
64
- size={size as IButtonProps['size']}
65
- variant={variant as IButtonProps['variant']}
63
+ type={type as ButtonProps['type']}
64
+ size={size as ButtonProps['size']}
65
+ variant={variant as ButtonProps['variant']}
66
66
  text={text}
67
67
  endIcon={appendIcon}
68
68
  startIcon={prependIcon}
@@ -116,9 +116,9 @@ const testTertiaryBtnHoverState = async (spec: TestPropsType) => {
116
116
 
117
117
  const { user, getByRole, getByTestId, findByTitle } = setup(
118
118
  <Button
119
- type={type as IButtonProps['type']}
120
- size={size as IButtonProps['size']}
121
- variant={variant as IButtonProps['variant']}
119
+ type={type as ButtonProps['type']}
120
+ size={size as ButtonProps['size']}
121
+ variant={variant as ButtonProps['variant']}
122
122
  text={text}
123
123
  endIcon={appendIcon}
124
124
  startIcon={prependIcon}
@@ -10,7 +10,7 @@ import {
10
10
  GreyLightButtonText,
11
11
  DisabledButtonText,
12
12
  } from './ButtonText';
13
- import { IButtonProps, IButtonVariants } from './types';
13
+ import { ButtonProps, ButtonVariants } from './types';
14
14
  import {
15
15
  large,
16
16
  medium,
@@ -31,7 +31,7 @@ const mapSizes: MainSizes = {
31
31
  large,
32
32
  };
33
33
 
34
- const mapVariants: IButtonVariants = {
34
+ const mapVariants: ButtonVariants = {
35
35
  primary,
36
36
  secondary,
37
37
  tertiary,
@@ -39,7 +39,7 @@ const mapVariants: IButtonVariants = {
39
39
  attention,
40
40
  };
41
41
 
42
- export const Button = forwardRef<HTMLButtonElement, IButtonProps>(
42
+ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
43
43
  function Button(
44
44
  {
45
45
  block = false,
@@ -1,8 +1,8 @@
1
1
  import { useTheme } from '@emotion/react';
2
2
 
3
- import { IColoredButtonTextProps, IButtonTextProps } from './types';
3
+ import { ColoredButtonTextProps, ButtonTextProps } from './types';
4
4
 
5
- export const ButtonText = ({ text, className, testId }: IButtonTextProps) => {
5
+ export const ButtonText = ({ text, className, testId }: ButtonTextProps) => {
6
6
  return (
7
7
  <span className={className} data-testid={testId}>
8
8
  {text}
@@ -10,7 +10,7 @@ export const ButtonText = ({ text, className, testId }: IButtonTextProps) => {
10
10
  );
11
11
  };
12
12
 
13
- export const WhiteButtonText = ({ text }: IColoredButtonTextProps) => {
13
+ export const WhiteButtonText = ({ text }: ColoredButtonTextProps) => {
14
14
  const theme = useTheme();
15
15
 
16
16
  return (
@@ -24,7 +24,7 @@ export const WhiteButtonText = ({ text }: IColoredButtonTextProps) => {
24
24
  );
25
25
  };
26
26
 
27
- export const GreyButtonText = ({ text }: IColoredButtonTextProps) => {
27
+ export const GreyButtonText = ({ text }: ColoredButtonTextProps) => {
28
28
  const theme = useTheme();
29
29
 
30
30
  return (
@@ -38,7 +38,7 @@ export const GreyButtonText = ({ text }: IColoredButtonTextProps) => {
38
38
  );
39
39
  };
40
40
 
41
- export const GreyLightButtonText = ({ text }: IColoredButtonTextProps) => {
41
+ export const GreyLightButtonText = ({ text }: ColoredButtonTextProps) => {
42
42
  const theme = useTheme();
43
43
 
44
44
  return (
@@ -52,7 +52,7 @@ export const GreyLightButtonText = ({ text }: IColoredButtonTextProps) => {
52
52
  );
53
53
  };
54
54
 
55
- export const DisabledButtonText = ({ text }: IColoredButtonTextProps) => {
55
+ export const DisabledButtonText = ({ text }: ColoredButtonTextProps) => {
56
56
  const theme = useTheme();
57
57
 
58
58
  return (
@@ -1,8 +1,8 @@
1
1
  import Icon from '@components/Icon';
2
- import { IButtonProps } from './types';
2
+ import { ButtonProps } from './types';
3
3
 
4
4
  export type TestPropsType = Omit<
5
- IButtonProps,
5
+ ButtonProps,
6
6
  'isDisabled' | 'startIcon' | 'endIcon'
7
7
  > & {
8
8
  disabled?: boolean;
@@ -125,41 +125,41 @@ const baseSpecs: TestPropsType[] = [
125
125
  export const primaryBtnSpecs = [
126
126
  ...baseSpecs,
127
127
  ...baseSpecs.map((s) => ({ ...s, size: undefined })),
128
- ...baseSpecs.map((s) => ({ ...s, size: 'medium' as IButtonProps['size'] })),
129
- ...baseSpecs.map((s) => ({ ...s, size: 'large' as IButtonProps['size'] })),
128
+ ...baseSpecs.map((s) => ({ ...s, size: 'medium' as ButtonProps['size'] })),
129
+ ...baseSpecs.map((s) => ({ ...s, size: 'large' as ButtonProps['size'] })),
130
130
  ...baseSpecs.map((s) => ({
131
131
  ...s,
132
- size: 'small' as IButtonProps['size'],
133
- type: 'submit' as IButtonProps['type'],
132
+ size: 'small' as ButtonProps['size'],
133
+ type: 'submit' as ButtonProps['type'],
134
134
  })),
135
135
  ...baseSpecs.map((s) => ({
136
136
  ...s,
137
- size: 'medium' as IButtonProps['size'],
138
- type: 'submit' as IButtonProps['type'],
137
+ size: 'medium' as ButtonProps['size'],
138
+ type: 'submit' as ButtonProps['type'],
139
139
  })),
140
140
  ...baseSpecs.map((s) => ({
141
141
  ...s,
142
- size: 'large' as IButtonProps['size'],
143
- type: 'submit' as IButtonProps['type'],
142
+ size: 'large' as ButtonProps['size'],
143
+ type: 'submit' as ButtonProps['type'],
144
144
  })),
145
145
  ];
146
146
 
147
147
  export const secondaryBtnSpecs = primaryBtnSpecs.map((s) => ({
148
148
  ...s,
149
- variant: 'secondary' as IButtonProps['variant'],
149
+ variant: 'secondary' as ButtonProps['variant'],
150
150
  }));
151
151
 
152
152
  export const tertiaryBtnSpecs = primaryBtnSpecs.map((s) => ({
153
153
  ...s,
154
- variant: 'tertiary' as IButtonProps['variant'],
154
+ variant: 'tertiary' as ButtonProps['variant'],
155
155
  }));
156
156
 
157
157
  export const infoBtnSpecs = primaryBtnSpecs.map((s) => ({
158
158
  ...s,
159
- variant: 'info' as IButtonProps['variant'],
159
+ variant: 'info' as ButtonProps['variant'],
160
160
  }));
161
161
 
162
162
  export const attentionBtnSpecs = primaryBtnSpecs.map((s) => ({
163
163
  ...s,
164
- variant: 'attention' as IButtonProps['variant'],
164
+ variant: 'attention' as ButtonProps['variant'],
165
165
  }));
@@ -1,8 +1,8 @@
1
1
  import styled from '@emotion/styled';
2
- import { IButtonVariants } from './types';
2
+ import { ButtonVariants } from './types';
3
3
 
4
4
  export const sizes: Array<keyof MainSizes> = ['small', 'medium', 'large'];
5
- export const variants: Array<keyof IButtonVariants> = [
5
+ export const variants: Array<keyof ButtonVariants> = [
6
6
  'primary',
7
7
  'info',
8
8
  'secondary',
@@ -15,13 +15,13 @@ type ButtonAriaProps = Pick<
15
15
  | 'aria-current'
16
16
  >;
17
17
 
18
- export interface IButtonProps extends ButtonAriaProps {
18
+ export interface ButtonProps extends ButtonAriaProps {
19
19
  block?: boolean;
20
20
  size?: keyof MainSizes;
21
21
  text?: string;
22
22
  startIcon?: React.ReactNode;
23
23
  endIcon?: React.ReactNode;
24
- variant?: keyof IButtonVariants | 'custom';
24
+ variant?: keyof ButtonVariants | 'custom';
25
25
  type?: 'button' | 'reset' | 'submit';
26
26
  isDisabled?: boolean;
27
27
  className?: string;
@@ -29,7 +29,7 @@ export interface IButtonProps extends ButtonAriaProps {
29
29
  children?: React.ReactNode;
30
30
  }
31
31
 
32
- export interface IButtonVariants {
32
+ export interface ButtonVariants {
33
33
  primary: (theme: Theme) => SerializedStyles;
34
34
  info: (theme: Theme) => SerializedStyles;
35
35
  secondary: (theme: Theme) => SerializedStyles;
@@ -37,12 +37,12 @@ export interface IButtonVariants {
37
37
  attention: (theme: Theme) => SerializedStyles;
38
38
  }
39
39
 
40
- export type IButtonTextProps = {
40
+ export type ButtonTextProps = {
41
41
  text: string;
42
42
  className?: string;
43
43
  testId?: string;
44
44
  };
45
45
 
46
- export type IColoredButtonTextProps = Required<Pick<IButtonProps, 'size'>> & {
46
+ export type ColoredButtonTextProps = Required<Pick<ButtonProps, 'size'>> & {
47
47
  text: string;
48
48
  };
@@ -6,7 +6,7 @@ import { useForm } from 'react-hook-form';
6
6
  import Checkbox from '@components/Checkbox';
7
7
  import FormCheckbox from '@components/FormCheckbox';
8
8
 
9
- import { ICheckboxProps } from './types';
9
+ import { CheckboxProps } from './types';
10
10
  import { getByRole } from '@testing-library/dom';
11
11
 
12
12
  const checkLabel = () => {
@@ -50,7 +50,7 @@ const checkToggle = async (
50
50
  checkIcon(labelEl, newIsChecked);
51
51
  };
52
52
 
53
- function setup(props: Omit<ICheckboxProps, 'onChange'> = {}) {
53
+ function setup(props: Omit<CheckboxProps, 'onChange'> = {}) {
54
54
  const mockOnChange = jest.fn();
55
55
  return {
56
56
  user: userEvent.setup(),
@@ -1,7 +1,7 @@
1
1
  import { Fragment } from 'react';
2
2
  import type { Meta } from '@storybook/react';
3
3
  import Typography from '@components/Typography';
4
- import Checkbox, { ICheckboxProps } from './index';
4
+ import Checkbox, { CheckboxProps } from './index';
5
5
 
6
6
  export default {
7
7
  title: 'Components/Checkbox',
@@ -27,7 +27,7 @@ export default {
27
27
 
28
28
  export const Default = {};
29
29
 
30
- const checkboxPropsVariants: Array<ICheckboxProps & { caption?: string }> = [
30
+ const checkboxPropsVariants: Array<CheckboxProps & { caption?: string }> = [
31
31
  {
32
32
  id: 'checked',
33
33
  caption: 'Checked by default',
@@ -3,7 +3,7 @@ import { useTheme } from '@emotion/react';
3
3
  import { CheckboxBase } from './CheckboxBase';
4
4
  import Icon from '@components/Icon';
5
5
 
6
- import { ICheckboxProps } from './types';
6
+ import { CheckboxProps } from './types';
7
7
 
8
8
  const Checkbox = ({
9
9
  text,
@@ -18,7 +18,7 @@ const Checkbox = ({
18
18
  ref,
19
19
  register,
20
20
  ...rest
21
- }: ICheckboxProps) => {
21
+ }: CheckboxProps) => {
22
22
  const [isChecked, setIsChecked] = useState(Boolean(initialState));
23
23
  const autoGenId = useId();
24
24
  const theme = useTheme();
@@ -1,9 +1,9 @@
1
1
  import styled from '@emotion/styled';
2
2
  import Label from '@components/Label';
3
3
  import { checkboxStyles } from './styles';
4
- import { ICheckboxProps } from './types';
4
+ import { CheckboxProps } from './types';
5
5
 
6
- export const CheckboxBase = styled(Label)<Pick<ICheckboxProps, 'color'>>`
6
+ export const CheckboxBase = styled(Label)<Pick<CheckboxProps, 'color'>>`
7
7
  position: relative;
8
8
  display: inline-flex;
9
9
  flex-grow: 0;
@@ -6,7 +6,7 @@ import {
6
6
  } from 'react-hook-form';
7
7
  import { MutableRefObject } from 'react';
8
8
 
9
- export interface ICheckboxProps
9
+ export interface CheckboxProps
10
10
  extends Partial<Pick<UseFormReturn, 'register'>> {
11
11
  text?: string;
12
12
  id?: string;
@@ -24,7 +24,7 @@ export interface ICheckboxProps
24
24
  }
25
25
 
26
26
  export type IFormCheckboxProps<T extends FieldValues> = Omit<
27
- ICheckboxProps,
27
+ CheckboxProps,
28
28
  'onChange' | 'name'
29
29
  > & {
30
30
  name: FieldPath<T>;
@@ -5,10 +5,10 @@ import { css } from '@emotion/react';
5
5
  import DropdownOption from '@components/DropdownOption';
6
6
 
7
7
  import Dropdown from './Dropdown';
8
- import { IDropdownProps } from './types';
9
- import { IDropdownOption } from '../..';
8
+ import { DropdownProps } from './types';
9
+ import { DropdownOptionProps } from '../..';
10
10
 
11
- type Args = IDropdownProps<IDropdownOption>;
11
+ type Args = DropdownProps<DropdownOptionProps>;
12
12
 
13
13
  const items = [
14
14
  { id: 1, value: 'One lorem ipsum', subText: 'subtext' },
@@ -7,9 +7,9 @@ import DropdownToggle from '@components/DropdownToggle';
7
7
  import DropdownArrow from '@components/DropdownArrow';
8
8
  import DropdownOptions from '@components/DropdownOptions';
9
9
  import DropdownContext from '@components/Dropdown/Dropdown.context';
10
- import { IDropdownOption } from '@components/DropdownOptions/types';
10
+ import { DropdownOptionProps } from '@components/DropdownOptions/types';
11
11
 
12
- import { DropdownContextType, IDropdownProps } from './types';
12
+ import { DropdownContextType, DropdownProps } from './types';
13
13
 
14
14
  /**
15
15
  * The structure of the component:
@@ -28,14 +28,14 @@ const DropdownBase = styled.div`
28
28
  position: relative;
29
29
  `;
30
30
 
31
- const Dropdown = <T extends IDropdownOption>({
31
+ const Dropdown = <T extends DropdownOptionProps>({
32
32
  selectedItem,
33
33
  isDisabled,
34
34
  isOpen: isInitOpen,
35
35
  children,
36
36
  onChange: handleChange,
37
37
  className,
38
- }: IDropdownProps<T>) => {
38
+ }: DropdownProps<T>) => {
39
39
  const theme = useTheme();
40
40
  const dropdownRef = useRef<HTMLDivElement>(null);
41
41
 
@@ -1,7 +1,8 @@
1
- import { IDropdownOption } from '@components/DropdownOptions';
1
+ import { DropdownOptionProps } from '@components/DropdownOptions';
2
2
  import { CommonProps } from '@global-types/emotion';
3
3
 
4
- export interface IDropdownProps<P extends IDropdownOption> extends CommonProps {
4
+ export interface DropdownProps<P extends DropdownOptionProps>
5
+ extends CommonProps {
5
6
  selectedItem?: P;
6
7
  onChange?: (item: P) => void;
7
8
  isDisabled?: boolean;
@@ -13,5 +14,5 @@ export interface IDropdownProps<P extends IDropdownOption> extends CommonProps {
13
14
 
14
15
  export interface DropdownContextType {
15
16
  onChange: (item?: string) => void;
16
- activeItem?: IDropdownOption | null;
17
+ activeItem?: DropdownOptionProps | null;
17
18
  }
@@ -3,7 +3,7 @@ import { Theme, css } from '@emotion/react';
3
3
  import styled from '@emotion/styled';
4
4
  import { CommonProps } from '@global-types/emotion';
5
5
 
6
- interface IDropdownItemProps extends CommonProps {
6
+ interface DropdownItemProps extends CommonProps {
7
7
  onClick?: (e: React.MouseEvent<HTMLElement>) => void;
8
8
  isActive?: boolean;
9
9
  isMultiple?: boolean;
@@ -31,7 +31,7 @@ const multipleStyles = ({ theme, isDisabled }: MultipleStylesProps) => {
31
31
  `;
32
32
  };
33
33
 
34
- const DropdownOption = styled.li<IDropdownItemProps>`
34
+ const DropdownOption = styled.li<DropdownItemProps>`
35
35
  overflow: hidden;
36
36
 
37
37
  height: 34px;
@@ -5,7 +5,7 @@ import { css } from '@emotion/react';
5
5
  import { useDropdownContext } from '@components/Dropdown/Dropdown.context';
6
6
  import DropdownOption from '@components/DropdownOption';
7
7
 
8
- import { IDropdownItemsListProps } from './types';
8
+ import { DropdownItemsListProps } from './types';
9
9
 
10
10
  const DropdownOptionsBase = styled.ul<{ tabindex?: string }>`
11
11
  position: absolute;
@@ -54,7 +54,7 @@ const DropdownOptions = ({
54
54
  ariaLabelledby,
55
55
  id,
56
56
  children,
57
- }: IDropdownItemsListProps) => {
57
+ }: DropdownItemsListProps) => {
58
58
  const { onChange, activeItem } = useDropdownContext();
59
59
 
60
60
  const childrenArray = React.Children.toArray(children).filter(Boolean);
@@ -1,2 +1,2 @@
1
1
  export { default } from './DropdownOptions';
2
- export type { IDropdownOption } from './types';
2
+ export type { DropdownOptionProps } from './types';
@@ -1,8 +1,8 @@
1
1
  import { CommonProps } from '@global-types/emotion';
2
2
 
3
- export type IDropdownOption = Record<string, string | number>;
3
+ export type DropdownOptionProps = Record<string, string | number>;
4
4
 
5
- export interface IDropdownItemsListProps extends CommonProps {
5
+ export interface DropdownItemsListProps extends CommonProps {
6
6
  ariaLabelledby?: string;
7
7
  id?: string;
8
8
  children?: React.ReactNode;
@@ -1,7 +1,7 @@
1
1
  import { css } from '@emotion/react';
2
2
  import styled from '@emotion/styled';
3
3
  import { focusOutline } from '@styles/safari-focus-outline';
4
- import { IDropdownToggleProps, MultipleStylesProps } from './types';
4
+ import { DropdownToggleProps, MultipleStylesProps } from './types';
5
5
 
6
6
  const multipleStyles = ({ theme, selectedCount = 0 }: MultipleStylesProps) => {
7
7
  let borderColor = theme.colors.greyDropdownMain;
@@ -43,7 +43,7 @@ const multipleStyles = ({ theme, selectedCount = 0 }: MultipleStylesProps) => {
43
43
 
44
44
  export const DropdownToggleBase = styled.button<
45
45
  Pick<
46
- IDropdownToggleProps,
46
+ DropdownToggleProps,
47
47
  'colors' | 'isOpen' | 'disabled' | 'isMultiple' | 'selectedCount'
48
48
  >
49
49
  >`
@@ -121,7 +121,7 @@ const DropdownToggle = ({
121
121
  ariaControls,
122
122
  colors,
123
123
  className,
124
- }: IDropdownToggleProps) => (
124
+ }: DropdownToggleProps) => (
125
125
  <DropdownToggleBase
126
126
  className={className}
127
127
  colors={colors}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Theme } from '@emotion/react';
3
3
  import { CommonProps } from '@global-types/emotion';
4
4
 
5
- export interface IDropdownToggleProps extends CommonProps {
5
+ export interface DropdownToggleProps extends CommonProps {
6
6
  onClick: (e: React.MouseEvent<HTMLElement>) => void;
7
7
  onFocus: (e: React.FocusEvent<HTMLButtonElement, Element>) => void;
8
8
  isOpen: boolean;
@@ -3,7 +3,7 @@ import type { FieldValues } from 'react-hook-form';
3
3
 
4
4
  import Checkbox from '@components/Checkbox';
5
5
 
6
- import { IFormCheckboxProps } from './types';
6
+ import { FormCheckboxProps } from './types';
7
7
  import { ChangeEvent } from 'react';
8
8
 
9
9
  const FormCheckbox = <T extends FieldValues>({
@@ -11,7 +11,7 @@ const FormCheckbox = <T extends FieldValues>({
11
11
  name,
12
12
  isRequired = false,
13
13
  ...props
14
- }: IFormCheckboxProps<T>) => {
14
+ }: FormCheckboxProps<T>) => {
15
15
  const { field } = useController({
16
16
  control,
17
17
  name,
@@ -1,8 +1,8 @@
1
1
  import { Control, FieldPath, FieldValues } from 'react-hook-form';
2
- import { ICheckboxProps } from '../..';
2
+ import { CheckboxProps } from '../..';
3
3
 
4
- export type IFormCheckboxProps<T extends FieldValues> = Omit<
5
- ICheckboxProps,
4
+ export type FormCheckboxProps<T extends FieldValues> = Omit<
5
+ CheckboxProps,
6
6
  'onChange' | 'name'
7
7
  > & {
8
8
  name: FieldPath<T>;
@@ -1,4 +1,4 @@
1
- import { IFormHelperText } from './types';
1
+ import { FormHelperTextProps } from './types';
2
2
  import { FormHelperTextBase } from './FormHelperTextBase';
3
3
 
4
4
  const FormHelperText = ({
@@ -6,7 +6,7 @@ const FormHelperText = ({
6
6
  status,
7
7
  disabled,
8
8
  children,
9
- }: IFormHelperText) => {
9
+ }: FormHelperTextProps) => {
10
10
  status = disabled ? 'basic' : status;
11
11
  return (
12
12
  <FormHelperTextBase role={role} status={status}>
@@ -1,6 +1,6 @@
1
1
  import { CommonProps } from '@global-types/emotion';
2
2
 
3
- export interface IFormHelperText extends CommonProps {
3
+ export interface FormHelperTextProps extends CommonProps {
4
4
  children: React.ReactNode;
5
5
  role?: string;
6
6
  status?: string;
@@ -6,7 +6,7 @@ import Typography from '@components/Typography';
6
6
  import Button from '@components/Button';
7
7
  import Radio from '@components/Radio';
8
8
 
9
- import { IFormRadioGroupProps } from './types';
9
+ import { FormRadioGroupProps } from './types';
10
10
  import FormRadioGroup from './FormRadioGroup';
11
11
 
12
12
  export default {
@@ -42,7 +42,7 @@ type DemoForm = {
42
42
  tree: string;
43
43
  };
44
44
 
45
- export const FormRadioGroupStory = (args: IFormRadioGroupProps<DemoForm>) => {
45
+ export const FormRadioGroupStory = (args: FormRadioGroupProps<DemoForm>) => {
46
46
  const { name, isRequired, initialState } = args;
47
47
 
48
48
  const { handleSubmit, control } = useForm<DemoForm>();