@axis-ds/ui-react 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,6 +46,18 @@ content: [
46
46
  ],
47
47
  ```
48
48
 
49
+ ### 애니메이션
50
+
51
+ - Accordion 열고 닫기 · Progress `indeterminate` 의 keyframes 는 `@axis-ds/tokens` 가 정의합니다(Tailwind 3 preset · Tailwind 4 진입점). 따로 할 일은 없습니다.
52
+ - Dialog · Sheet · Popover · Select · DropdownMenu · Tooltip · Toast 의 열고 닫는 애니메이션(`animate-in` · `fade-in-0` 류)은 애니메이션 플러그인이 필요합니다. 선택적 peer 의존으로 선언되어 있어 설치 경고는 나오지 않습니다. 없으면 애니메이션 없이 바로 열리고 닫힙니다.
53
+
54
+ | Tailwind | 플러그인 | 넣는 곳 |
55
+ |---|---|---|
56
+ | 4 | `tw-animate-css` | 전역 CSS 의 `@import "tailwindcss";` 바로 다음 줄에 `@import "tw-animate-css";` |
57
+ | 3 | `tailwindcss-animate` | `tailwind.config` 의 `plugins: [require("tailwindcss-animate")]` |
58
+
59
+ - 움직임 줄이기(`prefers-reduced-motion: reduce`) 설정에서는 모든 컴포넌트 애니메이션이 멈춥니다(`motion-reduce:!animate-none`).
60
+
49
61
  ## 사용법
50
62
 
51
63
  ```tsx
@@ -86,7 +86,7 @@ const AccordionContent = React.forwardRef(({ className, children, ...props }, re
86
86
  AccordionPrimitive.Content,
87
87
  {
88
88
  ref,
89
- className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
89
+ className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down motion-reduce:!animate-none",
90
90
  ...props,
91
91
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_utils.cn)("pb-4 pt-0", className), children })
92
92
  }
