@tecsinapse/react-web-kit 1.5.0 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/components/atoms/Accordion/Accordion.d.ts +9 -0
  3. package/dist/components/atoms/Accordion/Accordion.js +85 -0
  4. package/dist/components/atoms/Accordion/Accordion.js.map +1 -0
  5. package/dist/components/atoms/Accordion/animations.d.ts +41 -0
  6. package/dist/components/atoms/Accordion/animations.js +65 -0
  7. package/dist/components/atoms/Accordion/animations.js.map +1 -0
  8. package/dist/components/atoms/Accordion/index.d.ts +1 -0
  9. package/dist/components/atoms/Accordion/index.js +24 -0
  10. package/dist/components/atoms/Accordion/index.js.map +1 -0
  11. package/dist/components/atoms/Accordion/styled.d.ts +8 -0
  12. package/dist/components/atoms/Accordion/styled.js +53 -0
  13. package/dist/components/atoms/Accordion/styled.js.map +1 -0
  14. package/dist/components/atoms/Badge/index.js +2 -2
  15. package/dist/components/atoms/Button/index.js +2 -2
  16. package/dist/components/atoms/Button/styled.js +5 -3
  17. package/dist/components/atoms/Button/styled.js.map +1 -1
  18. package/dist/components/atoms/Input/index.js +2 -2
  19. package/dist/components/atoms/Modal/Modal.d.ts +8 -0
  20. package/dist/components/atoms/Modal/Modal.js +43 -0
  21. package/dist/components/atoms/Modal/Modal.js.map +1 -0
  22. package/dist/components/atoms/Modal/animations.d.ts +23 -0
  23. package/dist/components/atoms/Modal/animations.js +32 -0
  24. package/dist/components/atoms/Modal/animations.js.map +1 -0
  25. package/dist/components/atoms/Modal/index.d.ts +1 -0
  26. package/dist/components/atoms/Modal/index.js +24 -0
  27. package/dist/components/atoms/Modal/index.js.map +1 -0
  28. package/dist/components/atoms/Modal/styled.d.ts +2 -0
  29. package/dist/components/atoms/Modal/styled.js +39 -0
  30. package/dist/components/atoms/Modal/styled.js.map +1 -0
  31. package/dist/components/atoms/Overlay/Overlay.d.ts +10 -0
  32. package/dist/components/atoms/Overlay/Overlay.js +40 -0
  33. package/dist/components/atoms/Overlay/Overlay.js.map +1 -0
  34. package/dist/components/atoms/Overlay/animations.d.ts +18 -0
  35. package/dist/components/atoms/Overlay/animations.js +27 -0
  36. package/dist/components/atoms/Overlay/animations.js.map +1 -0
  37. package/dist/components/atoms/Overlay/index.d.ts +1 -0
  38. package/dist/components/atoms/Overlay/index.js +16 -0
  39. package/dist/components/atoms/Overlay/index.js.map +1 -0
  40. package/dist/components/atoms/Overlay/styled.d.ts +2 -0
  41. package/dist/components/atoms/Overlay/styled.js +36 -0
  42. package/dist/components/atoms/Overlay/styled.js.map +1 -0
  43. package/dist/components/atoms/Skeleton/index.js +2 -2
  44. package/dist/components/atoms/Table/Toolbar/index.js +2 -2
  45. package/dist/components/atoms/Tag/index.js +2 -2
  46. package/dist/components/molecules/Breadcrumbs/BreadcrumbItem/index.js +2 -2
  47. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +3 -3
  48. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js +3 -3
  49. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js.map +1 -1
  50. package/dist/components/molecules/Breadcrumbs/index.d.ts +1 -1
  51. package/dist/components/molecules/Breadcrumbs/index.js +8 -2
  52. package/dist/components/molecules/Breadcrumbs/index.js.map +1 -1
  53. package/dist/components/molecules/Drawer/Drawer.js +8 -11
  54. package/dist/components/molecules/Drawer/Drawer.js.map +1 -1
  55. package/dist/components/molecules/Drawer/animations.d.ts +0 -18
  56. package/dist/components/molecules/Drawer/animations.js +1 -21
  57. package/dist/components/molecules/Drawer/animations.js.map +1 -1
  58. package/dist/components/molecules/Drawer/index.js +2 -2
  59. package/dist/components/molecules/Drawer/styled.d.ts +0 -1
  60. package/dist/components/molecules/Drawer/styled.js +2 -21
  61. package/dist/components/molecules/Drawer/styled.js.map +1 -1
  62. package/dist/components/molecules/InputPassword/InputPassword.js +2 -2
  63. package/dist/components/molecules/InputPassword/index.js +2 -2
  64. package/dist/components/molecules/Menubar/MenuBlock/MenuBlock.d.ts +4 -3
  65. package/dist/components/molecules/Menubar/MenuBlock/MenuBlock.js +14 -5
  66. package/dist/components/molecules/Menubar/MenuBlock/MenuBlock.js.map +1 -1
  67. package/dist/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.d.ts +1 -0
  68. package/dist/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.js +6 -3
  69. package/dist/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.js.map +1 -1
  70. package/dist/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.d.ts +1 -0
  71. package/dist/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js +4 -2
  72. package/dist/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js.map +1 -1
  73. package/dist/components/molecules/Menubar/Menubar.d.ts +3 -2
  74. package/dist/components/molecules/Menubar/Menubar.js +26 -33
  75. package/dist/components/molecules/Menubar/Menubar.js.map +1 -1
  76. package/dist/components/molecules/Menubar/MostUsed/MostUsed.d.ts +3 -2
  77. package/dist/components/molecules/Menubar/MostUsed/MostUsed.js +6 -3
  78. package/dist/components/molecules/Menubar/MostUsed/MostUsed.js.map +1 -1
  79. package/dist/components/molecules/Menubar/SearchResultItem/SearchResultItem.d.ts +1 -0
  80. package/dist/components/molecules/Menubar/SearchResultItem/SearchResultItem.js +4 -2
  81. package/dist/components/molecules/Menubar/SearchResultItem/SearchResultItem.js.map +1 -1
  82. package/dist/components/molecules/Menubar/animations.d.ts +2 -2
  83. package/dist/components/molecules/Menubar/animations.js +14 -22
  84. package/dist/components/molecules/Menubar/animations.js.map +1 -1
  85. package/dist/components/molecules/Menubar/index.d.ts +1 -0
  86. package/dist/components/molecules/Menubar/index.js +26 -3
  87. package/dist/components/molecules/Menubar/index.js.map +1 -1
  88. package/dist/components/molecules/Menubar/styled.js +5 -2
  89. package/dist/components/molecules/Menubar/styled.js.map +1 -1
  90. package/dist/components/molecules/Menubar/types.js +4 -0
  91. package/dist/components/molecules/Select/index.js +2 -2
  92. package/dist/components/molecules/Snackbar/index.js +2 -2
  93. package/dist/components/molecules/Snackbar/styled.js +2 -2
  94. package/dist/components/organisms/DataGrid/index.js +2 -2
  95. package/dist/components/organisms/DataGrid/types.js +4 -0
  96. package/dist/index.d.ts +6 -3
  97. package/dist/index.js +99 -14
  98. package/dist/index.js.map +1 -1
  99. package/package.json +5 -5
  100. package/src/components/atoms/Accordion/Accordion.stories.tsx +35 -0
  101. package/src/components/atoms/Accordion/Accordion.tsx +99 -0
  102. package/src/components/atoms/Accordion/animations.ts +51 -0
  103. package/src/components/atoms/Accordion/index.ts +1 -0
  104. package/src/components/atoms/Accordion/styled.ts +35 -0
  105. package/src/components/atoms/Button/styled.ts +3 -1
  106. package/src/components/atoms/Modal/Modal.stories.tsx +55 -0
  107. package/src/components/atoms/Modal/Modal.tsx +34 -0
  108. package/src/components/atoms/Modal/animations.ts +12 -0
  109. package/src/components/atoms/Modal/index.ts +1 -0
  110. package/src/components/atoms/Modal/styled.ts +17 -0
  111. package/src/components/atoms/Overlay/Overlay.tsx +40 -0
  112. package/src/components/atoms/Overlay/animations.ts +11 -0
  113. package/src/components/atoms/Overlay/index.ts +1 -0
  114. package/src/components/atoms/Overlay/styled.ts +20 -0
  115. package/src/components/molecules/Breadcrumbs/Breadcrumbs.tsx +5 -5
  116. package/src/components/molecules/Breadcrumbs/index.ts +5 -1
  117. package/src/components/molecules/Drawer/Drawer.stories.tsx +10 -20
  118. package/src/components/molecules/Drawer/Drawer.tsx +3 -15
  119. package/src/components/molecules/Drawer/animations.ts +0 -11
  120. package/src/components/molecules/Drawer/styled.ts +1 -14
  121. package/src/components/molecules/Menubar/MenuBlock/MenuBlock.tsx +38 -31
  122. package/src/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.tsx +4 -2
  123. package/src/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.tsx +3 -2
  124. package/src/components/molecules/Menubar/Menubar.stories.tsx +19 -13
  125. package/src/components/molecules/Menubar/Menubar.tsx +48 -57
  126. package/src/components/molecules/Menubar/MostUsed/MostUsed.tsx +4 -2
  127. package/src/components/molecules/Menubar/SearchResultItem/SearchResultItem.tsx +7 -2
  128. package/src/components/molecules/Menubar/animations.ts +14 -21
  129. package/src/components/molecules/Menubar/index.ts +5 -0
  130. package/src/components/molecules/Menubar/styled.ts +3 -2
  131. package/src/index.ts +16 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,60 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.6.3](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.6.2...@tecsinapse/react-web-kit@1.6.3) (2021-09-16)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **menubar:** fixing toggle for search items ([330e6b8](https://github.com/tecsinapse/design-system/commit/330e6b8467945c55bbcbaa4876cd160224ef509d))
12
+ * **menubar:** fixing toggle for search items ([3aefce8](https://github.com/tecsinapse/design-system/commit/3aefce867cab7a12bafdef181148fc48654044ff))
13
+
14
+
15
+
16
+
17
+
18
+ ## [1.6.2](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.6.1...@tecsinapse/react-web-kit@1.6.2) (2021-09-15)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **menubar:** fixing z-index ([7f8396f](https://github.com/tecsinapse/design-system/commit/7f8396f77b41d32e21eb0cfef9b0c706c13ef454))
24
+
25
+
26
+
27
+
28
+
29
+ ## [1.6.1](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.6.0...@tecsinapse/react-web-kit@1.6.1) (2021-09-15)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * **menubar:** fixing right components ([efc933d](https://github.com/tecsinapse/design-system/commit/efc933d5a716be0c8f07b4c06a86c52db2f85077))
35
+
36
+
37
+
38
+
39
+
40
+ # [1.6.0](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.5.0...@tecsinapse/react-web-kit@1.6.0) (2021-09-14)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * **exports:** exporting components ([83a0500](https://github.com/tecsinapse/design-system/commit/83a0500e5666568029dbe6cb90a9c594c90c0af1))
46
+ * **transition:** changing animation from linear to ease-in-out ([d6570aa](https://github.com/tecsinapse/design-system/commit/d6570aa1d952ba18db122955b6f1e54a1f223b14))
47
+ * button user-select style ([f1145b4](https://github.com/tecsinapse/design-system/commit/f1145b400847dd8ab526a48f25958fdc407c9afb))
48
+
49
+
50
+ ### Features
51
+
52
+ * add accordion ([f7089c0](https://github.com/tecsinapse/design-system/commit/f7089c0d98568fd3ee0aa64f2150063f67e4fe66))
53
+ * add modal ([eff7597](https://github.com/tecsinapse/design-system/commit/eff7597f779c9e10b078153ed0eb23acc143760b))
54
+ * move to atoms ([5085e28](https://github.com/tecsinapse/design-system/commit/5085e28a96eafd85731cf3f564ae9de21635aea8))
55
+
56
+
57
+
58
+
59
+
6
60
  # [1.5.0](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.4.0...@tecsinapse/react-web-kit@1.5.0) (2021-09-06)
7
61
 
8
62
 
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface AccordionProps {
3
+ open?: boolean;
4
+ onChange?: () => void;
5
+ title: string;
6
+ transition?: number;
7
+ }
8
+ declare const Accordion: React.FC<AccordionProps>;
9
+ export default Accordion;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactCore = require("@tecsinapse/react-core");
11
+
12
+ var _styled = require("./styled");
13
+
14
+ var _reactTransitionGroup = require("react-transition-group");
15
+
16
+ var _animations = require("./animations");
17
+
18
+ var _react2 = require("@emotion/react");
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ const Accordion = ({
25
+ title,
26
+ open: _open = false,
27
+ onChange,
28
+ transition = 200,
29
+ children
30
+ }) => {
31
+ const [open, setOpen] = _react.default.useState(_open);
32
+
33
+ const [contentHeight, setContentHeight] = _react.default.useState(0);
34
+
35
+ const theme = (0, _react2.useTheme)();
36
+ const ref = (0, _react.useRef)(null);
37
+
38
+ _react.default.useEffect(() => setOpen(_open), [_open]);
39
+
40
+ _react.default.useLayoutEffect(() => {
41
+ var _ref$current;
42
+
43
+ const size = Array.from(((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.children) || []).reduce((prev, curr) => prev + curr.clientHeight, 0);
44
+ setContentHeight(size);
45
+ }, []);
46
+
47
+ const handleClick = _react.default.useCallback(() => {
48
+ if (onChange) {
49
+ onChange();
50
+ return;
51
+ }
52
+
53
+ setOpen(state => !state);
54
+ }, [onChange]);
55
+
56
+ return _react.default.createElement(_styled.AccordionContainer, null, _react.default.createElement(_styled.TitleContainer, {
57
+ onClick: handleClick
58
+ }, _react.default.createElement(_reactTransitionGroup.Transition, {
59
+ in: open,
60
+ timeout: transition
61
+ }, state => _react.default.createElement(_reactCore.Text, {
62
+ typography: "h4",
63
+ fontWeight: "bold",
64
+ style: { ...(0, _animations.titleStyle)(transition, theme),
65
+ ...(0, _animations.titleTransition)(theme)[state]
66
+ }
67
+ }, title)), _react.default.createElement(_styled.IconContainer, null, _react.default.createElement(_reactCore.Icon, {
68
+ type: "material-community",
69
+ name: open ? 'chevron-up' : 'chevron-down',
70
+ size: "kilo",
71
+ fontColor: "medium"
72
+ }))), _react.default.createElement(_reactTransitionGroup.Transition, {
73
+ in: open,
74
+ timeout: transition
75
+ }, state => _react.default.createElement(_styled.ContentContainer, {
76
+ ref: htmlEl => ref.current = htmlEl,
77
+ style: { ...(0, _animations.contentStyle)(open, transition, contentHeight, theme),
78
+ ...(0, _animations.contentTransition)(contentHeight, theme)[state]
79
+ }
80
+ }, children)));
81
+ };
82
+
83
+ var _default = Accordion;
84
+ exports.default = _default;
85
+ //# sourceMappingURL=Accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Accordion/Accordion.tsx"],"names":["Accordion","title","open","_open","onChange","transition","children","setOpen","React","useState","contentHeight","setContentHeight","theme","ref","useEffect","useLayoutEffect","size","Array","from","current","reduce","prev","curr","clientHeight","handleClick","useCallback","state","htmlEl"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;AAMA;;;;;;AAUA,MAAMA,SAAmC,GAAG,CAAC;AAC3CC,EAAAA,KAD2C;AAE3CC,EAAAA,IAAI,EAAEC,KAAK,GAAG,KAF6B;AAG3CC,EAAAA,QAH2C;AAI3CC,EAAAA,UAAU,GAAG,GAJ8B;AAK3CC,EAAAA;AAL2C,CAAD,KAMtC;AACJ,QAAM,CAACJ,IAAD,EAAOK,OAAP,IAAkBC,eAAMC,QAAN,CAAeN,KAAf,CAAxB;;AACA,QAAM,CAACO,aAAD,EAAgBC,gBAAhB,IAAoCH,eAAMC,QAAN,CAAe,CAAf,CAA1C;;AACA,QAAMG,KAAK,GAAG,uBAAd;AAEA,QAAMC,GAAG,GAAG,mBAA8B,IAA9B,CAAZ;;AAEAL,iBAAMM,SAAN,CAAgB,MAAMP,OAAO,CAACJ,KAAD,CAA7B,EAAsC,CAACA,KAAD,CAAtC;;AAEAK,iBAAMO,eAAN,CAAsB,MAAM;AAAA;;AAC1B,UAAMC,IAAI,GAAGC,KAAK,CAACC,IAAN,CACV,iBAAAL,GAAG,CAACM,OAAJ,8DAAab,QAAb,KAAyB,EADf,EAEXc,MAFW,CAEJ,CAACC,IAAD,EAAOC,IAAP,KAAgBD,IAAI,GAAGC,IAAI,CAACC,YAFxB,EAEsC,CAFtC,CAAb;AAGAZ,IAAAA,gBAAgB,CAACK,IAAD,CAAhB;AACD,GALD,EAKG,EALH;;AAOA,QAAMQ,WAAW,GAAGhB,eAAMiB,WAAN,CAAkB,MAAM;AAC1C,QAAIrB,QAAJ,EAAc;AACZA,MAAAA,QAAQ;AACR;AACD;;AACDG,IAAAA,OAAO,CAACmB,KAAK,IAAI,CAACA,KAAX,CAAP;AACD,GANmB,EAMjB,CAACtB,QAAD,CANiB,CAApB;;AAQA,SACE,6BAAC,0BAAD,QACE,6BAAC,sBAAD;AAAgB,IAAA,OAAO,EAAEoB;AAAzB,KACE,6BAAC,gCAAD;AAAY,IAAA,EAAE,EAAEtB,IAAhB;AAAsB,IAAA,OAAO,EAAEG;AAA/B,KACGqB,KAAK,IACJ,6BAAC,eAAD;AACE,IAAA,UAAU,EAAC,IADb;AAEE,IAAA,UAAU,EAAC,MAFb;AAGE,IAAA,KAAK,EAAE,EACL,GAAG,4BAAWrB,UAAX,EAAuBO,KAAvB,CADE;AAEL,SAAG,iCAAgBA,KAAhB,EAAuBc,KAAvB;AAFE;AAHT,KAQGzB,KARH,CAFJ,CADF,EAeE,6BAAC,qBAAD,QACE,6BAAC,eAAD;AACE,IAAA,IAAI,EAAC,oBADP;AAEE,IAAA,IAAI,EAAEC,IAAI,GAAG,YAAH,GAAkB,cAF9B;AAGE,IAAA,IAAI,EAAC,MAHP;AAIE,IAAA,SAAS,EAAC;AAJZ,IADF,CAfF,CADF,EAyBE,6BAAC,gCAAD;AAAY,IAAA,EAAE,EAAEA,IAAhB;AAAsB,IAAA,OAAO,EAAEG;AAA/B,KACGqB,KAAK,IACJ,6BAAC,wBAAD;AACE,IAAA,GAAG,EAAEC,MAAM,IAAKd,GAAG,CAACM,OAAJ,GAAcQ,MADhC;AAEE,IAAA,KAAK,EAAE,EACL,GAAG,8BAAazB,IAAb,EAAmBG,UAAnB,EAA+BK,aAA/B,EAA8CE,KAA9C,CADE;AAEL,SAAG,mCAAkBF,aAAlB,EAAiCE,KAAjC,EAAwCc,KAAxC;AAFE;AAFT,KAOGpB,QAPH,CAFJ,CAzBF,CADF;AAyCD,CAvED;;eAyEeN,S","sourcesContent":["import React, { useRef } from 'react';\nimport { Icon, Text, ThemeProp } from '@tecsinapse/react-core';\nimport {\n AccordionContainer,\n IconContainer,\n TitleContainer,\n ContentContainer,\n} from './styled';\nimport { Transition } from 'react-transition-group';\nimport {\n contentStyle,\n contentTransition,\n titleStyle,\n titleTransition,\n} from './animations';\nimport { useTheme } from '@emotion/react';\n\nexport interface AccordionProps {\n open?: boolean;\n onChange?: () => void;\n title: string;\n /** Transition time for collapse effect in ms */\n transition?: number;\n}\n\nconst Accordion: React.FC<AccordionProps> = ({\n title,\n open: _open = false,\n onChange,\n transition = 200,\n children,\n}) => {\n const [open, setOpen] = React.useState(_open);\n const [contentHeight, setContentHeight] = React.useState(0);\n const theme = useTheme() as ThemeProp;\n\n const ref = useRef<HTMLDivElement | null>(null);\n\n React.useEffect(() => setOpen(_open), [_open]);\n\n React.useLayoutEffect(() => {\n const size = Array.from(\n (ref.current?.children || []) as HTMLCollection\n ).reduce((prev, curr) => prev + curr.clientHeight, 0);\n setContentHeight(size);\n }, []);\n\n const handleClick = React.useCallback(() => {\n if (onChange) {\n onChange();\n return;\n }\n setOpen(state => !state);\n }, [onChange]);\n\n return (\n <AccordionContainer>\n <TitleContainer onClick={handleClick}>\n <Transition in={open} timeout={transition}>\n {state => (\n <Text\n typography=\"h4\"\n fontWeight=\"bold\"\n style={{\n ...titleStyle(transition, theme),\n ...titleTransition(theme)[state],\n }}\n >\n {title}\n </Text>\n )}\n </Transition>\n <IconContainer>\n <Icon\n type=\"material-community\"\n name={open ? 'chevron-up' : 'chevron-down'}\n size=\"kilo\"\n fontColor=\"medium\"\n />\n </IconContainer>\n </TitleContainer>\n <Transition in={open} timeout={transition}>\n {state => (\n <ContentContainer\n ref={htmlEl => (ref.current = htmlEl)}\n style={{\n ...contentStyle(open, transition, contentHeight, theme),\n ...contentTransition(contentHeight, theme)[state],\n }}\n >\n {children}\n </ContentContainer>\n )}\n </Transition>\n </AccordionContainer>\n );\n};\n\nexport default Accordion;\n"],"file":"Accordion.js"}
@@ -0,0 +1,41 @@
1
+ export declare const contentStyle: (open: boolean, transition: number, value: number, theme: any) => {
2
+ transition: string;
3
+ paddingBottom: any;
4
+ height: number;
5
+ };
6
+ export declare const contentTransition: (value: number, theme: any) => {
7
+ entering: {
8
+ paddingBottom: any;
9
+ height: number;
10
+ };
11
+ entered: {
12
+ paddingBottom: any;
13
+ height: number;
14
+ };
15
+ exiting: {
16
+ paddingBottom: any;
17
+ height: number;
18
+ };
19
+ exited: {
20
+ paddingBottom: number;
21
+ height: number;
22
+ };
23
+ };
24
+ export declare const titleStyle: (transition: number, theme: any) => {
25
+ transition: string;
26
+ color: any;
27
+ };
28
+ export declare const titleTransition: (theme: any) => {
29
+ entering: {
30
+ color: any;
31
+ };
32
+ entered: {
33
+ color: any;
34
+ };
35
+ exiting: {
36
+ color: any;
37
+ };
38
+ exited: {
39
+ color: any;
40
+ };
41
+ };
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.titleTransition = exports.titleStyle = exports.contentTransition = exports.contentStyle = void 0;
7
+
8
+ var _reactCore = require("@tecsinapse/react-core");
9
+
10
+ const contentStyle = (open, transition, value, theme) => ({
11
+ transition: `padding-bottom ${transition * 2}ms ease-in-out, height ${transition * 2}ms ease-in-out`,
12
+ paddingBottom: open ? (0, _reactCore.extractNumbersFromString)(theme.spacing.kilo) : 0,
13
+ height: open ? value : 0
14
+ });
15
+
16
+ exports.contentStyle = contentStyle;
17
+
18
+ const contentTransition = (value, theme) => {
19
+ const paddingBottom = (0, _reactCore.extractNumbersFromString)(theme.spacing.kilo);
20
+ return {
21
+ entering: {
22
+ paddingBottom,
23
+ height: value
24
+ },
25
+ entered: {
26
+ paddingBottom,
27
+ height: value
28
+ },
29
+ exiting: {
30
+ paddingBottom,
31
+ height: value
32
+ },
33
+ exited: {
34
+ paddingBottom: 0,
35
+ height: 0
36
+ }
37
+ };
38
+ };
39
+
40
+ exports.contentTransition = contentTransition;
41
+
42
+ const titleStyle = (transition, theme) => ({
43
+ transition: `color ${transition * 2}ms ease-in-out`,
44
+ color: theme.font.color.dark
45
+ });
46
+
47
+ exports.titleStyle = titleStyle;
48
+
49
+ const titleTransition = theme => ({
50
+ entering: {
51
+ color: theme.font.color.orange
52
+ },
53
+ entered: {
54
+ color: theme.font.color.orange
55
+ },
56
+ exiting: {
57
+ color: theme.font.color.orange
58
+ },
59
+ exited: {
60
+ color: theme.font.color.dark
61
+ }
62
+ });
63
+
64
+ exports.titleTransition = titleTransition;
65
+ //# sourceMappingURL=animations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Accordion/animations.ts"],"names":["contentStyle","open","transition","value","theme","paddingBottom","spacing","kilo","height","contentTransition","entering","entered","exiting","exited","titleStyle","color","font","dark","titleTransition","orange"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,YAAY,GAAG,CAC1BC,IAD0B,EAE1BC,UAF0B,EAG1BC,KAH0B,EAI1BC,KAJ0B,MAKtB;AACJF,EAAAA,UAAU,EAAG,kBAAiBA,UAAU,GAAG,CAAE,0BAC3CA,UAAU,GAAG,CACd,gBAHG;AAIJG,EAAAA,aAAa,EAAEJ,IAAI,GAAG,yCAAyBG,KAAK,CAACE,OAAN,CAAcC,IAAvC,CAAH,GAAkD,CAJjE;AAKJC,EAAAA,MAAM,EAAEP,IAAI,GAAGE,KAAH,GAAW;AALnB,CALsB,CAArB;;;;AAaA,MAAMM,iBAAiB,GAAG,CAACN,KAAD,EAAgBC,KAAhB,KAAqC;AACpE,QAAMC,aAAa,GAAG,yCAAyBD,KAAK,CAACE,OAAN,CAAcC,IAAvC,CAAtB;AACA,SAAO;AACLG,IAAAA,QAAQ,EAAE;AACRL,MAAAA,aADQ;AAERG,MAAAA,MAAM,EAAEL;AAFA,KADL;AAKLQ,IAAAA,OAAO,EAAE;AACPN,MAAAA,aADO;AAEPG,MAAAA,MAAM,EAAEL;AAFD,KALJ;AASLS,IAAAA,OAAO,EAAE;AACPP,MAAAA,aADO;AAEPG,MAAAA,MAAM,EAAEL;AAFD,KATJ;AAaLU,IAAAA,MAAM,EAAE;AAAER,MAAAA,aAAa,EAAE,CAAjB;AAAoBG,MAAAA,MAAM,EAAE;AAA5B;AAbH,GAAP;AAeD,CAjBM;;;;AAmBA,MAAMM,UAAU,GAAG,CAACZ,UAAD,EAAqBE,KAArB,MAA2C;AACnEF,EAAAA,UAAU,EAAG,SAAQA,UAAU,GAAG,CAAE,gBAD+B;AAEnEa,EAAAA,KAAK,EAAEX,KAAK,CAACY,IAAN,CAAWD,KAAX,CAAiBE;AAF2C,CAA3C,CAAnB;;;;AAKA,MAAMC,eAAe,GAAId,KAAD,KAAuB;AACpDM,EAAAA,QAAQ,EAAE;AACRK,IAAAA,KAAK,EAAEX,KAAK,CAACY,IAAN,CAAWD,KAAX,CAAiBI;AADhB,GAD0C;AAIpDR,EAAAA,OAAO,EAAE;AACPI,IAAAA,KAAK,EAAEX,KAAK,CAACY,IAAN,CAAWD,KAAX,CAAiBI;AADjB,GAJ2C;AAOpDP,EAAAA,OAAO,EAAE;AACPG,IAAAA,KAAK,EAAEX,KAAK,CAACY,IAAN,CAAWD,KAAX,CAAiBI;AADjB,GAP2C;AAUpDN,EAAAA,MAAM,EAAE;AAAEE,IAAAA,KAAK,EAAEX,KAAK,CAACY,IAAN,CAAWD,KAAX,CAAiBE;AAA1B;AAV4C,CAAvB,CAAxB","sourcesContent":["import { ThemeProp, extractNumbersFromString } from '@tecsinapse/react-core';\n\nexport const contentStyle = (\n open: boolean,\n transition: number,\n value: number,\n theme: ThemeProp\n) => ({\n transition: `padding-bottom ${transition * 2}ms ease-in-out, height ${\n transition * 2\n }ms ease-in-out`,\n paddingBottom: open ? extractNumbersFromString(theme.spacing.kilo) : 0,\n height: open ? value : 0,\n});\n\nexport const contentTransition = (value: number, theme: ThemeProp) => {\n const paddingBottom = extractNumbersFromString(theme.spacing.kilo);\n return {\n entering: {\n paddingBottom,\n height: value,\n },\n entered: {\n paddingBottom,\n height: value,\n },\n exiting: {\n paddingBottom,\n height: value,\n },\n exited: { paddingBottom: 0, height: 0 },\n };\n};\n\nexport const titleStyle = (transition: number, theme: ThemeProp) => ({\n transition: `color ${transition * 2}ms ease-in-out`,\n color: theme.font.color.dark,\n});\n\nexport const titleTransition = (theme: ThemeProp) => ({\n entering: {\n color: theme.font.color.orange,\n },\n entered: {\n color: theme.font.color.orange,\n },\n exiting: {\n color: theme.font.color.orange,\n },\n exited: { color: theme.font.color.dark },\n});\n"],"file":"animations.js"}
@@ -0,0 +1 @@
1
+ export { default as Accordion, AccordionProps } from './Accordion';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Accordion", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Accordion.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "AccordionProps", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _Accordion.AccordionProps;
16
+ }
17
+ });
18
+
19
+ var _Accordion = _interopRequireWildcard(require("./Accordion"));
20
+
21
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
22
+
23
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Accordion/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as Accordion, AccordionProps } from './Accordion';\n"],"file":"index.js"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const IconContainer: import("@emotion/styled").StyledComponent<any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
3
+ export declare const TitleContainer: import("@emotion/styled").StyledComponent<any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
+ export declare const AccordionContainer: import("@emotion/styled").StyledComponent<any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const ContentContainer: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any> | undefined;
8
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ContentContainer = exports.AccordionContainer = exports.TitleContainer = exports.IconContainer = void 0;
7
+
8
+ var _styled = _interopRequireDefault(require("@emotion/styled"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ const IconContainer = (0, _styled.default)('div')`
13
+ border-radius: ${({
14
+ theme
15
+ }) => theme.borderRadius.mili};
16
+ border: ${({
17
+ theme
18
+ }) => `${theme.borderWidth.pico} solid ${theme.color.secondary.light}`};
19
+ display: flex;
20
+ text-align: center;
21
+ justify-content: center;
22
+ align-items: center;
23
+ `;
24
+ exports.IconContainer = IconContainer;
25
+ const TitleContainer = (0, _styled.default)('div')`
26
+ display: flex;
27
+ flex: 1;
28
+ flex-direction: row;
29
+ justify-content: space-between;
30
+ cursor: pointer;
31
+ padding: ${({
32
+ theme
33
+ }) => theme.spacing.kilo} 0;
34
+ `;
35
+ exports.TitleContainer = TitleContainer;
36
+ const AccordionContainer = (0, _styled.default)('div')`
37
+ display: flex;
38
+ flex-direction: column;
39
+ border-bottom: ${({
40
+ theme
41
+ }) => `${theme.borderWidth.pico} solid ${theme.color.secondary.light}`};
42
+ background-color: ${({
43
+ theme
44
+ }) => theme.miscellaneous.surfaceColor};
45
+ `;
46
+ exports.AccordionContainer = AccordionContainer;
47
+ const ContentContainer = (0, _styled.default)('div')`
48
+ display: flex;
49
+ flex-direction: column;
50
+ overflow: hidden;
51
+ `;
52
+ exports.ContentContainer = ContentContainer;
53
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Accordion/styled.ts"],"names":["IconContainer","theme","borderRadius","mili","borderWidth","pico","color","secondary","light","TitleContainer","spacing","kilo","AccordionContainer","miscellaneous","surfaceColor","ContentContainer"],"mappings":";;;;;;;AAAA;;;;AAGO,MAAMA,aAAa,GAAG,qBAAO,KAAP,CAAmC;AAChE,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC1D,YAAY,CAAC;AAAEF,EAAAA;AAAF,CAAD,KACP,GAAEA,KAAK,CAACG,WAAN,CAAkBC,IAAK,UAASJ,KAAK,CAACK,KAAN,CAAYC,SAAZ,CAAsBC,KAAM,EAAE;AACrE;AACA;AACA;AACA;AACA,CARO;;AAUA,MAAMC,cAAc,GAAG,qBAAO,KAAP,CAAmC;AACjE;AACA;AACA;AACA;AACA;AACA,aAAa,CAAC;AAAER,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACS,OAAN,CAAcC,IAAK;AAC/C,CAPO;;AASA,MAAMC,kBAAkB,GAAG,qBAAO,KAAP,CAAmC;AACrE;AACA;AACA,mBAAmB,CAAC;AAAEX,EAAAA;AAAF,CAAD,KACd,GAAEA,KAAK,CAACG,WAAN,CAAkBC,IAAK,UAASJ,KAAK,CAACK,KAAN,CAAYC,SAAZ,CAAsBC,KAAM,EAAE;AACrE,sBAAsB,CAAC;AAAEP,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACY,aAAN,CAAoBC,YAAa;AACtE,CANO;;AAQA,MAAMC,gBAAgB,GAAG,qBAAO,KAAP,CAAc;AAC9C;AACA;AACA;AACA,CAJO","sourcesContent":["import styled from '@emotion/styled';\nimport { StyleProps } from '@tecsinapse/react-core';\n\nexport const IconContainer = styled('div')<Partial<StyleProps>>`\n border-radius: ${({ theme }) => theme.borderRadius.mili};\n border: ${({ theme }) =>\n `${theme.borderWidth.pico} solid ${theme.color.secondary.light}`};\n display: flex;\n text-align: center;\n justify-content: center;\n align-items: center;\n`;\n\nexport const TitleContainer = styled('div')<Partial<StyleProps>>`\n display: flex;\n flex: 1;\n flex-direction: row;\n justify-content: space-between;\n cursor: pointer;\n padding: ${({ theme }) => theme.spacing.kilo} 0;\n`;\n\nexport const AccordionContainer = styled('div')<Partial<StyleProps>>`\n display: flex;\n flex-direction: column;\n border-bottom: ${({ theme }) =>\n `${theme.borderWidth.pico} solid ${theme.color.secondary.light}`};\n background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};\n`;\n\nexport const ContentContainer = styled('div')`\n display: flex;\n flex-direction: column;\n overflow: hidden;\n`;\n"],"file":"styled.js"}
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "BadgeWebProps", {
18
18
 
19
19
  var _Badge = _interopRequireWildcard(require("./Badge"));
20
20
 
21
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
21
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
22
22
 
23
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
24
  //# sourceMappingURL=index.js.map
@@ -36,7 +36,7 @@ Object.keys(_useMouseHover).forEach(function (key) {
36
36
  });
37
37
  });
38
38
 
39
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
39
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
40
40
 
41
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
42
42
  //# sourceMappingURL=index.js.map
@@ -9,13 +9,15 @@ var _native = _interopRequireWildcard(require("@emotion/native"));
9
9
 
10
10
  var _reactCore = require("@tecsinapse/react-core");
11
11
 
12
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
13
 
14
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
 
16
16
  const webStyles = () => {
17
17
  return (0, _native.css)`
18
- user-select: none;
18
+ & * {
19
+ user-select: none;
20
+ }
19
21
  `;
20
22
  };
21
23
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Button/styled.ts"],"names":["webStyles","hoverStyles","mouseOver","theme","color","disabled","dark","StyledWebButton","Button"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAGA,MAAMA,SAAS,GAAG,MAAM;AACtB,SAAO,gBAAI;AACb;AACA,GAFE;AAGD,CAJD;;AAMA,MAAMC,WAAW,GAAG,CAAC;AACnBC,EAAAA,SADmB;AAEnBC,EAAAA,KAFmB;AAGnBC,EAAAA,KAAK,GAAG,SAHW;AAInBC,EAAAA;AAJmB,CAAD,KAKiD;AACnE,SACEH,SAAS,IACT,CAACG,QADD,IAEA,gBAAI;AACR,0BAA0BF,KADnB,aACmBA,KADnB,uBACmBA,KAAK,CAAEC,KAAP,CAAaA,KAAb,EAAoBE,IAAK;AACnD,sBAAsBH,KAFf,aAEeA,KAFf,uBAEeA,KAAK,CAAEC,KAAP,CAAaA,KAAb,EAAoBE,IAAK;AAC/C,KANE;AAQD,CAdD;;AAgBO,MAAMC,eAAe,GAAG,qBAAOC,iBAAP,EAE7BR,SAF6B,EAElBC,WAFkB,CAAxB","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { Button, StyleProps } from '@tecsinapse/react-core';\nimport { WebButtonProps } from './Button';\n\nconst webStyles = () => {\n return css`\n user-select: none;\n `;\n};\n\nconst hoverStyles = ({\n mouseOver,\n theme,\n color = 'primary',\n disabled,\n}: { mouseOver: boolean } & WebButtonProps & Partial<StyleProps>) => {\n return (\n mouseOver &&\n !disabled &&\n css`\n background-color: ${theme?.color[color].dark};\n border-color: ${theme?.color[color].dark};\n `\n );\n};\n\nexport const StyledWebButton = styled(Button)<\n { mouseOver: boolean } & WebButtonProps & Partial<StyleProps>\n>(webStyles, hoverStyles);\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Button/styled.ts"],"names":["webStyles","hoverStyles","mouseOver","theme","color","disabled","dark","StyledWebButton","Button"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAGA,MAAMA,SAAS,GAAG,MAAM;AACtB,SAAO,gBAAI;AACb;AACA;AACA;AACA,GAJE;AAKD,CAND;;AAQA,MAAMC,WAAW,GAAG,CAAC;AACnBC,EAAAA,SADmB;AAEnBC,EAAAA,KAFmB;AAGnBC,EAAAA,KAAK,GAAG,SAHW;AAInBC,EAAAA;AAJmB,CAAD,KAKiD;AACnE,SACEH,SAAS,IACT,CAACG,QADD,IAEA,gBAAI;AACR,0BAA0BF,KADnB,aACmBA,KADnB,uBACmBA,KAAK,CAAEC,KAAP,CAAaA,KAAb,EAAoBE,IAAK;AACnD,sBAAsBH,KAFf,aAEeA,KAFf,uBAEeA,KAAK,CAAEC,KAAP,CAAaA,KAAb,EAAoBE,IAAK;AAC/C,KANE;AAQD,CAdD;;AAgBO,MAAMC,eAAe,GAAG,qBAAOC,iBAAP,EAE7BR,SAF6B,EAElBC,WAFkB,CAAxB","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { Button, StyleProps } from '@tecsinapse/react-core';\nimport { WebButtonProps } from './Button';\n\nconst webStyles = () => {\n return css`\n & * {\n user-select: none;\n }\n `;\n};\n\nconst hoverStyles = ({\n mouseOver,\n theme,\n color = 'primary',\n disabled,\n}: { mouseOver: boolean } & WebButtonProps & Partial<StyleProps>) => {\n return (\n mouseOver &&\n !disabled &&\n css`\n background-color: ${theme?.color[color].dark};\n border-color: ${theme?.color[color].dark};\n `\n );\n};\n\nexport const StyledWebButton = styled(Button)<\n { mouseOver: boolean } & WebButtonProps & Partial<StyleProps>\n>(webStyles, hoverStyles);\n"],"file":"styled.js"}
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "InputWebProps", {
18
18
 
19
19
  var _Input = _interopRequireWildcard(require("./Input"));
20
20
 
21
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
21
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
22
22
 
23
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
24
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,8 @@
1
+ import React, { CSSProperties } from 'react';
2
+ export interface ModalProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ style?: CSSProperties;
6
+ }
7
+ declare const Modal: React.FC<ModalProps>;
8
+ export default Modal;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactTransitionGroup = require("react-transition-group");
11
+
12
+ var _Overlay = require("../Overlay");
13
+
14
+ var _styled = require("./styled");
15
+
16
+ var _animations = require("./animations");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const Modal = ({
21
+ children,
22
+ open,
23
+ onClose,
24
+ style
25
+ }) => {
26
+ return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_Overlay.Overlay, {
27
+ open: open,
28
+ onClose: onClose,
29
+ zIndex: "modal"
30
+ }), _react.default.createElement(_reactTransitionGroup.Transition, {
31
+ in: open,
32
+ timeout: 400
33
+ }, state => _react.default.createElement(_styled.ModalContainer, {
34
+ style: { ...style,
35
+ ..._animations.defaultStyleOverlay,
36
+ ..._animations.transitionStylesOverlay[state]
37
+ }
38
+ }, children)));
39
+ };
40
+
41
+ var _default = Modal;
42
+ exports.default = _default;
43
+ //# sourceMappingURL=Modal.js.map