@semcore/feature-popover 4.56.0-prerelease.4 → 4.56.0-prerelease.5
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/lib/cjs/FeaturePopover.js +101 -81
- 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 +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/feature-popover.shadow.css +26 -4
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/FeaturePopover.js +93 -70
- 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/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/FeaturePopover.mjs +88 -67
- package/lib/esm/style/feature-popover.shadow.css +26 -4
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/types/FeaturePopover.d.ts +3 -0
- package/lib/types/FeaturePopover.type.d.ts +109 -0
- package/lib/types/index.d.ts +3 -42
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +44 -0
- package/package.json +8 -8
- 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
|
@@ -3,77 +3,75 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
5
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
-
import
|
|
6
|
+
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
|
-
import { sstyled } from "@semcore/
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import { Box } from "@semcore/flex-box";
|
|
9
|
+
import { sstyled, Component, assignProps, createComponent } from "@semcore/core";
|
|
10
|
+
import { Popper, Box, Animation } from "@semcore/base-components";
|
|
11
|
+
import Button from "@semcore/button";
|
|
12
|
+
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
13
|
+
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
16
14
|
import CloseIcon from "@semcore/icon/Close/m";
|
|
17
|
-
import
|
|
18
|
-
import i18nEnhance from "@semcore/utils/lib/enhances/i18nEnhance";
|
|
15
|
+
import React from "react";
|
|
19
16
|
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
20
|
-
import Button from "@semcore/button";
|
|
21
17
|
var _excluded = ["styles", "forwardRef", "onVisibleChange", "modifiers"];
|
|
22
18
|
/*!__reshadow-styles__:"./style/feature-popover.shadow.css"*/
|
|
23
19
|
var style = (
|
|
24
20
|
/*__reshadow_css_start__*/
|
|
25
21
|
(sstyled.insert(
|
|
26
22
|
/*__inner_css_start__*/
|
|
27
|
-
'@keyframes
|
|
23
|
+
'@keyframes showTrigger_1p59g{0%{opacity:0}to{opacity:1}}@keyframes scaleSizeAndHide_1p59g{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}.___SFeaturePopover_1p59g_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, 1px 1px 10px 0px rgba(0, 21, 16, 0.07));position:relative}@supports (color:color(display-p3 0 0 0%)){.___SFeaturePopover_1p59g_gg_{box-shadow:var(--intergalactic-box-shadow-popper, 1px 1px 10px 0px rgba(0, 21, 16, 0.07))}@media (color-gamut:p3){.___SFeaturePopover_1p59g_gg_{box-shadow:var(--intergalactic-box-shadow-popper, 1px 1px 10px 0px color(display-p3 0.01753 0.08157 0.06372 / 0.07))}}}.___SFeaturePopover_1p59g_gg_._theme_accent_1p59g_gg_{background-color:var(--intergalactic-feature-popover-bg, rgb(225, 205, 255));color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899))}@supports (color:color(display-p3 0 0 0%)){.___SFeaturePopover_1p59g_gg_._theme_accent_1p59g_gg_{background-color:var(--intergalactic-feature-popover-bg, rgb(225, 205, 255))}@media (color-gamut:p3){.___SFeaturePopover_1p59g_gg_._theme_accent_1p59g_gg_{background-color:var(--intergalactic-feature-popover-bg, color(display-p3 0.87005 0.8017 0.99841))}}}.___SFeaturePopover_1p59g_gg_._theme_neutral_1p59g_gg_{background-color:var(--intergalactic-feature-popover-bg-neutral, rgb(26, 30, 26));color:var(--intergalactic-text-primary-invert, rgba(254, 255, 255, 0.949))}.___STrigger_1p59g_gg_{position:relative}.___SClose_1p59g_gg_{position:absolute;z-index:1;right:var(--intergalactic-spacing-2x, 8px);top:var(--intergalactic-spacing-2x, 8px)}.___SClose_1p59g_gg_ .___SAddon_1p59g_gg_:only-child{margin-left:calc(var(--intergalactic-spacing-2x, 8px) - 1px);margin-right:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SSpot_1p59g_gg_{position:absolute;bottom:calc(-1*var(--intergalactic-spacing-1x, 4px));right:calc(-1*var(--intergalactic-spacing-1x, 4px));animation-name:showTrigger_1p59g;animation-duration:.2s;animation-timing-function:ease-in;animation-delay:.4s;animation-fill-mode:forwards;width:12px;height:12px}.___SSpot_1p59g_gg_::before{transform-origin:50%;animation-name:scaleSizeAndHide_1p59g;animation-duration:1s;animation-iteration-count:infinite;animation-fill-mode:forwards;animation-delay:.5s}.___SSpot_1p59g_gg_::after,.___SSpot_1p59g_gg_::before{content:"";position:absolute;top:0;left:0;border-radius:50%;width:12px;height:12px}.___SSpot_1p59g_gg_._theme_accent_1p59g_gg_::before{background-color:var(--intergalactic-feature-popover-dot-outer-border, rgb(225, 205, 255))}@supports (color:color(display-p3 0 0 0%)){.___SSpot_1p59g_gg_._theme_accent_1p59g_gg_::before{background-color:var(--intergalactic-feature-popover-dot-outer-border, rgb(225, 205, 255))}@media (color-gamut:p3){.___SSpot_1p59g_gg_._theme_accent_1p59g_gg_::before{background-color:var(--intergalactic-feature-popover-dot-outer-border, color(display-p3 0.87005 0.8017 0.99841))}}}.___SSpot_1p59g_gg_._theme_accent_1p59g_gg_::after{background-color:var(--intergalactic-feature-popover-bg, rgb(225, 205, 255))}@supports (color:color(display-p3 0 0 0%)){.___SSpot_1p59g_gg_._theme_accent_1p59g_gg_::after{background-color:var(--intergalactic-feature-popover-bg, rgb(225, 205, 255))}@media (color-gamut:p3){.___SSpot_1p59g_gg_._theme_accent_1p59g_gg_::after{background-color:var(--intergalactic-feature-popover-bg, color(display-p3 0.87005 0.8017 0.99841))}}}.___SSpot_1p59g_gg_._theme_neutral_1p59g_gg_::before{background-color:var(--intergalactic-feature-popover-dot-neutral-outer-border, rgb(225, 205, 255))}@supports (color:color(display-p3 0 0 0%)){.___SSpot_1p59g_gg_._theme_neutral_1p59g_gg_::before{background-color:var(--intergalactic-feature-popover-dot-neutral-outer-border, rgb(225, 205, 255))}@media (color-gamut:p3){.___SSpot_1p59g_gg_._theme_neutral_1p59g_gg_::before{background-color:var(--intergalactic-feature-popover-dot-neutral-outer-border, color(display-p3 0.87005 0.8017 0.99841))}}}.___SSpot_1p59g_gg_._theme_neutral_1p59g_gg_::after{background-color:var(--intergalactic-feature-popover-dot-neutral, rgb(225, 205, 255))}@supports (color:color(display-p3 0 0 0%)){.___SSpot_1p59g_gg_._theme_neutral_1p59g_gg_::after{background-color:var(--intergalactic-feature-popover-dot-neutral, rgb(225, 205, 255))}@media (color-gamut:p3){.___SSpot_1p59g_gg_._theme_neutral_1p59g_gg_::after{background-color:var(--intergalactic-feature-popover-dot-neutral, color(display-p3 0.87005 0.8017 0.99841))}}}@media (prefers-reduced-motion){.___SSpot_1p59g_gg_,.___SSpot_1p59g_gg_::before{animation-name:none}}',
|
|
28
24
|
/*__inner_css_end__*/
|
|
29
|
-
"
|
|
25
|
+
"1p59g_gg_"
|
|
30
26
|
), /*__reshadow_css_end__*/
|
|
31
27
|
{
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
28
|
+
"__STrigger": "___STrigger_1p59g_gg_",
|
|
29
|
+
"@showTrigger": "showTrigger_1p59g",
|
|
30
|
+
"@scaleSizeAndHide": "scaleSizeAndHide_1p59g",
|
|
31
|
+
"__SFeaturePopover": "___SFeaturePopover_1p59g_gg_",
|
|
32
|
+
"_theme_accent": "_theme_accent_1p59g_gg_",
|
|
33
|
+
"_theme_neutral": "_theme_neutral_1p59g_gg_",
|
|
34
|
+
"__SClose": "___SClose_1p59g_gg_",
|
|
35
|
+
"__SAddon": "___SAddon_1p59g_gg_",
|
|
36
|
+
"__SSpot": "___SSpot_1p59g_gg_"
|
|
39
37
|
})
|
|
40
38
|
);
|
|
41
39
|
var stylePopper = (
|
|
42
40
|
/*__reshadow_css_start__*/
|
|
43
|
-
(sstyled
|
|
41
|
+
(sstyled.insert(
|
|
44
42
|
/*__inner_css_start__*/
|
|
45
|
-
"@keyframes
|
|
43
|
+
"@keyframes enter_1lkos{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}@keyframes exit_1lkos{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-10px)}}",
|
|
46
44
|
/*__inner_css_end__*/
|
|
47
|
-
"
|
|
45
|
+
"1lkos_gg_"
|
|
48
46
|
), /*__reshadow_css_end__*/
|
|
49
47
|
{
|
|
50
|
-
"@enter": "
|
|
51
|
-
"@exit": "
|
|
48
|
+
"@enter": "enter_1lkos",
|
|
49
|
+
"@exit": "exit_1lkos"
|
|
52
50
|
})
|
|
53
51
|
);
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
var _super = _createSuper(FeaturePopover2);
|
|
52
|
+
var enhance = [i18nEnhance(localizedMessages)];
|
|
53
|
+
var FeaturePopover = /* @__PURE__ */ (function(_Component) {
|
|
57
54
|
function FeaturePopover2() {
|
|
58
55
|
var _this;
|
|
59
56
|
_classCallCheck(this, FeaturePopover2);
|
|
60
57
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
61
58
|
args[_key] = arguments[_key];
|
|
62
59
|
}
|
|
63
|
-
_this =
|
|
64
|
-
_defineProperty(
|
|
60
|
+
_this = _callSuper(this, FeaturePopover2, [].concat(args));
|
|
61
|
+
_defineProperty(_this, "defaultModifiers", [{
|
|
65
62
|
name: "flip",
|
|
66
63
|
enabled: false
|
|
67
64
|
}]);
|
|
68
|
-
_defineProperty(
|
|
65
|
+
_defineProperty(_this, "handleVisibleChange", function(visible) {
|
|
69
66
|
_this.handlers.visible(visible);
|
|
70
67
|
});
|
|
71
|
-
_defineProperty(
|
|
68
|
+
_defineProperty(_this, "handleCloseClick", function(e) {
|
|
72
69
|
_this.handlers.visible(false, e);
|
|
73
70
|
});
|
|
74
71
|
return _this;
|
|
75
72
|
}
|
|
76
|
-
|
|
73
|
+
_inherits(FeaturePopover2, _Component);
|
|
74
|
+
return _createClass(FeaturePopover2, [{
|
|
77
75
|
key: "uncontrolledProps",
|
|
78
76
|
value: function uncontrolledProps() {
|
|
79
77
|
return {
|
|
@@ -83,35 +81,36 @@ var FeaturePopover = /* @__PURE__ */ function(_Component) {
|
|
|
83
81
|
}, {
|
|
84
82
|
key: "getPopperProps",
|
|
85
83
|
value: function getPopperProps() {
|
|
86
|
-
var _this$asProps = this.asProps, visible = _this$asProps.visible, getI18nText = _this$asProps.getI18nText;
|
|
84
|
+
var _this$asProps = this.asProps, visible = _this$asProps.visible, getI18nText = _this$asProps.getI18nText, theme = _this$asProps.theme;
|
|
87
85
|
return {
|
|
88
86
|
visible,
|
|
89
87
|
$onCloseClick: this.handleCloseClick,
|
|
90
|
-
getI18nText
|
|
88
|
+
getI18nText,
|
|
89
|
+
theme
|
|
91
90
|
};
|
|
92
91
|
}
|
|
93
92
|
}, {
|
|
94
93
|
key: "getSpotProps",
|
|
95
94
|
value: function getSpotProps() {
|
|
96
|
-
var
|
|
95
|
+
var _this$asProps2 = this.asProps, visible = _this$asProps2.visible, theme = _this$asProps2.theme;
|
|
97
96
|
return {
|
|
98
|
-
visible
|
|
97
|
+
visible,
|
|
98
|
+
theme
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
}, {
|
|
102
102
|
key: "render",
|
|
103
103
|
value: function render() {
|
|
104
104
|
var _ref4;
|
|
105
|
-
var _this$
|
|
106
|
-
return _ref4 = sstyled
|
|
105
|
+
var _this$asProps3 = this.asProps, styles = _this$asProps3.styles, forwardRef = _this$asProps3.forwardRef, onVisibleChange = _this$asProps3.onVisibleChange, _this$asProps3$modifi = _this$asProps3.modifiers, modifiers = _this$asProps3$modifi === void 0 ? [] : _this$asProps3$modifi, other = _objectWithoutProperties(_this$asProps3, _excluded);
|
|
106
|
+
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(Popper, _ref4.cn("Popper", _objectSpread({
|
|
107
107
|
"ref": forwardRef,
|
|
108
108
|
"onVisibleChange": callAllEventHandlers(onVisibleChange, this.handleVisibleChange),
|
|
109
109
|
"modifiers": [].concat(_toConsumableArray(this.defaultModifiers), _toConsumableArray(modifiers))
|
|
110
110
|
}, other)));
|
|
111
111
|
}
|
|
112
112
|
}]);
|
|
113
|
-
|
|
114
|
-
}(Component);
|
|
113
|
+
})(Component);
|
|
115
114
|
_defineProperty(FeaturePopover, "displayName", "FeaturePopover");
|
|
116
115
|
_defineProperty(FeaturePopover, "style", style);
|
|
117
116
|
_defineProperty(FeaturePopover, "defaultProps", {
|
|
@@ -123,37 +122,54 @@ _defineProperty(FeaturePopover, "defaultProps", {
|
|
|
123
122
|
},
|
|
124
123
|
interaction: "none",
|
|
125
124
|
i18n: localizedMessages,
|
|
126
|
-
locale: "en"
|
|
125
|
+
locale: "en",
|
|
126
|
+
theme: "accent"
|
|
127
127
|
});
|
|
128
|
-
_defineProperty(FeaturePopover, "enhance",
|
|
128
|
+
_defineProperty(FeaturePopover, "enhance", enhance);
|
|
129
129
|
function Trigger(_ref8) {
|
|
130
130
|
var _ref = arguments[0], _ref5;
|
|
131
131
|
var Children = _ref8.Children, styles = _ref8.styles;
|
|
132
132
|
var STrigger = Popper.Trigger;
|
|
133
|
-
return _ref5 = sstyled
|
|
133
|
+
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(STrigger, _ref5.cn("STrigger", _objectSpread({}, assignProps({
|
|
134
134
|
"tag": Box,
|
|
135
135
|
"aria-haspopup": false
|
|
136
136
|
}, _ref))), /* @__PURE__ */ React.createElement(Children, _ref5.cn("Children", {})));
|
|
137
137
|
}
|
|
138
|
-
var FeaturePopoverPopper = /* @__PURE__ */ function(_Component2) {
|
|
139
|
-
_inherits(FeaturePopoverPopper2, _Component2);
|
|
140
|
-
var _super2 = _createSuper(FeaturePopoverPopper2);
|
|
138
|
+
var FeaturePopoverPopper = /* @__PURE__ */ (function(_Component2) {
|
|
141
139
|
function FeaturePopoverPopper2() {
|
|
140
|
+
var _this2;
|
|
142
141
|
_classCallCheck(this, FeaturePopoverPopper2);
|
|
143
|
-
|
|
142
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
143
|
+
args[_key2] = arguments[_key2];
|
|
144
|
+
}
|
|
145
|
+
_this2 = _callSuper(this, FeaturePopoverPopper2, [].concat(args));
|
|
146
|
+
_defineProperty(_this2, "popperRef", /* @__PURE__ */ React.createRef());
|
|
147
|
+
return _this2;
|
|
144
148
|
}
|
|
145
|
-
|
|
149
|
+
_inherits(FeaturePopoverPopper2, _Component2);
|
|
150
|
+
return _createClass(FeaturePopoverPopper2, [{
|
|
151
|
+
key: "componentDidMount",
|
|
152
|
+
value: function componentDidMount() {
|
|
153
|
+
var _this3 = this;
|
|
154
|
+
if (this.asProps.autoFocus) {
|
|
155
|
+
setTimeout(function() {
|
|
156
|
+
var _this3$popperRef$curr;
|
|
157
|
+
(_this3$popperRef$curr = _this3.popperRef.current) === null || _this3$popperRef$curr === void 0 || _this3$popperRef$curr.focus();
|
|
158
|
+
}, 0);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
146
162
|
key: "render",
|
|
147
163
|
value: function render() {
|
|
148
164
|
var _ref2 = this.asProps, _ref6;
|
|
149
165
|
var SFeaturePopover = Box;
|
|
150
166
|
var SClose = Button;
|
|
151
|
-
var _this$
|
|
152
|
-
return _ref6 = sstyled
|
|
167
|
+
var _this$asProps4 = this.asProps, Children = _this$asProps4.Children, styles = _this$asProps4.styles, visible = _this$asProps4.visible, closeIcon = _this$asProps4.closeIcon, duration = _this$asProps4.duration, $onCloseClick = _this$asProps4.$onCloseClick, animationsDisabled = _this$asProps4.animationsDisabled, getI18nText = _this$asProps4.getI18nText, zIndex = _this$asProps4.zIndex, ariaLabel = _this$asProps4["aria-label"], ariaDescribedBy = _this$asProps4["aria-describedby"], ariaLabelledby = _this$asProps4["aria-labelledby"], title = _this$asProps4.title, theme = _this$asProps4.theme;
|
|
168
|
+
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(Popper.Popper, {
|
|
169
|
+
ref: this.popperRef,
|
|
153
170
|
disableEnforceFocus: true,
|
|
154
171
|
zIndex,
|
|
155
172
|
tabIndex: 0,
|
|
156
|
-
autoFocus: true,
|
|
157
173
|
role: "dialog",
|
|
158
174
|
"aria-describedby": ariaDescribedBy,
|
|
159
175
|
"aria-label": ariaLabel,
|
|
@@ -171,33 +187,38 @@ var FeaturePopoverPopper = /* @__PURE__ */ function(_Component2) {
|
|
|
171
187
|
"aria-label": getI18nText("close"),
|
|
172
188
|
"onClick": $onCloseClick,
|
|
173
189
|
"use": "tertiary",
|
|
174
|
-
"theme": "muted",
|
|
190
|
+
"theme": theme === "accent" ? "muted" : "invert",
|
|
175
191
|
"size": "m",
|
|
176
192
|
"addonLeft": CloseIcon,
|
|
177
193
|
"type": "button"
|
|
178
194
|
})), /* @__PURE__ */ React.createElement(Children, _ref6.cn("Children", {})))));
|
|
179
195
|
}
|
|
180
196
|
}]);
|
|
181
|
-
|
|
182
|
-
}(Component);
|
|
197
|
+
})(Component);
|
|
183
198
|
_defineProperty(FeaturePopoverPopper, "defaultProps", {
|
|
184
199
|
closeIcon: false,
|
|
185
|
-
duration: 200
|
|
200
|
+
duration: 200,
|
|
201
|
+
autoFocus: true
|
|
186
202
|
});
|
|
187
|
-
|
|
203
|
+
function Spot(props) {
|
|
188
204
|
var _ref3 = arguments[0], _ref7;
|
|
189
205
|
var SSpot = Box;
|
|
190
206
|
var styles = props.styles, visible = props.visible;
|
|
191
207
|
if (!visible) return null;
|
|
192
|
-
return _ref7 = sstyled
|
|
193
|
-
}
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
208
|
+
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(SSpot, _ref7.cn("SSpot", _objectSpread({}, assignProps({}, _ref3))));
|
|
209
|
+
}
|
|
210
|
+
const FeaturePopover_default = createComponent(
|
|
211
|
+
FeaturePopover,
|
|
212
|
+
{
|
|
213
|
+
Trigger,
|
|
214
|
+
Popper: FeaturePopoverPopper,
|
|
215
|
+
Spot
|
|
216
|
+
},
|
|
217
|
+
// @ts-ignore
|
|
218
|
+
{
|
|
219
|
+
parent: Popper
|
|
220
|
+
}
|
|
221
|
+
);
|
|
201
222
|
export {
|
|
202
|
-
|
|
223
|
+
FeaturePopover_default as default
|
|
203
224
|
};
|
|
@@ -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, oklch(0.88 0.078 303));
|
|
9
|
-
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
10
8
|
box-shadow: var(--intergalactic-box-shadow-popper, 1px 1px 10px 0px oklch(0.176 0.033 175.7 / 0.07));
|
|
11
9
|
position: relative;
|
|
10
|
+
|
|
11
|
+
&[theme='accent'] {
|
|
12
|
+
background-color: var(--intergalactic-feature-popover-bg, oklch(0.88 0.078 303));
|
|
13
|
+
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
14
|
+
}
|
|
15
|
+
&[theme='neutral'] {
|
|
16
|
+
background-color: var(--intergalactic-feature-popover-bg-neutral, oklch(0.23 0.01 140));
|
|
17
|
+
color: var(--intergalactic-text-primary-invert, oklch(0.999 0.001 180 / 0.949));
|
|
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, oklch(0.88 0.078 303));
|
|
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, oklch(0.88 0.078 303));
|
|
98
|
+
}
|
|
99
|
+
&::after {
|
|
100
|
+
background-color: var(--intergalactic-feature-popover-bg, oklch(0.88 0.078 303));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
&[theme='neutral'] {
|
|
104
|
+
&::before {
|
|
105
|
+
background-color: var(--intergalactic-feature-popover-dot-neutral-outer-border, oklch(0.88 0.078 303));
|
|
106
|
+
}
|
|
107
|
+
&::after {
|
|
108
|
+
background-color: var(--intergalactic-feature-popover-dot-neutral, oklch(0.88 0.078 303));
|
|
109
|
+
}
|
|
88
110
|
}
|
|
89
111
|
}
|
|
90
112
|
|
|
@@ -6,12 +6,12 @@ import it from "./it.json.mjs";
|
|
|
6
6
|
import ja from "./ja.json.mjs";
|
|
7
7
|
import ko from "./ko.json.mjs";
|
|
8
8
|
import nl from "./nl.json.mjs";
|
|
9
|
+
import pl from "./pl.json.mjs";
|
|
9
10
|
import pt from "./pt.json.mjs";
|
|
11
|
+
import sv from "./sv.json.mjs";
|
|
10
12
|
import tr from "./tr.json.mjs";
|
|
11
13
|
import vi from "./vi.json.mjs";
|
|
12
14
|
import zh from "./zh.json.mjs";
|
|
13
|
-
import pl from "./pl.json.mjs";
|
|
14
|
-
import sv from "./sv.json.mjs";
|
|
15
15
|
var localizedMessages = {
|
|
16
16
|
de,
|
|
17
17
|
en,
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Options as OptionsArrow } from '@popperjs/core/lib/modifiers/arrow';
|
|
2
|
+
import type { Options as OptionsComputeStyles } from '@popperjs/core/lib/modifiers/computeStyles';
|
|
3
|
+
import type { Options as OptionsEventListeners } from '@popperjs/core/lib/modifiers/eventListeners';
|
|
4
|
+
import type { Options as OptionsFlip } from '@popperjs/core/lib/modifiers/flip';
|
|
5
|
+
import type { Options as OptionsOffset } from '@popperjs/core/lib/modifiers/offset';
|
|
6
|
+
import type { Options as OptionsPreventOverflow } from '@popperjs/core/lib/modifiers/preventOverflow';
|
|
7
|
+
import type { Modifier, Options, PositioningStrategy } from '@popperjs/core/lib/types';
|
|
8
|
+
import type { AnimationProps, BoxProps, OutsideClickProps, PortalProps, Box, PopperContext, PopperPopperProps, Placement, Popper } from '@semcore/base-components';
|
|
9
|
+
import type { Intergalactic, PropGetterFn } from '@semcore/core';
|
|
10
|
+
import type { UniqueIDProps } from '@semcore/core/lib/utils/uniqueID';
|
|
11
|
+
import type React from 'react';
|
|
12
|
+
/**
|
|
13
|
+
* Popper must have an accessible names (aria-group-name).
|
|
14
|
+
*/
|
|
15
|
+
type AriaProps = Intergalactic.RequireAtLeastOne<{
|
|
16
|
+
'aria-label'?: string;
|
|
17
|
+
'aria-labelledby'?: string;
|
|
18
|
+
'title'?: string;
|
|
19
|
+
}>;
|
|
20
|
+
export type FeaturePopoverPopperProps = PopperPopperProps & {
|
|
21
|
+
/**
|
|
22
|
+
* The property responsible for the visibility of the closing icon
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
closeIcon?: boolean;
|
|
26
|
+
/** Animation display duration in `ms`
|
|
27
|
+
* @default 200
|
|
28
|
+
*/
|
|
29
|
+
duration?: number;
|
|
30
|
+
/** Specifies the locale for i18n support */
|
|
31
|
+
locale?: string;
|
|
32
|
+
};
|
|
33
|
+
export type FeaturePopoverPopperInnerProps = {
|
|
34
|
+
theme: FeaturePopoverProps['theme'];
|
|
35
|
+
visible: boolean;
|
|
36
|
+
$onCloseClick: (e: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
37
|
+
animationsDisabled: boolean;
|
|
38
|
+
getI18nText: (message: string, opts?: Record<string, unknown>) => string;
|
|
39
|
+
autofocus: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type FeaturePopoverContext = PopperContext & {
|
|
42
|
+
getSpotProps: PropGetterFn;
|
|
43
|
+
};
|
|
44
|
+
export type FPPopperProps = OutsideClickProps & PortalProps & UniqueIDProps & AnimationProps & {
|
|
45
|
+
/**
|
|
46
|
+
* Popper can have different positioning options
|
|
47
|
+
* @default absolute
|
|
48
|
+
*/
|
|
49
|
+
strategy?: PositioningStrategy;
|
|
50
|
+
/**
|
|
51
|
+
* Modifiers for popper.js
|
|
52
|
+
*/
|
|
53
|
+
modifiers?: Array<Partial<Modifier<any, any>>>;
|
|
54
|
+
/** Timer to show and hide the popper */
|
|
55
|
+
timeout?: number | [number, number];
|
|
56
|
+
/** PopperJS modifier settings for popper indent */
|
|
57
|
+
offset?: Partial<OptionsOffset> | number | [number, number];
|
|
58
|
+
/** PopperJS modifier settings for finding borders */
|
|
59
|
+
preventOverflow?: Partial<OptionsPreventOverflow>;
|
|
60
|
+
/** PopperJS modifier settings responsible for the arrow */
|
|
61
|
+
arrow?: Partial<OptionsArrow>;
|
|
62
|
+
/** PopperJS modifier settings responsible for turning the popper when there is not enough space */
|
|
63
|
+
flip?: Partial<OptionsFlip>;
|
|
64
|
+
/** PopperJS modifier settings for applying styles */
|
|
65
|
+
computeStyles?: Partial<OptionsComputeStyles>;
|
|
66
|
+
/** PopperJS modifier settings responsible for subscribing to global events */
|
|
67
|
+
eventListeners?: Partial<OptionsEventListeners>;
|
|
68
|
+
/** @ignore */
|
|
69
|
+
onFirstUpdate?: Options['onFirstUpdate'];
|
|
70
|
+
/**
|
|
71
|
+
* Flag for disable Popover (if true, it will close Popper and it will not respond to handlers)
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* If enabled, you will need to use setTrigger function from children rendering function to set popper trigger.
|
|
77
|
+
*/
|
|
78
|
+
explicitTriggerSet?: boolean;
|
|
79
|
+
popperMargin?: number;
|
|
80
|
+
};
|
|
81
|
+
export type FeaturePopoverProps = FPPopperProps & {
|
|
82
|
+
/** Popper visibility value */
|
|
83
|
+
visible?: boolean;
|
|
84
|
+
/** Function called when visibility changes */
|
|
85
|
+
onVisibleChange?: (visible: boolean, e?: Event) => boolean | void;
|
|
86
|
+
/**
|
|
87
|
+
* The position of the popper relative to the trigger that called it.
|
|
88
|
+
* @default auto
|
|
89
|
+
*/
|
|
90
|
+
placement?: Placement;
|
|
91
|
+
/**
|
|
92
|
+
* The theme of FeaturePopover
|
|
93
|
+
* @default accent
|
|
94
|
+
*/
|
|
95
|
+
theme?: 'accent' | 'neutral';
|
|
96
|
+
};
|
|
97
|
+
export type FeaturePopoverTriggerProps = BoxProps & {
|
|
98
|
+
theme?: FeaturePopoverProps['theme'];
|
|
99
|
+
};
|
|
100
|
+
export type FeaturePopoverSpotProps = {
|
|
101
|
+
visible?: boolean;
|
|
102
|
+
theme?: FeaturePopoverProps['theme'];
|
|
103
|
+
};
|
|
104
|
+
export type FeaturePopoverComponent = Intergalactic.Component<'div', FeaturePopoverProps, FeaturePopoverContext> & {
|
|
105
|
+
Trigger: Intergalactic.Component<typeof Popper.Trigger, FeaturePopoverTriggerProps>;
|
|
106
|
+
Popper: Intergalactic.Component<'div', FeaturePopoverPopperProps & AriaProps>;
|
|
107
|
+
Spot: Intergalactic.Component<typeof Box, FeaturePopoverSpotProps>;
|
|
108
|
+
};
|
|
109
|
+
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,42 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Popper must have an accessible names (aria-group-name).
|
|
7
|
-
*/
|
|
8
|
-
type AriaProps = Intergalactic.RequireAtLeastOne<{
|
|
9
|
-
'aria-label'?: string;
|
|
10
|
-
'aria-labelledby'?: string;
|
|
11
|
-
title?: string;
|
|
12
|
-
}>;
|
|
13
|
-
|
|
14
|
-
/** @deprecated */
|
|
15
|
-
export interface IFeaturePopoverPopperProps extends FeaturePopoverPopperProps, UnknownProperties {}
|
|
16
|
-
export type FeaturePopoverPopperProps = PopperPopperProps & {
|
|
17
|
-
/**
|
|
18
|
-
* The property responsible for the visibility of the closing icon
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
closeIcon?: boolean;
|
|
22
|
-
/** Animation display duration in `ms`
|
|
23
|
-
* @default 200
|
|
24
|
-
*/
|
|
25
|
-
duration?: number;
|
|
26
|
-
|
|
27
|
-
locale?: string;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/** @deprecated */
|
|
31
|
-
export interface IFeaturePopoverContext extends FeaturePopoverContext, UnknownProperties {}
|
|
32
|
-
export type FeaturePopoverContext = PopperContext & {
|
|
33
|
-
getSpotProps: PropGetterFn;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
declare const FeaturePopover: Intergalactic.Component<'div', PopperProps, FeaturePopoverContext> & {
|
|
37
|
-
Trigger: typeof Popper.Trigger;
|
|
38
|
-
Popper: Intergalactic.Component<'div', FeaturePopoverPopperProps & AriaProps>;
|
|
39
|
-
Spot: typeof Box;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default FeaturePopover;
|
|
1
|
+
import type { FeaturePopoverProps, FeaturePopoverPopperProps } from './FeaturePopover.type';
|
|
2
|
+
export { default } from './FeaturePopover';
|
|
3
|
+
export type { FeaturePopoverProps, FeaturePopoverPopperProps, };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const localizedMessages: {
|
|
2
|
+
de: {
|
|
3
|
+
close: string;
|
|
4
|
+
};
|
|
5
|
+
en: {
|
|
6
|
+
close: string;
|
|
7
|
+
};
|
|
8
|
+
es: {
|
|
9
|
+
close: string;
|
|
10
|
+
};
|
|
11
|
+
fr: {
|
|
12
|
+
close: string;
|
|
13
|
+
};
|
|
14
|
+
it: {
|
|
15
|
+
close: string;
|
|
16
|
+
};
|
|
17
|
+
ja: {
|
|
18
|
+
close: string;
|
|
19
|
+
};
|
|
20
|
+
ko: {
|
|
21
|
+
close: string;
|
|
22
|
+
};
|
|
23
|
+
nl: {
|
|
24
|
+
close: string;
|
|
25
|
+
};
|
|
26
|
+
pt: {
|
|
27
|
+
close: string;
|
|
28
|
+
};
|
|
29
|
+
tr: {
|
|
30
|
+
close: string;
|
|
31
|
+
};
|
|
32
|
+
vi: {
|
|
33
|
+
close: string;
|
|
34
|
+
};
|
|
35
|
+
zh: {
|
|
36
|
+
close: string;
|
|
37
|
+
};
|
|
38
|
+
pl: {
|
|
39
|
+
close: string;
|
|
40
|
+
};
|
|
41
|
+
sv: {
|
|
42
|
+
close: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/feature-popover",
|
|
3
3
|
"description": "Semrush FeaturePopover Component",
|
|
4
|
-
"version": "4.56.0-prerelease.
|
|
4
|
+
"version": "4.56.0-prerelease.5",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/button": "5.44.0-prerelease.
|
|
18
|
-
"@semcore/utils": "4.49.0-prerelease.
|
|
19
|
-
"@semcore/flex-box": "5.42.0-prerelease.
|
|
20
|
-
"@semcore/popper": "5.47.0-prerelease.
|
|
21
|
-
"@semcore/icon": "4.63.0-prerelease.
|
|
22
|
-
"@semcore/animation": "2.42.0-prerelease.
|
|
17
|
+
"@semcore/button": "5.44.0-prerelease.5",
|
|
18
|
+
"@semcore/utils": "4.49.0-prerelease.5",
|
|
19
|
+
"@semcore/flex-box": "5.42.0-prerelease.5",
|
|
20
|
+
"@semcore/popper": "5.47.0-prerelease.5",
|
|
21
|
+
"@semcore/icon": "4.63.0-prerelease.5",
|
|
22
|
+
"@semcore/animation": "2.42.0-prerelease.5"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@semcore/core": "^2.40.0-prerelease.
|
|
25
|
+
"@semcore/core": "^2.40.0-prerelease.5",
|
|
26
26
|
"react": "16.8 - 18",
|
|
27
27
|
"react-dom": "16.8 - 18"
|
|
28
28
|
},
|
package/lib/cjs/index.d.js
DELETED
package/lib/cjs/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { Intergalactic, PropGetterFn, UnknownProperties } from '@semcore/core';\nimport Popper, { PopperContext, PopperPopperProps, PopperProps } from '@semcore/popper';\nimport { Box } from '@semcore/flex-box';\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\n locale?: string;\n};\n\n/** @deprecated */\nexport interface IFeaturePopoverContext extends FeaturePopoverContext, UnknownProperties {}\nexport type FeaturePopoverContext = PopperContext & {\n getSpotProps: PropGetterFn;\n};\n\ndeclare const FeaturePopover: Intergalactic.Component<'div', PopperProps, FeaturePopoverContext> & {\n Trigger: typeof Popper.Trigger;\n Popper: Intergalactic.Component<'div', FeaturePopoverPopperProps & AriaProps>;\n Spot: typeof Box;\n};\n\nexport default FeaturePopover;\n"],"mappings":""}
|
package/lib/es6/index.d.js
DELETED
package/lib/es6/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { Intergalactic, PropGetterFn, UnknownProperties } from '@semcore/core';\nimport Popper, { PopperContext, PopperPopperProps, PopperProps } from '@semcore/popper';\nimport { Box } from '@semcore/flex-box';\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\n locale?: string;\n};\n\n/** @deprecated */\nexport interface IFeaturePopoverContext extends FeaturePopoverContext, UnknownProperties {}\nexport type FeaturePopoverContext = PopperContext & {\n getSpotProps: PropGetterFn;\n};\n\ndeclare const FeaturePopover: Intergalactic.Component<'div', PopperProps, FeaturePopoverContext> & {\n Trigger: typeof Popper.Trigger;\n Popper: Intergalactic.Component<'div', FeaturePopoverPopperProps & AriaProps>;\n Spot: typeof Box;\n};\n\nexport default FeaturePopover;\n"],"mappings":""}
|