shared-uicomponents-library 1.1.14 → 1.1.15

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.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { GeneralTimelineProps } from './GeneralTimeline.types';
3
+ declare const GeneralTimeline: React.FC<GeneralTimelineProps>;
4
+ export default GeneralTimeline;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("react").FC<import("./GeneralTimeline.types").GeneralTimelineProps>;
5
+ tags: string[];
6
+ };
7
+ export default meta;
8
+ export declare const GeneralTimelineStory: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-5617c98e").R, import("./GeneralTimeline.types").GeneralTimelineProps>;
9
+ export declare const GeneralTimelineStoryWithLineHeight: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-5617c98e").R, import("./GeneralTimeline.types").GeneralTimelineProps>;
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledTimelineContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
+ export declare const StyledTimelineItem: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
7
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
+ export declare const StyledTimelineText: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
10
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
11
+ export declare const StyledIndicatorContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
12
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
13
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
14
+ export declare const StyledTimelineIndicator: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
15
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
16
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
17
+ filled?: boolean | undefined;
18
+ }, {}, {}>;
19
+ export declare const StyledTimelineLine: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
20
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
21
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
22
+ height?: number | undefined;
23
+ }, {}, {}>;
@@ -0,0 +1,8 @@
1
+ export interface TimelineItemProps {
2
+ text: string;
3
+ filled?: boolean;
4
+ }
5
+ export interface GeneralTimelineProps {
6
+ items: TimelineItemProps[];
7
+ lineHeight?: number;
8
+ }
@@ -0,0 +1 @@
1
+ export { default as GeneralTimeline } from './GeneralTimeline';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-uicomponents-library",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -9,6 +9,7 @@
9
9
  "@emotion/react": "^11.13.0",
10
10
  "@emotion/styled": "^11.13.0",
11
11
  "@mui/icons-material": "^5.16.7",
12
+ "@mui/lab": "^5.0.0-alpha.173",
12
13
  "@mui/material": "^5.16.7",
13
14
  "@rollup/plugin-commonjs": "^26.0.1",
14
15
  "@rollup/plugin-image": "^3.0.3",
@@ -0,0 +1,52 @@
1
+ import type { Meta, StoryFn } from '@storybook/react';
2
+
3
+ import GeneralTimeline from './GeneralTimeline';
4
+
5
+ const meta = {
6
+ title: 'UI/Timeline',
7
+ component: GeneralTimeline,
8
+ tags: ['autodocs'],
9
+ } satisfies Meta<typeof GeneralTimeline>;
10
+
11
+ export default meta;
12
+
13
+ const TimelineTemplate: StoryFn<typeof GeneralTimeline> = (args) => (
14
+ <GeneralTimeline {...args} />
15
+ );
16
+
17
+ export const GeneralTimelineStory = TimelineTemplate.bind({});
18
+ GeneralTimelineStory.args = {
19
+ items: [
20
+ {
21
+ text: 'ben',
22
+ filled: true,
23
+ },
24
+ {
25
+ text: 'ben1',
26
+ filled: false,
27
+ },
28
+ {
29
+ text: 'ben2',
30
+ filled: false,
31
+ },
32
+ ],
33
+ };
34
+
35
+ export const GeneralTimelineStoryWithLineHeight = TimelineTemplate.bind({});
36
+ GeneralTimelineStoryWithLineHeight.args = {
37
+ lineHeight: 40,
38
+ items: [
39
+ {
40
+ text: 'ben',
41
+ filled: true,
42
+ },
43
+ {
44
+ text: 'ben1',
45
+ filled: false,
46
+ },
47
+ {
48
+ text: 'ben2',
49
+ filled: false,
50
+ },
51
+ ],
52
+ };
@@ -0,0 +1,49 @@
1
+ import { styled } from '@mui/material/styles';
2
+ import { Box } from '@mui/material';
3
+
4
+ export const StyledTimelineContainer = styled(Box)({
5
+ display: 'flex',
6
+ flexDirection: 'column',
7
+ alignItems: 'end',
8
+ position: 'relative',
9
+ });
10
+
11
+ export const StyledTimelineItem = styled(Box)({
12
+ display: 'flex',
13
+ flexDirection: 'row',
14
+ position: 'relative',
15
+ });
16
+
17
+ export const StyledTimelineText = styled(Box)(({ theme }) => ({
18
+ textAlign: 'right',
19
+ paddingRight: 8,
20
+ ...theme.typography.label_medium_regular_lh_s_desktop,
21
+ fontFamily: 'SimplerPro_Leumi',
22
+ }));
23
+
24
+ export const StyledIndicatorContainer = styled(Box)({
25
+ display: 'flex',
26
+ flexDirection: 'column',
27
+ alignItems: 'center',
28
+ position: 'relative',
29
+ flexShrink: 0,
30
+ });
31
+
32
+ export const StyledTimelineIndicator = styled(Box)<{ filled?: boolean }>(
33
+ ({ theme, filled }) => ({
34
+ width: 15,
35
+ height: 15,
36
+ borderRadius: '50%',
37
+ backgroundColor: filled ? theme.palette.icon.main_1 : 'transparent',
38
+ border: `1px solid ${theme.palette.icon.main_1}`,
39
+ zIndex: 1,
40
+ }),
41
+ );
42
+
43
+ export const StyledTimelineLine = styled(Box)<{ height?: number }>(
44
+ ({ theme, height }) => ({
45
+ width: 1.5,
46
+ backgroundColor: theme.palette.baseBlack.black_6,
47
+ height: height || 20,
48
+ }),
49
+ );
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
3
+ import { getCustomTheme } from 'assets/theme';
4
+
5
+ import {
6
+ StyledTimelineContainer,
7
+ StyledTimelineItem,
8
+ StyledTimelineText,
9
+ StyledTimelineIndicator,
10
+ StyledTimelineLine,
11
+ StyledIndicatorContainer,
12
+ } from './GeneralTimeline.styles';
13
+ import { GeneralTimelineProps } from './GeneralTimeline.types';
14
+
15
+ const GeneralTimeline: React.FC<GeneralTimelineProps> = ({
16
+ items,
17
+ lineHeight,
18
+ }) => {
19
+ return (
20
+ <MuiThemeProvider theme={getCustomTheme()}>
21
+ <StyledTimelineContainer>
22
+ {items.map((item, index) => (
23
+ <StyledTimelineItem key={index}>
24
+ <StyledTimelineText>{item.text}</StyledTimelineText>
25
+ <StyledIndicatorContainer>
26
+ <StyledTimelineIndicator filled={item.filled} />
27
+ {index !== items.length - 1 && <StyledTimelineLine height={lineHeight} />}
28
+ </StyledIndicatorContainer>
29
+ </StyledTimelineItem>
30
+ ))}
31
+ </StyledTimelineContainer>
32
+ </MuiThemeProvider>
33
+ );
34
+ };
35
+
36
+ export default GeneralTimeline;
@@ -0,0 +1,9 @@
1
+ export interface TimelineItemProps {
2
+ text: string;
3
+ filled?: boolean;
4
+ }
5
+
6
+ export interface GeneralTimelineProps {
7
+ items: TimelineItemProps[];
8
+ lineHeight?: number;
9
+ }
@@ -0,0 +1 @@
1
+ export { default as GeneralTimeline } from './GeneralTimeline';