Skip to content

Commit

Permalink
refactor(ds): Move related components to product-components
Browse files Browse the repository at this point in the history
  • Loading branch information
jvaclavik committed Sep 6, 2024
1 parent 275f3dd commit a7c8b54
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 46 deletions.
1 change: 0 additions & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"react-svg": "^16.1.33",
"react-use": "^17.5.0",
"styled-components": "^6.1.8",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@storybook/addon-actions": "^7.6.13",
Expand Down
8 changes: 0 additions & 8 deletions packages/components/src/components/TrezorLogo/trezorLogos.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export * from './components/AssetShareIndicator/AssetShareIndicator';
export * from './components/AssetLogo/AssetLogo';
export * from './components/CoinLogo/CoinLogo';
export * from './components/Flag/Flag';
export * from './components/TrezorLogo/TrezorLogo';
export * from './components/AutoScalingInput/AutoScalingInput';
export * from './components/Badge/Badge';
export * from './components/buttons/Button/Button';
Expand All @@ -27,7 +26,6 @@ export {
CollapsibleBox,
type CollapsibleBoxProps,
} from './components/CollapsibleBox/CollapsibleBox';
export * from './components/RotateDeviceImage/RotateDeviceImage';
export * from './components/DataAnalytics';
export * from './components/Divider/Divider';
export * from './components/Dropdown/Dropdown';
Expand Down Expand Up @@ -57,7 +55,6 @@ export * from './components/modals/Modal/Backdrop';
export * from './components/modals/Modal/Modal';
export * from './components/NewModal/NewModal';
export * from './components/Note/Note';
export * from './components/PasswordStrengthIndicator/PasswordStrengthIndicator';
export * from './components/ResizableBox/ResizableBox';
export * from './components/skeletons/SkeletonCircle';
export * from './components/skeletons/SkeletonRectangle';
Expand Down
3 changes: 2 additions & 1 deletion packages/connect-explorer-theme/src/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { ArrowRightIcon, MenuIcon } from 'nextra/icons';
import type { Item, MenuItem, PageItem } from 'nextra/normalize-pages';

import { Elevation, borders, mapElevationToBackground, spacingsPx } from '@trezor/theme';
import { TrezorLogo, useElevation } from '@trezor/components';
import { useElevation } from '@trezor/components';
import { TrezorLogo } from '@trezor/product-components';

import { useConfig, useMenu } from '../contexts';
import { renderComponent } from '../utils';
Expand Down
1 change: 1 addition & 0 deletions packages/connect-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dependencies": {
"@suite-common/validators": "workspace:*",
"@trezor/components": "workspace:*",
"@trezor/product-components": "workspace:*",
"@trezor/connect": "workspace:*",
"@trezor/connect-analytics": "workspace:*",
"@trezor/connect-common": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ import {
Input,
Tooltip,
TooltipProps,
PasswordStrengthIndicator,
motionAnimation,
Icon,
} from '@trezor/components';

import { PasswordStrengthIndicator } from '@trezor/product-components';
import { WalletType } from './types';

type WrapperProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,8 @@ import { AnimatePresence, motion } from 'framer-motion';
import styled, { useTheme } from 'styled-components';

import { isAndroid } from '@trezor/env-utils';
import {
Card,
Column,
Row,
Input,
Button,
motionAnimation,
PasswordStrengthIndicator,
Icon,
} from '@trezor/components';
import { Card, Column, Row, Input, Button, motionAnimation, Icon } from '@trezor/components';
import { PasswordStrengthIndicator } from '@trezor/product-components';
import { spacings, spacingsPx, typography } from '@trezor/theme';
import { useKeyPress } from '@trezor/react-utils';

Expand Down
4 changes: 3 additions & 1 deletion packages/product-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dependencies": {
"@suite-common/validators": "workspace:*",
"@trezor/components": "workspace:*",
"@trezor/product-components": "workspace:*",
"@trezor/connect": "workspace:*",
"@trezor/dom-utils": "workspace:*",
"@trezor/env-utils": "workspace:*",
Expand All @@ -28,7 +29,8 @@
"framer-motion": "^11.0.3",
"react": "18.2.0",
"react-intl": "^6.6.8",
"styled-components": "^6.1.8"
"styled-components": "^6.1.8",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@storybook/addon-actions": "^7.6.13",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
typography,
} from '@trezor/theme';
import { useElevation } from '@trezor/components';
import { RotateDeviceImage } from '@trezor/components';
import { RotateDeviceImage } from '@trezor/product-components';

