@zentauri-ui/zentauri-components 1.7.2 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -6
- package/cli/registry.json +2 -0
- package/dist/chunk-KEKMMNL5.mjs +600 -0
- package/dist/chunk-KEKMMNL5.mjs.map +1 -0
- package/dist/chunk-NZDHSIIC.js +616 -0
- package/dist/chunk-NZDHSIIC.js.map +1 -0
- package/dist/design-system/command.d.ts +41 -0
- package/dist/design-system/command.d.ts.map +1 -0
- package/dist/design-system/index.d.ts +2 -0
- package/dist/design-system/index.d.ts.map +1 -1
- package/dist/design-system/otp-input.d.ts +27 -0
- package/dist/design-system/otp-input.d.ts.map +1 -0
- package/dist/ui/command/animated/animations.d.ts +3 -0
- package/dist/ui/command/animated/animations.d.ts.map +1 -0
- package/dist/ui/command/animated/command-content-animated.d.ts +6 -0
- package/dist/ui/command/animated/command-content-animated.d.ts.map +1 -0
- package/dist/ui/command/animated/index.d.ts +4 -0
- package/dist/ui/command/animated/index.d.ts.map +1 -0
- package/dist/ui/command/animated/types.d.ts +9 -0
- package/dist/ui/command/animated/types.d.ts.map +1 -0
- package/dist/ui/command/animated.js +92 -0
- package/dist/ui/command/animated.js.map +1 -0
- package/dist/ui/command/animated.mjs +89 -0
- package/dist/ui/command/animated.mjs.map +1 -0
- package/dist/ui/command/command-base.d.ts +53 -0
- package/dist/ui/command/command-base.d.ts.map +1 -0
- package/dist/ui/command/command.d.ts +6 -0
- package/dist/ui/command/command.d.ts.map +1 -0
- package/dist/ui/command/index.d.ts +5 -0
- package/dist/ui/command/index.d.ts.map +1 -0
- package/dist/ui/command/types.d.ts +111 -0
- package/dist/ui/command/types.d.ts.map +1 -0
- package/dist/ui/command/variants.d.ts +15 -0
- package/dist/ui/command/variants.d.ts.map +1 -0
- package/dist/ui/command.js +69 -0
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/command.mjs +16 -0
- package/dist/ui/command.mjs.map +1 -0
- package/dist/ui/otp-input/index.d.ts +4 -0
- package/dist/ui/otp-input/index.d.ts.map +1 -0
- package/dist/ui/otp-input/otp-input.d.ts +6 -0
- package/dist/ui/otp-input/otp-input.d.ts.map +1 -0
- package/dist/ui/otp-input/types.d.ts +23 -0
- package/dist/ui/otp-input/types.d.ts.map +1 -0
- package/dist/ui/otp-input/variants.d.ts +5 -0
- package/dist/ui/otp-input/variants.d.ts.map +1 -0
- package/dist/ui/otp-input.js +302 -0
- package/dist/ui/otp-input.js.map +1 -0
- package/dist/ui/otp-input.mjs +299 -0
- package/dist/ui/otp-input.mjs.map +1 -0
- package/package.json +1 -1
- package/src/design-system/command.ts +80 -0
- package/src/design-system/index.ts +2 -0
- package/src/design-system/otp-input.ts +50 -0
- package/src/ui/command/animated/animations.ts +29 -0
- package/src/ui/command/animated/command-content-animated.tsx +58 -0
- package/src/ui/command/animated/index.ts +10 -0
- package/src/ui/command/animated/types.ts +23 -0
- package/src/ui/command/command-base.tsx +660 -0
- package/src/ui/command/command.test.tsx +130 -0
- package/src/ui/command/command.tsx +8 -0
- package/src/ui/command/index.ts +34 -0
- package/src/ui/command/types.ts +129 -0
- package/src/ui/command/variants.ts +41 -0
- package/src/ui/otp-input/index.ts +9 -0
- package/src/ui/otp-input/otp-input.test.tsx +99 -0
- package/src/ui/otp-input/otp-input.tsx +327 -0
- package/src/ui/otp-input/types.ts +32 -0
- package/src/ui/otp-input/variants.ts +18 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CommandAnimationPresets } from "./types";
|
|
2
|
+
|
|
3
|
+
export const commandOverlayAnimationPresets: CommandAnimationPresets = {
|
|
4
|
+
none: {},
|
|
5
|
+
fade: {
|
|
6
|
+
initial: { opacity: 0 },
|
|
7
|
+
animate: { opacity: 1 },
|
|
8
|
+
exit: { opacity: 0 },
|
|
9
|
+
transition: { duration: 0.18 },
|
|
10
|
+
},
|
|
11
|
+
scale: {
|
|
12
|
+
initial: { opacity: 0, scale: 0.97 },
|
|
13
|
+
animate: { opacity: 1, scale: 1 },
|
|
14
|
+
exit: { opacity: 0, scale: 0.97 },
|
|
15
|
+
transition: { type: "spring", stiffness: 440, damping: 34 },
|
|
16
|
+
},
|
|
17
|
+
"slide-down": {
|
|
18
|
+
initial: { opacity: 0, y: -20 },
|
|
19
|
+
animate: { opacity: 1, y: 0 },
|
|
20
|
+
exit: { opacity: 0, y: -12 },
|
|
21
|
+
transition: { type: "spring", stiffness: 420, damping: 32 },
|
|
22
|
+
},
|
|
23
|
+
"slide-up": {
|
|
24
|
+
initial: { opacity: 0, y: 20 },
|
|
25
|
+
animate: { opacity: 1, y: 0 },
|
|
26
|
+
exit: { opacity: 0, y: 12 },
|
|
27
|
+
transition: { type: "spring", stiffness: 420, damping: 32 },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
|
|
4
|
+
|
|
5
|
+
import { commandOverlayAnimationPresets } from "./animations";
|
|
6
|
+
import type { CommandContentAnimatedProps } from "./types";
|
|
7
|
+
import { CommandContentLayer } from "../command-base";
|
|
8
|
+
|
|
9
|
+
export function CommandContentAnimated({
|
|
10
|
+
className,
|
|
11
|
+
size,
|
|
12
|
+
appearance,
|
|
13
|
+
animation = "slide-down",
|
|
14
|
+
children,
|
|
15
|
+
ref,
|
|
16
|
+
id,
|
|
17
|
+
style,
|
|
18
|
+
}: CommandContentAnimatedProps) {
|
|
19
|
+
const reduceMotion = useReducedMotion();
|
|
20
|
+
const overlayMotion = commandOverlayAnimationPresets.fade;
|
|
21
|
+
const panelMotion =
|
|
22
|
+
commandOverlayAnimationPresets[reduceMotion ? "fade" : animation];
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<CommandContentLayer
|
|
26
|
+
appearance={appearance}
|
|
27
|
+
className={className}
|
|
28
|
+
componentName="CommandContent"
|
|
29
|
+
id={id}
|
|
30
|
+
ref={ref}
|
|
31
|
+
renderOverlay={(overlayProps) => (
|
|
32
|
+
<motion.div
|
|
33
|
+
{...overlayProps}
|
|
34
|
+
initial={overlayMotion.initial}
|
|
35
|
+
animate={overlayMotion.animate}
|
|
36
|
+
exit={overlayMotion.exit}
|
|
37
|
+
transition={overlayMotion.transition}
|
|
38
|
+
/>
|
|
39
|
+
)}
|
|
40
|
+
renderPanel={(panelProps) => (
|
|
41
|
+
<motion.div
|
|
42
|
+
{...panelProps}
|
|
43
|
+
initial={animation === "none" ? false : panelMotion.initial}
|
|
44
|
+
animate={animation === "none" ? undefined : panelMotion.animate}
|
|
45
|
+
exit={animation === "none" ? undefined : panelMotion.exit}
|
|
46
|
+
transition={panelMotion.transition}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
renderPresence={(content) => <AnimatePresence>{content}</AnimatePresence>}
|
|
50
|
+
size={size}
|
|
51
|
+
style={style}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
</CommandContentLayer>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
CommandContentAnimated.displayName = "CommandContent";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
export { CommandContentAnimated } from "./command-content-animated";
|
|
4
|
+
export type {
|
|
5
|
+
CommandContentAnimatedProps,
|
|
6
|
+
CommandAnimation,
|
|
7
|
+
CommandAnimationPresets,
|
|
8
|
+
CommandPresetMotionProps,
|
|
9
|
+
} from "./types";
|
|
10
|
+
export { commandOverlayAnimationPresets } from "./animations";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLMotionProps } from "framer-motion";
|
|
2
|
+
import type { CommandContentProps } from "../types";
|
|
3
|
+
|
|
4
|
+
export type CommandAnimation =
|
|
5
|
+
| "none"
|
|
6
|
+
| "fade"
|
|
7
|
+
| "scale"
|
|
8
|
+
| "slide-down"
|
|
9
|
+
| "slide-up";
|
|
10
|
+
|
|
11
|
+
export type CommandContentAnimatedProps = CommandContentProps & {
|
|
12
|
+
animation?: CommandAnimation;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type CommandPresetMotionProps = Pick<
|
|
16
|
+
HTMLMotionProps<"div">,
|
|
17
|
+
"initial" | "animate" | "exit" | "transition"
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
export type CommandAnimationPresets = Record<
|
|
21
|
+
CommandAnimation,
|
|
22
|
+
CommandPresetMotionProps
|
|
23
|
+
>;
|