@semcore/skeleton 16.0.11-prerelease.5 → 17.0.0-prerelease.17

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/README.md +4 -4
  3. package/lib/cjs/Charts/Area.js +28 -28
  4. package/lib/cjs/Charts/Area.js.map +1 -1
  5. package/lib/cjs/Charts/Bar.js +37 -37
  6. package/lib/cjs/Charts/Bar.js.map +1 -1
  7. package/lib/cjs/Charts/Bubble.js +24 -23
  8. package/lib/cjs/Charts/Bubble.js.map +1 -1
  9. package/lib/cjs/Charts/CompactHorizontalBar.js +24 -23
  10. package/lib/cjs/Charts/CompactHorizontalBar.js.map +1 -1
  11. package/lib/cjs/Charts/Donut.js +33 -33
  12. package/lib/cjs/Charts/Donut.js.map +1 -1
  13. package/lib/cjs/Charts/Histogram.js +37 -37
  14. package/lib/cjs/Charts/Histogram.js.map +1 -1
  15. package/lib/cjs/Charts/Line.js +28 -28
  16. package/lib/cjs/Charts/Line.js.map +1 -1
  17. package/lib/cjs/Charts/RadialTree.js +24 -23
  18. package/lib/cjs/Charts/RadialTree.js.map +1 -1
  19. package/lib/cjs/Charts/ScatterPlot.js +24 -23
  20. package/lib/cjs/Charts/ScatterPlot.js.map +1 -1
  21. package/lib/cjs/Charts/Venn.js +24 -23
  22. package/lib/cjs/Charts/Venn.js.map +1 -1
  23. package/lib/cjs/Charts/index.js +21 -21
  24. package/lib/cjs/Skeleton.js +118 -145
  25. package/lib/cjs/Skeleton.js.map +1 -1
  26. package/lib/cjs/index.d.js.map +1 -1
  27. package/lib/cjs/index.js +4 -4
  28. package/lib/cjs/index.js.map +1 -1
  29. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +16 -16
  30. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  31. package/lib/es6/Charts/Area.js +25 -25
  32. package/lib/es6/Charts/Area.js.map +1 -1
  33. package/lib/es6/Charts/Bar.js +34 -34
  34. package/lib/es6/Charts/Bar.js.map +1 -1
  35. package/lib/es6/Charts/Bubble.js +21 -20
  36. package/lib/es6/Charts/Bubble.js.map +1 -1
  37. package/lib/es6/Charts/CompactHorizontalBar.js +21 -20
  38. package/lib/es6/Charts/CompactHorizontalBar.js.map +1 -1
  39. package/lib/es6/Charts/Donut.js +30 -30
  40. package/lib/es6/Charts/Donut.js.map +1 -1
  41. package/lib/es6/Charts/Histogram.js +34 -34
  42. package/lib/es6/Charts/Histogram.js.map +1 -1
  43. package/lib/es6/Charts/Line.js +25 -25
  44. package/lib/es6/Charts/Line.js.map +1 -1
  45. package/lib/es6/Charts/RadialTree.js +21 -20
  46. package/lib/es6/Charts/RadialTree.js.map +1 -1
  47. package/lib/es6/Charts/ScatterPlot.js +21 -20
  48. package/lib/es6/Charts/ScatterPlot.js.map +1 -1
  49. package/lib/es6/Charts/Venn.js +21 -20
  50. package/lib/es6/Charts/Venn.js.map +1 -1
  51. package/lib/es6/Skeleton.js +106 -133
  52. package/lib/es6/Skeleton.js.map +1 -1
  53. package/lib/es6/index.d.js.map +1 -1
  54. package/lib/es6/translations/__intergalactic-dynamic-locales.js +15 -15
  55. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  56. package/lib/esm/Charts/Area.mjs +27 -26
  57. package/lib/esm/Charts/Bar.mjs +36 -35
  58. package/lib/esm/Charts/Bubble.mjs +23 -22
  59. package/lib/esm/Charts/CompactHorizontalBar.mjs +23 -22
  60. package/lib/esm/Charts/Donut.mjs +32 -31
  61. package/lib/esm/Charts/Histogram.mjs +36 -35
  62. package/lib/esm/Charts/Line.mjs +27 -26
  63. package/lib/esm/Charts/RadialTree.mjs +23 -22
  64. package/lib/esm/Charts/ScatterPlot.mjs +23 -22
  65. package/lib/esm/Charts/Venn.mjs +23 -22
  66. package/lib/esm/Skeleton.mjs +110 -116
  67. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
  68. package/lib/types/index.d.ts +2 -8
  69. package/package.json +5 -7
