norma-library 0.6.69 → 0.6.71

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,14 @@
1
+ import React from 'react';
2
+ import { ColorVariant } from '@/types';
3
+ export interface TimeLineData {
4
+ date: string;
5
+ description?: string;
6
+ children?: React.ReactNode;
7
+ }
8
+ interface TimeLineProps {
9
+ data: TimeLineData[];
10
+ theme?: ColorVariant;
11
+ color?: string;
12
+ }
13
+ export declare const TimeLine: React.FC<TimeLineProps>;
14
+ export {};
@@ -0,0 +1,48 @@
1
+ import { __assign, __makeTemplateObject } from "tslib";
2
+ import React from 'react';
3
+ import { Typography } from '@mui/material';
4
+ import { Timeline, TimelineItem, TimelineSeparator, TimelineConnector, TimelineContent, TimelineDot, timelineItemClasses, } from '@mui/lab';
5
+ import { palette } from '../../helpers';
6
+ import styled from 'styled-components';
7
+ var colorMap = {
8
+ inherit: palette.inherit,
9
+ primary: '#DB6619',
10
+ secondary: palette.secondary,
11
+ error: palette.error,
12
+ warning: palette.warning,
13
+ info: palette.info,
14
+ success: palette.success,
15
+ };
16
+ export var TimeLine = function (_a) {
17
+ var data = _a.data, _b = _a.theme, theme = _b === void 0 ? 'primary' : _b, color = _a.color;
18
+ var _mainColor = color || colorMap[theme];
19
+ var NormaTimeLine = styled(Timeline)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " {\n padding: 0;\n &:before {\n flex: 0;\n padding: 0;\n }\n }\n\n .MuiTimelineDot-root {\n &:last-child {\n &:before {\n content: '';\n width: 70%;\n height: 70%;\n background: ", ";\n position: absolute;\n border-radius: 50%;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n }\n "], ["\n .", " {\n padding: 0;\n &:before {\n flex: 0;\n padding: 0;\n }\n }\n\n .MuiTimelineDot-root {\n &:last-child {\n &:before {\n content: '';\n width: 70%;\n height: 70%;\n background: ", ";\n position: absolute;\n border-radius: 50%;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n }\n "])), timelineItemClasses.root, _mainColor);
20
+ var _getDotStyle = function (last) {
21
+ var style = {
22
+ background: 'none',
23
+ boxShadow: 'none',
24
+ padding: '6px',
25
+ margin: '0',
26
+ border: "3px solid ".concat(_mainColor),
27
+ };
28
+ var lastStyle = {
29
+ padding: '8px',
30
+ position: 'relative',
31
+ left: '-2px',
32
+ };
33
+ return last ? __assign(__assign({}, style), lastStyle) : style;
34
+ };
35
+ return (React.createElement(NormaTimeLine, { sx: { padding: '0' } }, data.map(function (item, key) {
36
+ var last = key !== data.length - 1;
37
+ return (React.createElement(TimelineItem, { key: key, sx: { minHeight: 'auto' } },
38
+ React.createElement(TimelineSeparator, null,
39
+ React.createElement(TimelineDot, { sx: _getDotStyle(!last) }),
40
+ last && React.createElement(TimelineConnector, { sx: { bgcolor: _mainColor, width: '5px' } })),
41
+ React.createElement(TimelineContent, { sx: { py: 0, pl: 2, pb: '35px' } },
42
+ React.createElement(Typography, { sx: { m: 'auto 0' }, className: "TimelineContent__Date", variant: "body1" }, item.date),
43
+ item.description && (React.createElement(Typography, { sx: { m: 'auto 0' }, className: "TimelineContent__Description", variant: "body2" }, item.description)),
44
+ item.children)));
45
+ })));
46
+ };
47
+ var templateObject_1;
48
+ //# sourceMappingURL=TimeLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeLine.js","sourceRoot":"","sources":["../../../../src/components/TimeLine/TimeLine.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAcvC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CAAC,CAAC;QACrC,OAAO,CACL,oBAAC,YAAY,IAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;YAC/C,oBAAC,iBAAiB;gBAChB,oBAAC,WAAW,IAAC,EAAE,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,GAAI;gBACvC,IAAI,IAAI,oBAAC,iBAAiB,IAAC,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,GAAI,CACvD;YACpB,oBAAC,eAAe,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE;gBAC/C,oBAAC,UAAU,IAAC,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAC,uBAAuB,EAAC,OAAO,EAAC,OAAO,IAC/E,IAAI,CAAC,IAAI,CACC;gBACZ,IAAI,CAAC,WAAW,IAAI,CACnB,oBAAC,UAAU,IAAC,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAC,8BAA8B,EAAC,OAAO,EAAC,OAAO,IACtF,IAAI,CAAC,WAAW,CACN,CACd;gBACA,IAAI,CAAC,QAAQ,CACE,CACL,CAChB,CAAC;IACJ,CAAC,CAAC,CACY,CACjB,CAAC;AACJ,CAAC,CAAC"}
@@ -27,8 +27,8 @@ import TextInput from './components/TextInput';
27
27
  import Table from './components/Table';
