@tide-design/components 0.18.1 → 0.18.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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { ListBoxNodes } from "../../_internal/components/ListBoxNodes/ListBoxNodes.js";
4
- import { listPopupClass } from "../../_internal/constants/listClass.js";
4
+ import { listItemsClass, listPopupClass } from "../../_internal/constants/listClass.js";
5
5
  import { useOverlayTheme } from "../../_internal/hooks/useOverlayTheme.js";
6
6
  import { usePopoverOverlay } from "../../_internal/hooks/usePopoverOverlay.js";
7
7
  import { emptyClass } from "../constants/comboboxClass.js";
@@ -34,7 +34,7 @@ function ComboboxPopoverInner({ state, inputRef, popoverRef, listBoxRef, listBox
34
34
  children: [/* @__PURE__ */ jsx("div", {
35
35
  ...listProps,
36
36
  ref: listBoxRef,
37
- className: "outline-none",
37
+ className: `${listItemsClass} outline-none`,
38
38
  children: /* @__PURE__ */ jsx(ListBoxNodes, { state })
39
39
  }), empty && /* @__PURE__ */ jsx("div", {
40
40
  className: "px-2 py-1.5 text-body-sm text-muted select-none",
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { listPopupClass, listSeparatorClass } from "../../_internal/constants/listClass.js";
3
+ import { listItemsClass, listPopupClass, listSeparatorClass } from "../../_internal/constants/listClass.js";
4
4
  import { useCloseOnTab } from "../../_internal/hooks/useCloseOnTab.js";
5
5
  import { useOverlayTheme } from "../../_internal/hooks/useOverlayTheme.js";
6
6
  import { usePopoverOverlay } from "../../_internal/hooks/usePopoverOverlay.js";
@@ -39,7 +39,7 @@ function MenuContentInner({ context, popoverRef, placement = "bottom start", off
39
39
  ...rest,
40
40
  ref: mergedRef,
41
41
  "data-open": state.isOpen ? "" : void 0,
42
- className: cn(listPopupClass, className),
42
+ className: cn(listPopupClass, listItemsClass, className),
43
43
  style: {
44
44
  ...overlayProps.style,
45
45
  ...props.style
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { listHeadingClass } from "../../_internal/constants/listClass.js";
3
+ import { listHeadingClass, listItemsClass } from "../../_internal/constants/listClass.js";
4
4
  import { MenuItemView } from "./MenuItemView.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { useMenuSection } from "react-aria";
@@ -21,6 +21,7 @@ function MenuSectionView({ node, tree }) {
21
21
  children: node.rendered
22
22
  }), /* @__PURE__ */ jsx("div", {
23
23
  ...groupProps,
24
+ className: listItemsClass,
24
25
  children: [...node.childNodes].map((child) => /* @__PURE__ */ jsx(MenuItemView, {
25
26
  node: child,
26
27
  tree
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { ListBoxNodes } from "../../_internal/components/ListBoxNodes/ListBoxNodes.js";
4
- import { listPopupClass } from "../../_internal/constants/listClass.js";
4
+ import { listItemsClass, listPopupClass } from "../../_internal/constants/listClass.js";
5
5
  import { useCloseOnTab } from "../../_internal/hooks/useCloseOnTab.js";
6
6
  import { useOverlayTheme } from "../../_internal/hooks/useOverlayTheme.js";
7
7
  import { usePopoverOverlay } from "../../_internal/hooks/usePopoverOverlay.js";
@@ -37,7 +37,7 @@ function SelectPopoverInner({ state, triggerRef, menuProps, popoverRef }) {
37
37
  /* @__PURE__ */ jsx("div", {
38
38
  ...listBoxProps,
39
39
  ref: listRef,
40
- className: "outline-none",
40
+ className: `${listItemsClass} outline-none`,
41
41
  children: /* @__PURE__ */ jsx(ListBoxNodes, { state })
42
42
  }),
43
43
  /* @__PURE__ */ jsx(DismissButton, { onDismiss: state.close })
@@ -1,5 +1,5 @@
1
1
  // src/Select/constants/selectClass.ts
2
- const triggerClass = "group inline-flex items-center justify-between gap-2 text-start";
2
+ const triggerClass = "group inline-flex cursor-pointer items-center justify-between gap-2 text-start";
3
3
  const valueClass = "min-w-0 flex-1 truncate [&>svg]:me-2 [&>svg]:inline-block [&>svg]:size-4 [&>svg]:align-[-0.125em]";
4
4
  const placeholderClass = "text-muted group-disabled:text-disabled";
5
5
  const chevronClass = "shrink-0 text-muted group-disabled:text-disabled";
@@ -1,6 +1,7 @@
1
- import { frequentMotionClass, overlaySurfaceClass } from "../../_internal/constants/overlayClass.js";
1
+ import { overlaySurfaceClass } from "../../_internal/constants/overlayClass.js";
2
2
 
3
3
  // src/Tooltip/constants/tooltipClass.ts
4
- const contentClass = `isolate z-tooltip max-w-60 px-2 py-1 text-body-sm ${overlaySurfaceClass} ${frequentMotionClass}`;
4
+ const motionClass = ["transition-[opacity,display] transition-discrete duration-fast ease-out data-open:transition-none", "not-data-open:pointer-events-none not-data-open:hidden not-data-open:opacity-0"].join(" ");
5
+ const contentClass = `isolate z-tooltip max-w-60 px-2 py-1 text-body-sm ${overlaySurfaceClass} ${motionClass}`;
5
6
 
6
7
  export { contentClass };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { listHeadingClass } from "../../../constants/listClass.js";
3
+ import { listHeadingClass, listItemsClass } from "../../../constants/listClass.js";
4
4
  import { ListBoxOptionView } from "./ListBoxOptionView.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { useListBoxSection } from "react-aria";
@@ -22,6 +22,7 @@ function ListBoxSectionView({ node, state }) {
22
22
  children: node.rendered
23
23
  }), /* @__PURE__ */ jsx("div", {
24
24
  ...groupProps,
25
+ className: listItemsClass,
25
26
  children: [...node.childNodes].map((child) => /* @__PURE__ */ jsx(ListBoxOptionView, {
26
27
  node: child,
27
28
  state
@@ -1,14 +1,21 @@
1
- import { frequentMotionClass, overlaySurfaceClass } from "./overlayClass.js";
1
+ import { overlaySurfaceClass } from "./overlayClass.js";
2
2
 
3
3
  // src/_internal/constants/listClass.ts
4
- /** 요소에 `data-open`이 있어야 한다. padding 3px는 radius 중첩 규칙(8 = 4 + 3 + 1)이다. */
5
- const listPopupClass = `isolate z-popover min-w-40 max-w-80 overflow-auto p-[3px] outline-none ${overlaySurfaceClass} ${frequentMotionClass}`;
4
+ const listMotionClass = [
5
+ "transition-[opacity,display] transition-discrete duration-fast ease-out motion-safe:transition-[opacity,translate,display]",
6
+ "not-data-open:pointer-events-none not-data-open:hidden not-data-open:opacity-0",
7
+ "starting:opacity-0",
8
+ "motion-safe:data-[placement=bottom]:starting:-translate-y-0.5 motion-safe:data-[placement=top]:starting:translate-y-0.5",
9
+ "motion-safe:data-[placement=right]:starting:-translate-x-0.5 motion-safe:data-[placement=left]:starting:translate-x-0.5"
10
+ ].join(" ");
11
+ /** 요소에 `data-open`과 `data-placement`가 있어야 한다. padding 3px는 radius 중첩 규칙(8 = 4 + 3 + 1)이다. */
12
+ const listPopupClass = `isolate z-popover min-w-40 max-w-80 overflow-auto p-[3px] outline-none ${overlaySurfaceClass} ${listMotionClass}`;
6
13
  /**
7
14
  * 상태는 boolean `data-*`로 받고 `not-data-highlighted:`로 서로 빼 CSS 순서에 기대지 않는다.
8
- * highlight의 투명 outline은 forced-colors에서 위치를 남긴다. `outline-none`이 모양을 none으로 두어 `outline-solid`를 함께 쓴다.
15
+ * highlight의 투명 outline(`outline-none`을 덮는 `outline-solid`)은 forced-colors에서 위치를 남기고, 번쩍이지 않게 색 전환에서 뺀다(ADR 0040).
9
16
  */
10
17
  const listItemClass = [
11
- "flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-body-sm text-default outline-none select-none [&>svg]:size-4 [&>svg]:shrink-0",
18
+ "flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-body-sm text-default outline-none select-none transition-[color,background-color] [&>svg]:size-4 [&>svg]:shrink-0",
12
19
  "hover:not-data-highlighted:not-data-disabled:bg-hover",
13
20
  "data-selected:not-data-highlighted:bg-neutral-subtle-active",
14
21
  "data-highlighted:bg-primary-subtle data-highlighted:text-primary data-highlighted:outline-2 data-highlighted:outline-solid data-highlighted:-outline-offset-2 data-highlighted:outline-transparent",
@@ -16,6 +23,9 @@ const listItemClass = [
16
23
  ].join(" ");
17
24
  /** 항목과 같은 가로 여백이라 글자 시작이 맞는다. */
18
25
  const listHeadingClass = "px-2 pt-1.5 pb-1 text-label-sm text-muted select-none";
19
- const listSeparatorClass = "my-1 h-0 border-t border-default";
26
+ /** 항목을 바로 담는 요소(목록·묶음)에 붙인다. 2px 간격이 highlight·선택 배경이 맞닿지 않게 한다. */
27
+ const listItemsClass = "flex flex-col gap-0.5";
28
+ /** 양옆 간격(`gap-0.5`)과 더해 항목에서 4px 떨어진다. */
29
+ const listSeparatorClass = "my-0.5 h-0 border-t border-default";
20
30
 
21
- export { listHeadingClass, listItemClass, listPopupClass, listSeparatorClass };
31
+ export { listHeadingClass, listItemClass, listItemsClass, listPopupClass, listSeparatorClass };
@@ -14,11 +14,6 @@ const popoverMotionClass = [
14
14
  "motion-safe:data-[placement=bottom]:starting:-translate-y-1 motion-safe:data-[placement=top]:starting:translate-y-1",
15
15
  "motion-safe:data-[placement=right]:starting:-translate-x-1 motion-safe:data-[placement=left]:starting:translate-x-1"
16
16
  ].join(" ");
17
- /**
18
- * 「자주 씀」 오버레이 motion. 요소에 `data-open`이 있어야 한다.
19
- * 열린 동안 `transition-none`이라 퇴장 중에 다시 열려도 바로 불투명해진다.
20
- */
21
- const frequentMotionClass = ["transition-[opacity,display] transition-discrete duration-fast ease-out data-open:transition-none", "not-data-open:pointer-events-none not-data-open:hidden not-data-open:opacity-0"].join(" ");
22
17
  /** Dialog류 표면. forced-colors 처리는 `overlaySurfaceClass`와 같다. */
23
18
  const dialogSurfaceClass = "rounded-xl border border-raised bg-raised text-default shadow-lg";
24
19
  /**
@@ -37,4 +32,4 @@ const dialogMotionClass = [
37
32
  "starting:opacity-0 motion-safe:starting:scale-96"
38
33
  ].join(" ");
39
34
 
40
- export { backdropMotionClass, dialogMotionClass, dialogSurfaceClass, frequentMotionClass, overlaySurfaceClass, popoverMotionClass };
35
+ export { backdropMotionClass, dialogMotionClass, dialogSurfaceClass, overlaySurfaceClass, popoverMotionClass };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tide-design/components",
3
- "version": "0.18.1",
3
+ "version": "0.18.2",
4
4
  "description": "Tide 디자인 시스템의 React Component",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -34,8 +34,8 @@
34
34
  "./styles.css": "./dist/styles.css"
35
35
  },
36
36
  "dependencies": {
37
- "@tide-design/foundation": "0.18.1",
38
- "@tide-design/icons": "0.18.1",
37
+ "@tide-design/foundation": "0.18.2",
38
+ "@tide-design/icons": "0.18.2",
39
39
  "clsx": "^2.1.1",
40
40
  "react-aria": "^3.53.1",
41
41
  "react-stately": "^3.51.0",