@neo4j-ndl/react 4.9.17 → 4.9.18

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 (53) hide show
  1. package/lib/cjs/_common/readme-docs-page.js +55 -0
  2. package/lib/cjs/_common/readme-docs-page.js.map +1 -0
  3. package/lib/cjs/drawer/Drawer.js +144 -31
  4. package/lib/cjs/drawer/Drawer.js.map +1 -1
  5. package/lib/cjs/drawer/stories/drawer-full.story.js +3 -1
  6. package/lib/cjs/drawer/stories/drawer-full.story.js.map +1 -1
  7. package/lib/cjs/drawer/stories/drawer-not-closeable.story.js +2 -4
  8. package/lib/cjs/drawer/stories/drawer-not-closeable.story.js.map +1 -1
  9. package/lib/cjs/drawer/stories/drawer-overlay.story.js +5 -3
  10. package/lib/cjs/drawer/stories/drawer-overlay.story.js.map +1 -1
  11. package/lib/cjs/drawer/stories/drawer-portaled.story.js +8 -7
  12. package/lib/cjs/drawer/stories/drawer-portaled.story.js.map +1 -1
  13. package/lib/cjs/drawer/stories/drawer-push.story.js +4 -2
  14. package/lib/cjs/drawer/stories/drawer-push.story.js.map +1 -1
  15. package/lib/cjs/drawer/stories/drawer-resizable.story.js +5 -3
  16. package/lib/cjs/drawer/stories/drawer-resizable.story.js.map +1 -1
  17. package/lib/cjs/drawer/stories/drawer-right-side.story.js +4 -2
  18. package/lib/cjs/drawer/stories/drawer-right-side.story.js.map +1 -1
  19. package/lib/cjs/drawer/stories/drawer-scrollable.story.js +4 -2
  20. package/lib/cjs/drawer/stories/drawer-scrollable.story.js.map +1 -1
  21. package/lib/esm/_common/readme-docs-page.js +52 -0
  22. package/lib/esm/_common/readme-docs-page.js.map +1 -0
  23. package/lib/esm/drawer/Drawer.js +146 -33
  24. package/lib/esm/drawer/Drawer.js.map +1 -1
  25. package/lib/esm/drawer/stories/drawer-full.story.js +3 -1
  26. package/lib/esm/drawer/stories/drawer-full.story.js.map +1 -1
  27. package/lib/esm/drawer/stories/drawer-not-closeable.story.js +3 -5
  28. package/lib/esm/drawer/stories/drawer-not-closeable.story.js.map +1 -1
  29. package/lib/esm/drawer/stories/drawer-overlay.story.js +5 -3
  30. package/lib/esm/drawer/stories/drawer-overlay.story.js.map +1 -1
  31. package/lib/esm/drawer/stories/drawer-portaled.story.js +10 -9
  32. package/lib/esm/drawer/stories/drawer-portaled.story.js.map +1 -1
  33. package/lib/esm/drawer/stories/drawer-push.story.js +4 -2
  34. package/lib/esm/drawer/stories/drawer-push.story.js.map +1 -1
  35. package/lib/esm/drawer/stories/drawer-resizable.story.js +5 -3
  36. package/lib/esm/drawer/stories/drawer-resizable.story.js.map +1 -1
  37. package/lib/esm/drawer/stories/drawer-right-side.story.js +4 -2
  38. package/lib/esm/drawer/stories/drawer-right-side.story.js.map +1 -1
  39. package/lib/esm/drawer/stories/drawer-scrollable.story.js +4 -2
  40. package/lib/esm/drawer/stories/drawer-scrollable.story.js.map +1 -1
  41. package/lib/types/_common/readme-docs-page.d.ts +23 -0
  42. package/lib/types/_common/readme-docs-page.d.ts.map +1 -0
  43. package/lib/types/drawer/Drawer.d.ts +32 -7
  44. package/lib/types/drawer/Drawer.d.ts.map +1 -1
  45. package/lib/types/drawer/stories/drawer-full.story.d.ts.map +1 -1
  46. package/lib/types/drawer/stories/drawer-not-closeable.story.d.ts.map +1 -1
  47. package/lib/types/drawer/stories/drawer-overlay.story.d.ts.map +1 -1
  48. package/lib/types/drawer/stories/drawer-portaled.story.d.ts.map +1 -1
  49. package/lib/types/drawer/stories/drawer-push.story.d.ts.map +1 -1
  50. package/lib/types/drawer/stories/drawer-resizable.story.d.ts.map +1 -1
  51. package/lib/types/drawer/stories/drawer-right-side.story.d.ts.map +1 -1
  52. package/lib/types/drawer/stories/drawer-scrollable.story.d.ts.map +1 -1
  53. package/package.json +3 -2
@@ -26,11 +26,13 @@ const react_1 = require("@neo4j-ndl/react");
26
26
  const react_2 = require("react");
27
27
  const Component = () => {
28
28
  const [isExpanded, setIsExpanded] = (0, react_2.useState)(true);
29
- const Placeholder = () => ((0, jsx_runtime_1.jsx)("div", { className: "n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(true), children: "Press to show the Drawer" }) }) }));
30
- return ((0, jsx_runtime_1.jsxs)("div", { className: "n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden", children: [(0, jsx_runtime_1.jsxs)(react_1.Drawer, { type: "overlay", isExpanded: isExpanded, onExpandedChange: () => setIsExpanded(false), position: "left", isResizeable: true, resizeableProps: {
29
+ const Placeholder = () => ((0, jsx_runtime_1.jsx)("div", { className: "n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(true), htmlAttributes: {
30
+ 'aria-expanded': isExpanded,
31
+ }, children: "Press to show the Drawer" }) }) }));
32
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden", children: [(0, jsx_runtime_1.jsxs)(react_1.Drawer, { type: "push", isExpanded: isExpanded, onExpandedChange: () => setIsExpanded(false), position: "left", isResizeable: true, resizeableProps: {
31
33
  maxWidth: '400px',
32
34
  minWidth: '300px',
33
- }, children: [(0, jsx_runtime_1.jsx)(react_1.Drawer.Header, { children: "Drawer Header" }), (0, jsx_runtime_1.jsx)(react_1.Drawer.Body, { children: "Lorem ipsum dolor sit amet." }), (0, jsx_runtime_1.jsx)(react_1.Drawer.Actions, { children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(false), size: "medium", children: "Close" }) })] }), (0, jsx_runtime_1.jsx)(Placeholder, {})] }));
35
+ }, children: [(0, jsx_runtime_1.jsx)(react_1.Drawer.Header, { children: "Drawer" }), (0, jsx_runtime_1.jsx)(react_1.Drawer.Body, { children: "Lorem ipsum dolor sit amet." }), (0, jsx_runtime_1.jsx)(react_1.Drawer.Actions, { children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(false), size: "medium", children: "Close" }) })] }), (0, jsx_runtime_1.jsx)(Placeholder, {})] }));
34
36
  };
35
37
  exports.default = Component;
36
38
  //# sourceMappingURL=drawer-resizable.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-resizable.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-resizable.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mDAAiD;AAEjD,4CAAwD;AACxD,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,gCAAK,SAAS,EAAC,gGAAgG,YAC7G,gCAAK,SAAS,EAAC,wIAAwI,YACrJ,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,yCAEjC,GACX,GACF,CACP,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAC,2EAA2E,aACxF,wBAAC,cAAM,IACL,IAAI,EAAC,SAAS,EACd,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAC5C,QAAQ,EAAC,MAAM,EACf,YAAY,EAAE,IAAI,EAClB,eAAe,EAAE;oBACf,QAAQ,EAAE,OAAO;oBACjB,QAAQ,EAAE,OAAO;iBAClB,aAED,uBAAC,cAAM,CAAC,MAAM,gCAA8B,EAC5C,uBAAC,cAAM,CAAC,IAAI,8CAA0C,EACtD,uBAAC,cAAM,CAAC,OAAO,cACb,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,QAAQ,sBAEjD,GACA,IACV,EACT,uBAAC,WAAW,KAAG,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Drawer, FilledButton } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const Placeholder = () => (\n <div className=\"n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\">\n <FilledButton onClick={() => setIsExpanded(true)}>\n Press to show the Drawer\n </FilledButton>\n </div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Drawer\n type=\"overlay\"\n isExpanded={isExpanded}\n onExpandedChange={() => setIsExpanded(false)}\n position=\"left\"\n isResizeable={true}\n resizeableProps={{\n maxWidth: '400px',\n minWidth: '300px',\n }}\n >\n <Drawer.Header>Drawer Header</Drawer.Header>\n <Drawer.Body>Lorem ipsum dolor sit amet.</Drawer.Body>\n <Drawer.Actions>\n <FilledButton onClick={() => setIsExpanded(false)} size=\"medium\">\n Close\n </FilledButton>\n </Drawer.Actions>\n </Drawer>\n <Placeholder />\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"drawer-resizable.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-resizable.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mDAAiD;AAEjD,4CAAwD;AACxD,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,gCAAK,SAAS,EAAC,gGAAgG,YAC7G,gCAAK,SAAS,EAAC,wIAAwI,YACrJ,uBAAC,oBAAY,IACX,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,cAAc,EAAE;oBACd,eAAe,EAAE,UAAU;iBAC5B,yCAGY,GACX,GACF,CACP,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAC,2EAA2E,aACxF,wBAAC,cAAM,IACL,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAC5C,QAAQ,EAAC,MAAM,EACf,YAAY,EAAE,IAAI,EAClB,eAAe,EAAE;oBACf,QAAQ,EAAE,OAAO;oBACjB,QAAQ,EAAE,OAAO;iBAClB,aAED,uBAAC,cAAM,CAAC,MAAM,yBAAuB,EACrC,uBAAC,cAAM,CAAC,IAAI,8CAA0C,EACtD,uBAAC,cAAM,CAAC,OAAO,cACb,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,QAAQ,sBAEjD,GACA,IACV,EACT,uBAAC,WAAW,KAAG,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Drawer, FilledButton } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const Placeholder = () => (\n <div className=\"n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\">\n <FilledButton\n onClick={() => setIsExpanded(true)}\n htmlAttributes={{\n 'aria-expanded': isExpanded,\n }}\n >\n Press to show the Drawer\n </FilledButton>\n </div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Drawer\n type=\"push\"\n isExpanded={isExpanded}\n onExpandedChange={() => setIsExpanded(false)}\n position=\"left\"\n isResizeable={true}\n resizeableProps={{\n maxWidth: '400px',\n minWidth: '300px',\n }}\n >\n <Drawer.Header>Drawer</Drawer.Header>\n <Drawer.Body>Lorem ipsum dolor sit amet.</Drawer.Body>\n <Drawer.Actions>\n <FilledButton onClick={() => setIsExpanded(false)} size=\"medium\">\n Close\n </FilledButton>\n </Drawer.Actions>\n </Drawer>\n <Placeholder />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -26,8 +26,10 @@ const react_1 = require("@neo4j-ndl/react");
