@snack-uikit/skeleton 0.6.11 → 1.0.1-preview-fe85442f.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.
@@ -22,14 +22,12 @@ const classnames_1 = __importDefault(require("classnames"));
22
22
  const hooks_1 = require("../../hooks");
23
23
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
24
24
  function Skeleton(_a) {
25
- var {
26
- width,
27
- height,
28
- className,
29
- borderRadius,
30
- loading,
31
- children
32
- } = _a,
25
+ var width = _a.width,
26
+ height = _a.height,
27
+ className = _a.className,
28
+ borderRadius = _a.borderRadius,
29
+ loading = _a.loading,
30
+ children = _a.children,
33
31
  restProps = __rest(_a, ["width", "height", "className", "borderRadius", "loading", "children"]);
34
32
  const isLoading = (0, hooks_1.useIsLoadingValue)(loading);
35
33
  if (isLoading) {
@@ -24,28 +24,28 @@ const hooks_1 = require("../../hooks");
24
24
  const Skeleton_1 = require("../Skeleton");
25
25
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
26
26
  function SkeletonText(_a) {
27
- var {
28
- width,
29
- className,
30
- rowClassName,
31
- lineClassName,
32
- children,
33
- loading,
34
- lines = 3,
35
- typography = 'body-m'
36
- } = _a,
27
+ var width = _a.width,
28
+ className = _a.className,
29
+ rowClassName = _a.rowClassName,
30
+ lineClassName = _a.lineClassName,
31
+ children = _a.children,
32
+ loading = _a.loading,
33
+ _a$lines = _a.lines,
34
+ lines = _a$lines === void 0 ? 3 : _a$lines,
35
+ _a$typography = _a.typography,
36
+ typography = _a$typography === void 0 ? 'body-m' : _a$typography,
37
37
  restProps = __rest(_a, ["width", "className", "rowClassName", "lineClassName", "children", "loading", "lines", "typography"]);
38
- const lineTestId = restProps['data-test-id'] ? `${restProps['data-test-id']}_line` : undefined;
38
+ const lineTestId = restProps['data-test-id'] ? "".concat(restProps['data-test-id'], "_line") : undefined;
39
39
  const rows = (0, react_1.useMemo)(() => Array(lines).fill(true).map((_, index) => (0, jsx_runtime_1.jsx)("div", {
40
40
  className: (0, classnames_1.default)(styles_module_scss_1.default.skeletonTextRow, rowClassName),
41
41
  style: {
42
- lineHeight: `var(--size-skeleton-text-line-height-${typography})`
42
+ lineHeight: "var(--size-skeleton-text-line-height-".concat(typography, ")")
43
43
  },
44
44
  children: (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, {
45
45
  "data-test-id": lineTestId,
46
46
  loading: true,
47
- height: `var(--size-skeleton-text-font-size-${typography})`,
48
- borderRadius: `var(--radius-skeleton-text-${typography})`,
47
+ height: "var(--size-skeleton-text-font-size-".concat(typography, ")"),
48
+ borderRadius: "var(--radius-skeleton-text-".concat(typography, ")"),
49
49
  className: (0, classnames_1.default)(styles_module_scss_1.default.skeletonTextLine, lineClassName)
50
50
  })
51
51
  }, index)), [lines, rowClassName, lineTestId, typography, lineClassName]);
@@ -8,11 +8,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const context_1 = require("../../context");
9
9
  const hooks_1 = require("../../hooks");
10
10
  function WithSkeleton(_ref) {
11
- let {
12
- children,
13
- skeleton,
14
- loading
15
- } = _ref;
11
+ let children = _ref.children,
12
+ skeleton = _ref.skeleton,
13
+ loading = _ref.loading;
16
14
  const isLoading = (0, hooks_1.useIsLoadingValue)(loading);
17
15
  if (isLoading) {
18
16
  return (0, jsx_runtime_1.jsx)(context_1.SkeletonContextProvider, {
@@ -9,10 +9,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
9
9
  const react_1 = require("react");
10
10
  exports.SkeletonContext = (0, react_1.createContext)(false);
11
11
  function SkeletonContextProvider(_ref) {
12
- let {
13
- loading,
14
- children
15
- } = _ref;
12
+ let loading = _ref.loading,
13
+ children = _ref.children;
16
14
  return (0, jsx_runtime_1.jsx)(exports.SkeletonContext.Provider, {
17
15
  value: loading,
18
16
  children: children
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Skeleton",
7
- "version": "0.6.11",
7
+ "version": "1.0.1-preview-fe85442f.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -34,10 +34,9 @@
34
34
  "./LICENSE"
35
35
  ],
36
36
  "license": "Apache-2.0",
37
- "scripts": {},
38
37
  "dependencies": {
39
- "@snack-uikit/utils": "4.0.2",
40
- "classnames": "2.5.1"
38
+ "classnames": "^2.5.1",
39
+ "@snack-uikit/utils": "4.0.3-preview-fe85442f.0"
41
40
  },
42
- "gitHead": "a9f6571146845d828e00206abdedb160980cff97"
43
- }
41
+ "scripts": {}
42
+ }