= {
label: { control: 'text' },
required: { control: 'boolean' },
placeholder: { control: 'text' },
+ helpText: { control: 'text' },
value: { control: 'text' },
},
args: {
@@ -56,6 +57,25 @@ export const Showcase: Story = {
),
};
+export const WithHelpText: Story = {
+ render: () => (
+
+ {STATES.map((state) => (
+
+ ))}
+
+ ),
+};
+
export const PriceVariant: Story = {
render: () => (
`
+ ${applyTypography('typography.caption.xsmall')}
+ font-weight: ${getTypographyToken('typography.caption.small-medium')
+ .fontWeight};
+ color: ${({ $state }) =>
+ $state === 'error' ? getToken('fg.accent-red.normal') : '#444950'};
+`;
diff --git a/src/shared/design-system/ui/Input/Input.tsx b/src/shared/design-system/ui/Input/Input.tsx
index 225e201d..466112ad 100644
--- a/src/shared/design-system/ui/Input/Input.tsx
+++ b/src/shared/design-system/ui/Input/Input.tsx
@@ -1,5 +1,6 @@
import { useId, forwardRef } from 'react';
import type { ReactNode, ChangeEventHandler, InputHTMLAttributes } from 'react';
+import SvgSystemDanger from '@/shared/assets/svgs/icon/SystemDanger';
import * as S from './Input.styles';
type InputState = 'default' | 'error' | 'disabled';
@@ -11,6 +12,7 @@ interface InputProps
state?: InputState;
variant?: InputVariant;
trailingIcon?: ReactNode;
+ helpText?: string;
value?: string;
onChange?: ChangeEventHandler;
}
@@ -24,6 +26,7 @@ const Input = forwardRef(function Input(
state = 'default',
variant = 'default',
trailingIcon,
+ helpText,
value,
onChange,
onClick,
@@ -67,7 +70,16 @@ const Input = forwardRef(function Input(
)}
- {/* TODO: 헬프텍스트 - 디자인 확정 후 추가 예정 */}
+ {helpText && variant === 'default' && (
+
+ {state === 'error' && (
+
+
+
+ )}
+ {helpText}
+
+ )}
);
});
diff --git a/src/shared/design-system/ui/NameChip/NameChip.tsx b/src/shared/design-system/ui/NameChip/NameChip.tsx
deleted file mode 100644
index 43d46248..00000000
--- a/src/shared/design-system/ui/NameChip/NameChip.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import * as S from './NameChip.styles';
-
-// HACK : ExpenseTimelineContent 에서 사용하는 NameChip이 정의되어 있지 않아서 임의로 black variant를 추가함.
-type NameChipVariant = 'selected' | 'unselected' | 'disabled' | 'red' | 'black';
-type NameChipSize = 'm' | 's';
-
-interface NameChipProps {
- label: string;
- variant?: NameChipVariant;
- size?: NameChipSize;
-}
-
-function NameChip(props: NameChipProps) {
- const { label, variant = 'selected', size = 'm' } = props;
-
- return (
-
- {label}
-
- );
-}
-
-export { NameChip };
-export type { NameChipProps, NameChipVariant, NameChipSize };
diff --git a/src/shared/design-system/ui/NameChip/index.ts b/src/shared/design-system/ui/NameChip/index.ts
deleted file mode 100644
index 16086b1f..00000000
--- a/src/shared/design-system/ui/NameChip/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { NameChip } from './NameChip';
-export type { NameChipProps, NameChipVariant, NameChipSize } from './NameChip';
diff --git a/src/shared/design-system/ui/index.ts b/src/shared/design-system/ui/index.ts
index 5cf32d89..017348c2 100644
--- a/src/shared/design-system/ui/index.ts
+++ b/src/shared/design-system/ui/index.ts
@@ -19,7 +19,8 @@ export { Keypad } from './Keypad';
export type { KeyValue } from './Keypad';
export { Modal } from './Modal';
export type { ModalProps } from './Modal';
-export { NameChip } from './NameChip';
+export { Chip } from './Chip';
+export type { ChipProps, ChipVariant, ChipSize } from './Chip';
export { PaidChip } from './PaidChip';
export type { PaidChipStatus } from './PaidChip';
export type { HeaderProps } from './Header';