@vvedantb/ui 0.62.0 → 0.62.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/ui/tabs-transition.js +41 -26
- package/package.json +1 -1
- package/src/ui/tabs-transition.tsx +13 -1
|
@@ -71,12 +71,13 @@ const variants = {
|
|
|
71
71
|
* reducedMotion` and page-motion off stop the slide.
|
|
72
72
|
*/
|
|
73
73
|
export function TabsTransition(t0) {
|
|
74
|
-
const $ = _c(
|
|
74
|
+
const $ = _c(20);
|
|
75
75
|
const {
|
|
76
76
|
value,
|
|
77
77
|
order,
|
|
78
78
|
variant: variantProp,
|
|
79
79
|
className,
|
|
80
|
+
panelClassName,
|
|
80
81
|
children
|
|
81
82
|
} = t0;
|
|
82
83
|
const configVariant = useUiConfig("Tabs")?.transition;
|
|
@@ -89,31 +90,44 @@ export function TabsTransition(t0) {
|
|
|
89
90
|
}
|
|
90
91
|
if (variant === "none") {
|
|
91
92
|
let t1;
|
|
92
|
-
if ($[0] !== children || $[1] !==
|
|
93
|
+
if ($[0] !== children || $[1] !== panelClassName) {
|
|
93
94
|
t1 = /*#__PURE__*/_jsx("div", {
|
|
94
|
-
className:
|
|
95
|
+
className: panelClassName,
|
|
95
96
|
children: children
|
|
96
97
|
});
|
|
97
98
|
$[0] = children;
|
|
98
|
-
$[1] =
|
|
99
|
+
$[1] = panelClassName;
|
|
99
100
|
$[2] = t1;
|
|
100
101
|
} else {
|
|
101
102
|
t1 = $[2];
|
|
102
103
|
}
|
|
103
|
-
|
|
104
|
+
let t2;
|
|
105
|
+
if ($[3] !== className || $[4] !== t1) {
|
|
106
|
+
t2 = /*#__PURE__*/_jsx("div", {
|
|
107
|
+
className: className,
|
|
108
|
+
children: t1
|
|
109
|
+
});
|
|
110
|
+
$[3] = className;
|
|
111
|
+
$[4] = t1;
|
|
112
|
+
$[5] = t2;
|
|
113
|
+
} else {
|
|
114
|
+
t2 = $[5];
|
|
115
|
+
}
|
|
116
|
+
return t2;
|
|
104
117
|
}
|
|
105
118
|
let t1;
|
|
106
|
-
if ($[
|
|
119
|
+
if ($[6] !== className) {
|
|
107
120
|
t1 = cn("relative overflow-x-clip", className);
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
121
|
+
$[6] = className;
|
|
122
|
+
$[7] = t1;
|
|
110
123
|
} else {
|
|
111
|
-
t1 = $[
|
|
124
|
+
t1 = $[7];
|
|
112
125
|
}
|
|
113
126
|
const t2 = variants[variant];
|
|
114
127
|
let t3;
|
|
115
|
-
if ($[
|
|
128
|
+
if ($[8] !== children || $[9] !== direction || $[10] !== panelClassName || $[11] !== t2 || $[12] !== value) {
|
|
116
129
|
t3 = /*#__PURE__*/_jsx(m.div, {
|
|
130
|
+
className: panelClassName,
|
|
117
131
|
custom: direction,
|
|
118
132
|
variants: t2,
|
|
119
133
|
initial: "enter",
|
|
@@ -121,39 +135,40 @@ export function TabsTransition(t0) {
|
|
|
121
135
|
exit: "exit",
|
|
122
136
|
children: children
|
|
123
137
|
}, value);
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
138
|
+
$[8] = children;
|
|
139
|
+
$[9] = direction;
|
|
140
|
+
$[10] = panelClassName;
|
|
141
|
+
$[11] = t2;
|
|
142
|
+
$[12] = value;
|
|
143
|
+
$[13] = t3;
|
|
129
144
|
} else {
|
|
130
|
-
t3 = $[
|
|
145
|
+
t3 = $[13];
|
|
131
146
|
}
|
|
132
147
|
let t4;
|
|
133
|
-
if ($[
|
|
148
|
+
if ($[14] !== direction || $[15] !== t3) {
|
|
134
149
|
t4 = /*#__PURE__*/_jsx(AnimatePresence, {
|
|
135
150
|
initial: false,
|
|
136
151
|
custom: direction,
|
|
137
152
|
mode: "popLayout",
|
|
138
153
|
children: t3
|
|
139
154
|
});
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
155
|
+
$[14] = direction;
|
|
156
|
+
$[15] = t3;
|
|
157
|
+
$[16] = t4;
|
|
143
158
|
} else {
|
|
144
|
-
t4 = $[
|
|
159
|
+
t4 = $[16];
|
|
145
160
|
}
|
|
146
161
|
let t5;
|
|
147
|
-
if ($[
|
|
162
|
+
if ($[17] !== t1 || $[18] !== t4) {
|
|
148
163
|
t5 = /*#__PURE__*/_jsx("div", {
|
|
149
164
|
className: t1,
|
|
150
165
|
children: t4
|
|
151
166
|
});
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
167
|
+
$[17] = t1;
|
|
168
|
+
$[18] = t4;
|
|
169
|
+
$[19] = t5;
|
|
155
170
|
} else {
|
|
156
|
-
t5 = $[
|
|
171
|
+
t5 = $[19];
|
|
157
172
|
}
|
|
158
173
|
return t5;
|
|
159
174
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvedantb/ui",
|
|
3
|
-
"version": "0.62.
|
|
3
|
+
"version": "0.62.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared React 19 UI for web apps: one main JavaScript entry (primitives, shell pieces, app helpers including the Convex and Clerk provider, VITE env parsing and ensure-user, artifact viewers over the @vvedantb/server artifacts core, native tokens), third-party brand logos (also @vvedantb/ui/logos), motion-driven animated SVG icons (@vvedantb/ui/icons/animated), a client entry without @vvedantb/server, convex or Clerk for Chrome extensions, design-token CSS, shared Tailwind v4 CSS, a Tailwind preset and packaged Instrument Sans fonts.",
|
|
6
6
|
"type": "module",
|
|
@@ -51,6 +51,12 @@ export interface TabsTransitionProps {
|
|
|
51
51
|
/** Defaults to the app's `UiConfig.Tabs.transition`, then `"none"`. */
|
|
52
52
|
variant?: TabsTransitionVariant;
|
|
53
53
|
className?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Classes on the moving panel. Full-height layouts pass the same flex
|
|
56
|
+
* classes as their container (`flex min-h-0 flex-1 flex-col`) so the panel
|
|
57
|
+
* still fills it.
|
|
58
|
+
*/
|
|
59
|
+
panelClassName?: string;
|
|
54
60
|
/** The selected tab's content. */
|
|
55
61
|
children: ReactNode;
|
|
56
62
|
}
|
|
@@ -67,6 +73,7 @@ export function TabsTransition({
|
|
|
67
73
|
order,
|
|
68
74
|
variant: variantProp,
|
|
69
75
|
className,
|
|
76
|
+
panelClassName,
|
|
70
77
|
children,
|
|
71
78
|
}: TabsTransitionProps) {
|
|
72
79
|
const configVariant = useUiConfig("Tabs")?.transition;
|
|
@@ -81,7 +88,11 @@ export function TabsTransition({
|
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
if (variant === "none") {
|
|
84
|
-
return
|
|
91
|
+
return (
|
|
92
|
+
<div className={className}>
|
|
93
|
+
<div className={panelClassName}>{children}</div>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
return (
|
|
@@ -89,6 +100,7 @@ export function TabsTransition({
|
|
|
89
100
|
<AnimatePresence initial={false} custom={direction} mode="popLayout">
|
|
90
101
|
<m.div
|
|
91
102
|
key={value}
|
|
103
|
+
className={panelClassName}
|
|
92
104
|
custom={direction}
|
|
93
105
|
variants={variants[variant]}
|
|
94
106
|
initial="enter"
|