const Column = styled.div`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import { isAndroid } from '@trezor/env-utils';
import { AnimatePresence, motion } from 'framer-motion';
import { FormattedMessage, useIntl } from 'react-intl';
import {
Card,
PasswordStrengthIndicator,
Column,
Row,
Input,
Button,
motionAnimation,
Icon,
} from '@trezor/components';
import { Card, Column, Row, Input, Button, motionAnimation, Icon } from '@trezor/components';
import { PasswordStrengthIndicator } from '../PasswordStrengthIndicator/PasswordStrengthIndicator';
import styled, { useTheme } from 'styled-components';
import { spacings, spacingsPx, typography } from '@trezor/theme';
import { useKeyPress } from '@trezor/react-utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { DeviceAnimation } from '../animations/DeviceAnimation';
import { DeviceAnimation } from '@trezor/components';
import { DeviceModelInternal } from '@trezor/connect';
import { Image } from '../Image/Image';
import { Image } from '@trezor/components';
import styled from 'styled-components';

export type RotateDeviceImageProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta, StoryObj } from '@storybook/react';
import { TrezorLogo as TrezorLogoComponent, TrezorLogoProps } from '../../index';
import { TrezorLogoProps, TrezorLogo as TrezorLogoComponent } from './TrezorLogo';

const meta: Meta = {
title: 'TrezorLogo',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';
import { Meta, StoryObj } from '@storybook/react';
import { TrezorLogo } from '../../index';
import { StoryColumn } from '../../support/Story';
import { TrezorLogo } from './TrezorLogo';
import { StoryColumn } from '@trezor/components';

interface WrapperProps {
isDark?: boolean;
Expand All @@ -16,7 +16,7 @@ const LogoWrapper = styled.div<WrapperProps>`
`;

const meta: Meta = {
title: 'TrezorLogos',
title: 'TrezorLogo',
} as Meta;
export default meta;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const LOGOS: { [key: string]: any } = {
HORIZONTAL: require('../../../../components/src/images/trezor_logo_horizontal.svg'),
VERTICAL: require('../../../../components/src/images/trezor_logo_vertical.svg'),
SYMBOL: require('../../../../components/src/images/trezor_logo_symbol.svg'),
SUITE: require('../../../../components/src/images/trezor_logo_suite.svg'),
SUITE_SQUARE: require('../../../../components/src/images/trezor_logo_suite_square.svg'),
SUITE_COMPACT: require('../../../../components/src/images/trezor_logo_suite_compact.svg'),
};
3 changes: 3 additions & 0 deletions packages/product-components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export { PassphraseTypeCard } from './components/PassphraseTypeCard/PassphraseTypeCard';
export { ConfirmOnDevice } from './components/ConfirmOnDevice/ConfirmOnDevice';
export { RotateDeviceImage } from './components/RotateDeviceImage/RotateDeviceImage';
export { TrezorLogo } from './components/TrezorLogo/TrezorLogo';
export { PasswordStrengthIndicator } from './components/PasswordStrengthIndicator/PasswordStrengthIndicator';
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useMemo, ReactNode } from 'react';
import styled from 'styled-components';

import { TrezorLogo, Button, variables } from '@trezor/components';
import { Button, variables } from '@trezor/components';
import { TrezorLogo } from '@trezor/product-components';
import { TREZOR_SUPPORT_URL } from '@trezor/urls';
import { TrezorLink, Translation } from 'src/components/suite';
import { OnboardingProgressBar } from 'src/components/onboarding';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DeviceDetail } from 'src/views/suite/SwitchDevice/DeviceItem/DeviceDeta
import { MouseEventHandler } from 'react';
import { TrezorDevice } from 'src/types/suite';
import { spacingsPx } from '@trezor/theme';
import { RotateDeviceImage } from '@trezor/components';
import { RotateDeviceImage } from '@trezor/product-components';
import { DeviceStatusText } from 'src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText';

type DeviceStatusProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';

import { TrezorDevice } from '@suite-common/suite-types';
import { RotateDeviceImage, variables } from '@trezor/components';
import { variables } from '@trezor/components';
import { RotateDeviceImage } from '@trezor/product-components';
import { Translation } from 'src/components/suite';
import styled from 'styled-components';

Expand Down

0 comments on commit a7c8b54

Please sign in to comment.