0.2522.3 • Published 10 months ago

@ahnlabcloudmate/design-system v0.2522.3

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

@ahnlabcloudmate/design-system

React UI 컴포넌트 라이브러리입니다.

요구사항

  • Node.js 16 이상
  • React 18 이상
  • TypeScript 5 이상

브라우저 지원

  • Chrome 88 이상
  • Firefox 87 이상
  • Safari 14 이상
  • Edge 88 이상
  • Opera 74 이상

참고:

  • React 18.3.1과 TypeScript 5.7.3을 사용하고 있으며, 이는 최신 브라우저의 ES2020+ 기능을 지원합니다.
  • @pandacss/dev 0.44.0은 CSS Grid, Flexbox, CSS Variables 등 최신 CSS 기능을 사용하며, PostCSS를 통해 브라우저 호환성을 자동으로 처리합니다.
  • 위에 명시된 브라우저 버전 이상에서 최적의 성능을 보장합니다.

주요 의존성

  • @pandacss/dev 0.44.0
  • @tabler/icons-react 3.17.0

설치 - REACT + VITE

1. 패키지 설치

# npm 사용시
npm install -D @pandacss/dev@0.44.0 @ahnlabcloudmate/design-system
npm install @tabler/icons-react@3.17.0
npx panda init --postcss

# yarn 사용시
yarn add -D @pandacss/dev@0.44.0 @ahnlabcloudmate/design-system
yarn add @tabler/icons-react@3.17.0
yarn panda init --postcss

# pnpm 사용시
pnpm add -D @pandacss/dev@0.44.0 @ahnlabcloudmate/design-system
pnpm add @tabler/icons-react@3.17.0
pnpm panda init --postcss

@tabler/icons-react는 3.17.0 버전 사용

3.19.0버전에서 부터 모든 icon을 chunk로 요청하여 받아오게 되어 3.17.0으로 고정

참고 : https://github.com/tabler/tabler-icons/issues/1233 Vite dev mode loads all icon chunks with 3.19.0 (React) #1233

2. panda.config.ts 파일 수정

패키지 설치 후 panda.config.ts 파일 수정

import { defineConfig } from '@pandacss/dev'
import customPreset from '@ahnlabcloudmate/design-system/customPreset'

export default defineConfig({
  staticCss: {
    recipes: '*',
  },
  jsxFramework: 'react',
  // Whether to use css reset
  preflight: true,

  // Where to look for your css declarations
  include: [
    './app/**/*.{js,jsx,ts,tsx}',
    './src/**/*.{js,jsx,ts,tsx}',
    './node_modules/@ahnlabcloudmate/design-system/**/*.{js,jsx}',
  ],

  // Files to exclude
  exclude: [],

  // Useful for theme customization
  presets: ['@pandacss/dev/presets', customPreset],

  // The output directory for your css system
  outdir: 'styled-system'
})

3. package.json파일의 scripts 섹션 수정

package.json 파일의 scripts 섹션에 추가

+    "prepare": "panda codegen",

# yarn
+    "postinstall": "panda codegen"

추가 후 아래 명령어 직접 실행

yarn postinstall
# or
pnpm prepare
# or
npm prepare

4. src/index.css 파일 코드 추가

src/index.css 프로젝트 루트 css에 아래 코드를 추가합니다.

@layer reset, base, tokens, recipes, utilities;

5. ACMEUIProvider 추가

import { ACMEUIProvider } from '@ahnlabcloudmate/design-system';

function App() {
  return (
      <ACMEUIProvider>
        {children}
      </ACMEUIProvider>
  )
}

설치 - Next.js

1. 패키지 설치

# npm 사용시
npm install -D @pandacss/dev@0.44.0 @ahnlabcloudmate/design-system
npm install @tabler/icons-react@3.17.0
npx panda init --postcss

# yarn 사용시
yarn add -D @pandacss/dev@0.44.0 @ahnlabcloudmate/design-system
yarn add @tabler/icons-react@3.17.0
yarn panda init --postcss

# pnpm 사용시
pnpm add -D @pandacss/dev@0.44.0 @ahnlabcloudmate/design-system
pnpm add @tabler/icons-react@3.17.0
pnpm panda init --postcss

@tabler/icons-react는 3.17.0 버전 사용

3.19.0버전에서 부터 모든 icon을 chunk로 요청하여 받아오게 되어 3.17.0으로 고정

참고 : https://github.com/tabler/tabler-icons/issues/1233 Vite dev mode loads all icon chunks with 3.19.0 (React) #1233

2. panda.config.ts 파일 수정

패키지 설치 후 panda.config.ts 파일 수정

