@highpixel-co/palda-design-system 0.4.1

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/dist/ui.d.ts ADDED
@@ -0,0 +1,243 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, AnchorHTMLAttributes, ReactElement } from 'react';
3
+
4
+ type AlertVariant = 'neutral' | 'accent' | 'warning' | 'danger';
5
+ interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
6
+ /** 배너 본문. 읽는 문장이라 좁아지면 접힌다. */
7
+ children: ReactNode;
8
+ /** 본문 위 굵은 한 줄. 없으면 본문만 그린다. */
9
+ title?: ReactNode;
10
+ /** 본문 왼쪽 아이콘. 라벨을 보조하는 장식이라 접근성 트리에서 뺀다. */
11
+ icon?: ReactNode;
12
+ /** 본문 아래 액션 줄. Button을 넣는다. */
13
+ action?: ReactNode;
14
+ variant?: AlertVariant;
15
+ }
16
+ declare function Alert({ children, className, title, icon, action, variant, ...props }: AlertProps): react.JSX.Element;
17
+
18
+ type BadgeVariant = 'primary' | 'accent' | 'secondary' | 'success' | 'warning' | 'danger';
19
+ type BadgeSize = 'md' | 'sm';
20
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
21
+ children: ReactNode;
22
+ /** 시안의 variant 프로퍼티. */
23
+ variant?: BadgeVariant;
24
+ /** 라벨 앞 아이콘. 시안 기준 16px 고정이며 md/sm이 같다. */
25
+ icon?: ReactNode;
26
+ size?: BadgeSize;
27
+ }
28
+ declare function Badge({ children, className, variant, icon, size, ...props }: BadgeProps): react.JSX.Element;
29
+
30
+ type ButtonVariant = 'primary' | 'secondary' | 'accent' | 'outline' | 'subtle';
31
+ type ButtonSize = 'md' | 'sm';
32
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
33
+ children: ReactNode;
34
+ /** 라벨 앞 아이콘. 시안 기준 16px 고정이며 md/sm이 같다. */
35
+ leadingIcon?: ReactNode;
36
+ size?: ButtonSize;
37
+ /** 라벨 뒤 아이콘. */
38
+ trailingIcon?: ReactNode;
39
+ variant?: ButtonVariant;
40
+ }
41
+ declare function Button({ children, className, leadingIcon, size, trailingIcon, type, variant, ...props }: ButtonProps): react.JSX.Element;
42
+
43
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
44
+ /** 시안의 `text` 토글. 생략하면 라벨 없이 컨트롤만 그리므로 `aria-label`을 함께 넘긴다. */
45
+ children?: ReactNode;
46
+ }
47
+ declare function Checkbox({ children, className, disabled, ...props }: CheckboxProps): react.JSX.Element;
48
+
49
+ type ChipVariant = 'primary' | 'accent' | 'secondary';
50
+ type ChipSize = 'md' | 'sm';
51
+ interface ChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
52
+ children: ReactNode;
53
+ /** 라벨 뒤 아이콘. 시안 기준 16px 고정이며 md/sm이 같다. */
54
+ icon?: ReactNode;
55
+ /** 시안 status의 selected. */
56
+ selected?: boolean;
57
+ size?: ChipSize;
58
+ /** 시안 property 이름은 color지만 코드는 variant로 통일한다(0003). */
59
+ variant?: ChipVariant;
60
+ }
61
+ declare function Chip({ children, className, icon, selected, size, variant, ...props }: ChipProps): react.JSX.Element;
62
+
63
+ type DropdownButtonAlign = 'start' | 'end';
64
+ type DropdownButtonVariant = 'outline' | 'subtle';
65
+ interface DropdownButtonItem {
66
+ disabled?: boolean;
67
+ /** 라벨 앞 아이콘. 트리거 chevron과 같은 16px 고정이다. */
68
+ icon?: ReactNode;
69
+ label: ReactNode;
70
+ /** onSelect로 돌려주는 값이자 목록 안에서의 key다. */
71
+ value: string;
72
+ }
73
+ interface DropdownButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onSelect' | 'type'> {
74
+ /** 메뉴를 트리거의 어느 쪽에 맞출지. 메뉴는 시안에 없어 이 축도 미확정이다. */
75
+ align?: DropdownButtonAlign;
76
+ children: ReactNode;
77
+ items: DropdownButtonItem[];
78
+ onSelect?: (value: string) => void;
79
+ /** 라벨 뒤 chevron. 시안 기준 16px 고정이고 열리면 180° 뒤집힌다.
80
+ 시안에서 chevron은 늘 붙어 있는 고정 요소이므로, chevron-down 아이콘이 들어오면
81
+ 이 prop을 없애고 컴포넌트가 직접 그린다. */
82
+ trailingIcon?: ReactNode;
83
+ variant?: DropdownButtonVariant;
84
+ }
85
+ declare function DropdownButton({ align, children, className, items, onClick, onKeyDown, onSelect, trailingIcon, variant, ...props }: DropdownButtonProps): react.JSX.Element;
86
+
87
+ type IconButtonVariant = 'primary' | 'secondary' | 'accent' | 'outline' | 'subtle';
88
+ type IconButtonSize = 'md' | 'sm';
89
+ interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label' | 'children'> {
90
+ /** 버튼 안 아이콘. 시안 기준 16px 고정이며 md/sm이 같다. */
91
+ icon: ReactNode;
92
+ /** 스크린 리더가 읽는 이름. 아이콘만 있는 버튼이라 필수다 (docs/ACCESSIBILITY.md). */
93
+ label: string;
94
+ size?: IconButtonSize;
95
+ variant?: IconButtonVariant;
96
+ }
97
+ declare function IconButton({ className, icon, label, size, type, variant, ...props }: IconButtonProps): react.JSX.Element;
98
+
99
+ type LinkVariant = 'primary' | 'accent';
100
+ type LinkSize = 'md' | 'sm';
101
+ interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
102
+ children: ReactNode;
103
+ /** 필수다. 주소가 없으면 링크가 아니라 버튼이다. */
104
+ href: string;
105
+ /**
106
+ * 새 탭으로 연다. `target`과 `rel`이 함께 붙고, 새 창이 열린다는 사실이 라벨에도 실린다.
107
+ * 아이콘으로만 알리면 스크린 리더에 전달되지 않는다 (docs/ACCESSIBILITY.md).
108
+ */
109
+ external?: boolean;
110
+ size?: LinkSize;
111
+ /** 시안의 색. `accent`는 아껴 쓴다 — 한 화면에서 강조는 하나다 (docs/TOKEN_POLICY.md §색). */
112
+ variant?: LinkVariant;
113
+ }
114
+ /**
115
+ * 눌러서 이동하는 것이다. **모양이 비슷하다고 Button으로 대신하지 않는다** — 새 탭·주소 복사·
116
+ * 가운데 클릭이 전부 달라진다. 반대로 이동하지 않는 동작에는 이것을 쓰지 않는다.
117
+ *
118
+ * 상태를 prop으로 갖지 않는다. hover·focus·visited는 전부 CSS가 가진다 (0004).
119
+ */
120
+ declare function Link({ children, className, external, href, rel, size, target, variant, ...props }: LinkProps): react.JSX.Element;
121
+
122
+ interface ModalActionsProps {
123
+ children: ReactNode;
124
+ className?: string;
125
+ }
126
+ declare function ModalActions({ children, className }: ModalActionsProps): react.JSX.Element;
127
+ interface ModalProps {
128
+ /** 시안의 본문 영역. 길어지면 헤더·푸터는 그대로 두고 여기만 스크롤된다. */
129
+ children?: ReactNode;
130
+ className?: string;
131
+ /** 닫기 버튼의 접근 가능한 이름. 아이콘만 있는 버튼이라 이름이 필요하다(docs/ACCESSIBILITY.md). */
132
+ closeLabel?: string;
133
+ /** 시안의 하단 액션 줄. 오른쪽 묶음은 ModalActions로 감싼다. */
134
+ footer?: ReactNode;
135
+ /** 닫기 버튼·ESC·딤 클릭이 모두 이 하나로 모인다. */
136
+ onClose: () => void;
137
+ open: boolean;
138
+ /** 헤더 오른쪽 닫기 버튼. 닫는 길을 푸터 버튼으로만 두고 싶을 때 끈다. */
139
+ showCloseButton?: boolean;
140
+ title: ReactNode;
141
+ }
142
+ declare function Modal({ children, className, closeLabel, footer, onClose, open, showCloseButton, title, }: ModalProps): react.ReactPortal | null;
143
+
144
+ interface NavigationButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
145
+ children: ReactNode;
146
+ /** 라벨 앞 아이콘. 시안 기준 24px 고정이다. */
147
+ icon?: ReactNode;
148
+ /** 지금 보고 있는 화면. `aria-current="page"`로 함께 노출된다. */
149
+ selected?: boolean;
150
+ }
151
+ declare function NavigationButton({ children, className, icon, selected, ...props }: NavigationButtonProps): react.JSX.Element;
152
+
153
+ interface ProgressBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
154
+ /** 0~100. 범위를 벗어난 값은 잘라서 그린다. */
155
+ value: number;
156
+ /** 무엇의 진행률인지 알리는 접근 가능한 이름. 막대만으로는 뜻이 통하지 않아 필수다. */
157
+ label: string;
158
+ }
159
+ declare function ProgressBar({ value, label, className, ...props }: ProgressBarProps): react.JSX.Element;
160
+
161
+ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
162
+ /** 시안의 `text` 토글. 생략하면 라벨 없이 컨트롤만 그리므로 `aria-label`을 함께 넘긴다. */
163
+ children?: ReactNode;
164
+ }
165
+ declare function Radio({ children, className, disabled, ...props }: RadioProps): react.JSX.Element;
166
+
167
+ type SwitchSize = 'md' | 'sm';
168
+ interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
169
+ size?: SwitchSize;
170
+ }
171
+ declare function Switch({ className, disabled, size, ...props }: SwitchProps): react.JSX.Element;
172
+
173
+ interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'role' | 'type'> {
174
+ children: ReactNode;
175
+ /** 라벨 앞 아이콘. 시안 기준 24px 고정이다. */
176
+ icon?: ReactNode;
177
+ /** 지금 보고 있는 탭. `aria-selected`로 함께 노출된다. */
178
+ selected?: boolean;
179
+ }
180
+ declare function Tab({ children, className, icon, selected, ...props }: TabProps): react.JSX.Element;
181
+
182
+ type TextFieldVariant = 'outline' | 'accent' | 'subtle';
183
+ type TextFieldSize = 'md' | 'sm';
184
+ interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'readOnly' | 'size'> {
185
+ /** 시안 description. 시안에 별도 에러 슬롯이 없어 error일 때 이 문구가 danger 색으로 바뀐다. */
186
+ description?: ReactNode;
187
+ /** 시안 status의 error. `aria-invalid`로 함께 노출된다. */
188
+ error?: boolean;
189
+ /** 입력 뒤 아이콘. 시안 기준 20px 고정이며 md/sm이 같다. */
190
+ icon?: ReactNode;
191
+ /** 시안의 header. */
192
+ label?: ReactNode;
193
+ size?: TextFieldSize;
194
+ /** 시안 property 이름은 color지만 코드는 variant로 통일한다(0003).
195
+ 값의 outline·subtle은 색이 아니라 채움 방식이라 이름도 다시 볼 대상이다. */
196
+ variant?: TextFieldVariant;
197
+ }
198
+ declare function TextField({ className, defaultValue, description, disabled, error, icon, id, label, maxLength, onChange, required, size, value, variant, ...props }: TextFieldProps): react.JSX.Element;
199
+
200
+ type ToastVariant = 'primary' | 'danger';
201
+
202
+ type ToasterPlacement = 'bottom-center' | 'bottom-right' | 'top-center' | 'top-right';
203
+ interface ToasterProps {
204
+ className?: string;
205
+ /** 화면 어느 모서리에 쌓을지. 시안이 없어 정한 축이다. */
206
+ placement?: ToasterPlacement;
207
+ }
208
+ declare function Toaster({ className, placement }: ToasterProps): react.JSX.Element;
209
+
210
+ interface ToastOptions {
211
+ /** 실행취소처럼 토스트가 떠 있는 동안만 유효한 액션의 라벨. onAction과 한 쌍이다. */
212
+ actionLabel?: string;
213
+ /** 닫기 버튼의 접근 가능한 이름. 아이콘만 있는 버튼이라 이름이 필요하다(docs/ACCESSIBILITY.md). */
214
+ closeLabel?: string;
215
+ /** 자동으로 닫히기까지의 시간(ms). 0이면 눌러서 닫을 때까지 남는다. */
216
+ duration?: number;
217
+ /** 메시지 앞 아이콘. 메시지를 보조하는 장식이라 접근성 이름에서 뺀다. */
218
+ icon?: ReactNode;
219
+ /** 누르면 토스트가 함께 닫힌다. 한 번 쓰고 사라지는 액션이라 다시 누를 자리가 없다. */
220
+ onAction?: () => void;
221
+ variant?: ToastVariant;
222
+ }
223
+ /** 토스트를 하나 띄우고 id를 돌려준다. 화면에 `<Toaster />`가 있어야 보인다. */
224
+ declare function toast(message: ReactNode, options?: ToastOptions): string;
225
+ declare namespace toast {
226
+ var dismiss: (id?: string) => void;
227
+ }
228
+
229
+ type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
230
+ interface TooltipProps {
231
+ /** 툴팁을 붙일 트리거 하나. 키보드로도 열리려면 포커스를 받는 요소여야 한다. */
232
+ children: ReactElement<{
233
+ 'aria-describedby'?: string;
234
+ }>;
235
+ className?: string;
236
+ /** 말풍선에 들어가는 설명. 트리거의 이름을 대신하지 않는다(이름은 aria-label로 준다). */
237
+ label: ReactNode;
238
+ /** 말풍선을 트리거의 어느 쪽에 둘지. 자리가 모자라면 반대쪽으로 뒤집는다. 시안 없이 정한 축이다. */
239
+ placement?: TooltipPlacement;
240
+ }
241
+ declare function Tooltip({ children, className, label, placement }: TooltipProps): react.JSX.Element;
242
+
243
+ export { Alert, type AlertProps, type AlertVariant, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipSize, type ChipVariant, DropdownButton, type DropdownButtonAlign, type DropdownButtonItem, type DropdownButtonProps, type DropdownButtonVariant, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, Link, type LinkProps, type LinkSize, type LinkVariant, Modal, ModalActions, type ModalActionsProps, type ModalProps, NavigationButton, type NavigationButtonProps, ProgressBar, type ProgressBarProps, Radio, type RadioProps, Switch, type SwitchProps, type SwitchSize, Tab, type TabProps, TextField, type TextFieldProps, type TextFieldSize, type TextFieldVariant, type ToastOptions, type ToastVariant, Toaster, type ToasterPlacement, type ToasterProps, Tooltip, type TooltipPlacement, type TooltipProps, toast };
package/dist/ui.js ADDED
@@ -0,0 +1,44 @@
1
+ import "./chunk-EYFL232L.js";
2
+ import {
3
+ Alert,
4
+ Badge,
5
+ Button,
6
+ Checkbox,
7
+ Chip,
8
+ DropdownButton,
9
+ IconButton,
10
+ Link,
11
+ Modal,
12
+ ModalActions,
13
+ NavigationButton,
14
+ ProgressBar,
15
+ Radio,
16
+ Switch,
17
+ Tab,
18
+ TextField,
19
+ Toaster,
20
+ Tooltip,
21
+ toast
22
+ } from "./chunk-GPCPGABI.js";
23
+ import "./chunk-TWYJ2UTC.js";
24
+ export {
25
+ Alert,
26
+ Badge,
27
+ Button,
28
+ Checkbox,
29
+ Chip,
30
+ DropdownButton,
31
+ IconButton,
32
+ Link,
33
+ Modal,
34
+ ModalActions,
35
+ NavigationButton,
36
+ ProgressBar,
37
+ Radio,
38
+ Switch,
39
+ Tab,
40
+ TextField,
41
+ Toaster,
42
+ Tooltip,
43
+ toast
44
+ };
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@highpixel-co/palda-design-system",
3
+ "version": "0.4.1",
4
+ "description": "Palda product design tokens, icons, React components, and patterns",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "files": [
8
+ "dist",
9
+ "LICENSE",
10
+ "NOTICE"
11
+ ],
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./ui": {
20
+ "types": "./dist/ui.d.ts",
21
+ "import": "./dist/ui.js"
22
+ },
23
+ "./icons": {
24
+ "types": "./dist/icons.d.ts",
25
+ "import": "./dist/icons.js"
26
+ },
27
+ "./patterns": {
28
+ "types": "./dist/patterns.d.ts",
29
+ "import": "./dist/patterns.js"
30
+ },
31
+ "./tokens": {
32
+ "types": "./dist/tokens.d.ts",
33
+ "import": "./dist/tokens.js"
34
+ },
35
+ "./styles.css": "./dist/styles.css"
36
+ },
37
+ "sideEffects": [
38
+ "./dist/styles.css"
39
+ ],
40
+ "scripts": {
41
+ "build": "tsup src/index.ts src/ui.ts src/icons.ts src/patterns.ts src/tokens.ts --format esm --dts --clean --external react --external react-dom --tsconfig ../../tsconfig.json && node build.mjs"
42
+ },
43
+ "peerDependencies": {
44
+ "react": ">=19",
45
+ "react-dom": ">=19"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/highpixel-co/palda-design-system.git",
50
+ "directory": "packages/palda-design-system"
51
+ },
52
+ "publishConfig": {
53
+ "registry": "https://registry.npmjs.org/",
54
+ "access": "public"
55
+ }
56
+ }