diff --git a/.templates/component/package.json b/.templates/component/package.json
index 6f655c1f..5e2cb05f 100644
--- a/.templates/component/package.json
+++ b/.templates/component/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/.templates/component/src/Component.stories.tsx b/.templates/component/src/Component.stories.tsx
index c2e12101..1acbfd1b 100644
--- a/.templates/component/src/Component.stories.tsx
+++ b/.templates/component/src/Component.stories.tsx
@@ -1,4 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
+
import { Component } from './Component';
const meta = {
diff --git a/.templates/component/vitest.config.ts b/.templates/component/vitest.config.ts
index a9178275..e663baf0 100644
--- a/.templates/component/vitest.config.ts
+++ b/.templates/component/vitest.config.ts
@@ -1,4 +1,5 @@
import { defineProject, mergeConfig } from 'vitest/config';
+
import defaultConfig from '../../vitest.config';
export default mergeConfig(
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 162f7a46..b166f505 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,6 +1,3 @@
{
- "recommendations": [
- "biomejs.biome",
- "github.vscode-github-actions"
- ]
+ "recommendations": ["biomejs.biome", "github.vscode-github-actions"]
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index b59dd216..068a1dc5 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -2,8 +2,7 @@
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
- "quickfix.biome": "explicit",
- "source.organizeImports.biome": "explicit"
+ "source.fixAll.biome": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
@@ -22,5 +21,5 @@
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
- },
+ }
}
diff --git a/commitlint.config.ts b/commitlint.config.ts
index 40f9c72f..4f0cec6d 100644
--- a/commitlint.config.ts
+++ b/commitlint.config.ts
@@ -2,6 +2,7 @@ const englishOnly = /^[A-Za-z0-9\s!@#$%^&*(),.?":{}|<>_-]+$/;
// https://commitlint.js.org/reference/configuration.html#typescript-configuration
import { RuleConfigSeverity, type UserConfig } from '@commitlint/types';
+
const Configuration: UserConfig = {
extends: ['@commitlint/config-conventional'],
// parserPreset: '',
diff --git a/package.json b/package.json
index ab0409ae..75f90b81 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,8 @@
"prepare": "husky",
"cz": "cz",
"format": "biome format --write",
- "lint": "biome lint --write",
+ "lint": "biome lint",
+ "lint:fix": "biome check --write",
"dev:storybook": "storybook dev -p 6006 public",
"build:storybook": "storybook build public",
"serve:storybook": "serve storybook-static -p 6006",
diff --git a/packages/accordion/package.json b/packages/accordion/package.json
index e9328151..b17b26ad 100644
--- a/packages/accordion/package.json
+++ b/packages/accordion/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/avatar/package.json b/packages/avatar/package.json
index 3a879dc1..1e700861 100644
--- a/packages/avatar/package.json
+++ b/packages/avatar/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/avatar/src/Avatar.css.ts b/packages/avatar/src/Avatar.css.ts
index e716b4b5..94bc11b1 100644
--- a/packages/avatar/src/Avatar.css.ts
+++ b/packages/avatar/src/Avatar.css.ts
@@ -1,4 +1,5 @@
import { style, styleVariants } from '@vanilla-extract/css';
+
import { AvatarShape, AvatarSize } from './Avatar';
export const root = style({
diff --git a/packages/avatar/src/Avatar.stories.tsx b/packages/avatar/src/Avatar.stories.tsx
index c6da5934..bf3b5869 100644
--- a/packages/avatar/src/Avatar.stories.tsx
+++ b/packages/avatar/src/Avatar.stories.tsx
@@ -1,5 +1,6 @@
import { faker } from '@faker-js/faker';
import type { Meta, StoryObj } from '@storybook/react';
+
import { Avatar } from './Avatar';
const meta = {
diff --git a/packages/avatar/src/Avatar.test.tsx b/packages/avatar/src/Avatar.test.tsx
index f80e003d..5c0def45 100644
--- a/packages/avatar/src/Avatar.test.tsx
+++ b/packages/avatar/src/Avatar.test.tsx
@@ -1,6 +1,7 @@
import { faker } from '@faker-js/faker';
import { render, screen } from '@testing-library/react';
import { describe, expect, it, test } from 'vitest';
+
import { Avatar, type AvatarShape, type AvatarSize } from './Avatar';
const testImage = faker.image.avatar();
diff --git a/packages/avatar/src/Avatar.tsx b/packages/avatar/src/Avatar.tsx
index 30ac1d0b..2a2c2ee7 100644
--- a/packages/avatar/src/Avatar.tsx
+++ b/packages/avatar/src/Avatar.tsx
@@ -1,6 +1,9 @@
+import { type ComponentProps, type ForwardedRef, forwardRef } from 'react';
+
import { Slot } from '@radix-ui/react-slot';
+
import { clsx as cx } from 'clsx';
-import { type ComponentProps, type ForwardedRef, forwardRef } from 'react';
+
import * as styles from './Avatar.css';
export interface AvatarProps extends ComponentProps<'div'> {
diff --git a/packages/avatar/vitest.config.ts b/packages/avatar/vitest.config.ts
index a9178275..e663baf0 100644
--- a/packages/avatar/vitest.config.ts
+++ b/packages/avatar/vitest.config.ts
@@ -1,4 +1,5 @@
import { defineProject, mergeConfig } from 'vitest/config';
+
import defaultConfig from '../../vitest.config';
export default mergeConfig(
diff --git a/packages/badge/.storybook/main.ts b/packages/badge/.storybook/main.ts
index 846b85c9..3724f800 100644
--- a/packages/badge/.storybook/main.ts
+++ b/packages/badge/.storybook/main.ts
@@ -2,11 +2,7 @@ import type { StorybookConfig } from '@storybook/react-vite';
export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
- addons: [
- '@storybook/addon-essentials',
- '@storybook/addon-interactions',
- '@storybook/addon-links',
- ],
+ addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/addon-links'],
framework: {
name: '@storybook/react-vite',
options: {},
diff --git a/packages/badge/.storybook/preview.ts b/packages/badge/.storybook/preview.ts
index 836149df..6c95c9f1 100644
--- a/packages/badge/.storybook/preview.ts
+++ b/packages/badge/.storybook/preview.ts
@@ -1,5 +1,6 @@
import 'sanitize.css';
import 'sanitize.css/typography.css';
+
import type { Preview } from '@storybook/react';
export default {
diff --git a/packages/badge/package.json b/packages/badge/package.json
index 9fa182dc..a38ce3f0 100644
--- a/packages/badge/package.json
+++ b/packages/badge/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/badge/src/Badge.css.ts b/packages/badge/src/Badge.css.ts
index 080da695..f98474f0 100644
--- a/packages/badge/src/Badge.css.ts
+++ b/packages/badge/src/Badge.css.ts
@@ -1,6 +1,7 @@
-import { style, styleVariants } from '@vanilla-extract/css';
import { color as colorToken, fontSize as fontSizeToken } from '@sipe-team/tokens';
+import { style, styleVariants } from '@vanilla-extract/css';
+
// Define the types for our component
export const BadgeSize = {
small: 'small',
diff --git a/packages/badge/src/Badge.stories.tsx b/packages/badge/src/Badge.stories.tsx
index 892569fa..7df46a73 100644
--- a/packages/badge/src/Badge.stories.tsx
+++ b/packages/badge/src/Badge.stories.tsx
@@ -1,4 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
+
import { Badge, type BadgeSize, type BadgeVariant } from './Badge';
import { BadgeSize as BadgeSizeEnum, BadgeVariant as BadgeVariantEnum } from './Badge.css';
diff --git a/packages/badge/src/Badge.test.tsx b/packages/badge/src/Badge.test.tsx
index 3771bd84..5bcbb016 100644
--- a/packages/badge/src/Badge.test.tsx
+++ b/packages/badge/src/Badge.test.tsx
@@ -1,7 +1,9 @@
+import { color as colorToken } from '@sipe-team/tokens';
+
import { render, screen } from '@testing-library/react';
import { expect, test } from 'vitest';
+
import { Badge } from './Badge';
-import { color as colorToken } from '@sipe-team/tokens';
test('children으로 입력한 텍스트를 표시한다.', () => {
render(테스트);
diff --git a/packages/badge/src/Badge.tsx b/packages/badge/src/Badge.tsx
index 91035e40..a9cb6fab 100644
--- a/packages/badge/src/Badge.tsx
+++ b/packages/badge/src/Badge.tsx
@@ -1,6 +1,9 @@
+import { type ComponentProps, type ForwardedRef, forwardRef } from 'react';
+
import { Typography } from '@sipe-team/typography';
+
import { clsx as cx } from 'clsx';
-import { type ComponentProps, type ForwardedRef, forwardRef } from 'react';
+
import * as styles from './Badge.css';
export type BadgeSize = keyof typeof styles.BadgeSize;
diff --git a/packages/badge/vitest.config.ts b/packages/badge/vitest.config.ts
index a9178275..e663baf0 100644
--- a/packages/badge/vitest.config.ts
+++ b/packages/badge/vitest.config.ts
@@ -1,4 +1,5 @@
import { defineProject, mergeConfig } from 'vitest/config';
+
import defaultConfig from '../../vitest.config';
export default mergeConfig(
diff --git a/packages/button/package.json b/packages/button/package.json
index 2f8daab7..8d2d014b 100644
--- a/packages/button/package.json
+++ b/packages/button/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/button/vitest.config.ts b/packages/button/vitest.config.ts
index a9178275..e663baf0 100644
--- a/packages/button/vitest.config.ts
+++ b/packages/button/vitest.config.ts
@@ -1,4 +1,5 @@
import { defineProject, mergeConfig } from 'vitest/config';
+
import defaultConfig from '../../vitest.config';
export default mergeConfig(
diff --git a/packages/card/.storybook/main.ts b/packages/card/.storybook/main.ts
index 846b85c9..3724f800 100644
--- a/packages/card/.storybook/main.ts
+++ b/packages/card/.storybook/main.ts
@@ -2,11 +2,7 @@ import type { StorybookConfig } from '@storybook/react-vite';
export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
- addons: [
- '@storybook/addon-essentials',
- '@storybook/addon-interactions',
- '@storybook/addon-links',
- ],
+ addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/addon-links'],
framework: {
name: '@storybook/react-vite',
options: {},
diff --git a/packages/card/.storybook/preview.ts b/packages/card/.storybook/preview.ts
index 836149df..6c95c9f1 100644
--- a/packages/card/.storybook/preview.ts
+++ b/packages/card/.storybook/preview.ts
@@ -1,5 +1,6 @@
import 'sanitize.css';
import 'sanitize.css/typography.css';
+
import type { Preview } from '@storybook/react';
export default {
diff --git a/packages/card/package.json b/packages/card/package.json
index 661c07a9..536a6ced 100644
--- a/packages/card/package.json
+++ b/packages/card/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/card/src/Card.css.ts b/packages/card/src/Card.css.ts
index 4e9cb3b8..6e2720d2 100644
--- a/packages/card/src/Card.css.ts
+++ b/packages/card/src/Card.css.ts
@@ -1,4 +1,5 @@
import { color } from '@sipe-team/tokens';
+
import { recipe } from '@vanilla-extract/recipes';
export const CardVariant = {
diff --git a/packages/card/src/Card.stories.tsx b/packages/card/src/Card.stories.tsx
index 36984ca7..c74e19db 100644
--- a/packages/card/src/Card.stories.tsx
+++ b/packages/card/src/Card.stories.tsx
@@ -1,4 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
+
import { Card } from './Card';
const meta = {
diff --git a/packages/card/src/Card.test.tsx b/packages/card/src/Card.test.tsx
index c847d554..c7078445 100644
--- a/packages/card/src/Card.test.tsx
+++ b/packages/card/src/Card.test.tsx
@@ -1,6 +1,8 @@
import { color } from '@sipe-team/tokens';
+
import { render, screen } from '@testing-library/react';
import { expect, test } from 'vitest';
+
import { Card } from './Card';
test('children으로 넘어간 요소를 반환한다. ', () => {
diff --git a/packages/card/src/Card.tsx b/packages/card/src/Card.tsx
index 6821a03c..aec5c134 100644
--- a/packages/card/src/Card.tsx
+++ b/packages/card/src/Card.tsx
@@ -1,7 +1,10 @@
+import { type ComponentProps, type ForwardedRef, forwardRef } from 'react';
+
import { Slot } from '@radix-ui/react-slot';
+
import { clsx as cx } from 'clsx';
-import { type ComponentProps, type ForwardedRef, forwardRef } from 'react';
-import { card, type CardVariant, type CardRatio } from './Card.css';
+
+import { type CardRatio, type CardVariant, card } from './Card.css';
export interface CardProps extends ComponentProps<'div'> {
asChild?: boolean;
diff --git a/packages/card/vitest.config.ts b/packages/card/vitest.config.ts
index a9178275..e663baf0 100644
--- a/packages/card/vitest.config.ts
+++ b/packages/card/vitest.config.ts
@@ -1,4 +1,5 @@
import { defineProject, mergeConfig } from 'vitest/config';
+
import defaultConfig from '../../vitest.config';
export default mergeConfig(
diff --git a/packages/checkbox/package.json b/packages/checkbox/package.json
index 079a99ad..c5938ac8 100644
--- a/packages/checkbox/package.json
+++ b/packages/checkbox/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/checkbox/src/Checkbox.css.ts b/packages/checkbox/src/Checkbox.css.ts
index 32d65e01..30b2f92e 100644
--- a/packages/checkbox/src/Checkbox.css.ts
+++ b/packages/checkbox/src/Checkbox.css.ts
@@ -1,6 +1,8 @@
import { color } from '@sipe-team/tokens';
+
import type { RecipeVariants } from '@vanilla-extract/recipes';
import { recipe } from '@vanilla-extract/recipes';
+
import { CheckboxSize } from './Checkbox';
export const CHECKBOX_SIZES = {
diff --git a/packages/checkbox/src/Checkbox.stories.tsx b/packages/checkbox/src/Checkbox.stories.tsx
index facd2254..4afa8deb 100644
--- a/packages/checkbox/src/Checkbox.stories.tsx
+++ b/packages/checkbox/src/Checkbox.stories.tsx
@@ -1,5 +1,7 @@
-import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
+
+import type { Meta, StoryObj } from '@storybook/react';
+
import { Checkbox } from './Checkbox';
import { useCheckboxGroup } from './hooks/useCheckboxGroup';
diff --git a/packages/checkbox/src/Checkbox.test.tsx b/packages/checkbox/src/Checkbox.test.tsx
index be99b6ea..5432c114 100644
--- a/packages/checkbox/src/Checkbox.test.tsx
+++ b/packages/checkbox/src/Checkbox.test.tsx
@@ -1,8 +1,9 @@
import { fireEvent, render, screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
import { describe, expect, test, vi } from 'vitest';
-import { Checkbox, CheckboxSize, type CheckBoxRootBaseProps } from './Checkbox';
+
+import { type CheckBoxRootBaseProps, Checkbox, CheckboxSize } from './Checkbox';
import { CHECKBOX_SIZES } from './Checkbox.css';
-import userEvent from '@testing-library/user-event';
const RenderBasicCheckbox = ({ label, ...props }: CheckBoxRootBaseProps & { label?: string }) => {
return (
diff --git a/packages/checkbox/src/Checkbox.tsx b/packages/checkbox/src/Checkbox.tsx
index df89a165..284b9549 100644
--- a/packages/checkbox/src/Checkbox.tsx
+++ b/packages/checkbox/src/Checkbox.tsx
@@ -1,13 +1,15 @@
-import clsx from 'clsx';
import {
+ type ChangeEventHandler,
+ type ComponentProps,
createContext,
forwardRef,
+ type Ref,
useContext,
useId,
- type ChangeEventHandler,
- type ComponentProps,
- type Ref,
} from 'react';
+
+import clsx from 'clsx';
+
import { container, input, label } from './Checkbox.css';
import { useControllableState } from './hooks/useControllableState';
diff --git a/packages/checkbox/vitest.config.ts b/packages/checkbox/vitest.config.ts
index a9178275..e663baf0 100644
--- a/packages/checkbox/vitest.config.ts
+++ b/packages/checkbox/vitest.config.ts
@@ -1,4 +1,5 @@
import { defineProject, mergeConfig } from 'vitest/config';
+
import defaultConfig from '../../vitest.config';
export default mergeConfig(
diff --git a/packages/divider/package.json b/packages/divider/package.json
index af278cdf..08c0e07d 100644
--- a/packages/divider/package.json
+++ b/packages/divider/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/divider/src/Divider.css.ts b/packages/divider/src/Divider.css.ts
index de228394..7249464a 100644
--- a/packages/divider/src/Divider.css.ts
+++ b/packages/divider/src/Divider.css.ts
@@ -1,5 +1,7 @@
import { color } from '@sipe-team/tokens';
+
import { style, styleVariants } from '@vanilla-extract/css';
+
import type { ColorType, OrientationType } from './constants';
export const base = style({
diff --git a/packages/divider/src/Divider.stories.tsx b/packages/divider/src/Divider.stories.tsx
index 20500b6a..3d74ce14 100644
--- a/packages/divider/src/Divider.stories.tsx
+++ b/packages/divider/src/Divider.stories.tsx
@@ -1,7 +1,9 @@
import { Typography } from '@sipe-team/typography';
+
import type { Meta, StoryObj } from '@storybook/react';
-import { Divider } from './Divider';
+
import { DIVIDER_COLORS, DIVIDER_ORIENTATIONS } from './constants';
+import { Divider } from './Divider';
const meta = {
title: 'Components/Divider',
diff --git a/packages/divider/src/Divider.test.tsx b/packages/divider/src/Divider.test.tsx
index 694c88e1..07d32139 100644
--- a/packages/divider/src/Divider.test.tsx
+++ b/packages/divider/src/Divider.test.tsx
@@ -1,6 +1,8 @@
import { color } from '@sipe-team/tokens';
+
import { render, screen } from '@testing-library/react';
import { describe, expect, test } from 'vitest';
+
import { Divider } from './Divider';
describe('Divider', () => {
diff --git a/packages/divider/src/Divider.tsx b/packages/divider/src/Divider.tsx
index 1db39d65..217fe141 100644
--- a/packages/divider/src/Divider.tsx
+++ b/packages/divider/src/Divider.tsx
@@ -1,7 +1,9 @@
-import { clsx as cx } from 'clsx';
import { type ComponentProps, forwardRef } from 'react';
-import * as styles from './Divider.css';
+
+import { clsx as cx } from 'clsx';
+
import type { ColorType, OrientationType } from './constants';
+import * as styles from './Divider.css';
export interface DividerProps extends ComponentProps<'hr'> {
orientation?: OrientationType;
diff --git a/packages/divider/vitest.config.ts b/packages/divider/vitest.config.ts
index a9178275..e663baf0 100644
--- a/packages/divider/vitest.config.ts
+++ b/packages/divider/vitest.config.ts
@@ -1,4 +1,5 @@
import { defineProject, mergeConfig } from 'vitest/config';
+
import defaultConfig from '../../vitest.config';
export default mergeConfig(
diff --git a/packages/flex/package.json b/packages/flex/package.json
index 63d8bec1..19637a30 100644
--- a/packages/flex/package.json
+++ b/packages/flex/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/flex/src/Flex.css.ts b/packages/flex/src/Flex.css.ts
index 194d13db..01bbb9da 100644
--- a/packages/flex/src/Flex.css.ts
+++ b/packages/flex/src/Flex.css.ts
@@ -1,5 +1,6 @@
import { style, styleVariants } from '@vanilla-extract/css';
-import type { FlexDirection, FlexAlign, FlexJustify, FlexWrap } from './constants';
+
+import type { FlexAlign, FlexDirection, FlexJustify, FlexWrap } from './constants';
export const base = style({
display: 'flex',
diff --git a/packages/flex/src/Flex.stories.tsx b/packages/flex/src/Flex.stories.tsx
index c8cc435f..5df52165 100644
--- a/packages/flex/src/Flex.stories.tsx
+++ b/packages/flex/src/Flex.stories.tsx
@@ -1,4 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
+
import { Flex } from './Flex';
const meta = {
diff --git a/packages/flex/src/Flex.test.tsx b/packages/flex/src/Flex.test.tsx
index b070b016..eb71a4bd 100644
--- a/packages/flex/src/Flex.test.tsx
+++ b/packages/flex/src/Flex.test.tsx
@@ -1,7 +1,9 @@
+import { type CSSProperties, createElement } from 'react';
+
import { faker } from '@faker-js/faker';
import { render, screen } from '@testing-library/react';
-import { type CSSProperties, createElement } from 'react';
import { describe, expect, it } from 'vitest';
+
import { Flex } from './Flex';
describe('Flex', () => {
@@ -39,20 +41,19 @@ describe('Flex', () => {
{ justifyContent: 'space-between' },
{ justifyContent: 'space-around' },
{ justifyContent: 'space-evenly' },
- ] satisfies Array<{ justifyContent: CSSProperties['justifyContent'] }>)(
- 'flex의 justify prop에 $justifyContent 속성을 주입하면 해당 속성을 적용한다.',
- ({ justifyContent }) => {
- render(
-
- item 1
- item 2
- ,
- );
+ ] satisfies Array<{
+ justifyContent: CSSProperties['justifyContent'];
+ }>)('flex의 justify prop에 $justifyContent 속성을 주입하면 해당 속성을 적용한다.', ({ justifyContent }) => {
+ render(
+
+ item 1
+ item 2
+ ,
+ );
- const flexContainer = screen.getByTestId('flex-container');
- expect(flexContainer).toHaveStyle({ justifyContent });
- },
- );
+ const flexContainer = screen.getByTestId('flex-container');
+ expect(flexContainer).toHaveStyle({ justifyContent });
+ });
});
describe('align', () => {
@@ -62,20 +63,19 @@ describe('Flex', () => {
{ alignItems: 'center' },
{ alignItems: 'baseline' },
{ alignItems: 'stretch' },
- ] satisfies Array<{ alignItems: CSSProperties['alignItems'] }>)(
- 'flex의 align prop에 $alignItems 속성을 주입하면 해당 속성을 적용한다.',
- ({ alignItems }) => {
- render(
-
- item 1
- item 2
- ,
- );
+ ] satisfies Array<{
+ alignItems: CSSProperties['alignItems'];
+ }>)('flex의 align prop에 $alignItems 속성을 주입하면 해당 속성을 적용한다.', ({ alignItems }) => {
+ render(
+
+ item 1
+ item 2
+ ,
+ );
- const flexContainer = screen.getByTestId('flex-container');
- expect(flexContainer).toHaveStyle({ alignItems });
- },
- );
+ const flexContainer = screen.getByTestId('flex-container');
+ expect(flexContainer).toHaveStyle({ alignItems });
+ });
});
describe('wrap', () => {
@@ -101,20 +101,19 @@ describe('Flex', () => {
{ direction: 'row-reverse' },
{ direction: 'column-reverse' },
{ direction: 'column-reverse' },
- ] satisfies Array<{ direction: CSSProperties['flexDirection'] }>)(
- 'flex의 direction prop에 $direction 속성을 주입하면 해당 속성을 적용한다.',
- ({ direction }) => {
- render(
-
- item 1
- item 2
- ,
- );
+ ] satisfies Array<{
+ direction: CSSProperties['flexDirection'];
+ }>)('flex의 direction prop에 $direction 속성을 주입하면 해당 속성을 적용한다.', ({ direction }) => {
+ render(
+
+ item 1
+ item 2
+ ,
+ );
- const flexContainer = screen.getByTestId('flex-container');
- expect(flexContainer).toHaveStyle({ flexDirection: direction });
- },
- );
+ const flexContainer = screen.getByTestId('flex-container');
+ expect(flexContainer).toHaveStyle({ flexDirection: direction });
+ });
describe('basis', () => {
it.each([
@@ -208,36 +207,39 @@ describe('Flex', () => {
{ style: { alignItems: 'center' } },
{ style: { flexWrap: 'wrap' } },
{ style: { flexDirection: 'column' } },
- ] satisfies Array<{ style: CSSProperties }>)(
- 'flex의 style prop에 $style 속성을 주입하면 해당 속성을 적용한다.',
- ({ style }) => {
- render(
-
- item 1
- item 2
- ,
- );
+ ] satisfies Array<{ style: CSSProperties }>)('flex의 style prop에 $style 속성을 주입하면 해당 속성을 적용한다.', ({
+ style,
+ }) => {
+ render(
+
+ item 1
+ item 2
+ ,
+ );
- const flexContainer = screen.getByTestId('flex-container');
- expect(flexContainer).toHaveStyle(style);
- },
- );
+ const flexContainer = screen.getByTestId('flex-container');
+ expect(flexContainer).toHaveStyle(style);
+ });
});
describe('polymorphic', () => {
- it.each(['span', 'nav', 'button', 'input', 'label', 'div'])(
- 'flex의 asChild prop에 true 속성을 주입하면 자식으로 %s 엘리먼트가 전달되면 해당 엘리먼트의 태그로 렌더링된다',
- (element) => {
- render(
-
- {createElement(element)}
- ,
- );
+ it.each([
+ 'span',
+ 'nav',
+ 'button',
+ 'input',
+ 'label',
+ 'div',
+ ])('flex의 asChild prop에 true 속성을 주입하면 자식으로 %s 엘리먼트가 전달되면 해당 엘리먼트의 태그로 렌더링된다', (element) => {
+ render(
+
+ {createElement(element)}
+ ,
+ );
- const flexContainer = screen.getByTestId('flex-container');
- expect(flexContainer).toBeInTheDocument();
- expect(flexContainer.tagName.toLowerCase()).toBe(element);
- },
- );
+ const flexContainer = screen.getByTestId('flex-container');
+ expect(flexContainer).toBeInTheDocument();
+ expect(flexContainer.tagName.toLowerCase()).toBe(element);
+ });
});
});
diff --git a/packages/flex/vitest.config.ts b/packages/flex/vitest.config.ts
index a9178275..e663baf0 100644
--- a/packages/flex/vitest.config.ts
+++ b/packages/flex/vitest.config.ts
@@ -1,4 +1,5 @@
import { defineProject, mergeConfig } from 'vitest/config';
+
import defaultConfig from '../../vitest.config';
export default mergeConfig(
diff --git a/packages/grid/package.json b/packages/grid/package.json
index 7ccd6dc5..f51ffbff 100644
--- a/packages/grid/package.json
+++ b/packages/grid/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/grid/src/Grid.test.tsx b/packages/grid/src/Grid.test.tsx
index 935d3261..3393eb4b 100644
--- a/packages/grid/src/Grid.test.tsx
+++ b/packages/grid/src/Grid.test.tsx
@@ -57,19 +57,18 @@ describe('Grid', () => {
for (const { prop, style, values } of gridProperties) {
describe(prop, () => {
- it.each(values.map((value) => ({ [prop]: value })))(
- `should apply ${style} when ${prop} prop is $${prop}`,
- (propValue) => {
- render(
-
- item 1
- ,
- );
-
- const gridContainer = screen.getByTestId('grid-container');
- expect(gridContainer).toHaveStyle({ [style]: propValue[prop] });
- },
- );
+ it.each(
+ values.map((value) => ({ [prop]: value })),
+ )(`should apply ${style} when ${prop} prop is $${prop}`, (propValue) => {
+ render(
+
+ item 1
+ ,
+ );
+
+ const gridContainer = screen.getByTestId('grid-container');
+ expect(gridContainer).toHaveStyle({ [style]: propValue[prop] });
+ });
});
}
});
@@ -202,19 +201,23 @@ describe('Grid', () => {
});
describe('polymorphic behavior', () => {
- it.each(['span', 'nav', 'button', 'input', 'label', 'div'])(
- 'should render as %s element when asChild is true',
- (element) => {
- render(
-
- {createElement(element)}
- ,
- );
-
- const gridContainer = screen.getByTestId('grid-container');
- expect(gridContainer).toBeInTheDocument();
- expect(gridContainer.tagName.toLowerCase()).toBe(element);
- },
- );
+ it.each([
+ 'span',
+ 'nav',
+ 'button',
+ 'input',
+ 'label',
+ 'div',
+ ])('should render as %s element when asChild is true', (element) => {
+ render(
+
+ {createElement(element)}
+ ,
+ );
+
+ const gridContainer = screen.getByTestId('grid-container');
+ expect(gridContainer).toBeInTheDocument();
+ expect(gridContainer.tagName.toLowerCase()).toBe(element);
+ });
});
});
diff --git a/packages/grid/src/Grid.tsx b/packages/grid/src/Grid.tsx
index d27611b6..c1fd0d9c 100644
--- a/packages/grid/src/Grid.tsx
+++ b/packages/grid/src/Grid.tsx
@@ -144,4 +144,4 @@ GridItem.displayName = 'GridItem';
const Root = Grid;
const Item = GridItem;
-export { Root, Item };
+export { Item, Root };
diff --git a/packages/icon/package.json b/packages/icon/package.json
index 6214d761..b3d19557 100644
--- a/packages/icon/package.json
+++ b/packages/icon/package.json
@@ -9,7 +9,9 @@
},
"type": "module",
"exports": "./src/index.ts",
- "files": ["dist"],
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
diff --git a/packages/icon/scripts/generate-icons.ts b/packages/icon/scripts/generate-icons.ts
index a58d2a47..ba024989 100644
--- a/packages/icon/scripts/generate-icons.ts
+++ b/packages/icon/scripts/generate-icons.ts
@@ -1,4 +1,5 @@
import { performance } from 'node:perf_hooks';
+
import { generateComponents } from './utils/generate-components';
async function main() {
@@ -7,7 +8,7 @@ async function main() {
console.log('🎨 Generating icons...');
const results = await generateComponents();
- const successCount = results.filter(r => r.success).length;
+ const successCount = results.filter((r) => r.success).length;
const failureCount = results.length - successCount;
console.log(`✨ Done in ${Math.round(performance.now() - startTime)}ms`);
@@ -15,16 +16,15 @@ async function main() {
if (failureCount > 0) {
console.warn(`⚠️ Failed to generate ${failureCount} components`);
- const failures = results.filter(r => !r.success);
+ const failures = results.filter((r) => !r.success);
for (const failure of failures) {
console.error(` ❌ ${failure.fileName}: ${failure.error}`);
}
}
-
} catch (error) {
console.error('Error:', error instanceof Error ? error.message : 'Unknown error');
process.exit(1);
}
}
-main();
\ No newline at end of file
+main();
diff --git a/packages/icon/scripts/utils/generate-components.ts b/packages/icon/scripts/utils/generate-components.ts
index d3376511..6a4d0586 100644
--- a/packages/icon/scripts/utils/generate-components.ts
+++ b/packages/icon/scripts/utils/generate-components.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs/promises';
import path from 'node:path';
+
import type { GenerateResult } from '../../src/types';
import { optimizeSvg } from './optimize-svg';
import { PATHS } from './paths';
@@ -8,9 +9,7 @@ function validateFileName(fileName: string): void {
const isKebabCase = /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(fileName);
if (!isKebabCase) {
- throw new Error(
- `Invalid file name: ${fileName}. File names must be in kebab-case (e.g., my-icon)`
- );
+ throw new Error(`Invalid file name: ${fileName}. File names must be in kebab-case (e.g., my-icon)`);
}
}
@@ -23,7 +22,7 @@ function validateSvgContent(content: string, fileName: string): void {
function toComponentName(fileName: string): string {
const pascalCase = fileName
.split('-')
- .map(part => part.charAt(0).toUpperCase() + part.slice(1))
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
.join('');
return `${pascalCase}Icon`;
@@ -50,7 +49,7 @@ export async function generateComponents(): Promise {
// 2. Get all SVG files
const files = await fs.readdir(PATHS.ICONS_DIR);
- const svgFiles = files.filter(file => file.endsWith('.svg'));
+ const svgFiles = files.filter((file) => file.endsWith('.svg'));
// 3. Generate components in parallel
const results = await Promise.all(
@@ -62,10 +61,7 @@ export async function generateComponents(): Promise {
validateFileName(fileName);
// Read and optimize SVG
- const svgContent = await fs.readFile(
- path.join(PATHS.ICONS_DIR, file),
- 'utf-8'
- );
+ const svgContent = await fs.readFile(path.join(PATHS.ICONS_DIR, file), 'utf-8');
validateSvgContent(svgContent, fileName);
@@ -75,10 +71,7 @@ export async function generateComponents(): Promise {
const componentContent = createComponentTemplate(componentName, optimizedSvg);
// Write component file
- await fs.writeFile(
- path.join(PATHS.COMPONENTS_DIR, `${componentName}.tsx`),
- componentContent
- );
+ await fs.writeFile(path.join(PATHS.COMPONENTS_DIR, `${componentName}.tsx`), componentContent);
return { fileName, componentName, success: true };
} catch (error) {
@@ -86,16 +79,16 @@ export async function generateComponents(): Promise {
fileName,
componentName,
success: false,
- error: error instanceof Error ? error.message : 'Unknown error'
+ error: error instanceof Error ? error.message : 'Unknown error',
};
}
- })
+ }),
);
// 4. Generate index file with successful components
- const successfulResults = results.filter(r => r.success);
+ const successfulResults = results.filter((r) => r.success);
const componentExports = successfulResults
- .map(r => `export { ${r.componentName} } from './components/${r.componentName}';`)
+ .map((r) => `export { ${r.componentName} } from './components/${r.componentName}';`)
.join('\n');
const indexContent = `\
@@ -103,10 +96,7 @@ export type { IconProps } from './types';
${componentExports}
`;
- await fs.writeFile(
- path.join(PATHS.COMPONENTS_DIR, '../index.ts'),
- indexContent
- );
+ await fs.writeFile(path.join(PATHS.COMPONENTS_DIR, '../index.ts'), indexContent);
return results;
- }
\ No newline at end of file
+}
diff --git a/packages/icon/scripts/utils/optimize-svg.ts b/packages/icon/scripts/utils/optimize-svg.ts
index 2c7bab25..4938430c 100644
--- a/packages/icon/scripts/utils/optimize-svg.ts
+++ b/packages/icon/scripts/utils/optimize-svg.ts
@@ -1,4 +1,5 @@
import { optimize } from 'svgo';
+
import { SVGO_CONFIG } from './svgo.config';
export const optimizeSvg = async (svg: string): Promise => {
@@ -11,30 +12,22 @@ export const optimizeSvg = async (svg: string): Promise => {
let optimizedSvg = result.data;
// Convert kebab-case to camelCase
- optimizedSvg = optimizedSvg.replace(
- /-([a-z])/g,
- (_, letter) => letter.toUpperCase()
- );
+ optimizedSvg = optimizedSvg.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
// Preserve fill="none" and handle other fill/stroke attributes
- optimizedSvg = optimizedSvg.replace(
- /(fill|stroke)="(none|[^"]+)"/g,
- (_, attr, value) =>
- value === 'none'
- ? `${attr}="none"`
- : value === 'currentColor'
- ? `${attr}={color}`
- : `${attr}={color || "${value}"}`
+ optimizedSvg = optimizedSvg.replace(/(fill|stroke)="(none|[^"]+)"/g, (_, attr, value) =>
+ value === 'none'
+ ? `${attr}="none"`
+ : value === 'currentColor'
+ ? `${attr}={color}`
+ : `${attr}={color || "${value}"}`,
);
// Inject SVG props
- optimizedSvg = optimizedSvg.replace(
- '