import { defineConfig } from '@pandacss/dev'
import customPreset from '@ahnlabcloudmate/design-system/customPreset'

export default defineConfig({
  staticCss: {
    recipes: '*',
  },
  jsxFramework: 'react',
  preflight: true,
  include: [
    './app/**/*.{js,jsx,ts,tsx}',
    './src/**/*.{js,jsx,ts,tsx}',
    './node_modules/@ahnlabcloudmate/design-system/**/*.{js,jsx}',
  ],
  exclude: [],
  presets: ['@pandacss/dev/presets', customPreset],
  outdir: 'styled-system'
})

3. next.config.js 파일 수정

next.config.js 파일에 다음 설정을 추가합니다.

/** @type {import('next').NextConfig} */
const nextConfig = {
  transpilePackages: ['@ahnlabcloudmate/design-system'],
}

module.exports = nextConfig

3. package.json파일의 scripts 섹션 수정

package.json 파일의 scripts 섹션에 추가

+    "prepare": "panda codegen",

# yarn
+    "postinstall": "panda codegen"

추가 후 아래 명령어 직접 실행

yarn postinstall
# or
pnpm prepare
# or
npm prepare

4. app/layout.tsx 파일 수정

app/layout.tsx 파일에 다음 코드를 추가합니다.

import './globals.css'

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="ko">
      <body>{children}</body>
    </html>
  )
}

5. app/globals.css 파일 수정

app/globals.css 파일에 다음 코드를 추가합니다.

@layer reset, base, tokens, recipes, utilities;

6. ACMEUIProvider 추가

import { ACMEUIProvider } from '@ahnlabcloudmate/design-system';

export default async function RootLayout({ children }) {
  return (
      <html>
        <body>
          <ACMEUIProvider>
            {children}
          </ACMEUIProvider>
        </body>
    </html>
  )
}

사용 방법

컴포넌트 사용하기

import { Button } from '@ahnlabcloudmate/design-system';

function App() {
  return (
    <Button variant="primary">버튼</Button>
  );
}

타입 사용하기

import { ColumnSummary } from '@ahnlabcloudmate/design-system/types'

커스텀 프리셋 사용하기

import customPreset from '@ahnlabcloudmate/design-system/customPreset';

// panda.config.ts 파일에서 사용
import { defineConfig } from '@pandacss/dev';

export default defineConfig({
  // 다른 설정들...
  presets: ['@pandacss/dev/presets', customPreset],
});

버전 정보

v0.0.3

LICENSE

MIT

0.2522.3

10 months ago

0.2522.2

10 months ago

0.2522.1

10 months ago

0.2521.1

10 months ago

0.2520.4

10 months ago

0.2520.3

10 months ago

0.2519.1

11 months ago

0.2518.6

11 months ago

0.2518.5

11 months ago

0.2518.4

11 months ago

0.2518.3

11 months ago

0.2518.2

11 months ago

0.2518.1

11 months ago

0.2517.51

11 months ago

0.2517.50

11 months ago

0.2517.49

11 months ago

0.2517.48

11 months ago

0.2517.47

11 months ago

0.2517.46

11 months ago

0.2517.45

11 months ago

0.2517.44

11 months ago

0.2517.43

11 months ago

0.2517.42

11 months ago

0.2517.41

11 months ago

0.2517.40

11 months ago

0.2517.39

11 months ago

0.2517.38

11 months ago

0.2517.37

11 months ago

0.2517.36

11 months ago

0.2517.35

11 months ago

0.2517.34

11 months ago

0.2517.33

11 months ago

0.2517.32

11 months ago

0.2517.31

11 months ago

0.2517.30

11 months ago

0.2517.29

11 months ago

0.2517.28

11 months ago

0.2517.27

11 months ago

0.2517.26

11 months ago

0.2517.25

11 months ago

0.2517.24

11 months ago

999.999.1000

11 months ago

999.999.998

11 months ago

999.999.999

11 months ago

118.10.2-test

11 months ago

117.10.2-test

11 months ago

116.10.2-test

11 months ago

0.2517.23

11 months ago

0.2517.22

11 months ago

0.2517.21

11 months ago

0.2517.20

11 months ago

0.2517.19

11 months ago

0.2517.18

11 months ago

0.2517.17

11 months ago

115.10.2

11 months ago

113.10.2

11 months ago

13.10.2

11 months ago

0.2513.2

11 months ago

0.2517.16

11 months ago

0.2517.15

11 months ago

0.2517.14

11 months ago

0.2517.12

11 months ago

0.2517.11

11 months ago

0.0.3-beta.1

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1-beta.0

11 months ago

0.0.1

11 months ago