@elliemae/ds-side-panel 3.0.0-next.2 → 3.0.0-next.3

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.
Files changed (43) hide show
  1. package/dist/cjs/SidePanel.js +111 -0
  2. package/dist/cjs/SidePanel.js.map +7 -0
  3. package/dist/cjs/SidePanelHeader.js +109 -0
  4. package/dist/cjs/SidePanelHeader.js.map +7 -0
  5. package/dist/cjs/TemplateBasicPageWithSidePanel.js +91 -0
  6. package/dist/cjs/TemplateBasicPageWithSidePanel.js.map +7 -0
  7. package/dist/cjs/defaultProps.js +42 -0
  8. package/dist/cjs/defaultProps.js.map +7 -0
  9. package/dist/cjs/index.js +38 -0
  10. package/dist/cjs/index.js.map +7 -0
  11. package/dist/cjs/props.js +48 -0
  12. package/dist/cjs/props.js.map +7 -0
  13. package/dist/esm/SidePanel.js +82 -0
  14. package/dist/esm/SidePanel.js.map +7 -0
  15. package/dist/esm/SidePanelHeader.js +80 -0
  16. package/dist/esm/SidePanelHeader.js.map +7 -0
  17. package/dist/esm/TemplateBasicPageWithSidePanel.js +62 -0
  18. package/dist/esm/TemplateBasicPageWithSidePanel.js.map +7 -0
  19. package/dist/esm/defaultProps.js +13 -0
  20. package/dist/esm/defaultProps.js.map +7 -0
  21. package/dist/esm/index.js +9 -0
  22. package/dist/esm/index.js.map +7 -0
  23. package/dist/esm/props.js +19 -0
  24. package/dist/esm/props.js.map +7 -0
  25. package/package.json +38 -29
  26. package/cjs/SidePanel.js +0 -97
  27. package/cjs/SidePanelHeader.js +0 -100
  28. package/cjs/TemplateBasicPageWithSidePanel.js +0 -122
  29. package/cjs/defaultProps.js +0 -14
  30. package/cjs/index.js +0 -17
  31. package/cjs/props.js +0 -44
  32. package/esm/SidePanel.js +0 -86
  33. package/esm/SidePanelHeader.js +0 -89
  34. package/esm/TemplateBasicPageWithSidePanel.js +0 -113
  35. package/esm/defaultProps.js +0 -10
  36. package/esm/index.js +0 -3
  37. package/esm/props.js +0 -40
  38. package/types/SidePanel.d.ts +0 -107
  39. package/types/SidePanelHeader.d.ts +0 -51
  40. package/types/TemplateBasicPageWithSidePanel.d.ts +0 -120
  41. package/types/defaultProps.d.ts +0 -8
  42. package/types/index.d.ts +0 -4
  43. package/types/props.d.ts +0 -82
