@cloud-ru/uikit-product-mobile-info-row 0.6.20 → 0.6.22

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 (72) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/components/AdaptiveInfoGroup/AdaptiveInfoGroup.d.ts +5 -0
  3. package/dist/cjs/components/AdaptiveInfoGroup/AdaptiveInfoGroup.js +21 -0
  4. package/dist/cjs/components/AdaptiveInfoGroup/index.d.ts +1 -0
  5. package/dist/cjs/components/AdaptiveInfoGroup/index.js +17 -0
  6. package/dist/cjs/components/AdaptiveInfoRow/AdaptiveInfoRow.d.ts +10 -0
  7. package/dist/cjs/components/AdaptiveInfoRow/AdaptiveInfoRow.js +35 -0
  8. package/dist/cjs/components/AdaptiveInfoRow/index.d.ts +1 -0
  9. package/dist/cjs/components/AdaptiveInfoRow/index.js +17 -0
  10. package/dist/cjs/components/MobileInfoGroup/MobileInfoGroup.d.ts +2 -0
  11. package/dist/cjs/components/MobileInfoGroup/MobileInfoGroup.js +26 -0
  12. package/dist/cjs/components/MobileInfoGroup/constants.d.ts +1 -0
  13. package/dist/cjs/components/MobileInfoGroup/constants.js +4 -0
  14. package/dist/cjs/components/MobileInfoGroup/index.d.ts +2 -0
  15. package/dist/cjs/components/MobileInfoGroup/index.js +5 -0
  16. package/dist/cjs/components/MobileInfoGroup/types.d.ts +19 -0
  17. package/dist/cjs/components/MobileInfoGroup/types.js +2 -0
  18. package/dist/cjs/components/MobileInfoGroup/utils/index.d.ts +1 -0
  19. package/dist/cjs/components/MobileInfoGroup/utils/index.js +17 -0
  20. package/dist/cjs/components/MobileInfoGroup/utils/typeGuards.d.ts +5 -0
  21. package/dist/cjs/components/MobileInfoGroup/utils/typeGuards.js +13 -0
  22. package/dist/cjs/components/MobileInfoGroup/utils/useGetContent.d.ts +4 -0
  23. package/dist/cjs/components/MobileInfoGroup/utils/useGetContent.js +34 -0
  24. package/dist/cjs/components/MobileInfoRow/MobileInfoRow.d.ts +27 -0
  25. package/dist/cjs/components/MobileInfoRow/MobileInfoRow.js +39 -0
  26. package/dist/cjs/components/MobileInfoRow/index.d.ts +1 -0
  27. package/dist/cjs/components/MobileInfoRow/index.js +6 -0
  28. package/dist/cjs/components/MobileInfoRow/styles.module.css +67 -0
  29. package/dist/cjs/components/index.d.ts +4 -0
  30. package/dist/cjs/components/index.js +20 -0
  31. package/dist/cjs/constants.d.ts +5 -0
  32. package/dist/cjs/constants.js +8 -0
  33. package/dist/cjs/index.d.ts +1 -0
  34. package/dist/cjs/index.js +17 -0
  35. package/dist/cjs/types.d.ts +3 -0
  36. package/dist/cjs/types.js +2 -0
  37. package/dist/esm/components/AdaptiveInfoGroup/AdaptiveInfoGroup.d.ts +5 -0
  38. package/dist/esm/components/AdaptiveInfoGroup/AdaptiveInfoGroup.js +18 -0
  39. package/dist/esm/components/AdaptiveInfoGroup/index.d.ts +1 -0
  40. package/dist/esm/components/AdaptiveInfoGroup/index.js +1 -0
  41. package/dist/esm/components/AdaptiveInfoRow/AdaptiveInfoRow.d.ts +10 -0
  42. package/dist/esm/components/AdaptiveInfoRow/AdaptiveInfoRow.js +31 -0
  43. package/dist/esm/components/AdaptiveInfoRow/index.d.ts +1 -0
  44. package/dist/esm/components/AdaptiveInfoRow/index.js +1 -0
  45. package/dist/esm/components/MobileInfoGroup/MobileInfoGroup.d.ts +2 -0
  46. package/dist/esm/components/MobileInfoGroup/MobileInfoGroup.js +23 -0
  47. package/dist/esm/components/MobileInfoGroup/constants.d.ts +1 -0
  48. package/dist/esm/components/MobileInfoGroup/constants.js +1 -0
  49. package/dist/esm/components/MobileInfoGroup/index.d.ts +2 -0
  50. package/dist/esm/components/MobileInfoGroup/index.js +1 -0
  51. package/dist/esm/components/MobileInfoGroup/types.d.ts +19 -0
  52. package/dist/esm/components/MobileInfoGroup/types.js +1 -0
  53. package/dist/esm/components/MobileInfoGroup/utils/index.d.ts +1 -0
  54. package/dist/esm/components/MobileInfoGroup/utils/index.js +1 -0
  55. package/dist/esm/components/MobileInfoGroup/utils/typeGuards.d.ts +5 -0
  56. package/dist/esm/components/MobileInfoGroup/utils/typeGuards.js +5 -0
  57. package/dist/esm/components/MobileInfoGroup/utils/useGetContent.d.ts +4 -0
  58. package/dist/esm/components/MobileInfoGroup/utils/useGetContent.js +31 -0
  59. package/dist/esm/components/MobileInfoRow/MobileInfoRow.d.ts +27 -0
  60. package/dist/esm/components/MobileInfoRow/MobileInfoRow.js +32 -0
  61. package/dist/esm/components/MobileInfoRow/index.d.ts +1 -0
  62. package/dist/esm/components/MobileInfoRow/index.js +1 -0
  63. package/dist/esm/components/MobileInfoRow/styles.module.css +67 -0
  64. package/dist/esm/components/index.d.ts +4 -0
  65. package/dist/esm/components/index.js +4 -0
  66. package/dist/esm/constants.d.ts +5 -0
  67. package/dist/esm/constants.js +5 -0
  68. package/dist/esm/index.d.ts +1 -0
  69. package/dist/esm/index.js +1 -0
  70. package/dist/esm/types.d.ts +3 -0
  71. package/dist/esm/types.js +1 -0
  72. package/package.json +6 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 0.6.22 (2025-11-13)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@cloud-ru/uikit-product-info-row@0.8.26](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/info-row/CHANGELOG.md)
