@semcore/feature-popover 16.1.6-prerelease.3 → 16.2.0-prerelease.1
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 +12 -0
- package/lib/cjs/FeaturePopover.js +61 -51
- package/lib/cjs/FeaturePopover.js.map +1 -1
- package/lib/cjs/FeaturePopover.type.js +2 -0
- package/lib/cjs/FeaturePopover.type.js.map +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/feature-popover.shadow.css +26 -4
- package/lib/es6/FeaturePopover.js +53 -43
- package/lib/es6/FeaturePopover.js.map +1 -1
- package/lib/es6/FeaturePopover.type.js +2 -0
- package/lib/es6/FeaturePopover.type.js.map +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/feature-popover.shadow.css +26 -4
- package/lib/esm/FeaturePopover.mjs +41 -32
- package/lib/esm/style/feature-popover.shadow.css +26 -4
- package/lib/types/FeaturePopover.d.ts +3 -0
- package/lib/types/FeaturePopover.type.d.ts +147 -0
- package/lib/types/index.d.ts +3 -138
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +44 -0
- package/package.json +13 -13
- package/lib/cjs/index.d.js +0 -2
- package/lib/cjs/index.d.js.map +0 -1
- package/lib/es6/index.d.js +0 -2
- package/lib/es6/index.d.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [16.2.0] - 2025-07-24
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Tokens for default `FeaturePopover` theme.
|
|
10
|
+
|
|
11
|
+
## [16.1.7] - 2025-08-29
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Type description for `FeaturePopoverPopperProps`.
|
|
16
|
+
|
|
5
17
|
## [16.1.6] - 2025-08-07
|
|
6
18
|
|
|
7
19
|
### Changed
|
|
@@ -16,35 +16,36 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
16
16
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _core = require("@semcore/core");
|
|
19
|
-
var
|
|
19
|
+
var _baseComponents = require("@semcore/base-components");
|
|
20
20
|
var _button = _interopRequireDefault(require("@semcore/button"));
|
|
21
21
|
var _assignProps4 = require("@semcore/core/lib/utils/assignProps");
|
|
22
22
|
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
23
|
-
var _flexBox = require("@semcore/flex-box");
|
|
24
23
|
var _m = _interopRequireDefault(require("@semcore/icon/Close/m"));
|
|
25
|
-
var _popper = _interopRequireDefault(require("@semcore/popper"));
|
|
26
24
|
var _react = _interopRequireDefault(require("react"));
|
|
27
25
|
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
28
26
|
var _excluded = ["styles", "forwardRef", "onVisibleChange", "modifiers"];
|
|
29
27
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
30
28
|
/*!__reshadow-styles__:"./style/feature-popover.shadow.css"*/
|
|
31
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
29
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes showTrigger_1a3ym{0%{opacity:0}to{opacity:1}}@keyframes scaleSizeAndHide_1a3ym{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}.___SFeaturePopover_1a3ym_gg_{padding-top:var(--intergalactic-spacing-4x, 16px);padding-right:var(--intergalactic-spacing-10x, 40px);padding-bottom:var(--intergalactic-spacing-4x, 16px);padding-left:var(--intergalactic-spacing-4x, 16px);border-radius:var(--intergalactic-popper-rounded, 6px);box-sizing:border-box;box-shadow:var(--intergalactic-box-shadow-popper, 0px 1px 12px 0px rgba(25, 27, 35, 0.15));position:relative}.___SFeaturePopover_1a3ym_gg_._theme_accent_1a3ym_gg_{background-color:var(--intergalactic-feature-popover-bg, #fce081);color:var(--intergalactic-text-primary, #191b23)}.___SFeaturePopover_1a3ym_gg_._theme_neutral_1a3ym_gg_{background-color:var(--intergalactic-feature-popover-bg-neutral, #1D113E);color:var(--intergalactic-text-primary-invert, #ffffff)}.___STrigger_1a3ym_gg_{position:relative}.___SClose_1a3ym_gg_{position:absolute;z-index:1;right:var(--intergalactic-spacing-2x, 8px);top:var(--intergalactic-spacing-2x, 8px)}.___SClose_1a3ym_gg_ .___SAddon_1a3ym_gg_:only-child{margin-left:calc(var(--intergalactic-spacing-2x, 8px) - 1px);margin-right:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SSpot_1a3ym_gg_{position:absolute;bottom:calc(-1*var(--intergalactic-spacing-1x, 4px));right:calc(-1*var(--intergalactic-spacing-1x, 4px));animation-name:showTrigger_1a3ym;animation-duration:.2s;animation-timing-function:ease-in;animation-delay:.4s;animation-fill-mode:forwards;width:12px;height:12px}.___SSpot_1a3ym_gg_::before{transform-origin:50%;animation-name:scaleSizeAndHide_1a3ym;animation-duration:1s;animation-iteration-count:infinite;animation-fill-mode:forwards;animation-delay:.5s}.___SSpot_1a3ym_gg_::after,.___SSpot_1a3ym_gg_::before{content:\"\";position:absolute;top:0;left:0;border-radius:50%;width:12px;height:12px}.___SSpot_1a3ym_gg_._theme_accent_1a3ym_gg_::before{background-color:var(--intergalactic-feature-popover-dot-outer-border, #fce081)}.___SSpot_1a3ym_gg_._theme_accent_1a3ym_gg_::after{background-color:var(--intergalactic-feature-popover-bg, #fce081)}.___SSpot_1a3ym_gg_._theme_neutral_1a3ym_gg_::before{background-color:var(--intergalactic-feature-popover-dot-neutral-outer-border, #00c192)}.___SSpot_1a3ym_gg_._theme_neutral_1a3ym_gg_::after{background-color:var(--intergalactic-feature-popover-dot-neutral, #00c192)}@media (prefers-reduced-motion){.___SSpot_1a3ym_gg_,.___SSpot_1a3ym_gg_::before{animation-name:none}}", /*__inner_css_end__*/"1a3ym_gg_"),
|
|
32
30
|
/*__reshadow_css_end__*/
|
|
33
31
|
{
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
32
|
+
"__STrigger": "___STrigger_1a3ym_gg_",
|
|
33
|
+
"@showTrigger": "showTrigger_1a3ym",
|
|
34
|
+
"@scaleSizeAndHide": "scaleSizeAndHide_1a3ym",
|
|
35
|
+
"__SFeaturePopover": "___SFeaturePopover_1a3ym_gg_",
|
|
36
|
+
"_theme_accent": "_theme_accent_1a3ym_gg_",
|
|
37
|
+
"_theme_neutral": "_theme_neutral_1a3ym_gg_",
|
|
38
|
+
"__SClose": "___SClose_1a3ym_gg_",
|
|
39
|
+
"__SAddon": "___SAddon_1a3ym_gg_",
|
|
40
|
+
"__SSpot": "___SSpot_1a3ym_gg_"
|
|
41
41
|
});
|
|
42
|
-
var stylePopper = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
42
|
+
var stylePopper = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes enter_1ewp0{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}@keyframes exit_1ewp0{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-10px)}}", /*__inner_css_end__*/"1ewp0_gg_"),
|
|
43
43
|
/*__reshadow_css_end__*/
|
|
44
44
|
{
|
|
45
|
-
"@enter": "
|
|
46
|
-
"@exit": "
|
|
45
|
+
"@enter": "enter_1ewp0",
|
|
46
|
+
"@exit": "exit_1ewp0"
|
|
47
47
|
});
|
|
48
|
+
var enhance = [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)];
|
|
48
49
|
var FeaturePopover = /*#__PURE__*/function (_Component) {
|
|
49
50
|
function FeaturePopover() {
|
|
50
51
|
var _this;
|
|
@@ -78,33 +79,38 @@ var FeaturePopover = /*#__PURE__*/function (_Component) {
|
|
|
78
79
|
value: function getPopperProps() {
|
|
79
80
|
var _this$asProps = this.asProps,
|
|
80
81
|
visible = _this$asProps.visible,
|
|
81
|
-
getI18nText = _this$asProps.getI18nText
|
|
82
|
+
getI18nText = _this$asProps.getI18nText,
|
|
83
|
+
theme = _this$asProps.theme;
|
|
82
84
|
return {
|
|
83
85
|
visible: visible,
|
|
84
86
|
$onCloseClick: this.handleCloseClick,
|
|
85
|
-
getI18nText: getI18nText
|
|
87
|
+
getI18nText: getI18nText,
|
|
88
|
+
theme: theme
|
|
86
89
|
};
|
|
87
90
|
}
|
|
88
91
|
}, {
|
|
89
92
|
key: "getSpotProps",
|
|
90
93
|
value: function getSpotProps() {
|
|
91
|
-
var
|
|
94
|
+
var _this$asProps2 = this.asProps,
|
|
95
|
+
visible = _this$asProps2.visible,
|
|
96
|
+
theme = _this$asProps2.theme;
|
|
92
97
|
return {
|
|
93
|
-
visible: visible
|
|
98
|
+
visible: visible,
|
|
99
|
+
theme: theme
|
|
94
100
|
};
|
|
95
101
|
}
|
|
96
102
|
}, {
|
|
97
103
|
key: "render",
|
|
98
104
|
value: function render() {
|
|
99
105
|
var _ref4;
|
|
100
|
-
var _this$
|
|
101
|
-
styles = _this$
|
|
102
|
-
forwardRef = _this$
|
|
103
|
-
onVisibleChange = _this$
|
|
104
|
-
_this$
|
|
105
|
-
modifiers = _this$
|
|
106
|
-
other = (0, _objectWithoutProperties2["default"])(_this$
|
|
107
|
-
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(
|
|
106
|
+
var _this$asProps3 = this.asProps,
|
|
107
|
+
styles = _this$asProps3.styles,
|
|
108
|
+
forwardRef = _this$asProps3.forwardRef,
|
|
109
|
+
onVisibleChange = _this$asProps3.onVisibleChange,
|
|
110
|
+
_this$asProps3$modifi = _this$asProps3.modifiers,
|
|
111
|
+
modifiers = _this$asProps3$modifi === void 0 ? [] : _this$asProps3$modifi,
|
|
112
|
+
other = (0, _objectWithoutProperties2["default"])(_this$asProps3, _excluded);
|
|
113
|
+
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_baseComponents.Popper, _ref4.cn("Popper", (0, _objectSpread2["default"])({
|
|
108
114
|
"ref": forwardRef,
|
|
109
115
|
"onVisibleChange": (0, _assignProps4.callAllEventHandlers)(onVisibleChange, this.handleVisibleChange),
|
|
110
116
|
"modifiers": [].concat((0, _toConsumableArray2["default"])(this.defaultModifiers), (0, _toConsumableArray2["default"])(modifiers))
|
|
@@ -123,17 +129,18 @@ var FeaturePopover = /*#__PURE__*/function (_Component) {
|
|
|
123
129
|
},
|
|
124
130
|
interaction: 'none',
|
|
125
131
|
i18n: _intergalacticDynamicLocales.localizedMessages,
|
|
126
|
-
locale: 'en'
|
|
132
|
+
locale: 'en',
|
|
133
|
+
theme: 'accent'
|
|
127
134
|
});
|
|
128
|
-
(0, _defineProperty2["default"])(FeaturePopover, "enhance",
|
|
135
|
+
(0, _defineProperty2["default"])(FeaturePopover, "enhance", enhance);
|
|
129
136
|
function Trigger(_ref8) {
|
|
130
137
|
var _ref = arguments[0],
|
|
131
138
|
_ref5;
|
|
132
139
|
var Children = _ref8.Children,
|
|
133
140
|
styles = _ref8.styles;
|
|
134
|
-
var STrigger =
|
|
141
|
+
var STrigger = _baseComponents.Popper.Trigger;
|
|
135
142
|
return _ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(STrigger, _ref5.cn("STrigger", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
136
|
-
"tag":
|
|
143
|
+
"tag": _baseComponents.Box,
|
|
137
144
|
"aria-haspopup": false
|
|
138
145
|
}, _ref))), /*#__PURE__*/_react["default"].createElement(Children, _ref5.cn("Children", {})));
|
|
139
146
|
}
|
|
@@ -148,23 +155,24 @@ var FeaturePopoverPopper = /*#__PURE__*/function (_Component2) {
|
|
|
148
155
|
value: function render() {
|
|
149
156
|
var _ref2 = this.asProps,
|
|
150
157
|
_ref6;
|
|
151
|
-
var SFeaturePopover =
|
|
158
|
+
var SFeaturePopover = _baseComponents.Box;
|
|
152
159
|
var SClose = _button["default"];
|
|
153
|
-
var _this$
|
|
154
|
-
Children = _this$
|
|
155
|
-
styles = _this$
|
|
156
|
-
visible = _this$
|
|
157
|
-
closeIcon = _this$
|
|
158
|
-
duration = _this$
|
|
159
|
-
$onCloseClick = _this$
|
|
160
|
-
animationsDisabled = _this$
|
|
161
|
-
getI18nText = _this$
|
|
162
|
-
zIndex = _this$
|
|
163
|
-
ariaLabel = _this$
|
|
164
|
-
ariaDescribedBy = _this$
|
|
165
|
-
ariaLabelledby = _this$
|
|
166
|
-
title = _this$
|
|
167
|
-
|
|
160
|
+
var _this$asProps4 = this.asProps,
|
|
161
|
+
Children = _this$asProps4.Children,
|
|
162
|
+
styles = _this$asProps4.styles,
|
|
163
|
+
visible = _this$asProps4.visible,
|
|
164
|
+
closeIcon = _this$asProps4.closeIcon,
|
|
165
|
+
duration = _this$asProps4.duration,
|
|
166
|
+
$onCloseClick = _this$asProps4.$onCloseClick,
|
|
167
|
+
animationsDisabled = _this$asProps4.animationsDisabled,
|
|
168
|
+
getI18nText = _this$asProps4.getI18nText,
|
|
169
|
+
zIndex = _this$asProps4.zIndex,
|
|
170
|
+
ariaLabel = _this$asProps4['aria-label'],
|
|
171
|
+
ariaDescribedBy = _this$asProps4['aria-describedby'],
|
|
172
|
+
ariaLabelledby = _this$asProps4['aria-labelledby'],
|
|
173
|
+
title = _this$asProps4.title,
|
|
174
|
+
theme = _this$asProps4.theme;
|
|
175
|
+
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_baseComponents.Popper.Popper, {
|
|
168
176
|
disableEnforceFocus: true,
|
|
169
177
|
zIndex: zIndex,
|
|
170
178
|
tabIndex: 0,
|
|
@@ -174,7 +182,7 @@ var FeaturePopoverPopper = /*#__PURE__*/function (_Component2) {
|
|
|
174
182
|
"aria-label": ariaLabel,
|
|
175
183
|
"aria-labelledby": ariaLabelledby,
|
|
176
184
|
title: title
|
|
177
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
185
|
+
}, /*#__PURE__*/_react["default"].createElement(_baseComponents.Animation, _ref6.cn("Animation", {
|
|
178
186
|
"visible": visible,
|
|
179
187
|
"duration": duration,
|
|
180
188
|
"keyframes": [stylePopper['@enter'], stylePopper['@exit']],
|
|
@@ -186,7 +194,7 @@ var FeaturePopoverPopper = /*#__PURE__*/function (_Component2) {
|
|
|
186
194
|
"aria-label": getI18nText('close'),
|
|
187
195
|
"onClick": $onCloseClick,
|
|
188
196
|
"use": 'tertiary',
|
|
189
|
-
"theme": 'muted',
|
|
197
|
+
"theme": theme === 'accent' ? 'muted' : 'invert',
|
|
190
198
|
"size": 'm',
|
|
191
199
|
"addonLeft": _m["default"],
|
|
192
200
|
"type": 'button'
|
|
@@ -201,7 +209,7 @@ var FeaturePopoverPopper = /*#__PURE__*/function (_Component2) {
|
|
|
201
209
|
var Spot = function Spot(props) {
|
|
202
210
|
var _ref3 = arguments[0],
|
|
203
211
|
_ref7;
|
|
204
|
-
var SSpot =
|
|
212
|
+
var SSpot = _baseComponents.Box;
|
|
205
213
|
var styles = props.styles,
|
|
206
214
|
visible = props.visible;
|
|
207
215
|
if (!visible) return null;
|
|
@@ -211,7 +219,9 @@ var _default = exports["default"] = (0, _core.createComponent)(FeaturePopover, {
|
|
|
211
219
|
Trigger: Trigger,
|
|
212
220
|
Popper: FeaturePopoverPopper,
|
|
213
221
|
Spot: Spot
|
|
214
|
-
},
|
|
215
|
-
|
|
222
|
+
},
|
|
223
|
+
// @ts-ignore
|
|
224
|
+
{
|
|
225
|
+
parent: _baseComponents.Popper
|
|
216
226
|
});
|
|
217
227
|
//# sourceMappingURL=FeaturePopover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeaturePopover.js","names":["_core","require","_animation","_button","_interopRequireDefault","_assignProps4","_i18nEnhance","_flexBox","_m","_popper","_react","_intergalacticDynamicLocales","_excluded","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","style","sstyled","insert","stylePopper","FeaturePopover","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","name","enabled","visible","handlers","_inherits2","_createClass2","key","value","uncontrolledProps","getPopperProps","_this$asProps","asProps","getI18nText","$onCloseClick","handleCloseClick","getSpotProps","render","_ref4","_this$asProps2","styles","forwardRef","onVisibleChange","_this$asProps2$modifi","modifiers","other","_objectWithoutProperties2","createElement","cn","_objectSpread2","callAllEventHandlers","handleVisibleChange","_toConsumableArray2","defaultModifiers","Component","offset","placement","defaultVisible","onOutsideClick","interaction","i18n","localizedMessages","locale","i18nEnhance","Trigger","_ref8","_ref","arguments[0]","_ref5","Children","STrigger","Popper","assignProps","Box","FeaturePopoverPopper","_Component2","_ref2","_ref6","SFeaturePopover","SClose","Button","_this$asProps3","closeIcon","duration","animationsDisabled","zIndex","ariaLabel","ariaDescribedBy","ariaLabelledby","title","disableEnforceFocus","tabIndex","autoFocus","role","Animation","CloseIcon","Spot","props","_ref3","_ref7","SSpot","_default","exports","createComponent","parent"],"sources":["../../src/FeaturePopover.jsx"],"sourcesContent":["import { Animation } from '@semcore/animation';\nimport Button from '@semcore/button';\nimport { createComponent, Root, Component, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Box } from '@semcore/flex-box';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport Popper from '@semcore/popper';\nimport React from 'react';\n\nimport style from './style/feature-popover.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\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: 'none',\n i18n: localizedMessages,\n locale: 'en',\n };\n\n static enhance = [i18nEnhance(localizedMessages)];\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, getI18nText } = this.asProps;\n return {\n visible,\n $onCloseClick: this.handleCloseClick,\n getI18nText,\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\nfunction Trigger({ Children, styles }) {\n const STrigger = Root;\n return sstyled(styles)(\n <STrigger render={Popper.Trigger} tag={Box} aria-haspopup={false}>\n <Children />\n </STrigger>,\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 = Button;\n const {\n Children,\n styles,\n visible,\n closeIcon,\n duration,\n $onCloseClick,\n animationsDisabled,\n getI18nText,\n zIndex,\n 'aria-label': ariaLabel,\n 'aria-describedBy': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledby,\n title,\n } = this.asProps;\n\n return sstyled(styles)(\n <Popper.Popper\n disableEnforceFocus\n zIndex={zIndex}\n tabIndex={0}\n autoFocus\n role='dialog'\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n title={title}\n >\n <Animation\n visible={visible}\n duration={duration}\n keyframes={[stylePopper['@enter'], stylePopper['@exit']]}\n initialAnimation\n animationsDisabled={animationsDisabled}\n >\n <SFeaturePopover\n render={Box}\n __excludeProps={['aria-label', 'aria-describedBy', 'title']}\n >\n {closeIcon && (\n <SClose\n aria-label={getI18nText('close')}\n onClick={$onCloseClick}\n use='tertiary'\n theme='muted'\n size='m'\n addonLeft={CloseIcon}\n type='button'\n />\n )}\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: Trigger,\n Popper: FeaturePopoverPopper,\n Spot,\n },\n { parent: Popper },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,EAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,OAAA,GAAAL,sBAAA,CAAAH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AC,KAAA,GAAA/B,YAAA;IAAAgC,KAAA;EACtB,IAAMC,KAAK,GAM2B3B,YAAG;EAJzC,IAAQjC,MAAM,GAAcyD,KAAK,CAAzBzD,MAAM;IAAEjB,OAAO,GAAK0E,KAAK,CAAjB1E,OAAO;EAEvB,IAAI,CAACA,OAAO,EAAE,OAAO,IAAI;EAEzB,OAAA4E,KAAA,GAAO,IAAA7F,aAAO,EAACkC,MAAM,CAAC,eAACjD,MAAA,YAAAwD,aAAA,CAACqD,KAAK,EAAAD,KAAA,CAAAnD,EAAA,cAAAC,cAAA,qBAAApE,KAAA,CAAA2F,WAAA,MAAA0B,KAAA,GAAe,CAAC;AAC/C,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,cAEa,IAAAC,qBAAe,EAC5B9F,cAAc,EACd;EACEuD,OAAO,EAAEA,OAAO;EAChBO,MAAM,EAAEG,oBAAoB;EAC5BsB,IAAI,EAAJA;AACF,CAAC,EACD;EAAEQ,MAAM,EAAEjC;AAAO,CACnB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FeaturePopover.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_assignProps4","_i18nEnhance","_m","_react","_intergalacticDynamicLocales","_excluded","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","style","sstyled","insert","stylePopper","enhance","i18nEnhance","localizedMessages","FeaturePopover","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","name","enabled","visible","handlers","_inherits2","_createClass2","key","value","uncontrolledProps","getPopperProps","_this$asProps","asProps","getI18nText","theme","$onCloseClick","handleCloseClick","getSpotProps","_this$asProps2","render","_ref4","_this$asProps3","styles","forwardRef","onVisibleChange","_this$asProps3$modifi","modifiers","other","_objectWithoutProperties2","createElement","Popper","cn","_objectSpread2","callAllEventHandlers","handleVisibleChange","_toConsumableArray2","defaultModifiers","Component","offset","placement","defaultVisible","onOutsideClick","interaction","i18n","locale","Trigger","_ref8","_ref","arguments[0]","_ref5","Children","STrigger","assignProps","Box","FeaturePopoverPopper","_Component2","_ref2","_ref6","SFeaturePopover","SClose","Button","_this$asProps4","closeIcon","duration","animationsDisabled","zIndex","ariaLabel","ariaDescribedBy","ariaLabelledby","title","disableEnforceFocus","tabIndex","autoFocus","role","Animation","CloseIcon","Spot","props","_ref3","_ref7","SSpot","_default","exports","createComponent","parent"],"sources":["../../src/FeaturePopover.tsx"],"sourcesContent":["import { Box, Popper, Animation } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport type { IRootComponentProps } from '@semcore/core';\nimport { createComponent, Root, Component, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport React from 'react';\n\nimport type {\n FeaturePopoverProps,\n FeaturePopoverComponent,\n FeaturePopoverSpotProps,\n FeaturePopoverPopperProps,\n FeaturePopoverPopperInnerProps,\n} from './FeaturePopover.type';\nimport style from './style/feature-popover.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\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\nconst enhance = [\n i18nEnhance(localizedMessages),\n] as const;\n\nclass FeaturePopover extends Component<FeaturePopoverProps, {}, {}, typeof enhance> {\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: 'none',\n i18n: localizedMessages,\n locale: 'en',\n theme: 'accent',\n };\n\n static enhance = enhance;\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: boolean) => {\n this.handlers.visible(visible);\n };\n\n handleCloseClick = (e: React.SyntheticEvent<HTMLButtonElement>) => {\n this.handlers.visible(false, e);\n };\n\n getPopperProps() {\n const { visible, getI18nText, theme } = this.asProps;\n return {\n visible,\n $onCloseClick: this.handleCloseClick,\n getI18nText,\n theme,\n };\n }\n\n getSpotProps() {\n const { visible, theme } = this.asProps;\n return { visible, theme };\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\nfunction Trigger({ Children, styles }: IRootComponentProps) {\n const STrigger = Root;\n return sstyled(styles)(\n <STrigger render={Popper.Trigger} tag={Box} aria-haspopup={false}>\n <Children />\n </STrigger>,\n );\n}\n\nclass FeaturePopoverPopper extends Component<FeaturePopoverPopperProps, {}, {}, [], FeaturePopoverPopperInnerProps> {\n static defaultProps = {\n closeIcon: false,\n duration: 200,\n };\n\n render() {\n const SFeaturePopover = Root;\n const SClose = Button;\n const {\n Children,\n styles,\n visible,\n closeIcon,\n duration,\n $onCloseClick,\n animationsDisabled,\n getI18nText,\n zIndex,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledby,\n title,\n theme,\n } = this.asProps;\n\n return sstyled(styles)(\n <Popper.Popper\n disableEnforceFocus\n zIndex={zIndex}\n tabIndex={0}\n autoFocus\n role='dialog'\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n title={title}\n >\n <Animation\n visible={visible}\n duration={duration}\n keyframes={[stylePopper['@enter'], stylePopper['@exit']]}\n initialAnimation\n animationsDisabled={animationsDisabled}\n >\n <SFeaturePopover\n render={Box}\n __excludeProps={['aria-label', 'aria-describedBy', 'title']}\n >\n {closeIcon && (\n <SClose\n aria-label={getI18nText('close')}\n onClick={$onCloseClick}\n use='tertiary'\n theme={theme === 'accent' ? 'muted' : 'invert'}\n size='m'\n addonLeft={CloseIcon}\n type='button'\n />\n )}\n <Children />\n </SFeaturePopover>\n </Animation>\n </Popper.Popper>,\n );\n }\n}\n\nconst Spot = (props: IRootComponentProps & FeaturePopoverSpotProps) => {\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: Trigger,\n Popper: FeaturePopoverPopper,\n Spot,\n },\n // @ts-ignore\n { parent: Popper },\n) as FeaturePopoverComponent;\n"],"mappings":";;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,EAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,MAAA,GAAAJ,sBAAA,CAAAH,OAAA;AAUA,IAAAQ,4BAAA,GAAAR,OAAA;AAAmF,IAAAS,SAAA;AAAA,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA;AAAA,IAAAQ,KAAA,8BAAAtB,KAAA,CAAAuB,OAAA,CAAAC,MAAA;AAAA;A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OAAO,GAAK0E,KAAK,CAAjB1E,OAAO;EAEvB,IAAI,CAACA,OAAO,EAAE,OAAO,IAAI;EAEzB,OAAA4E,KAAA,GAAO,IAAAhG,aAAO,EAACuC,MAAM,CAAC,eAACtD,MAAA,YAAA6D,aAAA,CAACmD,KAAK,EAAAD,KAAA,CAAAhD,EAAA,cAAAC,cAAA,qBAAAxE,KAAA,CAAA4F,WAAA,MAAA0B,KAAA,GAAe,CAAC;AAC/C,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,cAEa,IAAAC,qBAAe,EAC5B9F,cAAc,EACd;EACEwD,OAAO,EAAEA,OAAO;EAChBf,MAAM,EAAEwB,oBAAoB;EAC5BsB,IAAI,EAAJA;AACF,CAAC;AACD;AACA;EAAEQ,MAAM,EAAEtD;AAAO,CACnB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeaturePopover.type.js","names":[],"sources":["../../src/FeaturePopover.type.ts"],"sourcesContent":["import type { Options as OptionsArrow } from '@popperjs/core/lib/modifiers/arrow';\nimport type { Options as OptionsComputeStyles } from '@popperjs/core/lib/modifiers/computeStyles';\nimport type { Options as OptionsEventListeners } from '@popperjs/core/lib/modifiers/eventListeners';\nimport type { Options as OptionsFlip } from '@popperjs/core/lib/modifiers/flip';\nimport type { Options as OptionsOffset } from '@popperjs/core/lib/modifiers/offset';\nimport type { Options as OptionsPreventOverflow } from '@popperjs/core/lib/modifiers/preventOverflow';\nimport type { Modifier, Options, PositioningStrategy } from '@popperjs/core/lib/types';\nimport type {\n AnimationProps,\n BoxProps,\n eventInteraction, Flex,\n OutsideClickProps,\n PortalProps,\n} from '@semcore/base-components';\nimport type { Intergalactic, PropGetterFn, UnknownProperties } from '@semcore/core';\nimport type { UniqueIDProps } from '@semcore/core/lib/utils/uniqueID';\nimport type { Box } from '@semcore/flex-box';\nimport type { PopperContext, PopperPopperProps, Placement } from '@semcore/popper';\nimport type Popper from '@semcore/popper';\nimport type React from 'react';\n\n/**\n * Popper must have an accessible names (aria-group-name).\n */\ntype AriaProps = Intergalactic.RequireAtLeastOne<{\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'title'?: string;\n}>;\n\n/** @deprecated */\nexport interface IFeaturePopoverPopperProps extends FeaturePopoverPopperProps, UnknownProperties {}\nexport type FeaturePopoverPopperProps = PopperPopperProps & {\n /**\n * The property responsible for the visibility of the closing icon\n * @default false\n */\n closeIcon?: boolean;\n /** Animation display duration in `ms`\n * @default 200\n */\n duration?: number;\n /** Specifies the locale for i18n support */\n locale?: string;\n};\n\nexport type FeaturePopoverPopperInnerProps = {\n theme: FeaturePopoverProps['theme'];\n\n visible: boolean;\n\n $onCloseClick: (e: React.SyntheticEvent<HTMLButtonElement>) => void;\n animationsDisabled: boolean;\n getI18nText: (message: string, opts?: Record<string, unknown>) => string;\n};\n\n/** @deprecated */\nexport interface IFeaturePopoverContext extends FeaturePopoverContext, UnknownProperties {}\nexport type FeaturePopoverContext = PopperContext & {\n getSpotProps: PropGetterFn;\n};\n\nexport type FPPopperProps = OutsideClickProps &\n PortalProps &\n UniqueIDProps &\n AnimationProps & {\n /**\n * Popper can have different positioning options\n * @default absolute\n */\n strategy?: PositioningStrategy;\n /**\n * Modifiers for popper.js\n */\n modifiers?: Array<Partial<Modifier<any, any>>>;\n /** Timer to show and hide the popper */\n timeout?: number | [number, number];\n /** PopperJS modifier settings for popper indent */\n offset?: Partial<OptionsOffset> | number | [number, number];\n /** PopperJS modifier settings for finding borders */\n preventOverflow?: Partial<OptionsPreventOverflow>;\n /** PopperJS modifier settings responsible for the arrow */\n arrow?: Partial<OptionsArrow>;\n /** PopperJS modifier settings responsible for turning the popper when there is not enough space */\n flip?: Partial<OptionsFlip>;\n /** PopperJS modifier settings for applying styles */\n computeStyles?: Partial<OptionsComputeStyles>;\n /** PopperJS modifier settings responsible for subscribing to global events */\n eventListeners?: Partial<OptionsEventListeners>;\n /** @ignore */\n onFirstUpdate?: Options['onFirstUpdate'];\n /**\n * Flag for disable Popover (if true, it will close Popper and it will not respond to handlers)\n * @default false\n */\n disabled?: boolean;\n /**\n * If enabled, you will need to use setTrigger function from children rendering function to set popper trigger.\n */\n explicitTriggerSet?: boolean;\n /**\n * If set, popper will be placed near the place mouse cursor entered the trigger\n * @deprecated\n */\n cursorAnchoring?: boolean;\n\n popperMargin?: number;\n\n /**\n * You shouldn't change an interaction in FeaturePopover. Comes from a Popper component.\n * @deprecated\n * @default none\n */\n interaction?: 'click' | 'hover' | 'focus' | 'none' | eventInteraction;\n /**\n * You shouldn't change it in FeaturePopover as it should be controlled always. Comes from a Popper component.\n * @deprecated\n * @default false */\n defaultVisible?: boolean;\n /**\n * Disabled focus trap, autofocus and focus return\n * You shouldn't change it in FeaturePopover as it should be controlled always. Comes from a Popper component.\n * @deprecated\n */\n disableEnforceFocus?: boolean;\n /**\n * If enabled, after reaching the end of popper the browser focus goes to the start of popper and vice versa.\n * If disabled, after reading the end of popper the browser focus returns to trigger and popper is being closed.\n * You shouldn't change it in FeaturePopover as it should be controlled always. Comes from a Popper component.\n * @deprecated\n * @default `true` (`false` in Tooltip)\n */\n focusLoop?: boolean;\n };\n\nexport type FeaturePopoverProps = FPPopperProps & {\n /** Popper visibility value */\n visible?: boolean;\n /** Function called when visibility changes */\n onVisibleChange?: (visible: boolean, e?: Event) => boolean | void;\n /**\n * The position of the popper relative to the trigger that called it.\n * @default auto\n */\n placement?: Placement;\n /**\n * The theme of FeaturePopover\n * @default accent\n */\n theme?: 'accent' | 'neutral';\n};\n\nexport type FeaturePopoverTriggerProps = BoxProps & {\n theme?: FeaturePopoverProps['theme'];\n};\n\nexport type FeaturePopoverSpotProps = {\n visible?: boolean;\n theme?: FeaturePopoverProps['theme'];\n};\n\nexport type FeaturePopoverComponent = Intergalactic.Component<'div', FeaturePopoverProps, FeaturePopoverContext> & {\n Trigger: Intergalactic.Component<typeof Popper.Trigger, FeaturePopoverTriggerProps>;\n Popper: Intergalactic.Component<'div', FeaturePopoverPopperProps & AriaProps>;\n Spot: Intergalactic.Component<typeof Box, FeaturePopoverSpotProps>;\n};\n"],"mappings":"","ignoreList":[]}
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_FeaturePopover","_interopRequireDefault","require"],"sources":["../../src/index.
|
|
1
|
+
{"version":3,"file":"index.js","names":["_FeaturePopover","_interopRequireDefault","require"],"sources":["../../src/index.ts"],"sourcesContent":["import type { FeaturePopoverProps, FeaturePopoverPopperProps } from './FeaturePopover.type';\n\nexport { default } from './FeaturePopover';\n\nexport type {\n FeaturePopoverProps,\n FeaturePopoverPopperProps,\n};\n"],"mappings":";;;;;;;;;;;;AAEA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -5,10 +5,17 @@ SFeaturePopover {
|
|
|
5
5
|
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
6
6
|
border-radius: var(--intergalactic-popper-rounded, 6px);
|
|
7
7
|
box-sizing: border-box;
|
|
8
|
-
background-color: var(--intergalactic-bg-primary-highlight, #fce081);
|
|
9
|
-
color: var(--intergalactic-text-primary, #191b23);
|
|
10
8
|
box-shadow: var(--intergalactic-box-shadow-popper, 0px 1px 12px 0px rgba(25, 27, 35, 0.15));
|
|
11
9
|
position: relative;
|
|
10
|
+
|
|
11
|
+
&[theme='accent'] {
|
|
12
|
+
background-color: var(--intergalactic-feature-popover-bg, #fce081);
|
|
13
|
+
color: var(--intergalactic-text-primary, #191b23);
|
|
14
|
+
}
|
|
15
|
+
&[theme='neutral'] {
|
|
16
|
+
background-color: var(--intergalactic-feature-popover-bg-neutral, #1D113E);
|
|
17
|
+
color: var(--intergalactic-text-primary-invert, #ffffff);
|
|
18
|
+
}
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
STrigger {
|
|
@@ -70,7 +77,6 @@ SSpot {
|
|
|
70
77
|
animation-iteration-count: infinite;
|
|
71
78
|
animation-fill-mode: forwards;
|
|
72
79
|
animation-delay: 0.5s;
|
|
73
|
-
background-color: var(--intergalactic-feature-popover-dot-outer-border, #fce081);
|
|
74
80
|
border-radius: 50%;
|
|
75
81
|
width: 12px;
|
|
76
82
|
height: 12px;
|
|
@@ -84,7 +90,23 @@ SSpot {
|
|
|
84
90
|
border-radius: 50%;
|
|
85
91
|
width: 12px;
|
|
86
92
|
height: 12px;
|
|
87
|
-
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&[theme='accent'] {
|
|
96
|
+
&::before {
|
|
97
|
+
background-color: var(--intergalactic-feature-popover-dot-outer-border, #fce081);
|
|
98
|
+
}
|
|
99
|
+
&::after {
|
|
100
|
+
background-color: var(--intergalactic-feature-popover-bg, #fce081);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
&[theme='neutral'] {
|
|
104
|
+
&::before {
|
|
105
|
+
background-color: var(--intergalactic-feature-popover-dot-neutral-outer-border, #00c192);
|
|
106
|
+
}
|
|
107
|
+
&::after {
|
|
108
|
+
background-color: var(--intergalactic-feature-popover-dot-neutral, #00c192);
|
|
109
|
+
}
|
|
88
110
|
}
|
|
89
111
|
}
|
|
90
112
|
|
|
@@ -14,34 +14,35 @@ import { assignProps as _assignProps2 } from "@semcore/core";
|
|
|
14
14
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
15
15
|
var _excluded = ["styles", "forwardRef", "onVisibleChange", "modifiers"];
|
|
16
16
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
|
-
import { Animation } from '@semcore/
|
|
17
|
+
import { Box, Popper, Animation } from '@semcore/base-components';
|
|
18
18
|
import Button from '@semcore/button';
|
|
19
19
|
import { createComponent, Root, Component, sstyled } from '@semcore/core';
|
|
20
20
|
import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
|
|
21
21
|
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
22
|
-
import { Box } from '@semcore/flex-box';
|
|
23
22
|
import CloseIcon from '@semcore/icon/Close/m';
|
|
24
|
-
import Popper from '@semcore/popper';
|
|
25
23
|
import React from 'react';
|
|
26
24
|
/*!__reshadow-styles__:"./style/feature-popover.shadow.css"*/
|
|
27
|
-
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
25
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes showTrigger_1a3ym{0%{opacity:0}to{opacity:1}}@keyframes scaleSizeAndHide_1a3ym{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}.___SFeaturePopover_1a3ym_gg_{padding-top:var(--intergalactic-spacing-4x, 16px);padding-right:var(--intergalactic-spacing-10x, 40px);padding-bottom:var(--intergalactic-spacing-4x, 16px);padding-left:var(--intergalactic-spacing-4x, 16px);border-radius:var(--intergalactic-popper-rounded, 6px);box-sizing:border-box;box-shadow:var(--intergalactic-box-shadow-popper, 0px 1px 12px 0px rgba(25, 27, 35, 0.15));position:relative}.___SFeaturePopover_1a3ym_gg_._theme_accent_1a3ym_gg_{background-color:var(--intergalactic-feature-popover-bg, #fce081);color:var(--intergalactic-text-primary, #191b23)}.___SFeaturePopover_1a3ym_gg_._theme_neutral_1a3ym_gg_{background-color:var(--intergalactic-feature-popover-bg-neutral, #1D113E);color:var(--intergalactic-text-primary-invert, #ffffff)}.___STrigger_1a3ym_gg_{position:relative}.___SClose_1a3ym_gg_{position:absolute;z-index:1;right:var(--intergalactic-spacing-2x, 8px);top:var(--intergalactic-spacing-2x, 8px)}.___SClose_1a3ym_gg_ .___SAddon_1a3ym_gg_:only-child{margin-left:calc(var(--intergalactic-spacing-2x, 8px) - 1px);margin-right:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SSpot_1a3ym_gg_{position:absolute;bottom:calc(-1*var(--intergalactic-spacing-1x, 4px));right:calc(-1*var(--intergalactic-spacing-1x, 4px));animation-name:showTrigger_1a3ym;animation-duration:.2s;animation-timing-function:ease-in;animation-delay:.4s;animation-fill-mode:forwards;width:12px;height:12px}.___SSpot_1a3ym_gg_::before{transform-origin:50%;animation-name:scaleSizeAndHide_1a3ym;animation-duration:1s;animation-iteration-count:infinite;animation-fill-mode:forwards;animation-delay:.5s}.___SSpot_1a3ym_gg_::after,.___SSpot_1a3ym_gg_::before{content:\"\";position:absolute;top:0;left:0;border-radius:50%;width:12px;height:12px}.___SSpot_1a3ym_gg_._theme_accent_1a3ym_gg_::before{background-color:var(--intergalactic-feature-popover-dot-outer-border, #fce081)}.___SSpot_1a3ym_gg_._theme_accent_1a3ym_gg_::after{background-color:var(--intergalactic-feature-popover-bg, #fce081)}.___SSpot_1a3ym_gg_._theme_neutral_1a3ym_gg_::before{background-color:var(--intergalactic-feature-popover-dot-neutral-outer-border, #00c192)}.___SSpot_1a3ym_gg_._theme_neutral_1a3ym_gg_::after{background-color:var(--intergalactic-feature-popover-dot-neutral, #00c192)}@media (prefers-reduced-motion){.___SSpot_1a3ym_gg_,.___SSpot_1a3ym_gg_::before{animation-name:none}}", /*__inner_css_end__*/"1a3ym_gg_"),
|
|
28
26
|
/*__reshadow_css_end__*/
|
|
29
27
|
{
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"@
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
28
|
+
"__STrigger": "___STrigger_1a3ym_gg_",
|
|
29
|
+
"@showTrigger": "showTrigger_1a3ym",
|
|
30
|
+
"@scaleSizeAndHide": "scaleSizeAndHide_1a3ym",
|
|
31
|
+
"__SFeaturePopover": "___SFeaturePopover_1a3ym_gg_",
|
|
32
|
+
"_theme_accent": "_theme_accent_1a3ym_gg_",
|
|
33
|
+
"_theme_neutral": "_theme_neutral_1a3ym_gg_",
|
|
34
|
+
"__SClose": "___SClose_1a3ym_gg_",
|
|
35
|
+
"__SAddon": "___SAddon_1a3ym_gg_",
|
|
36
|
+
"__SSpot": "___SSpot_1a3ym_gg_"
|
|
37
37
|
});
|
|
38
38
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
39
|
-
var stylePopper = (/*__reshadow_css_start__*/sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
39
|
+
var stylePopper = (/*__reshadow_css_start__*/sstyled.insert(/*__inner_css_start__*/"@keyframes enter_1ewp0{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}@keyframes exit_1ewp0{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-10px)}}", /*__inner_css_end__*/"1ewp0_gg_"),
|
|
40
40
|
/*__reshadow_css_end__*/
|
|
41
41
|
{
|
|
42
|
-
"@enter": "
|
|
43
|
-
"@exit": "
|
|
42
|
+
"@enter": "enter_1ewp0",
|
|
43
|
+
"@exit": "exit_1ewp0"
|
|
44
44
|
});
|
|
45
|
+
var enhance = [i18nEnhance(localizedMessages)];
|
|
45
46
|
var FeaturePopover = /*#__PURE__*/function (_Component) {
|
|
46
47
|
function FeaturePopover() {
|
|
47
48
|
var _this;
|
|
@@ -75,32 +76,37 @@ var FeaturePopover = /*#__PURE__*/function (_Component) {
|
|
|
75
76
|
value: function getPopperProps() {
|
|
76
77
|
var _this$asProps = this.asProps,
|
|
77
78
|
visible = _this$asProps.visible,
|
|
78
|
-
getI18nText = _this$asProps.getI18nText
|
|
79
|
+
getI18nText = _this$asProps.getI18nText,
|
|
80
|
+
theme = _this$asProps.theme;
|
|
79
81
|
return {
|
|
80
82
|
visible: visible,
|
|
81
83
|
$onCloseClick: this.handleCloseClick,
|
|
82
|
-
getI18nText: getI18nText
|
|
84
|
+
getI18nText: getI18nText,
|
|
85
|
+
theme: theme
|
|
83
86
|
};
|
|
84
87
|
}
|
|
85
88
|
}, {
|
|
86
89
|
key: "getSpotProps",
|
|
87
90
|
value: function getSpotProps() {
|
|
88
|
-
var
|
|
91
|
+
var _this$asProps2 = this.asProps,
|
|
92
|
+
visible = _this$asProps2.visible,
|
|
93
|
+
theme = _this$asProps2.theme;
|
|
89
94
|
return {
|
|
90
|
-
visible: visible
|
|
95
|
+
visible: visible,
|
|
96
|
+
theme: theme
|
|
91
97
|
};
|
|
92
98
|
}
|
|
93
99
|
}, {
|
|
94
100
|
key: "render",
|
|
95
101
|
value: function render() {
|
|
96
102
|
var _ref4;
|
|
97
|
-
var _this$
|
|
98
|
-
styles = _this$
|
|
99
|
-
forwardRef = _this$
|
|
100
|
-
onVisibleChange = _this$
|
|
101
|
-
_this$
|
|
102
|
-
modifiers = _this$
|
|
103
|
-
other = _objectWithoutProperties(_this$
|
|
103
|
+
var _this$asProps3 = this.asProps,
|
|
104
|
+
styles = _this$asProps3.styles,
|
|
105
|
+
forwardRef = _this$asProps3.forwardRef,
|
|
106
|
+
onVisibleChange = _this$asProps3.onVisibleChange,
|
|
107
|
+
_this$asProps3$modifi = _this$asProps3.modifiers,
|
|
108
|
+
modifiers = _this$asProps3$modifi === void 0 ? [] : _this$asProps3$modifi,
|
|
109
|
+
other = _objectWithoutProperties(_this$asProps3, _excluded);
|
|
104
110
|
return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(Popper, _ref4.cn("Popper", _objectSpread({
|
|
105
111
|
"ref": forwardRef,
|
|
106
112
|
"onVisibleChange": callAllEventHandlers(onVisibleChange, this.handleVisibleChange),
|
|
@@ -120,9 +126,10 @@ _defineProperty(FeaturePopover, "defaultProps", {
|
|
|
120
126
|
},
|
|
121
127
|
interaction: 'none',
|
|
122
128
|
i18n: localizedMessages,
|
|
123
|
-
locale: 'en'
|
|
129
|
+
locale: 'en',
|
|
130
|
+
theme: 'accent'
|
|
124
131
|
});
|
|
125
|
-
_defineProperty(FeaturePopover, "enhance",
|
|
132
|
+
_defineProperty(FeaturePopover, "enhance", enhance);
|
|
126
133
|
function Trigger(_ref8) {
|
|
127
134
|
var _ref = arguments[0],
|
|
128
135
|
_ref5;
|
|
@@ -147,20 +154,21 @@ var FeaturePopoverPopper = /*#__PURE__*/function (_Component2) {
|
|
|
147
154
|
_ref6;
|
|
148
155
|
var SFeaturePopover = Box;
|
|
149
156
|
var SClose = Button;
|
|
150
|
-
var _this$
|
|
151
|
-
Children = _this$
|
|
152
|
-
styles = _this$
|
|
153
|
-
visible = _this$
|
|
154
|
-
closeIcon = _this$
|
|
155
|
-
duration = _this$
|
|
156
|
-
$onCloseClick = _this$
|
|
157
|
-
animationsDisabled = _this$
|
|
158
|
-
getI18nText = _this$
|
|
159
|
-
zIndex = _this$
|
|
160
|
-
ariaLabel = _this$
|
|
161
|
-
ariaDescribedBy = _this$
|
|
162
|
-
ariaLabelledby = _this$
|
|
163
|
-
title = _this$
|
|
157
|
+
var _this$asProps4 = this.asProps,
|
|
158
|
+
Children = _this$asProps4.Children,
|
|
159
|
+
styles = _this$asProps4.styles,
|
|
160
|
+
visible = _this$asProps4.visible,
|
|
161
|
+
closeIcon = _this$asProps4.closeIcon,
|
|
162
|
+
duration = _this$asProps4.duration,
|
|
163
|
+
$onCloseClick = _this$asProps4.$onCloseClick,
|
|
164
|
+
animationsDisabled = _this$asProps4.animationsDisabled,
|
|
165
|
+
getI18nText = _this$asProps4.getI18nText,
|
|
166
|
+
zIndex = _this$asProps4.zIndex,
|
|
167
|
+
ariaLabel = _this$asProps4['aria-label'],
|
|
168
|
+
ariaDescribedBy = _this$asProps4['aria-describedby'],
|
|
169
|
+
ariaLabelledby = _this$asProps4['aria-labelledby'],
|
|
170
|
+
title = _this$asProps4.title,
|
|
171
|
+
theme = _this$asProps4.theme;
|
|
164
172
|
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(Popper.Popper, {
|
|
165
173
|
disableEnforceFocus: true,
|
|
166
174
|
zIndex: zIndex,
|
|
@@ -183,7 +191,7 @@ var FeaturePopoverPopper = /*#__PURE__*/function (_Component2) {
|
|
|
183
191
|
"aria-label": getI18nText('close'),
|
|
184
192
|
"onClick": $onCloseClick,
|
|
185
193
|
"use": 'tertiary',
|
|
186
|
-
"theme": 'muted',
|
|
194
|
+
"theme": theme === 'accent' ? 'muted' : 'invert',
|
|
187
195
|
"size": 'm',
|
|
188
196
|
"addonLeft": CloseIcon,
|
|
189
197
|
"type": 'button'
|
|
@@ -208,7 +216,9 @@ export default createComponent(FeaturePopover, {
|
|
|
208
216
|
Trigger: Trigger,
|
|
209
217
|
Popper: FeaturePopoverPopper,
|
|
210
218
|
Spot: Spot
|
|
211
|
-
},
|
|
219
|
+
},
|
|
220
|
+
// @ts-ignore
|
|
221
|
+
{
|
|
212
222
|
parent: Popper
|
|
213
223
|
});
|
|
214
224
|
//# sourceMappingURL=FeaturePopover.js.map
|