@lidofinance/lido-ui 3.5.0 → 3.6.0
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/cjs/section/Section.js +21 -0
- package/dist/cjs/section/Section.js.map +1 -0
- package/dist/cjs/section/SectionStyles.js +54 -0
- package/dist/cjs/section/SectionStyles.js.map +1 -0
- package/dist/cjs/section/types.js +8 -0
- package/dist/cjs/section/types.js.map +1 -0
- package/dist/esm/section/Section.js +12 -0
- package/dist/esm/section/Section.js.map +1 -0
- package/dist/esm/section/SectionStyles.js +37 -0
- package/dist/esm/section/SectionStyles.js.map +1 -0
- package/dist/esm/section/types.js +3 -0
- package/dist/esm/section/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>_default
|
|
8
|
+
});
|
|
9
|
+
const _extends = require("@swc/helpers/lib/_extends.js").default;
|
|
10
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
11
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
12
|
+
const _sectionStyles = require("./SectionStyles");
|
|
13
|
+
function Section(props, ref) {
|
|
14
|
+
const { title , headerDecorator , children , ...rest } = props;
|
|
15
|
+
return /*#__PURE__*/ _react.default.createElement(_sectionStyles.SectionStyle, _extends({}, rest, {
|
|
16
|
+
ref: ref
|
|
17
|
+
}), title && /*#__PURE__*/ _react.default.createElement(_sectionStyles.SectionHeaderStyle, null, /*#__PURE__*/ _react.default.createElement(_sectionStyles.SectionTitleStyle, null, title), headerDecorator && /*#__PURE__*/ _react.default.createElement(_sectionStyles.SectionHeaderDecoratorStyle, null, headerDecorator)), children);
|
|
18
|
+
}
|
|
19
|
+
const _default = /*#__PURE__*/ (0, _react.forwardRef)(Section);
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=Section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/section/Section.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef } from 'react'\nimport { SectionProps } from './types'\nimport {\n SectionStyle,\n SectionHeaderStyle,\n SectionTitleStyle,\n SectionHeaderDecoratorStyle,\n} from './SectionStyles'\n\nfunction Section(props: SectionProps, ref?: ForwardedRef<HTMLDivElement>) {\n const { title, headerDecorator, children, ...rest } = props\n\n return (\n <SectionStyle {...rest} ref={ref}>\n {title && (\n <SectionHeaderStyle>\n <SectionTitleStyle>{title}</SectionTitleStyle>\n {headerDecorator && (\n <SectionHeaderDecoratorStyle>\n {headerDecorator}\n </SectionHeaderDecoratorStyle>\n )}\n </SectionHeaderStyle>\n )}\n {children}\n </SectionStyle>\n )\n}\n\nexport default forwardRef(Section)\n"],"names":["Section","props","ref","title","headerDecorator","children","rest","SectionStyle","SectionHeaderStyle","SectionTitleStyle","SectionHeaderDecoratorStyle","forwardRef"],"mappings":"AAAA;;;;+BA6BA,SAAkC;;aAAlC,QAAkC;;;;6DA7Bc,OAAO;+BAOhD,iBAAiB;AAExB,SAASA,OAAO,CAACC,KAAmB,EAAEC,GAAkC,EAAE;IACxE,MAAM,EAAEC,KAAK,CAAA,EAAEC,eAAe,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAGC,IAAI,EAAE,GAAGL,KAAK;IAE3D,qBACE,6BAACM,cAAY,aAAA,eAAKD,IAAI;QAAEJ,GAAG,EAAEA,GAAG;QAC7BC,KAAK,kBACJ,6BAACK,cAAkB,mBAAA,sBACjB,6BAACC,cAAiB,kBAAA,QAAEN,KAAK,CAAqB,EAC7CC,eAAe,kBACd,6BAACM,cAA2B,4BAAA,QACzBN,eAAe,CACY,AAC/B,CACkB,AACtB,EACAC,QAAQ,CACI,CAChB;AACH,CAAC;MAED,QAAkC,iBAAnBM,IAAAA,MAAU,WAAA,EAACX,OAAO,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
SectionStyle: ()=>SectionStyle,
|
|
13
|
+
SectionHeaderStyle: ()=>SectionHeaderStyle,
|
|
14
|
+
SectionTitleStyle: ()=>SectionTitleStyle,
|
|
15
|
+
SectionHeaderDecoratorStyle: ()=>SectionHeaderDecoratorStyle
|
|
16
|
+
});
|
|
17
|
+
const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
|
|
18
|
+
const _styledComponents = /*#__PURE__*/ _interopRequireDefault(require("styled-components"));
|
|
19
|
+
const SectionStyle = _styledComponents.default.section`
|
|
20
|
+
margin: ${(param)=>{
|
|
21
|
+
let { theme } = param;
|
|
22
|
+
return theme.spaceMap.xxl;
|
|
23
|
+
}}px 0;
|
|
24
|
+
`;
|
|
25
|
+
const SectionHeaderStyle = _styledComponents.default.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: flex-end;
|
|
28
|
+
margin-bottom: ${(param)=>{
|
|
29
|
+
let { theme } = param;
|
|
30
|
+
return theme.fontSizesMap.xxs;
|
|
31
|
+
}}px;
|
|
32
|
+
`;
|
|
33
|
+
const SectionTitleStyle = _styledComponents.default.h2`
|
|
34
|
+
margin-right: auto;
|
|
35
|
+
font-weight: 800;
|
|
36
|
+
font-size: ${(param)=>{
|
|
37
|
+
let { theme } = param;
|
|
38
|
+
return theme.fontSizesMap.md;
|
|
39
|
+
}}px;
|
|
40
|
+
line-height: 1.3em;
|
|
41
|
+
`;
|
|
42
|
+
const SectionHeaderDecoratorStyle = _styledComponents.default.div`
|
|
43
|
+
margin-left: ${(param)=>{
|
|
44
|
+
let { theme } = param;
|
|
45
|
+
return theme.spaceMap.lg;
|
|
46
|
+
}}px;
|
|
47
|
+
font-size: ${(param)=>{
|
|
48
|
+
let { theme } = param;
|
|
49
|
+
return theme.fontSizesMap.xxs;
|
|
50
|
+
}}px;
|
|
51
|
+
line-height: 1.5em;
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=SectionStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/section/SectionStyles.tsx"],"sourcesContent":["import styled from 'styled-components'\n\nexport const SectionStyle = styled.section`\n margin: ${({ theme }) => theme.spaceMap.xxl}px 0;\n`\n\nexport const SectionHeaderStyle = styled.div`\n display: flex;\n align-items: flex-end;\n margin-bottom: ${({ theme }) => theme.fontSizesMap.xxs}px;\n`\n\nexport const SectionTitleStyle = styled.h2`\n margin-right: auto;\n font-weight: 800;\n font-size: ${({ theme }) => theme.fontSizesMap.md}px;\n line-height: 1.3em;\n`\n\nexport const SectionHeaderDecoratorStyle = styled.div`\n margin-left: ${({ theme }) => theme.spaceMap.lg}px;\n font-size: ${({ theme }) => theme.fontSizesMap.xxs}px;\n line-height: 1.5em;\n`\n"],"names":["SectionStyle","SectionHeaderStyle","SectionTitleStyle","SectionHeaderDecoratorStyle","styled","section","theme","spaceMap","xxl","div","fontSizesMap","xxs","h2","md","lg"],"mappings":"AAAA;;;;;;;;;;;IAEaA,YAAY,MAAZA,YAAY;IAIZC,kBAAkB,MAAlBA,kBAAkB;IAMlBC,iBAAiB,MAAjBA,iBAAiB;IAOjBC,2BAA2B,MAA3BA,2BAA2B;;;uEAnBrB,mBAAmB;AAE/B,MAAMH,YAAY,GAAGI,iBAAM,QAAA,CAACC,OAAO,CAAC;UACjC,EAAE,SAAeC;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACC,QAAQ,CAACC,GAAG;AAAD,CAAC,CAAC;AAC9C,CAAC;AAEM,MAAMP,kBAAkB,GAAGG,iBAAM,QAAA,CAACK,GAAG,CAAC;;;iBAG5B,EAAE,SAAeH;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACI,YAAY,CAACC,GAAG;AAAD,CAAC,CAAC;AACzD,CAAC;AAEM,MAAMT,iBAAiB,GAAGE,iBAAM,QAAA,CAACQ,EAAE,CAAC;;;aAG9B,EAAE,SAAeN;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACI,YAAY,CAACG,EAAE;AAAD,CAAC,CAAC;;AAEpD,CAAC;AAEM,MAAMV,2BAA2B,GAAGC,iBAAM,QAAA,CAACK,GAAG,CAAC;eACvC,EAAE,SAAeH;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACC,QAAQ,CAACO,EAAE;AAAD,CAAC,CAAC;aACrC,EAAE,SAAeR;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACI,YAAY,CAACC,GAAG;AAAD,CAAC,CAAC;;AAErD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
|
|
6
|
+
const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/section/types.ts"],"sourcesContent":["import React from 'react'\nimport { LidoComponentProps } from '@lidofinance/utils'\n\nexport type SectionProps = LidoComponentProps<\n 'div',\n {\n title?: React.ReactNode\n headerDecorator?: React.ReactNode\n }\n>\n"],"names":[],"mappings":"AAAA;;;;;4DAAkB,OAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _extends from "@swc/helpers/src/_extends.mjs";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { SectionStyle, SectionHeaderStyle, SectionTitleStyle, SectionHeaderDecoratorStyle } from "./SectionStyles";
|
|
4
|
+
function Section(props, ref) {
|
|
5
|
+
const { title , headerDecorator , children , ...rest } = props;
|
|
6
|
+
return /*#__PURE__*/ React.createElement(SectionStyle, _extends({}, rest, {
|
|
7
|
+
ref: ref
|
|
8
|
+
}), title && /*#__PURE__*/ React.createElement(SectionHeaderStyle, null, /*#__PURE__*/ React.createElement(SectionTitleStyle, null, title), headerDecorator && /*#__PURE__*/ React.createElement(SectionHeaderDecoratorStyle, null, headerDecorator)), children);
|
|
9
|
+
}
|
|
10
|
+
export default /*#__PURE__*/ forwardRef(Section);
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=Section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/section/Section.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef } from 'react'\nimport { SectionProps } from './types'\nimport {\n SectionStyle,\n SectionHeaderStyle,\n SectionTitleStyle,\n SectionHeaderDecoratorStyle,\n} from './SectionStyles'\n\nfunction Section(props: SectionProps, ref?: ForwardedRef<HTMLDivElement>) {\n const { title, headerDecorator, children, ...rest } = props\n\n return (\n <SectionStyle {...rest} ref={ref}>\n {title && (\n <SectionHeaderStyle>\n <SectionTitleStyle>{title}</SectionTitleStyle>\n {headerDecorator && (\n <SectionHeaderDecoratorStyle>\n {headerDecorator}\n </SectionHeaderDecoratorStyle>\n )}\n </SectionHeaderStyle>\n )}\n {children}\n </SectionStyle>\n )\n}\n\nexport default forwardRef(Section)\n"],"names":["React","forwardRef","SectionStyle","SectionHeaderStyle","SectionTitleStyle","SectionHeaderDecoratorStyle","Section","props","ref","title","headerDecorator","children","rest"],"mappings":"AAAA;AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO,CAAA;AAEvD,SACEC,YAAY,EACZC,kBAAkB,EAClBC,iBAAiB,EACjBC,2BAA2B,QACtB,iBAAiB,CAAA;AAExB,SAASC,OAAO,CAACC,KAAmB,EAAEC,GAAkC,EAAE;IACxE,MAAM,EAAEC,KAAK,CAAA,EAAEC,eAAe,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAGC,IAAI,EAAE,GAAGL,KAAK;IAE3D,qBACE,oBAACL,YAAY,eAAKU,IAAI;QAAEJ,GAAG,EAAEA,GAAG;QAC7BC,KAAK,kBACJ,oBAACN,kBAAkB,sBACjB,oBAACC,iBAAiB,QAAEK,KAAK,CAAqB,EAC7CC,eAAe,kBACd,oBAACL,2BAA2B,QACzBK,eAAe,CACY,AAC/B,CACkB,AACtB,EACAC,QAAQ,CACI,CAChB;AACH,CAAC;AAED,6BAAeV,UAAU,CAACK,OAAO,CAAC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
export const SectionStyle = styled.section`
|
|
3
|
+
margin: ${(param)=>{
|
|
4
|
+
let { theme } = param;
|
|
5
|
+
return theme.spaceMap.xxl;
|
|
6
|
+
}}px 0;
|
|
7
|
+
`;
|
|
8
|
+
export const SectionHeaderStyle = styled.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: flex-end;
|
|
11
|
+
margin-bottom: ${(param)=>{
|
|
12
|
+
let { theme } = param;
|
|
13
|
+
return theme.fontSizesMap.xxs;
|
|
14
|
+
}}px;
|
|
15
|
+
`;
|
|
16
|
+
export const SectionTitleStyle = styled.h2`
|
|
17
|
+
margin-right: auto;
|
|
18
|
+
font-weight: 800;
|
|
19
|
+
font-size: ${(param)=>{
|
|
20
|
+
let { theme } = param;
|
|
21
|
+
return theme.fontSizesMap.md;
|
|
22
|
+
}}px;
|
|
23
|
+
line-height: 1.3em;
|
|
24
|
+
`;
|
|
25
|
+
export const SectionHeaderDecoratorStyle = styled.div`
|
|
26
|
+
margin-left: ${(param)=>{
|
|
27
|
+
let { theme } = param;
|
|
28
|
+
return theme.spaceMap.lg;
|
|
29
|
+
}}px;
|
|
30
|
+
font-size: ${(param)=>{
|
|
31
|
+
let { theme } = param;
|
|
32
|
+
return theme.fontSizesMap.xxs;
|
|
33
|
+
}}px;
|
|
34
|
+
line-height: 1.5em;
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=SectionStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/section/SectionStyles.tsx"],"sourcesContent":["import styled from 'styled-components'\n\nexport const SectionStyle = styled.section`\n margin: ${({ theme }) => theme.spaceMap.xxl}px 0;\n`\n\nexport const SectionHeaderStyle = styled.div`\n display: flex;\n align-items: flex-end;\n margin-bottom: ${({ theme }) => theme.fontSizesMap.xxs}px;\n`\n\nexport const SectionTitleStyle = styled.h2`\n margin-right: auto;\n font-weight: 800;\n font-size: ${({ theme }) => theme.fontSizesMap.md}px;\n line-height: 1.3em;\n`\n\nexport const SectionHeaderDecoratorStyle = styled.div`\n margin-left: ${({ theme }) => theme.spaceMap.lg}px;\n font-size: ${({ theme }) => theme.fontSizesMap.xxs}px;\n line-height: 1.5em;\n`\n"],"names":["styled","SectionStyle","section","theme","spaceMap","xxl","SectionHeaderStyle","div","fontSizesMap","xxs","SectionTitleStyle","h2","md","SectionHeaderDecoratorStyle","lg"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,MAAMC,YAAY,GAAGD,MAAM,CAACE,OAAO,CAAC;UACjC,EAAE,SAAeC;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACC,QAAQ,CAACC,GAAG;AAAD,CAAC,CAAC;AAC9C,CAAC,CAAA;AAED,OAAO,MAAMC,kBAAkB,GAAGN,MAAM,CAACO,GAAG,CAAC;;;iBAG5B,EAAE,SAAeJ;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACK,YAAY,CAACC,GAAG;AAAD,CAAC,CAAC;AACzD,CAAC,CAAA;AAED,OAAO,MAAMC,iBAAiB,GAAGV,MAAM,CAACW,EAAE,CAAC;;;aAG9B,EAAE,SAAeR;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACK,YAAY,CAACI,EAAE;AAAD,CAAC,CAAC;;AAEpD,CAAC,CAAA;AAED,OAAO,MAAMC,2BAA2B,GAAGb,MAAM,CAACO,GAAG,CAAC;eACvC,EAAE,SAAeJ;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACC,QAAQ,CAACU,EAAE;AAAD,CAAC,CAAC;aACrC,EAAE,SAAeX;QAAd,EAAEA,KAAK,CAAA,EAAE;WAAKA,KAAK,CAACK,YAAY,CAACC,GAAG;AAAD,CAAC,CAAC;;AAErD,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/section/types.ts"],"sourcesContent":["import React from 'react'\nimport { LidoComponentProps } from '@lidofinance/utils'\n\nexport type SectionProps = LidoComponentProps<\n 'div',\n {\n title?: React.ReactNode\n headerDecorator?: React.ReactNode\n }\n>\n"],"names":["React"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO,CAAA"}
|