28
28
  import UncontrolledTable from './components/UncontrolledTable';
29
29
  import UncontrolledTabs from './components/UncontrolledTabs/UncontrolledTabs';
30
- import { TimeLine } from './components/NormaTimeLine/NormaTimeLine';
30
+ import { TimeLine, TimeLineData } from './components/TimeLine/TimeLine';
31
31
  import { ModalStatus } from './components/StatusModal/StatusModal';
32
32
  import { breakpoints } from './utils/styledBreakpoints';
33
33
  import { useTheme } from '@mui/material';
34
- export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, NormaProvider, themes, DateInput, Box, Breadcrumb, SelectInput, MultiSelectInput, Text, Title, TextInput, Table, UncontrolledTable, UncontrolledTabs, ModalStatus, breakpoints, useTheme, TimeLine as NormaTimeLine, };
34
+ export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, NormaProvider, themes, DateInput, Box, Breadcrumb, SelectInput, MultiSelectInput, Text, Title, TextInput, Table, UncontrolledTable, UncontrolledTabs, ModalStatus, breakpoints, useTheme, TimeLine, TimeLineData, };
package/dist/esm/index.js CHANGED
@@ -27,9 +27,9 @@ import TextInput from './components/TextInput';
27
27
  import Table from './components/Table';
28
28
  import UncontrolledTable from './components/UncontrolledTable';
29
29
  import UncontrolledTabs from './components/UncontrolledTabs/UncontrolledTabs';
30
- import { TimeLine } from './components/NormaTimeLine/NormaTimeLine';
30
+ import { TimeLine } from './components/TimeLine/TimeLine';
31
31
  import { ModalStatus } from './components/StatusModal/StatusModal';
32
32
  import { breakpoints } from './utils/styledBreakpoints';
33
33
  import { useTheme } from '@mui/material';
34
- export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, NormaProvider, themes, DateInput, Box, Breadcrumb, SelectInput, MultiSelectInput, Text, Title, TextInput, Table, UncontrolledTable, UncontrolledTabs, ModalStatus, breakpoints, useTheme, TimeLine as NormaTimeLine, };
34
+ export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, NormaProvider, themes, DateInput, Box, Breadcrumb, SelectInput, MultiSelectInput, Text, Title, TextInput, Table, UncontrolledTable, UncontrolledTabs, ModalStatus, breakpoints, useTheme, TimeLine, };
35
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OA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AAC/D,OAAO,gBAAgB,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAgB,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EACL,SAAS,EACT,MAAM,EACN,IAAI,EACJ,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,SAAS,EACT,aAAa,EACb,MAAM,EACN,SAAS,EACT,GAAG,EACH,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,GAET,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "norma-library",
3
- "version": "0.6.69",
3
+ "version": "0.6.71",
4
4
  "private": false,
5
5
  "description": "Olos/Norma-DS. Design System based on Material UI, developed with TypeScript and Styled Components to create reusable and consistent components in web applications.",
6
6
  "scripts": {
@@ -42,6 +42,7 @@ export const TimeLine: React.FC<TimeLineProps> = ({ data, theme = 'primary', col
42
42
 
43
43
  const NormaTimeLine = styled(Timeline)`
44
44
  .${timelineItemClasses.root} {
45
+ padding: 0;
45
46
  &:before {
46
47
  flex: 0;
47
48
  padding: 0;
@@ -84,7 +85,7 @@ export const TimeLine: React.FC<TimeLineProps> = ({ data, theme = 'primary', col
84
85
  };
85
86
 
86
87
  return (
87
- <NormaTimeLine>
88
+ <NormaTimeLine sx={{ padding: '0' }}>
88
89
  {data.map((item, key) => {
89
90
  const last = key !== data.length - 1;
90
91
  return (
package/src/index.ts CHANGED
@@ -27,7 +27,7 @@ import TextInput from './components/TextInput';
27
27
  import Table from './components/Table';
28
28
  import UncontrolledTable from './components/UncontrolledTable';
29
29
  import UncontrolledTabs from './components/UncontrolledTabs/UncontrolledTabs';
30
- import { TimeLine } from './components/NormaTimeLine/NormaTimeLine';
30
+ import { TimeLine, TimeLineData } from './components/TimeLine/TimeLine';
31
31
  import { ModalStatus } from './components/StatusModal/StatusModal';
32
32
  import { breakpoints } from './utils/styledBreakpoints';
33
33
 
@@ -69,5 +69,6 @@ export {
69
69
  ModalStatus,
70
70
  breakpoints,
71
71
  useTheme,
72
- TimeLine as NormaTimeLine,
72
+ TimeLine,
73
+ TimeLineData,
73
74
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TimeLine, TimeLineData } from '../components/NormaTimeLine/NormaTimeLine';
2
+ import { TimeLine, TimeLineData } from '../components/TimeLine/TimeLine';
3
3
  import type { Meta } from '@storybook/react';
4
4
  import { Stack } from '@mui/material';
5
5