@kumix/ui 0.3.5 → 0.3.7
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/dist/components/agents/ai-sidebar.d.ts +17 -1
- package/dist/components/agents/ai-sidebar.d.ts.map +1 -1
- package/dist/components/agents/ai-sidebar.js +90 -14
- package/dist/components/agents/ai-sidebar.js.map +1 -1
- package/dist/components/agents/chat-app.d.ts +10 -5
- package/dist/components/agents/chat-app.d.ts.map +1 -1
- package/dist/components/agents/chat-app.js +54 -5
- package/dist/components/agents/chat-app.js.map +1 -1
- package/dist/components/agents/citations.d.ts.map +1 -1
- package/dist/components/agents/citations.js +5 -6
- package/dist/components/agents/citations.js.map +1 -1
- package/dist/components/agents/tool-approval.d.ts.map +1 -1
- package/dist/components/agents/tool-approval.js +1 -1
- package/dist/components/agents/tool-approval.js.map +1 -1
- package/dist/components/motion/action-swap.d.ts.map +1 -1
- package/dist/components/motion/action-swap.js +11 -16
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/animated-sidebar.js +1 -0
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
- package/dist/components/motion/availability-scheduler/day-row.d.ts +5 -2
- package/dist/components/motion/availability-scheduler/day-row.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/day-row.js +18 -8
- package/dist/components/motion/availability-scheduler/day-row.js.map +1 -1
- package/dist/components/motion/availability-scheduler/index.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/index.js +27 -5
- package/dist/components/motion/availability-scheduler/index.js.map +1 -1
- package/dist/components/motion/availability-scheduler/time-select.d.ts +3 -1
- package/dist/components/motion/availability-scheduler/time-select.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/time-select.js +3 -1
- package/dist/components/motion/availability-scheduler/time-select.js.map +1 -1
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
- package/dist/components/motion/bottom-sheet.js +26 -7
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/combobox/list.js +2 -2
- package/dist/components/motion/combobox/list.js.map +1 -1
- package/dist/components/motion/command-palette.d.ts.map +1 -1
- package/dist/components/motion/command-palette.js +3 -1
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.d.ts.map +1 -1
- package/dist/components/motion/context-menu.js +16 -6
- package/dist/components/motion/context-menu.js.map +1 -1
- package/dist/components/motion/cylinder-carousel.d.ts.map +1 -1
- package/dist/components/motion/cylinder-carousel.js +4 -3
- package/dist/components/motion/cylinder-carousel.js.map +1 -1
- package/dist/components/motion/expandable-action-bar.d.ts +6 -0
- package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
- package/dist/components/motion/expandable-action-bar.js +38 -9
- package/dist/components/motion/expandable-action-bar.js.map +1 -1
- package/dist/components/motion/hold-action-button.d.ts +1 -1
- package/dist/components/motion/hold-action-button.d.ts.map +1 -1
- package/dist/components/motion/hold-action-button.js +64 -50
- package/dist/components/motion/hold-action-button.js.map +1 -1
- package/dist/components/motion/morphing-tabs.d.ts.map +1 -1
- package/dist/components/motion/morphing-tabs.js +59 -18
- package/dist/components/motion/morphing-tabs.js.map +1 -1
- package/dist/components/motion/notification-stack.d.ts.map +1 -1
- package/dist/components/motion/notification-stack.js +28 -11
- package/dist/components/motion/notification-stack.js.map +1 -1
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +26 -11
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.d.ts.map +1 -1
- package/dist/components/motion/popover.js +39 -28
- package/dist/components/motion/popover.js.map +1 -1
- package/dist/components/motion/preview-rail.d.ts.map +1 -1
- package/dist/components/motion/preview-rail.js +42 -13
- package/dist/components/motion/preview-rail.js.map +1 -1
- package/dist/components/motion/project-folder.d.ts +27 -0
- package/dist/components/motion/project-folder.d.ts.map +1 -0
- package/dist/components/motion/project-folder.js +310 -0
- package/dist/components/motion/project-folder.js.map +1 -0
- package/dist/components/motion/pull-to-refresh.d.ts.map +1 -1
- package/dist/components/motion/pull-to-refresh.js +8 -7
- package/dist/components/motion/pull-to-refresh.js.map +1 -1
- package/dist/components/motion/range-slider-bubble.d.ts.map +1 -1
- package/dist/components/motion/range-slider-bubble.js +2 -1
- package/dist/components/motion/range-slider-bubble.js.map +1 -1
- package/dist/components/motion/range-slider-fluid.d.ts.map +1 -1
- package/dist/components/motion/range-slider-fluid.js +2 -1
- package/dist/components/motion/range-slider-fluid.js.map +1 -1
- package/dist/components/motion/range-slider-ruler.d.ts.map +1 -1
- package/dist/components/motion/range-slider-ruler.js +2 -1
- package/dist/components/motion/range-slider-ruler.js.map +1 -1
- package/dist/components/motion/range-slider-wave.d.ts.map +1 -1
- package/dist/components/motion/range-slider-wave.js +2 -1
- package/dist/components/motion/range-slider-wave.js.map +1 -1
- package/dist/components/motion/range-slider.d.ts.map +1 -1
- package/dist/components/motion/range-slider.js +2 -1
- package/dist/components/motion/range-slider.js.map +1 -1
- package/dist/components/motion/select.d.ts +15 -1
- package/dist/components/motion/select.d.ts.map +1 -1
- package/dist/components/motion/select.js +15 -4
- package/dist/components/motion/select.js.map +1 -1
- package/dist/components/motion/slide-action-button.d.ts.map +1 -1
- package/dist/components/motion/slide-action-button.js +3 -2
- package/dist/components/motion/slide-action-button.js.map +1 -1
- package/dist/components/motion/swipeable-list.d.ts.map +1 -1
- package/dist/components/motion/swipeable-list.js +2 -1
- package/dist/components/motion/swipeable-list.js.map +1 -1
- package/dist/components/motion/table/index.d.ts.map +1 -1
- package/dist/components/motion/table/index.js +64 -6
- package/dist/components/motion/table/index.js.map +1 -1
- package/dist/components/motion/table/table-header.d.ts.map +1 -1
- package/dist/components/motion/table/table-header.js +3 -2
- package/dist/components/motion/table/table-header.js.map +1 -1
- package/dist/components/motion/tabs.d.ts.map +1 -1
- package/dist/components/motion/tabs.js +2 -0
- package/dist/components/motion/tabs.js.map +1 -1
- package/dist/components/motion/text-reveal.d.ts.map +1 -1
- package/dist/components/motion/text-reveal.js +72 -48
- package/dist/components/motion/text-reveal.js.map +1 -1
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +35 -15
- package/dist/components/motion/tooltip.js.map +1 -1
- package/dist/components/motion/wheel-picker.d.ts.map +1 -1
- package/dist/components/motion/wheel-picker.js +4 -3
- package/dist/components/motion/wheel-picker.js.map +1 -1
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/badge.d.ts +2 -2
- package/dist/components/reui/frame.d.ts +2 -2
- package/dist/components/reui/icon-tile.d.ts +2 -2
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/{copy-menu-Bk5GP9Gp.js → copy-menu-1FKoMc9o.js} +9 -2
- package/dist/copy-menu-1FKoMc9o.js.map +1 -0
- package/dist/hooks/use-dismiss.d.ts +34 -0
- package/dist/hooks/use-dismiss.d.ts.map +1 -0
- package/dist/hooks/use-dismiss.js +78 -0
- package/dist/hooks/use-dismiss.js.map +1 -0
- package/dist/hooks/use-favicon.d.ts +17 -0
- package/dist/hooks/use-favicon.d.ts.map +1 -0
- package/dist/hooks/use-favicon.js +35 -0
- package/dist/hooks/use-favicon.js.map +1 -0
- package/dist/hooks/use-hover-gesture.d.ts +38 -0
- package/dist/hooks/use-hover-gesture.d.ts.map +1 -0
- package/dist/hooks/use-hover-gesture.js +46 -0
- package/dist/hooks/use-hover-gesture.js.map +1 -0
- package/dist/hooks/use-slider.d.ts.map +1 -1
- package/dist/hooks/use-slider.js +3 -2
- package/dist/hooks/use-slider.js.map +1 -1
- package/dist/hooks/use-tap-gesture.d.ts +47 -0
- package/dist/hooks/use-tap-gesture.d.ts.map +1 -0
- package/dist/hooks/use-tap-gesture.js +51 -0
- package/dist/hooks/use-tap-gesture.js.map +1 -0
- package/dist/hooks/use-touch-capable.d.ts +15 -0
- package/dist/hooks/use-touch-capable.d.ts.map +1 -0
- package/dist/hooks/use-touch-capable.js +29 -0
- package/dist/hooks/use-touch-capable.js.map +1 -0
- package/dist/lib/touch.d.ts +66 -0
- package/dist/lib/touch.d.ts.map +1 -0
- package/dist/lib/touch.js +79 -0
- package/dist/lib/touch.js.map +1 -0
- package/dist/types-smkWN_7x.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/copy-menu-Bk5GP9Gp.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { TOUCH_GESTURE_CLASS, capturePointer, releasePointer } from "../../lib/touch.js";
|
|
2
3
|
import { EASE_OUT, SPRING_PRESS } from "../../lib/ease.js";
|
|
3
4
|
import { forwardRef, useRef, useState } from "react";
|
|
4
5
|
import { cn } from "@kumix/utils";
|
|
@@ -22,13 +23,21 @@ const HoldActionButton = forwardRef(function HoldActionButton({ children, type =
|
|
|
22
23
|
};
|
|
23
24
|
const handlePointerDown = (event) => {
|
|
24
25
|
if (event.button !== 0) return;
|
|
25
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
26
26
|
startHold();
|
|
27
|
+
capturePointer(event.currentTarget, event.pointerId);
|
|
27
28
|
};
|
|
28
29
|
const handlePointerUp = (event) => {
|
|
29
|
-
|
|
30
|
+
releasePointer(event.currentTarget, event.pointerId);
|
|
30
31
|
cancelHold();
|
|
31
32
|
};
|
|
33
|
+
const handlePointerLeave = (event) => {
|
|
34
|
+
if (event.pointerType !== "touch") cancelHold();
|
|
35
|
+
};
|
|
36
|
+
const handlePointerMove = (event) => {
|
|
37
|
+
if (!holding) return;
|
|
38
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
39
|
+
if (event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom) cancelHold();
|
|
40
|
+
};
|
|
32
41
|
const handleKeyDown = (event) => {
|
|
33
42
|
if ((event.key === " " || event.key === "Enter") && !event.repeat) {
|
|
34
43
|
event.preventDefault();
|
|
@@ -56,66 +65,71 @@ const HoldActionButton = forwardRef(function HoldActionButton({ children, type =
|
|
|
56
65
|
disabled,
|
|
57
66
|
"aria-label": typeof children === "string" ? children : void 0,
|
|
58
67
|
onPointerDown: handlePointerDown,
|
|
68
|
+
onPointerMove: handlePointerMove,
|
|
59
69
|
onPointerUp: handlePointerUp,
|
|
60
70
|
onPointerCancel: cancelHold,
|
|
61
|
-
onPointerLeave:
|
|
71
|
+
onPointerLeave: handlePointerLeave,
|
|
62
72
|
onKeyDown: handleKeyDown,
|
|
63
73
|
onKeyUp: handleKeyUp,
|
|
64
74
|
onContextMenu: (event) => event.preventDefault(),
|
|
65
75
|
whileTap: reduce || disabled ? void 0 : { scale: .98 },
|
|
66
76
|
transition: SPRING_PRESS,
|
|
67
|
-
className: cn("relative inline-grid h-16 min-w-72 touch-none
|
|
77
|
+
className: cn("relative inline-grid h-16 min-w-72 touch-none place-items-center overflow-hidden rounded-(--hold-radius) bg-primary px-8 text-primary-foreground", "[--hold-radius:22px]", TOUCH_GESTURE_CLASS, "outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background", "disabled:pointer-events-none disabled:opacity-50", className),
|
|
68
78
|
...rest,
|
|
69
|
-
children: [/* @__PURE__ */ jsx(
|
|
79
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
70
80
|
"aria-hidden": "true",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
opacity: active ? 1 : 0,
|
|
74
|
-
transform: "none"
|
|
75
|
-
} : {
|
|
76
|
-
opacity: 1,
|
|
77
|
-
transform: active ? activeTransform : idleTransform
|
|
78
|
-
},
|
|
79
|
-
transition: active ? {
|
|
80
|
-
duration: holdDuration / 1e3,
|
|
81
|
-
ease: "linear"
|
|
82
|
-
} : {
|
|
83
|
-
duration: reduce ? .15 : .24,
|
|
84
|
-
ease: EASE_OUT
|
|
85
|
-
},
|
|
86
|
-
onAnimationComplete: handleFillComplete,
|
|
87
|
-
className: cn("absolute inset-0 bg-sky-400 will-change-[opacity,transform]", fillClassName),
|
|
88
|
-
children: !reduce ? type === "horizontal" ? /* @__PURE__ */ jsx(motion.svg, {
|
|
89
|
-
viewBox: "0 0 24 240",
|
|
90
|
-
preserveAspectRatio: "none",
|
|
81
|
+
className: "pointer-events-none absolute inset-0 [clip-path:inset(0_round_var(--hold-radius))]",
|
|
82
|
+
children: /* @__PURE__ */ jsx(motion.span, {
|
|
91
83
|
"aria-hidden": "true",
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
initial: false,
|
|
85
|
+
animate: reduce ? {
|
|
86
|
+
opacity: active ? 1 : 0,
|
|
87
|
+
transform: "none"
|
|
88
|
+
} : {
|
|
89
|
+
opacity: 1,
|
|
90
|
+
transform: active ? activeTransform : idleTransform
|
|
97
91
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
viewBox: "0 0 240 24",
|
|
105
|
-
preserveAspectRatio: "none",
|
|
106
|
-
"aria-hidden": "true",
|
|
107
|
-
animate: { transform: active ? "translateX(-50%)" : "translateX(0%)" },
|
|
108
|
-
transition: {
|
|
109
|
-
duration: 1.1,
|
|
110
|
-
ease: "linear",
|
|
111
|
-
repeat: active ? Number.POSITIVE_INFINITY : 0
|
|
92
|
+
transition: active ? {
|
|
93
|
+
duration: holdDuration / 1e3,
|
|
94
|
+
ease: "linear"
|
|
95
|
+
} : {
|
|
96
|
+
duration: reduce ? .15 : .24,
|
|
97
|
+
ease: EASE_OUT
|
|
112
98
|
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
99
|
+
onAnimationComplete: handleFillComplete,
|
|
100
|
+
className: cn("absolute inset-0 bg-sky-400 will-change-[opacity,transform]", fillClassName),
|
|
101
|
+
children: !reduce ? type === "horizontal" ? /* @__PURE__ */ jsx(motion.svg, {
|
|
102
|
+
viewBox: "0 0 24 240",
|
|
103
|
+
preserveAspectRatio: "none",
|
|
104
|
+
"aria-hidden": "true",
|
|
105
|
+
animate: { transform: active ? "translateY(-50%)" : "translateY(0%)" },
|
|
106
|
+
transition: {
|
|
107
|
+
duration: 1.1,
|
|
108
|
+
ease: "linear",
|
|
109
|
+
repeat: active ? Number.POSITIVE_INFINITY : 0
|
|
110
|
+
},
|
|
111
|
+
className: "absolute top-0 -right-5 h-[200%] w-6 text-sky-400",
|
|
112
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
113
|
+
d: "M0 0h12C2 20 2 40 12 60s10 40 0 60-10 40 0 60 10 40 0 60H0Z",
|
|
114
|
+
fill: "currentColor"
|
|
115
|
+
})
|
|
116
|
+
}) : /* @__PURE__ */ jsx(motion.svg, {
|
|
117
|
+
viewBox: "0 0 240 24",
|
|
118
|
+
preserveAspectRatio: "none",
|
|
119
|
+
"aria-hidden": "true",
|
|
120
|
+
animate: { transform: active ? "translateX(-50%)" : "translateX(0%)" },
|
|
121
|
+
transition: {
|
|
122
|
+
duration: 1.1,
|
|
123
|
+
ease: "linear",
|
|
124
|
+
repeat: active ? Number.POSITIVE_INFINITY : 0
|
|
125
|
+
},
|
|
126
|
+
className: "absolute -top-5 left-0 h-6 w-[200%] text-sky-400",
|
|
127
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
128
|
+
d: "M0 12C20 2 40 2 60 12s40 10 60 0 40-10 60 0 40 10 60 0v12H0Z",
|
|
129
|
+
fill: "currentColor"
|
|
130
|
+
})
|
|
131
|
+
}) : null
|
|
132
|
+
})
|
|
119
133
|
}), /* @__PURE__ */ jsxs("span", {
|
|
120
134
|
className: cn("relative z-10 grid place-items-center font-medium text-base tracking-[-0.01em]", labelClassName),
|
|
121
135
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hold-action-button.js","names":[],"sources":["../../../src/components/motion/hold-action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n useRef,\n useState,\n} from \"react\";\nimport { type HTMLMotionProps, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_PRESS } from \"../../lib/ease\";\n\nexport interface HoldActionButtonProps\n extends Omit<\n HTMLMotionProps<\"button\">,\n | \"children\"\n | \"type\"\n | \"onClick\"\n | \"onPointerDown\"\n | \"onPointerUp\"\n | \"onPointerCancel\"\n | \"onPointerLeave\"\n | \"onKeyDown\"\n | \"onKeyUp\"\n > {\n children: ReactNode;\n type?: \"vertical\" | \"horizontal\";\n holdingLabel?: ReactNode;\n completeLabel?: ReactNode;\n holdDuration?: number;\n onHoldComplete?: () => void;\n fillClassName?: string;\n labelClassName?: string;\n}\n\nexport const HoldActionButton = forwardRef<HTMLButtonElement, HoldActionButtonProps>(\n function HoldActionButton(\n {\n children,\n type = \"vertical\",\n holdingLabel = \"Keep holding\",\n completeLabel = \"Done\",\n holdDuration = 1600,\n onHoldComplete,\n fillClassName,\n labelClassName,\n className,\n disabled,\n ...rest\n },\n ref,\n ) {\n const reduce = useReducedMotion();\n const completedRef = useRef(false);\n const [holding, setHolding] = useState(false);\n const [completed, setCompleted] = useState(false);\n\n const startHold = () => {\n if (disabled || holding) return;\n completedRef.current = false;\n setCompleted(false);\n setHolding(true);\n };\n\n const cancelHold = () => {\n setHolding(false);\n setCompleted(false);\n };\n\n const handlePointerDown = (event: PointerEvent<HTMLButtonElement>) => {\n if (event.button !== 0) return;\n event.currentTarget.setPointerCapture(event.pointerId);\n startHold();\n };\n\n const handlePointerUp = (event: PointerEvent<HTMLButtonElement>) => {\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n cancelHold();\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if ((event.key === \" \" || event.key === \"Enter\") && !event.repeat) {\n event.preventDefault();\n startHold();\n }\n };\n\n const handleKeyUp = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === \" \" || event.key === \"Enter\") {\n event.preventDefault();\n cancelHold();\n }\n };\n\n const handleFillComplete = () => {\n if (!holding || completedRef.current) return;\n completedRef.current = true;\n setCompleted(true);\n onHoldComplete?.();\n };\n\n const active = holding || completed;\n const activeTransform = type === \"horizontal\" ? \"translateX(0%)\" : \"translateY(0%)\";\n const idleTransform = type === \"horizontal\" ? \"translateX(-100%)\" : \"translateY(115%)\";\n\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n disabled={disabled}\n aria-label={typeof children === \"string\" ? children : undefined}\n onPointerDown={handlePointerDown}\n onPointerUp={handlePointerUp}\n onPointerCancel={cancelHold}\n onPointerLeave={cancelHold}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onContextMenu={(event) => event.preventDefault()}\n whileTap={reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={cn(\n \"relative inline-grid h-16 min-w-72 touch-none select-none place-items-center overflow-hidden rounded-[22px] bg-primary px-8 text-primary-foreground\",\n \"outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...rest}\n >\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={\n reduce\n ? { opacity: active ? 1 : 0, transform: \"none\" }\n : {\n opacity: 1,\n transform: active ? activeTransform : idleTransform,\n }\n }\n transition={\n active\n ? { duration: holdDuration / 1000, ease: \"linear\" }\n : { duration: reduce ? 0.15 : 0.24, ease: EASE_OUT }\n }\n onAnimationComplete={handleFillComplete}\n className={cn(\n \"absolute inset-0 bg-sky-400 will-change-[opacity,transform]\",\n fillClassName,\n )}\n >\n {!reduce ? (\n type === \"horizontal\" ? (\n <motion.svg\n viewBox=\"0 0 24 240\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n animate={{\n transform: active ? \"translateY(-50%)\" : \"translateY(0%)\",\n }}\n transition={{\n duration: 1.1,\n ease: \"linear\",\n repeat: active ? Number.POSITIVE_INFINITY : 0,\n }}\n className=\"absolute top-0 -right-5 h-[200%] w-6 text-sky-400\"\n >\n <path\n d=\"M0 0h12C2 20 2 40 12 60s10 40 0 60-10 40 0 60 10 40 0 60H0Z\"\n fill=\"currentColor\"\n />\n </motion.svg>\n ) : (\n <motion.svg\n viewBox=\"0 0 240 24\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n animate={{\n transform: active ? \"translateX(-50%)\" : \"translateX(0%)\",\n }}\n transition={{\n duration: 1.1,\n ease: \"linear\",\n repeat: active ? Number.POSITIVE_INFINITY : 0,\n }}\n className=\"absolute -top-5 left-0 h-6 w-[200%] text-sky-400\"\n >\n <path\n d=\"M0 12C20 2 40 2 60 12s40 10 60 0 40-10 60 0 40 10 60 0v12H0Z\"\n fill=\"currentColor\"\n />\n </motion.svg>\n )\n ) : null}\n </motion.span>\n\n <span\n className={cn(\n \"relative z-10 grid place-items-center font-medium text-base tracking-[-0.01em]\",\n labelClassName,\n )}\n >\n <motion.span\n animate={{ opacity: active ? 0 : 1 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {children}\n </motion.span>\n <motion.span\n aria-hidden={!holding || completed}\n animate={{ opacity: holding && !completed ? 1 : 0 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {holdingLabel}\n </motion.span>\n <motion.span\n aria-hidden={!completed}\n animate={{ opacity: completed ? 1 : 0 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {completeLabel}\n </motion.span>\n </span>\n </motion.button>\n );\n },\n);\n"],"mappings":";;;;;;;AAsCA,MAAa,mBAAmB,WAC9B,SAAS,iBACP,EACE,UACA,OAAO,YACP,eAAe,gBACf,gBAAgB,QAChB,eAAe,MACf,gBACA,eACA,gBACA,WACA,UACA,GAAG,QAEL,KACA;CACA,MAAM,SAAS,iBAAiB;CAChC,MAAM,eAAe,OAAO,KAAK;CACjC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAEhD,MAAM,kBAAkB;EACtB,IAAI,YAAY,SAAS;EACzB,aAAa,UAAU;EACvB,aAAa,KAAK;EAClB,WAAW,IAAI;CACjB;CAEA,MAAM,mBAAmB;EACvB,WAAW,KAAK;EAChB,aAAa,KAAK;CACpB;CAEA,MAAM,qBAAqB,UAA2C;EACpE,IAAI,MAAM,WAAW,GAAG;EACxB,MAAM,cAAc,kBAAkB,MAAM,SAAS;EACrD,UAAU;CACZ;CAEA,MAAM,mBAAmB,UAA2C;EAClE,IAAI,MAAM,cAAc,kBAAkB,MAAM,SAAS,GACvD,MAAM,cAAc,sBAAsB,MAAM,SAAS;EAE3D,WAAW;CACb;CAEA,MAAM,iBAAiB,UAA4C;EACjE,KAAK,MAAM,QAAQ,OAAO,MAAM,QAAQ,YAAY,CAAC,MAAM,QAAQ;GACjE,MAAM,eAAe;GACrB,UAAU;EACZ;CACF;CAEA,MAAM,eAAe,UAA4C;EAC/D,IAAI,MAAM,QAAQ,OAAO,MAAM,QAAQ,SAAS;GAC9C,MAAM,eAAe;GACrB,WAAW;EACb;CACF;CAEA,MAAM,2BAA2B;EAC/B,IAAI,CAAC,WAAW,aAAa,SAAS;EACtC,aAAa,UAAU;EACvB,aAAa,IAAI;EACjB,iBAAiB;CACnB;CAEA,MAAM,SAAS,WAAW;CAC1B,MAAM,kBAAkB,SAA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IAEZ;EACO,CAAA,GAEb,qBAAC,QAAD;GACE,WAAW,GACT,kFACA,cACF;GAJF,UAAA;IAME,oBAAC,OAAO,MAAR;KACE,SAAS,EAAE,SAAS,SAAS,IAAI,EAAE;KACnC,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET;IACU,CAAA;IACb,oBAAC,OAAO,MAAR;KACE,eAAa,CAAC,WAAW;KACzB,SAAS,EAAE,SAAS,WAAW,CAAC,YAAY,IAAI,EAAE;KAClD,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET,UAAA;IACU,CAAA;IACb,oBAAC,OAAO,MAAR;KACE,eAAa,CAAC;KACd,SAAS,EAAE,SAAS,YAAY,IAAI,EAAE;KACtC,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET,UAAA;IACU,CAAA;GACT;EACO,CAAA,CAAA;;AAEnB,CACF"}
|
|
1
|
+
{"version":3,"file":"hold-action-button.js","names":[],"sources":["../../../src/components/motion/hold-action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n useRef,\n useState,\n} from \"react\";\nimport { type HTMLMotionProps, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { capturePointer, releasePointer, TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\nexport interface HoldActionButtonProps\n extends Omit<\n HTMLMotionProps<\"button\">,\n | \"children\"\n | \"type\"\n | \"onClick\"\n | \"onPointerDown\"\n | \"onPointerUp\"\n | \"onPointerCancel\"\n | \"onPointerLeave\"\n | \"onPointerMove\"\n | \"onKeyDown\"\n | \"onKeyUp\"\n > {\n children: ReactNode;\n type?: \"vertical\" | \"horizontal\";\n holdingLabel?: ReactNode;\n completeLabel?: ReactNode;\n holdDuration?: number;\n onHoldComplete?: () => void;\n fillClassName?: string;\n labelClassName?: string;\n}\n\nexport const HoldActionButton = forwardRef<HTMLButtonElement, HoldActionButtonProps>(\n function HoldActionButton(\n {\n children,\n type = \"vertical\",\n holdingLabel = \"Keep holding\",\n completeLabel = \"Done\",\n holdDuration = 1600,\n onHoldComplete,\n fillClassName,\n labelClassName,\n className,\n disabled,\n ...rest\n },\n ref,\n ) {\n const reduce = useReducedMotion();\n const completedRef = useRef(false);\n const [holding, setHolding] = useState(false);\n const [completed, setCompleted] = useState(false);\n\n const startHold = () => {\n if (disabled || holding) return;\n completedRef.current = false;\n setCompleted(false);\n setHolding(true);\n };\n\n const cancelHold = () => {\n setHolding(false);\n setCompleted(false);\n };\n\n const handlePointerDown = (event: PointerEvent<HTMLButtonElement>) => {\n if (event.button !== 0) return;\n // Start first: capture is a convenience, and a browser that refuses it\n // must not take the hold down with it.\n startHold();\n capturePointer(event.currentTarget, event.pointerId);\n };\n\n const handlePointerUp = (event: PointerEvent<HTMLButtonElement>) => {\n releasePointer(event.currentTarget, event.pointerId);\n cancelHold();\n };\n\n const handlePointerLeave = (event: PointerEvent<HTMLButtonElement>) => {\n // Only reached when the capture below was refused: a captured pointer gets\n // no boundary events at all. A finger does not get this reading either way\n // — WebKit fires leave repeatedly for a touch that never moved, which\n // would cancel every hold on the frame it started.\n if (event.pointerType !== \"touch\") cancelHold();\n };\n\n const handlePointerMove = (event: PointerEvent<HTMLButtonElement>) => {\n // Leaving the button abandons the hold, and while the pointer is captured\n // nothing announces that: no boundary events, and `touch-none` means a\n // finger sliding off cannot scroll and so cannot cancel either. Measure it\n // instead — off the button ends the hold, wherever the pointer then goes.\n if (!holding) return;\n\n const rect = event.currentTarget.getBoundingClientRect();\n const outside =\n event.clientX < rect.left ||\n event.clientX > rect.right ||\n event.clientY < rect.top ||\n event.clientY > rect.bottom;\n\n if (outside) cancelHold();\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if ((event.key === \" \" || event.key === \"Enter\") && !event.repeat) {\n event.preventDefault();\n startHold();\n }\n };\n\n const handleKeyUp = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === \" \" || event.key === \"Enter\") {\n event.preventDefault();\n cancelHold();\n }\n };\n\n const handleFillComplete = () => {\n if (!holding || completedRef.current) return;\n completedRef.current = true;\n setCompleted(true);\n onHoldComplete?.();\n };\n\n const active = holding || completed;\n const activeTransform = type === \"horizontal\" ? \"translateX(0%)\" : \"translateY(0%)\";\n const idleTransform = type === \"horizontal\" ? \"translateX(-100%)\" : \"translateY(115%)\";\n\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n disabled={disabled}\n aria-label={typeof children === \"string\" ? children : undefined}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={cancelHold}\n onPointerLeave={handlePointerLeave}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onContextMenu={(event) => event.preventDefault()}\n whileTap={reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={cn(\n \"relative inline-grid h-16 min-w-72 touch-none place-items-center overflow-hidden rounded-(--hold-radius) bg-primary px-8 text-primary-foreground\",\n \"[--hold-radius:22px]\",\n TOUCH_GESTURE_CLASS,\n \"outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...rest}\n >\n {/* Safari hands the fill its own compositing layer and then stops\n applying the button's rounded overflow clip to it, so the liquid\n bleeds past the corners. clip-path survives compositing. It lives on\n this static layer rather than the button so it never cuts the focus\n ring, and reads the same radius so the two cannot drift apart. */}\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 [clip-path:inset(0_round_var(--hold-radius))]\"\n >\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={\n reduce\n ? { opacity: active ? 1 : 0, transform: \"none\" }\n : {\n opacity: 1,\n transform: active ? activeTransform : idleTransform,\n }\n }\n transition={\n active\n ? { duration: holdDuration / 1000, ease: \"linear\" }\n : { duration: reduce ? 0.15 : 0.24, ease: EASE_OUT }\n }\n onAnimationComplete={handleFillComplete}\n className={cn(\n \"absolute inset-0 bg-sky-400 will-change-[opacity,transform]\",\n fillClassName,\n )}\n >\n {!reduce ? (\n type === \"horizontal\" ? (\n <motion.svg\n viewBox=\"0 0 24 240\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n animate={{\n transform: active ? \"translateY(-50%)\" : \"translateY(0%)\",\n }}\n transition={{\n duration: 1.1,\n ease: \"linear\",\n repeat: active ? Number.POSITIVE_INFINITY : 0,\n }}\n className=\"absolute top-0 -right-5 h-[200%] w-6 text-sky-400\"\n >\n <path\n d=\"M0 0h12C2 20 2 40 12 60s10 40 0 60-10 40 0 60 10 40 0 60H0Z\"\n fill=\"currentColor\"\n />\n </motion.svg>\n ) : (\n <motion.svg\n viewBox=\"0 0 240 24\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n animate={{\n transform: active ? \"translateX(-50%)\" : \"translateX(0%)\",\n }}\n transition={{\n duration: 1.1,\n ease: \"linear\",\n repeat: active ? Number.POSITIVE_INFINITY : 0,\n }}\n className=\"absolute -top-5 left-0 h-6 w-[200%] text-sky-400\"\n >\n <path\n d=\"M0 12C20 2 40 2 60 12s40 10 60 0 40-10 60 0 40 10 60 0v12H0Z\"\n fill=\"currentColor\"\n />\n </motion.svg>\n )\n ) : null}\n </motion.span>\n </span>\n\n <span\n className={cn(\n \"relative z-10 grid place-items-center font-medium text-base tracking-[-0.01em]\",\n labelClassName,\n )}\n >\n <motion.span\n animate={{ opacity: active ? 0 : 1 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {children}\n </motion.span>\n <motion.span\n aria-hidden={!holding || completed}\n animate={{ opacity: holding && !completed ? 1 : 0 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {holdingLabel}\n </motion.span>\n <motion.span\n aria-hidden={!completed}\n animate={{ opacity: completed ? 1 : 0 }}\n transition={{ duration: reduce ? 0 : 0.12, ease: EASE_OUT }}\n className=\"col-start-1 row-start-1\"\n >\n {completeLabel}\n </motion.span>\n </span>\n </motion.button>\n );\n },\n);\n"],"mappings":";;;;;;;;AAwCA,MAAa,mBAAmB,WAC9B,SAAS,iBACP,EACE,UACA,OAAO,YACP,eAAe,gBACf,gBAAgB,QAChB,eAAe,MACf,gBACA,eACA,gBACA,WACA,UACA,GAAG,QAEL,KACA;CACA,MAAM,SAAS,iBAAiB;CAChC,MAAM,eAAe,OAAO,KAAK;CACjC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAEhD,MAAM,kBAAkB;EACtB,IAAI,YAAY,SAAS;EACzB,aAAa,UAAU;EACvB,aAAa,KAAK;EAClB,WAAW,IAAI;CACjB;CAEA,MAAM,mBAAmB;EACvB,WAAW,KAAK;EAChB,aAAa,KAAK;CACpB;CAEA,MAAM,qBAAqB,UAA2C;EACpE,IAAI,MAAM,WAAW,GAAG;EAGxB,UAAU;EACV,eAAe,MAAM,eAAe,MAAM,SAAS;CACrD;CAEA,MAAM,mBAAmB,UAA2C;EAClE,eAAe,MAAM,eAAe,MAAM,SAAS;EACnD,WAAW;CACb;CAEA,MAAM,sBAAsB,UAA2C;EAKrE,IAAI,MAAM,gBAAgB,SAAS,WAAW;CAChD;CAEA,MAAM,qBAAqB,UAA2C;EAKpE,IAAI,CAAC,SAAS;EAEd,MAAM,OAAO,MAAM,cAAc,sBAAsB;EAOvD,IALE,MAAM,UAAU,KAAK,QACrB,MAAM,UAAU,KAAK,SACrB,MAAM,UAAU,KAAK,OACrB,MAAM,UAAU,KAAK,QAEV,WAAW;CAC1B;CAEA,MAAM,iBAAi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oB;KACpB,eAAY;KACZ,SAAS,EACP,WAAW,SAAS,qBAAqB,iBAC3C;KACA,YAAY;MACV,UAAU;MACV,MAAM;MACN,QAAQ,SAAS,OAAO,oBAAoB;KAC9C;KACA,WAAU;KAEV,UAAA,oBAAC,QAAD;MACE,GAAE;MACF,MAAK;KACN,CAAA;IACS,CAAA,IAEZ,oBAAC,OAAO,KAAR;KACE,SAAQ;KACR,qBAAoB;KACpB,eAAY;KACZ,SAAS,EACP,WAAW,SAAS,qBAAqB,iBAC3C;KACA,YAAY;MACV,UAAU;MACV,MAAM;MACN,QAAQ,SAAS,OAAO,oBAAoB;KAC9C;KACA,WAAU;KAEV,UAAA,oBAAC,QAAD;MACE,GAAE;MACF,MAAK;KACN,CAAA;IACS,CAAA,IAEZ;GACO,CAAA;EACT,CAAA,GAEN,qBAAC,QAAD;GACE,WAAW,GACT,kFACA,cACF;GAJF,UAAA;IAME,oBAAC,OAAO,MAAR;KACE,SAAS,EAAE,SAAS,SAAS,IAAI,EAAE;KACnC,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET;IACU,CAAA;IACb,oBAAC,OAAO,MAAR;KACE,eAAa,CAAC,WAAW;KACzB,SAAS,EAAE,SAAS,WAAW,CAAC,YAAY,IAAI,EAAE;KAClD,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET,UAAA;IACU,CAAA;IACb,oBAAC,OAAO,MAAR;KACE,eAAa,CAAC;KACd,SAAS,EAAE,SAAS,YAAY,IAAI,EAAE;KACtC,YAAY;MAAE,UAAU,SAAS,IAAI;MAAM,MAAM;KAAS;KAC1D,WAAU;KAET,UAAA;IACU,CAAA;GACT;EACO,CAAA,CAAA;;AAEnB,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morphing-tabs.d.ts","names":[],"sources":["../../../src/components/motion/morphing-tabs.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"morphing-tabs.d.ts","names":[],"sources":["../../../src/components/motion/morphing-tabs.tsx"],"mappings":";;KA8BY;EACV;EACA;EACA,OAAO;EACP,SAAS;EACT;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA;EACA,iBAAiB;;EAEjB,iBAAiB;;EAEjB,WAAW;EACX;EACA;EACA,aAAa;;iBA2MC,eACd,OACA,OACA,cACA,eACA,eACA,SACA,WACA,WACA,cACC,oCAAiB,IAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { TOUCH_GESTURE_CLASS, capturePointer } from "../../lib/touch.js";
|
|
2
3
|
import { EASE_OUT, SPRING_GLIDE, SPRING_PRESS } from "../../lib/ease.js";
|
|
3
4
|
import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
5
|
import { cn } from "@kumix/utils";
|
|
@@ -8,7 +9,8 @@ import { X } from "lucide-react";
|
|
|
8
9
|
import { createPortal } from "react-dom";
|
|
9
10
|
//#region src/components/motion/morphing-tabs.tsx
|
|
10
11
|
const DRAG_THRESHOLD = 5;
|
|
11
|
-
const
|
|
12
|
+
const MAX_TAB_WIDTH = 176;
|
|
13
|
+
const MIN_TAB_WIDTH = 96;
|
|
12
14
|
const TAB_HEIGHT = 56;
|
|
13
15
|
const TAB_TOP = 24;
|
|
14
16
|
const TAB_RADIUS = 24;
|
|
@@ -29,11 +31,11 @@ function moveItem(order, from, to) {
|
|
|
29
31
|
next.splice(to, 0, item);
|
|
30
32
|
return next;
|
|
31
33
|
}
|
|
32
|
-
function liquidTabPath(tabLeft, surfaceWidth) {
|
|
34
|
+
function liquidTabPath(tabLeft, surfaceWidth, tabWidth) {
|
|
33
35
|
const panelLeft = SURFACE_INSET;
|
|
34
36
|
const panelRight = surfaceWidth - SURFACE_INSET;
|
|
35
|
-
const left = Math.max(panelLeft, Math.min(panelRight -
|
|
36
|
-
const right = left +
|
|
37
|
+
const left = Math.max(panelLeft, Math.min(panelRight - tabWidth, tabLeft));
|
|
38
|
+
const right = left + tabWidth;
|
|
37
39
|
const top = 24;
|
|
38
40
|
const bottom = RAIL_HEIGHT;
|
|
39
41
|
const leftJoin = Math.max(panelLeft, left - LIQUID_JOIN);
|
|
@@ -62,7 +64,7 @@ function liquidTabPath(tabLeft, surfaceWidth) {
|
|
|
62
64
|
"Z"
|
|
63
65
|
].join(" ");
|
|
64
66
|
}
|
|
65
|
-
function SpringTab({ id, targetLeft, dragging, dragLeft, surfaceLeft, reduce, active, anyDragging, surfaceHost, surfaceWidth, surfaceClassName, zIndex, className, children, registerPosition, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onLostPointerCapture }) {
|
|
67
|
+
function SpringTab({ id, targetLeft, dragging, dragLeft, surfaceLeft, reduce, active, anyDragging, surfaceHost, surfaceWidth, tabWidth, surfaceClassName, zIndex, className, children, registerPosition, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onLostPointerCapture }) {
|
|
66
68
|
const target = useMotionValue(targetLeft);
|
|
67
69
|
const position = useSpring(target, SPRING_GLIDE);
|
|
68
70
|
const settledTransform = useTransform(reduce ? target : position, (left) => `translate3d(${left}px, 0, 0)`);
|
|
@@ -93,7 +95,8 @@ function SpringTab({ id, targetLeft, dragging, dragLeft, surfaceLeft, reduce, ac
|
|
|
93
95
|
className: cn("pointer-events-none absolute inset-x-0 top-0 h-[108px] w-full text-[#fafaf8]", dragging ? "z-20" : "z-0", surfaceClassName),
|
|
94
96
|
children: /* @__PURE__ */ jsx(LiquidSurfacePath, {
|
|
95
97
|
left: liquidDriver,
|
|
96
|
-
surfaceWidth
|
|
98
|
+
surfaceWidth,
|
|
99
|
+
tabWidth
|
|
97
100
|
}, anyDragging ? dragging ? "dragged" : "displaced" : "idle")
|
|
98
101
|
}), surfaceHost) : null, /* @__PURE__ */ jsx(motion.div, {
|
|
99
102
|
style: {
|
|
@@ -109,8 +112,8 @@ function SpringTab({ id, targetLeft, dragging, dragLeft, surfaceLeft, reduce, ac
|
|
|
109
112
|
children
|
|
110
113
|
})] });
|
|
111
114
|
}
|
|
112
|
-
function LiquidSurfacePath({ left, surfaceWidth }) {
|
|
113
|
-
const path = useTransform(left, (value) => liquidTabPath(value, surfaceWidth));
|
|
115
|
+
function LiquidSurfacePath({ left, surfaceWidth, tabWidth }) {
|
|
116
|
+
const path = useTransform(left, (value) => liquidTabPath(value, surfaceWidth, tabWidth));
|
|
114
117
|
return /* @__PURE__ */ jsx(motion.path, {
|
|
115
118
|
d: path,
|
|
116
119
|
fill: "currentColor"
|
|
@@ -157,7 +160,39 @@ function MorphingTabs({ items, value, defaultValue, onValueChange, onOrderChange
|
|
|
157
160
|
const firstEnabledItem = orderedItems.find((item) => !item.disabled) ?? orderedItems[0] ?? null;
|
|
158
161
|
const activeItem = currentValue && itemMap.has(currentValue) ? itemMap.get(currentValue) ?? null : firstEnabledItem;
|
|
159
162
|
const activeId = activeItem?.id ?? null;
|
|
160
|
-
const
|
|
163
|
+
const { tabWidth, slotGap } = useMemo(() => {
|
|
164
|
+
const count = order.length;
|
|
165
|
+
if (!surfaceWidth || count === 0) return {
|
|
166
|
+
tabWidth: MAX_TAB_WIDTH,
|
|
167
|
+
slotGap: tabGap
|
|
168
|
+
};
|
|
169
|
+
const inner = surfaceWidth - 32;
|
|
170
|
+
const widthAt = (gap) => Math.floor((inner - gap * (count - 1)) / count);
|
|
171
|
+
if (widthAt(tabGap) >= MIN_TAB_WIDTH) return {
|
|
172
|
+
tabWidth: Math.min(MAX_TAB_WIDTH, widthAt(tabGap)),
|
|
173
|
+
slotGap: tabGap
|
|
174
|
+
};
|
|
175
|
+
if (count > 1 && widthAt(0) >= MIN_TAB_WIDTH) {
|
|
176
|
+
const gap = Math.floor((inner - MIN_TAB_WIDTH * count) / (count - 1));
|
|
177
|
+
return {
|
|
178
|
+
tabWidth: MIN_TAB_WIDTH,
|
|
179
|
+
slotGap: Math.max(0, gap)
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
tabWidth: Math.max(0, widthAt(0)),
|
|
184
|
+
slotGap: 0
|
|
185
|
+
};
|
|
186
|
+
}, [
|
|
187
|
+
order.length,
|
|
188
|
+
surfaceWidth,
|
|
189
|
+
tabGap
|
|
190
|
+
]);
|
|
191
|
+
const slotLefts = useMemo(() => order.map((_, index) => SURFACE_INSET + index * (tabWidth + slotGap)), [
|
|
192
|
+
order,
|
|
193
|
+
slotGap,
|
|
194
|
+
tabWidth
|
|
195
|
+
]);
|
|
161
196
|
const dragStartIndex = draggingId ? order.indexOf(draggingId) : -1;
|
|
162
197
|
const visualIndexFor = useCallback((index) => {
|
|
163
198
|
if (dragStartIndex < 0 || dragTargetIndex < 0) return index;
|
|
@@ -225,7 +260,7 @@ function MorphingTabs({ items, value, defaultValue, onValueChange, onOrderChange
|
|
|
225
260
|
if (event.button !== 0 || itemMap.get(id)?.disabled || dragRef.current) return;
|
|
226
261
|
const startIndex = orderRef.current.indexOf(id);
|
|
227
262
|
if (startIndex < 0) return;
|
|
228
|
-
const capturedSlots = orderRef.current.map((_, index) => SURFACE_INSET + index * (
|
|
263
|
+
const capturedSlots = orderRef.current.map((_, index) => SURFACE_INSET + index * (tabWidth + slotGap));
|
|
229
264
|
const startLeft = capturedSlots[startIndex];
|
|
230
265
|
dragAnimationRef.current?.stop();
|
|
231
266
|
dragAnimationRef.current = null;
|
|
@@ -245,7 +280,8 @@ function MorphingTabs({ items, value, defaultValue, onValueChange, onOrderChange
|
|
|
245
280
|
}, [
|
|
246
281
|
dragLeft,
|
|
247
282
|
itemMap,
|
|
248
|
-
|
|
283
|
+
slotGap,
|
|
284
|
+
tabWidth
|
|
249
285
|
]);
|
|
250
286
|
const moveDrag = useCallback((event) => {
|
|
251
287
|
const drag = dragRef.current;
|
|
@@ -255,7 +291,7 @@ function MorphingTabs({ items, value, defaultValue, onValueChange, onOrderChange
|
|
|
255
291
|
event.preventDefault();
|
|
256
292
|
if (!drag.moved) {
|
|
257
293
|
drag.moved = true;
|
|
258
|
-
event.currentTarget
|
|
294
|
+
capturePointer(event.currentTarget, event.pointerId);
|
|
259
295
|
if (drag.id === activeId) {
|
|
260
296
|
surfaceAnimationRef.current?.stop();
|
|
261
297
|
surfaceLeft.set(drag.startLeft);
|
|
@@ -268,8 +304,8 @@ function MorphingTabs({ items, value, defaultValue, onValueChange, onOrderChange
|
|
|
268
304
|
const visualLeft = Math.max(minLeft, Math.min(maxLeft, drag.startLeft + delta));
|
|
269
305
|
let targetIndex = drag.startIndex;
|
|
270
306
|
if (visualLeft >= drag.startLeft) {
|
|
271
|
-
for (let index = drag.startIndex + 1; index < drag.slotLefts.length; index += 1) if (visualLeft +
|
|
272
|
-
} else for (let index = drag.startIndex - 1; index >= 0; index -= 1) if (visualLeft <= drag.slotLefts[index] +
|
|
307
|
+
for (let index = drag.startIndex + 1; index < drag.slotLefts.length; index += 1) if (visualLeft + tabWidth / 2 >= drag.slotLefts[index]) targetIndex = index;
|
|
308
|
+
} else for (let index = drag.startIndex - 1; index >= 0; index -= 1) if (visualLeft <= drag.slotLefts[index] + tabWidth / 2) targetIndex = index;
|
|
273
309
|
dragLeft.set(visualLeft);
|
|
274
310
|
if (targetIndex !== drag.targetIndex) {
|
|
275
311
|
drag.targetIndex = targetIndex;
|
|
@@ -278,7 +314,8 @@ function MorphingTabs({ items, value, defaultValue, onValueChange, onOrderChange
|
|
|
278
314
|
}, [
|
|
279
315
|
activeId,
|
|
280
316
|
dragLeft,
|
|
281
|
-
surfaceLeft
|
|
317
|
+
surfaceLeft,
|
|
318
|
+
tabWidth
|
|
282
319
|
]);
|
|
283
320
|
const finishDrag = useCallback((pointerId) => {
|
|
284
321
|
const drag = dragRef.current;
|
|
@@ -392,18 +429,22 @@ function MorphingTabs({ items, value, defaultValue, onValueChange, onOrderChange
|
|
|
392
429
|
anyDragging: Boolean(draggingId),
|
|
393
430
|
surfaceHost: rootRef.current,
|
|
394
431
|
surfaceWidth,
|
|
432
|
+
tabWidth,
|
|
395
433
|
surfaceClassName: classNames?.activeTab,
|
|
396
434
|
zIndex: isDragging ? 30 : isActive ? 20 : 1,
|
|
397
|
-
className: cn("group absolute top-0 left-0 flex touch-pan-y
|
|
435
|
+
className: cn("group absolute top-0 left-0 flex touch-pan-y items-stretch", TOUCH_GESTURE_CLASS, item.disabled && "cursor-not-allowed", isDragging ? "cursor-grabbing" : "cursor-grab"),
|
|
398
436
|
registerPosition,
|
|
399
437
|
onPointerDown: (event) => startDrag(item.id, event),
|
|
400
438
|
onPointerMove: moveDrag,
|
|
401
439
|
onPointerUp: (event) => finishDrag(event.pointerId),
|
|
402
440
|
onPointerCancel: (event) => finishDrag(event.pointerId),
|
|
403
|
-
onLostPointerCapture: (event) =>
|
|
441
|
+
onLostPointerCapture: (event) => {
|
|
442
|
+
if (event.target !== event.currentTarget) return;
|
|
443
|
+
finishDrag(event.pointerId);
|
|
444
|
+
},
|
|
404
445
|
children: /* @__PURE__ */ jsxs("div", {
|
|
405
446
|
style: {
|
|
406
|
-
width:
|
|
447
|
+
width: tabWidth,
|
|
407
448
|
height: TAB_HEIGHT,
|
|
408
449
|
marginTop: TAB_TOP
|
|
409
450
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morphing-tabs.js","names":["animateValue"],"sources":["../../../src/components/motion/morphing-tabs.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { X } from \"lucide-react\";\nimport {\n AnimatePresence,\n animate as animateValue,\n type MotionValue,\n motion,\n useMotionValue,\n useReducedMotion,\n useSpring,\n useTransform,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_GLIDE, SPRING_PRESS } from \"../../lib/ease\";\n\nexport type MorphingTabsItem = {\n id: string;\n label: string;\n icon?: ReactNode;\n content: ReactNode;\n disabled?: boolean;\n};\n\nexport type MorphingTabsClassNames = {\n root?: string;\n rail?: string;\n tab?: string;\n activeTab?: string;\n icon?: string;\n label?: string;\n close?: string;\n content?: string;\n};\n\nexport interface MorphingTabsProps {\n items: MorphingTabsItem[];\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (id: string | null) => void;\n /** Called once after a pointer drag or keyboard reorder completes. */\n onOrderChange?: (ids: string[]) => void;\n /** Enables the close affordance on every tab when provided. */\n onClose?: (id: string) => void;\n ariaLabel?: string;\n className?: string;\n classNames?: MorphingTabsClassNames;\n}\n\ntype DragSession = {\n id: string;\n pointerId: number;\n originX: number;\n startLeft: number;\n startIndex: number;\n targetIndex: number;\n moved: boolean;\n finishing: boolean;\n startOrder: string[];\n slotLefts: number[];\n};\n\ntype SpringTabProps = {\n id: string;\n targetLeft: number;\n dragging: boolean;\n dragLeft: MotionValue<number>;\n surfaceLeft: MotionValue<number>;\n reduce: boolean;\n active: boolean;\n anyDragging: boolean;\n surfaceHost: HTMLDivElement | null;\n surfaceWidth: number;\n surfaceClassName?: string;\n zIndex: number;\n className: string;\n children: ReactNode;\n registerPosition: (id: string, position: MotionValue<number> | null) => void;\n onPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;\n onPointerMove: (event: ReactPointerEvent<HTMLDivElement>) => void;\n onPointerUp: (event: ReactPointerEvent<HTMLDivElement>) => void;\n onPointerCancel: (event: ReactPointerEvent<HTMLDivElement>) => void;\n onLostPointerCapture: (event: ReactPointerEvent<HTMLDivElement>) => void;\n};\n\nconst DRAG_THRESHOLD = 5;\nconst TAB_WIDTH = 176;\nconst TAB_HEIGHT = 56;\nconst TAB_TOP = 24;\nconst TAB_RADIUS = 24;\nconst RAIL_HEIGHT = 80;\nconst SURFACE_INSET = 16;\nconst LIQUID_JOIN = 24;\nconst PANEL_RADIUS = 28;\n\nfunction sameOrder(a: string[], b: string[]) {\n return a.length === b.length && a.every((id, index) => id === b[index]);\n}\n\nfunction safeId(value: string) {\n return value.replace(/[^a-zA-Z0-9_-]/g, \"-\");\n}\n\nfunction moveItem(order: string[], from: number, to: number) {\n if (from === to) return order.slice();\n const next = order.slice();\n const [item] = next.splice(from, 1);\n next.splice(to, 0, item);\n return next;\n}\n\nfunction liquidTabPath(tabLeft: number, surfaceWidth: number) {\n const panelLeft = SURFACE_INSET;\n const panelRight = surfaceWidth - SURFACE_INSET;\n const left = Math.max(panelLeft, Math.min(panelRight - TAB_WIDTH, tabLeft));\n const right = left + TAB_WIDTH;\n const top = RAIL_HEIGHT - TAB_HEIGHT;\n const bottom = RAIL_HEIGHT;\n const leftJoin = Math.max(panelLeft, left - LIQUID_JOIN);\n const rightJoin = Math.min(panelRight, right + LIQUID_JOIN);\n const leftDepth = Math.min(LIQUID_JOIN, left - leftJoin);\n const rightDepth = Math.min(LIQUID_JOIN, rightJoin - right);\n const leftControl = leftDepth * 0.55;\n const rightControl = rightDepth * 0.55;\n const leftPanelRadius = Math.min(PANEL_RADIUS, leftJoin - panelLeft);\n const rightPanelRadius = Math.min(PANEL_RADIUS, panelRight - rightJoin);\n\n return [\n `M${panelLeft} ${bottom + PANEL_RADIUS}`,\n `V${bottom + leftPanelRadius}`,\n `Q${panelLeft} ${bottom} ${panelLeft + leftPanelRadius} ${bottom}`,\n `H${leftJoin}`,\n `C${leftJoin + leftControl} ${bottom} ${left} ${bottom - leftDepth + leftControl} ${left} ${bottom - leftDepth}`,\n `V${top + TAB_RADIUS}`,\n `Q${left} ${top} ${left + TAB_RADIUS} ${top}`,\n `H${right - TAB_RADIUS}`,\n `Q${right} ${top} ${right} ${top + TAB_RADIUS}`,\n `V${bottom - rightDepth}`,\n `C${right} ${bottom - rightDepth + rightControl} ${rightJoin - rightControl} ${bottom} ${rightJoin} ${bottom}`,\n `H${panelRight - rightPanelRadius}`,\n `Q${panelRight} ${bottom} ${panelRight} ${bottom + rightPanelRadius}`,\n `V${bottom + PANEL_RADIUS}`,\n \"Z\",\n ].join(\" \");\n}\n\nfunction SpringTab({\n id,\n targetLeft,\n dragging,\n dragLeft,\n surfaceLeft,\n reduce,\n active,\n anyDragging,\n surfaceHost,\n surfaceWidth,\n surfaceClassName,\n zIndex,\n className,\n children,\n registerPosition,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n onLostPointerCapture,\n}: SpringTabProps) {\n const target = useMotionValue(targetLeft);\n const position = useSpring(target, SPRING_GLIDE);\n const settledTransform = useTransform(\n reduce ? target : position,\n (left) => `translate3d(${left}px, 0, 0)`,\n );\n const draggedTransform = useTransform(dragLeft, (left) => `translate3d(${left}px, 0, 0)`);\n\n useLayoutEffect(() => {\n target.set(targetLeft);\n if (reduce) position.jump(targetLeft);\n }, [position, reduce, target, targetLeft]);\n\n useLayoutEffect(() => {\n registerPosition(id, position);\n return () => registerPosition(id, null);\n }, [id, position, registerPosition]);\n\n const liquidDriver = anyDragging ? (dragging ? dragLeft : position) : surfaceLeft;\n\n return (\n <>\n {active && surfaceHost && surfaceWidth > SURFACE_INSET * 2\n ? createPortal(\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox={`0 0 ${surfaceWidth} ${RAIL_HEIGHT + PANEL_RADIUS}`}\n preserveAspectRatio=\"none\"\n className={cn(\n \"pointer-events-none absolute inset-x-0 top-0 h-[108px] w-full text-[#fafaf8]\",\n dragging ? \"z-20\" : \"z-0\",\n surfaceClassName,\n )}\n >\n <LiquidSurfacePath\n key={anyDragging ? (dragging ? \"dragged\" : \"displaced\") : \"idle\"}\n left={liquidDriver}\n surfaceWidth={surfaceWidth}\n />\n </svg>,\n surfaceHost,\n )\n : null}\n <motion.div\n style={{\n zIndex,\n transform: dragging ? draggedTransform : settledTransform,\n }}\n className={className}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerCancel}\n onLostPointerCapture={onLostPointerCapture}\n >\n {children}\n </motion.div>\n </>\n );\n}\n\nfunction LiquidSurfacePath({\n left,\n surfaceWidth,\n}: {\n left: MotionValue<number>;\n surfaceWidth: number;\n}) {\n const path = useTransform(left, (value) => liquidTabPath(value, surfaceWidth));\n return <motion.path d={path} fill=\"currentColor\" />;\n}\n\nexport function MorphingTabs({\n items,\n value,\n defaultValue,\n onValueChange,\n onOrderChange,\n onClose,\n ariaLabel = \"Tabs\",\n className,\n classNames,\n}: MorphingTabsProps) {\n const reduce = Boolean(useReducedMotion());\n const uid = useId();\n const itemIds = useMemo(() => items.map((item) => item.id), [items]);\n const itemMap = useMemo(() => new Map(items.map((item) => [item.id, item])), [items]);\n const [order, setOrder] = useState(itemIds);\n const orderRef = useRef(order);\n orderRef.current = order;\n\n const [internalValue, setInternalValue] = useState<string | null>(\n defaultValue ?? itemIds[0] ?? null,\n );\n const controlled = value !== undefined;\n const currentValue = controlled ? (value ?? null) : internalValue;\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const railRef = useRef<HTMLDivElement | null>(null);\n const tabButtonRefs = useRef<Record<string, HTMLButtonElement | null>>({});\n const tabPositionRefs = useRef<Record<string, MotionValue<number> | null>>({});\n const dragRef = useRef<DragSession | null>(null);\n const dragAnimationRef = useRef<ReturnType<typeof animateValue> | null>(null);\n const surfaceAnimationRef = useRef<ReturnType<typeof animateValue> | null>(null);\n const [surfaceWidth, setSurfaceWidth] = useState(0);\n const [tabGap, setTabGap] = useState(12);\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dragTargetIndex, setDragTargetIndex] = useState(-1);\n const dragLeft = useMotionValue(SURFACE_INSET);\n const surfaceLeft = useMotionValue(SURFACE_INSET);\n\n useEffect(() => {\n setOrder((current) => {\n const available = new Set(itemIds);\n const retained = current.filter((id) => available.has(id));\n const retainedSet = new Set(retained);\n const added = itemIds.filter((id) => !retainedSet.has(id));\n const next = [...retained, ...added];\n return sameOrder(current, next) ? current : next;\n });\n }, [itemIds]);\n\n const orderedItems = useMemo(\n () =>\n order.flatMap((id) => {\n const item = itemMap.get(id);\n return item ? [item] : [];\n }),\n [itemMap, order],\n );\n\n const firstEnabledItem = orderedItems.find((item) => !item.disabled) ?? orderedItems[0] ?? null;\n const activeItem =\n currentValue && itemMap.has(currentValue)\n ? (itemMap.get(currentValue) ?? null)\n : firstEnabledItem;\n const activeId = activeItem?.id ?? null;\n\n const slotLefts = useMemo(\n () => order.map((_, index) => SURFACE_INSET + index * (TAB_WIDTH + tabGap)),\n [order, tabGap],\n );\n\n const dragStartIndex = draggingId ? order.indexOf(draggingId) : -1;\n\n const visualIndexFor = useCallback(\n (index: number) => {\n if (dragStartIndex < 0 || dragTargetIndex < 0) return index;\n if (index === dragStartIndex) return dragTargetIndex;\n\n if (dragTargetIndex > dragStartIndex && index > dragStartIndex && index <= dragTargetIndex) {\n return index - 1;\n }\n if (dragTargetIndex < dragStartIndex && index >= dragTargetIndex && index < dragStartIndex) {\n return index + 1;\n }\n return index;\n },\n [dragStartIndex, dragTargetIndex],\n );\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n const rail = railRef.current;\n if (!root || !rail) return;\n\n const measure = () => {\n setSurfaceWidth(root.clientWidth);\n const nextGap = Number.parseFloat(getComputedStyle(rail).columnGap);\n if (Number.isFinite(nextGap)) setTabGap(nextGap);\n };\n\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(root);\n return () => observer.disconnect();\n }, []);\n\n const setActive = useCallback(\n (id: string | null) => {\n if (id && itemMap.get(id)?.disabled) return;\n if (!controlled) setInternalValue(id);\n onValueChange?.(id);\n },\n [controlled, itemMap, onValueChange],\n );\n\n useEffect(() => {\n if (currentValue && itemMap.has(currentValue)) return;\n if (firstEnabledItem && firstEnabledItem.id !== currentValue) {\n setActive(firstEnabledItem.id);\n }\n }, [currentValue, firstEnabledItem, itemMap, setActive]);\n\n const activeOrderIndex = activeId ? order.indexOf(activeId) : -1;\n const activeVisualIndex = activeOrderIndex < 0 ? -1 : visualIndexFor(activeOrderIndex);\n\n useLayoutEffect(() => {\n if (\n !activeId ||\n activeVisualIndex < 0 ||\n activeId === draggingId ||\n !slotLefts[activeVisualIndex]\n ) {\n return;\n }\n\n surfaceAnimationRef.current?.stop();\n\n if (draggingId) return;\n\n surfaceAnimationRef.current = animateValue(\n surfaceLeft,\n slotLefts[activeVisualIndex],\n reduce ? { duration: 0 } : SPRING_GLIDE,\n );\n }, [activeId, activeVisualIndex, draggingId, reduce, slotLefts, surfaceLeft]);\n\n const commitOrder = useCallback(\n (next: string[], notify: boolean) => {\n orderRef.current = next;\n setOrder((current) => (sameOrder(current, next) ? current : next));\n if (notify) onOrderChange?.(next);\n },\n [onOrderChange],\n );\n\n const registerPosition = useCallback((id: string, position: MotionValue<number> | null) => {\n tabPositionRefs.current[id] = position;\n }, []);\n\n const startDrag = useCallback(\n (id: string, event: ReactPointerEvent<HTMLDivElement>) => {\n if (event.button !== 0 || itemMap.get(id)?.disabled || dragRef.current) {\n return;\n }\n\n const startIndex = orderRef.current.indexOf(id);\n if (startIndex < 0) return;\n const capturedSlots = orderRef.current.map(\n (_, index) => SURFACE_INSET + index * (TAB_WIDTH + tabGap),\n );\n const startLeft = capturedSlots[startIndex];\n\n dragAnimationRef.current?.stop();\n dragAnimationRef.current = null;\n dragLeft.set(startLeft);\n dragRef.current = {\n id,\n pointerId: event.pointerId,\n originX: event.clientX,\n startLeft,\n startIndex,\n targetIndex: startIndex,\n moved: false,\n finishing: false,\n startOrder: orderRef.current.slice(),\n slotLefts: capturedSlots,\n };\n },\n [dragLeft, itemMap, tabGap],\n );\n\n const moveDrag = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n const drag = dragRef.current;\n if (!drag || drag.finishing || drag.pointerId !== event.pointerId) return;\n\n const delta = event.clientX - drag.originX;\n if (!drag.moved && Math.abs(delta) < DRAG_THRESHOLD) return;\n event.preventDefault();\n\n if (!drag.moved) {\n drag.moved = true;\n event.currentTarget.setPointerCapture(event.pointerId);\n if (drag.id === activeId) {\n surfaceAnimationRef.current?.stop();\n surfaceLeft.set(drag.startLeft);\n }\n setDraggingId(drag.id);\n setDragTargetIndex(drag.startIndex);\n }\n\n const minLeft = drag.slotLefts[0];\n const maxLeft = drag.slotLefts[drag.slotLefts.length - 1];\n const visualLeft = Math.max(minLeft, Math.min(maxLeft, drag.startLeft + delta));\n let targetIndex = drag.startIndex;\n\n if (visualLeft >= drag.startLeft) {\n for (let index = drag.startIndex + 1; index < drag.slotLefts.length; index += 1) {\n if (visualLeft + TAB_WIDTH / 2 >= drag.slotLefts[index]) {\n targetIndex = index;\n }\n }\n } else {\n for (let index = drag.startIndex - 1; index >= 0; index -= 1) {\n if (visualLeft <= drag.slotLefts[index] + TAB_WIDTH / 2) {\n targetIndex = index;\n }\n }\n }\n\n dragLeft.set(visualLeft);\n if (targetIndex !== drag.targetIndex) {\n drag.targetIndex = targetIndex;\n setDragTargetIndex(targetIndex);\n }\n },\n [activeId, dragLeft, surfaceLeft],\n );\n\n const finishDrag = useCallback(\n (pointerId: number) => {\n const drag = dragRef.current;\n if (!drag || drag.pointerId !== pointerId || drag.finishing) return;\n\n if (!drag.moved) {\n dragRef.current = null;\n return;\n }\n\n drag.finishing = true;\n const targetLeft = drag.slotLefts[drag.targetIndex];\n const controls = animateValue(dragLeft, targetLeft, reduce ? { duration: 0 } : SPRING_GLIDE);\n dragAnimationRef.current = controls;\n\n controls.then(async () => {\n if (dragAnimationRef.current !== controls) return;\n const next = moveItem(drag.startOrder, drag.startIndex, drag.targetIndex);\n\n if (!reduce) {\n await new Promise<void>((resolve) => {\n const startedAt = performance.now();\n const check = () => {\n const settled = next.every((id, index) => {\n if (id === drag.id) return true;\n const position = tabPositionRefs.current[id];\n if (!position) return true;\n return (\n Math.abs(position.get() - drag.slotLefts[index]) < 0.5 &&\n Math.abs(position.getVelocity()) < 10\n );\n });\n\n if (settled || performance.now() - startedAt > 500) {\n resolve();\n return;\n }\n requestAnimationFrame(check);\n };\n check();\n });\n }\n\n if (dragAnimationRef.current !== controls) return;\n if (drag.id === activeId) {\n surfaceLeft.set(targetLeft);\n } else if (activeId) {\n const activePosition = tabPositionRefs.current[activeId];\n if (activePosition) surfaceLeft.set(activePosition.get());\n }\n tabPositionRefs.current[drag.id]?.jump(targetLeft);\n dragAnimationRef.current = null;\n dragRef.current = null;\n commitOrder(next, !sameOrder(drag.startOrder, next));\n setDraggingId(null);\n setDragTargetIndex(-1);\n });\n },\n [activeId, commitOrder, dragLeft, reduce, surfaceLeft],\n );\n\n useEffect(() => {\n const finishFromWindow = (event: PointerEvent) => {\n finishDrag(event.pointerId);\n };\n window.addEventListener(\"pointerup\", finishFromWindow, true);\n window.addEventListener(\"pointercancel\", finishFromWindow, true);\n return () => {\n window.removeEventListener(\"pointerup\", finishFromWindow, true);\n window.removeEventListener(\"pointercancel\", finishFromWindow, true);\n };\n }, [finishDrag]);\n\n const moveBy = useCallback(\n (id: string, direction: -1 | 1) => {\n const current = orderRef.current;\n const index = current.indexOf(id);\n const nextIndex = index + direction;\n if (index < 0 || nextIndex < 0 || nextIndex >= current.length || itemMap.get(id)?.disabled) {\n return;\n }\n commitOrder(moveItem(current, index, nextIndex), true);\n },\n [commitOrder, itemMap],\n );\n\n const handleTabKeyDown = useCallback(\n (id: string, event: React.KeyboardEvent<HTMLButtonElement>) => {\n const index = orderRef.current.indexOf(id);\n if (index < 0) return;\n\n if (event.altKey && (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\")) {\n event.preventDefault();\n moveBy(id, event.key === \"ArrowLeft\" ? -1 : 1);\n return;\n }\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return;\n\n event.preventDefault();\n const direction = event.key === \"ArrowLeft\" ? -1 : 1;\n const nextIndex = (index + direction + orderRef.current.length) % orderRef.current.length;\n const nextId = orderRef.current[nextIndex];\n setActive(nextId);\n requestAnimationFrame(() => tabButtonRefs.current[nextId]?.focus());\n },\n [moveBy, setActive],\n );\n\n if (!orderedItems.length) return null;\n\n return (\n <div\n ref={rootRef}\n className={cn(\n \"relative isolate min-w-0 overflow-hidden rounded-[2rem] bg-[#292929] text-white\",\n classNames?.root,\n className,\n )}\n >\n <div className=\"relative h-20\">\n <div\n ref={railRef}\n role=\"tablist\"\n aria-label={ariaLabel}\n aria-orientation=\"horizontal\"\n className={cn(\"relative z-30 flex h-full gap-3 md:gap-4\", classNames?.rail)}\n >\n {orderedItems.map((item, index) => {\n const isActive = item.id === activeId;\n const isDragging = item.id === draggingId;\n const visualIndex = visualIndexFor(index);\n const targetLeft = slotLefts[visualIndex] ?? SURFACE_INSET;\n const tabId = `${uid}-tab-${safeId(item.id)}`;\n\n return (\n <SpringTab\n key={item.id}\n id={item.id}\n targetLeft={targetLeft}\n dragging={isDragging}\n dragLeft={dragLeft}\n surfaceLeft={surfaceLeft}\n reduce={reduce}\n active={isActive}\n anyDragging={Boolean(draggingId)}\n surfaceHost={rootRef.current}\n surfaceWidth={surfaceWidth}\n surfaceClassName={classNames?.activeTab}\n zIndex={isDragging ? 30 : isActive ? 20 : 1}\n className={cn(\n \"group absolute top-0 left-0 flex touch-pan-y select-none items-stretch\",\n item.disabled && \"cursor-not-allowed\",\n isDragging ? \"cursor-grabbing\" : \"cursor-grab\",\n )}\n registerPosition={registerPosition}\n onPointerDown={(event) => startDrag(item.id, event)}\n onPointerMove={moveDrag}\n onPointerUp={(event) => finishDrag(event.pointerId)}\n onPointerCancel={(event) => finishDrag(event.pointerId)}\n onLostPointerCapture={(event) => finishDrag(event.pointerId)}\n >\n <div\n style={{\n width: TAB_WIDTH,\n height: TAB_HEIGHT,\n marginTop: TAB_TOP,\n }}\n className=\"relative flex items-stretch\"\n >\n {!isActive ? (\n <span\n aria-hidden\n className={cn(\n \"absolute inset-x-0 top-0 bottom-2 rounded-[1.25rem] transition-colors duration-200\",\n isDragging ? \"bg-[#3a3a3a]\" : \"bg-transparent group-hover:bg-white/[0.06]\",\n )}\n />\n ) : null}\n\n <button\n ref={(node) => {\n tabButtonRefs.current[item.id] = node;\n }}\n id={tabId}\n type=\"button\"\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={`${uid}-panel`}\n aria-disabled={item.disabled || undefined}\n tabIndex={isActive ? 0 : -1}\n disabled={item.disabled}\n onClick={() => {\n const drag = dragRef.current;\n if (drag?.id === item.id && drag.moved) return;\n setActive(item.id);\n }}\n onKeyDown={(event) => handleTabKeyDown(item.id, event)}\n className={cn(\n \"group relative z-10 flex h-full w-full min-w-0 items-center gap-2 overflow-hidden rounded-t-[1.5rem] px-3 text-left outline-none transition-colors\",\n isActive ? \"text-[#181818]\" : \"pb-2 text-white/70 hover:text-white\",\n classNames?.tab,\n )}\n >\n <span\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-x-1 top-1 opacity-0 transition-opacity group-focus-visible:opacity-100\",\n isActive\n ? \"bottom-0 rounded-t-[1.25rem] border-black/20 border-x-2 border-t-2\"\n : \"bottom-2 rounded-[1rem] border-2 border-white/60\",\n )}\n />\n {item.icon ? (\n <span\n aria-hidden\n className={cn(\"grid size-8 shrink-0 place-items-center\", classNames?.icon)}\n >\n {item.icon}\n </span>\n ) : null}\n <span\n className={cn(\n \"min-w-0 truncate whitespace-nowrap font-medium text-base leading-none tracking-[-0.025em]\",\n classNames?.label,\n )}\n >\n {item.label}\n </span>\n </button>\n\n {onClose ? (\n <button\n type=\"button\"\n aria-label={`Close ${item.label}`}\n onPointerDown={(event) => event.stopPropagation()}\n onClick={(event) => {\n event.stopPropagation();\n onClose(item.id);\n }}\n className={cn(\n \"absolute top-1/2 right-2 z-20 grid size-6 -translate-y-1/2 place-items-center rounded-full text-[#9aa0a8] transition-colors hover:bg-black/[0.06] hover:text-[#4b5563] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current\",\n !isActive &&\n \"top-[calc(50%-4px)] text-white/45 hover:bg-white/[0.08] hover:text-white/80\",\n classNames?.close,\n )}\n >\n <X aria-hidden className=\"size-3.5 stroke-[1.5]\" />\n </button>\n ) : null}\n </div>\n </SpringTab>\n );\n })}\n </div>\n </div>\n\n <div\n id={`${uid}-panel`}\n role=\"tabpanel\"\n aria-labelledby={`${uid}-tab-${safeId(activeId ?? \"empty\")}`}\n className={cn(\n \"relative z-20 mx-4 min-h-64 overflow-hidden rounded-[1.75rem] bg-[#fafaf8] text-[#181818]\",\n classNames?.content,\n )}\n >\n <AnimatePresence mode=\"popLayout\" initial={false}>\n {activeItem ? (\n <motion.div\n key={activeItem.id}\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 8, filter: \"blur(6px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n exit={\n reduce\n ? {\n opacity: 0,\n transition: { duration: 0.08, ease: EASE_OUT },\n }\n : {\n opacity: 0,\n y: -5,\n filter: \"blur(5px)\",\n transition: { duration: 0.12, ease: EASE_OUT },\n }\n }\n transition={reduce ? { duration: 0.12, ease: EASE_OUT } : SPRING_PRESS}\n className=\"min-h-64\"\n >\n {activeItem.content}\n </motion.div>\n ) : null}\n </AnimatePresence>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAkGA,MAAM,iBAAiB;AACvB,MAAM,YAAY;AAClB,MAAM,aAAa;AACnB,MAAM,UAAU;AAChB,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,gBAAgB;AACtB,MAAM,cAAc;AACpB,MAAM,eAAe;AAErB,SAAS,UAAU,GAAa,GAAa;CAC3C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,IAAI,UAAU,OAAO,EAAE,MAAM;AACxE;AAEA,SAAS,OAAO,OAAe;CAC7B,OAAO,MAAM,QAAQ,mBAAmB,GAAG;AAC7C;AAEA,SAAS,SAAS,OAAiB,MAAc,IAAY;CAC3D,IAAI,SAAS,IAAI,OAAO,MAAM,MAAM;CACpC,MAAM,OAAO,MAAM,MAAM;CACzB,MAAM,CAAC,QAAQ,KAAK,OAAO,MAAM,CAAC;CAClC,KAAK,OAAO,IAAI,GAAG,IAAI;CACvB,OAAO;AACT;AAEA,SAAS,cAAc,SAAiB,cAAsB;CAC5D,MAAM,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IAAI,OAAO,OAAO,YAAY,OAAO;GACzD,WAAW,GACT,6FACA,YAAY,OACd;GAEA,UAAA,oBAAC,iBAAD;IAAiB,MAAK;IAAY,SAAS;IACxC,UAAA,aACC,oBAAC,OAAO,KAAR;KAEE,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;MAAE,SAAS;MAAG,GAAG;MAAG,QAAQ;KAAY;KAC3E,SAAS;MAAE,SAAS;MAAG,GAAG;MAAG,QAAQ;KAAY;KACjD,MACE,SACI;MACE,SAAS;MACT,YAAY;OAAE,UAAU;OAAM,MAAM;MAAS;KAC/C,IACA;MACE,SAAS;MACT,GAAG;MACH,QAAQ;MACR,YAAY;OAAE,UAAU;OAAM,MAAM;MAAS;KAC/C;KAEN,YAAY,SAAS;MAAE,UAAU;MAAM,MAAM;KAAS,IAAI;KAC1D,WAAU;KAET,UAAA,WAAW;IACF,GApBL,WAAW,EAoBN,IACV;GACW,CAAA;EACd,CAAA,CACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"morphing-tabs.js","names":["animateValue"],"sources":["../../../src/components/motion/morphing-tabs.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { X } from \"lucide-react\";\nimport {\n AnimatePresence,\n animate as animateValue,\n type MotionValue,\n motion,\n useMotionValue,\n useReducedMotion,\n useSpring,\n useTransform,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_GLIDE, SPRING_PRESS } from \"../../lib/ease\";\nimport { capturePointer, TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\nexport type MorphingTabsItem = {\n id: string;\n label: string;\n icon?: ReactNode;\n content: ReactNode;\n disabled?: boolean;\n};\n\nexport type MorphingTabsClassNames = {\n root?: string;\n rail?: string;\n tab?: string;\n activeTab?: string;\n icon?: string;\n label?: string;\n close?: string;\n content?: string;\n};\n\nexport interface MorphingTabsProps {\n items: MorphingTabsItem[];\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (id: string | null) => void;\n /** Called once after a pointer drag or keyboard reorder completes. */\n onOrderChange?: (ids: string[]) => void;\n /** Enables the close affordance on every tab when provided. */\n onClose?: (id: string) => void;\n ariaLabel?: string;\n className?: string;\n classNames?: MorphingTabsClassNames;\n}\n\ntype DragSession = {\n id: string;\n pointerId: number;\n originX: number;\n startLeft: number;\n startIndex: number;\n targetIndex: number;\n moved: boolean;\n finishing: boolean;\n startOrder: string[];\n slotLefts: number[];\n};\n\ntype SpringTabProps = {\n id: string;\n targetLeft: number;\n dragging: boolean;\n dragLeft: MotionValue<number>;\n surfaceLeft: MotionValue<number>;\n reduce: boolean;\n active: boolean;\n anyDragging: boolean;\n surfaceHost: HTMLDivElement | null;\n surfaceWidth: number;\n tabWidth: number;\n surfaceClassName?: string;\n zIndex: number;\n className: string;\n children: ReactNode;\n registerPosition: (id: string, position: MotionValue<number> | null) => void;\n onPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;\n onPointerMove: (event: ReactPointerEvent<HTMLDivElement>) => void;\n onPointerUp: (event: ReactPointerEvent<HTMLDivElement>) => void;\n onPointerCancel: (event: ReactPointerEvent<HTMLDivElement>) => void;\n onLostPointerCapture: (event: ReactPointerEvent<HTMLDivElement>) => void;\n};\n\nconst DRAG_THRESHOLD = 5;\n// The design width of a tab, and the narrowest it may shrink to before the\n// label stops reading. See `tabWidth` in MorphingTabs.\nconst MAX_TAB_WIDTH = 176;\nconst MIN_TAB_WIDTH = 96;\nconst TAB_HEIGHT = 56;\nconst TAB_TOP = 24;\nconst TAB_RADIUS = 24;\nconst RAIL_HEIGHT = 80;\nconst SURFACE_INSET = 16;\nconst LIQUID_JOIN = 24;\nconst PANEL_RADIUS = 28;\n\nfunction sameOrder(a: string[], b: string[]) {\n return a.length === b.length && a.every((id, index) => id === b[index]);\n}\n\nfunction safeId(value: string) {\n return value.replace(/[^a-zA-Z0-9_-]/g, \"-\");\n}\n\nfunction moveItem(order: string[], from: number, to: number) {\n if (from === to) return order.slice();\n const next = order.slice();\n const [item] = next.splice(from, 1);\n next.splice(to, 0, item);\n return next;\n}\n\nfunction liquidTabPath(tabLeft: number, surfaceWidth: number, tabWidth: number) {\n const panelLeft = SURFACE_INSET;\n const panelRight = surfaceWidth - SURFACE_INSET;\n const left = Math.max(panelLeft, Math.min(panelRight - tabWidth, tabLeft));\n const right = left + tabWidth;\n const top = RAIL_HEIGHT - TAB_HEIGHT;\n const bottom = RAIL_HEIGHT;\n const leftJoin = Math.max(panelLeft, left - LIQUID_JOIN);\n const rightJoin = Math.min(panelRight, right + LIQUID_JOIN);\n const leftDepth = Math.min(LIQUID_JOIN, left - leftJoin);\n const rightDepth = Math.min(LIQUID_JOIN, rightJoin - right);\n const leftControl = leftDepth * 0.55;\n const rightControl = rightDepth * 0.55;\n const leftPanelRadius = Math.min(PANEL_RADIUS, leftJoin - panelLeft);\n const rightPanelRadius = Math.min(PANEL_RADIUS, panelRight - rightJoin);\n\n return [\n `M${panelLeft} ${bottom + PANEL_RADIUS}`,\n `V${bottom + leftPanelRadius}`,\n `Q${panelLeft} ${bottom} ${panelLeft + leftPanelRadius} ${bottom}`,\n `H${leftJoin}`,\n `C${leftJoin + leftControl} ${bottom} ${left} ${bottom - leftDepth + leftControl} ${left} ${bottom - leftDepth}`,\n `V${top + TAB_RADIUS}`,\n `Q${left} ${top} ${left + TAB_RADIUS} ${top}`,\n `H${right - TAB_RADIUS}`,\n `Q${right} ${top} ${right} ${top + TAB_RADIUS}`,\n `V${bottom - rightDepth}`,\n `C${right} ${bottom - rightDepth + rightControl} ${rightJoin - rightControl} ${bottom} ${rightJoin} ${bottom}`,\n `H${panelRight - rightPanelRadius}`,\n `Q${panelRight} ${bottom} ${panelRight} ${bottom + rightPanelRadius}`,\n `V${bottom + PANEL_RADIUS}`,\n \"Z\",\n ].join(\" \");\n}\n\nfunction SpringTab({\n id,\n targetLeft,\n dragging,\n dragLeft,\n surfaceLeft,\n reduce,\n active,\n anyDragging,\n surfaceHost,\n surfaceWidth,\n tabWidth,\n surfaceClassName,\n zIndex,\n className,\n children,\n registerPosition,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n onLostPointerCapture,\n}: SpringTabProps) {\n const target = useMotionValue(targetLeft);\n const position = useSpring(target, SPRING_GLIDE);\n const settledTransform = useTransform(\n reduce ? target : position,\n (left) => `translate3d(${left}px, 0, 0)`,\n );\n const draggedTransform = useTransform(dragLeft, (left) => `translate3d(${left}px, 0, 0)`);\n\n useLayoutEffect(() => {\n target.set(targetLeft);\n if (reduce) position.jump(targetLeft);\n }, [position, reduce, target, targetLeft]);\n\n useLayoutEffect(() => {\n registerPosition(id, position);\n return () => registerPosition(id, null);\n }, [id, position, registerPosition]);\n\n const liquidDriver = anyDragging ? (dragging ? dragLeft : position) : surfaceLeft;\n\n return (\n <>\n {active && surfaceHost && surfaceWidth > SURFACE_INSET * 2\n ? createPortal(\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox={`0 0 ${surfaceWidth} ${RAIL_HEIGHT + PANEL_RADIUS}`}\n preserveAspectRatio=\"none\"\n className={cn(\n \"pointer-events-none absolute inset-x-0 top-0 h-[108px] w-full text-[#fafaf8]\",\n dragging ? \"z-20\" : \"z-0\",\n surfaceClassName,\n )}\n >\n <LiquidSurfacePath\n key={anyDragging ? (dragging ? \"dragged\" : \"displaced\") : \"idle\"}\n left={liquidDriver}\n surfaceWidth={surfaceWidth}\n tabWidth={tabWidth}\n />\n </svg>,\n surfaceHost,\n )\n : null}\n <motion.div\n style={{\n zIndex,\n transform: dragging ? draggedTransform : settledTransform,\n }}\n className={className}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerCancel}\n onLostPointerCapture={onLostPointerCapture}\n >\n {children}\n </motion.div>\n </>\n );\n}\n\nfunction LiquidSurfacePath({\n left,\n surfaceWidth,\n tabWidth,\n}: {\n left: MotionValue<number>;\n surfaceWidth: number;\n tabWidth: number;\n}) {\n const path = useTransform(left, (value) => liquidTabPath(value, surfaceWidth, tabWidth));\n return <motion.path d={path} fill=\"currentColor\" />;\n}\n\nexport function MorphingTabs({\n items,\n value,\n defaultValue,\n onValueChange,\n onOrderChange,\n onClose,\n ariaLabel = \"Tabs\",\n className,\n classNames,\n}: MorphingTabsProps) {\n const reduce = Boolean(useReducedMotion());\n const uid = useId();\n const itemIds = useMemo(() => items.map((item) => item.id), [items]);\n const itemMap = useMemo(() => new Map(items.map((item) => [item.id, item])), [items]);\n const [order, setOrder] = useState(itemIds);\n const orderRef = useRef(order);\n orderRef.current = order;\n\n const [internalValue, setInternalValue] = useState<string | null>(\n defaultValue ?? itemIds[0] ?? null,\n );\n const controlled = value !== undefined;\n const currentValue = controlled ? (value ?? null) : internalValue;\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const railRef = useRef<HTMLDivElement | null>(null);\n const tabButtonRefs = useRef<Record<string, HTMLButtonElement | null>>({});\n const tabPositionRefs = useRef<Record<string, MotionValue<number> | null>>({});\n const dragRef = useRef<DragSession | null>(null);\n const dragAnimationRef = useRef<ReturnType<typeof animateValue> | null>(null);\n const surfaceAnimationRef = useRef<ReturnType<typeof animateValue> | null>(null);\n const [surfaceWidth, setSurfaceWidth] = useState(0);\n const [tabGap, setTabGap] = useState(12);\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dragTargetIndex, setDragTargetIndex] = useState(-1);\n const dragLeft = useMotionValue(SURFACE_INSET);\n const surfaceLeft = useMotionValue(SURFACE_INSET);\n\n useEffect(() => {\n setOrder((current) => {\n const available = new Set(itemIds);\n const retained = current.filter((id) => available.has(id));\n const retainedSet = new Set(retained);\n const added = itemIds.filter((id) => !retainedSet.has(id));\n const next = [...retained, ...added];\n return sameOrder(current, next) ? current : next;\n });\n }, [itemIds]);\n\n const orderedItems = useMemo(\n () =>\n order.flatMap((id) => {\n const item = itemMap.get(id);\n return item ? [item] : [];\n }),\n [itemMap, order],\n );\n\n const firstEnabledItem = orderedItems.find((item) => !item.disabled) ?? orderedItems[0] ?? null;\n const activeItem =\n currentValue && itemMap.has(currentValue)\n ? (itemMap.get(currentValue) ?? null)\n : firstEnabledItem;\n const activeId = activeItem?.id ?? null;\n\n // The rail cannot scroll: the liquid surface is one continuous shape spanning\n // the panel, so its notch has to stay over the tab that cut it. Slots narrow\n // to fit the panel instead, in that order of sacrifice:\n // 1. the design width, down to a floor where a truncated label still reads;\n // 2. the gap between slots, so the floor survives one panel narrower;\n // 3. the floor itself — a cramped tab is still tappable, a clipped one is\n // not reachable at all.\n // Every tier fits inside the panel by construction, so no tab is ever cut off\n // and the notch never has to be clamped away from the tab that cut it.\n const { tabWidth, slotGap } = useMemo(() => {\n const count = order.length;\n if (!surfaceWidth || count === 0) {\n return { tabWidth: MAX_TAB_WIDTH, slotGap: tabGap };\n }\n const inner = surfaceWidth - SURFACE_INSET * 2;\n const widthAt = (gap: number) => Math.floor((inner - gap * (count - 1)) / count);\n\n if (widthAt(tabGap) >= MIN_TAB_WIDTH) {\n return {\n tabWidth: Math.min(MAX_TAB_WIDTH, widthAt(tabGap)),\n slotGap: tabGap,\n };\n }\n if (count > 1 && widthAt(0) >= MIN_TAB_WIDTH) {\n const gap = Math.floor((inner - MIN_TAB_WIDTH * count) / (count - 1));\n return { tabWidth: MIN_TAB_WIDTH, slotGap: Math.max(0, gap) };\n }\n return { tabWidth: Math.max(0, widthAt(0)), slotGap: 0 };\n }, [order.length, surfaceWidth, tabGap]);\n\n const slotLefts = useMemo(\n () => order.map((_, index) => SURFACE_INSET + index * (tabWidth + slotGap)),\n [order, slotGap, tabWidth],\n );\n\n const dragStartIndex = draggingId ? order.indexOf(draggingId) : -1;\n\n const visualIndexFor = useCallback(\n (index: number) => {\n if (dragStartIndex < 0 || dragTargetIndex < 0) return index;\n if (index === dragStartIndex) return dragTargetIndex;\n\n if (dragTargetIndex > dragStartIndex && index > dragStartIndex && index <= dragTargetIndex) {\n return index - 1;\n }\n if (dragTargetIndex < dragStartIndex && index >= dragTargetIndex && index < dragStartIndex) {\n return index + 1;\n }\n return index;\n },\n [dragStartIndex, dragTargetIndex],\n );\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n const rail = railRef.current;\n if (!root || !rail) return;\n\n const measure = () => {\n setSurfaceWidth(root.clientWidth);\n const nextGap = Number.parseFloat(getComputedStyle(rail).columnGap);\n if (Number.isFinite(nextGap)) setTabGap(nextGap);\n };\n\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(root);\n return () => observer.disconnect();\n }, []);\n\n const setActive = useCallback(\n (id: string | null) => {\n if (id && itemMap.get(id)?.disabled) return;\n if (!controlled) setInternalValue(id);\n onValueChange?.(id);\n },\n [controlled, itemMap, onValueChange],\n );\n\n useEffect(() => {\n if (currentValue && itemMap.has(currentValue)) return;\n if (firstEnabledItem && firstEnabledItem.id !== currentValue) {\n setActive(firstEnabledItem.id);\n }\n }, [currentValue, firstEnabledItem, itemMap, setActive]);\n\n const activeOrderIndex = activeId ? order.indexOf(activeId) : -1;\n const activeVisualIndex = activeOrderIndex < 0 ? -1 : visualIndexFor(activeOrderIndex);\n\n useLayoutEffect(() => {\n if (\n !activeId ||\n activeVisualIndex < 0 ||\n activeId === draggingId ||\n !slotLefts[activeVisualIndex]\n ) {\n return;\n }\n\n surfaceAnimationRef.current?.stop();\n\n if (draggingId) return;\n\n surfaceAnimationRef.current = animateValue(\n surfaceLeft,\n slotLefts[activeVisualIndex],\n reduce ? { duration: 0 } : SPRING_GLIDE,\n );\n }, [activeId, activeVisualIndex, draggingId, reduce, slotLefts, surfaceLeft]);\n\n const commitOrder = useCallback(\n (next: string[], notify: boolean) => {\n orderRef.current = next;\n setOrder((current) => (sameOrder(current, next) ? current : next));\n if (notify) onOrderChange?.(next);\n },\n [onOrderChange],\n );\n\n const registerPosition = useCallback((id: string, position: MotionValue<number> | null) => {\n tabPositionRefs.current[id] = position;\n }, []);\n\n const startDrag = useCallback(\n (id: string, event: ReactPointerEvent<HTMLDivElement>) => {\n if (event.button !== 0 || itemMap.get(id)?.disabled || dragRef.current) {\n return;\n }\n\n const startIndex = orderRef.current.indexOf(id);\n if (startIndex < 0) return;\n const capturedSlots = orderRef.current.map(\n (_, index) => SURFACE_INSET + index * (tabWidth + slotGap),\n );\n const startLeft = capturedSlots[startIndex];\n\n dragAnimationRef.current?.stop();\n dragAnimationRef.current = null;\n dragLeft.set(startLeft);\n dragRef.current = {\n id,\n pointerId: event.pointerId,\n originX: event.clientX,\n startLeft,\n startIndex,\n targetIndex: startIndex,\n moved: false,\n finishing: false,\n startOrder: orderRef.current.slice(),\n slotLefts: capturedSlots,\n };\n },\n [dragLeft, itemMap, slotGap, tabWidth],\n );\n\n const moveDrag = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n const drag = dragRef.current;\n if (!drag || drag.finishing || drag.pointerId !== event.pointerId) return;\n\n const delta = event.clientX - drag.originX;\n if (!drag.moved && Math.abs(delta) < DRAG_THRESHOLD) return;\n event.preventDefault();\n\n if (!drag.moved) {\n drag.moved = true;\n capturePointer(event.currentTarget, event.pointerId);\n if (drag.id === activeId) {\n surfaceAnimationRef.current?.stop();\n surfaceLeft.set(drag.startLeft);\n }\n setDraggingId(drag.id);\n setDragTargetIndex(drag.startIndex);\n }\n\n const minLeft = drag.slotLefts[0];\n const maxLeft = drag.slotLefts[drag.slotLefts.length - 1];\n const visualLeft = Math.max(minLeft, Math.min(maxLeft, drag.startLeft + delta));\n let targetIndex = drag.startIndex;\n\n if (visualLeft >= drag.startLeft) {\n for (let index = drag.startIndex + 1; index < drag.slotLefts.length; index += 1) {\n if (visualLeft + tabWidth / 2 >= drag.slotLefts[index]) {\n targetIndex = index;\n }\n }\n } else {\n for (let index = drag.startIndex - 1; index >= 0; index -= 1) {\n if (visualLeft <= drag.slotLefts[index] + tabWidth / 2) {\n targetIndex = index;\n }\n }\n }\n\n dragLeft.set(visualLeft);\n if (targetIndex !== drag.targetIndex) {\n drag.targetIndex = targetIndex;\n setDragTargetIndex(targetIndex);\n }\n },\n [activeId, dragLeft, surfaceLeft, tabWidth],\n );\n\n const finishDrag = useCallback(\n (pointerId: number) => {\n const drag = dragRef.current;\n if (!drag || drag.pointerId !== pointerId || drag.finishing) return;\n\n if (!drag.moved) {\n dragRef.current = null;\n return;\n }\n\n drag.finishing = true;\n const targetLeft = drag.slotLefts[drag.targetIndex];\n const controls = animateValue(dragLeft, targetLeft, reduce ? { duration: 0 } : SPRING_GLIDE);\n dragAnimationRef.current = controls;\n\n controls.then(async () => {\n if (dragAnimationRef.current !== controls) return;\n const next = moveItem(drag.startOrder, drag.startIndex, drag.targetIndex);\n\n if (!reduce) {\n await new Promise<void>((resolve) => {\n const startedAt = performance.now();\n const check = () => {\n const settled = next.every((id, index) => {\n if (id === drag.id) return true;\n const position = tabPositionRefs.current[id];\n if (!position) return true;\n return (\n Math.abs(position.get() - drag.slotLefts[index]) < 0.5 &&\n Math.abs(position.getVelocity()) < 10\n );\n });\n\n if (settled || performance.now() - startedAt > 500) {\n resolve();\n return;\n }\n requestAnimationFrame(check);\n };\n check();\n });\n }\n\n if (dragAnimationRef.current !== controls) return;\n if (drag.id === activeId) {\n surfaceLeft.set(targetLeft);\n } else if (activeId) {\n const activePosition = tabPositionRefs.current[activeId];\n if (activePosition) surfaceLeft.set(activePosition.get());\n }\n tabPositionRefs.current[drag.id]?.jump(targetLeft);\n dragAnimationRef.current = null;\n dragRef.current = null;\n commitOrder(next, !sameOrder(drag.startOrder, next));\n setDraggingId(null);\n setDragTargetIndex(-1);\n });\n },\n [activeId, commitOrder, dragLeft, reduce, surfaceLeft],\n );\n\n useEffect(() => {\n const finishFromWindow = (event: PointerEvent) => {\n finishDrag(event.pointerId);\n };\n window.addEventListener(\"pointerup\", finishFromWindow, true);\n window.addEventListener(\"pointercancel\", finishFromWindow, true);\n return () => {\n window.removeEventListener(\"pointerup\", finishFromWindow, true);\n window.removeEventListener(\"pointercancel\", finishFromWindow, true);\n };\n }, [finishDrag]);\n\n const moveBy = useCallback(\n (id: string, direction: -1 | 1) => {\n const current = orderRef.current;\n const index = current.indexOf(id);\n const nextIndex = index + direction;\n if (index < 0 || nextIndex < 0 || nextIndex >= current.length || itemMap.get(id)?.disabled) {\n return;\n }\n commitOrder(moveItem(current, index, nextIndex), true);\n },\n [commitOrder, itemMap],\n );\n\n const handleTabKeyDown = useCallback(\n (id: string, event: React.KeyboardEvent<HTMLButtonElement>) => {\n const index = orderRef.current.indexOf(id);\n if (index < 0) return;\n\n if (event.altKey && (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\")) {\n event.preventDefault();\n moveBy(id, event.key === \"ArrowLeft\" ? -1 : 1);\n return;\n }\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return;\n\n event.preventDefault();\n const direction = event.key === \"ArrowLeft\" ? -1 : 1;\n const nextIndex = (index + direction + orderRef.current.length) % orderRef.current.length;\n const nextId = orderRef.current[nextIndex];\n setActive(nextId);\n requestAnimationFrame(() => tabButtonRefs.current[nextId]?.focus());\n },\n [moveBy, setActive],\n );\n\n if (!orderedItems.length) return null;\n\n return (\n <div\n ref={rootRef}\n className={cn(\n \"relative isolate min-w-0 overflow-hidden rounded-[2rem] bg-[#292929] text-white\",\n classNames?.root,\n className,\n )}\n >\n <div className=\"relative h-20\">\n <div\n ref={railRef}\n role=\"tablist\"\n aria-label={ariaLabel}\n aria-orientation=\"horizontal\"\n className={cn(\"relative z-30 flex h-full gap-3 md:gap-4\", classNames?.rail)}\n >\n {orderedItems.map((item, index) => {\n const isActive = item.id === activeId;\n const isDragging = item.id === draggingId;\n const visualIndex = visualIndexFor(index);\n const targetLeft = slotLefts[visualIndex] ?? SURFACE_INSET;\n const tabId = `${uid}-tab-${safeId(item.id)}`;\n\n return (\n <SpringTab\n key={item.id}\n id={item.id}\n targetLeft={targetLeft}\n dragging={isDragging}\n dragLeft={dragLeft}\n surfaceLeft={surfaceLeft}\n reduce={reduce}\n active={isActive}\n anyDragging={Boolean(draggingId)}\n surfaceHost={rootRef.current}\n surfaceWidth={surfaceWidth}\n tabWidth={tabWidth}\n surfaceClassName={classNames?.activeTab}\n zIndex={isDragging ? 30 : isActive ? 20 : 1}\n className={cn(\n // The drag is ours end to end, so iPadOS must not answer the\n // press with its callout or a native drag of the label.\n \"group absolute top-0 left-0 flex touch-pan-y items-stretch\",\n TOUCH_GESTURE_CLASS,\n item.disabled && \"cursor-not-allowed\",\n isDragging ? \"cursor-grabbing\" : \"cursor-grab\",\n )}\n registerPosition={registerPosition}\n onPointerDown={(event) => startDrag(item.id, event)}\n onPointerMove={moveDrag}\n onPointerUp={(event) => finishDrag(event.pointerId)}\n onPointerCancel={(event) => finishDrag(event.pointerId)}\n // A touch is implicitly captured by whatever it landed on —\n // here the label inside the tab — so the moment the drag takes\n // the capture for the tab itself, that child *loses* it, and\n // the notification bubbles straight back up to this handler.\n // Ending the drag on it kills the gesture on the frame it\n // starts. Only the tab losing its own capture means the\n // platform took the pointer away. A mouse has no implicit\n // capture, which is why this only ever bit on a real finger.\n onLostPointerCapture={(event) => {\n if (event.target !== event.currentTarget) return;\n finishDrag(event.pointerId);\n }}\n >\n <div\n style={{\n width: tabWidth,\n height: TAB_HEIGHT,\n marginTop: TAB_TOP,\n }}\n className=\"relative flex items-stretch\"\n >\n {!isActive ? (\n <span\n aria-hidden\n className={cn(\n \"absolute inset-x-0 top-0 bottom-2 rounded-[1.25rem] transition-colors duration-200\",\n isDragging ? \"bg-[#3a3a3a]\" : \"bg-transparent group-hover:bg-white/[0.06]\",\n )}\n />\n ) : null}\n\n <button\n ref={(node) => {\n tabButtonRefs.current[item.id] = node;\n }}\n id={tabId}\n type=\"button\"\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={`${uid}-panel`}\n aria-disabled={item.disabled || undefined}\n tabIndex={isActive ? 0 : -1}\n disabled={item.disabled}\n onClick={() => {\n const drag = dragRef.current;\n if (drag?.id === item.id && drag.moved) return;\n setActive(item.id);\n }}\n onKeyDown={(event) => handleTabKeyDown(item.id, event)}\n className={cn(\n \"group relative z-10 flex h-full w-full min-w-0 items-center gap-2 overflow-hidden rounded-t-[1.5rem] px-3 text-left outline-none transition-colors\",\n isActive ? \"text-[#181818]\" : \"pb-2 text-white/70 hover:text-white\",\n classNames?.tab,\n )}\n >\n <span\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-x-1 top-1 opacity-0 transition-opacity group-focus-visible:opacity-100\",\n isActive\n ? \"bottom-0 rounded-t-[1.25rem] border-black/20 border-x-2 border-t-2\"\n : \"bottom-2 rounded-[1rem] border-2 border-white/60\",\n )}\n />\n {item.icon ? (\n <span\n aria-hidden\n className={cn(\"grid size-8 shrink-0 place-items-center\", classNames?.icon)}\n >\n {item.icon}\n </span>\n ) : null}\n <span\n className={cn(\n \"min-w-0 truncate whitespace-nowrap font-medium text-base leading-none tracking-[-0.025em]\",\n classNames?.label,\n )}\n >\n {item.label}\n </span>\n </button>\n\n {onClose ? (\n <button\n type=\"button\"\n aria-label={`Close ${item.label}`}\n onPointerDown={(event) => event.stopPropagation()}\n onClick={(event) => {\n event.stopPropagation();\n onClose(item.id);\n }}\n className={cn(\n \"absolute top-1/2 right-2 z-20 grid size-6 -translate-y-1/2 place-items-center rounded-full text-[#9aa0a8] transition-colors hover:bg-black/[0.06] hover:text-[#4b5563] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current\",\n !isActive &&\n \"top-[calc(50%-4px)] text-white/45 hover:bg-white/[0.08] hover:text-white/80\",\n classNames?.close,\n )}\n >\n <X aria-hidden className=\"size-3.5 stroke-[1.5]\" />\n </button>\n ) : null}\n </div>\n </SpringTab>\n );\n })}\n </div>\n </div>\n\n <div\n id={`${uid}-panel`}\n role=\"tabpanel\"\n aria-labelledby={`${uid}-tab-${safeId(activeId ?? \"empty\")}`}\n className={cn(\n \"relative z-20 mx-4 min-h-64 overflow-hidden rounded-[1.75rem] bg-[#fafaf8] text-[#181818]\",\n classNames?.content,\n )}\n >\n <AnimatePresence mode=\"popLayout\" initial={false}>\n {activeItem ? (\n <motion.div\n key={activeItem.id}\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 8, filter: \"blur(6px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n exit={\n reduce\n ? {\n opacity: 0,\n transition: { duration: 0.08, ease: EASE_OUT },\n }\n : {\n opacity: 0,\n y: -5,\n filter: \"blur(5px)\",\n transition: { duration: 0.12, ease: EASE_OUT },\n }\n }\n transition={reduce ? { duration: 0.12, ease: EASE_OUT } : SPRING_PRESS}\n className=\"min-h-64\"\n >\n {activeItem.content}\n </motion.div>\n ) : null}\n </AnimatePresence>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAoGA,MAAM,iBAAiB;AAGvB,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;AACtB,MAAM,aAAa;AACnB,MAAM,UAAU;AAChB,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,gBAAgB;AACtB,MAAM,cAAc;AACpB,MAAM,eAAe;AAErB,SAAS,UAAU,GAAa,GAAa;CAC3C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,IAAI,UAAU,OAAO,EAAE,MAAM;AACxE;AAEA,SAAS,OAAO,OAAe;CAC7B,OAAO,MAAM,QAAQ,mBAAmB,GAAG;AAC7C;AAEA,SAAS,SAAS,OAAiB,MAAc,IAAY;CAC3D,IAAI,SAAS,IAAI,OAAO,MAAM,MAAM;CACpC,MAAM,OAAO,MAAM,MAAM;CACzB,MAAM,CAAC,QAAQ,KAAK,OAAO,MAAM,CAAC;CAClC,KAAK,OAAO,IAAI,GAAG,IAAI;CACvB,OAAO;AACT;AAEA,SAAS,cAAc,SAAiB,cAAsB,UAAkB;CAC9E,MAAM,YAAY;CAClB,MAAM,aAAa,eAAe;CAClC,MAAM,OAAO,KAAK,IAAI,WAAW,KAAK,IA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IACF,GApBL,WAAW,EAoBN,IACV;GACW,CAAA;EACd,CAAA,CACF;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-stack.d.ts","names":[],"sources":["../../../src/components/motion/notification-stack.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"notification-stack.d.ts","names":[],"sources":["../../../src/components/motion/notification-stack.tsx"],"mappings":";;KAqBY;EACV;EACA,OAAO;EACP,cAAc;EACd,WAAW;;KAGD;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA;EACA,oBAAoB;EACpB;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;;iBA0DC,oBACd,OACA,UACA,iBACA,kBACA,WACA,YACA,gBACA,eACA,YACA,WACA,cACC,yCAAsB,IAAA"}
|