@@ -1,63 +1,54 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
- import _createClass from "@babel/runtime/helpers/esm/createClass";
6
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
7
- import _inherits from "@babel/runtime/helpers/esm/inherits";
8
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
- import { createComponent, sstyled, assignProps, Component } from "@semcore/core";
2
+ import { createComponent, sstyled, Component, assignProps } from "@semcore/core";
3
+ import { Box } from "@semcore/base-components";
10
4
  import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
11
5
  import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
12
6
  import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
13
- import { Box } from "@semcore/flex-box";
14
7
  import React from "react";
15
8
  import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
16
- var _excluded = ["y", "x", "amount", "width", "styles", "forwardRef"];
17
9
  /*!__reshadow-styles__:"./style/skeleton.shadow.css"*/
18
- var style = (
10
+ const style = (
19
11
  /*__reshadow_css_start__*/
20
12
  (sstyled.insert(
21
13
  /*__inner_css_start__*/
22
- "@keyframes pulse_5mvam{0%,to{opacity:1}50%{opacity:.4}}.___SSkeleton_5mvam_gg_{animation-name:pulse_5mvam;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:var(--durationAnim_5mvam);will-change:opacity}.___SSkeletonSVG_5mvam_gg_._theme_invert_5mvam_gg_{fill:var(--intergalactic-skeleton-bg, rgba(224, 225, 233, 0.8))}.___SSkeletonSVG_5mvam_gg_._theme_dark_5mvam_gg_{fill:var(--intergalactic-skeleton-bg-invert, rgba(255, 255, 255, 0.3))}.___SText_5mvam_gg_{box-sizing:border-box}@media (prefers-reduced-motion){.___SSkeleton_5mvam_gg_{animation-name:none}}",
14
+ "@keyframes pulse_17nle{0%,to{opacity:1}50%{opacity:.4}}.___SSkeleton_17nle_gg_{animation-name:pulse_17nle;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:var(--durationAnim_17nle);will-change:opacity}.___SSkeletonSVG_17nle_gg_._theme_invert_17nle_gg_{fill:var(--intergalactic-skeleton-bg, rgba(224, 225, 233, 0.8))}.___SSkeletonSVG_17nle_gg_._theme_dark_17nle_gg_{fill:var(--intergalactic-skeleton-bg-invert, rgba(255, 255, 255, 0.3))}.___SText_17nle_gg_{box-sizing:border-box}@media (prefers-reduced-motion){.___SSkeleton_17nle_gg_{animation-name:none}}",
23
15
  /*__inner_css_end__*/
24
- "5mvam_gg_"
16
+ "17nle_gg_"
25
17
  ), /*__reshadow_css_end__*/
26
18
  {
27
- "__SSkeleton": "___SSkeleton_5mvam_gg_",
28
- "--durationAnim": "--durationAnim_5mvam",
29
- "@pulse": "pulse_5mvam",
30
- "__SSkeletonSVG": "___SSkeletonSVG_5mvam_gg_",
31
- "_theme_invert": "_theme_invert_5mvam_gg_",
32
- "_theme_dark": "_theme_dark_5mvam_gg_",
33
- "__SText": "___SText_5mvam_gg_"
19
+ "__SSkeleton": "___SSkeleton_17nle_gg_",
20
+ "--durationAnim": "--durationAnim_17nle",
21
+ "@pulse": "pulse_17nle",
22
+ "__SSkeletonSVG": "___SSkeletonSVG_17nle_gg_",
23
+ "_theme_invert": "_theme_invert_17nle_gg_",
24
+ "_theme_dark": "_theme_dark_17nle_gg_",
25
+ "__SText": "___SText_17nle_gg_"
34
26
  })
35
27
  );
36
- var MAP_COLOR_THEME = {
28
+ const MAP_COLOR_THEME = {
37
29
  dark: "rgba(255, 255, 255, 0.3)",
38
30
  invert: "rgba(224, 225, 233, 0.8)"
39
31
  };
40
- var SkeletonRoot = /* @__PURE__ */ (function(_Component) {
41
- function SkeletonRoot2() {
42
- _classCallCheck(this, SkeletonRoot2);
43
- return _callSuper(this, SkeletonRoot2, arguments);
44
- }
45
- _inherits(SkeletonRoot2, _Component);
46
- return _createClass(SkeletonRoot2, [{
47
- key: "render",
48
- value: function render() {
49
- var _ref = this.asProps, _ref3;
50
- var SSkeleton = Box;
51
- var _this$asProps = this.asProps, styles = _this$asProps.styles, duration = _this$asProps.duration, hidden = _this$asProps.hidden, getI18nText = _this$asProps.getI18nText;
52
- if (hidden) return null;
53
- return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SSkeleton, _ref3.cn("SSkeleton", _objectSpread({}, assignProps({
54
- "durationAnim": "".concat(duration, "ms"),
32
+ class SkeletonRoot extends Component {
33
+ render() {
34
+ var _ref = this.asProps, _ref3;
35
+ const SSkeleton = Box;
36
+ const {
37
+ styles,
38
+ duration,
39
+ hidden,
40
+ getI18nText
41
+ } = this.asProps;
42
+ if (hidden) return null;
43
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SSkeleton, _ref3.cn("SSkeleton", {
44
+ ...assignProps({
45
+ "durationAnim": `${duration}ms`,
55
46
  "role": "img",
56
47
  "aria-label": getI18nText("loading")
57
- }, _ref))));
58
- }
59
- }]);
60
- })(Component);
48
+ }, _ref)
49
+ }));
50
+ }
51
+ }
61
52
  _defineProperty(SkeletonRoot, "displayName", "Skeleton");