26
26
  const react_2 = require("react");
27
27
  const Component = () => {
28
28
  const [isExpanded, setIsExpanded] = (0, react_2.useState)(true);
29
- const Placeholder = () => ((0, jsx_runtime_1.jsx)("div", { className: "n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(true), children: "Press to show the Drawer" }) }) }));
30
- return ((0, jsx_runtime_1.jsxs)("div", { className: "n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden", children: [(0, jsx_runtime_1.jsx)(Placeholder, {}), (0, jsx_runtime_1.jsxs)(react_1.Drawer, { type: "overlay", isExpanded: isExpanded, onExpandedChange: () => setIsExpanded(false), position: "right", children: [(0, jsx_runtime_1.jsx)(react_1.Drawer.Header, { children: "Drawer Header" }), (0, jsx_runtime_1.jsx)(react_1.Drawer.Body, { children: "Lorem ipsum dolor sit amet." }), (0, jsx_runtime_1.jsx)(react_1.Drawer.Actions, { children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(false), size: "medium", children: "Close" }) })] })] }));
29
+ const Placeholder = () => ((0, jsx_runtime_1.jsx)("div", { className: "n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(true), htmlAttributes: {
30
+ 'aria-expanded': isExpanded,
31
+ }, children: "Press to show the Drawer" }) }) }));
32
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden", children: [(0, jsx_runtime_1.jsx)(Placeholder, {}), (0, jsx_runtime_1.jsxs)(react_1.Drawer, { type: "push", isExpanded: isExpanded, onExpandedChange: () => setIsExpanded(false), position: "right", children: [(0, jsx_runtime_1.jsx)(react_1.Drawer.Header, { children: "Drawer" }), (0, jsx_runtime_1.jsx)(react_1.Drawer.Body, { children: "Lorem ipsum dolor sit amet." }), (0, jsx_runtime_1.jsx)(react_1.Drawer.Actions, { children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(false), size: "medium", children: "Close" }) })] })] }));
31
33
  };
32
34
  exports.default = Component;
33
35
  //# sourceMappingURL=drawer-right-side.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-right-side.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-right-side.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mDAAiD;AAEjD,4CAAwD;AACxD,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,gCAAK,SAAS,EAAC,gGAAgG,YAC7G,gCAAK,SAAS,EAAC,wIAAwI,YACrJ,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,yCAEjC,GACX,GACF,CACP,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAC,2EAA2E,aACxF,uBAAC,WAAW,KAAG,EACf,wBAAC,cAAM,IACL,IAAI,EAAC,SAAS,EACd,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAC5C,QAAQ,EAAC,OAAO,aAEhB,uBAAC,cAAM,CAAC,MAAM,gCAA8B,EAC5C,uBAAC,cAAM,CAAC,IAAI,8CAA0C,EACtD,uBAAC,cAAM,CAAC,OAAO,cACb,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,QAAQ,sBAEjD,GACA,IACV,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Drawer, FilledButton } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const Placeholder = () => (\n <div className=\"n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\">\n <FilledButton onClick={() => setIsExpanded(true)}>\n Press to show the Drawer\n </FilledButton>\n </div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Placeholder />\n <Drawer\n type=\"overlay\"\n isExpanded={isExpanded}\n onExpandedChange={() => setIsExpanded(false)}\n position=\"right\"\n >\n <Drawer.Header>Drawer Header</Drawer.Header>\n <Drawer.Body>Lorem ipsum dolor sit amet.</Drawer.Body>\n <Drawer.Actions>\n <FilledButton onClick={() => setIsExpanded(false)} size=\"medium\">\n Close\n </FilledButton>\n </Drawer.Actions>\n </Drawer>\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"drawer-right-side.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-right-side.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mDAAiD;AAEjD,4CAAwD;AACxD,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,gCAAK,SAAS,EAAC,gGAAgG,YAC7G,gCAAK,SAAS,EAAC,wIAAwI,YACrJ,uBAAC,oBAAY,IACX,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,cAAc,EAAE;oBACd,eAAe,EAAE,UAAU;iBAC5B,yCAGY,GACX,GACF,CACP,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAC,2EAA2E,aACxF,uBAAC,WAAW,KAAG,EACf,wBAAC,cAAM,IACL,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAC5C,QAAQ,EAAC,OAAO,aAEhB,uBAAC,cAAM,CAAC,MAAM,yBAAuB,EACrC,uBAAC,cAAM,CAAC,IAAI,8CAA0C,EACtD,uBAAC,cAAM,CAAC,OAAO,cACb,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,QAAQ,sBAEjD,GACA,IACV,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Drawer, FilledButton } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const Placeholder = () => (\n <div className=\"n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\">\n <FilledButton\n onClick={() => setIsExpanded(true)}\n htmlAttributes={{\n 'aria-expanded': isExpanded,\n }}\n >\n Press to show the Drawer\n </FilledButton>\n </div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Placeholder />\n <Drawer\n type=\"push\"\n isExpanded={isExpanded}\n onExpandedChange={() => setIsExpanded(false)}\n position=\"right\"\n >\n <Drawer.Header>Drawer</Drawer.Header>\n <Drawer.Body>Lorem ipsum dolor sit amet.</Drawer.Body>\n <Drawer.Actions>\n <FilledButton onClick={() => setIsExpanded(false)} size=\"medium\">\n Close\n </FilledButton>\n </Drawer.Actions>\n </Drawer>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -26,8 +26,10 @@ const react_1 = require("@neo4j-ndl/react");
26
26
  const react_2 = require("react");
27
27
  const Component = () => {
28
28
  const [isExpanded, setIsExpanded] = (0, react_2.useState)(true);
29
- const Placeholder = () => ((0, jsx_runtime_1.jsx)("div", { className: "w-full n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16", children: (0, jsx_runtime_1.jsx)("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(true), children: "Press to show the Drawer" }) }) }));
30
- return ((0, jsx_runtime_1.jsxs)("div", { className: "n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden", children: [(0, jsx_runtime_1.jsxs)(react_1.Drawer, { type: "overlay", isExpanded: isExpanded, onExpandedChange: () => setIsExpanded(false), children: [(0, jsx_runtime_1.jsx)(react_1.Drawer.Header, { children: "Drawer Header" }), (0, jsx_runtime_1.jsxs)(react_1.Drawer.Body, { children: [(0, jsx_runtime_1.jsx)(react_1.TextInput, { showRequiredOrOptionalLabel: true, moreInformationText: "some information", label: "Label", isDisabled: false, isReadOnly: false, helpText: "Friendly text", isFluid: true }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Some input", value: "something" }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.Checkbox, { label: "Checkbox label" }), (0, jsx_runtime_1.jsx)("br", {}), "Some example of something.", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Some input", isDisabled: true, value: "something" }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { showRequiredOrOptionalLabel: true, moreInformationText: "some information", label: "Label", isDisabled: false, isReadOnly: false, helpText: "Friendly text", isFluid: true }), (0, jsx_runtime_1.jsx)("br", {}), "Some example of something.", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Some input", value: "something" }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.Checkbox, { label: "Checkbox label" }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Some input", value: "something" })] })] }), (0, jsx_runtime_1.jsx)(Placeholder, {})] }));
29
+ const Placeholder = () => ((0, jsx_runtime_1.jsx)("div", { className: "w-full n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16", children: (0, jsx_runtime_1.jsx)("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsExpanded(true), htmlAttributes: {
30
+ 'aria-expanded': isExpanded,
31
+ }, children: "Press to show the Drawer" }) }) }));
32
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden", children: [(0, jsx_runtime_1.jsxs)(react_1.Drawer, { type: "push", isExpanded: isExpanded, onExpandedChange: () => setIsExpanded(false), children: [(0, jsx_runtime_1.jsx)(react_1.Drawer.Header, { children: "Drawer" }), (0, jsx_runtime_1.jsxs)(react_1.Drawer.Body, { children: [(0, jsx_runtime_1.jsx)(react_1.TextInput, { showRequiredOrOptionalLabel: true, moreInformationText: "some information", label: "Label", isDisabled: false, isReadOnly: false, helpText: "Friendly text", isFluid: true }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Some input", value: "something" }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.Checkbox, { label: "Checkbox label" }), (0, jsx_runtime_1.jsx)("br", {}), "Some example of something.", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Some input", isDisabled: true, value: "something" }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { showRequiredOrOptionalLabel: true, moreInformationText: "some information", label: "Label", isDisabled: false, isReadOnly: false, helpText: "Friendly text", isFluid: true }), (0, jsx_runtime_1.jsx)("br", {}), "Some example of something.", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Some input", value: "something" }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.Checkbox, { label: "Checkbox label" }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Some input", value: "something" })] })] }), (0, jsx_runtime_1.jsx)(Placeholder, {})] }));
31
33
  };
