@zentauri-ui/zentauri-components 1.7.5 → 1.7.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/README.md +11 -6
- package/cli/registry.json +3 -0
- package/dist/chunk-DEZRB6DS.mjs +83 -0
- package/dist/chunk-DEZRB6DS.mjs.map +1 -0
- package/dist/chunk-GRJFGIZC.mjs +417 -0
- package/dist/chunk-GRJFGIZC.mjs.map +1 -0
- package/dist/chunk-QHEHBC6M.js +421 -0
- package/dist/chunk-QHEHBC6M.js.map +1 -0
- package/dist/chunk-V5JTDRV5.mjs +278 -0
- package/dist/chunk-V5JTDRV5.mjs.map +1 -0
- package/dist/chunk-Z4KHAD6Y.js +295 -0
- package/dist/chunk-Z4KHAD6Y.js.map +1 -0
- package/dist/chunk-ZX2IBIZT.js +92 -0
- package/dist/chunk-ZX2IBIZT.js.map +1 -0
- package/dist/design-system/context-menu.d.ts +41 -0
- package/dist/design-system/context-menu.d.ts.map +1 -0
- package/dist/design-system/index.d.ts +3 -0
- package/dist/design-system/index.d.ts.map +1 -1
- package/dist/design-system/timeline.d.ts +56 -0
- package/dist/design-system/timeline.d.ts.map +1 -0
- package/dist/design-system/tree-view.d.ts +66 -0
- package/dist/design-system/tree-view.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu.d.ts +11 -0
- package/dist/ui/context-menu/context-menu.d.ts.map +1 -0
- package/dist/ui/context-menu/index.d.ts +4 -0
- package/dist/ui/context-menu/index.d.ts.map +1 -0
- package/dist/ui/context-menu/types.d.ts +81 -0
- package/dist/ui/context-menu/types.d.ts.map +1 -0
- package/dist/ui/context-menu/variants.d.ts +7 -0
- package/dist/ui/context-menu/variants.d.ts.map +1 -0
- package/dist/ui/context-menu.js +500 -0
- package/dist/ui/context-menu.js.map +1 -0
- package/dist/ui/context-menu.mjs +488 -0
- package/dist/ui/context-menu.mjs.map +1 -0
- package/dist/ui/dropdown.js +9 -89
- package/dist/ui/dropdown.js.map +1 -1
- package/dist/ui/dropdown.mjs +1 -81
- package/dist/ui/dropdown.mjs.map +1 -1
- package/dist/ui/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/ui/scroll-area.js.map +1 -1
- package/dist/ui/scroll-area.mjs.map +1 -1
- package/dist/ui/timeline/animated/animations.d.ts +8 -0
- package/dist/ui/timeline/animated/animations.d.ts.map +1 -0
- package/dist/ui/timeline/animated/index.d.ts +6 -0
- package/dist/ui/timeline/animated/index.d.ts.map +1 -0
- package/dist/ui/timeline/animated/timeline-item-animated.d.ts +8 -0
- package/dist/ui/timeline/animated/timeline-item-animated.d.ts.map +1 -0
- package/dist/ui/timeline/animated/types.d.ts +12 -0
- package/dist/ui/timeline/animated/types.d.ts.map +1 -0
- package/dist/ui/timeline/animated.js +94 -0
- package/dist/ui/timeline/animated.js.map +1 -0
- package/dist/ui/timeline/animated.mjs +71 -0
- package/dist/ui/timeline/animated.mjs.map +1 -0
- package/dist/ui/timeline/index.d.ts +4 -0
- package/dist/ui/timeline/index.d.ts.map +1 -0
- package/dist/ui/timeline/timeline-base.d.ts +37 -0
- package/dist/ui/timeline/timeline-base.d.ts.map +1 -0
- package/dist/ui/timeline/timeline.d.ts +8 -0
- package/dist/ui/timeline/timeline.d.ts.map +1 -0
- package/dist/ui/timeline/types.d.ts +38 -0
- package/dist/ui/timeline/types.d.ts.map +1 -0
- package/dist/ui/timeline/variants.d.ts +19 -0
- package/dist/ui/timeline/variants.d.ts.map +1 -0
- package/dist/ui/timeline.js +63 -0
- package/dist/ui/timeline.js.map +1 -0
- package/dist/ui/timeline.mjs +14 -0
- package/dist/ui/timeline.mjs.map +1 -0
- package/dist/ui/tree-view/animated/animations.d.ts +6 -0
- package/dist/ui/tree-view/animated/animations.d.ts.map +1 -0
- package/dist/ui/tree-view/animated/index.d.ts +5 -0
- package/dist/ui/tree-view/animated/index.d.ts.map +1 -0
- package/dist/ui/tree-view/animated/tree-view-animated.d.ts +6 -0
- package/dist/ui/tree-view/animated/tree-view-animated.d.ts.map +1 -0
- package/dist/ui/tree-view/animated/types.d.ts +6 -0
- package/dist/ui/tree-view/animated/types.d.ts.map +1 -0
- package/dist/ui/tree-view/animated.js +53 -0
- package/dist/ui/tree-view/animated.js.map +1 -0
- package/dist/ui/tree-view/animated.mjs +50 -0
- package/dist/ui/tree-view/animated.mjs.map +1 -0
- package/dist/ui/tree-view/index.d.ts +5 -0
- package/dist/ui/tree-view/index.d.ts.map +1 -0
- package/dist/ui/tree-view/tree-view-base.d.ts +15 -0
- package/dist/ui/tree-view/tree-view-base.d.ts.map +1 -0
- package/dist/ui/tree-view/tree-view.d.ts +6 -0
- package/dist/ui/tree-view/tree-view.d.ts.map +1 -0
- package/dist/ui/tree-view/types.d.ts +61 -0
- package/dist/ui/tree-view/types.d.ts.map +1 -0
- package/dist/ui/tree-view/variants.d.ts +9 -0
- package/dist/ui/tree-view/variants.d.ts.map +1 -0
- package/dist/ui/tree-view.js +27 -0
- package/dist/ui/tree-view.js.map +1 -0
- package/dist/ui/tree-view.mjs +14 -0
- package/dist/ui/tree-view.mjs.map +1 -0
- package/package.json +1 -1
- package/src/design-system/context-menu.ts +44 -0
- package/src/design-system/index.ts +3 -0
- package/src/design-system/timeline.ts +87 -0
- package/src/design-system/tree-view.ts +113 -0
- package/src/ui/context-menu/context-menu.test.tsx +176 -0
- package/src/ui/context-menu/context-menu.tsx +536 -0
- package/src/ui/context-menu/index.ts +29 -0
- package/src/ui/context-menu/types.ts +110 -0
- package/src/ui/context-menu/variants.ts +26 -0
- package/src/ui/scroll-area/scroll-area.tsx +0 -2
- package/src/ui/timeline/animated/animations.ts +16 -0
- package/src/ui/timeline/animated/index.ts +22 -0
- package/src/ui/timeline/animated/timeline-item-animated.tsx +76 -0
- package/src/ui/timeline/animated/types.ts +21 -0
- package/src/ui/timeline/index.ts +30 -0
- package/src/ui/timeline/timeline-base.tsx +232 -0
- package/src/ui/timeline/timeline.test.tsx +262 -0
- package/src/ui/timeline/timeline.tsx +24 -0
- package/src/ui/timeline/types.ts +61 -0
- package/src/ui/timeline/variants.ts +60 -0
- package/src/ui/tree-view/animated/animations.ts +13 -0
- package/src/ui/tree-view/animated/index.ts +6 -0
- package/src/ui/tree-view/animated/tree-view-animated.tsx +52 -0
- package/src/ui/tree-view/animated/types.ts +6 -0
- package/src/ui/tree-view/index.ts +13 -0
- package/src/ui/tree-view/tree-view-base.tsx +496 -0
- package/src/ui/tree-view/tree-view.test.tsx +136 -0
- package/src/ui/tree-view/tree-view.tsx +9 -0
- package/src/ui/tree-view/types.ts +68 -0
- package/src/ui/tree-view/variants.ts +32 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import type {
|
|
3
|
+
ComponentPropsWithRef,
|
|
4
|
+
ComponentPropsWithoutRef,
|
|
5
|
+
ReactNode,
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
import type { TimelineTransition } from "./animated/animations";
|
|
9
|
+
import type {
|
|
10
|
+
timelineIndicatorVariants,
|
|
11
|
+
timelineVariants,
|
|
12
|
+
} from "./variants";
|
|
13
|
+
|
|
14
|
+
export type { TimelineTransition };
|
|
15
|
+
|
|
16
|
+
type TimelineVariantProps = VariantProps<typeof timelineVariants>;
|
|
17
|
+
|
|
18
|
+
export type TimelineAppearance = NonNullable<
|
|
19
|
+
VariantProps<typeof timelineIndicatorVariants>["appearance"]
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export type TimelineSize = NonNullable<
|
|
23
|
+
VariantProps<typeof timelineIndicatorVariants>["size"]
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export type TimelineProps = TimelineVariantProps & {
|
|
27
|
+
/** Default indicator appearance applied to every item (overridable per indicator). */
|
|
28
|
+
appearance?: TimelineAppearance;
|
|
29
|
+
/** Controls indicator size, content spacing, and text scale. */
|
|
30
|
+
size?: TimelineSize;
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
} & Omit<ComponentPropsWithRef<"ol">, "children">;
|
|
33
|
+
|
|
34
|
+
export type TimelineItemProps = ComponentPropsWithRef<"li"> & {
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type TimelineIndicatorProps = ComponentPropsWithoutRef<"div"> & {
|
|
39
|
+
/** Override the appearance inherited from the Timeline root. */
|
|
40
|
+
appearance?: TimelineAppearance;
|
|
41
|
+
children?: ReactNode;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type TimelineContentProps = ComponentPropsWithoutRef<"div"> & {
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type TimelineTitleProps = ComponentPropsWithoutRef<"div">;
|
|
49
|
+
|
|
50
|
+
export type TimelineDescriptionProps = ComponentPropsWithoutRef<"p">;
|
|
51
|
+
|
|
52
|
+
export type TimelineCtx = {
|
|
53
|
+
appearance: TimelineAppearance;
|
|
54
|
+
size: TimelineSize;
|
|
55
|
+
total: number;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type TimelineItemCtx = {
|
|
59
|
+
index: number;
|
|
60
|
+
isLast: boolean;
|
|
61
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
zuiTimelineBase,
|
|
5
|
+
zuiTimelineConnectorBase,
|
|
6
|
+
zuiTimelineConnectorSizes,
|
|
7
|
+
zuiTimelineContentBase,
|
|
8
|
+
zuiTimelineContentSizes,
|
|
9
|
+
zuiTimelineDescriptionBase,
|
|
10
|
+
zuiTimelineDescriptionSizes,
|
|
11
|
+
zuiTimelineIndicatorAppearances,
|
|
12
|
+
zuiTimelineIndicatorBase,
|
|
13
|
+
zuiTimelineIndicatorSizes,
|
|
14
|
+
zuiTimelineItemBase,
|
|
15
|
+
zuiTimelineTitleBase,
|
|
16
|
+
zuiTimelineTitleSizes,
|
|
17
|
+
} from "../../design-system/timeline";
|
|
18
|
+
|
|
19
|
+
export const timelineVariants = cva(zuiTimelineBase);
|
|
20
|
+
|
|
21
|
+
export const timelineItemVariants = cva(zuiTimelineItemBase);
|
|
22
|
+
|
|
23
|
+
export const timelineConnectorVariants = cva(zuiTimelineConnectorBase, {
|
|
24
|
+
variants: {
|
|
25
|
+
size: zuiTimelineConnectorSizes,
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: { size: "md" },
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const timelineIndicatorVariants = cva(zuiTimelineIndicatorBase, {
|
|
31
|
+
variants: {
|
|
32
|
+
appearance: zuiTimelineIndicatorAppearances,
|
|
33
|
+
size: zuiTimelineIndicatorSizes,
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
appearance: "default",
|
|
37
|
+
size: "md",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const timelineContentVariants = cva(zuiTimelineContentBase, {
|
|
42
|
+
variants: {
|
|
43
|
+
size: zuiTimelineContentSizes,
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: { size: "md" },
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const timelineTitleVariants = cva(zuiTimelineTitleBase, {
|
|
49
|
+
variants: {
|
|
50
|
+
size: zuiTimelineTitleSizes,
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: { size: "md" },
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const timelineDescriptionVariants = cva(zuiTimelineDescriptionBase, {
|
|
56
|
+
variants: {
|
|
57
|
+
size: zuiTimelineDescriptionSizes,
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: { size: "md" },
|
|
60
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Transition } from "framer-motion";
|
|
2
|
+
|
|
3
|
+
/** Easing and duration presets for tree group expand/collapse. */
|
|
4
|
+
export type TreeViewTransition = "none" | "default" | "smooth" | "slow";
|
|
5
|
+
|
|
6
|
+
export type TreeViewTransitionPresets = Record<TreeViewTransition, Transition>;
|
|
7
|
+
|
|
8
|
+
export const treeViewTransitionPresets: TreeViewTransitionPresets = {
|
|
9
|
+
none: { duration: 0 },
|
|
10
|
+
default: { duration: 0.2, ease: [0.4, 0, 0.2, 1] },
|
|
11
|
+
smooth: { duration: 0.28, ease: [0.22, 1, 0.36, 1] },
|
|
12
|
+
slow: { duration: 0.38, ease: [0.4, 0, 0.2, 1] },
|
|
13
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
5
|
+
|
|
6
|
+
import { TreeViewBase } from "../tree-view-base";
|
|
7
|
+
import type { TreeGroupProps } from "../types";
|
|
8
|
+
|
|
9
|
+
import { treeViewTransitionPresets } from "./animations";
|
|
10
|
+
import type { TreeViewAnimatedProps } from "./types";
|
|
11
|
+
import type { TreeViewTransition } from "./animations";
|
|
12
|
+
|
|
13
|
+
function createAnimatedGroup(transitionVariant: TreeViewTransition) {
|
|
14
|
+
const transition = treeViewTransitionPresets[transitionVariant];
|
|
15
|
+
const motionless = transitionVariant === "none";
|
|
16
|
+
|
|
17
|
+
function AnimatedTreeGroup({ open, children }: TreeGroupProps) {
|
|
18
|
+
return (
|
|
19
|
+
<AnimatePresence initial={false}>
|
|
20
|
+
{open ? (
|
|
21
|
+
<motion.ul
|
|
22
|
+
role="group"
|
|
23
|
+
data-slot="tree-view-group"
|
|
24
|
+
className="m-0 list-none overflow-hidden p-0"
|
|
25
|
+
initial={motionless ? false : { height: 0, opacity: 0 }}
|
|
26
|
+
animate={motionless ? undefined : { height: "auto", opacity: 1 }}
|
|
27
|
+
exit={motionless ? undefined : { height: 0, opacity: 0 }}
|
|
28
|
+
transition={transition}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</motion.ul>
|
|
32
|
+
) : null}
|
|
33
|
+
</AnimatePresence>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
AnimatedTreeGroup.displayName = "AnimatedTreeGroup";
|
|
38
|
+
return AnimatedTreeGroup;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function TreeViewAnimated({
|
|
42
|
+
transitionVariant = "default",
|
|
43
|
+
...props
|
|
44
|
+
}: TreeViewAnimatedProps) {
|
|
45
|
+
const GroupComponent = useMemo(
|
|
46
|
+
() => createAnimatedGroup(transitionVariant),
|
|
47
|
+
[transitionVariant],
|
|
48
|
+
);
|
|
49
|
+
return <TreeViewBase {...props} GroupComponent={GroupComponent} />;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
TreeViewAnimated.displayName = "TreeViewAnimated";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
export { TreeView } from "./tree-view";
|
|
4
|
+
export { TreeViewBase } from "./tree-view-base";
|
|
5
|
+
export type {
|
|
6
|
+
TreeNode,
|
|
7
|
+
TreeViewBaseProps,
|
|
8
|
+
TreeViewProps,
|
|
9
|
+
TreeViewRenderArgs,
|
|
10
|
+
TreeViewVariantProps,
|
|
11
|
+
TreeGroupProps,
|
|
12
|
+
} from "./types";
|
|
13
|
+
export { treeViewVariants, treeViewItemVariants } from "./variants";
|