@nurihaus/web-design-system 2.0.9 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1 +1,50 @@
1
1
  # design-system-lab
2
+
3
+ ## 설치와 사용 (3.x)
4
+
5
+ ```bash
6
+ npm i @nurihaus/web-design-system
7
+ ```
8
+
9
+ CSS 는 JS 에 들어 있지 않다. 앱에서 한 번 가져온다.
10
+
11
+ ```ts
12
+ // 토큰만 (CSS Modules 로 직접 화면을 짤 때). 가져와도 화면이 바뀌지 않는다.
13
+ import '@nurihaus/web-design-system/tokens.css';
14
+
15
+ // 토큰 + 글꼴 + 리셋 + 컴포넌트 스타일 (디자인 시스템 컴포넌트를 쓸 때)
16
+ import '@nurihaus/web-design-system/styles.css';
17
+ ```
18
+
19
+ ```css
20
+ /* CSS Modules 에서 */
21
+ .card {
22
+ padding: var(--spacing-16);
23
+ border-radius: var(--radius-6);
24
+ background: var(--color-purple-50);
25
+ color: var(--color-purple-900);
26
+ font-size: var(--font-size-sm);
27
+ }
28
+ ```
29
+
30
+ 어드민 화면은 의미 토큰을 어드민 세트로 갈아탄다.
31
+
32
+ ```html
33
+ <html data-ds-theme="admin">
34
+ ```
35
+
36
+ JS 토큰이 필요하면.
37
+
38
+ ```ts
39
+ import { primitive, semanticApp } from '@nurihaus/web-design-system/tokens';
40
+ ```
41
+
42
+ ## 토큰 고치기
43
+
44
+ 원본은 `tokens/figma.json` 하나다. Tokens Studio 가 그 파일을 갱신하면 생성만 다시 돌린다.
45
+
46
+ ```bash
47
+ npm run tokens # figma.json → tokens/generated/{tokens.css, *.ts}
48
+ ```
49
+
50
+ `tokens/generated/` 와 `styles/token/*.css` 를 손으로 고치지 않는다. 배경은 `docs/decisions/0001-tokens-in-ds-and-separate-css.md`.
@@ -3,7 +3,6 @@ import { ReactNode } from 'react';
3
3
  import { colors } from '../../styles/token/colors';
4
4
  import { size } from './badge-props';
5
5
  import { CommonBadgeProps } from './badge-type';
6
- import './badge-style.css';
7
6
  export interface OptionBadgeProps extends Pick<CommonBadgeProps, 'asChild'> {
8
7
  borderColor?: keyof typeof colors;
9
8
  color?: keyof typeof colors;
@@ -1,7 +1,4 @@
1
1
  import type { TabsProps } from './tabs-type';
2
- import '../../styles/token/color.css';
3
- import '../../styles/token/font.css';
4
- import './tabs-style.css';
5
2
  declare const Tabs: (props: TabsProps) => import("react/jsx-runtime").JSX.Element;
6
3
  export default Tabs;
7
4
  export type { TabsProps };
@@ -2,8 +2,8 @@ import React, { PropsWithChildren } from 'react';
2
2
  import { TextFieldHelperTextProps, TextFieldInputProps, TextFieldLabelProps, TextFieldRootProps } from './text-field-type';
3
3
  declare const TextFieldRoot: {
4
4
  (props: PropsWithChildren<TextFieldRootProps>): import("react/jsx-runtime").JSX.Element;
5
- TextLabel: (props: TextFieldLabelProps) => number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
5
+ TextLabel: (props: TextFieldLabelProps) => number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
6
6
  InputField: React.ForwardRefExoticComponent<Omit<TextFieldInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
7
- HelperText: (props: TextFieldHelperTextProps) => number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
7
+ HelperText: (props: TextFieldHelperTextProps) => number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
8
8
  };
9
9
  export default TextFieldRoot;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import './styles/index.css';
2
1
  export { default as Avatar } from './components/avatar/avatar';
3
2
  export { default as CTAButton } from './components/button/cta-button';
4
3
  export { default as OptionBadge } from './components/badge/option-badge';
@@ -14,4 +13,5 @@ export { default as Text } from './components/elements/text/text';
14
13
  export { default as Tooltip } from './components/tooltip/tooltip';
15
14
  export { default as ModalWithDoubleButton } from './components/modal/modal-with-double-button';
16
15
  export { Spinner, InlineLoading, OverlayLoading } from './components/loading';
17
- export { colors } from './styles/token/colors';
16
+ export { colors, primitive, semanticApp, semanticAdmin } from './tokens/generated';
17
+ export type { PrimitiveTokens, SemanticAppTokens, SemanticAdminTokens } from './tokens/generated';