Skip to content

Commit

Permalink
feat: publish Skeleton component
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokyeom committed Oct 20, 2024
1 parent b5380ff commit 39ad242
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/ui/Skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import type { SkeletonProps as RadixSkeletonProps } from '@radix-ui/themes';
import { Skeleton as RadixSkeleton } from '@radix-ui/themes';
import '@radix-ui/themes/styles.css';
import { colors } from '@sopt-makers/colors';
import { forwardRef } from 'react';

export type SkeletonProps = RadixSkeletonProps;

/**
* - 자세한 옵션은 [radix-ui/Skeleton](https://www.radix-ui.com/themes/docs/components/skeleton)문서를 참고해주세요.
*/
export const Skeleton = forwardRef<HTMLSpanElement, SkeletonProps>((props, forwardedRef) => {
const { children, ...restProps } = props;

return (
<RadixSkeleton
ref={forwardedRef}
style={{ backgroundColor: colors.gray700, borderRadius: '9999px' }}
{...restProps}
>
{children}
</RadixSkeleton>
);
});

Skeleton.displayName = 'Skeleton';
1 change: 1 addition & 0 deletions packages/ui/Skeleton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Skeleton';
1 change: 1 addition & 0 deletions packages/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export { default as Tag } from './Tag';
export { default as Chip } from './Chip';
export { default as Callout } from './Callout';
export { default as Tab } from './Tab';
export * from './Skeleton';

// test component
export { default as Test } from './Test';

0 comments on commit 39ad242

Please sign in to comment.