Browse Source

SONAR-22049 Move ToggleButton to sonar-aligned folder

pull/3361/head
stanislavh 1 month ago
parent
commit
7067c5cd8c

+ 1
- 1
server/sonar-web/design-system/src/components/Tabs.tsx View File

import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
import tw from 'twin.macro'; import tw from 'twin.macro';
import { OPACITY_20_PERCENT, themeBorder, themeColor } from '../helpers'; import { OPACITY_20_PERCENT, themeBorder, themeColor } from '../helpers';
import { getTabId, getTabPanelId } from '../helpers/tabs';
import { BareButton } from '../sonar-aligned/components/buttons'; import { BareButton } from '../sonar-aligned/components/buttons';
import { getTabId, getTabPanelId } from '../sonar-aligned/helpers/tabs';
import { Badge } from './Badge'; import { Badge } from './Badge';


type TabValueType = string | number | boolean; type TabValueType = string | number | boolean;

+ 0
- 1
server/sonar-web/design-system/src/components/index.ts View File

export * from './Text'; export * from './Text';
export * from './TextAccordion'; export * from './TextAccordion';
export * from './Title'; export * from './Title';
export * from './ToggleButton';
export { Tooltip } from './Tooltip'; export { Tooltip } from './Tooltip';
export { TopBar } from './TopBar'; export { TopBar } from './TopBar';
export * from './TreeMap'; export * from './TreeMap';

+ 0
- 1
server/sonar-web/design-system/src/helpers/index.ts View File

export * from './constants'; export * from './constants';
export * from './keyboard'; export * from './keyboard';
export * from './positioning'; export * from './positioning';
export * from './tabs';
export * from './theme'; export * from './theme';

server/sonar-web/design-system/src/components/ToggleButton.tsx → server/sonar-web/design-system/src/sonar-aligned/components/ToggleButton.tsx View File

*/ */
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import tw from 'twin.macro'; import tw from 'twin.macro';
import { Badge } from '../../components/Badge';
import { themeBorder, themeColor, themeContrast } from '../../helpers/theme';
import { getTabId, getTabPanelId } from '../helpers/tabs'; import { getTabId, getTabPanelId } from '../helpers/tabs';
import { themeBorder, themeColor, themeContrast } from '../helpers/theme';
import { ButtonSecondary } from '../sonar-aligned/components/buttons';
import { Badge } from './Badge';
import { ButtonSecondary } from './buttons';


type ToggleButtonValueType = string | number | boolean; type ToggleButtonValueType = string | number | boolean;



server/sonar-web/design-system/src/components/__tests__/ToggleButton-test.tsx → server/sonar-web/design-system/src/sonar-aligned/components/__tests__/ToggleButton-test.tsx View File

*/ */
import { screen } from '@testing-library/react'; import { screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event'; import userEvent from '@testing-library/user-event';
import { render } from '../../../helpers/testUtils';
import { FCProps } from '../../../types/misc';
import { getTabPanelId } from '../../helpers'; import { getTabPanelId } from '../../helpers';
import { render } from '../../helpers/testUtils';
import { FCProps } from '../../types/misc';
import { ToggleButton, ToggleButtonsOption } from '../ToggleButton'; import { ToggleButton, ToggleButtonsOption } from '../ToggleButton';


it('should render all options', async () => { it('should render all options', async () => {

+ 1
- 0
server/sonar-web/design-system/src/sonar-aligned/components/index.ts View File

export { DismissableFlagMessage, FlagMessage } from './FlagMessage'; export { DismissableFlagMessage, FlagMessage } from './FlagMessage';
export * from './MetricsRatingBadge'; export * from './MetricsRatingBadge';
export * from './Table'; export * from './Table';
export * from './ToggleButton';
export * from './buttons'; export * from './buttons';
export * from './typography'; export * from './typography';

server/sonar-web/design-system/src/helpers/__tests__/tabs-test.ts → server/sonar-web/design-system/src/sonar-aligned/helpers/__tests__/tabs-test.ts View File


+ 21
- 0
server/sonar-web/design-system/src/sonar-aligned/helpers/index.ts View File

/*
* SonarQube
* Copyright (C) 2009-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

export * from './tabs';

server/sonar-web/design-system/src/helpers/tabs.ts → server/sonar-web/design-system/src/sonar-aligned/helpers/tabs.ts View File


+ 1
- 0
server/sonar-web/design-system/src/sonar-aligned/index.ts View File

*/ */


export * from './components'; export * from './components';
export * from './helpers';
export * from './types'; export * from './types';

Loading…
Cancel
Save