@seed-design/react 2.4.0 → 2.4.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.
Files changed (107) hide show
  1. package/lib/components/ActionButton/ActionButton.cjs +2 -2
  2. package/lib/components/ActionButton/ActionButton.js +1 -1
  3. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.cjs +5 -4
  4. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.d.ts.map +1 -1
  5. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.js +2 -1
  6. package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.cjs +2 -2
  7. package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.js +1 -1
  8. package/lib/components/AttachmentInput/AttachmentInputItem.cjs +5 -4
  9. package/lib/components/AttachmentInput/AttachmentInputItem.d.ts.map +1 -1
  10. package/lib/components/AttachmentInput/AttachmentInputItem.js +2 -1
  11. package/lib/components/AttachmentInput/AttachmentInputTrigger.cjs +2 -2
  12. package/lib/components/AttachmentInput/AttachmentInputTrigger.js +1 -1
  13. package/lib/components/BottomSheet/BottomSheet.cjs +2 -2
  14. package/lib/components/BottomSheet/BottomSheet.js +1 -1
  15. package/lib/components/Callout/Callout.cjs +3 -3
  16. package/lib/components/Callout/Callout.js +1 -1
  17. package/lib/components/Checkbox/Checkbox.cjs +2 -2
  18. package/lib/components/Checkbox/Checkbox.js +1 -1
  19. package/lib/components/Chip/Chip.cjs +2 -2
  20. package/lib/components/Chip/Chip.js +1 -1
  21. package/lib/components/ChipTabs/ChipTabs.cjs +2 -2
  22. package/lib/components/ChipTabs/ChipTabs.js +1 -1
  23. package/lib/components/ContentDialog/ContentDialog.cjs +2 -2
  24. package/lib/components/ContentDialog/ContentDialog.js +1 -1
  25. package/lib/components/ContextualFloatingButton/ContextualFloatingButton.cjs +2 -2
  26. package/lib/components/ContextualFloatingButton/ContextualFloatingButton.js +1 -1
  27. package/lib/components/FieldButton/FieldButton.cjs +2 -2
  28. package/lib/components/FieldButton/FieldButton.js +1 -1
  29. package/lib/components/FloatingActionButton/FloatingActionButton.cjs +2 -2
  30. package/lib/components/FloatingActionButton/FloatingActionButton.js +1 -1
  31. package/lib/components/HelpBubble/HelpBubble.cjs +2 -2
  32. package/lib/components/HelpBubble/HelpBubble.js +1 -1
  33. package/lib/components/ImageFrame/ImageFrame.cjs +2 -2
  34. package/lib/components/ImageFrame/ImageFrame.js +1 -1
  35. package/lib/components/MenuSheet/MenuSheet.cjs +2 -2
  36. package/lib/components/MenuSheet/MenuSheet.js +1 -1
  37. package/lib/components/PageBanner/PageBanner.cjs +3 -3
  38. package/lib/components/PageBanner/PageBanner.js +1 -1
  39. package/lib/components/QuantityPicker/QuantityPicker.cjs +3 -3
  40. package/lib/components/QuantityPicker/QuantityPicker.js +1 -1
  41. package/lib/components/RadioGroup/RadioGroup.cjs +2 -2
  42. package/lib/components/RadioGroup/RadioGroup.js +1 -1
  43. package/lib/components/ReactionButton/ReactionButton.cjs +2 -2
  44. package/lib/components/ReactionButton/ReactionButton.js +1 -1
  45. package/lib/components/SidePanel/SidePanel.cjs +2 -2
  46. package/lib/components/SidePanel/SidePanel.d.ts +13 -1
  47. package/lib/components/SidePanel/SidePanel.d.ts.map +1 -1
  48. package/lib/components/SidePanel/SidePanel.js +1 -1
  49. package/lib/components/Snackbar/Snackbar.cjs +2 -2
  50. package/lib/components/Snackbar/Snackbar.js +1 -1
  51. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.cjs +2 -2
  52. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.js +1 -1
  53. package/lib/components/Switch/Switch.cjs +2 -2
  54. package/lib/components/Switch/Switch.js +1 -1
  55. package/lib/components/Tabs/Tabs.cjs +2 -2
  56. package/lib/components/Tabs/Tabs.js +1 -1
  57. package/lib/components/ToggleButton/ToggleButton.cjs +2 -2
  58. package/lib/components/ToggleButton/ToggleButton.js +1 -1
  59. package/lib/index.cjs +13 -3
  60. package/lib/index.d.ts +2 -2
  61. package/lib/index.d.ts.map +1 -1
  62. package/lib/index.js +1 -1
  63. package/lib/utils/withScaleFeedback.cjs +25 -0
  64. package/lib/utils/withScaleFeedback.d.ts +8 -0
  65. package/lib/utils/withScaleFeedback.d.ts.map +1 -0
  66. package/lib/utils/withScaleFeedback.js +22 -0
  67. package/package.json +3 -2
  68. package/src/components/AGENTS.md +3 -3
  69. package/src/components/ActionButton/ActionButton.tsx +1 -1
  70. package/src/components/AttachmentDisplay/AttachmentDisplayItem.tsx +2 -1
  71. package/src/components/AttachmentDisplay/AttachmentDisplayTrigger.tsx +1 -1
  72. package/src/components/AttachmentInput/AttachmentInputItem.tsx +2 -1
  73. package/src/components/AttachmentInput/AttachmentInputTrigger.tsx +1 -1
  74. package/src/components/BottomSheet/BottomSheet.tsx +1 -1
  75. package/src/components/Callout/Callout.tsx +1 -1
  76. package/src/components/Checkbox/Checkbox.tsx +1 -1
  77. package/src/components/Chip/Chip.tsx +1 -1
  78. package/src/components/ChipTabs/ChipTabs.tsx +1 -1
  79. package/src/components/ContentDialog/ContentDialog.tsx +1 -1
  80. package/src/components/ContextualFloatingButton/ContextualFloatingButton.tsx +1 -1
  81. package/src/components/FieldButton/FieldButton.tsx +1 -1
  82. package/src/components/FloatingActionButton/FloatingActionButton.tsx +1 -1
  83. package/src/components/HelpBubble/HelpBubble.tsx +1 -1
  84. package/src/components/ImageFrame/ImageFrame.tsx +1 -1
  85. package/src/components/MenuSheet/MenuSheet.tsx +1 -1
  86. package/src/components/PageBanner/PageBanner.tsx +1 -1
  87. package/src/components/QuantityPicker/QuantityPicker.tsx +1 -1
  88. package/src/components/RadioGroup/RadioGroup.tsx +1 -1
  89. package/src/components/ReactionButton/ReactionButton.tsx +1 -1
  90. package/src/components/SidePanel/SidePanel.tsx +18 -6
  91. package/src/components/Snackbar/Snackbar.tsx +1 -1
  92. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +1 -1
  93. package/src/components/Switch/Switch.tsx +1 -1
  94. package/src/components/Tabs/Tabs.tsx +1 -1
  95. package/src/components/ToggleButton/ToggleButton.tsx +1 -1
  96. package/src/index.ts +2 -2
  97. package/src/utils/withScaleFeedback.tsx +34 -0
  98. package/lib/utils/elementSizeVars.cjs +0 -76
  99. package/lib/utils/elementSizeVars.d.ts +0 -15
  100. package/lib/utils/elementSizeVars.d.ts.map +0 -1
  101. package/lib/utils/elementSizeVars.js +0 -74
  102. package/lib/utils/scaleFeedback.cjs +0 -99
  103. package/lib/utils/scaleFeedback.d.ts +0 -58
  104. package/lib/utils/scaleFeedback.d.ts.map +0 -1
  105. package/lib/utils/scaleFeedback.js +0 -94
  106. package/src/utils/elementSizeVars.tsx +0 -112
  107. package/src/utils/scaleFeedback.tsx +0 -128
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import clsx$1 from "clsx";
3
+ import * as React$1 from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { useComposedRefs } from "@radix-ui/react-compose-refs";
6
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
7
+ //#region src/utils/withScaleFeedback.tsx
8
+ function withScaleFeedback(Component) {
9
+ const Pressable = React$1.forwardRef((props, ref) => {
10
+ const { scaleFeedbackRef, scaleFeedbackClassName } = useScaleFeedback();
11
+ const composedRef = useComposedRefs(scaleFeedbackRef, ref);
12
+ return /* @__PURE__ */ jsx(Component, {
13
+ ...props,
14
+ ref: composedRef,
15
+ className: clsx$1(scaleFeedbackClassName, props.className)
16
+ });
17
+ });
18
+ Pressable.displayName = Component.displayName;
19
+ return Pressable;
20
+ }
21
+ //#endregion
22
+ export { withScaleFeedback };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-design/react",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/daangn/seed-design.git",
@@ -66,6 +66,7 @@
66
66
  "@seed-design/react-pull-to-refresh": "^2.1.0",
