@axis-ds/ui-react 1.3.0 → 1.5.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 +74 -0
- package/dist/accordion/index.js +9 -27
- package/dist/accordion/index.mjs +58 -7
- package/dist/alert/index.js +9 -27
- package/dist/alert/index.mjs +54 -7
- package/dist/avatar/avatar.d.mts +24 -0
- package/dist/avatar/avatar.d.ts +24 -0
- package/dist/avatar/avatar.js +70 -0
- package/dist/{chunk-OQGMQL2A.mjs → avatar/avatar.mjs} +5 -26
- package/dist/avatar/index.d.mts +5 -26
- package/dist/avatar/index.d.ts +5 -26
- package/dist/avatar/index.js +4 -78
- package/dist/avatar/index.mjs +2 -5
- package/dist/avatar/variants.d.mts +14 -0
- package/dist/avatar/variants.d.ts +14 -0
- package/dist/avatar/variants.js +44 -0
- package/dist/avatar/variants.mjs +20 -0
- package/dist/badge/index.js +5 -23
- package/dist/badge/index.mjs +35 -5
- package/dist/breadcrumb/index.js +15 -33
- package/dist/breadcrumb/index.mjs +118 -10
- package/dist/button/index.js +5 -23
- package/dist/button/index.mjs +44 -5
- package/dist/card/index.js +13 -31
- package/dist/card/index.mjs +58 -9
- package/dist/checkbox/index.js +5 -23
- package/dist/checkbox/index.mjs +41 -4
- package/dist/collapsible/index.js +3 -5
- package/dist/collapsible/index.mjs +4 -5
- package/dist/command/index.d.mts +7 -7
- package/dist/command/index.d.ts +7 -7
- package/dist/command/index.js +16 -33
- package/dist/command/index.mjs +110 -10
- package/dist/dialog/index.js +18 -36
- package/dist/dialog/index.mjs +88 -13
- package/dist/dropdown-menu/index.js +26 -44
- package/dist/dropdown-menu/index.mjs +188 -18
- package/dist/index.d.mts +4 -10
- package/dist/index.d.ts +4 -10
- package/dist/index.js +153 -1907
- package/dist/index.mjs +105 -150
- package/dist/input/index.js +4 -22
- package/dist/input/index.mjs +28 -4
- package/dist/label/index.js +5 -23
- package/dist/label/index.mjs +17 -4
- package/dist/popover/index.js +6 -24
- package/dist/popover/index.mjs +21 -6
- package/dist/progress/index.js +7 -25
- package/dist/progress/index.mjs +71 -6
- package/dist/radio-group/index.js +6 -24
- package/dist/radio-group/index.mjs +40 -5
- package/dist/scroll-area/index.js +6 -24
- package/dist/scroll-area/index.mjs +34 -5
- package/dist/select/index.js +16 -34
- package/dist/select/index.mjs +129 -11
- package/dist/separator/index.js +4 -22
- package/dist/separator/index.mjs +21 -4
- package/dist/sheet/index.js +19 -37
- package/dist/sheet/index.mjs +122 -13
- package/dist/skeleton/index.js +4 -22
- package/dist/skeleton/index.mjs +19 -4
- package/dist/slider/index.js +4 -22
- package/dist/slider/index.mjs +34 -4
- package/dist/switch/index.js +5 -23
- package/dist/switch/index.mjs +29 -4
- package/dist/table/index.js +18 -36
- package/dist/table/index.mjs +96 -11
- package/dist/tabs/index.js +9 -27
- package/dist/tabs/index.mjs +47 -7
- package/dist/textarea/index.js +4 -22
- package/dist/textarea/index.mjs +20 -4
- package/dist/toast/index.js +16 -34
- package/dist/toast/index.mjs +94 -10
- package/dist/toggle/index.js +5 -23
- package/dist/toggle/index.mjs +34 -5
- package/dist/tooltip/index.js +7 -25
- package/dist/tooltip/index.mjs +26 -7
- package/dist/utils.d.mts +9 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +40 -0
- package/dist/{chunk-ZIF4PLK3.mjs → utils.mjs} +2 -4
- package/package.json +8 -6
- package/tailwind.css +10 -0
- package/dist/chunk-22MWNPDF.mjs +0 -44
- package/dist/chunk-2OEPKE4D.mjs +0 -69
- package/dist/chunk-2XNUJNTG.mjs +0 -43
- package/dist/chunk-3N6NG7VT.mjs +0 -11
- package/dist/chunk-4I2F2NLP.mjs +0 -111
- package/dist/chunk-4PT43LON.mjs +0 -31
- package/dist/chunk-5NWFAQBM.mjs +0 -36
- package/dist/chunk-5Z2R3IHJ.mjs +0 -28
- package/dist/chunk-AY4B3RRN.mjs +0 -144
- package/dist/chunk-C5O47K7L.mjs +0 -71
- package/dist/chunk-CNU6645Y.mjs +0 -42
- package/dist/chunk-CY72AGI2.mjs +0 -105
- package/dist/chunk-DRFCNDVQ.mjs +0 -27
- package/dist/chunk-F2WSIT7F.mjs +0 -49
- package/dist/chunk-FZFREHAE.mjs +0 -139
- package/dist/chunk-HKYKDQ6C.mjs +0 -81
- package/dist/chunk-IS7NER3O.mjs +0 -37
- package/dist/chunk-MOBW7BKD.mjs +0 -49
- package/dist/chunk-PJX5UF3Y.mjs +0 -25
- package/dist/chunk-QXQWVRXN.mjs +0 -53
- package/dist/chunk-RFB4IABR.mjs +0 -108
- package/dist/chunk-SO2QSRGV.mjs +0 -58
- package/dist/chunk-TA62Q7YX.mjs +0 -37
- package/dist/chunk-TB33GTWS.mjs +0 -43
- package/dist/chunk-YI5OZRUB.mjs +0 -132
- package/dist/chunk-YZDRNV46.mjs +0 -210
- package/dist/chunk-Z4P43F5J.mjs +0 -65
- package/dist/chunk-Z65ZMFDH.mjs +0 -123
- package/dist/chunk-ZW6GY5PO.mjs +0 -29
package/README.md
CHANGED
|
@@ -10,6 +10,26 @@ npm install @axis-ds/ui-react @axis-ds/tokens @axis-ds/theme
|
|
|
10
10
|
pnpm add @axis-ds/ui-react @axis-ds/tokens @axis-ds/theme
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
## Tailwind 연동
|
|
14
|
+
|
|
15
|
+
### Tailwind CSS 4
|
|
16
|
+
|
|
17
|
+
Tailwind CSS 4(`@import "tailwindcss"`, create-next-app 15.5 기본)에서는 `@import "tailwindcss"` 가 있는 전역 CSS 에 두 줄을 더합니다.
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
/* app/globals.css */
|
|
21
|
+
@import "tailwindcss";
|
|
22
|
+
@import "@axis-ds/tokens/css/tailwind4";
|
|
23
|
+
@import "@axis-ds/ui-react/tailwind.css";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- `@axis-ds/ui-react/tailwind.css` 는 스타일 규칙 없이 `@source "./dist"` 한 줄만 담습니다. Tailwind 4 는 `node_modules` 를 스캔하지 않아서, 이 줄이 없으면 컴포넌트가 쓰는 `bg-[var(--axis-button-bg-default)]` 같은 클래스가 생성되지 않고 Button 배경이 투명해집니다. 경로는 파일 기준 상대 경로라 npm · pnpm 설치 모두 동작합니다.
|
|
27
|
+
- `@import "tailwindcss"` 가 있는 같은 파일에서 import 합니다. 다른 CSS 파일이나 JS/TSX 에서 import 하면 스캔 경로가 그 컴파일에 들어가지 않습니다.
|
|
28
|
+
- `@axis-ds/tokens/css/tailwind4` 는 `rounded-md` · `font-mono` 등을 AXIS 변수로 매핑하고 토큰 변수(`css` · `css/shadcn`)를 base 레이어로 함께 불러옵니다. 아래 Tailwind 3 의 `@axis-ds/tokens/css/shadcn` import 는 넣지 않습니다(레이어 없이 넣으면 `border-red-500` 같은 테두리색 유틸리티가 무효가 됩니다). 브랜드 CSS · create-next-app 기본 `:root` 와의 충돌은 `@axis-ds/tokens` README 를 참고하세요.
|
|
29
|
+
- `@axis-ds/agentic-ui` 도 쓰면 `@import "@axis-ds/agentic-ui/tailwind.css";` 를 함께 넣습니다.
|
|
30
|
+
|
|
31
|
+
### Tailwind CSS 3
|
|
32
|
+
|
|
13
33
|
CSS Variables 설정:
|
|
14
34
|
|
|
15
35
|
```css
|
|
@@ -17,6 +37,15 @@ CSS Variables 설정:
|
|
|
17
37
|
@import '@axis-ds/tokens/css/shadcn';
|
|
18
38
|
```
|
|
19
39
|
|
|
40
|
+
`tailwind.config` 에는 `@axis-ds/tokens/tailwind` preset 과 함께 컴포넌트 파일을 `content` 에 넣습니다.
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
content: [
|
|
44
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
45
|
+
"./node_modules/@axis-ds/ui-react/**/*.{js,jsx}",
|
|
46
|
+
],
|
|
47
|
+
```
|
|
48
|
+
|
|
20
49
|
## 사용법
|
|
21
50
|
|
|
22
51
|
```tsx
|
|
@@ -29,6 +58,51 @@ export default function App() {
|
|
|
29
58
|
}
|
|
30
59
|
```
|
|
31
60
|
|
|
61
|
+
## 서버 컴포넌트 (Next.js App Router)
|
|
62
|
+
|
|
63
|
+
1.5.0 부터 `"use client"` 를 쓰지 않은 서버 컴포넌트(create-next-app 기본 `app/page.tsx` · `app/layout.tsx`)에서 바로 import 해 렌더할 수 있습니다. 루트(`@axis-ds/ui-react`)와 서브패스(`@axis-ds/ui-react/button` 등) 결과가 같습니다.
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
// app/page.tsx (서버 컴포넌트)
|
|
67
|
+
import { Avatar, Button, Card, buttonVariants, cn } from '@axis-ds/ui-react';
|
|
68
|
+
|
|
69
|
+
export default function Page() {
|
|
70
|
+
return (
|
|
71
|
+
<Card className={cn('p-6')}>
|
|
72
|
+
<Avatar src="/me.png" alt="프로필" fallback="AX" />
|
|
73
|
+
<Button>저장</Button>
|
|
74
|
+
<a className={buttonVariants({ variant: 'outline' })} href="/docs">문서</a>
|
|
75
|
+
</Card>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**클라이언트 경계가 있는 컴포넌트**: 아래는 패키지 안에 `"use client"` 경계가 있어 서버 컴포넌트가 렌더하면 그 부분만 브라우저에서 hydrate 됩니다. 쓰는 쪽에서 따로 할 일은 없습니다.
|
|
81
|
+
|
|
82
|
+
| 경계 | 컴포넌트 |
|
|
83
|
+
|---|---|
|
|
84
|
+
| 모듈 전체(패키지 `dist` 파일에 `"use client"`) | `Avatar`(이미지 로드 오류 상태와 대체 표시), `Command` · `CommandInput` · `CommandList` · `CommandEmpty` · `CommandGroup` · `CommandItem` · `CommandSeparator`(cmdk) |
|
|
85
|
+
| Radix 부분만(Radix 패키지 자체의 `"use client"`) | Accordion · Checkbox · Collapsible · Dialog · Dropdown Menu · Label · Popover · Radio Group · Scroll Area · Select · Separator · Sheet · Slider · Switch · Tabs · Toast · Toggle · Tooltip. 래퍼는 서버에서 렌더되고 Radix 부분이 클라이언트 참조가 됩니다 |
|
|
86
|
+
| 없음(서버에서 렌더) | Alert · Badge · Breadcrumb · Button · Card · Input · Progress · Skeleton · Table · Textarea |
|
|
87
|
+
|
|
88
|
+
판단 기준은 `useState` · `useEffect` · `useContext` · `createContext` 같은 클라이언트 전용 API, DOM 이벤트 핸들러를 직접 만드는 코드, `"use client"` 모듈 내보내기의 점 접근(`Command.Input` 등)입니다. 지시문을 붙이는 파일 목록은 패키지 소스 `scripts/client-modules.mjs` 한 곳에서 관리합니다.
|
|
89
|
+
|
|
90
|
+
**서버에서 호출할 수 있는 함수**: `cn` 과 `*Variants` 7개(`alertVariants` · `avatarVariants` · `badgeVariants` · `buttonVariants` · `progressVariants` · `progressIndicatorVariants` · `toggleVariants`), 합 8개 함수는 서버 컴포넌트에서 직접 호출할 수 있습니다. 이 함수들을 담은 파일과 루트 배럴에는 `"use client"` 를 두지 않습니다. `avatarVariants` 는 `Avatar` 컴포넌트와 파일을 나눠 서버 호출을 유지했습니다(import 경로 · 이름은 그대로).
|
|
91
|
+
|
|
92
|
+
**서버 컴포넌트에서 함수 prop 은 넘길 수 없습니다**: `onClick` · `onCheckedChange` · `onSelect` 같은 함수는 서버에서 클라이언트로 직렬화할 수 없어 React 가 오류를 냅니다(React Server Components 규칙이며 이 패키지의 제약이 아닙니다). 핸들러가 필요하면 그 부분을 `"use client"` 파일로 만들고 그 안에서 AXIS 컴포넌트를 씁니다.
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
// app/save-button.tsx
|
|
96
|
+
'use client';
|
|
97
|
+
import { Button } from '@axis-ds/ui-react';
|
|
98
|
+
|
|
99
|
+
export function SaveButton() {
|
|
100
|
+
return <Button onClick={() => console.log('저장')}>저장</Button>;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
- 서버 컴포넌트가 루트 배럴을 import 하면 Radix 컴포넌트의 클라이언트 참조가 함께 실려 First Load JS 가 커질 수 있습니다(1.4.0 에도 있던 현상). 크기가 중요하면 서브패스(`@axis-ds/ui-react/button`)로 import 합니다.
|
|
105
|
+
|
|
32
106
|
## 컴포넌트 목록
|
|
33
107
|
|
|
34
108
|
Accordion, Alert, Avatar, Breadcrumb, Button, Card, Checkbox, Collapsible, Command, Dialog, Dropdown Menu, Input, Popover, Progress, Radio Group, Scroll Area, Sheet, Skeleton, Slider, Switch, Table, Textarea, Toggle, Tooltip
|
package/dist/accordion/index.js
CHANGED
|
@@ -26,8 +26,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/accordion/index.tsx
|
|
31
29
|
var accordion_exports = {};
|
|
32
30
|
__export(accordion_exports, {
|
|
33
31
|
Accordion: () => Accordion,
|
|
@@ -36,41 +34,25 @@ __export(accordion_exports, {
|
|
|
36
34
|
AccordionTrigger: () => AccordionTrigger
|
|
37
35
|
});
|
|
38
36
|
module.exports = __toCommonJS(accordion_exports);
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
38
|
var React = __toESM(require("react"));
|
|
40
39
|
var AccordionPrimitive = __toESM(require("@radix-ui/react-accordion"));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
45
|
-
var isArbitraryShadowWithHint = (value) => /^\[shadow:.+\]$/.test(value);
|
|
46
|
-
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
47
|
-
extend: {
|
|
48
|
-
classGroups: {
|
|
49
|
-
shadow: [{ shadow: [isArbitraryShadowWithHint] }]
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
function cn(...inputs) {
|
|
54
|
-
return twMerge((0, import_clsx.clsx)(inputs));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// src/accordion/index.tsx
|
|
58
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
|
-
var Accordion = AccordionPrimitive.Root;
|
|
60
|
-
var AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
var import_utils = require("../utils.js");
|
|
41
|
+
const Accordion = AccordionPrimitive.Root;
|
|
42
|
+
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
43
|
AccordionPrimitive.Item,
|
|
62
44
|
{
|
|
63
45
|
ref,
|
|
64
|
-
className: cn("border-b border-[var(--axis-border-default)]", className),
|
|
46
|
+
className: (0, import_utils.cn)("border-b border-[var(--axis-border-default)]", className),
|
|
65
47
|
...props
|
|
66
48
|
}
|
|
67
49
|
));
|
|
68
50
|
AccordionItem.displayName = "AccordionItem";
|
|
69
|
-
|
|
51
|
+
const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
70
52
|
AccordionPrimitive.Trigger,
|
|
71
53
|
{
|
|
72
54
|
ref,
|
|
73
|
-
className: cn(
|
|
55
|
+
className: (0, import_utils.cn)(
|
|
74
56
|
"flex flex-1 items-center justify-between py-4 font-medium transition-all",
|
|
75
57
|
"text-[var(--axis-text-primary)]",
|
|
76
58
|
"hover:underline",
|
|
@@ -100,13 +82,13 @@ var AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref)
|
|
|
100
82
|
}
|
|
101
83
|
) }));
|
|
102
84
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
103
|
-
|
|
85
|
+
const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
86
|
AccordionPrimitive.Content,
|
|
105
87
|
{
|
|
106
88
|
ref,
|
|
107
89
|
className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
108
90
|
...props,
|
|
109
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("pb-4 pt-0", className), children })
|
|
91
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_utils.cn)("pb-4 pt-0", className), children })
|
|
110
92
|
}
|
|
111
93
|
));
|
|
112
94
|
AccordionContent.displayName = "AccordionContent";
|
package/dist/accordion/index.mjs
CHANGED
|
@@ -1,10 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
4
|
+
import { cn } from "../utils.mjs";
|
|
5
|
+
const Accordion = AccordionPrimitive.Root;
|
|
6
|
+
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
|
+
AccordionPrimitive.Item,
|
|
8
|
+
{
|
|
9
|
+
ref,
|
|
10
|
+
className: cn("border-b border-[var(--axis-border-default)]", className),
|
|
11
|
+
...props
|
|
12
|
+
}
|
|
13
|
+
));
|
|
14
|
+
AccordionItem.displayName = "AccordionItem";
|
|
15
|
+
const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
16
|
+
AccordionPrimitive.Trigger,
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
className: cn(
|
|
20
|
+
"flex flex-1 items-center justify-between py-4 font-medium transition-all",
|
|
21
|
+
"text-[var(--axis-text-primary)]",
|
|
22
|
+
"hover:underline",
|
|
23
|
+
"[&[data-state=open]>svg]:rotate-180",
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
...props,
|
|
27
|
+
children: [
|
|
28
|
+
children,
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"svg",
|
|
31
|
+
{
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
width: "16",
|
|
34
|
+
height: "16",
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
fill: "none",
|
|
37
|
+
stroke: "currentColor",
|
|
38
|
+
strokeWidth: "2",
|
|
39
|
+
strokeLinecap: "round",
|
|
40
|
+
strokeLinejoin: "round",
|
|
41
|
+
className: "shrink-0 text-[var(--axis-text-secondary)] transition-transform duration-200",
|
|
42
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
) }));
|
|
48
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
49
|
+
const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
50
|
+
AccordionPrimitive.Content,
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
54
|
+
...props,
|
|
55
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pb-4 pt-0", className), children })
|
|
56
|
+
}
|
|
57
|
+
));
|
|
58
|
+
AccordionContent.displayName = "AccordionContent";
|
|
8
59
|
export {
|
|
9
60
|
Accordion,
|
|
10
61
|
AccordionContent,
|
package/dist/alert/index.js
CHANGED
|
@@ -26,8 +26,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/alert/index.tsx
|
|
31
29
|
var alert_exports = {};
|
|
32
30
|
__export(alert_exports, {
|
|
33
31
|
Alert: () => Alert,
|
|
@@ -36,27 +34,11 @@ __export(alert_exports, {
|
|
|
36
34
|
alertVariants: () => alertVariants
|
|
37
35
|
});
|
|
38
36
|
module.exports = __toCommonJS(alert_exports);
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
38
|
var React = __toESM(require("react"));
|
|
40
39
|
var import_class_variance_authority = require("class-variance-authority");
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var import_clsx = require("clsx");
|
|
44
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
45
|
-
var isArbitraryShadowWithHint = (value) => /^\[shadow:.+\]$/.test(value);
|
|
46
|
-
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
47
|
-
extend: {
|
|
48
|
-
classGroups: {
|
|
49
|
-
shadow: [{ shadow: [isArbitraryShadowWithHint] }]
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
function cn(...inputs) {
|
|
54
|
-
return twMerge((0, import_clsx.clsx)(inputs));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// src/alert/index.tsx
|
|
58
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
|
-
var alertVariants = (0, import_class_variance_authority.cva)(
|
|
40
|
+
var import_utils = require("../utils.js");
|
|
41
|
+
const alertVariants = (0, import_class_variance_authority.cva)(
|
|
60
42
|
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-current",
|
|
61
43
|
{
|
|
62
44
|
// 아이콘은 기본 클래스 [&>svg]:text-current로 변형의 글자색(text-*)을 따른다.
|
|
@@ -76,32 +58,32 @@ var alertVariants = (0, import_class_variance_authority.cva)(
|
|
|
76
58
|
}
|
|
77
59
|
}
|
|
78
60
|
);
|
|
79
|
-
|
|
61
|
+
const Alert = React.forwardRef(
|
|
80
62
|
({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
63
|
"div",
|
|
82
64
|
{
|
|
83
65
|
ref,
|
|
84
66
|
role: "alert",
|
|
85
|
-
className: cn(alertVariants({ variant }), className),
|
|
67
|
+
className: (0, import_utils.cn)(alertVariants({ variant }), className),
|
|
86
68
|
...props
|
|
87
69
|
}
|
|
88
70
|
)
|
|
89
71
|
);
|
|
90
72
|
Alert.displayName = "Alert";
|
|
91
|
-
|
|
73
|
+
const AlertTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
74
|
"h5",
|
|
93
75
|
{
|
|
94
76
|
ref,
|
|
95
|
-
className: cn("mb-1 font-medium leading-none tracking-tight", className),
|
|
77
|
+
className: (0, import_utils.cn)("mb-1 font-medium leading-none tracking-tight", className),
|
|
96
78
|
...props
|
|
97
79
|
}
|
|
98
80
|
));
|
|
99
81
|
AlertTitle.displayName = "AlertTitle";
|
|
100
|
-
|
|
82
|
+
const AlertDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
83
|
"div",
|
|
102
84
|
{
|
|
103
85
|
ref,
|
|
104
|
-
className: cn("text-sm [&_p]:leading-relaxed", className),
|
|
86
|
+
className: (0, import_utils.cn)("text-sm [&_p]:leading-relaxed", className),
|
|
105
87
|
...props
|
|
106
88
|
}
|
|
107
89
|
));
|
package/dist/alert/index.mjs
CHANGED
|
@@ -1,10 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../utils.mjs";
|
|
5
|
+
const alertVariants = cva(
|
|
6
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-current",
|
|
7
|
+
{
|
|
8
|
+
// 아이콘은 기본 클래스 [&>svg]:text-current로 변형의 글자색(text-*)을 따른다.
|
|
9
|
+
// 라이트 icon-success(#22C55E) · icon-warning(#EAB308)은 상태 배경 대비가 2.18:1 · 1.85:1로
|
|
10
|
+
// 비텍스트 기준 3:1에 못 미치므로 아이콘 색에 쓰지 않는다(글자색은 4.76:1 이상).
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: "bg-[var(--axis-surface-default)] text-[var(--axis-text-primary)] border-[var(--axis-border-default)]",
|
|
14
|
+
info: "bg-[var(--axis-surface-info)] text-[var(--axis-text-info)] border-[var(--axis-border-info)]",
|
|
15
|
+
success: "bg-[var(--axis-surface-success)] text-[var(--axis-text-success)] border-[var(--axis-border-success)]",
|
|
16
|
+
warning: "bg-[var(--axis-surface-warning)] text-[var(--axis-text-warning)] border-[var(--axis-border-warning)]",
|
|
17
|
+
destructive: "bg-[var(--axis-surface-error)] text-[var(--axis-text-error)] border-[var(--axis-border-error)]"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
const Alert = React.forwardRef(
|
|
26
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
role: "alert",
|
|
31
|
+
className: cn(alertVariants({ variant }), className),
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
Alert.displayName = "Alert";
|
|
37
|
+
const AlertTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
38
|
+
"h5",
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
className: cn("mb-1 font-medium leading-none tracking-tight", className),
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
));
|
|
45
|
+
AlertTitle.displayName = "AlertTitle";
|
|
46
|
+
const AlertDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
className: cn("text-sm [&_p]:leading-relaxed", className),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
));
|
|
54
|
+
AlertDescription.displayName = "AlertDescription";
|
|
8
55
|
export {
|
|
9
56
|
Alert,
|
|
10
57
|
AlertDescription,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { avatarVariants } from './variants.mjs';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Avatar 컴포넌트 Props
|
|
8
|
+
* @property size - 아바타 크기 (sm, default, lg, xl)
|
|
9
|
+
*/
|
|
10
|
+
interface AvatarProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof avatarVariants> {
|
|
11
|
+
/** 이미지 소스 URL */
|
|
12
|
+
src?: string;
|
|
13
|
+
/** 대체 텍스트 */
|
|
14
|
+
alt?: string;
|
|
15
|
+
/** 이미지 로드 실패 시 표시할 fallback 텍스트 */
|
|
16
|
+
fallback?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 사용자 프로필 이미지를 표시하는 아바타 컴포넌트
|
|
20
|
+
* 이미지 로드 실패 시 이니셜 fallback을 표시한다.
|
|
21
|
+
*/
|
|
22
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
|
|
24
|
+
export { Avatar, type AvatarProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { avatarVariants } from './variants.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Avatar 컴포넌트 Props
|
|
8
|
+
* @property size - 아바타 크기 (sm, default, lg, xl)
|
|
9
|
+
*/
|
|
10
|
+
interface AvatarProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof avatarVariants> {
|
|
11
|
+
/** 이미지 소스 URL */
|
|
12
|
+
src?: string;
|
|
13
|
+
/** 대체 텍스트 */
|
|
14
|
+
alt?: string;
|
|
15
|
+
/** 이미지 로드 실패 시 표시할 fallback 텍스트 */
|
|
16
|
+
fallback?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 사용자 프로필 이미지를 표시하는 아바타 컴포넌트
|
|
20
|
+
* 이미지 로드 실패 시 이니셜 fallback을 표시한다.
|
|
21
|
+
*/
|
|
22
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
|
|
24
|
+
export { Avatar, type AvatarProps };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var avatar_exports = {};
|
|
31
|
+
__export(avatar_exports, {
|
|
32
|
+
Avatar: () => Avatar
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(avatar_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_utils = require("../utils.js");
|
|
38
|
+
var import_variants = require("./variants.js");
|
|
39
|
+
const Avatar = React.forwardRef(
|
|
40
|
+
({ className, size, src, alt, fallback, ...props }, ref) => {
|
|
41
|
+
const [hasError, setHasError] = React.useState(false);
|
|
42
|
+
const initials = React.useMemo(() => {
|
|
43
|
+
if (fallback) return fallback;
|
|
44
|
+
if (!alt) return "?";
|
|
45
|
+
return alt.split(" ").map((word) => word[0]).join("").toUpperCase().slice(0, 2);
|
|
46
|
+
}, [alt, fallback]);
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
className: (0, import_utils.cn)((0, import_variants.avatarVariants)({ size, className })),
|
|
52
|
+
...props,
|
|
53
|
+
children: src && !hasError ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
"img",
|
|
55
|
+
{
|
|
56
|
+
src,
|
|
57
|
+
alt: alt || "Avatar",
|
|
58
|
+
className: "aspect-square h-full w-full object-cover",
|
|
59
|
+
onError: () => setHasError(true)
|
|
60
|
+
}
|
|
61
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex h-full w-full items-center justify-center bg-[var(--axis-surface-tertiary)] text-[var(--axis-text-secondary)] font-medium", children: initials })
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
Avatar.displayName = "Avatar";
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
Avatar
|
|
70
|
+
});
|
|
@@ -1,28 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-ZIF4PLK3.mjs";
|
|
4
|
-
|
|
5
|
-
// src/avatar/index.tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { cva } from "class-variance-authority";
|
|
1
|
+
"use client";
|
|
8
2
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
size: {
|
|
14
|
-
sm: "h-8 w-8 text-xs",
|
|
15
|
-
default: "h-10 w-10 text-sm",
|
|
16
|
-
lg: "h-12 w-12 text-base",
|
|
17
|
-
xl: "h-16 w-16 text-lg"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
defaultVariants: {
|
|
21
|
-
size: "default"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
var Avatar = React.forwardRef(
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../utils.mjs";
|
|
5
|
+
import { avatarVariants } from "./variants.mjs";
|
|
6
|
+
const Avatar = React.forwardRef(
|
|
26
7
|
({ className, size, src, alt, fallback, ...props }, ref) => {
|
|
27
8
|
const [hasError, setHasError] = React.useState(false);
|
|
28
9
|
const initials = React.useMemo(() => {
|
|
@@ -50,8 +31,6 @@ var Avatar = React.forwardRef(
|
|
|
50
31
|
}
|
|
51
32
|
);
|
|
52
33
|
Avatar.displayName = "Avatar";
|
|
53
|
-
|
|
54
34
|
export {
|
|
55
|
-
avatarVariants,
|
|
56
35
|
Avatar
|
|
57
36
|
};
|
package/dist/avatar/index.d.mts
CHANGED
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
size?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
7
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
|
-
/**
|
|
9
|
-
* Avatar 컴포넌트 Props
|
|
10
|
-
* @property size - 아바타 크기 (sm, default, lg, xl)
|
|
11
|
-
*/
|
|
12
|
-
interface AvatarProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof avatarVariants> {
|
|
13
|
-
/** 이미지 소스 URL */
|
|
14
|
-
src?: string;
|
|
15
|
-
/** 대체 텍스트 */
|
|
16
|
-
alt?: string;
|
|
17
|
-
/** 이미지 로드 실패 시 표시할 fallback 텍스트 */
|
|
18
|
-
fallback?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 사용자 프로필 이미지를 표시하는 아바타 컴포넌트
|
|
22
|
-
* 이미지 로드 실패 시 이니셜 fallback을 표시한다.
|
|
23
|
-
*/
|
|
24
|
-
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
-
|
|
26
|
-
export { Avatar, type AvatarProps, avatarVariants };
|
|
1
|
+
export { Avatar, AvatarProps } from './avatar.mjs';
|
|
2
|
+
export { avatarVariants } from './variants.mjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'class-variance-authority';
|
|
5
|
+
import 'class-variance-authority/types';
|
package/dist/avatar/index.d.ts
CHANGED
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
size?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
7
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
|
-
/**
|
|
9
|
-
* Avatar 컴포넌트 Props
|
|
10
|
-
* @property size - 아바타 크기 (sm, default, lg, xl)
|
|
11
|
-
*/
|
|
12
|
-
interface AvatarProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof avatarVariants> {
|
|
13
|
-
/** 이미지 소스 URL */
|
|
14
|
-
src?: string;
|
|
15
|
-
/** 대체 텍스트 */
|
|
16
|
-
alt?: string;
|
|
17
|
-
/** 이미지 로드 실패 시 표시할 fallback 텍스트 */
|
|
18
|
-
fallback?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 사용자 프로필 이미지를 표시하는 아바타 컴포넌트
|
|
22
|
-
* 이미지 로드 실패 시 이니셜 fallback을 표시한다.
|
|
23
|
-
*/
|
|
24
|
-
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
-
|
|
26
|
-
export { Avatar, type AvatarProps, avatarVariants };
|
|
1
|
+
export { Avatar, AvatarProps } from './avatar.js';
|
|
2
|
+
export { avatarVariants } from './variants.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'class-variance-authority';
|
|
5
|
+
import 'class-variance-authority/types';
|