62
53
  _defineProperty(SkeletonRoot, "style", style);
63
54
  _defineProperty(SkeletonRoot, "enhance", [i18nEnhance(localizedMessages)]);
@@ -66,71 +57,66 @@ _defineProperty(SkeletonRoot, "defaultProps", {
66
57
  height: "100%",
67
58
  duration: 2e3
68
59
  });
69
- var SkeletonSVG = /* @__PURE__ */ (function(_Component2) {
70
- function SkeletonSVG2(props) {
71
- var _this;
72
- _classCallCheck(this, SkeletonSVG2);
73
- _this = _callSuper(this, SkeletonSVG2, [props]);
74
- _defineProperty(_this, "svgRef", /* @__PURE__ */ React.createRef());
60
+ class SkeletonSVG extends Component {
61
+ constructor(props) {
62
+ super(props);
63
+ _defineProperty(this, "svgRef", /* @__PURE__ */ React.createRef());
75
64
  if (canUseDOM() && props.observeParentSize) {
76
- _this.observer = new ResizeObserver(_this.handleResize.bind(_this));
65
+ this.observer = new ResizeObserver(this.handleResize.bind(this));
77
66
  }
78
- return _this;
79
67
  }
80
- _inherits(SkeletonSVG2, _Component2);
81
- return _createClass(SkeletonSVG2, [{
82
- key: "componentDidMount",
83
- value: function componentDidMount() {
84
- var _this$observer, _this$svgRef$current;
85
- (_this$observer = this.observer) === null || _this$observer === void 0 || _this$observer.observe((_this$svgRef$current = this.svgRef.current) === null || _this$svgRef$current === void 0 ? void 0 : _this$svgRef$current.parentElement);
86
- }
87
- }, {
88
- key: "componentWillUnmount",
89
- value: function componentWillUnmount() {
90
- var _this$observer2;
91
- (_this$observer2 = this.observer) === null || _this$observer2 === void 0 || _this$observer2.disconnect();
92
- }
93
- }, {
94
- key: "handleResize",
95
- value: function handleResize(data) {
96
- var target = data[0].target;
97
- var svg = this.svgRef.current;
98
- if (target && svg) {
99
- svg.setAttribute("width", "100%");
100
- }
101
- }
102
- }, {
103
- key: "setContext",
104
- value: function setContext() {
105
- var theme = this.asProps.theme;
106
- return {
107
- gradientUrl: MAP_COLOR_THEME[theme]
108
- };
68
+ componentDidMount() {
69
+ var _a, _b;
70
+ (_b = this.observer) == null ? void 0 : _b.observe((_a = this.svgRef.current) == null ? void 0 : _a.parentElement);
71
+ }
72
+ componentWillUnmount() {
73
+ var _a;
74
+ (_a = this.observer) == null ? void 0 : _a.disconnect();
75
+ }
76
+ handleResize(data) {
77
+ const target = data[0].target;
78
+ const svg = this.svgRef.current;
79
+ if (target && svg) {
80
+ svg.setAttribute("width", "100%");
109
81
  }
110
- }, {
111
- key: "render",
112
- value: function render() {
113
- var _ref2 = this.asProps, _ref4;
114
- var _this$asProps2 = this.asProps, Children = _this$asProps2.Children, styles = _this$asProps2.styles, uid = _this$asProps2.uid, theme = _this$asProps2.theme, duration = _this$asProps2.duration;
115
- var SSkeletonSVG = Skeleton;
116
- return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SSkeletonSVG, _ref4.cn("SSkeletonSVG", _objectSpread({}, assignProps({
82
+ }
83
+ setContext() {
84
+ const {
85
+ theme
86
+ } = this.asProps;
87
+ return {
88
+ gradientUrl: MAP_COLOR_THEME[theme]
89
+ };
90
+ }
91
+ render() {
92
+ var _ref2 = this.asProps, _ref4;
93
+ const {
94
+ Children,
95
+ styles,
96
+ uid,
97
+ theme,
98
+ duration
99
+ } = this.asProps;
100
+ const SSkeletonSVG = Skeleton;
101
+ return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SSkeletonSVG, _ref4.cn("SSkeletonSVG", {
102
+ ...assignProps({
117
103
  "tag": "svg",
118
104
  "ref": this.svgRef,
119
105
  "preserveAspectRatio": "none",
120
106
  "theme": theme,
121
- "durationAnim": "".concat(duration, "ms")
122
- }, _ref2))), /* @__PURE__ */ React.createElement("defs", _ref4.cn("defs", {}), /* @__PURE__ */ React.createElement("mask", _ref4.cn("mask", {
123
- "id": uid
124
- }), /* @__PURE__ */ React.createElement(Children, _ref4.cn("Children", {})))), /* @__PURE__ */ React.createElement("rect", _ref4.cn("rect", {
125
- "x": "0",
126
- "y": "0",
127
- "width": "100%",
128
- "height": "100%",
129
- "mask": "url(#".concat(uid, ")")
130
- })));
131
- }
132
- }]);
133
- })(Component);
107
+ "durationAnim": `${duration}ms`
108
+ }, _ref2)
109
+ }), /* @__PURE__ */ React.createElement("defs", _ref4.cn("defs", {}), /* @__PURE__ */ React.createElement("mask", _ref4.cn("mask", {
110
+ "id": uid
111
+ }), /* @__PURE__ */ React.createElement(Children, _ref4.cn("Children", {})))), /* @__PURE__ */ React.createElement("rect", _ref4.cn("rect", {
112
+ "x": "0",
113
+ "y": "0",
114
+ "width": "100%",
115
+ "height": "100%",
116
+ "mask": `url(#${uid})`
117
+ })));
118
+ }
119
+ }
134
120
  _defineProperty(SkeletonSVG, "displayName", "SkeletonSVG");
