@semcore/feature-popover 3.0.7 → 3.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +2 -2
- package/lib/cjs/FeaturePopover.js +11 -11
- package/lib/cjs/FeaturePopover.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/es6/FeaturePopover.js +11 -11
- package/lib/es6/FeaturePopover.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/package.json +1 -1
- package/src/FeaturePopover.jsx +0 -143
- package/src/index.d.ts +0 -29
- package/src/index.js +0 -1
- package/src/style/feature-popover.shadow.css +0 -93
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [3.0.10] - 2022-07-22
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/utils` [3.34.0 ~> 3.35.0], `@semcore/animation` [1.5.4 ~> 1.5.5]).
|
|
10
|
+
|
|
11
|
+
## [3.0.9] - 2022-07-21
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Version patch update due to children dependencies update (`@semcore/icon` [2.28.0 ~> 2.29.0]).
|
|
16
|
+
|
|
17
|
+
## [3.0.8] - 2022-07-18
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Version patch update due to children dependencies update (`@semcore/popper` [4.11.23 ~> 4.11.24]).
|
|
22
|
+
|
|
5
23
|
## [3.0.7] - 2022-07-07
|
|
6
24
|
|
|
7
25
|
### Changed
|
package/README.md
CHANGED
|
@@ -42,12 +42,12 @@ of the components that is discussed below. There should only be one version of t
|
|
|
42
42
|
|
|
43
43
|
You can use the package the same way but without `/ui/` in the import path.
|
|
44
44
|
|
|
45
|
-
</details>
|
|
46
|
-
|
|
47
45
|
```jsx
|
|
48
46
|
import FeaturePopover from '@semcore/feature-popover';
|
|
49
47
|
```
|
|
50
48
|
|
|
49
|
+
</details>
|
|
50
|
+
|
|
51
51
|
## 👤 Author
|
|
52
52
|
|
|
53
53
|
[UI-kit team](https://github.com/semrush/intergalactic/blob/master/MAINTAINERS) and [others ❤️](https://github.com/semrush/intergalactic/graphs/contributors)
|
|
@@ -60,28 +60,28 @@ var style = (
|
|
|
60
60
|
/*__reshadow_css_start__*/
|
|
61
61
|
_core.sstyled.insert(
|
|
62
62
|
/*__inner_css_start__*/
|
|
63
|
-
".
|
|
63
|
+
".___SFeaturePopover_cwqjb_gg_{padding-top:16px;padding-right:32px;padding-bottom:16px;padding-left:16px;border-radius:6px;box-sizing:border-box;background-color:#fce081;color:#191b23;box-shadow:0 1px 12px rgba(25,27,35,.15)}.___SClose_cwqjb_gg_{position:absolute;right:0;top:0;padding:8px;cursor:pointer;color:#191b23;font-size:0}@-webkit-keyframes showTrigger_cwqjb{0%{opacity:0}to{opacity:1}}@keyframes showTrigger_cwqjb{0%{opacity:0}to{opacity:1}}@-webkit-keyframes scaleSizeAndHide_cwqjb{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}@keyframes scaleSizeAndHide_cwqjb{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}.___SSpot_cwqjb_gg_{position:absolute;bottom:-4px;right:-4px;-webkit-animation-name:showTrigger_cwqjb;animation-name:showTrigger_cwqjb;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-delay:.4s;animation-delay:.4s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;width:12px;height:12px}.___SSpot_cwqjb_gg_:before{content:\"\";position:absolute;top:0;left:0;transform-origin:50%;-webkit-animation-name:scaleSizeAndHide_cwqjb;animation-name:scaleSizeAndHide_cwqjb;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:.5s;animation-delay:.5s;background-color:#fce081;border-radius:50%;width:12px;height:12px}.___SSpot_cwqjb_gg_:after{content:\"\";position:absolute;top:0;left:0;border-radius:50%;width:12px;height:12px;background-color:#fce081}@media (prefers-reduced-motion){.___SSpot_cwqjb_gg_{-webkit-animation-name:none;animation-name:none}.___SSpot_cwqjb_gg_:before{-webkit-animation-name:none;animation-name:none}}"
|
|
64
64
|
/*__inner_css_end__*/
|
|
65
|
-
, "
|
|
65
|
+
, "cwqjb_gg_")
|
|
66
66
|
/*__reshadow_css_end__*/
|
|
67
67
|
, {
|
|
68
|
-
"__SFeaturePopover": "
|
|
69
|
-
"__SClose": "
|
|
70
|
-
"@showTrigger": "
|
|
71
|
-
"@scaleSizeAndHide": "
|
|
72
|
-
"__SSpot": "
|
|
68
|
+
"__SFeaturePopover": "___SFeaturePopover_cwqjb_gg_",
|
|
69
|
+
"__SClose": "___SClose_cwqjb_gg_",
|
|
70
|
+
"@showTrigger": "showTrigger_cwqjb",
|
|
71
|
+
"@scaleSizeAndHide": "scaleSizeAndHide_cwqjb",
|
|
72
|
+
"__SSpot": "___SSpot_cwqjb_gg_"
|
|
73
73
|
});
|
|
74
74
|
var stylePopper = (
|
|
75
75
|
/*__reshadow_css_start__*/
|
|
76
76
|
_core.sstyled.insert(
|
|
77
77
|
/*__inner_css_start__*/
|
|
78
|
-
"@-webkit-keyframes
|
|
78
|
+
"@-webkit-keyframes enter_1pppn{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}@keyframes enter_1pppn{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}@-webkit-keyframes exit_1pppn{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-10px)}}@keyframes exit_1pppn{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-10px)}}"
|
|
79
79
|
/*__inner_css_end__*/
|
|
80
|
-
, "
|
|
80
|
+
, "1pppn_gg_")
|
|
81
81
|
/*__reshadow_css_end__*/
|
|
82
82
|
, {
|
|
83
|
-
"@enter": "
|
|
84
|
-
"@exit": "
|
|
83
|
+
"@enter": "enter_1pppn",
|
|
84
|
+
"@exit": "exit_1pppn"
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
var FeaturePopover = /*#__PURE__*/function (_Component) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"FeaturePopover.js","names":["stylePopper","sstyled","FeaturePopover","name","enabled","visible","handlers","e","asProps","$onCloseClick","handleCloseClick","styles","forwardRef","onVisibleChange","modifiers","other","callAllEventHandlers","handleVisibleChange","defaultModifiers","Component","style","offset","placement","defaultVisible","onOutsideClick","interaction","trigger","popper","FeaturePopoverPopper","SFeaturePopover","Box","SClose","Close","Children","closeIcon","duration","Spot","props","SSpot","createComponent","Trigger","Popper","parent"],"sources":["../../src/FeaturePopover.jsx"],"sourcesContent":["import React from 'react';\nimport { Animation } from '@semcore/animation';\nimport createComponent, { Root, Component, sstyled } from '@semcore/core';\nimport Popper from '@semcore/popper';\nimport { Box } from '@semcore/flex-box';\nimport Close from '@semcore/icon/Close/m';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\n\nimport style from './style/feature-popover.shadow.css';\n\nconst stylePopper = sstyled.css`\n @keyframes enter {\n from {\n opacity: 0;\n transform: translateX(-10px);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n }\n\n @keyframes exit {\n from {\n opacity: 1;\n transform: translateX(0);\n }\n to {\n opacity: 0;\n transform: translateX(-10px);\n }\n }\n`;\n\nclass FeaturePopover extends Component {\n static displayName = 'FeaturePopover';\n static style = style;\n static defaultProps = {\n offset: [0, 12],\n placement: 'bottom-start',\n defaultVisible: false,\n onOutsideClick: () => false,\n interaction: {\n trigger: [['onClick']],\n popper: [],\n },\n };\n\n defaultModifiers = [\n {\n name: 'flip',\n enabled: false,\n },\n ];\n\n uncontrolledProps() {\n return {\n visible: null,\n };\n }\n\n handleVisibleChange = (visible) => {\n this.handlers.visible(visible);\n };\n\n handleCloseClick = (e) => {\n this.handlers.visible(false, e);\n };\n\n getPopperProps() {\n const { visible } = this.asProps;\n return {\n visible,\n $onCloseClick: this.handleCloseClick,\n };\n }\n\n getSpotProps() {\n const { visible } = this.asProps;\n return { visible };\n }\n\n render() {\n const { styles, forwardRef, onVisibleChange, modifiers = [], ...other } = this.asProps;\n\n return sstyled(styles)(\n <Popper\n ref={forwardRef}\n onVisibleChange={callAllEventHandlers(onVisibleChange, this.handleVisibleChange)}\n modifiers={[...this.defaultModifiers, ...modifiers]}\n {...other}\n />,\n );\n }\n}\n\nclass FeaturePopoverPopper extends Component {\n static defaultProps = {\n closeIcon: false,\n duration: 200,\n };\n\n render() {\n const SFeaturePopover = Root;\n const SClose = Close;\n const { Children, styles, visible, closeIcon, duration, $onCloseClick } = this.asProps;\n\n return sstyled(styles)(\n <Popper.Popper disableEnforceFocus>\n <Animation\n visible={visible}\n duration={duration}\n keyframes={[stylePopper['@enter'], stylePopper['@exit']]}\n >\n <SFeaturePopover render={Box}>\n {closeIcon ? <SClose onClick={$onCloseClick} /> : null}\n <Children />\n </SFeaturePopover>\n </Animation>\n </Popper.Popper>,\n );\n }\n}\n\nconst Spot = (props) => {\n const SSpot = Root;\n\n const { styles, visible } = props;\n\n if (!visible) return null;\n\n return sstyled(styles)(<SSpot render={Box} />);\n};\n\nexport default createComponent(\n FeaturePopover,\n {\n Trigger: Popper.Trigger,\n Popper: FeaturePopoverPopper,\n Spot,\n },\n { parent: Popper },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,WAAW;AAAA;AAAGC,aAAA,OAAH;AAAA;AAA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B,CAAQ1B,MAAR;EAAA,IAAgBN,OAAhB,GAA4BgC,KAA5B,CAAgBhC,OAAhB;EAEA,IAAI,CAACA,OAAL,EAAc,OAAO,IAAP;EAEd,eAAO,IAAAJ,aAAA,EAAQU,MAAR,CAAP,eAAuB,gCAAC,KAAD,0EAAvB;AACD,CARD;;eAUe,IAAA4B,gBAAA,EACbrC,cADa,EAEb;EACEsC,OAAO,EAAEC,kBAAA,CAAOD,OADlB;EAEEC,MAAM,EAAEb,oBAFV;EAGEQ,IAAI,EAAJA;AAHF,CAFa,EAOb;EAAEM,MAAM,EAAED;AAAV,CAPa,C"}
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './FeaturePopover';\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
|
|
@@ -33,28 +33,28 @@ var style = (
|
|
|
33
33
|
/*__reshadow_css_start__*/
|
|
34
34
|
_sstyled.insert(
|
|
35
35
|
/*__inner_css_start__*/
|
|
36
|
-
".
|
|
36
|
+
".___SFeaturePopover_cwqjb_gg_{padding-top:16px;padding-right:32px;padding-bottom:16px;padding-left:16px;border-radius:6px;box-sizing:border-box;background-color:#fce081;color:#191b23;box-shadow:0 1px 12px rgba(25,27,35,.15)}.___SClose_cwqjb_gg_{position:absolute;right:0;top:0;padding:8px;cursor:pointer;color:#191b23;font-size:0}@-webkit-keyframes showTrigger_cwqjb{0%{opacity:0}to{opacity:1}}@keyframes showTrigger_cwqjb{0%{opacity:0}to{opacity:1}}@-webkit-keyframes scaleSizeAndHide_cwqjb{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}@keyframes scaleSizeAndHide_cwqjb{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}.___SSpot_cwqjb_gg_{position:absolute;bottom:-4px;right:-4px;-webkit-animation-name:showTrigger_cwqjb;animation-name:showTrigger_cwqjb;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-delay:.4s;animation-delay:.4s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;width:12px;height:12px}.___SSpot_cwqjb_gg_:before{content:\"\";position:absolute;top:0;left:0;transform-origin:50%;-webkit-animation-name:scaleSizeAndHide_cwqjb;animation-name:scaleSizeAndHide_cwqjb;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:.5s;animation-delay:.5s;background-color:#fce081;border-radius:50%;width:12px;height:12px}.___SSpot_cwqjb_gg_:after{content:\"\";position:absolute;top:0;left:0;border-radius:50%;width:12px;height:12px;background-color:#fce081}@media (prefers-reduced-motion){.___SSpot_cwqjb_gg_{-webkit-animation-name:none;animation-name:none}.___SSpot_cwqjb_gg_:before{-webkit-animation-name:none;animation-name:none}}"
|
|
37
37
|
/*__inner_css_end__*/
|
|
38
|
-
, "
|
|
38
|
+
, "cwqjb_gg_")
|
|
39
39
|
/*__reshadow_css_end__*/
|
|
40
40
|
, {
|
|
41
|
-
"__SFeaturePopover": "
|
|
42
|
-
"__SClose": "
|
|
43
|
-
"@showTrigger": "
|
|
44
|
-
"@scaleSizeAndHide": "
|
|
45
|
-
"__SSpot": "
|
|
41
|
+
"__SFeaturePopover": "___SFeaturePopover_cwqjb_gg_",
|
|
42
|
+
"__SClose": "___SClose_cwqjb_gg_",
|
|
43
|
+
"@showTrigger": "showTrigger_cwqjb",
|
|
44
|
+
"@scaleSizeAndHide": "scaleSizeAndHide_cwqjb",
|
|
45
|
+
"__SSpot": "___SSpot_cwqjb_gg_"
|
|
46
46
|
});
|
|
47
47
|
var stylePopper = (
|
|
48
48
|
/*__reshadow_css_start__*/
|
|
49
49
|
sstyled.insert(
|
|
50
50
|
/*__inner_css_start__*/
|
|
51
|
-
"@-webkit-keyframes
|
|
51
|
+
"@-webkit-keyframes enter_1pppn{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}@keyframes enter_1pppn{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}@-webkit-keyframes exit_1pppn{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-10px)}}@keyframes exit_1pppn{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-10px)}}"
|
|
52
52
|
/*__inner_css_end__*/
|
|
53
|
-
, "
|
|
53
|
+
, "1pppn_gg_")
|
|
54
54
|
/*__reshadow_css_end__*/
|
|
55
55
|
, {
|
|
56
|
-
"@enter": "
|
|
57
|
-
"@exit": "
|
|
56
|
+
"@enter": "enter_1pppn",
|
|
57
|
+
"@exit": "exit_1pppn"
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
var FeaturePopover = /*#__PURE__*/function (_Component) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"FeaturePopover.js","names":["React","Animation","createComponent","Root","Component","sstyled","Popper","Box","Close","callAllEventHandlers","stylePopper","FeaturePopover","name","enabled","visible","handlers","e","asProps","$onCloseClick","handleCloseClick","styles","forwardRef","onVisibleChange","modifiers","other","handleVisibleChange","defaultModifiers","style","offset","placement","defaultVisible","onOutsideClick","interaction","trigger","popper","FeaturePopoverPopper","SFeaturePopover","SClose","Children","closeIcon","duration","Spot","props","SSpot","Trigger","parent"],"sources":["../../src/FeaturePopover.jsx"],"sourcesContent":["import React from 'react';\nimport { Animation } from '@semcore/animation';\nimport createComponent, { Root, Component, sstyled } from '@semcore/core';\nimport Popper from '@semcore/popper';\nimport { Box } from '@semcore/flex-box';\nimport Close from '@semcore/icon/Close/m';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\n\nimport style from './style/feature-popover.shadow.css';\n\nconst stylePopper = sstyled.css`\n @keyframes enter {\n from {\n opacity: 0;\n transform: translateX(-10px);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n }\n\n @keyframes exit {\n from {\n opacity: 1;\n transform: translateX(0);\n }\n to {\n opacity: 0;\n transform: translateX(-10px);\n }\n }\n`;\n\nclass FeaturePopover extends Component {\n static displayName = 'FeaturePopover';\n static style = style;\n static defaultProps = {\n offset: [0, 12],\n placement: 'bottom-start',\n defaultVisible: false,\n onOutsideClick: () => false,\n interaction: {\n trigger: [['onClick']],\n popper: [],\n },\n };\n\n defaultModifiers = [\n {\n name: 'flip',\n enabled: false,\n },\n ];\n\n uncontrolledProps() {\n return {\n visible: null,\n };\n }\n\n handleVisibleChange = (visible) => {\n this.handlers.visible(visible);\n };\n\n handleCloseClick = (e) => {\n this.handlers.visible(false, e);\n };\n\n getPopperProps() {\n const { visible } = this.asProps;\n return {\n visible,\n $onCloseClick: this.handleCloseClick,\n };\n }\n\n getSpotProps() {\n const { visible } = this.asProps;\n return { visible };\n }\n\n render() {\n const { styles, forwardRef, onVisibleChange, modifiers = [], ...other } = this.asProps;\n\n return sstyled(styles)(\n <Popper\n ref={forwardRef}\n onVisibleChange={callAllEventHandlers(onVisibleChange, this.handleVisibleChange)}\n modifiers={[...this.defaultModifiers, ...modifiers]}\n {...other}\n />,\n );\n }\n}\n\nclass FeaturePopoverPopper extends Component {\n static defaultProps = {\n closeIcon: false,\n duration: 200,\n };\n\n render() {\n const SFeaturePopover = Root;\n const SClose = Close;\n const { Children, styles, visible, closeIcon, duration, $onCloseClick } = this.asProps;\n\n return sstyled(styles)(\n <Popper.Popper disableEnforceFocus>\n <Animation\n visible={visible}\n duration={duration}\n keyframes={[stylePopper['@enter'], stylePopper['@exit']]}\n >\n <SFeaturePopover render={Box}>\n {closeIcon ? <SClose onClick={$onCloseClick} /> : null}\n <Children />\n </SFeaturePopover>\n </Animation>\n </Popper.Popper>,\n );\n }\n}\n\nconst Spot = (props) => {\n const SSpot = Root;\n\n const { styles, visible } = props;\n\n if (!visible) return null;\n\n return sstyled(styles)(<SSpot render={Box} />);\n};\n\nexport default createComponent(\n FeaturePopover,\n {\n Trigger: Popper.Trigger,\n Popper: FeaturePopoverPopper,\n Spot,\n },\n { parent: Popper },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,OAAOC,eAAP,IAA0BC,IAA1B,EAAgCC,SAAhC,EAA2CC,OAA3C,QAA0D,eAA1D;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,KAAP,MAAkB,uBAAlB;AACA,SAASC,oBAAT,QAAqC,gCAArC;;;;;;;;;;;;;;;;;;AAIA,IAAMC,WAAW;AAAA;AAAGL,OAAO,OAAV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAAA;EAAA;AAAA,EAAjB;;IAwBMM,c;;;;;;;;;;;;;;;;uEAce,CACjB;MACEC,IAAI,EAAE,MADR;MAEEC,OAAO,EAAE;IAFX,CADiB,C;;0EAaG,UAACC,OAAD,EAAa;MACjC,MAAKC,QAAL,CAAcD,OAAd,CAAsBA,OAAtB;IACD,C;;uEAEkB,UAACE,CAAD,EAAO;MACxB,MAAKD,QAAL,CAAcD,OAAd,CAAsB,KAAtB,EAA6BE,CAA7B;IACD,C;;;;;;;WAZD,6BAAoB;MAClB,OAAO;QACLF,OAAO,EAAE;MADJ,CAAP;IAGD;;;WAUD,0BAAiB;MACf,IAAQA,OAAR,GAAoB,KAAKG,OAAzB,CAAQH,OAAR;MACA,OAAO;QACLA,OAAO,EAAPA,OADK;QAELI,aAAa,EAAE,KAAKC;MAFf,CAAP;IAID;;;WAED,wBAAe;MACb,IAAQL,OAAR,GAAoB,KAAKG,OAAzB,CAAQH,OAAR;MACA,OAAO;QAAEA,OAAO,EAAPA;MAAF,CAAP;IACD;;;WAED,kBAAS;MAAA;;MACP,oBAA0E,KAAKG,OAA/E;MAAA,IAAQG,MAAR,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WN,OADX;QAAA,YAEY0B,QAFZ;QAAA,aAGa,CAAC9B,WAAW,CAAC,QAAD,CAAZ,EAAwBA,WAAW,CAAC,OAAD,CAAnC;MAHb,iBAKE,oBAAC,eAAD,0EACG6B,SAAS,gBAAG,oBAAC,MAAD;QAAA,WAAiBrB;MAAjB,GAAH,GAAwC,IADpD,eAEE,oBAAC,QAAD,2BAFF,CALF,CADF,CADF;IAcD;;;;EAzBgCd,S;;gBAA7B+B,oB,kBACkB;EACpBI,SAAS,EAAE,KADS;EAEpBC,QAAQ,EAAE;AAFU,C;;AA2BxB,IAAMC,IAAI,GAAG,SAAPA,IAAO,CAACC,KAAD,EAAW;EAAA;EAAA;;EACtB,IAAMC,KAAK,GAM2BpC,GANtC;EAEA,IAAQa,MAAR,GAA4BsB,KAA5B,CAAQtB,MAAR;EAAA,IAAgBN,OAAhB,GAA4B4B,KAA5B,CAAgB5B,OAAhB;EAEA,IAAI,CAACA,OAAL,EAAc,OAAO,IAAP;EAEd,eAAOT,OAAO,CAACe,MAAD,CAAd,eAAuB,oBAAC,KAAD,iEAAvB;AACD,CARD;;AAUA,eAAelB,eAAe,CAC5BS,cAD4B,EAE5B;EACEiC,OAAO,EAAEtC,MAAM,CAACsC,OADlB;EAEEtC,MAAM,EAAE6B,oBAFV;EAGEM,IAAI,EAAJA;AAHF,CAF4B,EAO5B;EAAEI,MAAM,EAAEvC;AAAV,CAP4B,CAA9B"}
|
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './FeaturePopover';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,kBAAxB"}
|
package/package.json
CHANGED
package/src/FeaturePopover.jsx
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Animation } from '@semcore/animation';
|
|
3
|
-
import createComponent, { Root, Component, sstyled } from '@semcore/core';
|
|
4
|
-
import Popper from '@semcore/popper';
|
|
5
|
-
import { Box } from '@semcore/flex-box';
|
|
6
|
-
import Close from '@semcore/icon/Close/m';
|
|
7
|
-
import { callAllEventHandlers } from '@semcore/utils/lib/assignProps';
|
|
8
|
-
|
|
9
|
-
import style from './style/feature-popover.shadow.css';
|
|
10
|
-
|
|
11
|
-
const stylePopper = sstyled.css`
|
|
12
|
-
@keyframes enter {
|
|
13
|
-
from {
|
|
14
|
-
opacity: 0;
|
|
15
|
-
transform: translateX(-10px);
|
|
16
|
-
}
|
|
17
|
-
to {
|
|
18
|
-
opacity: 1;
|
|
19
|
-
transform: translateX(0);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@keyframes exit {
|
|
24
|
-
from {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
transform: translateX(0);
|
|
27
|
-
}
|
|
28
|
-
to {
|
|
29
|
-
opacity: 0;
|
|
30
|
-
transform: translateX(-10px);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
class FeaturePopover extends Component {
|
|
36
|
-
static displayName = 'FeaturePopover';
|
|
37
|
-
static style = style;
|
|
38
|
-
static defaultProps = {
|
|
39
|
-
offset: [0, 12],
|
|
40
|
-
placement: 'bottom-start',
|
|
41
|
-
defaultVisible: false,
|
|
42
|
-
onOutsideClick: () => false,
|
|
43
|
-
interaction: {
|
|
44
|
-
trigger: [['onClick']],
|
|
45
|
-
popper: [],
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
defaultModifiers = [
|
|
50
|
-
{
|
|
51
|
-
name: 'flip',
|
|
52
|
-
enabled: false,
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
uncontrolledProps() {
|
|
57
|
-
return {
|
|
58
|
-
visible: null,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
handleVisibleChange = (visible) => {
|
|
63
|
-
this.handlers.visible(visible);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
handleCloseClick = (e) => {
|
|
67
|
-
this.handlers.visible(false, e);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
getPopperProps() {
|
|
71
|
-
const { visible } = this.asProps;
|
|
72
|
-
return {
|
|
73
|
-
visible,
|
|
74
|
-
$onCloseClick: this.handleCloseClick,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
getSpotProps() {
|
|
79
|
-
const { visible } = this.asProps;
|
|
80
|
-
return { visible };
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
render() {
|
|
84
|
-
const { styles, forwardRef, onVisibleChange, modifiers = [], ...other } = this.asProps;
|
|
85
|
-
|
|
86
|
-
return sstyled(styles)(
|
|
87
|
-
<Popper
|
|
88
|
-
ref={forwardRef}
|
|
89
|
-
onVisibleChange={callAllEventHandlers(onVisibleChange, this.handleVisibleChange)}
|
|
90
|
-
modifiers={[...this.defaultModifiers, ...modifiers]}
|
|
91
|
-
{...other}
|
|
92
|
-
/>,
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
class FeaturePopoverPopper extends Component {
|
|
98
|
-
static defaultProps = {
|
|
99
|
-
closeIcon: false,
|
|
100
|
-
duration: 200,
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
render() {
|
|
104
|
-
const SFeaturePopover = Root;
|
|
105
|
-
const SClose = Close;
|
|
106
|
-
const { Children, styles, visible, closeIcon, duration, $onCloseClick } = this.asProps;
|
|
107
|
-
|
|
108
|
-
return sstyled(styles)(
|
|
109
|
-
<Popper.Popper disableEnforceFocus>
|
|
110
|
-
<Animation
|
|
111
|
-
visible={visible}
|
|
112
|
-
duration={duration}
|
|
113
|
-
keyframes={[stylePopper['@enter'], stylePopper['@exit']]}
|
|
114
|
-
>
|
|
115
|
-
<SFeaturePopover render={Box}>
|
|
116
|
-
{closeIcon ? <SClose onClick={$onCloseClick} /> : null}
|
|
117
|
-
<Children />
|
|
118
|
-
</SFeaturePopover>
|
|
119
|
-
</Animation>
|
|
120
|
-
</Popper.Popper>,
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const Spot = (props) => {
|
|
126
|
-
const SSpot = Root;
|
|
127
|
-
|
|
128
|
-
const { styles, visible } = props;
|
|
129
|
-
|
|
130
|
-
if (!visible) return null;
|
|
131
|
-
|
|
132
|
-
return sstyled(styles)(<SSpot render={Box} />);
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export default createComponent(
|
|
136
|
-
FeaturePopover,
|
|
137
|
-
{
|
|
138
|
-
Trigger: Popper.Trigger,
|
|
139
|
-
Popper: FeaturePopoverPopper,
|
|
140
|
-
Spot,
|
|
141
|
-
},
|
|
142
|
-
{ parent: Popper },
|
|
143
|
-
);
|
package/src/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { PropGetterFn, CProps, ReturnEl } from '@semcore/core';
|
|
2
|
-
import Popper, { IPopperContext, IPopperPopperProps, IPopperProps } from '@semcore/popper';
|
|
3
|
-
import { Box } from '@semcore/flex-box';
|
|
4
|
-
|
|
5
|
-
export interface IFeaturePopoverPopperProps extends IPopperPopperProps {
|
|
6
|
-
/**
|
|
7
|
-
* The property responsible for the visibility of the closing icon
|
|
8
|
-
* @default false
|
|
9
|
-
*/
|
|
10
|
-
closeIcon?: boolean;
|
|
11
|
-
/** Animation display duration in `ms`
|
|
12
|
-
* @default 200
|
|
13
|
-
*/
|
|
14
|
-
duration?: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface IFeaturePopoverContext extends IPopperContext {
|
|
18
|
-
getSpotProps: PropGetterFn;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare const FeaturePopover: ((
|
|
22
|
-
props: CProps<IPopperProps, IFeaturePopoverContext>,
|
|
23
|
-
) => ReturnEl) & {
|
|
24
|
-
Trigger: typeof Popper.Trigger;
|
|
25
|
-
Popper: <T>(props: IFeaturePopoverPopperProps & T) => ReturnEl;
|
|
26
|
-
Spot: typeof Box;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default FeaturePopover;
|
package/src/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './FeaturePopover';
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
@import '@semcore/utils/style/var.css';
|
|
2
|
-
|
|
3
|
-
SFeaturePopover {
|
|
4
|
-
padding-top: 16px;
|
|
5
|
-
padding-right: 32px;
|
|
6
|
-
padding-bottom: 16px;
|
|
7
|
-
padding-left: 16px;
|
|
8
|
-
border-radius: var(--rounded-m);
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
background-color: var(--yellow-100);
|
|
11
|
-
color: var(--gray-800);
|
|
12
|
-
box-shadow: 0 1px 12px rgba(25, 27, 35, 0.15);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
SClose {
|
|
16
|
-
position: absolute;
|
|
17
|
-
right: 0;
|
|
18
|
-
top: 0;
|
|
19
|
-
padding: 8px;
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
color: var(--gray-800);
|
|
22
|
-
font-size: 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@keyframes showTrigger {
|
|
26
|
-
from {
|
|
27
|
-
opacity: 0;
|
|
28
|
-
}
|
|
29
|
-
to {
|
|
30
|
-
opacity: 1;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@keyframes scaleSizeAndHide {
|
|
35
|
-
from {
|
|
36
|
-
opacity: 1;
|
|
37
|
-
transform: scale(1);
|
|
38
|
-
}
|
|
39
|
-
to {
|
|
40
|
-
opacity: 0;
|
|
41
|
-
transform: scale(2);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
SSpot {
|
|
46
|
-
position: absolute;
|
|
47
|
-
bottom: -4px;
|
|
48
|
-
right: -4px;
|
|
49
|
-
animation-name: showTrigger;
|
|
50
|
-
animation-duration: 0.2s;
|
|
51
|
-
animation-timing-function: ease-in;
|
|
52
|
-
animation-delay: 0.4s;
|
|
53
|
-
animation-fill-mode: forwards;
|
|
54
|
-
width: 12px;
|
|
55
|
-
height: 12px;
|
|
56
|
-
|
|
57
|
-
&::before {
|
|
58
|
-
content: '';
|
|
59
|
-
position: absolute;
|
|
60
|
-
top: 0;
|
|
61
|
-
left: 0;
|
|
62
|
-
transform-origin: 50%;
|
|
63
|
-
animation-name: scaleSizeAndHide;
|
|
64
|
-
animation-duration: 1s;
|
|
65
|
-
animation-iteration-count: infinite;
|
|
66
|
-
animation-fill-mode: forwards;
|
|
67
|
-
animation-delay: 0.5s;
|
|
68
|
-
background-color: var(--yellow-100);
|
|
69
|
-
border-radius: 50%;
|
|
70
|
-
width: 12px;
|
|
71
|
-
height: 12px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
&::after {
|
|
75
|
-
content: '';
|
|
76
|
-
position: absolute;
|
|
77
|
-
top: 0;
|
|
78
|
-
left: 0;
|
|
79
|
-
border-radius: 50%;
|
|
80
|
-
width: 12px;
|
|
81
|
-
height: 12px;
|
|
82
|
-
background-color: var(--yellow-100);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@media (prefers-reduced-motion) {
|
|
87
|
-
SSpot {
|
|
88
|
-
animation-name: none;
|
|
89
|
-
&::before {
|
|
90
|
-
animation-name: none;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|