67
67
  "@seed-design/react-quantity-picker": "^1.0.0",
68
68
  "@seed-design/react-radio-group": "^2.0.1",
69
+ "@seed-design/react-scale-feedback": "^1.0.0",
69
70
  "@seed-design/react-segmented-control": "^2.0.2",
70
71
  "@seed-design/react-select": "^1.0.1",
71
72
  "@seed-design/react-side-navigation": "^1.0.1",
@@ -82,7 +83,7 @@
82
83
  "unicode-segmenter": "^0.17.3"
83
84
  },
84
85
  "peerDependencies": {
85
- "@seed-design/css": "^2.5.0",
86
+ "@seed-design/css": "^2.8.0",
86
87
  "react": ">=18.0.0",
87
88
  "react-dom": ">=18.0.0"
88
89
  },
@@ -6,9 +6,9 @@
6
6
 
7
7
  ## 파일 작성 컨벤션
8
8
 
9
- - 컴포넌트별 디렉토리는 `PascalCase`를 사용하고, 기본 파일은 `{ComponentName}.tsx`, `{ComponentName}.namespace.ts`, `index.ts` 조합을 따른다.
10
- - 실제 구현은 `{ComponentName}.tsx`에 두고, namespace 단축 이름은 `{ComponentName}.namespace.ts`, 공개 re-export는 `index.ts`에 둔다.
11
- - helper slot이 내부 구현에만 필요하면 별도 파일 분리보다 같은 구현 파일 안에 두고 export surface에서 숨기는 쪽을 우선 검토한다.
9
+ - 컴포넌트별 디렉토리는 `PascalCase`를 사용한다. 단일 컴포넌트는 `{ComponentName}.tsx`와 `index.ts`를 기본으로 둔다.
10
+ - compound component에서 public namespace 단축 이름이 필요할 때만 `{ComponentName}.namespace.ts`를 추가한다.
11
+ - 실제 구현은 `{ComponentName}.tsx` 또는 역할별 구현 파일에 두고, 공개 re-export `index.ts`와 필요한 namespace 파일에서 관리한다.
12
12
 