@@ -50,7 +50,7 @@ const AccordionContent = React.forwardRef(({ className, children, ...props }, re
50
50
  AccordionPrimitive.Content,
51
51
  {
52
52
  ref,
53
- className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
53
+ className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down motion-reduce:!animate-none",
54
54
  ...props,
55
55
  children: /* @__PURE__ */ jsx("div", { className: cn("pb-4 pt-0", className), children })
56
56
  }
@@ -17,6 +17,16 @@ interface AvatarProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps
17
17
  /**
18
18
  * 사용자 프로필 이미지를 표시하는 아바타 컴포넌트
19
19
  * 이미지 로드 실패 시 이니셜 fallback을 표시한다.
20
+ *
21
+ * 실패 판정은 두 경로다(WI-0054).
22
+ * 1. `<img onError>`: 하이드레이션 뒤(또는 클라이언트 렌더)에 난 오류.
23
+ * 2. 마운트 시 검사: 서버 렌더된 이미지의 오류가 하이드레이션 전에 끝나면 onError 가 붙기 전이라
24
+ * 이벤트를 놓친다. 그래서 마운트(와 src 변경) 때 `complete && naturalWidth === 0` 이면 실패 후보로 보고,
25
+ * `img.decode()` 가 거부될 때만 실패로 확정한다. 고유 크기가 없는 SVG 처럼 정상 로드인데
26
+ * naturalWidth 가 0 일 수 있는 이미지는 decode 가 이행되므로 실패로 보지 않는다.
27
+ * decode 가 없는 환경에서는 판정하지 않는다(종전 동작).
28
+ *
29
+ * 실패 상태는 실패한 src 와 함께 기억한다. src 가 바뀌면 렌더 중에 초기화해 새 이미지를 다시 시도한다.
20
30
  */
21
31
  declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
22
32
 
@@ -17,6 +17,16 @@ interface AvatarProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps
17
17
  /**
18
18
  * 사용자 프로필 이미지를 표시하는 아바타 컴포넌트
19
19
  * 이미지 로드 실패 시 이니셜 fallback을 표시한다.
20
+ *
21
+ * 실패 판정은 두 경로다(WI-0054).
22
+ * 1. `<img onError>`: 하이드레이션 뒤(또는 클라이언트 렌더)에 난 오류.
23
+ * 2. 마운트 시 검사: 서버 렌더된 이미지의 오류가 하이드레이션 전에 끝나면 onError 가 붙기 전이라
24
+ * 이벤트를 놓친다. 그래서 마운트(와 src 변경) 때 `complete && naturalWidth === 0` 이면 실패 후보로 보고,
25
+ * `img.decode()` 가 거부될 때만 실패로 확정한다. 고유 크기가 없는 SVG 처럼 정상 로드인데
26
+ * naturalWidth 가 0 일 수 있는 이미지는 decode 가 이행되므로 실패로 보지 않는다.
27
+ * decode 가 없는 환경에서는 판정하지 않는다(종전 동작).
28
+ *
29
+ * 실패 상태는 실패한 src 와 함께 기억한다. src 가 바뀌면 렌더 중에 초기화해 새 이미지를 다시 시도한다.
20
30
  */
21
31
  declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
22
32
 
@@ -38,7 +38,28 @@ var import_utils = require("../utils.js");
38
38
  var import_variants = require("./variants.js");
39
39
  const Avatar = React.forwardRef(
40
40
  ({ className, size, src, alt, fallback, ...props }, ref) => {
41
- const [hasError, setHasError] = React.useState(false);
41
+ const [failedSrc, setFailedSrc] = React.useState(null);
42
+ if (failedSrc !== null && failedSrc !== src) {
43
+ setFailedSrc(null);
44
+ }
45
+ const hasError = failedSrc !== null && failedSrc === src;
46
+ const imgRef = React.useRef(null);
47
+ React.useEffect(() => {
48
+ const img = imgRef.current;
49
+ if (!img || !src) return;
50
+ if (!img.complete || img.naturalWidth !== 0) return;
51
+ if (typeof img.decode !== "function") return;
52
+ let cancelled = false;
53
+ img.decode().then(
54
+ () => void 0,
55
+ () => {
56
+ if (!cancelled) setFailedSrc(src);
57
+ }
58
+ );
59
+ return () => {
60
+ cancelled = true;
61
+ };
62
+ }, [src]);
42
63
  const initials = React.useMemo(() => {
43
64
  if (fallback) return fallback;
44
65
  if (!alt) return "?";
@@ -53,10 +74,11 @@ const Avatar = React.forwardRef(
53
74
  children: src && !hasError ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
75
  "img",
55
76
  {
77
+ ref: imgRef,
56
78
  src,
57
79
  alt: alt || "Avatar",
58
80
  className: "aspect-square h-full w-full object-cover",
59
- onError: () => setHasError(true)
81
+ onError: () => setFailedSrc(src)
60
82
  }
61
83
  ) : /* @__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
84
  }
@@ -5,7 +5,28 @@ import { cn } from "../utils.mjs";
5
5
  import { avatarVariants } from "./variants.mjs";
6
6
  const Avatar = React.forwardRef(
7
7
  ({ className, size, src, alt, fallback, ...props }, ref) => {
8
- const [hasError, setHasError] = React.useState(false);
8
+ const [failedSrc, setFailedSrc] = React.useState(null);
9
+ if (failedSrc !== null && failedSrc !== src) {
10
+ setFailedSrc(null);
11
+ }
12
+ const hasError = failedSrc !== null && failedSrc === src;
13
+ const imgRef = React.useRef(null);
14
+ React.useEffect(() => {
15
+ const img = imgRef.current;
16
+ if (!img || !src) return;
17
+ if (!img.complete || img.naturalWidth !== 0) return;
18
+ if (typeof img.decode !== "function") return;
19
+ let cancelled = false;
20
+ img.decode().then(
21
+ () => void 0,
22
+ () => {
23
+ if (!cancelled) setFailedSrc(src);
24
+ }
25
+ );
26
+ return () => {
27
+ cancelled = true;
28
+ };
29
+ }, [src]);
9
30
  const initials = React.useMemo(() => {
10
31
  if (fallback) return fallback;
11
32
  if (!alt) return "?";
@@ -20,10 +41,11 @@ const Avatar = React.forwardRef(
20
41
  children: src && !hasError ? /* @__PURE__ */ jsx(
21
42
  "img",
22
43
  {
44
+ ref: imgRef,
23
45
  src,
24
46
  alt: alt || "Avatar",
25
47
  className: "aspect-square h-full w-full object-cover",
26
- onError: () => setHasError(true)
48
+ onError: () => setFailedSrc(src)
27
49
  }
28
50
  ) : /* @__PURE__ */ 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 })
29
51
  }
@@ -53,7 +53,7 @@ const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__P
53
53
  {
54
54
  ref,
55
55
  className: (0, import_utils.cn)(
56
- "fixed inset-0 z-50 bg-[var(--axis-dialog-overlay-bg)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
56
+ "fixed inset-0 z-50 bg-[var(--axis-dialog-overlay-bg)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",
57
57
  className
58
58
  ),
59
59
  ...props
@@ -69,7 +69,7 @@ const DialogContent = React.forwardRef(({ className, children, ...props }, ref)
69
69
  className: (0, import_utils.cn)(
70
70
  "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-[shadow:var(--axis-shadow-lg)] duration-200",
71
71
  "bg-[var(--axis-dialog-content-bg)] border-[var(--axis-dialog-content-border)]",
72
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
72
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] motion-reduce:!animate-none",
73
73
  "sm:rounded-lg",
74
74
  className
75
75
  ),
@@ -11,7 +11,7 @@ const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__P
11
11
  {
12
12
  ref,
13
13
  className: cn(
14
- "fixed inset-0 z-50 bg-[var(--axis-dialog-overlay-bg)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
14
+ "fixed inset-0 z-50 bg-[var(--axis-dialog-overlay-bg)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",
15
15
  className
16
16
  ),
17
17
  ...props
@@ -27,7 +27,7 @@ const DialogContent = React.forwardRef(({ className, children, ...props }, ref)
27
27
  className: cn(
28
28
  "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-[shadow:var(--axis-shadow-lg)] duration-200",
29
29
  "bg-[var(--axis-dialog-content-bg)] border-[var(--axis-dialog-content-border)]",
30
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
30
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] motion-reduce:!animate-none",
31
31
  "sm:rounded-lg",
32
32
  className
33
33
  ),
@@ -96,7 +96,7 @@ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) =
96
96
  ref,
97
97
  className: (0, import_utils.cn)(
98
98
  "z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--axis-border-default)] bg-[var(--axis-surface-default)] p-1 text-[var(--axis-text-primary)] shadow-lg",
99
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
99
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",
100
100
  className
101
101
  ),
102
102
  ...props
@@ -110,7 +110,7 @@ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...pr
110
110
  sideOffset,
111
111
  className: (0, import_utils.cn)(
112
112
  "z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--axis-border-default)] bg-[var(--axis-surface-default)] p-1 text-[var(--axis-text-primary)] shadow-md",
113
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
113
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",
114
114
  className
115
115
  ),
116
116
  ...props
@@ -49,7 +49,7 @@ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) =
49
49
  ref,
50
50
  className: cn(
51
51
  "z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--axis-border-default)] bg-[var(--axis-surface-default)] p-1 text-[var(--axis-text-primary)] shadow-lg",
52
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
52
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",
53
53
  className
54
54
  ),
55
55
  ...props
@@ -63,7 +63,7 @@ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...pr
63
63
  sideOffset,
64
64
  className: cn(
65
65
  "z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--axis-border-default)] bg-[var(--axis-surface-default)] p-1 text-[var(--axis-text-primary)] shadow-md",
66
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
66
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",
67
67
  className
68
68
  ),
69
69
  ...props
@@ -47,7 +47,7 @@ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffs
47
47
  sideOffset,
48
48
  className: (0, import_utils.cn)(
49
49
  "z-50 w-72 rounded-md border border-[var(--axis-border-default)] bg-[var(--axis-surface-default)] p-4 text-[var(--axis-text-primary)] shadow-md outline-none",
50
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
50
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",
51
51
  className
52
52
  ),
53
53
  ...props
@@ -12,7 +12,7 @@ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffs
12
12
  sideOffset,
13
13
  className: cn(
14
14
  "z-50 w-72 rounded-md border border-[var(--axis-border-default)] bg-[var(--axis-surface-default)] p-4 text-[var(--axis-text-primary)] shadow-md outline-none",
15
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
15
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",
16
16
  className
17
17
  ),
18
18
  ...props
@@ -94,7 +94,11 @@ const Progress = React.forwardRef(
94
94
  {
95
95
  className: (0, import_utils.cn)(
96
96
  progressIndicatorVariants({ variant }),
97
- indeterminate && "animate-progress-indeterminate"
97
+ // 불확정: 트랙 폭 1/3 인 표시기가 왕복한다(@axis-ds/tokens 의 progress-indeterminate keyframes).
98
+ // 꽉 찬 막대(100% 완료)로 보이지 않도록 폭을 줄이고, 움직임 줄이기 설정에서는 왼쪽에 멈춘다.
99
+ // duration-[1500ms]: tailwindcss-animate 는 duration-300 을 animation-duration 에도 적용해 왕복이
100
+ // 0.3s 로 빨라진다(실측). keyframes 의 1.5s 와 같은 값으로 덮는다(progress.test 가 토큰 값과 대조)
101
+ indeterminate && "w-1/3 duration-[1500ms] animate-progress-indeterminate motion-reduce:!animate-none"
98
102
  ),
99
103
  style: indeterminate ? void 0 : { transform: `translateX(-${100 - percentage}%)` }
100
104
  }
@@ -59,7 +59,11 @@ const Progress = React.forwardRef(
59
59
  {
60
60
  className: cn(
61
61
  progressIndicatorVariants({ variant }),
62
- indeterminate && "animate-progress-indeterminate"
62
+ // 불확정: 트랙 폭 1/3 인 표시기가 왕복한다(@axis-ds/tokens 의 progress-indeterminate keyframes).
63
+ // 꽉 찬 막대(100% 완료)로 보이지 않도록 폭을 줄이고, 움직임 줄이기 설정에서는 왼쪽에 멈춘다.
64
+ // duration-[1500ms]: tailwindcss-animate 는 duration-300 을 animation-duration 에도 적용해 왕복이
65
+ // 0.3s 로 빨라진다(실측). keyframes 의 1.5s 와 같은 값으로 덮는다(progress.test 가 토큰 값과 대조)
66
+ indeterminate && "w-1/3 duration-[1500ms] animate-progress-indeterminate motion-reduce:!animate-none"
63
67
  ),
64
68
  style: indeterminate ? void 0 : { transform: `translateX(-${100 - percentage}%)` }
65
69
  }
@@ -91,7 +91,7 @@ const SelectContent = React.forwardRef(({ className, children, position = "poppe
91
91
  className: (0, import_utils.cn)(
92
92
  "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",
93
93
  "bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
94
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
94
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 motion-reduce:!animate-none",
95
95
  position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
96
96
  className
97
97
  ),
@@ -51,7 +51,7 @@ const SelectContent = React.forwardRef(({ className, children, position = "poppe
51
51
  className: cn(
52
52
  "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",
53
53
  "bg-[var(--axis-surface-default)] border-[var(--axis-border-default)]",
54
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
54
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 motion-reduce:!animate-none",
55
55
  position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
56
56
  className
57
57
  ),
@@ -53,7 +53,7 @@ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PU
53
53
  SheetPrimitive.Overlay,
54
54
  {
55
55
  className: (0, import_utils.cn)(
56
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
56
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",
57
57
  className
58
58
  ),
59
59
  ...props,
@@ -62,7 +62,7 @@ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PU
62
62
  ));
63
63
  SheetOverlay.displayName = "SheetOverlay";
64
64
  const sheetVariants = (0, import_class_variance_authority.cva)(
65
- "fixed z-50 gap-4 bg-[var(--axis-surface-default)] border-[var(--axis-border-default)] p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
65
+ "fixed z-50 gap-4 bg-[var(--axis-surface-default)] border-[var(--axis-border-default)] p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 motion-reduce:!animate-none",
66
66
  {
67
67
  variants: {
68
68
  side: {
@@ -11,7 +11,7 @@ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PU
11
11
  SheetPrimitive.Overlay,
12
12
  {
13
13
  className: cn(
14
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
14
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",
15
15
  className
16
16
  ),
17
17
  ...props,
@@ -20,7 +20,7 @@ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PU
20
20
  ));
21
21
  SheetOverlay.displayName = "SheetOverlay";
22
22
  const sheetVariants = cva(
23
- "fixed z-50 gap-4 bg-[var(--axis-surface-default)] border-[var(--axis-border-default)] p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
23
+ "fixed z-50 gap-4 bg-[var(--axis-surface-default)] border-[var(--axis-border-default)] p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 motion-reduce:!animate-none",
24
24
  {
25
25
  variants: {
26
26
  side: {
@@ -41,7 +41,7 @@ const Skeleton = React.forwardRef(
41
41
  {
42
42
  ref,
43
43
  className: (0, import_utils.cn)(
44
- "animate-pulse rounded-md bg-[var(--axis-surface-tertiary)]",
44
+ "animate-pulse rounded-md bg-[var(--axis-surface-tertiary)] motion-reduce:!animate-none",
45
45
  className
46
46
  ),
47
47
  ...props
@@ -8,7 +8,7 @@ const Skeleton = React.forwardRef(
8
8
  {
9
9
  ref,
10
10
  className: cn(
11
- "animate-pulse rounded-md bg-[var(--axis-surface-tertiary)]",
11
+ "animate-pulse rounded-md bg-[var(--axis-surface-tertiary)] motion-reduce:!animate-none",
12
12
  className
13
13
  ),
14
14
  ...props
@@ -56,7 +56,7 @@ const ToastViewport = React.forwardRef(({ className, ...props }, ref) => /* @__P
56
56
  ));
57
57
  ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
58
58
  const toastVariants = (0, import_class_variance_authority.cva)(
59
- "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
59
+ "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full motion-reduce:!animate-none",
60
60
  {
61
61
  variants: {
62
62
  variant: {
@@ -17,7 +17,7 @@ const ToastViewport = React.forwardRef(({ className, ...props }, ref) => /* @__P
17
17
  ));
18
18
  ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
19
19
  const toastVariants = cva(
20
- "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
20
+ "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full motion-reduce:!animate-none",
21
21
  {
22
22
  variants: {
23
23
  variant: {
@@ -48,8 +48,7 @@ const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }
48
48
  sideOffset,
49
49
  className: (0, import_utils.cn)(
50
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",
52
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
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",
53
52
  "data-[side=bottom]:slide-in-from-top-2",
54
53
  "data-[side=left]:slide-in-from-right-2",
55
54
  "data-[side=right]:slide-in-from-left-2",
@@ -12,8 +12,7 @@ const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }
12
12
  sideOffset,
13
13
  className: cn(
14
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",
16
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
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",
17
16
  "data-[side=bottom]:slide-in-from-top-2",
18
17
  "data-[side=left]:slide-in-from-right-2",
19
18
  "data-[side=right]:slide-in-from-left-2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axis-ds/ui-react",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "AXIS Design System - Core React UI Components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -267,7 +267,17 @@
267
267
  },
268
268
  "peerDependencies": {
269
269
  "react": ">=18.0.0",
270
- "react-dom": ">=18.0.0"
270
+ "react-dom": ">=18.0.0",
271
+ "tailwindcss-animate": "^1.0.7",
272
+ "tw-animate-css": "^1.3.0"
273
+ },
274
+ "peerDependenciesMeta": {
275
+ "tailwindcss-animate": {
276
+ "optional": true
277
+ },
278
+ "tw-animate-css": {
279
+ "optional": true
280
+ }
271
281
  },
272
282
  "dependencies": {
273
283
  "@radix-ui/react-accordion": "^1.2.12",
@@ -292,7 +302,7 @@
292
302
  "clsx": "^2.1.0",
293
303
  "cmdk": "^1.1.1",
294
304
  "tailwind-merge": "^2.5.0",
295
- "@axis-ds/tokens": "1.6.0"
305
+ "@axis-ds/tokens": "1.6.2"
296
306
  },
297
307
  "devDependencies": {
298
308
  "@testing-library/jest-dom": "^6.9.1",