@semcore/spin-container 7.41.0-prerelease.4 → 7.41.0

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 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
- ## [7.41.0] - 2025-02-27
5
+ ## [7.41.0] - 2025-03-14
6
6
 
7
- ### Changed
7
+ ### Added
8
8
 
9
- - Version minor update due to children dependencies update (`@semcore/utils` [4.45.1 ~> 4.47.1], `@semcore/spin` [5.40.1 ~> 5.41.0], `@semcore/flex-box` [5.40.1 ~> 5.41.0], `@semcore/animation` [2.40.1 ~> 2.41.0], `@semcore/core` [2.38.1 ~> 2.39.0]).
9
+ - Build for ESM.
10
10
 
11
11
  ## [7.40.4] - 2025-02-05
12
12
 
@@ -0,0 +1,133 @@
1
+ import v from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import C from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import S from "@babel/runtime/helpers/esm/createClass";
4
+ import T from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import x from "@babel/runtime/helpers/esm/inherits";
6
+ import k from "@babel/runtime/helpers/esm/createSuper";
7
+ import m from "@babel/runtime/helpers/esm/defineProperty";
8
+ import { sstyled as A } from "@semcore/utils/lib/core/index";
9
+ import M, { sstyled as h, assignProps as f, Component as b } from "@semcore/core";
10
+ import i from "react";
11
+ import { FadeInOut as $ } from "@semcore/animation";
12
+ import w from "@semcore/spin";
13
+ import { Box as y } from "@semcore/flex-box";
14
+ import F from "@semcore/utils/lib/enhances/resolveColorEnhance";
15
+ import { isAdvanceMode as I } from "@semcore/utils/lib/findComponent";
16
+ var R = (
17
+ /*__reshadow_css_start__*/
18
+ (A.insert(
19
+ /*__inner_css_start__*/
20
+ ".___SSpinContainer_1l6x4_gg_{z-index:0;position:relative;display:block;overflow:hidden}.___SContent_1l6x4_gg_{z-index:0;position:relative}.___SOverlay_1l6x4_gg_{z-index:1;display:flex;width:100%;height:100%;justify-content:center;align-items:center;position:absolute;top:0;left:0}.___SOverlay_1l6x4_gg_._theme_invert_1l6x4_gg_{background-color:var(--intergalactic-overlay-secondary, rgba(25, 27, 35, 0.4))}.___SOverlay_1l6x4_gg_._theme_dark_1l6x4_gg_{background-color:var(--intergalactic-overlay-limitation-secondary, rgba(255, 255, 255, 0.85))}.___SOverlay_1l6x4_gg_._theme_custom_1l6x4_gg_{background-color:var(--background_1l6x4)}",
21
+ "1l6x4_gg_"
22
+ ), {
23
+ __SSpinContainer: "___SSpinContainer_1l6x4_gg_",
24
+ __SContent: "___SContent_1l6x4_gg_",
25
+ __SOverlay: "___SOverlay_1l6x4_gg_",
26
+ _theme_invert: "_theme_invert_1l6x4_gg_",
27
+ _theme_dark: "_theme_dark_1l6x4_gg_",
28
+ _theme_custom: "_theme_custom_1l6x4_gg_",
29
+ "--background": "--background_1l6x4"
30
+ })
31
+ ), u = /* @__PURE__ */ function(s) {
32
+ x(r, s);
33
+ var l = k(r);
34
+ function r() {
35
+ var a;
36
+ C(this, r);
37
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
38
+ t[n] = arguments[n];
39
+ return a = l.call.apply(l, [this].concat(t)), m(T(a), "state", {
40
+ inert: a.props.loading
41
+ }), a;
42
+ }
43
+ return S(r, [{
44
+ key: "componentDidUpdate",
45
+ value: function(e) {
46
+ var t = this, n = this.props.loading;
47
+ e.loading !== n && (this.inertTimer && clearTimeout(this.inertTimer), n ? this.setState({
48
+ inert: !0
49
+ }) : this.inertTimer = setTimeout(function() {
50
+ t.setState({
51
+ inert: !1
52
+ });
53
+ }, this.asProps.duration + 50));
54
+ }
55
+ }, {
56
+ key: "getOverlayProps",
57
+ value: function() {
58
+ var e = this.asProps, t = e.loading, n = e.background, o = e.duration, c = e.size, _ = e.theme, d = e.resolveColor;
59
+ return {
60
+ background: n,
61
+ // for Animated
62
+ loading: t,
63
+ duration: o,
64
+ // for Spin
65
+ size: c,
66
+ theme: _,
67
+ resolveColor: d
68
+ };
69
+ }
70
+ }, {
71
+ key: "getContentProps",
72
+ value: function() {
73
+ var e = this.state.inert;
74
+ return {
75
+ inert: e ? "" : void 0
76
+ };
77
+ }
78
+ }, {
79
+ key: "render",
80
+ value: function() {
81
+ var e = this.asProps, t, n = y, o = this.asProps, c = o.styles, _ = o.Children, d = o.forcedAdvancedMode, p = d || I(_, [g.Overlay.displayName]);
82
+ return t = h(c), /* @__PURE__ */ i.createElement(n, t.cn("SSpinContainer", v({}, f({}, e))), p ? /* @__PURE__ */ i.createElement(_, t.cn("Children", {})) : /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(g.Content, null, /* @__PURE__ */ i.createElement(_, t.cn("Children", {}))), /* @__PURE__ */ i.createElement(g.Overlay, null)));
83
+ }
84
+ }]), r;
85
+ }(b);
86
+ m(u, "displayName", "SpinContainer");
87
+ m(u, "style", R);
88
+ m(u, "defaultProps", {
89
+ size: "xxl",
90
+ theme: "dark",
91
+ duration: 200
92
+ });
93
+ m(u, "enhance", [F()]);
94
+ var P = /* @__PURE__ */ function(s) {
95
+ x(r, s);
96
+ var l = k(r);
97
+ function r() {
98
+ return C(this, r), l.apply(this, arguments);
99
+ }
100
+ return S(r, [{
101
+ key: "render",
102
+ value: function() {
103
+ var e = this.asProps, t, n = y, o = this.asProps, c = o.styles, _ = o.theme, d = o.background, p = o.loading, O = o.duration, E = o.resolveColor, z = d ? "custom" : _;
104
+ return t = h(c), /* @__PURE__ */ i.createElement($, t.cn("FadeInOut", {
105
+ visible: p,
106
+ duration: O
107
+ }), /* @__PURE__ */ i.createElement(n, t.cn("SOverlay", v({}, f({
108
+ "use:theme": z,
109
+ "use:background": E(d)
110
+ }, e)))));
111
+ }
112
+ }]), r;
113
+ }(b);
114
+ m(P, "defaultProps", function(s) {
115
+ var l = s.size, r = s.theme;
116
+ return {
117
+ children: /* @__PURE__ */ i.createElement(w, {
118
+ size: l,
119
+ theme: r
120
+ })
121
+ };
122
+ });
123
+ function j(s) {
124
+ var l = arguments[0], r, a = y, e = s.styles;
125
+ return r = h(e), /* @__PURE__ */ i.createElement(a, r.cn("SContent", v({}, f({}, l))));
126
+ }
127
+ var g = M(u, {
128
+ Overlay: P,
129
+ Content: j
130
+ });
131
+ export {
132
+ g as default
133
+ };
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./SpinContainer.mjs";
2
+ export {
3
+ o as default
4
+ };
package/package.json CHANGED
@@ -1,21 +1,26 @@
1
1
  {
2
2
  "name": "@semcore/spin-container",
3
3
  "description": "Semrush SpinContainer Component",
4
- "version": "7.41.0-prerelease.4",
4
+ "version": "7.41.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "types": "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/utils": "4.47.1-prerelease.4",
13
- "@semcore/spin": "5.41.0-prerelease.4",
14
- "@semcore/flex-box": "5.41.0-prerelease.4",
15
- "@semcore/animation": "2.41.0-prerelease.4"
17
+ "@semcore/utils": "4.48.0",
18
+ "@semcore/spin": "5.41.0",
19
+ "@semcore/flex-box": "5.41.0",
20
+ "@semcore/animation": "2.41.0"
16
21
  },
17
22
  "peerDependencies": {
18
- "@semcore/core": "^2.39.0-prerelease.4",
23
+ "@semcore/core": "^2.17.5",
19
24
  "react": "16.8 - 18",
20
25
  "react-dom": "16.8 - 18"
21
26
  },
@@ -29,6 +34,6 @@
29
34
  "@semcore/testing-utils": "1.0.0"
30
35
  },
31
36
  "scripts": {
32
- "build": "pnpm semcore-builder --source=js"
37
+ "build": "pnpm semcore-builder --source=js && pnpm vite build"
33
38
  }
34
39
  }
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
+ );