13
13
  ## 코드 작성 컨벤션
14
14
 
@@ -6,7 +6,7 @@ import { useComposedRefs } from "@radix-ui/react-compose-refs";
6
6
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
7
7
  import clsx from "clsx";
8
8
  import * as React from "react";
9
- import { useScaleFeedback } from "../../utils/scaleFeedback";
9
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
10
10
  import { handleColor, useStyleProps, type StyleProps } from "../../utils/styled";
11
11
  import { IconRequired } from "../Icon/Icon";
12
12
  import {
@@ -18,7 +18,8 @@ import clsx from "clsx";
18
18
  import * as React from "react";
19
19
  import { createRenderTrackingContext } from "../../utils/createRenderTrackingContext";
20
20
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
21
- import { useScaleFeedback, withScaleFeedback } from "../../utils/scaleFeedback";
21
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
22
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
22
23
 
23
24
  const { useClassNames, ClassNamesProvider, withContext } =
24
25
  createSlotRecipeContext(attachmentInputItem);
@@ -14,7 +14,7 @@ import clsx from "clsx";
14
14
  import * as React from "react";
15
15
  import { InternalIcon } from "../private/Icon";
16
16
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
17
- import { withScaleFeedback } from "../../utils/scaleFeedback";
17
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
18
18
 
19
19
  const { withProvider, useClassNames } = createSlotRecipeContext(attachmentInputTrigger);
20
20
 
@@ -21,7 +21,8 @@ import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
21
21
  import clsx from "clsx";
22
22
  import { createRenderTrackingContext } from "../../utils/createRenderTrackingContext";
23
23
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
24
- import { useScaleFeedback, withScaleFeedback } from "../../utils/scaleFeedback";
24
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
25
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
25
26
 
26
27
  const { useClassNames, ClassNamesProvider, withContext } =
27
28
  createSlotRecipeContext(attachmentInputItem);
@@ -16,7 +16,7 @@ import { mergeProps } from "@seed-design/dom-utils";
16
16
  import clsx from "clsx";
17
17
  import { InternalIcon } from "../private/Icon";
18
18
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
19
- import { withScaleFeedback } from "../../utils/scaleFeedback";
19
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
20
20
 
21
21
  const { withProvider, useClassNames } = createSlotRecipeContext(attachmentInputTrigger);
22
22
 
@@ -5,7 +5,7 @@ import { Drawer } from "@seed-design/react-drawer";
5
5
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
6
6
  import clsx from "clsx";
7
7
  import { forwardRef } from "react";
8
- import { useScaleFeedback } from "../../utils/scaleFeedback";
8
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
9
9
  import { createRenderTrackingContext } from "../../utils/createRenderTrackingContext";
10
10
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
11
11
  import { withStyleProps, type StyleProps } from "../../utils/styled";
@@ -3,7 +3,7 @@ import type * as React from "react";
3
3
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
4
4
  import { callout, type CalloutVariantProps } from "@seed-design/css/recipes/callout";
5
5
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
6
- import { withScaleFeedback } from "../../utils/scaleFeedback";
6
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
7
7
  import {
8
8
  DismissibleCloseButton,
9
9
  DismissibleRoot,
@@ -8,7 +8,7 @@ import clsx from "clsx";
8
8
  import { forwardRef } from "react";
9
9
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
10
10
  import { createWithStateProps } from "../../utils/createWithStateProps";
11
- import { withScaleFeedback } from "../../utils/scaleFeedback";
11
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
12
12
  import { InternalIcon } from "../private/Icon";
13
13
  import { createRecipeContext } from "../../utils/createRecipeContext";
14
14
  import {
@@ -2,7 +2,7 @@ import { chip, type ChipVariantProps } from "@seed-design/css/recipes/chip";
2
2
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
3
3
  import type * as React from "react";
4
4
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
5
- import { withScaleFeedback } from "../../utils/scaleFeedback";
5
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
6
6
  import { withIconRequired } from "../Icon/Icon";
7
7
  import { createWithStateProps } from "../../utils/createWithStateProps";
8
8
  import { useCheckboxContext } from "@seed-design/react-checkbox";
@@ -1,7 +1,7 @@
1
1
  import { chipTabs, type ChipTabsVariantProps } from "@seed-design/css/recipes/chip-tabs";
2
2
  import { Tabs as TabsPrimitive } from "@seed-design/react-tabs";
3
3
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
4
- import { withScaleFeedback } from "../../utils/scaleFeedback";
4
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
5
5
  import { forwardRef } from "react";
6
6
  import clsx from "clsx";
7
7
 
@@ -10,7 +10,7 @@ import clsx from "clsx";
10
10
  import * as React from "react";
11
11
  import { createRenderTrackingContext } from "../../utils/createRenderTrackingContext";
12
12
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
13
- import { useScaleFeedback } from "../../utils/scaleFeedback";
13
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
14
14
  import { useStyleProps, withStyleProps, type StyleProps } from "../../utils/styled";
15
15
 
16
16
  const { withContext, useClassNames, ClassNamesProvider } = createSlotRecipeContext(contentDialog);
@@ -6,7 +6,7 @@ import { useComposedRefs } from "@radix-ui/react-compose-refs";
6
6
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
7
7
  import clsx from "clsx";
8
8
  import * as React from "react";
9
- import { useScaleFeedback } from "../../utils/scaleFeedback";
9
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
10
10
  import { IconRequired } from "../Icon/Icon";
11
11
  import {
12
12
  PendingButtonProvider,
@@ -4,7 +4,7 @@ import * as React from "react";
4
4
  import { forwardRef } from "react";
5
5
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
6
6
  import { createWithStateProps } from "../../utils/createWithStateProps";
7
- import { withScaleFeedback } from "../../utils/scaleFeedback";
7
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
8
8
  import { splitMultipleVariantsProps } from "../../utils/splitMultipleVariantsProps";
9
9
  import { field, type FieldVariantProps } from "@seed-design/css/recipes/field";
10
10
  import { fieldLabel, type FieldLabelVariantProps } from "@seed-design/css/recipes/field-label";
@@ -5,7 +5,7 @@ import {
5
5
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
6
6
  import type * as React from "react";
7
7
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
8
- import { withScaleFeedback } from "../../utils/scaleFeedback";
8
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
9
9
  import { InternalIcon, type InternalIconProps } from "../private/Icon";
10
10
 
11
11
  const { withProvider, withContext } = createSlotRecipeContext(floatingActionButton);
@@ -3,7 +3,7 @@ import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
3
3
  import { helpBubble, type HelpBubbleVariantProps } from "@seed-design/css/recipes/help-bubble";
4
4
  import { forwardRef } from "react";
5
5
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
6
- import { withScaleFeedback } from "../../utils/scaleFeedback";
6
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
7
7
  import { createWithStateProps } from "../../utils/createWithStateProps";
8
8
  import { withStyleProps, type StyleProps } from "../../utils/styled";
9
9
  import { getHelpBubbleArrowTipPath } from "../../utils/getHelpBubbleArrowTipPath";
@@ -17,7 +17,7 @@ import { Toggle as TogglePrimitive, useToggleContext } from "@seed-design/react-
17
17
  import { useComposedRefs } from "@radix-ui/react-compose-refs";
18
18
  import clsx from "clsx";
19
19
  import * as React from "react";
20
- import { useScaleFeedback } from "../../utils/scaleFeedback";
20
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
21
21
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
22
22
  import type { DistributiveOmit } from "../../utils/styled";
23
23
  import { AspectRatio, type AspectRatioProps } from "../AspectRatio/AspectRatio";
@@ -7,7 +7,7 @@ import {
7
7
  } from "@seed-design/css/recipes/menu-sheet-item";
8
8
  import * as React from "react";
9
9
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
10
- import { withScaleFeedback } from "../../utils/scaleFeedback";
10
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
11
11
  import { createWithStateProps } from "../../utils/createWithStateProps";
12
12
  import clsx from "clsx";
13
13
 
@@ -4,7 +4,7 @@ import { forwardRef } from "react";
4
4
  import { pageBanner, type PageBannerVariantProps } from "@seed-design/css/recipes/page-banner";
5
5
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
6
6
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
7
- import { withScaleFeedback } from "../../utils/scaleFeedback";
7
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
8
8
  import {
9
9
  DismissibleCloseButton,
10
10
  DismissibleRoot,
@@ -15,7 +15,7 @@ import * as React from "react";
15
15
  import { useComposedRefs } from "@radix-ui/react-compose-refs";
16
16
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
17
17
  import { createWithStateProps } from "../../utils/createWithStateProps";
18
- import { useScaleFeedback } from "../../utils/scaleFeedback";
18
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
19
19
 
20
20
  const { ClassNamesProvider, useClassNames } = createSlotRecipeContext(quantityPicker);
21
21
  const withStateProps = createWithStateProps([useQuantityPickerContext]);
@@ -11,7 +11,7 @@ import clsx from "clsx";
11
11
  import { forwardRef } from "react";
12
12
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
13
13
  import { createWithStateProps } from "../../utils/createWithStateProps";
14
- import { withScaleFeedback } from "../../utils/scaleFeedback";
14
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
15
15
  import { InternalIcon } from "../private/Icon";
16
16
  import { splitMultipleVariantsProps } from "../../utils/splitMultipleVariantsProps";
17
17
  import { createRecipeContext } from "../../utils/createRecipeContext";
@@ -6,7 +6,7 @@ import { useComposedRefs } from "@radix-ui/react-compose-refs";
6
6
  import { Toggle as TogglePrimitive } from "@seed-design/react-toggle";
7
7
  import clsx from "clsx";
8
8
  import * as React from "react";
9
- import { useScaleFeedback } from "../../utils/scaleFeedback";
9
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
10
10
  import {
11
11
  PendingButtonProvider,
12
12
  usePendingButton,
@@ -7,7 +7,7 @@ import clsx from "clsx";
7
7
  import * as React from "react";
8
8
  import { createRenderTrackingContext } from "../../utils/createRenderTrackingContext";
9
9
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
10
- import { useScaleFeedback } from "../../utils/scaleFeedback";
10
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
11
11
  import { useStyleProps, withStyleProps, type StyleProps } from "../../utils/styled";
12
12
 
13
13
  const { withContext, useClassNames, ClassNamesProvider } = createSlotRecipeContext(sidePanel);
@@ -137,11 +137,23 @@ SidePanelDescription.displayName = "SidePanelDescription";
137
137
 
138
138
  export interface SidePanelBodyProps
139
139
  extends PrimitiveProps,
140
- Pick<
141
- StyleProps,
142
- "paddingX" | "height" | "maxHeight" | "minHeight" | "justifyContent" | "alignItems"
143
- >,
144
- React.HTMLAttributes<HTMLDivElement> {}
140
+ Pick<StyleProps, "paddingX" | "justifyContent" | "alignItems">,
141
+ React.HTMLAttributes<HTMLDivElement> {
142
+ /**
143
+ * @deprecated SEED React 3.0.0에서 제거됩니다. Side Panel 본문은 항상 헤더와 푸터를 제외한 남은 높이를 채우므로 이 prop은 효과가 없습니다. 콘텐츠의 높이를 지정하려면 본문 안에 `Box`를 두고 `height`를 지정하세요.
144
+ */
145
+ height?: StyleProps["height"];
146
+
147
+ /**
148
+ * @deprecated SEED React 3.0.0에서 제거됩니다. Side Panel 본문은 항상 헤더와 푸터를 제외한 남은 높이를 채우므로, 남은 높이보다 큰 값을 주면 푸터가 패널 밖으로 밀려납니다. 콘텐츠의 최소 높이를 지정하려면 본문 안에 `Box`를 두고 `minHeight`를 지정하세요.
149
+ */
150
+ minHeight?: StyleProps["minHeight"];
151
+
152
+ /**
153
+ * @deprecated SEED React 3.0.0에서 제거됩니다. Side Panel 본문은 항상 헤더와 푸터를 제외한 남은 높이를 채우므로, 남은 높이보다 작은 값을 주면 푸터가 패널 중간에 뜹니다. 콘텐츠의 최대 높이를 지정하려면 본문 안에 `Box`를 두고 `maxHeight`를 지정하세요.
154
+ */
155
+ maxHeight?: StyleProps["maxHeight"];
156
+ }
145
157
 
146
158
  export const SidePanelBody = React.forwardRef<HTMLDivElement, SidePanelBodyProps>(
147
159
  (props, forwardedRef) => {
@@ -6,7 +6,7 @@ import { Snackbar as SnackbarPrimitive } from "@seed-design/react-snackbar";
6
6
  import { forwardRef } from "react";
7
7
  import { createRecipeContext } from "../../utils/createRecipeContext";
8
8
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
9
- import { withScaleFeedback } from "../../utils/scaleFeedback";
9
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
10
10
  import { InternalIcon, type InternalIconProps } from "../private/Icon";
11
11
 
12
12
  const { withContext: withRegionContext } = createRecipeContext(snackbarRegion);
@@ -9,7 +9,7 @@ import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
9
9
  import clsx from "clsx";
10
10
  import * as React from "react";
11
11
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
12
- import { withScaleFeedback } from "../../utils/scaleFeedback";
12
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
13
13
 
14
14
  const { withContext, useClassNames, ClassNamesProvider } = createSlotRecipeContext(menuSheet);
15
15
  const {
@@ -4,7 +4,7 @@ import { switchmark, type SwitchmarkVariantProps } from "@seed-design/css/recipe
4
4
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
5
5
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
6
6
  import { createWithStateProps } from "../../utils/createWithStateProps";
7
- import { withScaleFeedback } from "../../utils/scaleFeedback";
7
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
8
8
  import React from "react";
9
9
  import clsx from "clsx";
10
10
  import { splitMultipleVariantsProps } from "../../utils/splitMultipleVariantsProps";
@@ -1,7 +1,7 @@
1
1
  import { tabs, type TabsVariantProps } from "@seed-design/css/recipes/tabs";
2
2
  import { Tabs as TabsPrimitive } from "@seed-design/react-tabs";
3
3
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
4
- import { withScaleFeedback } from "../../utils/scaleFeedback";
4
+ import { withScaleFeedback } from "../../utils/withScaleFeedback";
5
5
 
6
6
  const { withProvider, withContext } = createSlotRecipeContext(tabs);
7
7
 
@@ -6,7 +6,7 @@ import { useComposedRefs } from "@radix-ui/react-compose-refs";
6
6
  import { Toggle as TogglePrimitive } from "@seed-design/react-toggle";
7
7
  import clsx from "clsx";
8
8
  import * as React from "react";
9
- import { useScaleFeedback } from "../../utils/scaleFeedback";
9
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
10
10
  import {
11
11
  PendingButtonProvider,
12
12
  usePendingButton,
package/src/index.ts CHANGED
@@ -5,8 +5,8 @@ export type { ResponsiveValue, UnwrapResponsive, BreakpointThreshold } from "./t
5
5
  export { useBreakpoint } from "./hooks/useBreakpoint";
6
6
  export type { UseBreakpointOptions } from "./hooks/useBreakpoint";
7
7
  export { useBreakpointValue } from "./hooks/useBreakpointValue";
8
- export { useScaleFeedback, ScaleFeedback } from "./utils/scaleFeedback";
9
- export type { ScaleFeedbackProps } from "./utils/scaleFeedback";
8
+ export { useScaleFeedback, ScaleFeedback } from "@seed-design/react-scale-feedback";
9
+ export type { ScaleFeedbackProps } from "@seed-design/react-scale-feedback";
10
10
  export { BreakpointProvider } from "./providers/BreakpointProvider";
11
11
  export type { BreakpointProviderProps } from "./providers/BreakpointProvider";
12
12
 
@@ -0,0 +1,34 @@
1
+ import { useComposedRefs } from "@radix-ui/react-compose-refs";
2
+ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
3
+ import clsx from "clsx";
4
+ import * as React from "react";
5
+
6
+ /**
7
+ * Wraps a component so its element opts into scale feedback — for one-liner
8
+ * factory components (`withContext`/`withProvider` results). Hand-written
9
+ * forwardRef components call `useScaleFeedback` directly instead.
10
+ */
11
+ export function withScaleFeedback<P>(
12
+ Component: React.ForwardRefExoticComponent<P>,
13
+ ): React.ForwardRefExoticComponent<P>;
14
+ export function withScaleFeedback(
15
+ Component: React.ForwardRefExoticComponent<
16
+ React.RefAttributes<HTMLElement> & { className?: string }
17
+ >,
18
+ ): React.ForwardRefExoticComponent<React.RefAttributes<HTMLElement> & { className?: string }> {
19
+ const Pressable = React.forwardRef<HTMLElement, { className?: string }>((props, ref) => {
20
+ const { scaleFeedbackRef, scaleFeedbackClassName } = useScaleFeedback();
21
+ const composedRef = useComposedRefs(scaleFeedbackRef, ref);
22
+
23
+ return (
24
+ <Component
25
+ {...props}
26
+ ref={composedRef}
27
+ className={clsx(scaleFeedbackClassName, props.className)}
28
+ />
29
+ );
30
+ });
31
+
32
+ Pressable.displayName = Component.displayName;
33
+ return Pressable;
34
+ }
@@ -1,76 +0,0 @@
1
- "use client";
2
- const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
3
- let react = require("react");
4
- react = require_runtime.__toESM(react);
5
- //#region src/utils/elementSizeVars.tsx
6
- /**
7
- * Publishes an element's rendered size as CSS custom properties.
8
- *
9
- * The size is a plain fact about the element rather than a feature, so this
10
- * util keeps unitless `--seed-element-width` / `--seed-element-height` in sync
11
- * on the element and stops there. Whatever needs the size derives its own
12
- * values from those vars in CSS.
13
- *
14
- * The names must stay in sync with `@seed-design/qvism-preset`
15
- * (utils/scale-feedback.ts), which owns the formula that consumes them. Press
16
- * detection stays in CSS (`:active` gates), so nothing here tracks interaction;
17
- * without JS the vars are simply never set and consumers fall back to scale 1.
18
- */
19
- var sharedObserver = null;
20
- function getSharedObserver() {
21
- sharedObserver ??= new ResizeObserver((entries) => {
22
- const measurements = entries.map((entry) => {
23
- const element = entry.target;
24
- const size = entry.borderBoxSize?.[0];
25
- return {
26
- element,
27
- width: size ? size.inlineSize : element.offsetWidth,
28
- height: size ? size.blockSize : element.offsetHeight
29
- };
30
- });
31
- for (const { element, width, height } of measurements) {
32
- element.style.setProperty("--seed-element-width", String(width));
33
- element.style.setProperty("--seed-element-height", String(height));
34
- }
35
- });
36
- return sharedObserver;
37
- }
38
- /**
39
- * Returns a callback ref that keeps the size vars in sync on the element it is
40
- * attached to. Compose it with the element's other refs however you like: being
41
- * handed an element it already watches is a no-op, so the observation survives a
42
- * ref whose identity changes every render and the vars are republished on resize
43
- * rather than on render.
44
- *
45
- * Teardown still runs when the ref genuinely leaves an element — it is unobserved
46
- * and its vars removed — so an element that keeps the class but loses the ref
47
- * falls back to a ratio of 1 instead of holding a stale one.
48
- */
49
- function useElementSizeVars() {
50
- const attachedRef = react.useRef(null);
51
- const observedRef = react.useRef(null);
52
- const release = react.useCallback(() => {
53
- const observed = observedRef.current;
54
- if (!observed) return;
55
- observedRef.current = null;
56
- getSharedObserver().unobserve(observed);
57
- observed.style.removeProperty("--seed-element-width");
58
- observed.style.removeProperty("--seed-element-height");
59
- }, []);
60
- return { sizeVarsRef: react.useCallback((node) => {
61
- attachedRef.current = node;
62
- if (!node) {
63
- queueMicrotask(() => {
64
- if (attachedRef.current === observedRef.current) return;
65
- release();
66
- });
67
- return;
68
- }
69
- if (observedRef.current === node) return;
70
- release();
71
- observedRef.current = node;
72
- getSharedObserver().observe(node, { box: "border-box" });
73
- }, [release]) };
74
- }
75
- //#endregion
76
- exports.useElementSizeVars = useElementSizeVars;
@@ -1,15 +0,0 @@
1
- /**
2
- * Returns a callback ref that keeps the size vars in sync on the element it is
3
- * attached to. Compose it with the element's other refs however you like: being
4
- * handed an element it already watches is a no-op, so the observation survives a
5
- * ref whose identity changes every render and the vars are republished on resize
6
- * rather than on render.
7
- *
8
- * Teardown still runs when the ref genuinely leaves an element — it is unobserved
9
- * and its vars removed — so an element that keeps the class but loses the ref
10
- * falls back to a ratio of 1 instead of holding a stale one.
11
- */
12
- export declare function useElementSizeVars(): {
13
- sizeVarsRef: (node: HTMLElement | null) => void;
14
- };
15
- //# sourceMappingURL=elementSizeVars.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"elementSizeVars.d.ts","sourceRoot":"","sources":["../../src/utils/elementSizeVars.tsx"],"names":[],"mappings":"AAgDA;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB;wBAkBvB,WAAW,GAAG,IAAI;EAkC5B"}
@@ -1,74 +0,0 @@
1
- "use client";
2
- import * as React$1 from "react";
3
- //#region src/utils/elementSizeVars.tsx
4
- /**
5
- * Publishes an element's rendered size as CSS custom properties.
6
- *
7
- * The size is a plain fact about the element rather than a feature, so this
8
- * util keeps unitless `--seed-element-width` / `--seed-element-height` in sync
9
- * on the element and stops there. Whatever needs the size derives its own
10
- * values from those vars in CSS.
11
- *
12
- * The names must stay in sync with `@seed-design/qvism-preset`
13
- * (utils/scale-feedback.ts), which owns the formula that consumes them. Press
14
- * detection stays in CSS (`:active` gates), so nothing here tracks interaction;
15
- * without JS the vars are simply never set and consumers fall back to scale 1.
16
- */
17
- var sharedObserver = null;
18
- function getSharedObserver() {
19
- sharedObserver ??= new ResizeObserver((entries) => {
20
- const measurements = entries.map((entry) => {
21
- const element = entry.target;
22
- const size = entry.borderBoxSize?.[0];
23
- return {
24
- element,
25
- width: size ? size.inlineSize : element.offsetWidth,
26
- height: size ? size.blockSize : element.offsetHeight
27
- };
28
- });
29
- for (const { element, width, height } of measurements) {
30
- element.style.setProperty("--seed-element-width", String(width));
31
- element.style.setProperty("--seed-element-height", String(height));
32
- }
33
- });
34
- return sharedObserver;
35
- }
36
- /**
37
- * Returns a callback ref that keeps the size vars in sync on the element it is
38
- * attached to. Compose it with the element's other refs however you like: being
39
- * handed an element it already watches is a no-op, so the observation survives a
40
- * ref whose identity changes every render and the vars are republished on resize
41
- * rather than on render.
42
- *
43
- * Teardown still runs when the ref genuinely leaves an element — it is unobserved
44
- * and its vars removed — so an element that keeps the class but loses the ref
45
- * falls back to a ratio of 1 instead of holding a stale one.
46
- */
47
- function useElementSizeVars() {
48
- const attachedRef = React$1.useRef(null);
49
- const observedRef = React$1.useRef(null);
50
- const release = React$1.useCallback(() => {
51
- const observed = observedRef.current;
52
- if (!observed) return;
53
- observedRef.current = null;
54
- getSharedObserver().unobserve(observed);
55
- observed.style.removeProperty("--seed-element-width");
56
- observed.style.removeProperty("--seed-element-height");
57
- }, []);
58
- return { sizeVarsRef: React$1.useCallback((node) => {
59
- attachedRef.current = node;
60
- if (!node) {
61
- queueMicrotask(() => {
62
- if (attachedRef.current === observedRef.current) return;
63
- release();
64
- });
65
- return;
66
- }
67
- if (observedRef.current === node) return;
68
- release();
69
- observedRef.current = node;
70
- getSharedObserver().observe(node, { box: "border-box" });
71
- }, [release]) };
72
- }
73
- //#endregion
74
- export { useElementSizeVars };