135
121
  _defineProperty(SkeletonSVG, "enhance", [uniqueIDEnhancement()]);
136
122
  _defineProperty(SkeletonSVG, "style", style);
@@ -139,33 +125,41 @@ _defineProperty(SkeletonSVG, "defaultProps", {
139
125
  duration: 2e3
140
126
  });
141
127
  function Text(props) {
142
- var SText = Box;
143
- var _props$y = props.y, y = _props$y === void 0 ? 0 : _props$y, _props$x = props.x, x = _props$x === void 0 ? 0 : _props$x, _props$amount = props.amount, amount = _props$amount === void 0 ? 1 : _props$amount, _props$width = props.width, width = _props$width === void 0 ? "100%" : _props$width, styles = props.styles, forwardRef = props.forwardRef, other = _objectWithoutProperties(props, _excluded);
144
- var amountLine = Number(amount);
145
- var renderRect = function renderRect2(props2) {
128
+ const SText = Box;
129
+ const {
130
+ y = 0,
131
+ x = 0,
132
+ amount = 1,
133
+ width = "100%",
134
+ styles,
135
+ forwardRef,
136
+ ...other
137
+ } = props;
138
+ const amountLine = Number(amount);
139
+ const renderRect = (props2) => {
146
140
  var _ref5;
147
- return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref5.cn("SText", _objectSpread({
141
+ return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref5.cn("SText", {
148
142
  "tag": "rect",
149
143
  "rx": "4",
150
144
  "ry": "4",
151
- "height": "8"
152
- }, props2)));
145
+ "height": "8",
146
+ ...props2
147
+ }));
153
148
  };
