@vrobots/storybook 0.1.37 → 0.1.39
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/package.json
CHANGED
|
@@ -3,9 +3,9 @@ import { TimelineRootProps } from "@chakra-ui/react";
|
|
|
3
3
|
import * as Icons from "react-icons/md";
|
|
4
4
|
export interface ITimelineItem {
|
|
5
5
|
date: string;
|
|
6
|
-
title: string;
|
|
7
|
-
component: React.ReactNode;
|
|
8
6
|
icon: keyof typeof Icons;
|
|
7
|
+
title?: string;
|
|
8
|
+
component?: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
export interface ITimelineProps extends TimelineRootProps {
|
|
11
11
|
items?: ITimelineItem[];
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Timeline as ChakraTimeline } from "@chakra-ui/react";
|
|
4
4
|
import * as Icons from "react-icons/md";
|
|
5
|
-
const createTimelineItem = (item, index) => (_jsxs(ChakraTimeline.Item, { children: [_jsxs(ChakraTimeline.Connector, { children: [_jsx(ChakraTimeline.Separator, {}), _jsx(ChakraTimeline.Indicator, { children: Icons[item.icon] ? React.createElement(Icons[item.icon]) : null })] }), _jsxs(ChakraTimeline.Content, { children: [_jsx(ChakraTimeline.
|
|
5
|
+
const createTimelineItem = (item, index) => (_jsxs(ChakraTimeline.Item, { children: [_jsxs(ChakraTimeline.Connector, { children: [_jsx(ChakraTimeline.Separator, {}), _jsx(ChakraTimeline.Indicator, { children: Icons[item.icon] ? React.createElement(Icons[item.icon]) : null })] }), _jsxs(ChakraTimeline.Content, { children: [_jsx(ChakraTimeline.Description, { children: item.date }), !!item.title && _jsx(ChakraTimeline.Title, { textStyle: "sm", children: item.title }), item.component || null] })] }, item.date + index));
|
|
6
6
|
export const Timeline = React.forwardRef(({ items = [], ...props }, ref) => {
|
|
7
7
|
return (_jsx(ChakraTimeline.Root, { ref: ref, ...props, children: items.map(createTimelineItem) }));
|
|
8
8
|
});
|