@semcore/feature-popover 4.53.0-prerelease.11 → 4.53.0-prerelease.12
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 +3 -3
- package/lib/esm/FeaturePopover.mjs +178 -0
- package/lib/esm/index.mjs +4 -0
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +33 -0
- package/lib/esm/translations/de.json.mjs +7 -0
- package/lib/esm/translations/en.json.mjs +7 -0
- package/lib/esm/translations/es.json.mjs +7 -0
- package/lib/esm/translations/fr.json.mjs +7 -0
- package/lib/esm/translations/it.json.mjs +7 -0
- package/lib/esm/translations/ja.json.mjs +7 -0
- package/lib/esm/translations/ko.json.mjs +7 -0
- package/lib/esm/translations/nl.json.mjs +7 -0
- package/lib/esm/translations/pl.json.mjs +7 -0
- package/lib/esm/translations/pt.json.mjs +7 -0
- package/lib/esm/translations/sv.json.mjs +7 -0
- package/lib/esm/translations/tr.json.mjs +7 -0
- package/lib/esm/translations/vi.json.mjs +7 -0
- package/lib/esm/translations/zh.json.mjs +7 -0
- package/package.json +14 -8
- package/vite.config.ts +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [4.53.0] - 2025-03-
|
|
5
|
+
## [4.53.0] - 2025-03-14
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Added
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- Build for ESM.
|
|
10
10
|
|
|
11
11
|
## [4.52.1] - 2025-02-05
|
|
12
12
|
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import y from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import m from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import L from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
import P from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
|
+
import C from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
+
import b from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
7
|
+
import k from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
import T from "@babel/runtime/helpers/esm/createSuper";
|
|
9
|
+
import p from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
|
+
import { sstyled as M } from "@semcore/utils/lib/core/index";
|
|
11
|
+
import j, { sstyled as _, Component as w, assignProps as h } from "@semcore/core";
|
|
12
|
+
import s from "react";
|
|
13
|
+
import { Animation as O } from "@semcore/animation";
|
|
14
|
+
import f from "@semcore/popper";
|
|
15
|
+
import { Box as x } from "@semcore/flex-box";
|
|
16
|
+
import N from "@semcore/icon/Close/m";
|
|
17
|
+
import { callAllEventHandlers as W } from "@semcore/utils/lib/assignProps";
|
|
18
|
+
import q from "@semcore/utils/lib/enhances/i18nEnhance";
|
|
19
|
+
import { localizedMessages as A } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
20
|
+
import G from "@semcore/button";
|
|
21
|
+
var J = ["styles", "forwardRef", "onVisibleChange", "modifiers"], K = (
|
|
22
|
+
/*__reshadow_css_start__*/
|
|
23
|
+
(M.insert(
|
|
24
|
+
/*__inner_css_start__*/
|
|
25
|
+
'@keyframes showTrigger_6pave{0%{opacity:0}to{opacity:1}}@keyframes scaleSizeAndHide_6pave{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}.___SFeaturePopover_6pave_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;background-color:var(--intergalactic-bg-primary-highlight, #fce081);color:var(--intergalactic-text-primary, #191b23);box-shadow:var(--intergalactic-box-shadow-popper, 0px 1px 12px 0px rgba(25, 27, 35, 0.15));position:relative}.___STrigger_6pave_gg_{position:relative}.___SClose_6pave_gg_{position:absolute;z-index:1;right:var(--intergalactic-spacing-2x, 8px);top:var(--intergalactic-spacing-2x, 8px)}.___SClose_6pave_gg_ .___SAddon_6pave_gg_:only-child{margin-left:calc(var(--intergalactic-spacing-2x, 8px) - 1px);margin-right:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SSpot_6pave_gg_{position:absolute;bottom:calc(-1*var(--intergalactic-spacing-1x, 4px));right:calc(-1*var(--intergalactic-spacing-1x, 4px));animation-name:showTrigger_6pave;animation-duration:.2s;animation-timing-function:ease-in;animation-delay:.4s;animation-fill-mode:forwards;width:12px;height:12px}.___SSpot_6pave_gg_::after,.___SSpot_6pave_gg_::before{content:"";position:absolute;top:0;left:0;border-radius:50%;width:12px;height:12px}.___SSpot_6pave_gg_::before{transform-origin:50%;animation-name:scaleSizeAndHide_6pave;animation-duration:1s;animation-iteration-count:infinite;animation-fill-mode:forwards;animation-delay:.5s;background-color:var(--intergalactic-feature-popover-dot-outer-border, #fce081)}.___SSpot_6pave_gg_::after{background-color:var(--intergalactic-bg-primary-highlight, #fce081)}@media (prefers-reduced-motion){.___SSpot_6pave_gg_,.___SSpot_6pave_gg_::before{animation-name:none}}',
|
|
26
|
+
"6pave_gg_"
|
|
27
|
+
), {
|
|
28
|
+
__SFeaturePopover: "___SFeaturePopover_6pave_gg_",
|
|
29
|
+
__STrigger: "___STrigger_6pave_gg_",
|
|
30
|
+
"@showTrigger": "showTrigger_6pave",
|
|
31
|
+
"@scaleSizeAndHide": "scaleSizeAndHide_6pave",
|
|
32
|
+
__SClose: "___SClose_6pave_gg_",
|
|
33
|
+
__SAddon: "___SAddon_6pave_gg_",
|
|
34
|
+
__SSpot: "___SSpot_6pave_gg_"
|
|
35
|
+
})
|
|
36
|
+
), S = (
|
|
37
|
+
/*__reshadow_css_start__*/
|
|
38
|
+
(_.insert(
|
|
39
|
+
/*__inner_css_start__*/
|
|
40
|
+
"@keyframes enter_ob9e6{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}@keyframes exit_ob9e6{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-10px)}}",
|
|
41
|
+
"ob9e6_gg_"
|
|
42
|
+
), {
|
|
43
|
+
"@enter": "enter_ob9e6",
|
|
44
|
+
"@exit": "exit_ob9e6"
|
|
45
|
+
})
|
|
46
|
+
), g = /* @__PURE__ */ function(l) {
|
|
47
|
+
k(r, l);
|
|
48
|
+
var n = T(r);
|
|
49
|
+
function r() {
|
|
50
|
+
var a;
|
|
51
|
+
P(this, r);
|
|
52
|
+
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++)
|
|
53
|
+
e[o] = arguments[o];
|
|
54
|
+
return a = n.call.apply(n, [this].concat(e)), p(b(a), "defaultModifiers", [{
|
|
55
|
+
name: "flip",
|
|
56
|
+
enabled: !1
|
|
57
|
+
}]), p(b(a), "handleVisibleChange", function(c) {
|
|
58
|
+
a.handlers.visible(c);
|
|
59
|
+
}), p(b(a), "handleCloseClick", function(c) {
|
|
60
|
+
a.handlers.visible(!1, c);
|
|
61
|
+
}), a;
|
|
62
|
+
}
|
|
63
|
+
return C(r, [{
|
|
64
|
+
key: "uncontrolledProps",
|
|
65
|
+
value: function() {
|
|
66
|
+
return {
|
|
67
|
+
visible: null
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "getPopperProps",
|
|
72
|
+
value: function() {
|
|
73
|
+
var t = this.asProps, e = t.visible, o = t.getI18nText;
|
|
74
|
+
return {
|
|
75
|
+
visible: e,
|
|
76
|
+
$onCloseClick: this.handleCloseClick,
|
|
77
|
+
getI18nText: o
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "getSpotProps",
|
|
82
|
+
value: function() {
|
|
83
|
+
var t = this.asProps.visible;
|
|
84
|
+
return {
|
|
85
|
+
visible: t
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "render",
|
|
90
|
+
value: function() {
|
|
91
|
+
var t, e = this.asProps, o = e.styles, c = e.forwardRef, i = e.onVisibleChange, d = e.modifiers, u = d === void 0 ? [] : d, v = L(e, J);
|
|
92
|
+
return t = _(o), /* @__PURE__ */ s.createElement(f, t.cn("Popper", m({
|
|
93
|
+
ref: c,
|
|
94
|
+
onVisibleChange: W(i, this.handleVisibleChange),
|
|
95
|
+
modifiers: [].concat(y(this.defaultModifiers), y(u))
|
|
96
|
+
}, v)));
|
|
97
|
+
}
|
|
98
|
+
}]), r;
|
|
99
|
+
}(w);
|
|
100
|
+
p(g, "displayName", "FeaturePopover");
|
|
101
|
+
p(g, "style", K);
|
|
102
|
+
p(g, "defaultProps", {
|
|
103
|
+
offset: [0, 12],
|
|
104
|
+
placement: "bottom-start",
|
|
105
|
+
defaultVisible: !1,
|
|
106
|
+
onOutsideClick: function() {
|
|
107
|
+
return !1;
|
|
108
|
+
},
|
|
109
|
+
interaction: "none",
|
|
110
|
+
i18n: A,
|
|
111
|
+
locale: "en"
|
|
112
|
+
});
|
|
113
|
+
p(g, "enhance", [q(A)]);
|
|
114
|
+
function Q(l) {
|
|
115
|
+
var n = arguments[0], r, a = l.Children, t = l.styles, e = f.Trigger;
|
|
116
|
+
return r = _(t), /* @__PURE__ */ s.createElement(e, r.cn("STrigger", m({}, h({
|
|
117
|
+
tag: x,
|
|
118
|
+
"aria-haspopup": !1
|
|
119
|
+
}, n))), /* @__PURE__ */ s.createElement(a, r.cn("Children", {})));
|
|
120
|
+
}
|
|
121
|
+
var F = /* @__PURE__ */ function(l) {
|
|
122
|
+
k(r, l);
|
|
123
|
+
var n = T(r);
|
|
124
|
+
function r() {
|
|
125
|
+
return P(this, r), n.apply(this, arguments);
|
|
126
|
+
}
|
|
127
|
+
return C(r, [{
|
|
128
|
+
key: "render",
|
|
129
|
+
value: function() {
|
|
130
|
+
var t = this.asProps, e, o = x, c = G, i = this.asProps, d = i.Children, u = i.styles, v = i.visible, E = i.closeIcon, I = i.duration, z = i.$onCloseClick, $ = i.animationsDisabled, V = i.getI18nText, B = i.zIndex, H = i["aria-label"], D = i["aria-describedBy"], R = i["aria-labelledby"], X = i.title;
|
|
131
|
+
return e = _(u), /* @__PURE__ */ s.createElement(f.Popper, {
|
|
132
|
+
disableEnforceFocus: !0,
|
|
133
|
+
zIndex: B,
|
|
134
|
+
tabIndex: 0,
|
|
135
|
+
autoFocus: !0,
|
|
136
|
+
role: "dialog",
|
|
137
|
+
"aria-describedby": D,
|
|
138
|
+
"aria-label": H,
|
|
139
|
+
"aria-labelledby": R,
|
|
140
|
+
title: X
|
|
141
|
+
}, /* @__PURE__ */ s.createElement(O, e.cn("Animation", {
|
|
142
|
+
visible: v,
|
|
143
|
+
duration: I,
|
|
144
|
+
keyframes: [S["@enter"], S["@exit"]],
|
|
145
|
+
initialAnimation: !0,
|
|
146
|
+
animationsDisabled: $
|
|
147
|
+
}), /* @__PURE__ */ s.createElement(o, e.cn("SFeaturePopover", m({}, h({
|
|
148
|
+
__excludeProps: ["aria-label", "aria-describedBy", "title"]
|
|
149
|
+
}, t))), E && /* @__PURE__ */ s.createElement(c, e.cn("SClose", {
|
|
150
|
+
"aria-label": V("close"),
|
|
151
|
+
onClick: z,
|
|
152
|
+
use: "tertiary",
|
|
153
|
+
theme: "muted",
|
|
154
|
+
size: "m",
|
|
155
|
+
addonLeft: N,
|
|
156
|
+
type: "button"
|
|
157
|
+
})), /* @__PURE__ */ s.createElement(d, e.cn("Children", {})))));
|
|
158
|
+
}
|
|
159
|
+
}]), r;
|
|
160
|
+
}(w);
|
|
161
|
+
p(F, "defaultProps", {
|
|
162
|
+
closeIcon: !1,
|
|
163
|
+
duration: 200
|
|
164
|
+
});
|
|
165
|
+
var U = function(n) {
|
|
166
|
+
var r = arguments[0], a, t = x, e = n.styles, o = n.visible;
|
|
167
|
+
return o ? (a = _(e), /* @__PURE__ */ s.createElement(t, a.cn("SSpot", m({}, h({}, r))))) : null;
|
|
168
|
+
};
|
|
169
|
+
const be = j(g, {
|
|
170
|
+
Trigger: Q,
|
|
171
|
+
Popper: F,
|
|
172
|
+
Spot: U
|
|
173
|
+
}, {
|
|
174
|
+
parent: f
|
|
175
|
+
});
|
|
176
|
+
export {
|
|
177
|
+
be as default
|
|
178
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import r from "./de.json.mjs";
|
|
2
|
+
import o from "./en.json.mjs";
|
|
3
|
+
import m from "./es.json.mjs";
|
|
4
|
+
import t from "./fr.json.mjs";
|
|
5
|
+
import i from "./it.json.mjs";
|
|
6
|
+
import p from "./ja.json.mjs";
|
|
7
|
+
import f from "./ko.json.mjs";
|
|
8
|
+
import e from "./nl.json.mjs";
|
|
9
|
+
import s from "./pt.json.mjs";
|
|
10
|
+
import a from "./tr.json.mjs";
|
|
11
|
+
import l from "./vi.json.mjs";
|
|
12
|
+
import v from "./zh.json.mjs";
|
|
13
|
+
import d from "./pl.json.mjs";
|
|
14
|
+
import n from "./sv.json.mjs";
|
|
15
|
+
var B = {
|
|
16
|
+
de: r,
|
|
17
|
+
en: o,
|
|
18
|
+
es: m,
|
|
19
|
+
fr: t,
|
|
20
|
+
it: i,
|
|
21
|
+
ja: p,
|
|
22
|
+
ko: f,
|
|
23
|
+
nl: e,
|
|
24
|
+
pt: s,
|
|
25
|
+
tr: a,
|
|
26
|
+
vi: l,
|
|
27
|
+
zh: v,
|
|
28
|
+
pl: d,
|
|
29
|
+
sv: n
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
B as localizedMessages
|
|
33
|
+
};
|
package/package.json
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/feature-popover",
|
|
3
3
|
"description": "Semrush FeaturePopover Component",
|
|
4
|
-
"version": "4.53.0-prerelease.
|
|
4
|
+
"version": "4.53.0-prerelease.12",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
|
+
"exports": {
|
|
12
|
+
"require": "./lib/cjs/index.js",
|
|
13
|
+
"import": "./lib/esm/index.mjs",
|
|
14
|
+
"types": "./lib/types/index.d.ts"
|
|
15
|
+
},
|
|
11
16
|
"dependencies": {
|
|
12
|
-
"@semcore/
|
|
13
|
-
"@semcore/
|
|
14
|
-
"@semcore/
|
|
15
|
-
"@semcore/
|
|
16
|
-
"@semcore/
|
|
17
|
+
"@semcore/button": "5.42.0-prerelease.12",
|
|
18
|
+
"@semcore/utils": "4.48.0-prerelease.12",
|
|
19
|
+
"@semcore/flex-box": "5.41.0-prerelease.12",
|
|
20
|
+
"@semcore/popper": "5.46.0-prerelease.12",
|
|
21
|
+
"@semcore/icon": "4.61.0-prerelease.12",
|
|
22
|
+
"@semcore/animation": "2.41.0-prerelease.12"
|
|
17
23
|
},
|
|
18
24
|
"peerDependencies": {
|
|
19
|
-
"@semcore/core": "^2.39.0-prerelease.
|
|
25
|
+
"@semcore/core": "^2.39.0-prerelease.12",
|
|
20
26
|
"react": "16.8 - 18",
|
|
21
27
|
"react-dom": "16.8 - 18"
|
|
22
28
|
},
|
|
@@ -33,6 +39,6 @@
|
|
|
33
39
|
"@semcore/dropdown-menu": "*"
|
|
34
40
|
},
|
|
35
41
|
"scripts": {
|
|
36
|
-
"build": "pnpm semcore-builder --source=js"
|
|
42
|
+
"build": "pnpm semcore-builder --source=js && pnpm vite build"
|
|
37
43
|
}
|
|
38
44
|
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig, mergeConfig } from 'vite';
|
|
2
|
+
|
|
3
|
+
import viteConfig from '../../commonVite.config';
|
|
4
|
+
|
|
5
|
+
export default mergeConfig(
|
|
6
|
+
viteConfig,
|
|
7
|
+
defineConfig({
|
|
8
|
+
build: {
|
|
9
|
+
lib: {
|
|
10
|
+
entry: './src/index.js',
|
|
11
|
+
},
|
|
12
|
+
rollupOptions: {
|
|
13
|
+
external: ['react', 'react-dom', 'react/jsx-runtime', /@babel\/runtime\/*/, /@semcore\/*/],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
);
|