32
34
  exports.default = Component;
33
35
  //# sourceMappingURL=drawer-scrollable.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-scrollable.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-scrollable.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mDAAiD;AAEjD,4CAA6E;AAC7E,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,gCAAK,SAAS,EAAC,gGAAgG,YAC7G,gCAAK,SAAS,EAAC,wIAAwI,YACrJ,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,C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AAW,GAAG,IACtC,IACP,EACT,uBAAC,WAAW,KAAG,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Checkbox, Drawer, FilledButton, TextInput } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const Placeholder = () => (\n <div className=\"w-full n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\">\n <FilledButton onClick={() => setIsExpanded(true)}>\n Press to show the Drawer\n </FilledButton>\n </div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Drawer\n type=\"overlay\"\n isExpanded={isExpanded}\n onExpandedChange={() => setIsExpanded(false)}\n >\n <Drawer.Header>Drawer Header</Drawer.Header>\n <Drawer.Body>\n <TextInput\n showRequiredOrOptionalLabel={true}\n moreInformationText=\"some information\"\n label=\"Label\"\n isDisabled={false}\n isReadOnly={false}\n helpText=\"Friendly text\"\n isFluid={true}\n />\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n <br />\n <Checkbox label=\"Checkbox label\" />\n <br />\n Some example of something.\n <br />\n <TextInput label=\"Some input\" isDisabled={true} value=\"something\" />\n <br />\n <TextInput\n showRequiredOrOptionalLabel={true}\n moreInformationText=\"some information\"\n label=\"Label\"\n isDisabled={false}\n isReadOnly={false}\n helpText=\"Friendly text\"\n isFluid={true}\n />\n <br />\n Some example of something.\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n <br />\n <Checkbox label=\"Checkbox label\" />\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n </Drawer.Body>\n </Drawer>\n <Placeholder />\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"drawer-scrollable.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-scrollable.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mDAAiD;AAEjD,4CAA6E;AAC7E,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,gCAAK,SAAS,EAAC,gGAAgG,YAC7G,gCAAK,SAAS,EAAC,wIAAwI,YACrJ,uBAAC,oBAAY,IACX,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,cAAc,EAAE;oBACd,eAAe,EAAE,UAAU;iBAC5B,yCAGY,GACX,GACF,CACP,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAC,2EAA2E,aACxF,wBAAC,cAAM,IACL,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,aAE5C,uBAAC,cAAM,CAAC,MAAM,yBAAuB,EACrC,wBAAC,cAAM,CAAC,IAAI,eACV,uBAAC,iBAAS,IACR,2BAA2B,EAAE,IAAI,EACjC,mBAAmB,EAAC,kBAAkB,EACtC,KAAK,EAAC,OAAO,EACb,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAC,eAAe,EACxB,OAAO,EAAE,IAAI,GACb,EACF,gCAAM,EACN,uBAAC,iBAAS,IAAC,KAAK,EAAC,YAAY,EAAC,KAAK,EAAC,WAAW,GAAG,EAClD,gCAAM,EACN,uBAAC,gBAAQ,IAAC,KAAK,EAAC,gBAAgB,GAAG,EACnC,gCAAM,gCAEN,gCAAM,EACN,uBAAC,iBAAS,IAAC,KAAK,EAAC,YAAY,EAAC,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC,WAAW,GAAG,EACpE,gCAAM,EACN,uBAAC,iBAAS,IACR,2BAA2B,EAAE,IAAI,EACjC,mBAAmB,EAAC,kBAAkB,EACtC,KAAK,EAAC,OAAO,EACb,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAC,eAAe,EACxB,OAAO,EAAE,IAAI,GACb,EACF,gCAAM,gCAEN,gCAAM,EACN,uBAAC,iBAAS,IAAC,KAAK,EAAC,YAAY,EAAC,KAAK,EAAC,WAAW,GAAG,EAClD,gCAAM,EACN,uBAAC,gBAAQ,IAAC,KAAK,EAAC,gBAAgB,GAAG,EACnC,gCAAM,EACN,uBAAC,iBAAS,IAAC,KAAK,EAAC,YAAY,EAAC,KAAK,EAAC,WAAW,GAAG,IACtC,IACP,EACT,uBAAC,WAAW,KAAG,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Checkbox, Drawer, FilledButton, TextInput } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const Placeholder = () => (\n <div className=\"w-full n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\">\n <FilledButton\n onClick={() => setIsExpanded(true)}\n htmlAttributes={{\n 'aria-expanded': isExpanded,\n }}\n >\n Press to show the Drawer\n </FilledButton>\n </div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Drawer\n type=\"push\"\n isExpanded={isExpanded}\n onExpandedChange={() => setIsExpanded(false)}\n >\n <Drawer.Header>Drawer</Drawer.Header>\n <Drawer.Body>\n <TextInput\n showRequiredOrOptionalLabel={true}\n moreInformationText=\"some information\"\n label=\"Label\"\n isDisabled={false}\n isReadOnly={false}\n helpText=\"Friendly text\"\n isFluid={true}\n />\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n <br />\n <Checkbox label=\"Checkbox label\" />\n <br />\n Some example of something.\n <br />\n <TextInput label=\"Some input\" isDisabled={true} value=\"something\" />\n <br />\n <TextInput\n showRequiredOrOptionalLabel={true}\n moreInformationText=\"some information\"\n label=\"Label\"\n isDisabled={false}\n isReadOnly={false}\n helpText=\"Friendly text\"\n isFluid={true}\n />\n <br />\n Some example of something.\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n <br />\n <Checkbox label=\"Checkbox label\" />\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n </Drawer.Body>\n </Drawer>\n <Placeholder />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ import { Markdown } from '@storybook/addon-docs/blocks';
