Skip to content

Commit

Permalink
chore: Move Separator component to UI directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz committed Jan 28, 2025
1 parent 5315a45 commit b5640b1
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ReactNode } from 'react';

import { BackButton } from '../buttons/backButton';
import { Separator } from '../separator';
import { H3, Paragraph } from '../typography';
import { Separator } from '../ui/separator';

export type PageHeadlineProps = {
hasBackButton?: boolean;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryFn, StoryObj } from '@storybook/react';

import { Separator } from './separator.component';
import { Separator } from '../separator';

const Template: StoryFn = () => {
return (
Expand All @@ -11,7 +11,7 @@ const Template: StoryFn = () => {
};

const meta: Meta = {
title: 'Core / Separator',
title: 'Core / UI / Separator',
component: Template,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { screen } from '@testing-library/react';

import { render } from '../../../tests/utils/rendering';
import { Separator } from '../separator.component';
import { Separator } from '../separator';

describe('Separator: Component', () => {
describe('UI/Separator: Component', () => {
it('should render', async () => {
render(<Separator />);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import * as SeparatorPrimitive from '@radix-ui/react-separator';
import * as React from 'react';

import { cn } from '../../lib/utils';
import { cn } from '@sb/webapp-core/lib/utils';

const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
<SeparatorPrimitive.Root
ref={ref}
data-testid="Separator"
decorative={decorative}
orientation={orientation}
className={cn('bg-border shrink-0', orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', className)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useQuery } from '@apollo/client';
import { gql } from '@sb/webapp-api-client/graphql';
import { PageHeadline } from '@sb/webapp-core/components/pageHeadline';
import { PageLayout } from '@sb/webapp-core/components/pageLayout';
import { Separator } from '@sb/webapp-core/components/separator';
import { Separator } from '@sb/webapp-core/components/ui/separator';
import { Skeleton } from '@sb/webapp-core/components/ui/skeleton';
import { useCurrentTenant } from '@sb/webapp-tenants/providers';
import { useParams } from 'react-router';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMutation, useQuery } from '@apollo/client';
import { PageHeadline } from '@sb/webapp-core/components/pageHeadline';
import { PageLayout } from '@sb/webapp-core/components/pageLayout';
import { Separator } from '@sb/webapp-core/components/separator';
import { Separator } from '@sb/webapp-core/components/ui/separator';
import { Skeleton } from '@sb/webapp-core/components/ui/skeleton';
import { useGenerateLocalePath } from '@sb/webapp-core/hooks';
import { trackEvent } from '@sb/webapp-core/services/analytics';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StripeSubscriptionQueryQuery } from '@sb/webapp-api-client';
import { Button, RadioButton } from '@sb/webapp-core/components/buttons';
import { FormItem, FormLabel, FormMessage } from '@sb/webapp-core/components/forms';
import { RadioGroup } from '@sb/webapp-core/components/forms/radioGroup';
import { Separator } from '@sb/webapp-core/components/separator';
import { Separator } from '@sb/webapp-core/components/ui/separator';
import { Skeleton } from '@sb/webapp-core/components/ui/skeleton';
import { mapConnection } from '@sb/webapp-core/utils/graphql';
import { useCurrentTenant } from '@sb/webapp-tenants/providers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FragmentType, getFragmentData } from '@sb/webapp-api-client/graphql';
import { Button, ButtonVariant } from '@sb/webapp-core/components/buttons';
import { EmptyState } from '@sb/webapp-core/components/emptyState';
import { Separator } from '@sb/webapp-core/components/separator';
import { H4 } from '@sb/webapp-core/components/typography';
import { Separator } from '@sb/webapp-core/components/ui/separator';
import { Skeleton } from '@sb/webapp-core/components/ui/skeleton';
import { CheckCheck } from 'lucide-react';
import { isEmpty } from 'ramda';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useApiForm } from '@sb/webapp-api-client/hooks';
import { useCommonQuery } from '@sb/webapp-api-client/providers';
import { Button, ButtonVariant } from '@sb/webapp-core/components/buttons';
import { Input } from '@sb/webapp-core/components/forms';
import { Separator } from '@sb/webapp-core/components/separator';
import { H1, H4, Paragraph, Small } from '@sb/webapp-core/components/typography';
import { Separator } from '@sb/webapp-core/components/ui/separator';
import { trackEvent } from '@sb/webapp-core/services/analytics';
import { useToast } from '@sb/webapp-core/toast/useToast';
import * as QRCode from 'qrcode';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { TenantUserRole } from '@sb/webapp-api-client';
import { Link } from '@sb/webapp-core/components/buttons';
import { buttonVariants } from '@sb/webapp-core/components/buttons/button/button.styles';
import { Separator } from '@sb/webapp-core/components/separator';
import { Alert, AlertDescription, AlertTitle } from '@sb/webapp-core/components/ui/alert';
import { Separator } from '@sb/webapp-core/components/ui/separator';
import { useGenerateLocalePath, useMediaQuery } from '@sb/webapp-core/hooks';
import { cn } from '@sb/webapp-core/lib/utils';
import { media } from '@sb/webapp-core/theme';
Expand Down
52 changes: 26 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b5640b1

Please sign in to comment.