154
- return /* @__PURE__ */ React.createElement(React.Fragment, null, _toConsumableArray(Array(amountLine)).map(function(_el, index) {
155
- return renderRect(_objectSpread({
156
- key: index,
157
- y: y || 20 * index,
158
- x,
159
- ref: forwardRef,
160
- width
161
- }, other));
162
- }));
149
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, [...Array(amountLine)].map((_el, index) => renderRect({
150
+ key: index,
151
+ y: y || 20 * index,
152
+ x,
153
+ ref: forwardRef,
154
+ width,
155
+ ...other
156
+ })));
163
157
  }
164
- var Skeleton = createComponent(SkeletonRoot);
165
- const Skeleton$1 = createComponent(SkeletonSVG, {
158
+ const Skeleton = createComponent(SkeletonRoot);
159
+ const Skeleton_default = createComponent(SkeletonSVG, {
166
160
  Text
167
161
  });
168
162
  export {
169
163
  Skeleton,
170
- Skeleton$1 as default
164
+ Skeleton_default as default
171
165
  };
@@ -12,7 +12,7 @@ import sv from "./sv.json.mjs";
12
12
  import tr from "./tr.json.mjs";
13
13
  import vi from "./vi.json.mjs";
14
14
  import zh from "./zh.json.mjs";
15
- var localizedMessages = {
15
+ const localizedMessages = {
16
16
  de,
17
17
  en,
18
18
  es,
@@ -1,9 +1,7 @@
1
- import type { Intergalactic, UnknownProperties } from '@semcore/core';
1
+ import type { BoxProps } from '@semcore/base-components';
2
+ import type { Intergalactic } from '@semcore/core';
2
3
  import type { UniqueIDProps } from '@semcore/core/lib/utils/uniqueID';
3
- import type { BoxProps } from '@semcore/flex-box';
4
4
 
5
- /** @deprecated */
6
- export interface ISkeletonProps extends SkeletonProps, UnknownProperties {}
7
5
  export type SkeletonProps = BoxProps &
8
6
  UniqueIDProps & {
9
7
  /**
@@ -29,14 +27,10 @@ export type SkeletonProps = BoxProps &
29
27
  observeParentSize?: boolean;
30
28
  };
31
29
 
32
- /** @deprecated */
33
- export interface ISkeletonCtx extends SkeletonCtx, UnknownProperties {}
34
30
  export type SkeletonCtx = {
35
31
  gradientUrl: 'string';
36
32
  };
37
33
 
38
- /** @deprecated */
39
- export interface ISkeletonTextProps extends SkeletonTextProps, UnknownProperties {}
40
34
  export type SkeletonTextProps = BoxProps & {
41
35
  /**
42
36
  * Number of items to be returned
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/skeleton",
3
3
  "description": "Semrush Skeleton Component",
4
- "version": "16.0.11-prerelease.5",
4
+ "version": "17.0.0-prerelease.17",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "types": "lib/types/index.d.ts",
@@ -13,11 +13,8 @@
13
13
  "import": "./lib/esm/index.mjs",
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
- "dependencies": {
17
- "@semcore/flex-box": "16.0.11-prerelease.5"
18
- },
19
16
  "peerDependencies": {
20
- "@semcore/base-components": "^16.4.1-prerelease.5"
17
+ "@semcore/base-components": "^17.0.0-prerelease.17"
21
18
  },
22
19
  "repository": {
23
20
  "type": "git",
@@ -25,8 +22,9 @@
25
22
  "directory": "semcore/skeleton"
26
23
  },
27
24
  "devDependencies": {
28
- "@semcore/testing-utils": "1.0.0",
29
- "@semcore/core": "16.5.1-prerelease.5"
25
+ "@semcore/core": "17.0.0-prerelease.17",
26
+ "@semcore/base-components": "17.0.0-prerelease.17",
27
+ "@semcore/testing-utils": "1.0.0"
30
28
  },
31
29
  "scripts": {
32
30
  "build": "pnpm semcore-builder --source=js && pnpm vite build"