23
+ /**
24
+ * Creates a Storybook docs page component that renders markdown content (e.g. a README.md).
25
+ *
26
+ * Requires the `autodocs` tag on the component meta to create a Docs entry in the sidebar
27
+ * (the global preview config disables autodocs with `!autodocs`).
28
+ *
29
+ * Usage in a *.stories.tsx file:
30
+ * ```ts
31
+ * import ReadmeContent from '../README.md?raw';
32
+ * import { createReadmeDocsPage } from '../../_common/readme-docs-page';
33
+ *
34
+ * const meta: Meta = {
35
+ * // ...
36
+ * tags: ['docsPage', 'autodocs'],
37
+ * parameters: {
38
+ * docs: { page: createReadmeDocsPage(ReadmeContent) },
39
+ * },
40
+ * };
41
+ * ```
42
+ */
43
+ function stripMarkdownComments(content) {
44
+ return content.replace(/^\[\/\/\]: #.*\n*/gm, '');
45
+ }
46
+ export function createReadmeDocsPage(markdownContent) {
47
+ const cleaned = stripMarkdownComments(markdownContent);
48
+ return function ReadmeDocsPage() {
49
+ return _jsx(Markdown, { children: cleaned });
50
+ };
51
+ }
52
+ //# sourceMappingURL=readme-docs-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readme-docs-page.js","sourceRoot":"","sources":["../../../src/_common/readme-docs-page.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,qBAAqB,CAAC,OAAe;IAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,eAAuB;IAC1D,MAAM,OAAO,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;IACvD,OAAO,SAAS,cAAc;QAC5B,OAAO,KAAC,QAAQ,cAAE,OAAO,GAAY,CAAC;IACxC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Markdown } from '@storybook/addon-docs/blocks';\n\n/**\n * Creates a Storybook docs page component that renders markdown content (e.g. a README.md).\n *\n * Requires the `autodocs` tag on the component meta to create a Docs entry in the sidebar\n * (the global preview config disables autodocs with `!autodocs`).\n *\n * Usage in a *.stories.tsx file:\n * ```ts\n * import ReadmeContent from '../README.md?raw';\n * import { createReadmeDocsPage } from '../../_common/readme-docs-page';\n *\n * const meta: Meta = {\n * // ...\n * tags: ['docsPage', 'autodocs'],\n * parameters: {\n * docs: { page: createReadmeDocsPage(ReadmeContent) },\n * },\n * };\n * ```\n */\nfunction stripMarkdownComments(content: string): string {\n return content.replace(/^\\[\\/\\/\\]: #.*\\n*/gm, '');\n}\n\nexport function createReadmeDocsPage(markdownContent: string) {\n const cleaned = stripMarkdownComments(markdownContent);\n return function ReadmeDocsPage() {\n return <Markdown>{cleaned}</Markdown>;\n };\n}\n"]}
@@ -30,59 +30,172 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
30
30
  * You should have received a copy of the GNU General Public License
31
31
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
32
  */
33
- import { FloatingPortal } from '@floating-ui/react';
33
+ import { FloatingFocusManager, FloatingOverlay, FloatingPortal, useDismiss, useFloating, useInteractions, useMergeRefs, useRole, } from '@floating-ui/react';
34
34
  import classNames from 'classnames';
35
35
  import { Resizable } from 're-resizable';
36
- import { useCallback } from 'react';
36
+ import { useCallback, useEffect, useRef, useState, } from 'react';
37
+ import { needleWarningMessage } from '../_common/utils';
37
38
  import { CleanIconButton } from '../clean-icon-button';
38
39
  import { ConditionalWrap } from '../conditional-wrap';
39
40
  import { XMarkIconOutline } from '../icons';
40
41
  import { Typography } from '../typography';
42
+ const KEYBOARD_RESIZE_STEP_PX = 16;
43
+ function parsePixelSize(value) {
44
+ if (value === undefined) {
45
+ return undefined;
46
+ }
47
+ if (typeof value === 'number') {
48
+ return value;
49
+ }
50
+ const parsed = parseInt(value.replace(/px$/i, ''), 10);
51
+ return Number.isNaN(parsed) ? undefined : parsed;
52
+ }
53
+ function DrawerResizeHandle({ handleSide, onResizeBy, valueMax, valueMin, valueNow, }) {
54
+ const handleKeyDown = useCallback((e) => {
55
+ const isArrowKey = e.key === 'ArrowLeft' || e.key === 'ArrowRight';
56
+ if (isArrowKey) {
57
+ e.preventDefault();
58
+ const delta = handleSide === 'right'
59
+ ? e.key === 'ArrowRight'
60
+ ? KEYBOARD_RESIZE_STEP_PX
61
+ : -KEYBOARD_RESIZE_STEP_PX
62
+ : e.key === 'ArrowLeft'
63
+ ? KEYBOARD_RESIZE_STEP_PX
64
+ : -KEYBOARD_RESIZE_STEP_PX;
65
+ onResizeBy(delta);
66
+ }
67
+ }, [handleSide, onResizeBy]);
68
+ return (
69
+ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- Resize handle is focusable for keyboard resize. */
70
+ _jsx("div", { "aria-label": `Resize drawer with arrow keys. Handle on ${handleSide}.`, "aria-orientation": "vertical", "aria-valuemax": valueMax, "aria-valuemin": valueMin, "aria-valuenow": valueNow !== null && valueNow !== void 0 ? valueNow : 0, "aria-valuetext": `drawer width ${valueNow !== null && valueNow !== void 0 ? valueNow : 0}px`, className: "ndl-drawer-resize-handle", "data-drawer-handle": handleSide, onKeyDown: handleKeyDown, role: "separator", style: { height: '100%', width: '100%' },
71
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- Resize handle is focusable for keyboard resize.
72
+ tabIndex: 0 }));
73
+ }
41
74
  const DrawerComponent = function DrawerComponent(_a) {
42
- var { children, className = '', isExpanded, onExpandedChange, position = 'left', type = 'overlay', isResizeable = false, resizeableProps, isCloseable = true, isPortaled = false, portalProps = {}, htmlAttributes, style, ref, as } = _a, restProps = __rest(_a, ["children", "className", "isExpanded", "onExpandedChange", "position", "type", "isResizeable", "resizeableProps", "isCloseable", "isPortaled", "portalProps", "htmlAttributes", "style", "ref", "as"]);
43
- const setOnExpandedChange = useCallback(() => {
44
- if (onExpandedChange) {
45
- onExpandedChange(!isExpanded);
75
+ var { children, className = '', isExpanded, onExpandedChange, position = 'left', type = 'overlay', isResizeable = false, resizeableProps, isCloseable = true, isPortaled = false, portalProps = {}, closeOnEscape = type === 'modal' ? true : false, closeOnClickOutside = false, closeOnFocusOut = false, ariaLabel, htmlAttributes, style, ref, as } = _a, restProps = __rest(_a, ["children", "className", "isExpanded", "onExpandedChange", "position", "type", "isResizeable", "resizeableProps", "isCloseable", "isPortaled", "portalProps", "closeOnEscape", "closeOnClickOutside", "closeOnFocusOut", "ariaLabel", "htmlAttributes", "style", "ref", "as"]);
76
+ const resizableRef = useRef(null);
77
+ const [resizeWidth, setResizeWidth] = useState(0);
78
+ if ((type === 'modal' || type === 'overlay') && !ariaLabel) {
79
+ needleWarningMessage('A Drawer should have an aria-label when type is "modal" or "overlay" to be accessible.');
80
+ }
81
+ const { refs, context } = useFloating({
82
+ onOpenChange: onExpandedChange,
83
+ open: isExpanded,
84
+ });
85
+ /** Dismiss (escape + click outside) applies to portaled overlay and to non-portaled overlay. */
86
+ const shouldUseDismiss = type === 'modal' ||
87
+ (type === 'overlay' && !isPortaled && isExpanded) ||
88
+ (type === 'overlay' && isPortaled);
89
+ const dismiss = useDismiss(context, {
90
+ enabled: shouldUseDismiss,
91
+ escapeKey: closeOnEscape,
92
+ outsidePress: closeOnClickOutside,
93
+ });
94
+ const role = useRole(context, {
95
+ enabled: type === 'modal' || type === 'overlay',
96
+ role: 'dialog',
97
+ });
98
+ const { getFloatingProps } = useInteractions([dismiss, role]);
99
+ /** When overlay is open and not portaled, drawer gets the floating ref + props; when portaled, the portal layer gets them. */
100
+ const shouldApplyFloatingPropsOnDrawer = type === 'overlay' && isExpanded && !isPortaled;
101
+ const floatingPropsForDrawer = shouldApplyFloatingPropsOnDrawer
102
+ ? getFloatingProps(htmlAttributes !== null && htmlAttributes !== void 0 ? htmlAttributes : {})
103
+ : {};
104
+ const resizableMergedRef = useMergeRefs([
105
+ resizableRef,
106
+ ref,
107
+ shouldApplyFloatingPropsOnDrawer
108
+ ? refs.setFloating
109
+ : null,
110
+ shouldApplyFloatingPropsOnDrawer
111
+ ? refs.setReference
112
+ : null,
113
+ ]);
114
+ const componentMergedRef = useMergeRefs([
115
+ shouldApplyFloatingPropsOnDrawer ? refs.setFloating : null,
116
+ shouldApplyFloatingPropsOnDrawer ? refs.setReference : null,
117
+ ref,
118
+ ]);
119
+ const handleResizeBy = useCallback((delta) => {
120
+ if (!resizableRef.current) {
121
+ return;
122
+ }
123
+ const current = resizableRef.current.size;
124
+ const min = parsePixelSize(resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.minWidth);
125
+ const max = parsePixelSize(resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.maxWidth);
126
+ const newWidth = Math.max(min !== null && min !== void 0 ? min : 0, Math.min(max !== null && max !== void 0 ? max : Number.POSITIVE_INFINITY, current.width + delta));
127
+ resizableRef.current.updateSize({
128
+ height: '100%',
129
+ width: newWidth,
130
+ });
131
+ setResizeWidth(newWidth);
132
+ }, [resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.minWidth, resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.maxWidth]);
133
+ const handleResize = useCallback((event, direction, elementRef, delta) => {
134
+ var _a;
135
+ setResizeWidth(elementRef.offsetWidth);
136
+ (_a = resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.onResize) === null || _a === void 0 ? void 0 : _a.call(resizeableProps, event, direction, elementRef, delta);
137
+ }, [resizeableProps]);
138
+ useEffect(() => {
139
+ if (!isResizeable || !resizableRef.current) {
140
+ return;
141
+ }
142
+ const width = resizableRef.current.size.width;
143
+ if (width > 0) {
144
+ setResizeWidth(width);
46
145
  }
146
+ }, [isResizeable]);
147
+ const setOnExpandedChange = useCallback(() => {
148
+ onExpandedChange === null || onExpandedChange === void 0 ? void 0 : onExpandedChange(!isExpanded);
47
149
  }, [isExpanded, onExpandedChange]);
48
150
  const classes = classNames('ndl-drawer', className, {
49
- 'ndl-drawer-expanded': isExpanded,
50
151
  'ndl-drawer-left': position === 'left',
152
+ 'ndl-drawer-modal': type === 'modal',
51
153
  'ndl-drawer-overlay': type === 'overlay',
154
+ 'ndl-drawer-portaled': isPortaled && type === 'overlay',
52
155
  'ndl-drawer-push': type === 'push',
53
156
  'ndl-drawer-right': position === 'right',
54
157
  });
55
158
  const resizableStylePosition = type === 'overlay' ? 'absolute' : 'relative';
56
- const shouldRenderInPortal = isPortaled && type === 'overlay';
57
159
  const Component = as !== null && as !== void 0 ? as : 'div';
58
- const Close = () => (_jsx(_Fragment, { children: isCloseable && (_jsx(CleanIconButton, { className: "ndl-drawer-close-button", onClick: setOnExpandedChange, description: null, size: "medium", htmlAttributes: {
160
+ const Close = () => (_jsx(_Fragment, { children: (isCloseable || type === 'modal') && (_jsx(CleanIconButton, { className: "ndl-drawer-close-button", onClick: setOnExpandedChange, description: null, size: "medium", htmlAttributes: {
59
161
  'aria-label': 'Close',
60
162
  }, children: _jsx(XMarkIconOutline, {}) })) }));
61
- if (isResizeable) {
62
- return (_jsx(ConditionalWrap, { shouldWrap: shouldRenderInPortal, wrap: (wrapChildren) => (_jsx(FloatingPortal, Object.assign({ preserveTabOrder: true }, portalProps, { children: wrapChildren }))), children: _jsxs(Resizable, Object.assign({ as: Component, defaultSize: {
63
- height: '100%',
64
- width: 'auto',
65
- } }, resizeableProps, { className: classes, style: Object.assign(Object.assign({ position: resizableStylePosition }, style), resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.style), boundsByDirection: true, bounds: "parent", handleStyles: {
66
- /*
67
- * adding a small offset to the handle to make it easier to click
68
- * if the content of the drawer is scrollable, most noticeable if not using
69
- * a mouse on mac or chrome on windows with the fluent scrollbars
70
- */
71
- right: {
72
- right: '-8px',
73
- },
74
- }, enable: {
75
- bottom: false,
76
- bottomLeft: false,
77
- bottomRight: false,
78
- left: position === 'right',
79
- right: position === 'left',
80
- top: false,
81
- topLeft: false,
82
- topRight: false,
83
- }, ref: ref }, restProps, htmlAttributes, { children: [children, _jsx(Close, {})] })) }));
163
+ const resizableContent = (_jsxs(Resizable, Object.assign({ as: Component, defaultSize: {
164
+ height: '100%',
165
+ width: 'auto',
166
+ } }, resizeableProps, { className: classes, style: Object.assign(Object.assign({ position: resizableStylePosition }, style), resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.style), boundsByDirection: true, bounds: "parent", handleStyles: Object.assign(Object.assign({}, (position === 'left' && { right: { right: '-8px' } })), (position === 'right' && { left: { left: '-8px' } })), enable: {
167
+ bottom: false,
168
+ bottomLeft: false,
169
+ bottomRight: false,
170
+ left: position === 'right',
171
+ right: position === 'left',
172
+ top: false,
173
+ topLeft: false,
174
+ topRight: false,
175
+ }, handleComponent: position === 'left'
176
+ ? {
177
+ right: (_jsx(DrawerResizeHandle, { handleSide: "right", onResizeBy: handleResizeBy, valueMax: parsePixelSize(resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.maxWidth), valueMin: parsePixelSize(resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.minWidth), valueNow: resizeWidth })),
178
+ }
179
+ : {
180
+ left: (_jsx(DrawerResizeHandle, { handleSide: "left", onResizeBy: handleResizeBy, valueMax: parsePixelSize(resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.maxWidth), valueMin: parsePixelSize(resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.minWidth), valueNow: resizeWidth })),
181
+ }, onResize: handleResize, ref: resizableMergedRef }, restProps, floatingPropsForDrawer, htmlAttributes, { children: [_jsx(Close, {}), children] })));
182
+ const regularContent = (_jsxs(Component, Object.assign({ className: classNames(classes), style: style, ref: componentMergedRef }, restProps, floatingPropsForDrawer, htmlAttributes, { children: [_jsx(Close, {}), children] })));
183
+ /** what content to render*/
184
+ const content = isResizeable ? resizableContent : regularContent;
185
+ /** if the drawer is not expanded, don't render anything */
186
+ if (isExpanded === false) {
187
+ return null;
188
+ }
189
+ /** modal behavior */
190
+ if (type === 'modal') {
191
+ return (_jsxs(FloatingPortal, Object.assign({}, portalProps, { children: [_jsx(FloatingOverlay, { className: "ndl-drawer-overlay-root", lockScroll: true }), _jsx(FloatingFocusManager, { context: context, modal: true, returnFocus: true, children: _jsx("div", Object.assign({ ref: refs.setFloating }, getFloatingProps(), { "aria-label": ariaLabel, "aria-modal": "true", children: content })) })] })));
192
+ }
193
+ /** overlay focus behavior */
194
+ if (type === 'overlay') {
195
+ return (_jsx(ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => (_jsx(FloatingPortal, Object.assign({ preserveTabOrder: true }, portalProps, { children: wrapChildren }))), children: _jsx(FloatingFocusManager, { context: context, modal: false, returnFocus: true, closeOnFocusOut: closeOnFocusOut, children: content }) }));
84
196
  }
85
- return (_jsx(ConditionalWrap, { shouldWrap: shouldRenderInPortal, wrap: (wrapChildren) => (_jsx(FloatingPortal, Object.assign({ preserveTabOrder: true }, portalProps, { children: wrapChildren }))), children: _jsxs(Component, Object.assign({ className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: [children, _jsx(Close, {})] })) }));
197
+ /** regular push behavior */
198
+ return content;
86
199
  };
87
200
  DrawerComponent.displayName = 'Drawer';
88
201
  const DrawerHeader = (_a) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/drawer/Drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAuB,WAAW,EAAE,MAAM,OAAO,CAAC;AAMzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA4C3C,MAAM,eAAe,GAAG,SAAS,eAAe,CAE9C,EAiBuC;QAjBvC,EACA,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,UAAU,EACV,gBAAgB,EAChB,QAAQ,GAAG,MAAM,EACjB,IAAI,GAAG,SAAS,EAChB,YAAY,GAAG,KAAK,EACpB,eAAe,EACf,WAAW,GAAG,IAAI,EAClB,UAA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,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;IAC5C,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,YAAY;CACrB,CAAC,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { FloatingPortal } from '@floating-ui/react';\nimport classNames from 'classnames';\nimport { Resizable, type ResizableProps } from 're-resizable';\nimport type React from 'react';\nimport { type ComponentProps, useCallback } from 'react';\n\nimport {\n type HtmlAttributes,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { XMarkIconOutline } from '../icons';\nimport { Typography } from '../typography';\n\ntype DrawerPosition = 'left' | 'right';\n\ntype DrawerType = 'overlay' | 'push';\n\ntype DrawerProps = {\n /** Controls whether the drawer is open (expanded) or closed (collapsed). */\n isExpanded: boolean;\n\n /** Callback functions fired when the drawer's expanded state changes. */\n onExpandedChange?: (expanded: boolean) => void;\n\n /** Position where the drawer appears on screen. By default, it appears from the left. */\n position?: DrawerPosition;\n\n /** How the drawer affects the layout of sibling content. By default, it overlays content. */\n type?: DrawerType;\n\n /** Enables horizontal resizing of the drawer, by default it is not resizable. */\n isResizeable?: boolean;\n\n /** To use this prop the isResizeable prop must be set to true. For overriding the third party library props: https://github.com/bokuweb/re-resizable */\n resizeableProps?: ResizableProps;\n\n /** Whether a close button (X) is displayed in the drawer. */\n isCloseable?: boolean;\n\n /** Whether to portal the content */\n isPortaled?: boolean;\n\n /** The content to display within the drawer. */\n children: React.ReactNode;\n\n /** Additional CSS classes to apply to the drawer container. */\n className?: string;\n\n /**\n * Props to pass to the portal from @floating-ui/react FloatingPortal\n * @see https://floating-ui.com/docs/floatingportal\n */\n portalProps?: ComponentProps<typeof FloatingPortal>;\n};\n\nconst DrawerComponent = function DrawerComponent<\n T extends React.ElementType = 'div',\n>({\n children,\n className = '',\n isExpanded,\n onExpandedChange,\n position = 'left',\n type = 'overlay',\n isResizeable = false,\n resizeableProps,\n isCloseable = true,\n isPortaled = false,\n portalProps = {},\n htmlAttributes,\n style,\n ref,\n as,\n ...restProps\n}: PolymorphicCommonProps<T, DrawerProps>) {\n const setOnExpandedChange = useCallback(() => {\n if (onExpandedChange) {\n onExpandedChange(!isExpanded);\n }\n }, [isExpanded, onExpandedChange]);\n\n const classes = classNames('ndl-drawer', className, {\n 'ndl-drawer-expanded': isExpanded,\n 'ndl-drawer-left': position === 'left',\n 'ndl-drawer-overlay': type === 'overlay',\n 'ndl-drawer-push': type === 'push',\n 'ndl-drawer-right': position === 'right',\n });\n\n const resizableStylePosition = type === 'overlay' ? 'absolute' : 'relative';\n const shouldRenderInPortal = isPortaled && type === 'overlay';\n const Component = as ?? 'div';\n\n const Close = () => (\n <>\n {isCloseable && (\n <CleanIconButton\n className=\"ndl-drawer-close-button\"\n onClick={setOnExpandedChange}\n description={null}\n size=\"medium\"\n htmlAttributes={{\n 'aria-label': 'Close',\n }}\n >\n <XMarkIconOutline />\n </CleanIconButton>\n )}\n </>\n );\n\n if (isResizeable) {\n return (\n <ConditionalWrap\n shouldWrap={shouldRenderInPortal}\n wrap={(wrapChildren) => (\n <FloatingPortal preserveTabOrder={true} {...portalProps}>\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <Resizable\n as={Component}\n defaultSize={{\n height: '100%',\n width: 'auto',\n }}\n {...resizeableProps}\n className={classes}\n style={{\n position: resizableStylePosition,\n ...style,\n ...resizeableProps?.style,\n }}\n boundsByDirection={true}\n bounds=\"parent\"\n handleStyles={{\n /*\n * adding a small offset to the handle to make it easier to click\n * if the content of the drawer is scrollable, most noticeable if not using\n * a mouse on mac or chrome on windows with the fluent scrollbars\n */\n right: {\n right: '-8px',\n },\n }}\n enable={{\n bottom: false,\n bottomLeft: false,\n bottomRight: false,\n left: position === 'right',\n right: position === 'left',\n top: false,\n topLeft: false,\n topRight: false,\n }}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n <Close />\n </Resizable>\n </ConditionalWrap>\n );\n }\n\n return (\n <ConditionalWrap\n shouldWrap={shouldRenderInPortal}\n wrap={(wrapChildren) => (\n <FloatingPortal preserveTabOrder={true} {...portalProps}>\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n <Close />\n </Component>\n </ConditionalWrap>\n );\n};\n\nDrawerComponent.displayName = 'Drawer';\n\ntype DrawerHeaderProps = {\n children: React.ReactNode;\n className?: string;\n htmlAttributes?: HtmlAttributes<'h5'>;\n};\n\nconst DrawerHeader = ({\n children,\n className = '',\n htmlAttributes,\n ...restProps\n}: DrawerHeaderProps) => {\n const classes = classNames('ndl-drawer-header', className);\n\n if (typeof children === 'string' || typeof children === 'number') {\n return (\n <Typography\n className={classes}\n variant=\"title-3\"\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Typography>\n );\n }\n\n return (\n <div className={classes} {...restProps} {...htmlAttributes}>\n {children}\n </div>\n );\n};\n\ntype DrawerActionsProps = {\n children: React.ReactNode;\n className?: string;\n htmlAttributes?: HtmlAttributes<'div'>;\n};\n\nconst DrawerActions = ({\n children,\n className = '',\n htmlAttributes,\n ...restProps\n}: DrawerActionsProps) => {\n const classes = classNames('ndl-drawer-actions', className);\n\n return (\n <div className={classes} {...restProps} {...htmlAttributes}>\n {children}\n </div>\n );\n};\n\ntype DrawerBodyProps = {\n children: React.ReactNode;\n className?: string;\n htmlAttributes?: HtmlAttributes<'div'>;\n};\n\nconst DrawerBody = ({\n children,\n className = '',\n htmlAttributes,\n ...restProps\n}: DrawerBodyProps) => {\n const classes = classNames('ndl-drawer-body', className);\n\n return (\n <div className=\"ndl-drawer-body-wrapper\">\n <div className={classes} {...restProps} {...htmlAttributes}>\n {children}\n </div>\n </div>\n );\n};\n\nconst Drawer = Object.assign(DrawerComponent, {\n Actions: DrawerActions,\n Body: DrawerBody,\n Header: DrawerHeader,\n});\n\nexport { Drawer };\n"]}
1
+ {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/drawer/Drawer.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,OAAO,GACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAC;AAE9D,OAAO,EAEL,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA8E3C,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC,SAAS,cAAc,CACrB,KAAkC;IAElC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC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E5D,OAAO,CACL,4BAAK,SAAS,EAAE,OAAO,IAAM,SAAS,EAAM,cAAc,cACvD,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAQF,MAAM,UAAU,GAAG,CAAC,EAKF,EAAE,EAAE;QALF,EAClB,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,cAAc,OAEE,EADb,SAAS,cAJM,2CAKnB,CADa;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;IAEzD,OAAO,CACL,cAAK,SAAS,EAAC,yBAAyB,YACtC,4BAAK,SAAS,EAAE,OAAO,IAAM,SAAS,EAAM,cAAc,cACvD,QAAQ,IACL,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;IAC5C,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,YAAY;CACrB,CAAC,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n useRole,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport { Resizable, type ResizableProps } from 're-resizable';\nimport type React from 'react';\nimport {\n type ComponentProps,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type HtmlAttributes,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { needleWarningMessage } from '../_common/utils';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { XMarkIconOutline } from '../icons';\nimport { Typography } from '../typography';\n\ntype DrawerPosition = 'left' | 'right';\n\ntype DrawerType = 'overlay' | 'push' | 'modal';\n\ntype DrawerProps = {\n /** Controls whether the drawer is open (expanded) or closed (collapsed). */\n isExpanded: boolean;\n\n /** Callback fired when the drawer's expanded state changes (close button, Escape, click outside, or programmatic change). */\n onExpandedChange?: (expanded: boolean) => void;\n\n /** Position where the drawer appears on screen. By default, it appears from the left. */\n position?: DrawerPosition;\n\n /** How the drawer affects the layout of sibling content. By default, it overlays content. */\n type?: DrawerType;\n\n /** Enables horizontal resizing of the drawer, by default it is not resizable. */\n isResizeable?: boolean;\n\n /** To use this prop the isResizeable prop must be set to true. For overriding the third party library props: https://github.com/bokuweb/re-resizable */\n resizeableProps?: ResizableProps;\n\n /** Whether a close button (X) is displayed in the drawer. */\n isCloseable?: boolean;\n\n /** Whether to portal the content. Only applies when type is \"overlay\". Type \"modal\" is always portaled.*/\n isPortaled?: boolean;\n\n // TODO v5: this should maybe be default on portaled in the future\n /**\n * Whether pressing Escape closes the drawer.\n * - When type is \"modal\", this defaults to true.\n * - When type is \"overlay\", this defaults to false.\n * - When type is \"push\", no effect.\n */\n closeOnEscape?: boolean;\n\n // TODO v5: this should maybe be default on overlay in the future\n /**\n * When type is \"overlay\", whether clicking outside the drawer closes it.\n * - When type is \"overlay\" or \"modal\", this defaults to false.\n * - When type is \"push\", no effect.\n */\n closeOnClickOutside?: boolean;\n\n // TODO v5: this should maybe be default on overlay in the future\n /**\n * Whether tabbing focus outside the drawer closes it.\n * - When type is \"overlay\", this defaults to false.\n * - When type is \"push\" or \"modal\", no effect.\n */\n closeOnFocusOut?: boolean;\n\n /** The content to display within the drawer. */\n children: React.ReactNode;\n\n /**\n * Props to pass to the portal from @floating-ui/react FloatingPortal\n * Only applies when type is \"overlay\" and isPortaled is true, or if type is \"modal\".\n * @see https://floating-ui.com/docs/floatingportal\n */\n portalProps?: ComponentProps<typeof FloatingPortal>;\n} & (\n | {\n type: 'modal';\n /** The aria-label to apply to the drawer. Required for accessibility when type is \"modal\" or \"overlay\".*/\n ariaLabel: string;\n }\n | {\n type?: 'push' | 'overlay';\n // TODO v5: aria label should be required when type is \"overlay\" too.\n ariaLabel?: string;\n }\n);\n\nconst KEYBOARD_RESIZE_STEP_PX = 16;\n\nfunction parsePixelSize(\n value: string | number | undefined,\n): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (typeof value === 'number') {\n return value;\n }\n const parsed = parseInt(value.replace(/px$/i, ''), 10);\n return Number.isNaN(parsed) ? undefined : parsed;\n}\n\ntype DrawerResizeHandleProps = {\n /** Which edge this handle resizes (right = drawer’s right edge, left = drawer’s left edge). */\n handleSide: 'left' | 'right';\n /** Called with a pixel delta to apply to the drawer width (positive = wider). */\n onResizeBy: (delta: number) => void;\n onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;\n /** Current width in pixels (for aria-valuenow). */\n valueNow?: number;\n /** Minimum width in pixels (for aria-valuemin). */\n valueMin?: number;\n /** Maximum width in pixels (for aria-valuemax). */\n valueMax?: number;\n};\n\nfunction DrawerResizeHandle({\n handleSide,\n onResizeBy,\n valueMax,\n valueMin,\n valueNow,\n}: DrawerResizeHandleProps) {\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n const isArrowKey = e.key === 'ArrowLeft' || e.key === 'ArrowRight';\n if (isArrowKey) {\n e.preventDefault();\n const delta =\n handleSide === 'right'\n ? e.key === 'ArrowRight'\n ? KEYBOARD_RESIZE_STEP_PX\n : -KEYBOARD_RESIZE_STEP_PX\n : e.key === 'ArrowLeft'\n ? KEYBOARD_RESIZE_STEP_PX\n : -KEYBOARD_RESIZE_STEP_PX;\n onResizeBy(delta);\n }\n },\n [handleSide, onResizeBy],\n );\n\n return (\n /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- Resize handle is focusable for keyboard resize. */\n <div\n aria-label={`Resize drawer with arrow keys. Handle on ${handleSide}.`}\n aria-orientation=\"vertical\"\n aria-valuemax={valueMax}\n aria-valuemin={valueMin}\n aria-valuenow={valueNow ?? 0}\n aria-valuetext={`drawer width ${valueNow ?? 0}px`}\n className=\"ndl-drawer-resize-handle\"\n data-drawer-handle={handleSide}\n onKeyDown={handleKeyDown}\n role=\"separator\"\n style={{ height: '100%', width: '100%' }}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- Resize handle is focusable for keyboard resize.\n tabIndex={0}\n />\n );\n}\n\nconst DrawerComponent = function DrawerComponent<\n T extends React.ElementType = 'div',\n>({\n children,\n className = '',\n isExpanded,\n onExpandedChange,\n position = 'left',\n type = 'overlay',\n isResizeable = false,\n resizeableProps,\n isCloseable = true,\n isPortaled = false,\n portalProps = {},\n closeOnEscape = type === 'modal' ? true : false,\n closeOnClickOutside = false,\n closeOnFocusOut = false,\n ariaLabel,\n htmlAttributes,\n style,\n ref,\n as,\n ...restProps\n}: PolymorphicCommonProps<T, DrawerProps>) {\n const resizableRef = useRef<Resizable | null>(null);\n const [resizeWidth, setResizeWidth] = useState<number>(0);\n\n if ((type === 'modal' || type === 'overlay') && !ariaLabel) {\n needleWarningMessage(\n 'A Drawer should have an aria-label when type is \"modal\" or \"overlay\" to be accessible.',\n );\n }\n\n const { refs, context } = useFloating({\n onOpenChange: onExpandedChange,\n open: isExpanded,\n });\n\n /** Dismiss (escape + click outside) applies to portaled overlay and to non-portaled overlay. */\n const shouldUseDismiss =\n type === 'modal' ||\n (type === 'overlay' && !isPortaled && isExpanded) ||\n (type === 'overlay' && isPortaled);\n\n const dismiss = useDismiss(context, {\n enabled: shouldUseDismiss,\n escapeKey: closeOnEscape,\n outsidePress: closeOnClickOutside,\n });\n const role = useRole(context, {\n enabled: type === 'modal' || type === 'overlay',\n role: 'dialog',\n });\n const { getFloatingProps } = useInteractions([dismiss, role]);\n\n /** When overlay is open and not portaled, drawer gets the floating ref + props; when portaled, the portal layer gets them. */\n const shouldApplyFloatingPropsOnDrawer =\n type === 'overlay' && isExpanded && !isPortaled;\n\n const floatingPropsForDrawer = shouldApplyFloatingPropsOnDrawer\n ? getFloatingProps(htmlAttributes ?? {})\n : {};\n\n const resizableMergedRef = useMergeRefs([\n resizableRef,\n ref,\n shouldApplyFloatingPropsOnDrawer\n ? (refs.setFloating as React.Ref<Resizable>)\n : null,\n shouldApplyFloatingPropsOnDrawer\n ? (refs.setReference as React.Ref<Resizable>)\n : null,\n ]);\n const componentMergedRef = useMergeRefs([\n shouldApplyFloatingPropsOnDrawer ? refs.setFloating : null,\n shouldApplyFloatingPropsOnDrawer ? refs.setReference : null,\n ref,\n ]);\n\n const handleResizeBy = useCallback(\n (delta: number) => {\n if (!resizableRef.current) {\n return;\n }\n const current = resizableRef.current.size;\n const min = parsePixelSize(resizeableProps?.minWidth);\n const max = parsePixelSize(resizeableProps?.maxWidth);\n const newWidth = Math.max(\n min ?? 0,\n Math.min(max ?? Number.POSITIVE_INFINITY, current.width + delta),\n );\n resizableRef.current.updateSize({\n height: '100%',\n width: newWidth,\n });\n setResizeWidth(newWidth);\n },\n [resizeableProps?.minWidth, resizeableProps?.maxWidth],\n );\n\n const handleResize = useCallback(\n (\n event: MouseEvent | TouchEvent,\n direction: Parameters<NonNullable<ResizableProps['onResize']>>[1],\n elementRef: HTMLElement,\n delta: { width: number; height: number },\n ) => {\n setResizeWidth(elementRef.offsetWidth);\n resizeableProps?.onResize?.(event, direction, elementRef, delta);\n },\n [resizeableProps],\n );\n\n useEffect(() => {\n if (!isResizeable || !resizableRef.current) {\n return;\n }\n const width = resizableRef.current.size.width;\n if (width > 0) {\n setResizeWidth(width);\n }\n }, [isResizeable]);\n\n const setOnExpandedChange = useCallback(() => {\n onExpandedChange?.(!isExpanded);\n }, [isExpanded, onExpandedChange]);\n\n const classes = classNames('ndl-drawer', className, {\n 'ndl-drawer-left': position === 'left',\n 'ndl-drawer-modal': type === 'modal',\n 'ndl-drawer-overlay': type === 'overlay',\n 'ndl-drawer-portaled': isPortaled && type === 'overlay',\n 'ndl-drawer-push': type === 'push',\n 'ndl-drawer-right': position === 'right',\n });\n\n const resizableStylePosition = type === 'overlay' ? 'absolute' : 'relative';\n const Component = as ?? 'div';\n\n const Close = () => (\n <>\n {(isCloseable || type === 'modal') && (\n <CleanIconButton\n className=\"ndl-drawer-close-button\"\n onClick={setOnExpandedChange}\n description={null}\n size=\"medium\"\n htmlAttributes={{\n 'aria-label': 'Close',\n }}\n >\n <XMarkIconOutline />\n </CleanIconButton>\n )}\n </>\n );\n\n const resizableContent = (\n <Resizable\n as={Component}\n defaultSize={{\n height: '100%',\n width: 'auto',\n }}\n {...resizeableProps}\n className={classes}\n style={{\n position: resizableStylePosition,\n ...style,\n ...resizeableProps?.style,\n }}\n boundsByDirection={true}\n bounds=\"parent\"\n handleStyles={{\n /*\n * Small offset so the handle is easier to hit when the drawer content is scrollable.\n */\n ...(position === 'left' && { right: { right: '-8px' } }),\n ...(position === 'right' && { left: { left: '-8px' } }),\n }}\n enable={{\n bottom: false,\n bottomLeft: false,\n bottomRight: false,\n left: position === 'right',\n right: position === 'left',\n top: false,\n topLeft: false,\n topRight: false,\n }}\n handleComponent={\n position === 'left'\n ? {\n right: (\n <DrawerResizeHandle\n handleSide=\"right\"\n onResizeBy={handleResizeBy}\n valueMax={parsePixelSize(resizeableProps?.maxWidth)}\n valueMin={parsePixelSize(resizeableProps?.minWidth)}\n valueNow={resizeWidth}\n />\n ),\n }\n : {\n left: (\n <DrawerResizeHandle\n handleSide=\"left\"\n onResizeBy={handleResizeBy}\n valueMax={parsePixelSize(resizeableProps?.maxWidth)}\n valueMin={parsePixelSize(resizeableProps?.minWidth)}\n valueNow={resizeWidth}\n />\n ),\n }\n }\n onResize={handleResize}\n ref={resizableMergedRef}\n {...restProps}\n {...floatingPropsForDrawer}\n {...htmlAttributes}\n >\n <Close />\n {children}\n </Resizable>\n );\n\n const regularContent = (\n <Component\n className={classNames(classes)}\n style={style}\n ref={componentMergedRef}\n {...restProps}\n {...floatingPropsForDrawer}\n {...htmlAttributes}\n >\n <Close />\n {children}\n </Component>\n );\n\n /** what content to render*/\n const content = isResizeable ? resizableContent : regularContent;\n\n /** if the drawer is not expanded, don't render anything */\n if (isExpanded === false) {\n return null;\n }\n\n /** modal behavior */\n if (type === 'modal') {\n return (\n <FloatingPortal {...portalProps}>\n <FloatingOverlay\n className=\"ndl-drawer-overlay-root\"\n lockScroll={true}\n />\n <FloatingFocusManager context={context} modal={true} returnFocus={true}>\n <div\n ref={refs.setFloating}\n {...getFloatingProps()}\n aria-label={ariaLabel}\n aria-modal=\"true\"\n >\n {content}\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n );\n }\n\n /** overlay focus behavior */\n if (type === 'overlay') {\n return (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal preserveTabOrder={true} {...portalProps}>\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n returnFocus={true}\n closeOnFocusOut={closeOnFocusOut}\n >\n {content}\n </FloatingFocusManager>\n </ConditionalWrap>\n );\n }\n\n /** regular push behavior */\n return content;\n};\n\nDrawerComponent.displayName = 'Drawer';\n\ntype DrawerHeaderProps = {\n children: React.ReactNode;\n className?: string;\n // TODO v5: fix the typing on the Drawer subcomponents to use the common props type. Also, this is not an h5 haha. Should be polymorphic I guess, maybe default to h2 as we've recommended.\n htmlAttributes?: HtmlAttributes<'h5'>;\n};\n\nconst DrawerHeader = ({\n children,\n className = '',\n htmlAttributes,\n ...restProps\n}: DrawerHeaderProps) => {\n const classes = classNames('ndl-drawer-header', className);\n\n if (typeof children === 'string' || typeof children === 'number') {\n return (\n <Typography\n className={classes}\n variant=\"title-3\"\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Typography>\n );\n }\n\n return (\n <div className={classes} {...restProps} {...htmlAttributes}>\n {children}\n </div>\n );\n};\n\ntype DrawerActionsProps = {\n children: React.ReactNode;\n className?: string;\n htmlAttributes?: HtmlAttributes<'div'>;\n};\n\nconst DrawerActions = ({\n children,\n className = '',\n htmlAttributes,\n ...restProps\n}: DrawerActionsProps) => {\n const classes = classNames('ndl-drawer-actions', className);\n\n return (\n <div className={classes} {...restProps} {...htmlAttributes}>\n {children}\n </div>\n );\n};\n\ntype DrawerBodyProps = {\n children: React.ReactNode;\n className?: string;\n htmlAttributes?: HtmlAttributes<'div'>;\n};\n\nconst DrawerBody = ({\n children,\n className = '',\n htmlAttributes,\n ...restProps\n}: DrawerBodyProps) => {\n const classes = classNames('ndl-drawer-body', className);\n\n return (\n <div className=\"ndl-drawer-body-wrapper\">\n <div className={classes} {...restProps} {...htmlAttributes}>\n {children}\n </div>\n </div>\n );\n};\n\nconst Drawer = Object.assign(DrawerComponent, {\n Actions: DrawerActions,\n Body: DrawerBody,\n Header: DrawerHeader,\n});\n\nexport { Drawer };\n"]}
@@ -24,7 +24,9 @@ import { Checkbox, Drawer, FilledButton, TextInput } from '@neo4j-ndl/react';
24
24
  import { useState } from 'react';
25
25
  const Component = () => {
26
26
  const [isExpanded, setIsExpanded] = useState(true);
27
- const Placeholder = () => (_jsx("div", { className: "w-full n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16", children: _jsx("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md", children: _jsx(FilledButton, { onClick: () => setIsExpanded(true), children: "Press to show the Drawer" }) }) }));
27
+ const Placeholder = () => (_jsx("div", { className: "w-full n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16", children: _jsx("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md", children: _jsx(FilledButton, { onClick: () => setIsExpanded(true), htmlAttributes: {
28
+ 'aria-expanded': isExpanded,
29
+ }, children: "Press to show the Drawer" }) }) }));
28
30
  return (_jsxs("div", { className: "n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden", children: [_jsxs(Drawer, { type: "push", isExpanded: isExpanded, onExpandedChange: () => setIsExpanded(false), isResizeable: true, resizeableProps: {
29
31
  maxWidth: '400px',
30
32
  minWidth: '300px',
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-full.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-full.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,cAAK,SAAS,EAAC,gGAAgG,YAC7G,cAAK,SAAS,EAAC,wIAAwI,YACrJ,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,yCAEjC,GACX,GACF,CACP,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,2EAA2E,aACxF,MAAC,MAAM,IACL,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAC5C,YAAY,EAAE,IAAI,EAClB,eAAe,EAAE;oBACf,QAAQ,EAAE,OAAO;oBACjB,QAAQ,EAAE,OAAO;iBAClB,EACD,WAAW,EAAE,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e,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Checkbox, Drawer, FilledButton, TextInput } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const Placeholder = () => (\n <div className=\"w-full n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\">\n <FilledButton onClick={() => setIsExpanded(true)}>\n Press to show the Drawer\n </FilledButton>\n </div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Drawer\n type=\"push\"\n isExpanded={isExpanded}\n onExpandedChange={() => setIsExpanded(false)}\n isResizeable={true}\n resizeableProps={{\n maxWidth: '400px',\n minWidth: '300px',\n }}\n isCloseable={true}\n isPortaled={false}\n >\n <Drawer.Header>Drawer Header</Drawer.Header>\n <Drawer.Body>\n <TextInput\n showRequiredOrOptionalLabel={true}\n moreInformationText=\"some information\"\n label=\"Label\"\n isDisabled={false}\n isReadOnly={false}\n helpText=\"Friendly text\"\n isFluid={true}\n />\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n <br />\n <Checkbox label=\"Checkbox label\" />\n <br />\n Some example of something.\n <br />\n <TextInput label=\"Some input\" isDisabled={true} value=\"something\" />\n <br />\n <TextInput\n showRequiredOrOptionalLabel={true}\n moreInformationText=\"some information\"\n label=\"Label\"\n isDisabled={false}\n isReadOnly={false}\n helpText=\"Friendly text\"\n isFluid={true}\n />\n <br />\n Some example of something.\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n <br />\n <Checkbox label=\"Checkbox label\" />\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n </Drawer.Body>\n <Drawer.Actions>\n <FilledButton onClick={() => setIsExpanded(false)} size=\"medium\">\n Close\n </FilledButton>\n </Drawer.Actions>\n </Drawer>\n <Placeholder />\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"drawer-full.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-full.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,cAAK,SAAS,EAAC,gGAAgG,YAC7G,cAAK,SAAS,EAAC,wIAAwI,YACrJ,KAAC,YAAY,IACX,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,cAAc,EAAE;oBACd,eAAe,EAAE,UAAU;iBAC5B,yCAGY,GACX,GACF,CACP,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,2EAA2E,aACxF,MAAC,MAAM,IACL,IAAI,EAAC,MAAM,EACX,UAAU,EAAE,UAAU,EACtB,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YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,QAAQ,sBAEjD,GACA,IACV,EACT,KAAC,WAAW,KAAG,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Checkbox, Drawer, FilledButton, TextInput } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const Placeholder = () => (\n <div className=\"w-full n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\">\n <FilledButton\n onClick={() => setIsExpanded(true)}\n htmlAttributes={{\n 'aria-expanded': isExpanded,\n }}\n >\n Press to show the Drawer\n </FilledButton>\n </div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Drawer\n type=\"push\"\n isExpanded={isExpanded}\n onExpandedChange={() => setIsExpanded(false)}\n isResizeable={true}\n resizeableProps={{\n maxWidth: '400px',\n minWidth: '300px',\n }}\n isCloseable={true}\n isPortaled={false}\n >\n <Drawer.Header>Drawer Header</Drawer.Header>\n <Drawer.Body>\n <TextInput\n showRequiredOrOptionalLabel={true}\n moreInformationText=\"some information\"\n label=\"Label\"\n isDisabled={false}\n isReadOnly={false}\n helpText=\"Friendly text\"\n isFluid={true}\n />\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n <br />\n <Checkbox label=\"Checkbox label\" />\n <br />\n Some example of something.\n <br />\n <TextInput label=\"Some input\" isDisabled={true} value=\"something\" />\n <br />\n <TextInput\n showRequiredOrOptionalLabel={true}\n moreInformationText=\"some information\"\n label=\"Label\"\n isDisabled={false}\n isReadOnly={false}\n helpText=\"Friendly text\"\n isFluid={true}\n />\n <br />\n Some example of something.\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n <br />\n <Checkbox label=\"Checkbox label\" />\n <br />\n <TextInput label=\"Some input\" value=\"something\" />\n </Drawer.Body>\n <Drawer.Actions>\n <FilledButton onClick={() => setIsExpanded(false)} size=\"medium\">\n Close\n </FilledButton>\n </Drawer.Actions>\n </Drawer>\n <Placeholder />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -20,12 +20,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
20
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
21
  */
22
22
  import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
- import { Drawer, FilledButton } from '@neo4j-ndl/react';
24
- import { useState } from 'react';
23
+ import { Drawer } from '@neo4j-ndl/react';
25
24
  const Component = () => {
26
- const [isExpanded, setIsExpanded] = useState(true);
27
- const Placeholder = () => (_jsx("div", { className: "n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full", children: _jsx("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md", children: _jsx(FilledButton, { onClick: () => setIsExpanded(true), children: "Press to show the Drawer" }) }) }));
28
- return (_jsxs("div", { className: "n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden", children: [_jsxs(Drawer, { type: "overlay", isExpanded: isExpanded, onExpandedChange: () => setIsExpanded(false), position: "left", isCloseable: false, children: [_jsx(Drawer.Header, { children: "Drawer Header" }), _jsx(Drawer.Body, { children: "Lorem ipsum dolor sit amet." })] }), _jsx(Placeholder, {})] }));
25
+ const Placeholder = () => (_jsx("div", { className: "n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full", children: _jsx("div", { className: "n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md" }) }));
26
+ return (_jsxs("div", { className: "n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden", children: [_jsxs(Drawer, { type: "push", isExpanded: true, position: "left", isCloseable: false, children: [_jsx(Drawer.Header, { children: "Drawer" }), _jsx(Drawer.Body, { children: "Lorem ipsum dolor sit amet." })] }), _jsx(Placeholder, {})] }));
29
27
  };
30
28
  export default Component;
31
29
  //# sourceMappingURL=drawer-not-closeable.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-not-closeable.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-not-closeable.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,cAAK,SAAS,EAAC,gGAAgG,YAC7G,cAAK,SAAS,EAAC,wIAAwI,YACrJ,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,yCAEjC,GACX,GACF,CACP,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,2EAA2E,aACxF,MAAC,MAAM,IACL,IAAI,EAAC,SAAS,EACd,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAC5C,QAAQ,EAAC,MAAM,EACf,WAAW,EAAE,KAAK,aAElB,KAAC,MAAM,CAAC,MAAM,gCAA8B,EAC5C,KAAC,MAAM,CAAC,IAAI,8CAA0C,IAC/C,EACT,KAAC,WAAW,KAAG,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Drawer, FilledButton } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const Placeholder = () => (\n <div className=\"n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\">\n <FilledButton onClick={() => setIsExpanded(true)}>\n Press to show the Drawer\n </FilledButton>\n </div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Drawer\n type=\"overlay\"\n isExpanded={isExpanded}\n onExpandedChange={() => setIsExpanded(false)}\n position=\"left\"\n isCloseable={false}\n >\n <Drawer.Header>Drawer Header</Drawer.Header>\n <Drawer.Body>Lorem ipsum dolor sit amet.</Drawer.Body>\n </Drawer>\n <Placeholder />\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"drawer-not-closeable.story.js","sourceRoot":"","sources":["../../../../src/drawer/stories/drawer-not-closeable.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,cAAK,SAAS,EAAC,gGAAgG,YAC7G,cAAK,SAAS,EAAC,wIAAwI,GAAO,GAC1J,CACP,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,2EAA2E,aACxF,MAAC,MAAM,IAAC,IAAI,EAAC,MAAM,EAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAC,MAAM,EAAC,WAAW,EAAE,KAAK,aACtE,KAAC,MAAM,CAAC,MAAM,yBAAuB,EACrC,KAAC,MAAM,CAAC,IAAI,8CAA0C,IAC/C,EACT,KAAC,WAAW,KAAG,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Drawer } from '@neo4j-ndl/react';\n\nconst Component = () => {\n const Placeholder = () => (\n <div className=\"n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-16 w-full\">\n <div className=\"n-border-dashed n-border-2 n-border-light-primary-bg-strong n-size-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md\"></div>\n </div>\n );\n\n return (\n <div className=\"n-h-[calc(40vh-32px)] n-min-h-[700px] n-flex n-relative n-overflow-hidden\">\n <Drawer type=\"push\" isExpanded={true} position=\"left\" isCloseable={false}>\n <Drawer.Header>Drawer</Drawer.Header>\n <Drawer.Body>Lorem ipsum dolor sit amet.</Drawer.Body>\n </Drawer>\n <Placeholder />\n </div>\n );\n};\n\nexport default Component;\n"]}