@@ -0,0 +1,80 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { PropTypes, describe } from "react-desc";
4
+ import styled from "styled-components";
5
+ import { noop } from "lodash";
6
+ import { border, truncate, useTheme } from "@elliemae/ds-system";
7
+ import { CloseSmall } from "@elliemae/ds-icons";
8
+ import DSButton from "@elliemae/ds-button";
9
+ import { Grid } from "@elliemae/ds-grid";
10
+ const StyledSeparator = styled.div`
11
+ width: 0;
12
+ height: 100%;
13
+ margin: 0 ${(props2) => props2.theme.space.xxs};
14
+ border-left: ${(props2) => `${props2.theme.colors.neutral[300]} 1px solid`};
15
+ `;
16
+ const StyledTitle = styled.div`
17
+ font-size: 18px;
18
+ font-weight: ${(props2) => props2.theme.fontWeights.regular};
19
+ color: ${(props2) => props2.theme.colors.neutral["700"]};
20
+ ${truncate()}
21
+ `;
22
+ const Wrapper = styled(Grid)`
23
+ border-bottom: ${(props2) => border(props2.theme.colors.neutral["300"])};
24
+ `;
25
+ const SidePanelHeader = ({ title = null, additionalAction = null, onClose = noop, showClose = true }) => {
26
+ const theme = useTheme();
27
+ const separator = /* @__PURE__ */ React2.createElement(Grid, {
28
+ height: "24px"
29
+ }, /* @__PURE__ */ React2.createElement(StyledSeparator, null));
30
+ const cols = [1, "auto", "auto"];
31
+ const cols2 = ["auto"];
32
+ return /* @__PURE__ */ React2.createElement(Wrapper, {
33
+ cols,
34
+ height: theme.space.m,
35
+ pl: theme.space.xs,
36
+ pr: theme.space.xs,
37
+ alignItems: "center",
38
+ width: "100%"
39
+ }, /* @__PURE__ */ React2.createElement(Grid, {
40
+ alignItems: "center",
41
+ justifyContent: "flex-start",
42
+ cols: cols2
43
+ }, /* @__PURE__ */ React2.createElement(Grid, {
44
+ cols: [1],
45
+ alignItems: "center",
46
+ pr: theme.space.xs
47
+ }, /* @__PURE__ */ React2.createElement(Grid, {
48
+ flexGrow: 0
49
+ }, /* @__PURE__ */ React2.createElement(Grid, {
50
+ cols: ["auto", "auto"],
51
+ alignItems: "center"
52
+ }, /* @__PURE__ */ React2.createElement(StyledTitle, {
53
+ maxWidth: "100%",
54
+ alignItems: "center"
55
+ }, title))))), /* @__PURE__ */ React2.createElement(Grid, {
56
+ ml: "xxs",
57
+ alignItems: "center",
58
+ cols: additionalAction ? ["auto", "auto", "auto"] : ["auto"]
59
+ }, additionalAction && /* @__PURE__ */ React2.createElement(Grid, null, additionalAction), additionalAction && showClose && separator, /* @__PURE__ */ React2.createElement(Grid, null, showClose && /* @__PURE__ */ React2.createElement(DSButton, {
60
+ buttonType: "text",
61
+ icon: /* @__PURE__ */ React2.createElement(CloseSmall, null),
62
+ size: "m",
63
+ onClick: onClose,
64
+ "data-testid": "btn-close-slide-panel"
65
+ }))));
66
+ };
67
+ const props = {
68
+ title: PropTypes.string.description("Page title"),
69
+ additionalAction: PropTypes.element.description("Action button"),
70
+ onClose: PropTypes.func.description("Called when the slide collapse"),
71
+ showClose: PropTypes.bool.description("Show/Hide close button")
72
+ };
73
+ SidePanelHeader.propTypes = props;
74
+ const DSSidePanelHeaderWithSchema = describe(SidePanelHeader);
75
+ DSSidePanelHeaderWithSchema.propTypes = props;
76
+ export {
77
+ DSSidePanelHeaderWithSchema,
78
+ SidePanelHeader
79
+ };
80
+ //# sourceMappingURL=SidePanelHeader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/SidePanelHeader.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport styled from 'styled-components';\nimport { noop } from 'lodash';\nimport { border, truncate, useTheme } from '@elliemae/ds-system';\nimport { CloseSmall } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { Grid } from '@elliemae/ds-grid';\n\nconst StyledSeparator = styled.div`\n width: 0;\n height: 100%;\n margin: 0 ${(props) => props.theme.space.xxs};\n border-left: ${(props) => `${props.theme.colors.neutral[300]} 1px solid`};\n`;\n\nconst StyledTitle = styled.div`\n font-size: 18px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['700']};\n ${truncate()}\n`;\n\nconst Wrapper = styled(Grid)`\n border-bottom: ${(props) => border(props.theme.colors.neutral['300'])};\n`;\n\nconst SidePanelHeader = ({ title = null, additionalAction = null, onClose = noop, showClose = true }) => {\n const theme = useTheme();\n const separator = (\n <Grid height=\"24px\">\n <StyledSeparator />\n </Grid>\n );\n const cols = [1, 'auto', 'auto'];\n const cols2 = ['auto'];\n return (\n <Wrapper\n cols={cols}\n height={theme.space.m}\n pl={theme.space.xs}\n pr={theme.space.xs}\n alignItems=\"center\"\n width=\"100%\"\n >\n <Grid alignItems=\"center\" justifyContent=\"flex-start\" cols={cols2}>\n <Grid cols={[1]} alignItems=\"center\" pr={theme.space.xs}>\n <Grid flexGrow={0}>\n <Grid cols={['auto', 'auto']} alignItems=\"center\">\n <StyledTitle maxWidth=\"100%\" alignItems=\"center\">\n {title}\n </StyledTitle>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n <Grid ml=\"xxs\" alignItems=\"center\" cols={additionalAction ? ['auto', 'auto', 'auto'] : ['auto']}>\n {additionalAction && <Grid>{additionalAction}</Grid>}\n {additionalAction && showClose && separator}\n <Grid>\n {showClose && (\n <DSButton\n buttonType=\"text\"\n icon={<CloseSmall />}\n size=\"m\"\n onClick={onClose}\n data-testid=\"btn-close-slide-panel\"\n />\n )}\n </Grid>\n </Grid>\n </Wrapper>\n );\n};\n\nconst props = {\n /** Page title */\n title: PropTypes.string.description('Page title'),\n\n /** Action button */\n additionalAction: PropTypes.element.description('Action button'),\n\n /** Called when the slide collapse */\n onClose: PropTypes.func.description('Called when the slide collapse'),\n\n /** Show/Hide close button */\n showClose: PropTypes.bool.description('Show/Hide close button'),\n};\n\nSidePanelHeader.propTypes = props;\n\nconst DSSidePanelHeaderWithSchema = describe(SidePanelHeader);\n\nDSSidePanelHeaderWithSchema.propTypes = props;\n\nexport { SidePanelHeader, DSSidePanelHeaderWithSchema };\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA,cAGjB,CAAC,WAAU,OAAM,MAAM,MAAM;AAAA,iBAC1B,CAAC,WAAU,GAAG,OAAM,MAAM,OAAO,QAAQ;AAAA;AAG1D,MAAM,cAAc,OAAO;AAAA;AAAA,iBAEV,CAAC,WAAU,OAAM,MAAM,YAAY;AAAA,WACzC,CAAC,WAAU,OAAM,MAAM,OAAO,QAAQ;AAAA,IAC7C;AAAA;AAGJ,MAAM,UAAU,OAAO;AAAA,mBACJ,CAAC,WAAU,OAAO,OAAM,MAAM,OAAO,QAAQ;AAAA;AAGhE,MAAM,kBAAkB,CAAC,EAAE,QAAQ,MAAM,mBAAmB,MAAM,UAAU,MAAM,YAAY,WAAW;AACvG,QAAM,QAAQ;AACd,QAAM,YACJ,qCAAC,MAAD;AAAA,IAAM,QAAO;AAAA,KACX,qCAAC,iBAAD;AAGJ,QAAM,OAAO,CAAC,GAAG,QAAQ;AACzB,QAAM,QAAQ,CAAC;AACf,SACE,qCAAC,SAAD;AAAA,IACE;AAAA,IACA,QAAQ,MAAM,MAAM;AAAA,IACpB,IAAI,MAAM,MAAM;AAAA,IAChB,IAAI,MAAM,MAAM;AAAA,IAChB,YAAW;AAAA,IACX,OAAM;AAAA,KAEN,qCAAC,MAAD;AAAA,IAAM,YAAW;AAAA,IAAS,gBAAe;AAAA,IAAa,MAAM;AAAA,KAC1D,qCAAC,MAAD;AAAA,IAAM,MAAM,CAAC;AAAA,IAAI,YAAW;AAAA,IAAS,IAAI,MAAM,MAAM;AAAA,KACnD,qCAAC,MAAD;AAAA,IAAM,UAAU;AAAA,KACd,qCAAC,MAAD;AAAA,IAAM,MAAM,CAAC,QAAQ;AAAA,IAAS,YAAW;AAAA,KACvC,qCAAC,aAAD;AAAA,IAAa,UAAS;AAAA,IAAO,YAAW;AAAA,KACrC,YAMX,qCAAC,MAAD;AAAA,IAAM,IAAG;AAAA,IAAM,YAAW;AAAA,IAAS,MAAM,mBAAmB,CAAC,QAAQ,QAAQ,UAAU,CAAC;AAAA,KACrF,oBAAoB,qCAAC,MAAD,MAAO,mBAC3B,oBAAoB,aAAa,WAClC,qCAAC,MAAD,MACG,aACC,qCAAC,UAAD;AAAA,IACE,YAAW;AAAA,IACX,MAAM,qCAAC,YAAD;AAAA,IACN,MAAK;AAAA,IACL,SAAS;AAAA,IACT,eAAY;AAAA;AAAA;AAS1B,MAAM,QAAQ;AAAA,EAEZ,OAAO,UAAU,OAAO,YAAY;AAAA,EAGpC,kBAAkB,UAAU,QAAQ,YAAY;AAAA,EAGhD,SAAS,UAAU,KAAK,YAAY;AAAA,EAGpC,WAAW,UAAU,KAAK,YAAY;AAAA;AAGxC,gBAAgB,YAAY;AAE5B,MAAM,8BAA8B,SAAS;AAE7C,4BAA4B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,62 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { PropTypes, describe } from "react-desc";
4
+ import { Grid } from "@elliemae/ds-grid";
5
+ import SidePanel from "./SidePanel";
6
+ const TemplateBasicPageWithSidePanel = ({
7
+ globalHeader = null,
8
+ mainHeader = null,
9
+ mainContent,
10
+ mainFooter,
11
+ isOpen = false,
12
+ onClose,
13
+ panelFooter,
14
+ panelHeader,
15
+ panelContent,
16
+ panelWidth
17
+ }) => /* @__PURE__ */ React2.createElement(Grid, {
18
+ style: { overflow: "hidden", width: "100%" },
19
+ height: "100%",
20
+ maxHeight: "100%",
21
+ rows: ["auto", "1fr"]
22
+ }, /* @__PURE__ */ React2.createElement(Grid, null, globalHeader), /* @__PURE__ */ React2.createElement(SidePanel, {
23
+ footer: panelFooter,
24
+ header: panelHeader,
25
+ panelWidth,
26
+ onClose,
27
+ panelContent,
28
+ isOpen
29
+ }, /* @__PURE__ */ React2.createElement(Grid, {
30
+ style: { overflow: "hidden" },
31
+ height: "100%",
32
+ maxHeight: "100%"
33
+ }, /* @__PURE__ */ React2.createElement(Grid, {
34
+ rows: mainFooter ? [mainHeader ? "auto" : "0px", "minmax(0px, 1fr)", "48px"] : [mainHeader ? "auto" : "0px", "minmax(0px, 1fr)"],
35
+ style: { overflow: "hidden" }
36
+ }, /* @__PURE__ */ React2.createElement(Grid, null, mainHeader), /* @__PURE__ */ React2.createElement(Grid, {
37
+ style: { overflow: "hidden" }
38
+ }, /* @__PURE__ */ React2.createElement(Grid, {
39
+ style: { overflow: "auto" }
40
+ }, mainContent)), mainFooter && /* @__PURE__ */ React2.createElement(Grid, {
41
+ alignItems: "center"
42
+ }, mainFooter)))));
43
+ const props = {
44
+ globalHeader: PropTypes.element.description("Global Header"),
45
+ mainHeader: PropTypes.element.description("Main Header"),
46
+ mainContent: PropTypes.element.isRequired.description("Main content"),
47
+ mainFooter: PropTypes.element.description("Main Footer"),
48
+ isOpen: PropTypes.bool.description("Should show the slide panel or not"),
49
+ panelFooter: PropTypes.element.description("Footer for Slide Panel"),
50
+ panelHeader: PropTypes.element.description("Header for Slide Panel instance of SlidePanelHeader"),
51
+ panelContent: PropTypes.element.description("Content for Slide Panel"),
52
+ panelWidth: PropTypes.number.description("Width of the panel open. eg: 300"),
53
+ onClose: PropTypes.func.description("callback")
54
+ };
55
+ TemplateBasicPageWithSidePanel.propTypes = props;
56
+ const DSTemplateBasicPageWithSidePanel = describe(TemplateBasicPageWithSidePanel);
57
+ DSTemplateBasicPageWithSidePanel.propTypes = props;
58
+ export {
59
+ DSTemplateBasicPageWithSidePanel,
60
+ TemplateBasicPageWithSidePanel
61
+ };
62
+ //# sourceMappingURL=TemplateBasicPageWithSidePanel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/TemplateBasicPageWithSidePanel.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { Grid } from '@elliemae/ds-grid';\nimport SidePanel from './SidePanel';\n\nconst TemplateBasicPageWithSidePanel = ({\n globalHeader = null,\n mainHeader = null,\n mainContent,\n mainFooter,\n isOpen = false,\n onClose,\n panelFooter,\n panelHeader,\n panelContent,\n panelWidth,\n}) => (\n <Grid\n style={{ overflow: 'hidden', width: '100%' }}\n height=\"100%\"\n maxHeight=\"100%\"\n rows={['auto', '1fr']}\n >\n <Grid>{globalHeader}</Grid>\n <SidePanel\n footer={panelFooter}\n header={panelHeader}\n panelWidth={panelWidth}\n onClose={onClose}\n panelContent={panelContent}\n isOpen={isOpen}\n >\n <Grid style={{ overflow: 'hidden' }} height=\"100%\" maxHeight=\"100%\">\n <Grid\n rows={\n mainFooter\n ? [mainHeader ? 'auto' : '0px', 'minmax(0px, 1fr)', '48px']\n : [mainHeader ? 'auto' : '0px', 'minmax(0px, 1fr)']\n }\n style={{ overflow: 'hidden' }}\n >\n <Grid>{mainHeader}</Grid>\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>{mainContent}</Grid>\n </Grid>\n {mainFooter && <Grid alignItems=\"center\">{mainFooter}</Grid>}\n </Grid>\n </Grid>\n </SidePanel>\n </Grid>\n);\n\nconst props = {\n /**\n * Global Header\n */\n globalHeader: PropTypes.element.description('Global Header'),\n /**\n * Main Header\n */\n mainHeader: PropTypes.element.description('Main Header'),\n /**\n * Main content\n */\n mainContent: PropTypes.element.isRequired.description('Main content'),\n /**\n * Main Footer\n */\n mainFooter: PropTypes.element.description('Main Footer'),\n /**\n * Should show the slide panel or not\n */\n isOpen: PropTypes.bool.description('Should show the slide panel or not'),\n /**\n * Footer for Slide Panel\n */\n panelFooter: PropTypes.element.description('Footer for Slide Panel'),\n /**\n * Header for Slide Panel instance of SlidePanelHeader\n */\n panelHeader: PropTypes.element.description(\n 'Header for Slide Panel instance of SlidePanelHeader',\n ),\n /**\n * Content for Slide Panel\n */\n panelContent: PropTypes.element.description('Content for Slide Panel'),\n /**\n * Width of the panel open. eg: 300\n */\n panelWidth: PropTypes.number.description('Width of the panel open. eg: 300'),\n /**\n * Callback\n */\n onClose: PropTypes.func.description('callback'),\n};\n\nTemplateBasicPageWithSidePanel.propTypes = props;\n\nconst DSTemplateBasicPageWithSidePanel = describe(\n TemplateBasicPageWithSidePanel,\n);\nDSTemplateBasicPageWithSidePanel.propTypes = props;\n\nexport { TemplateBasicPageWithSidePanel, DSTemplateBasicPageWithSidePanel };\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,iCAAiC,CAAC;AAAA,EACtC,eAAe;AAAA,EACf,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAEA,qCAAC,MAAD;AAAA,EACE,OAAO,EAAE,UAAU,UAAU,OAAO;AAAA,EACpC,QAAO;AAAA,EACP,WAAU;AAAA,EACV,MAAM,CAAC,QAAQ;AAAA,GAEf,qCAAC,MAAD,MAAO,eACP,qCAAC,WAAD;AAAA,EACE,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GAEA,qCAAC,MAAD;AAAA,EAAM,OAAO,EAAE,UAAU;AAAA,EAAY,QAAO;AAAA,EAAO,WAAU;AAAA,GAC3D,qCAAC,MAAD;AAAA,EACE,MACE,aACI,CAAC,aAAa,SAAS,OAAO,oBAAoB,UAClD,CAAC,aAAa,SAAS,OAAO;AAAA,EAEpC,OAAO,EAAE,UAAU;AAAA,GAEnB,qCAAC,MAAD,MAAO,aACP,qCAAC,MAAD;AAAA,EAAM,OAAO,EAAE,UAAU;AAAA,GACvB,qCAAC,MAAD;AAAA,EAAM,OAAO,EAAE,UAAU;AAAA,GAAW,eAErC,cAAc,qCAAC,MAAD;AAAA,EAAM,YAAW;AAAA,GAAU;AAOpD,MAAM,QAAQ;AAAA,EAIZ,cAAc,UAAU,QAAQ,YAAY;AAAA,EAI5C,YAAY,UAAU,QAAQ,YAAY;AAAA,EAI1C,aAAa,UAAU,QAAQ,WAAW,YAAY;AAAA,EAItD,YAAY,UAAU,QAAQ,YAAY;AAAA,EAI1C,QAAQ,UAAU,KAAK,YAAY;AAAA,EAInC,aAAa,UAAU,QAAQ,YAAY;AAAA,EAI3C,aAAa,UAAU,QAAQ,YAC7B;AAAA,EAKF,cAAc,UAAU,QAAQ,YAAY;AAAA,EAI5C,YAAY,UAAU,OAAO,YAAY;AAAA,EAIzC,SAAS,UAAU,KAAK,YAAY;AAAA;AAGtC,+BAA+B,YAAY;AAE3C,MAAM,mCAAmC,SACvC;AAEF,iCAAiC,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ const defaultProps = {
3
+ isOpen: false,
4
+ panelWidth: 300,
5
+ widthWhenIsClosed: 0,
6
+ panelContentOverflow: "auto",
7
+ withBorder: true,
8
+ withBoxShadow: false
9
+ };
10
+ export {
11
+ defaultProps
12
+ };
13
+ //# sourceMappingURL=defaultProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/defaultProps.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const defaultProps = {\n isOpen: false,\n panelWidth: 300,\n widthWhenIsClosed: 0,\n panelContentOverflow: 'auto',\n withBorder: true,\n withBoxShadow: false,\n};\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,YAAY;AAAA,EACZ,eAAe;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ export * from "./SidePanel";
3
+ export * from "./SidePanelHeader";
4
+ export * from "./TemplateBasicPageWithSidePanel";
5
+ import { default as default2 } from "./SidePanel";
6
+ export {
7
+ default2 as default
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './SidePanel';\nexport * from './SidePanelHeader';\nexport * from './TemplateBasicPageWithSidePanel';\nexport { default } from './SidePanel';\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { PropTypes } from "react-desc";
3
+ const props = {
4
+ children: PropTypes.element.isRequired.description("Main content"),
5
+ isOpen: PropTypes.bool.description("Should show the slide panel or not"),
6
+ footer: PropTypes.element.description("Footer for Slide Panel"),
7
+ header: PropTypes.element.description("Header for Slide Panel instance of SlidePanelHeader"),
8
+ panelContent: PropTypes.element.description("Content for Slide Panel"),
9
+ panelWidth: PropTypes.number.description("Width of the panel open. eg: 300"),
10
+ widthWhenIsClosed: PropTypes.number.description("Width of the panel closed. eg: 0"),
11
+ panelContentOverflow: PropTypes.oneOf(["auto", "hidden"]).description("Overflow on SidePanel content"),
12
+ withBorder: PropTypes.bool.description("Whether the sidepanel has border or not"),
13
+ withBoxShadow: PropTypes.bool.description("Whether the sidepanel has box shadow or not"),
14
+ noGridInfluencer: PropTypes.bool.description("Whether the sidepanel is grid-influencer or not")
15
+ };
16
+ export {
17
+ props
18
+ };
19
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/props.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\n\nexport const props = {\n /**\n * Main content\n */\n children: PropTypes.element.isRequired.description('Main content'),\n /**\n * Should show the slide panel or not\n */\n isOpen: PropTypes.bool.description('Should show the slide panel or not'),\n /**\n * Footer for Slide Panel\n */\n footer: PropTypes.element.description('Footer for Slide Panel'),\n /**\n * Header for Slide Panel instance of SlidePanelHeader\n */\n header: PropTypes.element.description('Header for Slide Panel instance of SlidePanelHeader'),\n /**\n * Content for Slide Panel\n */\n panelContent: PropTypes.element.description('Content for Slide Panel'),\n /**\n * Width of the panel open. eg: 300\n */\n panelWidth: PropTypes.number.description('Width of the panel open. eg: 300'),\n\n widthWhenIsClosed: PropTypes.number.description('Width of the panel closed. eg: 0'),\n panelContentOverflow: PropTypes.oneOf(['auto', 'hidden']).description('Overflow on SidePanel content'),\n withBorder: PropTypes.bool.description('Whether the sidepanel has border or not'),\n withBoxShadow: PropTypes.bool.description('Whether the sidepanel has box shadow or not'),\n noGridInfluencer: PropTypes.bool.description('Whether the sidepanel is grid-influencer or not'),\n};\n"],
5
+ "mappings": "AAAA;ACAA;AAEO,MAAM,QAAQ;AAAA,EAInB,UAAU,UAAU,QAAQ,WAAW,YAAY;AAAA,EAInD,QAAQ,UAAU,KAAK,YAAY;AAAA,EAInC,QAAQ,UAAU,QAAQ,YAAY;AAAA,EAItC,QAAQ,UAAU,QAAQ,YAAY;AAAA,EAItC,cAAc,UAAU,QAAQ,YAAY;AAAA,EAI5C,YAAY,UAAU,OAAO,YAAY;AAAA,EAEzC,mBAAmB,UAAU,OAAO,YAAY;AAAA,EAChD,sBAAsB,UAAU,MAAM,CAAC,QAAQ,WAAW,YAAY;AAAA,EACtE,YAAY,UAAU,KAAK,YAAY;AAAA,EACvC,eAAe,UAAU,KAAK,YAAY;AAAA,EAC1C,kBAAkB,UAAU,KAAK,YAAY;AAAA;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,35 +1,38 @@
1
1
  {
2
2
  "name": "@elliemae/ds-side-panel",
3
- "version": "3.0.0-next.2",
3
+ "version": "3.0.0-next.3",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Side Panel",
6
- "module": "./esm/index.js",
7
- "main": "./cjs/index.js",
8
- "types": "./types/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
9
12
  "exports": {
10
13
  ".": {
11
- "import": "./esm/index.js",
12
- "require": "./cjs/index.js"
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
13
16
  },
14
17
  "./TemplateBasicPageWithSidePanel": {
15
- "import": "./esm/TemplateBasicPageWithSidePanel.js",
16
- "require": "./cjs/TemplateBasicPageWithSidePanel.js"
18
+ "import": "./dist/esm/TemplateBasicPageWithSidePanel.js",
19
+ "require": "./dist/cjs/TemplateBasicPageWithSidePanel.js"
17
20
  },
18
21
  "./SidePanelHeader": {
19
- "import": "./esm/SidePanelHeader.js",
20
- "require": "./cjs/SidePanelHeader.js"
22
+ "import": "./dist/esm/SidePanelHeader.js",
23
+ "require": "./dist/cjs/SidePanelHeader.js"
21
24
  },
22
25
  "./SidePanel": {
23
- "import": "./esm/SidePanel.js",
24
- "require": "./cjs/SidePanel.js"
26
+ "import": "./dist/esm/SidePanel.js",
27
+ "require": "./dist/cjs/SidePanel.js"
25
28
  },
26
29
  "./props": {
27
- "import": "./esm/props.js",
28
- "require": "./cjs/props.js"
30
+ "import": "./dist/esm/props.js",
31
+ "require": "./dist/cjs/props.js"
29
32
  },
30
33
  "./defaultProps": {
31
- "import": "./esm/defaultProps.js",
32
- "require": "./cjs/defaultProps.js"
34
+ "import": "./dist/esm/defaultProps.js",
35
+ "require": "./dist/cjs/defaultProps.js"
33
36
  }
34
37
  },
35
38
  "sideEffects": [
@@ -41,21 +44,21 @@
41
44
  "url": "https://git.elliemae.io/platform-ui/dimsum.git"
42
45
  },
43
46
  "engines": {
44
- "npm": ">=7",
45
- "node": ">=14"
47
+ "pnpm": ">=6",
48
+ "node": ">=16"
46
49
  },
47
50
  "author": "ICE MT",
48
- "scripts": {
49
- "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
50
- "prebuild": "exit 0",
51
- "predev": "exit 0",
52
- "build": "node ../../scripts/build/build.js"
51
+ "jestSonar": {
52
+ "sonar56x": true,
53
+ "reportPath": "reports",
54
+ "reportFile": "tests.xml",
55
+ "indent": 4
53
56
  },
54
57
  "dependencies": {
55
- "@elliemae/ds-button": "3.0.0-next.2",
56
- "@elliemae/ds-grid": "3.0.0-next.2",
57
- "@elliemae/ds-icons": "3.0.0-next.2",
58
- "@elliemae/ds-system": "3.0.0-next.2",
58
+ "@elliemae/ds-button": "3.0.0-next.3",
59
+ "@elliemae/ds-grid": "3.0.0-next.3",
60
+ "@elliemae/ds-icons": "3.0.0-next.3",
61
+ "@elliemae/ds-system": "3.0.0-next.3",
59
62
  "react-desc": "~4.1.3"
60
63
  },
61
64
  "devDependencies": {
@@ -69,7 +72,13 @@
69
72
  },
70
73
  "publishConfig": {
71
74
  "access": "public",
72
- "directory": "dist",
73
- "generateSubmodules": true
75
+ "typeSafety": false
76
+ },
77
+ "scripts": {
78
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
79
+ "test": "node ../../scripts/testing/test.mjs",
80
+ "lint": "node ../../scripts/lint.mjs",
81
+ "dts": "node ../../scripts/dts.mjs",
82
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
74
83
  }
75
84
  }
package/cjs/SidePanel.js DELETED
@@ -1,97 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- require('react');
7
- var reactDesc = require('react-desc');
8
- var styled = require('styled-components');
9
- var dsSystem = require('@elliemae/ds-system');
10
- var dsGrid = require('@elliemae/ds-grid');
11
- var props = require('./props.js');
12
- var defaultProps = require('./defaultProps.js');
13
-
14
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
-
16
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
17
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
18
-
19
- const Container = /*#__PURE__*/styled__default["default"].div.withConfig({
20
- componentId: "sc-71f9h4-0"
21
- })(["display:flex;height:100%;flex-direction:row;max-height:100%;overflow:hidden;", ""], _ref => {
22
- let {
23
- noGridInfluencer
24
- } = _ref;
25
- return noGridInfluencer ? 'position: relative;' : '';
26
- });
27
- const TransGrid = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
28
- componentId: "sc-71f9h4-1"
29
- })(["box-shadow:", ";transition:300ms;border-left:", ";", " background:", ";"], props => props.withBoxShadow ? '0 2px 5px 0 rgba(53, 60, 70, 0.5)' : 'none', props => props.withBorder ? dsSystem.border(props.theme.colors.neutral['300'], '1px') : 'none', _ref2 => {
30
- let {
31
- noGridInfluencer
32
- } = _ref2;
33
- return noGridInfluencer ? "\n position: absolute;\n top:0;\n right:0;\n height: 100%;\n " : '';
34
- }, props => props.theme.colors.neutral['000']);
35
- const FooterContainer = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
36
- componentId: "sc-71f9h4-2"
37
- })(["border-top:", ";"], props => dsSystem.border(props.theme.colors.neutral['300']));
38
-
39
- const SidePanel = _ref3 => {
40
- let {
41
- children,
42
- isOpen,
43
- footer,
44
- header,
45
- panelContent,
46
- panelWidth,
47
- panelContentOverflow,
48
- widthWhenIsClosed,
49
- noGridInfluencer,
50
- withBorder = true,
51
- withBoxShadow = false
52
- } = _ref3;
53
- return /*#__PURE__*/_jsx__default["default"](Container, {
54
- noGridInfluencer: noGridInfluencer
55
- }, void 0, /*#__PURE__*/_jsx__default["default"](TransGrid, {
56
- height: "100%",
57
- flex: "1",
58
- mr: noGridInfluencer ? "".concat(widthWhenIsClosed, "px") : 0
59
- }, void 0, children), /*#__PURE__*/_jsx__default["default"](TransGrid, {
60
- style: {
61
- overflow: 'hidden'
62
- },
63
- height: "100%",
64
- maxHeight: "100%",
65
- width: isOpen ? "".concat(panelWidth, "px") : "".concat(widthWhenIsClosed, "px"),
66
- withBorder: withBorder,
67
- withBoxShadow: withBoxShadow,
68
- isOpen: isOpen,
69
- cols: [1],
70
- noGridInfluencer: noGridInfluencer
71
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
72
- rows: footer ? [header ? '48px' : '0px', 'minmax(0px, 1fr)', '48px'] : [header ? '48px' : '0px', 'minmax(0px, 1fr)'],
73
- style: {
74
- overflow: 'hidden'
75
- }
76
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {}, void 0, header), /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
77
- style: {
78
- overflow: 'hidden'
79
- }
80
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
81
- style: {
82
- overflow: panelContentOverflow
83
- }
84
- }, void 0, panelContent)), footer ? /*#__PURE__*/_jsx__default["default"](FooterContainer, {
85
- alignItems: "center",
86
- pl: "xs",
87
- pr: "xs"
88
- }, void 0, footer) : null)));
89
- };
90
-
91
- SidePanel.defaultProps = defaultProps.defaultProps;
92
- const DSSidePanelWithSchema = reactDesc.describe(SidePanel);
93
- DSSidePanelWithSchema.propTypes = props.props;
94
-
95
- exports.DSSidePanelWithSchema = DSSidePanelWithSchema;
96
- exports.SidePanel = SidePanel;
97
- exports["default"] = SidePanel;
@@ -1,100 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- require('react');
7
- var reactDesc = require('react-desc');
8
- var styled = require('styled-components');
9
- var lodash = require('lodash');
10
- var dsSystem = require('@elliemae/ds-system');
11
- var dsIcons = require('@elliemae/ds-icons');
12
- var DSButton = require('@elliemae/ds-button');
13
- var dsGrid = require('@elliemae/ds-grid');
14
-
15
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
-
17
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
18
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
19
- var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
20
-
21
- var _Grid, _CloseSmall;
22
- const StyledSeparator = /*#__PURE__*/styled__default["default"].div.withConfig({
23
- componentId: "sc-1xdsdq5-0"
24
- })(["width:0;height:100%;margin:0 ", ";border-left:", ";"], props => props.theme.space.xxs, props => "".concat(props.theme.colors.neutral[300], " 1px solid"));
25
- const StyledTitle = /*#__PURE__*/styled__default["default"].div.withConfig({
26
- componentId: "sc-1xdsdq5-1"
27
- })(["font-size:18px;font-weight:", ";color:", ";", ""], props => props.theme.fontWeights.regular, props => props.theme.colors.neutral['700'], dsSystem.truncate());
28
- const Wrapper = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
29
- componentId: "sc-1xdsdq5-2"
30
- })(["border-bottom:", ";"], props => dsSystem.border(props.theme.colors.neutral['300']));
31
-
32
- const SidePanelHeader = _ref => {
33
- let {
34
- title = null,
35
- additionalAction = null,
36
- onClose = lodash.noop,
37
- showClose = true
38
- } = _ref;
39
- const theme = dsSystem.useTheme();
40
-
41
- const separator = _Grid || (_Grid = /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
42
- height: "24px"
43
- }, void 0, /*#__PURE__*/_jsx__default["default"](StyledSeparator, {})));
44
-
45
- const cols = [1, 'auto', 'auto'];
46
- const cols2 = ['auto'];
47
- return /*#__PURE__*/_jsx__default["default"](Wrapper, {
48
- cols: cols,
49
- height: theme.space.m,
50
- pl: theme.space.xs,
51
- pr: theme.space.xs,
52
- alignItems: "center",
53
- width: "100%"
54
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
55
- alignItems: "center",
56
- justifyContent: "flex-start",
57
- cols: cols2
58
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
59
- cols: [1],
60
- alignItems: "center",
61
- pr: theme.space.xs
62
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
63
- flexGrow: 0
64
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
65
- cols: ['auto', 'auto'],
66
- alignItems: "center"
67
- }, void 0, /*#__PURE__*/_jsx__default["default"](StyledTitle, {
68
- maxWidth: "100%",
69
- alignItems: "center"
70
- }, void 0, title))))), /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
71
- ml: "xxs",
72
- alignItems: "center",
73
- cols: additionalAction ? ['auto', 'auto', 'auto'] : ['auto']
74
- }, void 0, additionalAction && /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {}, void 0, additionalAction), additionalAction && showClose && separator, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {}, void 0, showClose && /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
75
- buttonType: "text",
76
- icon: _CloseSmall || (_CloseSmall = /*#__PURE__*/_jsx__default["default"](dsIcons.CloseSmall, {})),
77
- size: "m",
78
- onClick: onClose,
79
- "data-testid": "btn-close-slide-panel"
80
- }))));
81
- };
82
-
83
- const props = {
84
- /** Page title */
85
- title: reactDesc.PropTypes.string.description('Page title'),
86
-
87
- /** Action button */
88
- additionalAction: reactDesc.PropTypes.element.description('Action button'),
89
-
90
- /** Called when the slide collapse */
91
- onClose: reactDesc.PropTypes.func.description('Called when the slide collapse'),
92
-
93
- /** Show/Hide close button */
94
- showClose: reactDesc.PropTypes.bool.description('Show/Hide close button')
95
- };
96
- const DSSidePanelHeaderWithSchema = reactDesc.describe(SidePanelHeader);
97
- DSSidePanelHeaderWithSchema.propTypes = props;
98
-
99
- exports.DSSidePanelHeaderWithSchema = DSSidePanelHeaderWithSchema;
100
- exports.SidePanelHeader = SidePanelHeader;