10
+ * [@cloud-ru/uikit-product-mobile-tooltip@0.4.67](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-tooltip/CHANGELOG.md)
11
+ * [@cloud-ru/uikit-product-utils@7.0.2](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/utils/CHANGELOG.md)
12
+
13
+
14
+
15
+
16
+
17
+ ## 0.6.21 (2025-11-12)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **PD-3377:** contributors update to publish all packages ([719fd3e](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/719fd3e1249e247443b125c47ea408d92c8395c3))
23
+
24
+
25
+
26
+
27
+
6
28
  ## 0.6.20 (2025-11-12)
7
29
 
8
30
  ### Only dependencies have been changed
@@ -0,0 +1,5 @@
1
+ import { InfoGroupProps } from '@sbercloud/uikit-product-info-row';
2
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
3
+ import { DataType } from '../MobileInfoGroup/types';
4
+ export type AdaptiveInfoGroupProps<T extends DataType> = WithLayoutType<InfoGroupProps<T>>;
5
+ export declare function AdaptiveInfoGroup<T extends DataType>({ layoutType, ...props }: AdaptiveInfoGroupProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.AdaptiveInfoGroup = AdaptiveInfoGroup;
15
+ const jsx_runtime_1 = require("react/jsx-runtime");
16
+ const uikit_product_info_row_1 = require("@sbercloud/uikit-product-info-row");
17
+ const MobileInfoGroup_1 = require("../MobileInfoGroup");
18
+ function AdaptiveInfoGroup(_a) {
19
+ var { layoutType } = _a, props = __rest(_a, ["layoutType"]);
20
+ return layoutType === 'mobile' ? (0, jsx_runtime_1.jsx)(MobileInfoGroup_1.MobileInfoGroup, Object.assign({}, props)) : (0, jsx_runtime_1.jsx)(uikit_product_info_row_1.InfoGroup, Object.assign({}, props));
21
+ }
@@ -0,0 +1 @@
1
+ export * from './AdaptiveInfoGroup';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AdaptiveInfoGroup"), exports);
@@ -0,0 +1,10 @@
1
+ import { InfoRowProps } from '@sbercloud/uikit-product-info-row';
2
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
3
+ import { MobileInfoRowProps } from '../MobileInfoRow';
4
+ export type AdaptiveInfoRowProps = WithLayoutType<InfoRowProps & Pick<MobileInfoRowProps, 'position'>>;
5
+ export declare function AdaptiveInfoRow({ layoutType, position, ...props }: AdaptiveInfoRowProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function getPosition({ index, length }: {
7
+ index: number;
8
+ length: number;
9
+ }): MobileInfoRowProps['position'];
10
+ export type { InfoRowProps };
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.AdaptiveInfoRow = AdaptiveInfoRow;
15
+ exports.getPosition = getPosition;
16
+ const jsx_runtime_1 = require("react/jsx-runtime");
17
+ const uikit_product_info_row_1 = require("@sbercloud/uikit-product-info-row");
18
+ const MobileInfoRow_1 = require("../MobileInfoRow");
19
+ function AdaptiveInfoRow(_a) {
20
+ var { layoutType, position } = _a, props = __rest(_a, ["layoutType", "position"]);
21
+ const isMobile = layoutType === 'mobile';
22
+ return isMobile ? (0, jsx_runtime_1.jsx)(MobileInfoRow_1.MobileInfoRow, Object.assign({ position: position }, props)) : (0, jsx_runtime_1.jsx)(uikit_product_info_row_1.InfoRow, Object.assign({}, props));
23
+ }
24
+ function getPosition({ index, length }) {
25
+ if (length < 2) {
26
+ return 'inner';
27
+ }
28
+ if (index === 0) {
29
+ return 'first';
30
+ }
31
+ if (index === length - 1) {
32
+ return 'last';
33
+ }
34
+ return 'inner';
35
+ }
@@ -0,0 +1 @@
1
+ export * from './AdaptiveInfoRow';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AdaptiveInfoRow"), exports);
@@ -0,0 +1,2 @@
1
+ import { DataType, MobileInfoGroupProps } from './types';
2
+ export declare function MobileInfoGroup<T extends DataType>({ data, items, className, loading }: MobileInfoGroupProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.MobileInfoGroup = MobileInfoGroup;
15
+ const jsx_runtime_1 = require("react/jsx-runtime");
16
+ const MobileInfoRow_1 = require("../MobileInfoRow");
17
+ const utils_1 = require("./utils");
18
+ function MobileInfoGroup({ data, items, className, loading }) {
19
+ const getContent = (0, utils_1.useGetContent)();
20
+ return ((0, jsx_runtime_1.jsx)("div", { className: className, children: items.map((_a, index) => {
21
+ var _b;
22
+ var { label, accessorKey, render } = _a, rest = __rest(_a, ["label", "accessorKey", "render"]);
23
+ const content = getContent({ data, render, accessorKey });
24
+ return ((0, jsx_runtime_1.jsx)(MobileInfoRow_1.MobileInfoRow, Object.assign({ label: label, content: content, topDivider: index === 0, bottomDivider: true, loading: loading }, rest), (_b = accessorKey) !== null && _b !== void 0 ? _b : label));
25
+ }) }));
26
+ }
@@ -0,0 +1 @@
1
+ export declare const NO_DATA_PLACEHOLDER = "\u2014";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NO_DATA_PLACEHOLDER = void 0;
4
+ exports.NO_DATA_PLACEHOLDER = '—';
@@ -0,0 +1,2 @@
1
+ export { MobileInfoGroup } from './MobileInfoGroup';
2
+ export { type MobileInfoGroupProps, type MobileInfoGroupItem } from './types';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MobileInfoGroup = void 0;
4
+ var MobileInfoGroup_1 = require("./MobileInfoGroup");
5
+ Object.defineProperty(exports, "MobileInfoGroup", { enumerable: true, get: function () { return MobileInfoGroup_1.MobileInfoGroup; } });
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ import { MobileInfoRowPropsBase } from '../MobileInfoRow/MobileInfoRow';
3
+ export type DataType = Record<string, unknown>;
4
+ type PropsWithAccessorKey<T extends DataType> = {
5
+ accessorKey: keyof T;
6
+ render?: never;
7
+ } & Omit<MobileInfoRowPropsBase, 'content'>;
8
+ type PropsWithRender<T extends DataType> = {
9
+ render: (data: T, noDataPlaceholder: string) => ReactNode;
10
+ accessorKey?: never;
11
+ } & Omit<MobileInfoRowPropsBase, 'content'>;
12
+ export type MobileInfoGroupItem<T extends DataType> = PropsWithRender<T> | PropsWithAccessorKey<T>;
13
+ export type MobileInfoGroupProps<T extends DataType> = {
14
+ data: T | undefined;
15
+ items: MobileInfoGroupItem<T>[];
16
+ className?: string;
17
+ loading?: boolean;
18
+ };
19
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './useGetContent';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useGetContent"), exports);
@@ -0,0 +1,5 @@
1
+ export declare const isNil: (value: unknown) => value is undefined | null;
2
+ export declare const isBoolean: (value: unknown) => value is boolean;
3
+ export declare const isString: (value: unknown) => value is string;
4
+ export declare const isArray: <T>(value: unknown) => value is Array<T>;
5
+ export declare const isObject: (value: unknown) => value is object;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isObject = exports.isArray = exports.isString = exports.isBoolean = exports.isNil = void 0;
4
+ const isNil = (value) => value === undefined || value === null;
5
+ exports.isNil = isNil;
6
+ const isBoolean = (value) => typeof value === 'boolean';
7
+ exports.isBoolean = isBoolean;
8
+ const isString = (value) => typeof value === 'string';
9
+ exports.isString = isString;
10
+ const isArray = (value) => Array.isArray(value);
11
+ exports.isArray = isArray;
12
+ const isObject = (value) => typeof value === 'object' && !(0, exports.isArray)(value);
13
+ exports.isObject = isObject;
@@ -0,0 +1,4 @@
1
+ import { DataType, MobileInfoGroupItem, MobileInfoGroupProps } from '../types';
2
+ type Props<T extends DataType> = Pick<MobileInfoGroupProps<T>, 'data'> & Pick<MobileInfoGroupItem<T>, 'accessorKey' | 'render'>;
3
+ export declare function useGetContent(): <T extends DataType>({ data, accessorKey, render }: Props<T>) => import("react").ReactNode;
4
+ export {};
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useGetContent = useGetContent;
4
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
5
+ const constants_1 = require("../constants");
6
+ const typeGuards_1 = require("./typeGuards");
7
+ function useGetContent() {
8
+ const { t } = (0, uikit_product_locale_1.useLocale)('InfoRow');
9
+ return function getContent({ data, accessorKey, render }) {
10
+ if (!data) {
11
+ return constants_1.NO_DATA_PLACEHOLDER;
12
+ }
13
+ const value = accessorKey ? data[accessorKey] : undefined;
14
+ if (!(0, typeGuards_1.isNil)(value)) {
15
+ if ((0, typeGuards_1.isBoolean)(value)) {
16
+ return value ? t('booleanValueTrue') : t('booleanValueFalse');
17
+ }
18
+ if ((0, typeGuards_1.isString)(value)) {
19
+ return value ? value : constants_1.NO_DATA_PLACEHOLDER;
20
+ }
21
+ if ((0, typeGuards_1.isArray)(value)) {
22
+ return value.length ? value.join(', ') : constants_1.NO_DATA_PLACEHOLDER;
23
+ }
24
+ if ((0, typeGuards_1.isObject)(value)) {
25
+ return Object.keys(value).length ? JSON.stringify(value) : constants_1.NO_DATA_PLACEHOLDER;
26
+ }
27
+ return String(value);
28
+ }
29
+ if (render) {
30
+ return render(data, constants_1.NO_DATA_PLACEHOLDER);
31
+ }
32
+ return constants_1.NO_DATA_PLACEHOLDER;
33
+ };
34
+ }
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from 'react';
2
+ import { MobileQuestionTooltipProps, MobileTooltipProps } from '@sbercloud/uikit-product-mobile-tooltip';
3
+ import { WithSupportProps } from '@sbercloud/uikit-product-utils';
4
+ import { ButtonTonalProps } from '@snack-uikit/button';
5
+ import { Position } from '../../types';
6
+ type RowActionButton = {
7
+ tip?: Pick<MobileTooltipProps, 'trigger' | 'tip' | 'placement' | 'disableMaxWidth' | 'open' | 'onOpenChange'> | string;
8
+ } & Omit<ButtonTonalProps, 'size' | 'appearance' | 'label'>;
9
+ export type MobileInfoRowPropsBase = {
10
+ position?: Position;
11
+ label: string;
12
+ labelTruncate?: number;
13
+ labelTooltip?: Pick<MobileQuestionTooltipProps, 'trigger' | 'tip' | 'placement' | 'disableMaxWidth' | 'open' | 'onOpenChange'> | string;
14
+ topDivider?: boolean;
15
+ bottomDivider?: boolean;
16
+ className?: string;
17
+ content?: ReactNode;
18
+ rowActions?: {
19
+ first: RowActionButton;
20
+ second?: RowActionButton;
21
+ };
22
+ loading?: boolean;
23
+ };
24
+ export type MobileInfoRowProps = WithSupportProps<MobileInfoRowPropsBase>;
25
+ export declare function withTip(children: ReactNode, tip?: MobileTooltipProps | string): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
26
+ export declare function MobileInfoRow({ label, topDivider, bottomDivider, className, labelTooltip, content, rowActions, loading, position, ...rest }: MobileInfoRowProps): import("react/jsx-runtime").JSX.Element;
27
+ export {};
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.withTip = withTip;
18
+ exports.MobileInfoRow = MobileInfoRow;
19
+ const jsx_runtime_1 = require("react/jsx-runtime");
20
+ const classnames_1 = __importDefault(require("classnames"));
21
+ const uikit_product_mobile_tooltip_1 = require("@sbercloud/uikit-product-mobile-tooltip");
22
+ const uikit_product_utils_1 = require("@sbercloud/uikit-product-utils");
23
+ const button_1 = require("@snack-uikit/button");
24
+ const divider_1 = require("@snack-uikit/divider");
25
+ const skeleton_1 = require("@snack-uikit/skeleton");
26
+ const constants_1 = require("../../constants");
27
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
28
+ function withTip(children, tip) {
29
+ if (!tip) {
30
+ return children;
31
+ }
32
+ return typeof tip === 'string' ? ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.MobileTooltip, { tip: tip, children: children })) : ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.MobileTooltip, Object.assign({}, tip, { children: children })));
33
+ }
34
+ function MobileInfoRow(_a) {
35
+ var { label, topDivider = true, bottomDivider = true, className, labelTooltip, content, rowActions, loading = false, position = constants_1.POSITION.Inner } = _a, rest = __rest(_a, ["label", "topDivider", "bottomDivider", "className", "labelTooltip", "content", "rowActions", "loading", "position"]);
36
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, (0, uikit_product_utils_1.extractSupportProps)(rest), { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className), children: [topDivider && position !== constants_1.POSITION.First && (0, jsx_runtime_1.jsx)(divider_1.Divider, { weight: 'regular' }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.infoRow, "data-position": position, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.labelLayout, children: [label, labelTooltip &&
37
+ (typeof labelTooltip === 'string' ? ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.MobileQuestionTooltip, { tip: labelTooltip, size: 'xs', placement: 'top', trigger: 'hover', tabIndex: -1 })) : ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.MobileQuestionTooltip, Object.assign({}, labelTooltip, { size: 'xs' }))))] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.contentLayout, children: [(0, jsx_runtime_1.jsx)(skeleton_1.SkeletonContextProvider, { loading: loading, children: (0, jsx_runtime_1.jsx)(skeleton_1.WithSkeleton, { skeleton: (0, jsx_runtime_1.jsx)(skeleton_1.SkeletonText, { width: '100%', lines: 1 }), children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.content, children: content }) }) }), rowActions && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.rowActions, children: [withTip((0, jsx_runtime_1.jsx)(button_1.ButtonTonal, Object.assign({}, rowActions.first, { disabled: loading || rowActions.first.disabled, appearance: 'neutral', size: 's' })), rowActions.first.tip), rowActions.second &&
38
+ withTip((0, jsx_runtime_1.jsx)(button_1.ButtonTonal, Object.assign({}, rowActions.second, { disabled: loading || rowActions.second.disabled, appearance: 'neutral', size: 's' })), rowActions.second.tip)] }))] })] }), bottomDivider && position !== constants_1.POSITION.Last && (0, jsx_runtime_1.jsx)(divider_1.Divider, { weight: 'regular' })] })));
39
+ }
@@ -0,0 +1 @@
1
+ export { MobileInfoRow, type MobileInfoRowProps, withTip } from './MobileInfoRow';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withTip = exports.MobileInfoRow = void 0;
4
+ var MobileInfoRow_1 = require("./MobileInfoRow");
5
+ Object.defineProperty(exports, "MobileInfoRow", { enumerable: true, get: function () { return MobileInfoRow_1.MobileInfoRow; } });
6
+ Object.defineProperty(exports, "withTip", { enumerable: true, get: function () { return MobileInfoRow_1.withTip; } });
@@ -0,0 +1,67 @@
1
+ .wrapper{
2
+ width:100%;
3
+ }
4
+
5
+ .infoRow{
6
+ display:flex;
7
+ flex-direction:column;
8
+ gap:var(--dimension-050m, 4px);
9
+ width:100%;
10
+ }
11
+ .infoRow[data-position=inner]{
12
+ padding:var(--dimension-2m, 16px) 0;
13
+ }
14
+ .infoRow[data-position=first]{
15
+ padding-bottom:var(--dimension-2m, 16px);
16
+ }
17
+ .infoRow[data-position=last]{
18
+ padding-top:var(--dimension-2m, 16px);
19
+ }
20
+
21
+ .labelLayout{
22
+ font-family:var(--light-label-l-font-family, SB Sans Interface);
23
+ font-weight:var(--light-label-l-font-weight, Regular);
24
+ line-height:var(--light-label-l-line-height, 20px);
25
+ font-size:var(--light-label-l-font-size, 14px);
26
+ letter-spacing:var(--light-label-l-letter-spacing, 0px);
27
+ paragraph-spacing:var(--light-label-l-paragraph-spacing, 7.7px);
28
+ position:relative;
29
+ color:var(--sys-neutral-text-light, #8b8e9b);
30
+ display:flex;
31
+ gap:var(--dimension-050m, 4px);
32
+ align-items:center;
33
+ justify-content:flex-start;
34
+ height:100%;
35
+ }
36
+
37
+ .contentLayout{
38
+ position:relative;
39
+ display:flex;
40
+ flex-direction:column;
41
+ flex:1;
42
+ gap:var(--dimension-2m, 16px);
43
+ }
44
+
45
+ .content{
46
+ font-family:var(--sans-body-m-font-family, SB Sans Interface);
47
+ font-weight:var(--sans-body-m-font-weight, Regular);
48
+ line-height:var(--sans-body-m-line-height, 20px);
49
+ font-size:var(--sans-body-m-font-size, 14px);
50
+ letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
51
+ paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
52
+ position:relative;
53
+ min-width:0;
54
+ color:var(--sys-neutral-text-main, #41424e);
55
+ display:flex;
56
+ height:100%;
57
+ flex:1;
58
+ justify-content:flex-start;
59
+ align-items:flex-start;
60
+ word-break:break-word;
61
+ }
62
+
63
+ .rowActions{
64
+ display:flex;
65
+ align-items:center;
66
+ gap:var(--dimension-1m, 8px);
67
+ }
@@ -0,0 +1,4 @@
1
+ export * from './AdaptiveInfoRow';
2
+ export * from './AdaptiveInfoGroup';
3
+ export * from './MobileInfoRow';
4
+ export * from './MobileInfoGroup';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AdaptiveInfoRow"), exports);
18
+ __exportStar(require("./AdaptiveInfoGroup"), exports);
19
+ __exportStar(require("./MobileInfoRow"), exports);
20
+ __exportStar(require("./MobileInfoGroup"), exports);
@@ -0,0 +1,5 @@
1
+ export declare const POSITION: {
2
+ readonly Inner: "inner";
3
+ readonly First: "first";
4
+ readonly Last: "last";
5
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.POSITION = void 0;
4
+ exports.POSITION = {
5
+ Inner: 'inner',
6
+ First: 'first',
7
+ Last: 'last',
8
+ };
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./components"), exports);
@@ -0,0 +1,3 @@
1
+ import { ValueOf } from '@snack-uikit/utils';
2
+ import { POSITION } from './constants';
3
+ export type Position = ValueOf<typeof POSITION>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { InfoGroupProps } from '@sbercloud/uikit-product-info-row';
2
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
3
+ import { DataType } from '../MobileInfoGroup/types';
4
+ export type AdaptiveInfoGroupProps<T extends DataType> = WithLayoutType<InfoGroupProps<T>>;
5
+ export declare function AdaptiveInfoGroup<T extends DataType>({ layoutType, ...props }: AdaptiveInfoGroupProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { InfoGroup } from '@sbercloud/uikit-product-info-row';
14
+ import { MobileInfoGroup } from '../MobileInfoGroup';
15
+ export function AdaptiveInfoGroup(_a) {
16
+ var { layoutType } = _a, props = __rest(_a, ["layoutType"]);
17
+ return layoutType === 'mobile' ? _jsx(MobileInfoGroup, Object.assign({}, props)) : _jsx(InfoGroup, Object.assign({}, props));
18
+ }
@@ -0,0 +1 @@
1
+ export * from './AdaptiveInfoGroup';
@@ -0,0 +1 @@
1
+ export * from './AdaptiveInfoGroup';
@@ -0,0 +1,10 @@
1
+ import { InfoRowProps } from '@sbercloud/uikit-product-info-row';
2
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
3
+ import { MobileInfoRowProps } from '../MobileInfoRow';
4
+ export type AdaptiveInfoRowProps = WithLayoutType<InfoRowProps & Pick<MobileInfoRowProps, 'position'>>;
5
+ export declare function AdaptiveInfoRow({ layoutType, position, ...props }: AdaptiveInfoRowProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function getPosition({ index, length }: {
7
+ index: number;
8
+ length: number;
9
+ }): MobileInfoRowProps['position'];
10
+ export type { InfoRowProps };
@@ -0,0 +1,31 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { InfoRow } from '@sbercloud/uikit-product-info-row';
14
+ import { MobileInfoRow } from '../MobileInfoRow';
15
+ export function AdaptiveInfoRow(_a) {
16
+ var { layoutType, position } = _a, props = __rest(_a, ["layoutType", "position"]);
17
+ const isMobile = layoutType === 'mobile';
18
+ return isMobile ? _jsx(MobileInfoRow, Object.assign({ position: position }, props)) : _jsx(InfoRow, Object.assign({}, props));
19
+ }
20
+ export function getPosition({ index, length }) {
21
+ if (length < 2) {
22
+ return 'inner';
23
+ }
24
+ if (index === 0) {
25
+ return 'first';
26
+ }
27
+ if (index === length - 1) {
28
+ return 'last';
29
+ }
30
+ return 'inner';
31
+ }
@@ -0,0 +1 @@
1
+ export * from './AdaptiveInfoRow';
@@ -0,0 +1 @@
1
+ export * from './AdaptiveInfoRow';
@@ -0,0 +1,2 @@
1
+ import { DataType, MobileInfoGroupProps } from './types';
2
+ export declare function MobileInfoGroup<T extends DataType>({ data, items, className, loading }: MobileInfoGroupProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { MobileInfoRow } from '../MobileInfoRow';
14
+ import { useGetContent } from './utils';
15
+ export function MobileInfoGroup({ data, items, className, loading }) {
16
+ const getContent = useGetContent();
17
+ return (_jsx("div", { className: className, children: items.map((_a, index) => {
18
+ var _b;
19
+ var { label, accessorKey, render } = _a, rest = __rest(_a, ["label", "accessorKey", "render"]);
20
+ const content = getContent({ data, render, accessorKey });
21
+ return (_jsx(MobileInfoRow, Object.assign({ label: label, content: content, topDivider: index === 0, bottomDivider: true, loading: loading }, rest), (_b = accessorKey) !== null && _b !== void 0 ? _b : label));
22
+ }) }));
23
+ }
@@ -0,0 +1 @@
1
+ export declare const NO_DATA_PLACEHOLDER = "\u2014";
@@ -0,0 +1 @@
1
+ export const NO_DATA_PLACEHOLDER = '—';
@@ -0,0 +1,2 @@
1
+ export { MobileInfoGroup } from './MobileInfoGroup';
2
+ export { type MobileInfoGroupProps, type MobileInfoGroupItem } from './types';
@@ -0,0 +1 @@
1
+ export { MobileInfoGroup } from './MobileInfoGroup';
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ import { MobileInfoRowPropsBase } from '../MobileInfoRow/MobileInfoRow';
3
+ export type DataType = Record<string, unknown>;
4
+ type PropsWithAccessorKey<T extends DataType> = {
5
+ accessorKey: keyof T;
6
+ render?: never;
7
+ } & Omit<MobileInfoRowPropsBase, 'content'>;
8
+ type PropsWithRender<T extends DataType> = {
9
+ render: (data: T, noDataPlaceholder: string) => ReactNode;
10
+ accessorKey?: never;
11
+ } & Omit<MobileInfoRowPropsBase, 'content'>;
12
+ export type MobileInfoGroupItem<T extends DataType> = PropsWithRender<T> | PropsWithAccessorKey<T>;
13
+ export type MobileInfoGroupProps<T extends DataType> = {
14
+ data: T | undefined;
15
+ items: MobileInfoGroupItem<T>[];
16
+ className?: string;
17
+ loading?: boolean;
18
+ };
19
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './useGetContent';
@@ -0,0 +1 @@
1
+ export * from './useGetContent';
@@ -0,0 +1,5 @@
1
+ export declare const isNil: (value: unknown) => value is undefined | null;
2
+ export declare const isBoolean: (value: unknown) => value is boolean;
3
+ export declare const isString: (value: unknown) => value is string;
4
+ export declare const isArray: <T>(value: unknown) => value is Array<T>;
5
+ export declare const isObject: (value: unknown) => value is object;
@@ -0,0 +1,5 @@
1
+ export const isNil = (value) => value === undefined || value === null;
2
+ export const isBoolean = (value) => typeof value === 'boolean';
3
+ export const isString = (value) => typeof value === 'string';
4
+ export const isArray = (value) => Array.isArray(value);
5
+ export const isObject = (value) => typeof value === 'object' && !isArray(value);
@@ -0,0 +1,4 @@
1
+ import { DataType, MobileInfoGroupItem, MobileInfoGroupProps } from '../types';
2
+ type Props<T extends DataType> = Pick<MobileInfoGroupProps<T>, 'data'> & Pick<MobileInfoGroupItem<T>, 'accessorKey' | 'render'>;
3
+ export declare function useGetContent(): <T extends DataType>({ data, accessorKey, render }: Props<T>) => import("react").ReactNode;
4
+ export {};
@@ -0,0 +1,31 @@
1
+ import { useLocale } from '@sbercloud/uikit-product-locale';
2
+ import { NO_DATA_PLACEHOLDER } from '../constants';
3
+ import { isArray, isBoolean, isNil, isObject, isString } from './typeGuards';
4
+ export function useGetContent() {
5
+ const { t } = useLocale('InfoRow');
6
+ return function getContent({ data, accessorKey, render }) {
7
+ if (!data) {
8
+ return NO_DATA_PLACEHOLDER;
9
+ }
10
+ const value = accessorKey ? data[accessorKey] : undefined;
11
+ if (!isNil(value)) {
12
+ if (isBoolean(value)) {
13
+ return value ? t('booleanValueTrue') : t('booleanValueFalse');
14
+ }
15
+ if (isString(value)) {
16
+ return value ? value : NO_DATA_PLACEHOLDER;
17
+ }
18
+ if (isArray(value)) {
19
+ return value.length ? value.join(', ') : NO_DATA_PLACEHOLDER;
20
+ }
21
+ if (isObject(value)) {
22
+ return Object.keys(value).length ? JSON.stringify(value) : NO_DATA_PLACEHOLDER;
23
+ }
24
+ return String(value);
25
+ }
26
+ if (render) {
27
+ return render(data, NO_DATA_PLACEHOLDER);
28
+ }
29
+ return NO_DATA_PLACEHOLDER;
30
+ };
31
+ }
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from 'react';
2
+ import { MobileQuestionTooltipProps, MobileTooltipProps } from '@sbercloud/uikit-product-mobile-tooltip';
3
+ import { WithSupportProps } from '@sbercloud/uikit-product-utils';
4
+ import { ButtonTonalProps } from '@snack-uikit/button';
5
+ import { Position } from '../../types';
6
+ type RowActionButton = {
7
+ tip?: Pick<MobileTooltipProps, 'trigger' | 'tip' | 'placement' | 'disableMaxWidth' | 'open' | 'onOpenChange'> | string;
8
+ } & Omit<ButtonTonalProps, 'size' | 'appearance' | 'label'>;
9
+ export type MobileInfoRowPropsBase = {
10
+ position?: Position;
11
+ label: string;
12
+ labelTruncate?: number;
13
+ labelTooltip?: Pick<MobileQuestionTooltipProps, 'trigger' | 'tip' | 'placement' | 'disableMaxWidth' | 'open' | 'onOpenChange'> | string;
14
+ topDivider?: boolean;
15
+ bottomDivider?: boolean;
16
+ className?: string;
17
+ content?: ReactNode;
18
+ rowActions?: {
19
+ first: RowActionButton;
20
+ second?: RowActionButton;
21
+ };
22
+ loading?: boolean;
23
+ };
24
+ export type MobileInfoRowProps = WithSupportProps<MobileInfoRowPropsBase>;
25
+ export declare function withTip(children: ReactNode, tip?: MobileTooltipProps | string): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
26
+ export declare function MobileInfoRow({ label, topDivider, bottomDivider, className, labelTooltip, content, rowActions, loading, position, ...rest }: MobileInfoRowProps): import("react/jsx-runtime").JSX.Element;
27
+ export {};
@@ -0,0 +1,32 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import cn from 'classnames';
14
+ import { MobileQuestionTooltip, MobileTooltip, } from '@sbercloud/uikit-product-mobile-tooltip';
15
+ import { extractSupportProps } from '@sbercloud/uikit-product-utils';
16
+ import { ButtonTonal } from '@snack-uikit/button';
17
+ import { Divider } from '@snack-uikit/divider';
18
+ import { SkeletonContextProvider, SkeletonText, WithSkeleton } from '@snack-uikit/skeleton';
19
+ import { POSITION } from '../../constants';
20
+ import styles from './styles.module.css';
21
+ export function withTip(children, tip) {
22
+ if (!tip) {
23
+ return children;
24
+ }
25
+ return typeof tip === 'string' ? (_jsx(MobileTooltip, { tip: tip, children: children })) : (_jsx(MobileTooltip, Object.assign({}, tip, { children: children })));
26
+ }
27
+ export function MobileInfoRow(_a) {
28
+ var { label, topDivider = true, bottomDivider = true, className, labelTooltip, content, rowActions, loading = false, position = POSITION.Inner } = _a, rest = __rest(_a, ["label", "topDivider", "bottomDivider", "className", "labelTooltip", "content", "rowActions", "loading", "position"]);
29
+ return (_jsxs("div", Object.assign({}, extractSupportProps(rest), { className: cn(styles.wrapper, className), children: [topDivider && position !== POSITION.First && _jsx(Divider, { weight: 'regular' }), _jsxs("div", { className: styles.infoRow, "data-position": position, children: [_jsxs("div", { className: styles.labelLayout, children: [label, labelTooltip &&
30
+ (typeof labelTooltip === 'string' ? (_jsx(MobileQuestionTooltip, { tip: labelTooltip, size: 'xs', placement: 'top', trigger: 'hover', tabIndex: -1 })) : (_jsx(MobileQuestionTooltip, Object.assign({}, labelTooltip, { size: 'xs' }))))] }), _jsxs("div", { className: styles.contentLayout, children: [_jsx(SkeletonContextProvider, { loading: loading, children: _jsx(WithSkeleton, { skeleton: _jsx(SkeletonText, { width: '100%', lines: 1 }), children: _jsx("div", { className: styles.content, children: content }) }) }), rowActions && (_jsxs("div", { className: styles.rowActions, children: [withTip(_jsx(ButtonTonal, Object.assign({}, rowActions.first, { disabled: loading || rowActions.first.disabled, appearance: 'neutral', size: 's' })), rowActions.first.tip), rowActions.second &&
31
+ withTip(_jsx(ButtonTonal, Object.assign({}, rowActions.second, { disabled: loading || rowActions.second.disabled, appearance: 'neutral', size: 's' })), rowActions.second.tip)] }))] })] }), bottomDivider && position !== POSITION.Last && _jsx(Divider, { weight: 'regular' })] })));
32
+ }
@@ -0,0 +1 @@
1
+ export { MobileInfoRow, type MobileInfoRowProps, withTip } from './MobileInfoRow';
@@ -0,0 +1 @@
1
+ export { MobileInfoRow, withTip } from './MobileInfoRow';
@@ -0,0 +1,67 @@
1
+ .wrapper{
2
+ width:100%;
3
+ }
4
+
5
+ .infoRow{
6
+ display:flex;
7
+ flex-direction:column;
8
+ gap:var(--dimension-050m, 4px);
9
+ width:100%;
10
+ }
11
+ .infoRow[data-position=inner]{
12
+ padding:var(--dimension-2m, 16px) 0;
13
+ }
14
+ .infoRow[data-position=first]{
15
+ padding-bottom:var(--dimension-2m, 16px);
16
+ }
17
+ .infoRow[data-position=last]{
18
+ padding-top:var(--dimension-2m, 16px);
19
+ }
20
+
21
+ .labelLayout{
22
+ font-family:var(--light-label-l-font-family, SB Sans Interface);
23
+ font-weight:var(--light-label-l-font-weight, Regular);
24
+ line-height:var(--light-label-l-line-height, 20px);
25
+ font-size:var(--light-label-l-font-size, 14px);
26
+ letter-spacing:var(--light-label-l-letter-spacing, 0px);
27
+ paragraph-spacing:var(--light-label-l-paragraph-spacing, 7.7px);
28
+ position:relative;
29
+ color:var(--sys-neutral-text-light, #8b8e9b);
30
+ display:flex;
31
+ gap:var(--dimension-050m, 4px);
32
+ align-items:center;
33
+ justify-content:flex-start;
34
+ height:100%;
35
+ }
36
+
37
+ .contentLayout{
38
+ position:relative;
39
+ display:flex;
40
+ flex-direction:column;
41
+ flex:1;
42
+ gap:var(--dimension-2m, 16px);
43
+ }
44
+
45
+ .content{
46
+ font-family:var(--sans-body-m-font-family, SB Sans Interface);
47
+ font-weight:var(--sans-body-m-font-weight, Regular);
48
+ line-height:var(--sans-body-m-line-height, 20px);
49
+ font-size:var(--sans-body-m-font-size, 14px);
50
+ letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
51
+ paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
52
+ position:relative;
53
+ min-width:0;
54
+ color:var(--sys-neutral-text-main, #41424e);
55
+ display:flex;
56
+ height:100%;
57
+ flex:1;
58
+ justify-content:flex-start;
59
+ align-items:flex-start;
60
+ word-break:break-word;
61
+ }
62
+
63
+ .rowActions{
64
+ display:flex;
65
+ align-items:center;
66
+ gap:var(--dimension-1m, 8px);
67
+ }
@@ -0,0 +1,4 @@
1
+ export * from './AdaptiveInfoRow';
2
+ export * from './AdaptiveInfoGroup';
3
+ export * from './MobileInfoRow';
4
+ export * from './MobileInfoGroup';
@@ -0,0 +1,4 @@
1
+ export * from './AdaptiveInfoRow';
2
+ export * from './AdaptiveInfoGroup';
3
+ export * from './MobileInfoRow';
4
+ export * from './MobileInfoGroup';
@@ -0,0 +1,5 @@
1
+ export declare const POSITION: {
2
+ readonly Inner: "inner";
3
+ readonly First: "first";
4
+ readonly Last: "last";
5
+ };
@@ -0,0 +1,5 @@
1
+ export const POSITION = {
2
+ Inner: 'inner',
3
+ First: 'first',
4
+ Last: 'last',
5
+ };
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,3 @@
1
+ import { ValueOf } from '@snack-uikit/utils';
2
+ import { POSITION } from './constants';
3
+ export type Position = ValueOf<typeof POSITION>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-mobile-info-row",
3
3
  "title": "Mobile Info Row",
4
- "version": "0.6.20",
4
+ "version": "0.6.22",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -30,15 +30,16 @@
30
30
  "name": "Akhremenko Grigorii",
31
31
  "url": "https://github.com/AGrigorii"
32
32
  },
33
+ "contributors": [],
33
34
  "license": "Apache-2.0",
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  },
37
38
  "scripts": {},
38
39
  "dependencies": {
39
- "@cloud-ru/uikit-product-info-row": "0.8.24",
40
- "@cloud-ru/uikit-product-mobile-tooltip": "0.4.65",
41
- "@cloud-ru/uikit-product-utils": "7.0.0",
40
+ "@cloud-ru/uikit-product-info-row": "0.8.26",
41
+ "@cloud-ru/uikit-product-mobile-tooltip": "0.4.67",
42
+ "@cloud-ru/uikit-product-utils": "7.0.2",
42
43
  "@snack-uikit/button": "0.19.15",
43
44
  "@snack-uikit/divider": "3.2.9",
44
45
  "@snack-uikit/skeleton": "0.6.8",
@@ -48,5 +49,5 @@
48
49
  "peerDependencies": {
49
50
  "@cloud-ru/uikit-product-locale": "*"
50
51
  },
51
- "gitHead": "e8bd79bc92b26a8f52611972eec98a867536ccd3"
52
+ "gitHead": "bf479ecf7238ef20b78f20acaef439efa535d1a1"
52
53
  }