From 24b52609f185cfe3dd6dcbffc2bdb7a89ccab944 Mon Sep 17 00:00:00 2001 From: Andrey Morozov Date: Mon, 29 Jan 2024 15:28:24 +0300 Subject: [PATCH] refactor!: rename .yc class prefix (#1260) --- .storybook/theme-addon/register.tsx | 2 +- src/components/Alert/Alert.test.tsx | 5 ++-- .../Alert/__snapshots__/Alert.test.tsx.snap | 30 +++++++++---------- src/components/Avatar/Avatar.scss | 2 +- src/components/Avatar/Avatar.tsx | 4 +-- .../Button/__tests__/Button.test.tsx | 14 ++++----- src/components/Card/__tests__/Card.test.tsx | 16 +++++----- .../Checkbox/__tests__/Checkbox.test.tsx | 2 +- src/components/Disclosure/Disclosure.scss | 2 +- src/components/Disclosure/cn.ts | 4 +-- .../__stories__/DropdownMenu.stories.scss | 8 ----- src/components/Label/README.md | 6 ++-- src/components/Menu/README.md | 2 +- src/components/Pagination/Pagination.scss | 2 +- src/components/Pagination/Pagination.tsx | 4 +-- .../PaginationEllipsis.scss | 2 +- .../PaginationEllipsis/PaginationEllipsis.tsx | 4 +-- .../PaginationInput/PaginationInput.scss | 2 +- .../PaginationInput/PaginationInput.tsx | 4 +-- .../PaginationPage/PaginationPage.scss | 2 +- .../PaginationPage/PaginationPage.tsx | 4 +-- .../PaginationPageOf/PaginationPageOf.scss | 2 +- .../PaginationPageOf/PaginationPageOf.tsx | 4 +-- src/components/Persona/i18n/index.ts | 4 +-- src/components/Popover/Popover.scss | 6 ++-- .../Popover/__tests__/Popover.test.tsx | 4 +-- src/components/Radio/__tests__/Radio.test.tsx | 2 +- .../RadioGroup/__tests__/RadioGroup.test.tsx | 4 +-- src/components/Select/Select.scss | 2 +- .../Select/__stories__/SelectShowcase.scss | 4 +-- .../components/EmptyOptions/EmptyOptions.scss | 2 +- .../components/EmptyOptions/EmptyOptions.tsx | 2 +- .../components/SelectClear/SelectClear.scss | 2 +- .../SelectControl/SelectControl.scss | 4 +-- .../components/SelectFilter/SelectFilter.scss | 2 +- .../components/SelectFilter/SelectFilter.tsx | 2 +- .../components/SelectList/GroupLabel.tsx | 2 +- .../components/SelectList/OptionWrap.tsx | 2 +- .../components/SelectList/SelectList.scss | 2 +- .../components/SelectPopup/SelectPopup.scss | 2 +- .../components/SelectPopup/SelectPopup.tsx | 4 +-- src/components/Select/constants.ts | 2 +- src/components/Table/__tests__/Table.test.tsx | 10 +++---- src/components/Tabs/__tests__/Tabs.test.tsx | 20 ++++++------- .../Tabs/__tests__/TabsItem.test.tsx | 10 +++---- .../Toaster/__stories__/ToasterShowcase.scss | 2 +- .../Toaster/__stories__/ToasterShowcase.tsx | 4 +-- src/components/Toc/Toc.scss | 2 +- src/components/Toc/Toc.tsx | 4 +-- src/components/Toc/TocItem/TocItem.scss | 2 +- src/components/Toc/TocItem/TocItem.tsx | 4 +-- .../Toc/__stories__/Toc.stories.scss | 2 +- .../Toc/__stories__/Toc.stories.tsx | 4 +-- src/components/User/User.scss | 2 +- src/components/User/User.tsx | 4 +-- .../controls/TextArea/TextArea.scss | 2 +- src/components/controls/TextArea/TextArea.tsx | 4 +-- .../controls/TextArea/TextAreaControl.tsx | 4 +-- .../__tests__/TextInput.input.test.tsx | 18 +++++------ .../common/ClearButton/ClearButton.scss | 2 +- .../common/ClearButton/ClearButton.tsx | 4 +-- .../controls/common/ClearButton/i18n/index.ts | 4 +-- .../layout/spacing/spacing.test.tsx | 6 ++-- src/components/theme/ThemeProvider.tsx | 7 ++--- src/components/theme/dom-helpers.ts | 14 +-------- src/components/utils/cn.ts | 4 +-- src/components/variables.scss | 7 +++-- src/demo/DocsDecorator/DocsDecorator.scss | 18 +++++------ src/hooks/useUniqId/useUniqId.ts | 4 +-- styles/mixins.scss | 2 +- styles/styles.scss | 2 +- 71 files changed, 165 insertions(+), 188 deletions(-) diff --git a/.storybook/theme-addon/register.tsx b/.storybook/theme-addon/register.tsx index 272b96ca5f..7c3ad306b4 100644 --- a/.storybook/theme-addon/register.tsx +++ b/.storybook/theme-addon/register.tsx @@ -7,7 +7,7 @@ import type {API} from '@storybook/api'; import {getThemeType} from '../../src/components/theme/getThemeType'; import {themes} from '../theme'; -const ADDON_ID = 'yc-theme-addon'; +const ADDON_ID = 'g-theme-addon'; const TOOL_ID = `${ADDON_ID}tool`; addons.register(ADDON_ID, (api) => { diff --git a/src/components/Alert/Alert.test.tsx b/src/components/Alert/Alert.test.tsx index 5f89bb3cf5..fcc0a43ed2 100644 --- a/src/components/Alert/Alert.test.tsx +++ b/src/components/Alert/Alert.test.tsx @@ -6,6 +6,7 @@ import {render, screen} from '../../../test-utils/utils'; import {Flex} from '../layout'; import {Alert} from './Alert'; +import {bAlert} from './constants'; import type {AlertTheme} from './types'; const title = 'Where will you go, hero?'; @@ -80,7 +81,7 @@ describe('Alert', () => { ); // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access - const icon = await container.querySelector('.yc-alert__icon'); + const icon = await container.querySelector(`.${bAlert('icon')}`); expect(icon).toBeInTheDocument(); }, @@ -90,7 +91,7 @@ describe('Alert', () => { const {container} = render(); // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access - const icon = await container.querySelector('.yc-alert__icon'); + const icon = await container.querySelector(`.${bAlert('icon')}`); expect(icon).not.toBeInTheDocument(); }); diff --git a/src/components/Alert/__snapshots__/Alert.test.tsx.snap b/src/components/Alert/__snapshots__/Alert.test.tsx.snap index 117c792346..eadecdf83e 100644 --- a/src/components/Alert/__snapshots__/Alert.test.tsx.snap +++ b/src/components/Alert/__snapshots__/Alert.test.tsx.snap @@ -3,18 +3,18 @@ exports[`Alert has predicted styles if inline layout rendered 1`] = `
Where will you go, hero?