diff --git a/README.md b/README.md
index 15780f65..cd335c65 100644
--- a/README.md
+++ b/README.md
@@ -191,41 +191,6 @@ If you want to dive deeper into the components Tetrisly offers, check out our of
You can also check out our Storybook, which is our Documentation for React components (now in progress): [Tetrisly Storybook](https://virtuslab.github.io/tetrisly-react/?path=/docs/alertbanner--docs)
-## Customization
-
-All Tetrisly components have a `custom` prop. It makes it possible to customize the component without the need to create a new one. Below you can see an example of Button customization
-
-### Button
-
-If you want to change any of button styles, you can make it by passing custom props with object based on
-specific component config.
-
-For instance, to change background-color of appereance="primary" intent="secondary" variant to pink, just pass
-refferenced object structure:
-
-```jsx
-
-```
-
-we are still working on it, thanks for your feedback here!
-
### Useful links
- [Tetrisly Storybook](https://storybook.tetrisly.com/)
diff --git a/package.json b/package.json
index ef691bdb..70abdb2e 100644
--- a/package.json
+++ b/package.json
@@ -84,7 +84,7 @@
"exports": {
".": {
"import": "./dist/tetrisly-react.es.js",
- "require": "./dist/tetrisly-react.umd.js"
+ "require": "./dist/tetrisly-react.umd.cjs"
}
},
"repository": {
diff --git a/src/components/AlertBanner/AlertBanner.stories.tsx b/src/components/AlertBanner/AlertBanner.stories.tsx
index a09c883d..ff3b4261 100644
--- a/src/components/AlertBanner/AlertBanner.stories.tsx
+++ b/src/components/AlertBanner/AlertBanner.stories.tsx
@@ -23,13 +23,6 @@ const meta = {
},
],
},
- argTypes: {
- intent: {
- options: ['none', 'success', 'warning', 'negative'],
- defaultValue: 'none',
- control: { type: 'radio' },
- },
- },
parameters: {
docs: {
description: {
@@ -53,7 +46,7 @@ export const Default: Story = {};
export const Positive: Story = {
args: {
- intent: 'success',
+ intent: 'positive',
},
};
diff --git a/src/components/AlertBanner/AlertBanner.styles.ts b/src/components/AlertBanner/AlertBanner.styles.ts
index 2de57dba..4ec1bba4 100644
--- a/src/components/AlertBanner/AlertBanner.styles.ts
+++ b/src/components/AlertBanner/AlertBanner.styles.ts
@@ -23,7 +23,7 @@ export const defaultConfig = {
backgroundColor: '$color-background-neutral-strong',
color: '$color-content-primary-inverted',
},
- success: {
+ positive: {
backgroundColor: '$color-background-positive-strong',
color: '$color-content-primary-inverted',
},
@@ -53,13 +53,13 @@ export const defaultConfig = {
},
} satisfies AlertBannerConfig;
-export const resolveIconName = (intent: AlertBannerIntent) => {
- const iconConfig = {
+export const resolveIconName = (intent: AlertBannerIntent): IconName<20> => {
+ const iconConfig: Record> = {
none: '20-info-fill',
- success: '20-check-circle-fill',
+ positive: '20-info-fill',
warning: '20-warning-fill',
negative: '20-alert-fill',
- } satisfies Record>;
+ };
return iconConfig[intent];
};
diff --git a/src/components/AlertBanner/AlertBanner.test.tsx b/src/components/AlertBanner/AlertBanner.test.tsx
index b11e30f1..af0d8dc0 100644
--- a/src/components/AlertBanner/AlertBanner.test.tsx
+++ b/src/components/AlertBanner/AlertBanner.test.tsx
@@ -53,9 +53,9 @@ describe('AlertBanner', () => {
expect(alertBanner).toHaveStyle('background-color: rgb(85, 95, 109);');
});
- it('should render correct intent color (success)', () => {
+ it('should render correct intent color (positive)', () => {
const alertBanner = getAlertBanner(
- ,
+ ,
);
expect(alertBanner).toHaveStyle('color: rgb(255,255,255);');
expect(alertBanner).toHaveStyle('background-color: rgb(29, 124, 77);');
diff --git a/src/components/AlertBanner/types/AlertBannerIntent.type.ts b/src/components/AlertBanner/types/AlertBannerIntent.type.ts
index ba47c21d..67b0d85d 100644
--- a/src/components/AlertBanner/types/AlertBannerIntent.type.ts
+++ b/src/components/AlertBanner/types/AlertBannerIntent.type.ts
@@ -1 +1 @@
-export type AlertBannerIntent = 'none' | 'success' | 'warning' | 'negative';
+export type AlertBannerIntent = 'none' | 'positive' | 'warning' | 'negative';
diff --git a/src/components/Avatar/Avatar.stories.tsx b/src/components/Avatar/Avatar.stories.tsx
index bf2e0094..62ce878b 100644
--- a/src/components/Avatar/Avatar.stories.tsx
+++ b/src/components/Avatar/Avatar.stories.tsx
@@ -17,12 +17,9 @@ const meta = {
img: { if: { arg: 'appearance', eq: 'image' } },
initials: { if: { arg: 'appearance', neq: 'image' } },
emphasis: { if: { arg: 'appearance', neq: 'image' } },
- appearance: {
- options: appearances,
- control: { type: 'select' },
- },
},
parameters: {
+ controls: { sort: 'alpha' },
docs: {
description: {
component:
diff --git a/src/components/Avatar/Avatar.styles.ts b/src/components/Avatar/Avatar.styles.ts
index 97219011..59f6e2f1 100644
--- a/src/components/Avatar/Avatar.styles.ts
+++ b/src/components/Avatar/Avatar.styles.ts
@@ -119,7 +119,7 @@ export const defaultConfig = {
orange: {
emphasis: {
high: {
- color: '$color-nonSemantic-grey-content-primary',
+ color: '$color-nonSemantic-white-content-primary',
backgroundColor: '$color-nonSemantic-orange-background-strong',
},
low: {
diff --git a/src/components/Avatar/Avatar.tsx b/src/components/Avatar/Avatar.tsx
index 8eeabe13..dcfc429d 100644
--- a/src/components/Avatar/Avatar.tsx
+++ b/src/components/Avatar/Avatar.tsx
@@ -1,4 +1,4 @@
-import { type FC, useMemo } from 'react';
+import { FC, useMemo } from 'react';
import type { AvatarProps } from './Avatar.props';
import { stylesBuilder } from './stylesBuilder';
diff --git a/src/components/Avatar/types/AvatarAppearance.type.ts b/src/components/Avatar/types/AvatarAppearance.type.ts
index 00108887..e25e7f97 100644
--- a/src/components/Avatar/types/AvatarAppearance.type.ts
+++ b/src/components/Avatar/types/AvatarAppearance.type.ts
@@ -1,20 +1,17 @@
-export const avatarAppearanceColors = [
- 'blue',
- 'green',
- 'grey',
- 'red',
- 'orange',
- 'raspberry',
- 'magenta',
- 'purple',
- 'grape',
- 'violet',
- 'cyan',
- 'teal',
- 'aquamarine',
- 'emerald',
-] as const;
+export type AvatarAppearanceColors =
+ | 'blue'
+ | 'green'
+ | 'grey'
+ | 'red'
+ | 'orange'
+ | 'raspberry'
+ | 'magenta'
+ | 'purple'
+ | 'grape'
+ | 'violet'
+ | 'cyan'
+ | 'teal'
+ | 'aquamarine'
+ | 'emerald';
-export type AvatarAppearanceColors = (typeof avatarAppearanceColors)[number];
-
-export type AvatarAppearance = 'image' | AvatarAppearanceColors;
+export type AvatarAppearance = AvatarAppearanceColors | 'image';
diff --git a/src/components/Badge/Badge.stories.tsx b/src/components/Badge/Badge.stories.tsx
index 21cc936a..01acc2f7 100644
--- a/src/components/Badge/Badge.stories.tsx
+++ b/src/components/Badge/Badge.stories.tsx
@@ -1,7 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Badge } from './Badge';
-import type { BadgeEmphasis } from './BadgeEmphasis.type';
import { BadgeDocs } from '@/docs-components/BadgeDocs';
import { TetDocs } from '@/docs-components/TetDocs';
@@ -10,14 +9,6 @@ const meta = {
title: 'Badge',
component: Badge,
tags: ['autodocs'],
- argTypes: {
- emphasis: {
- control: {
- type: 'select',
- options: ['high', 'medium', 'low'] satisfies BadgeEmphasis[],
- },
- },
- },
parameters: {
docs: {
description: {
diff --git a/src/components/Badge/Badge.styles.ts b/src/components/Badge/Badge.styles.ts
index e821e272..84980b9f 100644
--- a/src/components/Badge/Badge.styles.ts
+++ b/src/components/Badge/Badge.styles.ts
@@ -271,7 +271,7 @@ export const defaultConfig = {
},
medium: {
border: '1px solid',
- borderColor: '$color-nonSemantic-grey-border-subtle',
+ borderColor: '$color-nonSemantic-grey-border-strong',
color: '$color-nonSemantic-grey-content-primary',
backgroundColor: '$color-nonSemantic-white-background-strong',
},
diff --git a/src/components/Badge/Badge.tsx b/src/components/Badge/Badge.tsx
index 220cad8a..23367160 100644
--- a/src/components/Badge/Badge.tsx
+++ b/src/components/Badge/Badge.tsx
@@ -1,11 +1,11 @@
import { Icon } from '@virtuslab/tetrisly-icons';
-import { type FC, useMemo } from 'react';
+import { FC, useMemo } from 'react';
-import type { BadgeProps } from './Badge.props';
+import { BadgeProps } from './Badge.props';
import { stylesBuilder } from './stylesBuilder';
import { tet } from '@/tetrisly';
-import type { MarginProps } from '@/types/MarginProps';
+import { MarginProps } from '@/types/MarginProps';
export const Badge: FC = ({
appearance,
diff --git a/src/components/Button/Button.stories.tsx b/src/components/Button/Button.stories.tsx
index 0fab6d26..c05997a3 100644
--- a/src/components/Button/Button.stories.tsx
+++ b/src/components/Button/Button.stories.tsx
@@ -23,16 +23,6 @@ const meta = {
defaultValue: 'medium',
control: { type: 'radio' },
},
- variant: {
- options: ['default', 'ghost', 'bare'],
- defaultValue: 'default',
- control: { type: 'radio' },
- },
- intent: {
- options: ['none', 'success', 'destructive'],
- defaultValue: 'none',
- control: { type: 'radio' },
- },
},
parameters: {
docs: {
diff --git a/src/components/Button/Button.styles.ts b/src/components/Button/Button.styles.ts
index ea288cee..c5aba8d7 100644
--- a/src/components/Button/Button.styles.ts
+++ b/src/components/Button/Button.styles.ts
@@ -178,7 +178,7 @@ const size = {
const commonConfig = {
display: 'inline-flex',
- gap: '$space-component-gap-xSmall',
+ gap: '$space-component-gap-small',
w: 'fit-content',
justifyContent: 'center',
alignItems: 'center',
@@ -304,7 +304,7 @@ const defaultButtonConfig = {
const ghostButtonConfig = {
...commonConfig,
- borderRadius: '$border-radius-large',
+ borderRadius: '$border-radius-medium',
backgroundColor: {
_: 'transparent',
hover: '$color-action-ghost-hover',
diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx
index b6abe707..fb786988 100644
--- a/src/components/Button/Button.tsx
+++ b/src/components/Button/Button.tsx
@@ -1,7 +1,7 @@
import { Icon } from '@virtuslab/tetrisly-icons';
-import { type FC, useMemo } from 'react';
+import { FC, useMemo } from 'react';
-import type { ButtonProps } from './Button.props';
+import { ButtonProps } from './Button.props';
import { stylesBuilder } from './stylesBuilder';
import { tet } from '../../tetrisly';
import { Loader } from '../Loader';
@@ -67,7 +67,7 @@ export const Button: FC = ({
)}
{beforeIcon && state !== 'loading' && }
{children}
- {dropdown && }
+ {dropdown && }
{afterIcon && !dropdown && }
);
diff --git a/src/components/Button/stylesBuilder/stylesBuilder.test.ts b/src/components/Button/stylesBuilder/stylesBuilder.test.ts
index bbfdc889..348b9228 100644
--- a/src/components/Button/stylesBuilder/stylesBuilder.test.ts
+++ b/src/components/Button/stylesBuilder/stylesBuilder.test.ts
@@ -27,7 +27,7 @@ describe('stylesBuilder', () => {
boxShadow: '$elevation-bottom-100',
color: '$color-action-inverted-normal',
display: 'inline-flex',
- gap: '$space-component-gap-xSmall',
+ gap: '$space-component-gap-small',
justifyContent: 'center',
opacity: {
disabled: '$opacity-disabled',
diff --git a/src/components/Checkbox/Checkbox.props.ts b/src/components/Checkbox/Checkbox.props.ts
index 2568a1cf..7201ec84 100644
--- a/src/components/Checkbox/Checkbox.props.ts
+++ b/src/components/Checkbox/Checkbox.props.ts
@@ -1,7 +1,6 @@
import type { InputHTMLAttributes } from 'react';
import type { CheckboxConfig } from './Checkbox.styles';
-import { HelperTextProps } from '../HelperText';
export type CheckboxProps = {
isChecked?: boolean;
@@ -14,11 +13,5 @@ export type CheckboxProps = {
> &
(
| { label?: string; helperText?: never }
- | {
- label: string;
- helperText?: Pick<
- HelperTextProps,
- 'hasBeforeIcon' | 'counter' | 'text'
- >;
- }
+ | { label: string; helperText?: string }
);
diff --git a/src/components/Checkbox/Checkbox.stories.tsx b/src/components/Checkbox/Checkbox.stories.tsx
index 8e15917a..a274888e 100644
--- a/src/components/Checkbox/Checkbox.stories.tsx
+++ b/src/components/Checkbox/Checkbox.stories.tsx
@@ -11,14 +11,6 @@ const meta = {
title: 'Checkbox',
component: Checkbox,
tags: ['autodocs'],
- argTypes: {
- state: {
- control: {
- type: 'select',
- options: [undefined, 'disabled', 'alert'],
- },
- },
- },
parameters: {
docs: {
description: {
@@ -42,7 +34,6 @@ export const Default: Story = {};
export const Checked: Story = {
args: {
isChecked: true,
- onChange: () => {},
},
};
@@ -96,7 +87,7 @@ export const Alert: Story = {
args: {
state: 'alert',
label: 'Label',
- helperText: { text: 'Helper text' },
+ helperText: 'Helper text',
},
};
@@ -109,6 +100,6 @@ export const Label: Story = {
export const HelperText: Story = {
args: {
label: 'Label',
- helperText: { text: 'Helper text' },
+ helperText: 'Helper text',
},
};
diff --git a/src/components/Checkbox/Checkbox.test.tsx b/src/components/Checkbox/Checkbox.test.tsx
index 97903333..a1d20e94 100644
--- a/src/components/Checkbox/Checkbox.test.tsx
+++ b/src/components/Checkbox/Checkbox.test.tsx
@@ -19,19 +19,16 @@ const getCheckbox = (jsx: JSX.Element) => {
};
describe('Checkbox', () => {
- customPropTester(
- ,
- {
- containerId: 'checkbox',
- innerElements: {
- input: [],
- checkboxContainer: [],
- checkboxIcon: [],
- label: [],
- helperText: [],
- },
+ customPropTester(, {
+ containerId: 'checkbox',
+ innerElements: {
+ input: [],
+ checkboxContainer: [],
+ checkboxIcon: [],
+ label: [],
+ helperText: [],
},
- );
+ });
beforeEach(() => {
handleEventMock.mockReset();
@@ -104,7 +101,7 @@ describe('Checkbox', () => {
it('should render helper text if props provided', () => {
const { label, helperText } = getCheckbox(
- ,
+ ,
);
expect(label).toHaveTextContent('Label');
diff --git a/src/components/Checkbox/Checkbox.tsx b/src/components/Checkbox/Checkbox.tsx
index 981981c3..988de100 100644
--- a/src/components/Checkbox/Checkbox.tsx
+++ b/src/components/Checkbox/Checkbox.tsx
@@ -34,7 +34,6 @@ export const Checkbox = forwardRef<
label,
helperText,
custom,
- onChange,
...restProps
},
checkboxForwardRef,
@@ -65,15 +64,6 @@ export const Checkbox = forwardRef<
}
}, [checkboxInternalRef, label]);
- if (
- (onChange === undefined && isChecked !== undefined) ||
- (onChange !== undefined && isChecked === undefined)
- ) {
- console.warn(
- 'Checkbox: onChange and isChecked have to be either both provided or both not provided',
- );
- }
-
const input = (
)}
diff --git a/src/components/CheckboxGroup/CheckboxGroup.tsx b/src/components/CheckboxGroup/CheckboxGroup.tsx
index 9a1700da..22f8e23a 100644
--- a/src/components/CheckboxGroup/CheckboxGroup.tsx
+++ b/src/components/CheckboxGroup/CheckboxGroup.tsx
@@ -1,23 +1,25 @@
import {
Children,
FC,
- ForwardRefExoticComponent,
isValidElement,
PropsWithChildren,
useMemo,
} from 'react';
-import type { CheckboxGroupProps } from './CheckboxGroup.props';
+import type {
+ CheckboxGroupProps,
+ CheckboxGroupItemProps,
+} from './CheckboxGroup.props';
import { stylesBuilder } from './stylesBuilder';
-import { Checkbox, type CheckboxProps } from '../Checkbox';
+import { Checkbox } from '../Checkbox';
import { HelperText } from '../HelperText';
import { Label } from '../Label';
import { tet } from '@/tetrisly';
-import type { MarginProps } from '@/types';
+import { MarginProps } from '@/types';
type Props = FC> & {
- Item: ForwardRefExoticComponent;
+ Item: FC;
};
export const CheckboxGroup: Props = ({
@@ -79,4 +81,4 @@ export const CheckboxGroup: Props = ({
);
};
-CheckboxGroup.Item = Checkbox;
+CheckboxGroup.Item = Checkbox as FC;
diff --git a/src/components/Counter/Counter.tsx b/src/components/Counter/Counter.tsx
index 2a8a1640..a5f0a7a5 100644
--- a/src/components/Counter/Counter.tsx
+++ b/src/components/Counter/Counter.tsx
@@ -1,4 +1,4 @@
-import { type FC, useMemo } from 'react';
+import { FC, useMemo } from 'react';
import type { CounterProps } from './Counter.props';
import { stylesBuilder } from './stylesBuilder';
diff --git a/src/components/Divider/Divider.stories.tsx b/src/components/Divider/Divider.stories.tsx
index 000c154b..251b228c 100644
--- a/src/components/Divider/Divider.stories.tsx
+++ b/src/components/Divider/Divider.stories.tsx
@@ -9,11 +9,6 @@ const meta = {
title: 'Divider',
component: Divider,
tags: ['autodocs'],
- render: (args) => (
-
-
-
- ),
parameters: {
docs: {
description: {
diff --git a/src/components/Divider/Divider.tsx b/src/components/Divider/Divider.tsx
index 18ea0181..f54af6d1 100644
--- a/src/components/Divider/Divider.tsx
+++ b/src/components/Divider/Divider.tsx
@@ -1,4 +1,4 @@
-import { type FC, useMemo } from 'react';
+import { FC, useMemo } from 'react';
import type { DividerProps } from './Divider.props';
import { stylesBuilder } from './stylesBuilder';
diff --git a/src/components/HelperText/HelperText.props.ts b/src/components/HelperText/HelperText.props.ts
index 9dcbf219..4aa056e3 100644
--- a/src/components/HelperText/HelperText.props.ts
+++ b/src/components/HelperText/HelperText.props.ts
@@ -7,7 +7,7 @@ export type HelperTextProps = {
current: number;
max: number;
};
- hasBeforeIcon?: boolean;
+ beforeIcon?: boolean;
text: string;
custom?: HelperTextConfig;
};
diff --git a/src/components/HelperText/HelperText.stories.tsx b/src/components/HelperText/HelperText.stories.tsx
index 877c6885..996e1b70 100644
--- a/src/components/HelperText/HelperText.stories.tsx
+++ b/src/components/HelperText/HelperText.stories.tsx
@@ -39,7 +39,7 @@ export const Default: Story = {};
export const DefaultWithIcon: Story = {
args: {
- hasBeforeIcon: true,
+ beforeIcon: true,
},
};
diff --git a/src/components/HelperText/HelperText.test.tsx b/src/components/HelperText/HelperText.test.tsx
index 6f37dbae..7e1e278a 100644
--- a/src/components/HelperText/HelperText.test.tsx
+++ b/src/components/HelperText/HelperText.test.tsx
@@ -14,7 +14,7 @@ const getHelperText = (jsx: JSX.Element) => {
};
describe('HelperText', () => {
- customPropTester(, {
+ customPropTester(, {
containerId: 'helper-text',
props: {
intent: ['none', 'success', 'alert'],
@@ -39,7 +39,7 @@ describe('HelperText', () => {
,
);
@@ -53,7 +53,7 @@ describe('HelperText', () => {
,
);
@@ -67,7 +67,7 @@ describe('HelperText', () => {
,
);
@@ -78,7 +78,7 @@ describe('HelperText', () => {
it('should render icon if passed as a prop', () => {
const { icon } = getHelperText(
- ,
+ ,
);
expect(icon).toBeInTheDocument();
});
diff --git a/src/components/HelperText/HelperText.tsx b/src/components/HelperText/HelperText.tsx
index 09b20e61..aea9c916 100644
--- a/src/components/HelperText/HelperText.tsx
+++ b/src/components/HelperText/HelperText.tsx
@@ -10,7 +10,7 @@ import { MarginProps } from '@/types/MarginProps';
export const HelperText: FC = ({
intent = 'none',
- hasBeforeIcon = false,
+ beforeIcon = false,
counter,
text,
custom,
@@ -21,7 +21,7 @@ export const HelperText: FC = ({
return (
- {hasBeforeIcon && (
+ {beforeIcon && (
= ({
const iconName = useMemo(() => resolveIconName(intent), [intent]);
return (
-
+
= ({
intent = 'informative',
diff --git a/src/components/InlineSearchInput/InlineSearchInput.tsx b/src/components/InlineSearchInput/InlineSearchInput.tsx
index 1cd61da8..42bdc85b 100644
--- a/src/components/InlineSearchInput/InlineSearchInput.tsx
+++ b/src/components/InlineSearchInput/InlineSearchInput.tsx
@@ -1,11 +1,11 @@
-import { type FC, useMemo } from 'react';
+import { FC, useMemo } from 'react';
-import type { InlineSearchInputProps } from './InlineSearchInput.props';
+import { InlineSearchInputProps } from './InlineSearchInput.props';
import { defaultConfig } from './InlineSearchInput.styles';
import { SearchInput } from '../SearchInput';
import { mergeConfigWithCustom } from '@/services';
-import type { MarginProps } from '@/types';
+import { MarginProps } from '@/types';
export const InlineSearchInput: FC = ({
custom,
diff --git a/src/components/Label/Label.tsx b/src/components/Label/Label.tsx
index 54d4af35..ff2fe2be 100644
--- a/src/components/Label/Label.tsx
+++ b/src/components/Label/Label.tsx
@@ -1,12 +1,12 @@
import { Icon } from '@virtuslab/tetrisly-icons';
-import { type FC, useMemo } from 'react';
+import { FC, useMemo } from 'react';
import type { LabelProps } from './Label.props';
import { stylesBuilder } from './stylesBuilder';
import { Button } from '../Button';
import { tet } from '@/tetrisly';
-import type { MarginProps } from '@/types/MarginProps';
+import { MarginProps } from '@/types/MarginProps';
export const Label: FC = ({
label,
diff --git a/src/components/Loader/Loader.tsx b/src/components/Loader/Loader.tsx
index 063fe11b..2f0fe253 100644
--- a/src/components/Loader/Loader.tsx
+++ b/src/components/Loader/Loader.tsx
@@ -1,15 +1,13 @@
-import { type FC, useMemo } from 'react';
+import { FC, useMemo } from 'react';
import { AnimatedProgress } from './AnimatedProgress';
-import type { LoaderProps } from './Loader.props';
+import { LoaderProps } from './Loader.props';
import { stylesBuilder } from './stylesBuilder';
import { tet } from '@/tetrisly';
-import type { MarginProps } from '@/types';
+import { MarginProps } from '@/types';
-type NewType = FC;
-
-export const Loader: NewType = ({
+export const Loader: FC = ({
appearance = 'primary',
progress,
shape,
diff --git a/src/components/Popover/Popover.styles.ts b/src/components/Popover/Popover.styles.ts
index 3e82b502..81c1ed7e 100644
--- a/src/components/Popover/Popover.styles.ts
+++ b/src/components/Popover/Popover.styles.ts
@@ -86,7 +86,7 @@ export const defaultConfig = {
text: '$typo-body-medium',
color: '$color-content-secondary',
padding: '$space-component-padding-large',
- ring: '$border-width-small',
+ ring: '$border-width-focus',
ringColor: '$color-border-defaultA',
boxShadow: '$elevation-bottom-300',
backgroundColor: '$color-interaction-background-modeless',
diff --git a/src/components/Popover/Popover.tsx b/src/components/Popover/Popover.tsx
index 089dea65..e9d53f13 100644
--- a/src/components/Popover/Popover.tsx
+++ b/src/components/Popover/Popover.tsx
@@ -1,5 +1,5 @@
import { useSpace } from '@xstyled/styled-components';
-import { type PropsWithChildren, useMemo, type FC } from 'react';
+import { FC, PropsWithChildren, useMemo } from 'react';
import { AnchorWrapper, PopoverContent } from './AnchorWrapper.styled';
import type { PopoverProps } from './Popover.props';
diff --git a/src/components/RadioButton/RadioButton.stories.tsx b/src/components/RadioButton/RadioButton.stories.tsx
index 9ec25e45..75679ecc 100644
--- a/src/components/RadioButton/RadioButton.stories.tsx
+++ b/src/components/RadioButton/RadioButton.stories.tsx
@@ -32,7 +32,6 @@ export const Default: Story = {};
export const Checked: Story = {
args: {
isChecked: true,
- onChange: () => {},
},
};
diff --git a/src/components/RadioButton/RadioButton.tsx b/src/components/RadioButton/RadioButton.tsx
index c3b33803..ebcc14ee 100644
--- a/src/components/RadioButton/RadioButton.tsx
+++ b/src/components/RadioButton/RadioButton.tsx
@@ -13,7 +13,7 @@ export const RadioButton = forwardRef<
RadioButtonProps & MarginProps
>(
(
- { isChecked, onChange, state, label, helperText, custom, ...restProps },
+ { isChecked, state, label, helperText, custom, ...restProps },
radioButtonRef,
) => {
const [radioButtonProps, containerProps] = extractInputProps(restProps);
@@ -22,28 +22,12 @@ export const RadioButton = forwardRef<
const radioButtonId = useId();
- if (state === 'alert' && isChecked) {
- console.warn('RadioButton: Checked alert state does not exist.');
- }
-
- if (
- (isChecked !== undefined && onChange === undefined) ||
- (isChecked === undefined && onChange !== undefined)
- ) {
- console.warn(
- 'RadioButton: isChecked and onChange must be both defined or both undefined.',
- );
- }
-
- const isAlert = state === 'alert' && !isChecked;
-
const input = (
diff --git a/src/components/RadioButtonGroup/RadioButtonGroup.tsx b/src/components/RadioButtonGroup/RadioButtonGroup.tsx
index 523cc028..0210dbc0 100644
--- a/src/components/RadioButtonGroup/RadioButtonGroup.tsx
+++ b/src/components/RadioButtonGroup/RadioButtonGroup.tsx
@@ -1,10 +1,10 @@
import {
Children,
cloneElement,
- type FC,
+ FC,
isValidElement,
- type PropsWithChildren,
- type ReactElement,
+ PropsWithChildren,
+ ReactElement,
useMemo,
} from 'react';
@@ -21,7 +21,7 @@ import { tet } from '@/tetrisly';
import type { MarginProps } from '@/types';
type Props = FC> & {
- Item: FC;
+ Item: React.FC;
};
export const RadioButtonGroup: Props = ({
diff --git a/src/components/SearchInput/SearchInput.tsx b/src/components/SearchInput/SearchInput.tsx
index 63e51821..3c136fdb 100644
--- a/src/components/SearchInput/SearchInput.tsx
+++ b/src/components/SearchInput/SearchInput.tsx
@@ -1,9 +1,9 @@
-import type { FC } from 'react';
+import { FC } from 'react';
-import type { SearchInputProps } from './SearchInput.props';
-import { TextInput, type TextInputProps } from '../TextInput';
+import { SearchInputProps } from './SearchInput.props';
+import { TextInput, TextInputProps } from '../TextInput';
-import type { MarginProps } from '@/types';
+import { MarginProps } from '@/types';
const SEARCH_ICON_COMPONENT: TextInputProps['beforeComponent'] = {
type: 'Icon',
diff --git a/src/components/Select/Select.test.tsx b/src/components/Select/Select.test.tsx
index 135352d7..59d2bc62 100644
--- a/src/components/Select/Select.test.tsx
+++ b/src/components/Select/Select.test.tsx
@@ -9,9 +9,9 @@ const getSelect = (jsx: JSX.Element) => {
const { getByTestId, queryByTestId } = render(jsx);
return {
- textInput: getByTestId('select'),
- input: getByTestId('select-input') as HTMLInputElement,
- beforeComponent: queryByTestId('select-before-component'),
+ textInput: getByTestId('text-input'),
+ input: getByTestId('text-input-input') as HTMLInputElement,
+ beforeComponent: queryByTestId('text-input-before-component'),
};
};
diff --git a/src/components/Select/Select.tsx b/src/components/Select/Select.tsx
index 0870600e..395c12fb 100644
--- a/src/components/Select/Select.tsx
+++ b/src/components/Select/Select.tsx
@@ -1,91 +1,17 @@
-import { Icon } from '@virtuslab/tetrisly-icons';
-import type { FC } from 'react';
+import { FC } from 'react';
-import type { SelectProps } from './Select.props';
-import { Avatar } from '../Avatar';
-import { IconButton } from '../IconButton';
-import type { TextInputProps } from '../TextInput';
-import { useTextInput } from '../TextInput/useTextInput';
+import { SelectProps } from './Select.props';
+import { TextInput, TextInputProps } from '../TextInput';
-import { tet } from '@/tetrisly';
-import type { MarginProps } from '@/types';
+import { MarginProps } from '@/types';
-const DROPDOWN_INDICATOR_COMPONENT = {
+const DROPDOWN_INDICATOR_COMPONENT: TextInputProps['afterComponent'] = {
type: 'IconButton',
props: {
icon: '20-chevron-down-small',
},
-} satisfies TextInputProps['afterComponent'];
-
-export const Select: FC = ({
- state,
- beforeComponent,
- hasClearButton,
- value,
- ...props
-}) => {
- const afterComponent = DROPDOWN_INDICATOR_COMPONENT;
- const {
- containerRef,
- handleContainerClick,
- styles,
- containerProps,
- innerValue,
- handleOnChange,
- handleOnClear,
- textInputProps,
- } = useTextInput({
- beforeComponent,
- afterComponent,
- ...props,
- });
- return (
-
- {!!beforeComponent && (
-
- {beforeComponent.type === 'Icon' && (
-
-
-
- )}
- {beforeComponent.type === 'Avatar' && (
-
- )}
-
- )}
-
- {!!hasClearButton && (value || innerValue) && (
-
- )}
-
-
-
-
- );
};
+
+export const Select: FC = (props) => (
+
+);
diff --git a/src/components/SocialButton/SocialButton.tsx b/src/components/SocialButton/SocialButton.tsx
index 9a627614..b320f981 100644
--- a/src/components/SocialButton/SocialButton.tsx
+++ b/src/components/SocialButton/SocialButton.tsx
@@ -5,7 +5,7 @@ import { socials } from './socials';
import { stylesBuilder } from './stylesBuilder';
import { tet } from '@/tetrisly';
-import type { MarginProps } from '@/types';
+import { MarginProps } from '@/types';
export const SocialButton: FC = ({
platform,
diff --git a/src/components/SocialButton/socials/Apple.tsx b/src/components/SocialButton/socials/Apple.tsx
index 5d67f362..7a81222a 100644
--- a/src/components/SocialButton/socials/Apple.tsx
+++ b/src/components/SocialButton/socials/Apple.tsx
@@ -1,6 +1,6 @@
-import type { FC } from 'react';
+import { FC } from 'react';
-import type { SocialProps } from './SocialProps';
+import { SocialProps } from './SocialProps';
import { WithLoader } from './WithLoader';
import { tet } from '@/tetrisly';
diff --git a/src/components/SocialButton/socials/Facebook.tsx b/src/components/SocialButton/socials/Facebook.tsx
index 8e57632d..feaa7a20 100644
--- a/src/components/SocialButton/socials/Facebook.tsx
+++ b/src/components/SocialButton/socials/Facebook.tsx
@@ -1,20 +1,20 @@
-import type { FC } from 'react';
+import { FC } from 'react';
-import type { SocialProps } from './SocialProps';
+import { SocialProps } from './SocialProps';
import { WithLoader } from './WithLoader';
export const Facebook: FC = ({ fill, loading }) => (
diff --git a/src/components/SocialButton/socials/Figma.tsx b/src/components/SocialButton/socials/Figma.tsx
index 17dad1d2..687a1bf1 100644
--- a/src/components/SocialButton/socials/Figma.tsx
+++ b/src/components/SocialButton/socials/Figma.tsx
@@ -1,40 +1,40 @@
-import type { FC } from 'react';
+import { FC } from 'react';
-import type { SocialProps } from './SocialProps';
+import { SocialProps } from './SocialProps';
import { WithLoader } from './WithLoader';
export const Figma: FC = ({ fill, loading }) => (