@axis-ds/ui-react 1.7.0 → 1.8.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.
Files changed (40) hide show
  1. package/README.md +10 -3
  2. package/dist/checkbox/index.js +1 -1
  3. package/dist/checkbox/index.mjs +1 -1
  4. package/dist/command/index.d.mts +7 -1
  5. package/dist/command/index.d.ts +7 -1
  6. package/dist/command/index.js +16 -8
  7. package/dist/command/index.mjs +17 -9
  8. package/dist/dialog/index.d.mts +6 -4
  9. package/dist/dialog/index.d.ts +6 -4
  10. package/dist/dialog/index.js +26 -2
  11. package/dist/dialog/index.mjs +26 -2
  12. package/dist/dropdown-menu/index.js +1 -1
  13. package/dist/dropdown-menu/index.mjs +1 -1
  14. package/dist/popover/index.d.mts +7 -4
  15. package/dist/popover/index.d.ts +7 -4
  16. package/dist/popover/index.js +26 -2
  17. package/dist/popover/index.mjs +26 -2
  18. package/dist/progress/index.js +4 -4
  19. package/dist/progress/index.mjs +4 -4
  20. package/dist/radio-group/index.js +1 -1
  21. package/dist/radio-group/index.mjs +1 -1
  22. package/dist/scroll-area/index.js +8 -1
  23. package/dist/scroll-area/index.mjs +8 -1
  24. package/dist/sheet/index.d.mts +7 -5
  25. package/dist/sheet/index.d.ts +7 -5
  26. package/dist/sheet/index.js +26 -2
  27. package/dist/sheet/index.mjs +26 -2
  28. package/dist/slider/index.js +1 -1
  29. package/dist/slider/index.mjs +1 -1
  30. package/dist/switch/index.js +1 -1
  31. package/dist/switch/index.mjs +1 -1
  32. package/dist/textarea/index.js +1 -1
  33. package/dist/textarea/index.mjs +1 -1
  34. package/dist/toast/index.js +1 -1
  35. package/dist/toast/index.mjs +1 -1
  36. package/dist/tooltip/index.d.mts +16 -3
  37. package/dist/tooltip/index.d.ts +16 -3
  38. package/dist/tooltip/index.js +87 -19
  39. package/dist/tooltip/index.mjs +87 -19
  40. package/package.json +2 -2
package/README.md CHANGED
@@ -30,13 +30,20 @@ Tailwind CSS 4(`@import "tailwindcss"`, create-next-app 15.5 기본)에서는 `@
30
30
 
31
31
  ### Tailwind CSS 3
32
32
 
33
- CSS Variables 설정:
33
+ CSS Variables 설정(두 줄 모두, 이 순서로 `@tailwind` 지시문보다 앞에):
34
34
 
35
35
  ```css
36
36
  /* globals.css */
37
+ @import '@axis-ds/tokens/css';
37
38
  @import '@axis-ds/tokens/css/shadcn';
39
+
40
+ @tailwind base;
41
+ @tailwind components;
42
+ @tailwind utilities;
38
43
  ```
39
44
 
45
+ - `@axis-ds/tokens/css` 는 컴포넌트가 읽는 `--axis-*` 변수를 정의합니다. 빠지면 Input · Checkbox 경계가 글자색이 되고 Progress 채움이 투명해집니다. `@axis-ds/tokens/css/shadcn` 은 preset 이 읽는 `--primary` · `--radius` 등을 정의합니다.
46
+
40
47
  `tailwind.config` 에는 `@axis-ds/tokens/tailwind` preset 과 함께 컴포넌트 파일을 `content` 에 넣습니다.
41
48
 
42
49
  ```js
@@ -93,8 +100,8 @@ export default function Page() {
93
100
 
94
101
  | 경계 | 컴포넌트 |
95
102
  |---|---|
96
- | 모듈 전체(패키지 `dist` 파일에 `"use client"`) | `Avatar`(이미지 로드 오류 상태와 대체 표시), `Command` · `CommandInput` · `CommandList` · `CommandEmpty` · `CommandGroup` · `CommandItem` · `CommandSeparator`(cmdk) |
97
- | 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 부분이 클라이언트 참조가 됩니다 |
103
+ | 모듈 전체(패키지 `dist` 파일에 `"use client"`) | `Avatar`(이미지 로드 오류 상태와 대체 표시), `Command` · `CommandInput` · `CommandList` · `CommandEmpty` · `CommandGroup` · `CommandItem` · `CommandSeparator`(cmdk), Dialog · Popover · Sheet(열림 상태를 알아 닫힌 트리거의 `aria-controls` 를 뺌, 1.8.0 · WI-0069), Tooltip(포커스 스크롤 닫힘 방지, WI-0073) |
104
+ | Radix 부분만(Radix 패키지 자체의 `"use client"`) | Accordion · Checkbox · Collapsible · Dropdown Menu · Label · Radio Group · Scroll Area · Select · Separator · Slider · Switch · Tabs · Toast · Toggle. 래퍼는 서버에서 렌더되고 Radix 부분이 클라이언트 참조가 됩니다 |
98
105
  | 없음(서버에서 렌더) | Alert · Badge · Breadcrumb · Button · Card · Input · Progress · Skeleton · Table · Textarea |
99
106
 
100
107
  판단 기준은 `useState` · `useEffect` · `useContext` · `createContext` 같은 클라이언트 전용 API, DOM 이벤트 핸들러를 직접 만드는 코드, `"use client"` 모듈 내보내기의 점 접근(`Command.Input` 등)입니다. 지시문을 붙이는 파일 목록은 패키지 소스 `scripts/client-modules.mjs` 한 곳에서 관리합니다.
@@ -40,7 +40,7 @@ const Checkbox = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
40
40
  {
41
41
  ref,
42
42
  className: (0, import_utils.cn)(
43
- "peer h-4 w-4 shrink-0 rounded-sm border border-[var(--axis-border-default)]",
43
+ "peer h-4 w-4 shrink-0 rounded-sm border border-[var(--axis-form-control-border,var(--axis-border-default))]",
44
44
  "ring-offset-[var(--axis-surface-default)]",
45
45
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--axis-border-focus)] focus-visible:ring-offset-2",
46
46
  "disabled:cursor-not-allowed disabled:opacity-50",
@@ -7,7 +7,7 @@ const Checkbox = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
7
7
  {
8
8
  ref,
9
9
  className: cn(
10
- "peer h-4 w-4 shrink-0 rounded-sm border border-[var(--axis-border-default)]",
10
+ "peer h-4 w-4 shrink-0 rounded-sm border border-[var(--axis-form-control-border,var(--axis-border-default))]",
11
11
  "ring-offset-[var(--axis-surface-default)]",
12
12
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--axis-border-focus)] focus-visible:ring-offset-2",
13
13
  "disabled:cursor-not-allowed disabled:opacity-50",
@@ -60,7 +60,13 @@ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
60
60
  value?: string;
61
61
  forceMount?: boolean;
62
62
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
63
- /** 명령어 그룹 사이의 시각적 구분선 */
63
+ /**
64
+ * 명령어 그룹 사이의 시각적 구분선.
65
+ *
66
+ * cmdk 의 Separator 는 role="separator" 를 props 뒤에 고정해 listbox(CommandList) 안에 두면
67
+ * 허용되지 않는 자식이 된다(axe aria-required-children, WI-0069). 구분선은 시각 장식이라
68
+ * 역할 없이 보조기술에서 숨기고, 검색 중에는 숨기는 cmdk 동작(alwaysRender 로 끔)은 그대로 따른다.
69
+ */
64
70
  declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
65
71
  ref?: React.Ref<HTMLDivElement>;
66
72
  } & {
@@ -60,7 +60,13 @@ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
60
60
  value?: string;
61
61
  forceMount?: boolean;
62
62
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
63
- /** 명령어 그룹 사이의 시각적 구분선 */
63
+ /**
64
+ * 명령어 그룹 사이의 시각적 구분선.
65
+ *
66
+ * cmdk 의 Separator 는 role="separator" 를 props 뒤에 고정해 listbox(CommandList) 안에 두면
67
+ * 허용되지 않는 자식이 된다(axe aria-required-children, WI-0069). 구분선은 시각 장식이라
68
+ * 역할 없이 보조기술에서 숨기고, 검색 중에는 숨기는 cmdk 동작(alwaysRender 로 끔)은 그대로 따른다.
69
+ */
64
70
  declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
65
71
  ref?: React.Ref<HTMLDivElement>;
66
72
  } & {
@@ -41,6 +41,7 @@ module.exports = __toCommonJS(command_exports);
41
41
  var import_jsx_runtime = require("react/jsx-runtime");
42
42
  var React = __toESM(require("react"));
43
43
  var import_cmdk = require("cmdk");
44
+ var import_react_slot = require("@radix-ui/react-slot");
44
45
  var import_utils = require("../utils.js");
45
46
  const Command = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
46
47
  import_cmdk.Command,
@@ -123,14 +124,21 @@ const CommandGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PU
123
124
  }
