Skip to content

Commit

Permalink
refactor: Text 컴포넌트 HTMLAttributes 타입 확장 및 Theme Font 값 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
semnil5202 committed Oct 19, 2024
1 parent 42adf63 commit 6bf44ba
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "concept-be-design-system",
"description": "컨셉비 디자인 시스템",
"version": "0.5.3",
"version": "0.5.5",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';

import { Alert, BottomSheet, Button, Confirm } from '.';
import { Alert, BottomSheet, Button, Confirm, Text } from '.';

const App = () => {
const [isBottomSheetOpen, setIsBottomSheetOpen] = useState(false);
Expand All @@ -10,7 +10,7 @@ const App = () => {
return (
<>
<Button onClick={() => setIsBottomSheetOpen(true)}>Bottom Sheet</Button>

<Text font="suit10eb">피드</Text>
<BottomSheet
isOpen={isBottomSheetOpen}
onClose={() => setIsBottomSheetOpen(false)}
Expand Down
8 changes: 5 additions & 3 deletions src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import styled from '@emotion/styled';
import {
ReactNode,
ElementType,
ComponentPropsWithoutRef,
CSSProperties,
ElementType,
HTMLAttributes,
ReactNode,
} from 'react';

import { ReactComponent as SVGTextRequired } from '../../assets/svg/text_required.svg';
Expand All @@ -16,7 +17,8 @@ type Props<T extends ElementType> = {
color?: ColorKeyType;
required?: boolean;
wordBreak?: CSSProperties['wordBreak'];
} & ComponentPropsWithoutRef<T>;
} & ComponentPropsWithoutRef<T> &
HTMLAttributes<T>;

const Text = <T extends ElementType>({
as,
Expand Down
4 changes: 4 additions & 0 deletions src/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const color = {
} as const;

const font = {
suit10eb: {
fontSize: 10,
fontWeight: 800,
},
suit12r: {
fontSize: 12,
fontWeight: 400,
Expand Down

0 comments on commit 6bf44ba

Please sign in to comment.