124
125
  ));
125
126
  CommandGroup.displayName = "CommandGroup";
126
- const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
127
- import_cmdk.Command.Separator,
128
- {
129
- ref,
130
- className: (0, import_utils.cn)("-mx-1 h-px bg-[var(--axis-border-default)]", className),
131
- ...props
132
- }
133
- ));
127
+ const CommandSeparator = React.forwardRef(({ className, alwaysRender, asChild, ...props }, ref) => {
128
+ const searching = (0, import_cmdk.useCommandState)((state) => state.search !== "");
129
+ if (searching && !alwaysRender) return null;
130
+ const Comp = asChild ? import_react_slot.Slot : "div";
131
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
132
+ Comp,
133
+ {
134
+ ref,
135
+ "aria-hidden": "true",
136
+ "cmdk-separator": "",
137
+ className: (0, import_utils.cn)("-mx-1 h-px bg-[var(--axis-border-default)]", className),
138
+ ...props
139
+ }
140
+ );
141
+ });
134
142
  CommandSeparator.displayName = "CommandSeparator";
135
143
  const CommandItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
136
144
  import_cmdk.Command.Item,
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { Command as CommandPrimitive } from "cmdk";
4
+ import { Command as CommandPrimitive, useCommandState } from "cmdk";
5
+ import { Slot } from "@radix-ui/react-slot";
5
6
  import { cn } from "../utils.mjs";
6
7
  const Command = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7
8
  CommandPrimitive,
@@ -84,14 +85,21 @@ const CommandGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PU
84
85
  }
85
86
  ));
86
87
  CommandGroup.displayName = "CommandGroup";
87
- const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
88
- CommandPrimitive.Separator,
89
- {
90
- ref,
91
- className: cn("-mx-1 h-px bg-[var(--axis-border-default)]", className),
92
- ...props
93
- }
94
- ));
88
+ const CommandSeparator = React.forwardRef(({ className, alwaysRender, asChild, ...props }, ref) => {
89
+ const searching = useCommandState((state) => state.search !== "");
90
+ if (searching && !alwaysRender) return null;
91
+ const Comp = asChild ? Slot : "div";
92
+ return /* @__PURE__ */ jsx(
93
+ Comp,
94
+ {
95
+ ref,
96
+ "aria-hidden": "true",
97
+ "cmdk-separator": "",
98
+ className: cn("-mx-1 h-px bg-[var(--axis-border-default)]", className),
99
+ ...props
100
+ }
101
+ );
102
+ });
95
103
  CommandSeparator.displayName = "CommandSeparator";
96
104
  const CommandItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
97
105
  CommandPrimitive.Item,
@@ -2,10 +2,12 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import * as DialogPrimitive from '@radix-ui/react-dialog';
4
4
 
5
- /** 다이얼로그의 루트 컴포넌트. 열림/닫힘 상태를 관리한다. */
6
- declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
7
- /** 다이얼로그를 여는 트리거 버튼 컴포넌트 */
8
- declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare function Dialog({ open: openProp, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
6
+ declare namespace Dialog {
7
+ var displayName: string;
8
+ }
9
+ /** 다이얼로그를 여는 트리거 버튼 컴포넌트. 닫힌 동안에는 aria-controls 를 두지 않는다. */
10
+ declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
11
  /** 다이얼로그 콘텐츠를 포털로 렌더링하는 컴포넌트 */
10
12
  declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
11
13
  /** 다이얼로그를 닫는 버튼 컴포넌트 */
@@ -2,10 +2,12 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import * as DialogPrimitive from '@radix-ui/react-dialog';
4
4
 
5
- /** 다이얼로그의 루트 컴포넌트. 열림/닫힘 상태를 관리한다. */
6
- declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
7
- /** 다이얼로그를 여는 트리거 버튼 컴포넌트 */
8
- declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare function Dialog({ open: openProp, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
6
+ declare namespace Dialog {
7
+ var displayName: string;
8
+ }
9
+ /** 다이얼로그를 여는 트리거 버튼 컴포넌트. 닫힌 동안에는 aria-controls 를 두지 않는다. */
10
+ declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
11
  /** 다이얼로그 콘텐츠를 포털로 렌더링하는 컴포넌트 */
10
12
  declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
11
13
  /** 다이얼로그를 닫는 버튼 컴포넌트 */
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -44,8 +45,31 @@ var import_jsx_runtime = require("react/jsx-runtime");
44
45
  var React = __toESM(require("react"));
45
46
  var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
46
47
  var import_utils = require("../utils.js");
47
- const Dialog = DialogPrimitive.Root;
48
- const DialogTrigger = DialogPrimitive.Trigger;
48
+ const DialogOpenContext = React.createContext(null);
49
+ function Dialog({
50
+ open: openProp,
51
+ defaultOpen,
52
+ onOpenChange,
53
+ ...props
54
+ }) {
55
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
56
+ const isControlled = openProp !== void 0;
57
+ const open = isControlled ? openProp : uncontrolledOpen;
58
+ const handleOpenChange = React.useCallback(
59
+ (next) => {
60
+ if (!isControlled) setUncontrolledOpen(next);
61
+ onOpenChange?.(next);
62
+ },
63
+ [isControlled, onOpenChange]
64
+ );
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOpenContext.Provider, { value: open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props }) });
66
+ }
67
+ Dialog.displayName = "Dialog";
68
+ const DialogTrigger = React.forwardRef((props, ref) => {
69
+ const open = React.useContext(DialogOpenContext);
70
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Trigger, { ref, ...open === false ? { "aria-controls": void 0 } : {}, ...props });
71
+ });
72
+ DialogTrigger.displayName = "DialogTrigger";
49
73
  const DialogPortal = DialogPrimitive.Portal;
50
74
  const DialogClose = DialogPrimitive.Close;
51
75
  const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1,9 +1,33 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import * as DialogPrimitive from "@radix-ui/react-dialog";
4
5
  import { cn } from "../utils.mjs";
5
- const Dialog = DialogPrimitive.Root;
6
- const DialogTrigger = DialogPrimitive.Trigger;
6
+ const DialogOpenContext = React.createContext(null);
7
+ function Dialog({
8
+ open: openProp,
9
+ defaultOpen,
10
+ onOpenChange,
11
+ ...props
12
+ }) {
13
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
14
+ const isControlled = openProp !== void 0;
15
+ const open = isControlled ? openProp : uncontrolledOpen;
16
+ const handleOpenChange = React.useCallback(
17
+ (next) => {
18
+ if (!isControlled) setUncontrolledOpen(next);
19
+ onOpenChange?.(next);
20
+ },
21
+ [isControlled, onOpenChange]
22
+ );
23
+ return /* @__PURE__ */ jsx(DialogOpenContext.Provider, { value: open, children: /* @__PURE__ */ jsx(DialogPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props }) });
24
+ }
25
+ Dialog.displayName = "Dialog";
26
+ const DialogTrigger = React.forwardRef((props, ref) => {
27
+ const open = React.useContext(DialogOpenContext);
28
+ return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ref, ...open === false ? { "aria-controls": void 0 } : {}, ...props });
29
+ });
30
+ DialogTrigger.displayName = "DialogTrigger";
7
31
  const DialogPortal = DialogPrimitive.Portal;
8
32
  const DialogClose = DialogPrimitive.Close;
9
33
  const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
@@ -226,7 +226,7 @@ const DropdownMenuShortcut = ({
226
226
  "span",
227
227
  {
228
228
  className: (0, import_utils.cn)(
229
- "ml-auto text-xs tracking-widest text-[var(--axis-text-tertiary)]",
229
+ "ml-auto text-xs tracking-widest text-[var(--axis-text-secondary)]",
230
230
  className
231
231
  ),
232
232
  ...props
@@ -179,7 +179,7 @@ const DropdownMenuShortcut = ({
179
179
  "span",
180
180
  {
181
181
  className: cn(
182
- "ml-auto text-xs tracking-widest text-[var(--axis-text-tertiary)]",
182
+ "ml-auto text-xs tracking-widest text-[var(--axis-text-secondary)]",
183
183
  className
184
184
  ),
185
185
  ...props
@@ -1,10 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as React from 'react';
2
3
  import * as PopoverPrimitive from '@radix-ui/react-popover';
3
4
 
4
- /** 팝오버의 루트 컴포넌트. 열림/닫힘 상태를 관리한다. */
5
- declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
6
- /** 팝오버를 여는 트리거 요소 컴포넌트 */
7
- declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare function Popover({ open: openProp, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): react_jsx_runtime.JSX.Element;
6
+ declare namespace Popover {
7
+ var displayName: string;
8
+ }
9
+ /** 팝오버를 여는 트리거 요소 컴포넌트. 닫힌 동안에는 aria-controls 를 두지 않는다. */
10
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
8
11
  /** 팝오버의 본문 콘텐츠 컴포넌트. 포털을 통해 렌더링되며 트리거 요소에 상대적으로 위치한다. */
9
12
  declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
13
 
@@ -1,10 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as React from 'react';
2
3
  import * as PopoverPrimitive from '@radix-ui/react-popover';
3
4
 
4
- /** 팝오버의 루트 컴포넌트. 열림/닫힘 상태를 관리한다. */
5
- declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
6
- /** 팝오버를 여는 트리거 요소 컴포넌트 */
7
- declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare function Popover({ open: openProp, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): react_jsx_runtime.JSX.Element;
6
+ declare namespace Popover {
7
+ var displayName: string;
8
+ }
9
+ /** 팝오버를 여는 트리거 요소 컴포넌트. 닫힌 동안에는 aria-controls 를 두지 않는다. */
10
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
8
11
  /** 팝오버의 본문 콘텐츠 컴포넌트. 포털을 통해 렌더링되며 트리거 요소에 상대적으로 위치한다. */
9
12
  declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
13
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -37,8 +38,31 @@ var import_jsx_runtime = require("react/jsx-runtime");
37
38
  var React = __toESM(require("react"));
38
39
  var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
39
40
  var import_utils = require("../utils.js");
40
- const Popover = PopoverPrimitive.Root;
41
- const PopoverTrigger = PopoverPrimitive.Trigger;
41
+ const PopoverOpenContext = React.createContext(null);
42
+ function Popover({
43
+ open: openProp,
44
+ defaultOpen,
45
+ onOpenChange,
46
+ ...props
47
+ }) {
48
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
49
+ const isControlled = openProp !== void 0;
50
+ const open = isControlled ? openProp : uncontrolledOpen;
51
+ const handleOpenChange = React.useCallback(
52
+ (next) => {
53
+ if (!isControlled) setUncontrolledOpen(next);
54
+ onOpenChange?.(next);
55
+ },
56
+ [isControlled, onOpenChange]
57
+ );
58
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverOpenContext.Provider, { value: open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props }) });
59
+ }
60
+ Popover.displayName = "Popover";
61
+ const PopoverTrigger = React.forwardRef((props, ref) => {
62
+ const open = React.useContext(PopoverOpenContext);
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Trigger, { ref, ...open === false ? { "aria-controls": void 0 } : {}, ...props });
64
+ });
65
+ PopoverTrigger.displayName = "PopoverTrigger";
42
66
  const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
43
67
  PopoverPrimitive.Content,
44
68
  {
@@ -1,9 +1,33 @@
1
+ "use client";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import * as PopoverPrimitive from "@radix-ui/react-popover";
4
5
  import { cn } from "../utils.mjs";
5
- const Popover = PopoverPrimitive.Root;
6
- const PopoverTrigger = PopoverPrimitive.Trigger;
6
+ const PopoverOpenContext = React.createContext(null);
7
+ function Popover({
8
+ open: openProp,
9
+ defaultOpen,
10
+ onOpenChange,
11
+ ...props
12
+ }) {
13
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
14
+ const isControlled = openProp !== void 0;
15
+ const open = isControlled ? openProp : uncontrolledOpen;
16
+ const handleOpenChange = React.useCallback(
17
+ (next) => {
18
+ if (!isControlled) setUncontrolledOpen(next);
19
+ onOpenChange?.(next);
20
+ },
21
+ [isControlled, onOpenChange]
22
+ );
23
+ return /* @__PURE__ */ jsx(PopoverOpenContext.Provider, { value: open, children: /* @__PURE__ */ jsx(PopoverPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props }) });
24
+ }
25
+ Popover.displayName = "Popover";
26
+ const PopoverTrigger = React.forwardRef((props, ref) => {
27
+ const open = React.useContext(PopoverOpenContext);
28
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { ref, ...open === false ? { "aria-controls": void 0 } : {}, ...props });
29
+ });
30
+ PopoverTrigger.displayName = "PopoverTrigger";
7
31
  const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
8
32
  PopoverPrimitive.Content,
9
33
  {
@@ -57,10 +57,10 @@ const progressIndicatorVariants = (0, import_class_variance_authority.cva)(
57
57
  {
58
58
  variants: {
59
59
  variant: {
60
- default: "bg-[var(--axis-surface-brand)]",
61
- success: "bg-[var(--axis-color-green-500)]",
62
- warning: "bg-[var(--axis-color-yellow-500)]",
63
- destructive: "bg-[var(--axis-color-red-500)]"
60
+ default: "bg-[var(--axis-progress-fill-default,var(--axis-surface-brand))]",
61
+ success: "bg-[var(--axis-progress-fill-success,var(--axis-color-green-500))]",
62
+ warning: "bg-[var(--axis-progress-fill-warning,var(--axis-color-yellow-500))]",
63
+ destructive: "bg-[var(--axis-progress-fill-destructive,var(--axis-color-red-500))]"
64
64
  }
65
65
  },
66
66
  defaultVariants: {
@@ -22,10 +22,10 @@ const progressIndicatorVariants = cva(
22
22
  {
23
23
  variants: {
24
24
  variant: {
25
- default: "bg-[var(--axis-surface-brand)]",
26
- success: "bg-[var(--axis-color-green-500)]",
27
- warning: "bg-[var(--axis-color-yellow-500)]",
28
- destructive: "bg-[var(--axis-color-red-500)]"
25
+ default: "bg-[var(--axis-progress-fill-default,var(--axis-surface-brand))]",
26
+ success: "bg-[var(--axis-progress-fill-success,var(--axis-color-green-500))]",
27
+ warning: "bg-[var(--axis-progress-fill-warning,var(--axis-color-yellow-500))]",
28
+ destructive: "bg-[var(--axis-progress-fill-destructive,var(--axis-color-red-500))]"
29
29
  }
30
30
  },
31
31
  defaultVariants: {
@@ -50,7 +50,7 @@ const RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => /* @__
50
50
  {
51
51
  ref,
52
52
  className: (0, import_utils.cn)(
53
- "aspect-square h-4 w-4 rounded-full border border-[var(--axis-border-default)]",
53
+ "aspect-square h-4 w-4 rounded-full border border-[var(--axis-form-control-border,var(--axis-border-default))]",
54
54
  "ring-offset-[var(--axis-surface-default)]",
55
55
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--axis-border-focus)] focus-visible:ring-offset-2",
56
56
  "disabled:cursor-not-allowed disabled:opacity-50",
@@ -16,7 +16,7 @@ const RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => /* @__
16
16
  {
17
17
  ref,
18
18
  className: cn(
19
- "aspect-square h-4 w-4 rounded-full border border-[var(--axis-border-default)]",
19
+ "aspect-square h-4 w-4 rounded-full border border-[var(--axis-form-control-border,var(--axis-border-default))]",
20
20
  "ring-offset-[var(--axis-surface-default)]",
21
21
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--axis-border-focus)] focus-visible:ring-offset-2",
22
22
  "disabled:cursor-not-allowed disabled:opacity-50",
@@ -43,7 +43,14 @@ const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) =>
43
43
  className: (0, import_utils.cn)("relative overflow-hidden", className),
44
44
  ...props,
45
45
  children: [
46
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ ScrollAreaPrimitive.Viewport,
48
+ {
49
+ tabIndex: 0,
50
+ className: "h-full w-full rounded-[inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--axis-border-focus)]",
51
+ children
52
+ }
53
+ ),
47
54
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollBar, {}),
48
55
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaPrimitive.Corner, {})
49
56
  ]
@@ -9,7 +9,14 @@ const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) =>
9
9
  className: cn("relative overflow-hidden", className),
10
10
  ...props,
11
11
  children: [
12
- /* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
12
+ /* @__PURE__ */ jsx(
13
+ ScrollAreaPrimitive.Viewport,
14
+ {
15
+ tabIndex: 0,
16
+ className: "h-full w-full rounded-[inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--axis-border-focus)]",
17
+ children
18
+ }
19
+ ),
13
20
  /* @__PURE__ */ jsx(ScrollBar, {}),
14
21
  /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
15
22
  ]
@@ -1,14 +1,16 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import type * as __AxisClsx from 'clsx';
3
2
  type __AxisCvaClassProp = { class: __AxisClsx.ClassValue; className?: never } | { class?: never; className: __AxisClsx.ClassValue } | { class?: never; className?: never };
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as React from 'react';
5
5
  import * as DialogPrimitive from '@radix-ui/react-dialog';
6
6
  import { VariantProps } from 'class-variance-authority';
7
7
 
8
- /** 화면 측면에서 슬라이드되어 나타나는 시트(Sheet) 컴포넌트의 루트 요소 */
9
- declare const Sheet: React.FC<DialogPrimitive.DialogProps>;
10
- /** 시트를 열기 위한 트리거 버튼 컴포넌트 */
11
- declare const SheetTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
+ declare function Sheet({ open: openProp, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
9
+ declare namespace Sheet {
10
+ var displayName: string;
11
+ }
12
+ /** 시트를 열기 위한 트리거 버튼 컴포넌트. 닫힌 동안에는 aria-controls 를 두지 않는다. */
13
+ declare const SheetTrigger: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
12
14
  /** 시트를 닫기 위한 닫기 버튼 컴포넌트 */
13
15
  declare const SheetClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
14
16
  /** 시트 콘텐츠를 포탈로 렌더링하는 컴포넌트 */
@@ -1,14 +1,16 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import type * as __AxisClsx from 'clsx';
3
2
  type __AxisCvaClassProp = { class: __AxisClsx.ClassValue; className?: never } | { class?: never; className: __AxisClsx.ClassValue } | { class?: never; className?: never };
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as React from 'react';
5
5
  import * as DialogPrimitive from '@radix-ui/react-dialog';
6
6
  import { VariantProps } from 'class-variance-authority';
7
7
 
8
- /** 화면 측면에서 슬라이드되어 나타나는 시트(Sheet) 컴포넌트의 루트 요소 */
9
- declare const Sheet: React.FC<DialogPrimitive.DialogProps>;
10
- /** 시트를 열기 위한 트리거 버튼 컴포넌트 */
11
- declare const SheetTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
+ declare function Sheet({ open: openProp, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
9
+ declare namespace Sheet {
10
+ var displayName: string;
11
+ }
12
+ /** 시트를 열기 위한 트리거 버튼 컴포넌트. 닫힌 동안에는 aria-controls 를 두지 않는다. */
13
+ declare const SheetTrigger: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
12
14
  /** 시트를 닫기 위한 닫기 버튼 컴포넌트 */
13
15
  declare const SheetClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
14
16
  /** 시트 콘텐츠를 포탈로 렌더링하는 컴포넌트 */
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -45,8 +46,31 @@ var React = __toESM(require("react"));
45
46
  var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"));
46
47
  var import_class_variance_authority = require("class-variance-authority");
47
48
  var import_utils = require("../utils.js");
48
- const Sheet = SheetPrimitive.Root;
49
- const SheetTrigger = SheetPrimitive.Trigger;
49
+ const SheetOpenContext = React.createContext(null);
50
+ function Sheet({
51
+ open: openProp,
52
+ defaultOpen,
53
+ onOpenChange,
54
+ ...props
55
+ }) {
56
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
57
+ const isControlled = openProp !== void 0;
58
+ const open = isControlled ? openProp : uncontrolledOpen;
59
+ const handleOpenChange = React.useCallback(
60
+ (next) => {
61
+ if (!isControlled) setUncontrolledOpen(next);
62
+ onOpenChange?.(next);
63
+ },
64
+ [isControlled, onOpenChange]
65
+ );
66
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetOpenContext.Provider, { value: open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props }) });
67
+ }
68
+ Sheet.displayName = "Sheet";
69
+ const SheetTrigger = React.forwardRef((props, ref) => {
70
+ const open = React.useContext(SheetOpenContext);
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetPrimitive.Trigger, { ref, ...open === false ? { "aria-controls": void 0 } : {}, ...props });
72
+ });
73
+ SheetTrigger.displayName = "SheetTrigger";
50
74
  const SheetClose = SheetPrimitive.Close;
51
75
  const SheetPortal = SheetPrimitive.Portal;
52
76
  const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1,10 +1,34 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import * as SheetPrimitive from "@radix-ui/react-dialog";
4
5
  import { cva } from "class-variance-authority";
5
6
  import { cn } from "../utils.mjs";
6
- const Sheet = SheetPrimitive.Root;
7
- const SheetTrigger = SheetPrimitive.Trigger;
7
+ const SheetOpenContext = React.createContext(null);
8
+ function Sheet({
9
+ open: openProp,
10
+ defaultOpen,
11
+ onOpenChange,
12
+ ...props
13
+ }) {
14
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
15
+ const isControlled = openProp !== void 0;
16
+ const open = isControlled ? openProp : uncontrolledOpen;
17
+ const handleOpenChange = React.useCallback(
18
+ (next) => {
19
+ if (!isControlled) setUncontrolledOpen(next);
20
+ onOpenChange?.(next);
21
+ },
22
+ [isControlled, onOpenChange]
23
+ );
24
+ return /* @__PURE__ */ jsx(SheetOpenContext.Provider, { value: open, children: /* @__PURE__ */ jsx(SheetPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props }) });
25
+ }
26
+ Sheet.displayName = "Sheet";
27
+ const SheetTrigger = React.forwardRef((props, ref) => {
28
+ const open = React.useContext(SheetOpenContext);
29
+ return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { ref, ...open === false ? { "aria-controls": void 0 } : {}, ...props });
30
+ });
31
+ SheetTrigger.displayName = "SheetTrigger";
8
32
  const SheetClose = SheetPrimitive.Close;
9
33
  const SheetPortal = SheetPrimitive.Portal;
10
34
  const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
@@ -51,7 +51,7 @@ const Slider = React.forwardRef(
51
51
  ),
52
52
  ...props,
53
53
  children: [
54
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-[var(--axis-surface-tertiary)]", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderPrimitive.Range, { className: "absolute h-full bg-[var(--axis-interactive-primary)]" }) }),
54
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-[var(--axis-form-control-track,var(--axis-surface-tertiary))]", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderPrimitive.Range, { className: "absolute h-full bg-[var(--axis-interactive-primary)]" }) }),
55
55
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
56
  SliderPrimitive.Thumb,
57
57
  {
@@ -18,7 +18,7 @@ const Slider = React.forwardRef(
18
18
  ),
19
19
  ...props,
20
20
  children: [
21
- /* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-[var(--axis-surface-tertiary)]", children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "absolute h-full bg-[var(--axis-interactive-primary)]" }) }),
21
+ /* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-[var(--axis-form-control-track,var(--axis-surface-tertiary))]", children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "absolute h-full bg-[var(--axis-interactive-primary)]" }) }),
22
22
  /* @__PURE__ */ jsx(
23
23
  SliderPrimitive.Thumb,
24
24
  {
@@ -43,7 +43,7 @@ const Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
43
43
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--axis-border-focus)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--axis-surface-default)]",
44
44
  "disabled:cursor-not-allowed disabled:opacity-50",
45
45
  "data-[state=checked]:bg-[var(--axis-interactive-primary)]",
46
- "data-[state=unchecked]:bg-[var(--axis-surface-tertiary)]",
46
+ "data-[state=unchecked]:bg-[var(--axis-form-control-track,var(--axis-surface-tertiary))]",
47
47
  className
48
48
  ),
49
49
  ...props,
@@ -10,7 +10,7 @@ const Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
10
10
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--axis-border-focus)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--axis-surface-default)]",
11
11
  "disabled:cursor-not-allowed disabled:opacity-50",
12
12
  "data-[state=checked]:bg-[var(--axis-interactive-primary)]",
13
- "data-[state=unchecked]:bg-[var(--axis-surface-tertiary)]",
13
+ "data-[state=unchecked]:bg-[var(--axis-form-control-track,var(--axis-surface-tertiary))]",
14
14
  className
15
15
  ),
16
16
  ...props,
@@ -38,7 +38,7 @@ const Textarea = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
38
38
  "textarea",
39
39
  {
40
40
  className: (0, import_utils.cn)(
41
- "flex min-h-[80px] w-full rounded-md border border-[var(--axis-border-default)] bg-[var(--axis-surface-default)] px-3 py-2 text-sm",
41
+ "flex min-h-[80px] w-full rounded-md border border-[var(--axis-form-control-border,var(--axis-border-default))] bg-[var(--axis-surface-default)] px-3 py-2 text-sm",
42
42
  "text-[var(--axis-text-primary)]",
43
43
  "ring-offset-[var(--axis-surface-default)]",
44
44
  "placeholder:text-[var(--axis-text-tertiary)]",
@@ -5,7 +5,7 @@ const Textarea = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
5
5
  "textarea",
6
6
  {
7
7
  className: cn(
8
- "flex min-h-[80px] w-full rounded-md border border-[var(--axis-border-default)] bg-[var(--axis-surface-default)] px-3 py-2 text-sm",
8
+ "flex min-h-[80px] w-full rounded-md border border-[var(--axis-form-control-border,var(--axis-border-default))] bg-[var(--axis-surface-default)] px-3 py-2 text-sm",
9
9
  "text-[var(--axis-text-primary)]",
10
10
  "ring-offset-[var(--axis-surface-default)]",
11
11
  "placeholder:text-[var(--axis-text-tertiary)]",
@@ -126,7 +126,7 @@ const ToastDescription = React.forwardRef(({ className, ...props }, ref) => /* @
126
126
  ToastPrimitives.Description,
127
127
  {
128
128
  ref,
129
- className: (0, import_utils.cn)("text-sm opacity-90", className),
129
+ className: (0, import_utils.cn)("text-sm", className),
130
130
  ...props
131
131
  }
132
132
  ));
@@ -87,7 +87,7 @@ const ToastDescription = React.forwardRef(({ className, ...props }, ref) => /* @
87
87
  ToastPrimitives.Description,
88
88
  {
89
89
  ref,
90
- className: cn("text-sm opacity-90", className),
90
+ className: cn("text-sm", className),
91
91
  ...props
92
92
  }
93
93
  ));
@@ -1,12 +1,25 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as React from 'react';
2
3
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
4
 
4
5
  /** 툴팁 시스템의 프로바이더 컴포넌트. delayDuration 등 전역 설정을 관리한다. */
5
6
  declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
6
- /** 툴팁의 루트 컴포넌트. 열림/닫힘 상태를 관리한다. */
7
- declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
7
+ type TooltipProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>;
8
+ /**
9
+ * 툴팁의 루트 컴포넌트. 열림/닫힘 상태를 관리한다.
10
+ *
11
+ * Radix Tooltip 은 트리거를 담은 요소가 스크롤되면 닫힌다. 화면 밖 트리거로 Tab 하면 브라우저가 트리거를
12
+ * 화면 안으로 스크롤하고, 그 스크롤이 막 열린 툴팁을 닫는다(WCAG 1.4.13 지속성, WI-0073).
13
+ * 이 래퍼는 open 을 직접 제어해 **트리거에 포커스가 있는 동안 스크롤로 생긴 닫힘**만 무시한다.
14
+ * Esc · 포인터 이탈 · 블러 · 클릭 · 포커스 없는 hover 툴팁의 스크롤 닫힘은 Radix 동작 그대로다.
15
+ * open · defaultOpen · onOpenChange 는 그대로 통과한다(제어 · 비제어 모두).
16
+ */
17
+ declare function Tooltip({ open: openProp, defaultOpen, onOpenChange, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
18
+ declare namespace Tooltip {
19
+ var displayName: string;
20
+ }
8
21
  /** 툴팁을 표시하기 위한 트리거 요소 */
9
- declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
22
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
23
  /** 툴팁의 콘텐츠를 표시하는 컴포넌트. 포탈을 통해 렌더링되며 방향별 슬라이드 애니메이션을 지원한다. */
11
24
  declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
25
 
@@ -1,12 +1,25 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as React from 'react';
2
3
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
4
 
4
5
  /** 툴팁 시스템의 프로바이더 컴포넌트. delayDuration 등 전역 설정을 관리한다. */
5
6
  declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
6
- /** 툴팁의 루트 컴포넌트. 열림/닫힘 상태를 관리한다. */
7
- declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
7
+ type TooltipProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>;
8
+ /**
9
+ * 툴팁의 루트 컴포넌트. 열림/닫힘 상태를 관리한다.
10
+ *
11
+ * Radix Tooltip 은 트리거를 담은 요소가 스크롤되면 닫힌다. 화면 밖 트리거로 Tab 하면 브라우저가 트리거를
12
+ * 화면 안으로 스크롤하고, 그 스크롤이 막 열린 툴팁을 닫는다(WCAG 1.4.13 지속성, WI-0073).
13
+ * 이 래퍼는 open 을 직접 제어해 **트리거에 포커스가 있는 동안 스크롤로 생긴 닫힘**만 무시한다.
14
+ * Esc · 포인터 이탈 · 블러 · 클릭 · 포커스 없는 hover 툴팁의 스크롤 닫힘은 Radix 동작 그대로다.
15
+ * open · defaultOpen · onOpenChange 는 그대로 통과한다(제어 · 비제어 모두).
16
+ */
17
+ declare function Tooltip({ open: openProp, defaultOpen, onOpenChange, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
18
+ declare namespace Tooltip {
19
+ var displayName: string;
20
+ }
8
21
  /** 툴팁을 표시하기 위한 트리거 요소 */
9
- declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
22
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
23
  /** 툴팁의 콘텐츠를 표시하는 컴포넌트. 포탈을 통해 렌더링되며 방향별 슬라이드 애니메이션을 지원한다. */
11
24
  declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
25
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -39,25 +40,92 @@ var React = __toESM(require("react"));
39
40
  var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
40
41
  var import_utils = require("../utils.js");
41
42
  const TooltipProvider = TooltipPrimitive.Provider;
42
- const Tooltip = TooltipPrimitive.Root;
43
- const TooltipTrigger = TooltipPrimitive.Trigger;
44
- const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
- TooltipPrimitive.Content,
46
- {
47
- ref,
48
- sideOffset,
49
- className: (0, import_utils.cn)(
50
- "z-50 overflow-hidden rounded-md bg-[var(--axis-surface-inverse)] px-3 py-1.5 text-xs text-[var(--axis-text-inverse)]",
51
- "animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 motion-reduce:!animate-none",
52
- "data-[side=bottom]:slide-in-from-top-2",
53
- "data-[side=left]:slide-in-from-right-2",
54
- "data-[side=right]:slide-in-from-left-2",
55
- "data-[side=top]:slide-in-from-bottom-2",
56
- className
57
- ),
58
- ...props
59
- }
60
- ) }));
43
+ const TooltipPersistenceContext = React.createContext(null);
44
+ const useIsomorphicLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
45
+ function Tooltip({ open: openProp, defaultOpen, onOpenChange, ...props }) {
46
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
47
+ const isControlled = openProp !== void 0;
48
+ const open = isControlled ? openProp : uncontrolledOpen;
49
+ const triggerRef = React.useRef(null);
50
+ const scrollingRef = React.useRef(false);
51
+ const dismissRef = React.useRef(false);
52
+ useIsomorphicLayoutEffect(() => {
53
+ let timer = 0;
54
+ const handleScroll = () => {
55
+ scrollingRef.current = true;
56
+ window.clearTimeout(timer);
57
+ timer = window.setTimeout(() => {
58
+ scrollingRef.current = false;
59
+ }, 0);
60
+ };
61
+ window.addEventListener("scroll", handleScroll, { capture: true });
62
+ return () => {
63
+ window.removeEventListener("scroll", handleScroll, { capture: true });
64
+ window.clearTimeout(timer);
65
+ };
66
+ }, []);
67
+ const handleOpenChange = React.useCallback(
68
+ (next) => {
69
+ if (!next) {
70
+ const dismissed = dismissRef.current;
71
+ dismissRef.current = false;
72
+ const trigger = triggerRef.current;
73
+ const focused = trigger !== null && trigger.ownerDocument.activeElement === trigger;
74
+ if (!dismissed && scrollingRef.current && focused) return;
75
+ }
76
+ if (!isControlled) setUncontrolledOpen(next);
77
+ onOpenChange?.(next);
78
+ },
79
+ [isControlled, onOpenChange]
80
+ );
81
+ const markDismiss = React.useCallback(() => {
82
+ dismissRef.current = true;
83
+ }, []);
84
+ const contextValue = React.useMemo(() => ({ triggerRef, markDismiss }), [markDismiss]);
85
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPersistenceContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Root, { ...props, open, onOpenChange: handleOpenChange }) });
86
+ }
87
+ Tooltip.displayName = "Tooltip";
88
+ const TooltipTrigger = React.forwardRef((props, forwardedRef) => {
89
+ const persistence = React.useContext(TooltipPersistenceContext);
90
+ const ref = React.useCallback(
91
+ (node) => {
92
+ if (persistence) persistence.triggerRef.current = node;
93
+ if (typeof forwardedRef === "function") forwardedRef(node);
94
+ else if (forwardedRef) forwardedRef.current = node;
95
+ },
96
+ [persistence, forwardedRef]
97
+ );
98
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Trigger, { ref, ...props });
99
+ });
100
+ TooltipTrigger.displayName = "TooltipTrigger";
101
+ const TooltipContent = React.forwardRef(({ className, sideOffset = 4, onEscapeKeyDown, onPointerDownOutside, ...props }, ref) => {
102
+ const persistence = React.useContext(TooltipPersistenceContext);
103
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
104
+ TooltipPrimitive.Content,
105
+ {
106
+ ref,
107
+ sideOffset,
108
+ onEscapeKeyDown: (event) => {
109
+ onEscapeKeyDown?.(event);
110
+ if (!event.defaultPrevented) persistence?.markDismiss();
111
+ },
112
+ onPointerDownOutside: (event) => {
113
+ onPointerDownOutside?.(event);
114
+ if (!event.defaultPrevented) persistence?.markDismiss();
115
+ },
116
+ className: (0, import_utils.cn)(
117
+ "z-50 overflow-hidden rounded-md bg-[var(--axis-surface-inverse)] px-3 py-1.5 text-xs text-[var(--axis-text-inverse)]",
118
+ "animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 motion-reduce:!animate-none",
119
+ "data-[side=bottom]:slide-in-from-top-2",
120
+ "data-[side=left]:slide-in-from-right-2",
121
+ "data-[side=right]:slide-in-from-left-2",
122
+ "data-[side=top]:slide-in-from-bottom-2",
123
+ className
124
+ ),
125
+ ...props
126
+ }
127
+ ) });
128
+ });
61
129
  TooltipContent.displayName = "TooltipContent";
62
130
  // Annotate the CommonJS export names for ESM import in node:
63
131
  0 && (module.exports = {
@@ -1,27 +1,95 @@
1
+ "use client";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
4
5
  import { cn } from "../utils.mjs";
5
6
  const TooltipProvider = TooltipPrimitive.Provider;
6
- const Tooltip = TooltipPrimitive.Root;
7
- const TooltipTrigger = TooltipPrimitive.Trigger;
8
- const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
9
- TooltipPrimitive.Content,
10
- {
11
- ref,
12
- sideOffset,
13
- className: cn(
14
- "z-50 overflow-hidden rounded-md bg-[var(--axis-surface-inverse)] px-3 py-1.5 text-xs text-[var(--axis-text-inverse)]",
15
- "animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 motion-reduce:!animate-none",
16
- "data-[side=bottom]:slide-in-from-top-2",
17
- "data-[side=left]:slide-in-from-right-2",
18
- "data-[side=right]:slide-in-from-left-2",
19
- "data-[side=top]:slide-in-from-bottom-2",
20
- className
21
- ),
22
- ...props
23
- }
24
- ) }));
7
+ const TooltipPersistenceContext = React.createContext(null);
8
+ const useIsomorphicLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
9
+ function Tooltip({ open: openProp, defaultOpen, onOpenChange, ...props }) {
10
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
11
+ const isControlled = openProp !== void 0;
12
+ const open = isControlled ? openProp : uncontrolledOpen;
13
+ const triggerRef = React.useRef(null);
14
+ const scrollingRef = React.useRef(false);
15
+ const dismissRef = React.useRef(false);
16
+ useIsomorphicLayoutEffect(() => {
17
+ let timer = 0;
18
+ const handleScroll = () => {
19
+ scrollingRef.current = true;
20
+ window.clearTimeout(timer);
21
+ timer = window.setTimeout(() => {
22
+ scrollingRef.current = false;
23
+ }, 0);
24
+ };
25
+ window.addEventListener("scroll", handleScroll, { capture: true });
26
+ return () => {
27
+ window.removeEventListener("scroll", handleScroll, { capture: true });
28
+ window.clearTimeout(timer);
29
+ };
30
+ }, []);
31
+ const handleOpenChange = React.useCallback(
32
+ (next) => {
33
+ if (!next) {
34
+ const dismissed = dismissRef.current;
35
+ dismissRef.current = false;
36
+ const trigger = triggerRef.current;
37
+ const focused = trigger !== null && trigger.ownerDocument.activeElement === trigger;
38
+ if (!dismissed && scrollingRef.current && focused) return;
39
+ }
40
+ if (!isControlled) setUncontrolledOpen(next);
41
+ onOpenChange?.(next);
42
+ },
43
+ [isControlled, onOpenChange]
44
+ );
45
+ const markDismiss = React.useCallback(() => {
46
+ dismissRef.current = true;
47
+ }, []);
48
+ const contextValue = React.useMemo(() => ({ triggerRef, markDismiss }), [markDismiss]);
49
+ return /* @__PURE__ */ jsx(TooltipPersistenceContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { ...props, open, onOpenChange: handleOpenChange }) });
50
+ }
51
+ Tooltip.displayName = "Tooltip";
52
+ const TooltipTrigger = React.forwardRef((props, forwardedRef) => {
53
+ const persistence = React.useContext(TooltipPersistenceContext);
54
+ const ref = React.useCallback(
55
+ (node) => {
56
+ if (persistence) persistence.triggerRef.current = node;
57
+ if (typeof forwardedRef === "function") forwardedRef(node);
58
+ else if (forwardedRef) forwardedRef.current = node;
59
+ },
60
+ [persistence, forwardedRef]
61
+ );
62
+ return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { ref, ...props });
63
+ });
64
+ TooltipTrigger.displayName = "TooltipTrigger";
65
+ const TooltipContent = React.forwardRef(({ className, sideOffset = 4, onEscapeKeyDown, onPointerDownOutside, ...props }, ref) => {
66
+ const persistence = React.useContext(TooltipPersistenceContext);
67
+ return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
68
+ TooltipPrimitive.Content,
69
+ {
70
+ ref,
71
+ sideOffset,
72
+ onEscapeKeyDown: (event) => {
73
+ onEscapeKeyDown?.(event);
74
+ if (!event.defaultPrevented) persistence?.markDismiss();
75
+ },
76
+ onPointerDownOutside: (event) => {
77
+ onPointerDownOutside?.(event);
78
+ if (!event.defaultPrevented) persistence?.markDismiss();
79
+ },
80
+ className: cn(
81
+ "z-50 overflow-hidden rounded-md bg-[var(--axis-surface-inverse)] px-3 py-1.5 text-xs text-[var(--axis-text-inverse)]",
82
+ "animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 motion-reduce:!animate-none",
83
+ "data-[side=bottom]:slide-in-from-top-2",
84
+ "data-[side=left]:slide-in-from-right-2",
85
+ "data-[side=right]:slide-in-from-left-2",
86
+ "data-[side=top]:slide-in-from-bottom-2",
87
+ className
88
+ ),
89
+ ...props
90
+ }
91
+ ) });
92
+ });
25
93
  TooltipContent.displayName = "TooltipContent";
26
94
  export {
27
95
  Tooltip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axis-ds/ui-react",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "AXIS Design System - Core React UI Components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -302,7 +302,7 @@
302
302
  "clsx": "^2.1.0",
303
303
  "cmdk": "^1.1.1",
304
304
  "tailwind-merge": "^2.5.0",
305
- "@axis-ds/tokens": "1.7.0"
305
+ "@axis-ds/tokens": "1.8.1"
306
306
  },
307
307
  "devDependencies": {
308
308
  "@testing-library/jest-dom": "^6.9.1",