New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@alfalab/core-components-typography

Package Overview
Dependencies
Maintainers
14
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alfalab/core-components-typography - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

colors.module-69def6bf.js

8

component.js

@@ -11,6 +11,10 @@ 'use strict';

require('react');
require('react-merge-refs');
require('classnames');
require('./colors.module-1c06b16d.js');
require('./hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');
require('./colors.module-69def6bf.js');
require('./title/component.js');
require('./common.module-00fb3f71.js');
require('./common.module-59cc11ca.js');

@@ -17,0 +21,0 @@ var Typography = {

@@ -11,3 +11,8 @@ 'use strict';

require('react');
require('react-merge-refs');
require('classnames');
require('./hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('./hooks/use-skeleton.module.css');
require('./colors.module.css');

@@ -14,0 +19,0 @@ require('./text/index.module.css');

@@ -10,3 +10,8 @@ 'use strict';

require('react');
require('react-merge-refs');
require('classnames');
require('./hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('./hooks/use-skeleton.module.css');
require('./colors.module.css');

@@ -13,0 +18,0 @@ require('./text/index.module.css');

@@ -5,3 +5,3 @@ /// <reference types="react" />

import { Color } from "../colors";
import { TextElementType } from "../types";
import { TextElementType, TextSkeletonProps } from "../types";
type NativeProps = HTMLAttributes<HTMLSpanElement>;

@@ -49,2 +49,10 @@ type TextBaseProps = {

rowLimit?: 1 | 2 | 3;
/**
* Показать скелетон
*/
showSkeleton?: boolean;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps;
};

@@ -51,0 +59,0 @@ type TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {

@@ -7,5 +7,10 @@ 'use strict';

var React = require('react');
var mergeRefs = require('react-merge-refs');
var cn = require('classnames');
var hooks_useSkeleton = require('../hooks/useSkeleton.js');
var colors = require('../colors.module.css');
var styles = require('./index.module.css');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('../hooks/use-skeleton.module.css');

@@ -15,2 +20,3 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefaultCompat(React);
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);

@@ -21,12 +27,22 @@ var colors__default = /*#__PURE__*/_interopDefaultCompat(colors);

var Text = React.forwardRef(function (_a, ref) {
var _b;
var _c = _a.view, view = _c === void 0 ? 'primary-medium' : _c, _d = _a.tag, Component = _d === void 0 ? 'span' : _d, weight = _a.weight, _e = _a.monospaceNumbers, monospaceNumbers = _e === void 0 ? false : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? true : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, restProps = tslib.__rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit"]);
return (React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default((_b = {},
_b[styles__default.default.paragraph] = Component === 'p' && !defaultMargins,
var _b, _c;
var _d = _a.view, view = _d === void 0 ? 'primary-medium' : _d, _e = _a.tag, Component = _e === void 0 ? 'span' : _e, weight = _a.weight, _f = _a.monospaceNumbers, monospaceNumbers = _f === void 0 ? false : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? true : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, showSkeleton = _a.showSkeleton, skeletonProps = _a.skeletonProps, restProps = tslib.__rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "showSkeleton", "skeletonProps"]);
var _h = hooks_useSkeleton.useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _h.renderSkeleton, textRef = _h.textRef;
var skeleton = renderSkeleton({
wrapperClassName: cn__default.default((_b = {},
_b[styles__default.default.paragraphWithMargins] = Component === 'p' && defaultMargins,
_b[styles__default.default.monospace] = monospaceNumbers,
_b[styles__default.default["rowLimit".concat(rowLimit)]] = rowLimit,
_b), className, color && colors__default.default[color], styles__default.default[view], weight && styles__default.default[weight]), "data-test-id": dataTestId, ref: ref }, restProps), children));
_b)),
dataTestId: dataTestId,
});
if (skeleton) {
return skeleton;
}
return (React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default((_c = {},
_c[styles__default.default.paragraph] = Component === 'p' && !defaultMargins,
_c[styles__default.default.paragraphWithMargins] = Component === 'p' && defaultMargins,
_c[styles__default.default.monospace] = monospaceNumbers,
_c[styles__default.default["rowLimit".concat(rowLimit)]] = rowLimit,
_c), className, color && colors__default.default[color], styles__default.default[view], weight && styles__default.default[weight]), "data-test-id": dataTestId, ref: mergeRefs__default.default([ref, textRef]) }, restProps), children));
});
exports.Text = Text;

@@ -8,3 +8,8 @@ 'use strict';

require('react');
require('react-merge-refs');
require('classnames');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('../hooks/use-skeleton.module.css');
require('../colors.module.css');

@@ -11,0 +16,0 @@ require('./index.module.css');

@@ -10,3 +10,8 @@ 'use strict';

var styles = require('./index.module.css');
require('react-merge-refs');
require('classnames');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('../hooks/use-skeleton.module.css');
require('../colors.module.css');

@@ -13,0 +18,0 @@

@@ -9,3 +9,8 @@ 'use strict';

require('../title/component.js');
require('react-merge-refs');
require('classnames');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('../hooks/use-skeleton.module.css');
require('../colors.module.css');

@@ -12,0 +17,0 @@ require('../title/common.module.css');

@@ -10,3 +10,8 @@ 'use strict';

var styles = require('./index.module.css');
require('react-merge-refs');
require('classnames');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('../hooks/use-skeleton.module.css');
require('../colors.module.css');

@@ -13,0 +18,0 @@

@@ -9,3 +9,8 @@ 'use strict';

require('../title/component.js');
require('react-merge-refs');
require('classnames');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('../hooks/use-skeleton.module.css');
require('../colors.module.css');

@@ -12,0 +17,0 @@ require('../title/common.module.css');

@@ -5,2 +5,3 @@ /// <reference types="react" />

import { Color } from "../colors";
import { TextSkeletonProps } from "../types";
type NativeProps = HTMLAttributes<HTMLHeadingElement>;

@@ -48,2 +49,10 @@ type TitleProps = Omit<NativeProps, 'color'> & {

rowLimit?: 1 | 2 | 3;
/**
* Показать скелетон
*/
showSkeleton?: boolean;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps;
};

@@ -64,3 +73,3 @@ type Styles = {

*/
view?: "medium" | "xlarge" | "large" | "small" | "xsmall" | undefined;
view?: "small" | "medium" | "xlarge" | "large" | "xsmall" | undefined;
/**

@@ -73,3 +82,3 @@ * Цвет текста

*/
weight?: "regular" | "medium" | "bold" | undefined;
weight?: "bold" | "regular" | "medium" | undefined;
/**

@@ -99,3 +108,11 @@ * Шрифт текста

rowLimit?: 1 | 2 | 3 | undefined;
/**
* Показать скелетон
*/
showSkeleton?: boolean | undefined;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps | undefined;
} & Styles & React.RefAttributes<TitleElementType>>;
export { TitleProps, Title };

@@ -7,4 +7,9 @@ 'use strict';

var React = require('react');
var mergeRefs = require('react-merge-refs');
var cn = require('classnames');
var hooks_useSkeleton = require('../hooks/useSkeleton.js');
var colors = require('../colors.module.css');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('../hooks/use-skeleton.module.css');

@@ -14,2 +19,3 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefaultCompat(React);
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);

@@ -20,6 +26,14 @@ var colors__default = /*#__PURE__*/_interopDefaultCompat(colors);

var _b;
var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d, _e = _a.font, font = _e === void 0 ? 'styrene' : _e, _f = _a.weight, weight = _f === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? false : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, styles = _a.styles, restProps = tslib.__rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles"]);
return (React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors__default.default[color], (_b = {}, _b[styles["rowLimit".concat(rowLimit)]] = rowLimit, _b)), "data-test-id": dataTestId, ref: ref }, restProps), children));
var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d, _e = _a.font, font = _e === void 0 ? 'styrene' : _e, _f = _a.weight, weight = _f === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? false : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, styles = _a.styles, skeletonProps = _a.skeletonProps, showSkeleton = _a.showSkeleton, restProps = tslib.__rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles", "skeletonProps", "showSkeleton"]);
var _h = hooks_useSkeleton.useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _h.renderSkeleton, textRef = _h.textRef;
var skeleton = renderSkeleton({
wrapperClassName: cn__default.default(defaultMargins && styles["margins-".concat(view)]),
dataTestId: dataTestId,
});
if (skeleton) {
return skeleton;
}
return (React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors__default.default[color], (_b = {}, _b[styles["rowLimit".concat(rowLimit)]] = rowLimit, _b)), "data-test-id": dataTestId, ref: mergeRefs__default.default([ref, textRef]) }, restProps), children));
});
exports.Title = Title;

@@ -10,3 +10,8 @@ 'use strict';

var styles = require('./index.module.css');
require('react-merge-refs');
require('classnames');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton/cssm');
require('@alfalab/hooks');
require('../hooks/use-skeleton.module.css');
require('../colors.module.css');

@@ -13,0 +18,0 @@

type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
export { TextElementType };
type WidthUnit = number | string;
type TextSkeletonProps = {
/**
* Кол-во строк текста
*/
rows?: number;
/**
* Ширина строки
*/
width?: WidthUnit | WidthUnit[];
};
export { TextElementType, TextSkeletonProps };

@@ -7,6 +7,10 @@ import { Text } from './text/component.js';

import 'react';
import 'react-merge-refs';
import 'classnames';
import './colors.module-d9f55bc3.js';
import './hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
import './colors.module-64858915.js';
import './title/component.js';
import './common.module-39c4c6a5.js';
import './common.module-a0a4a875.js';

@@ -13,0 +17,0 @@ var Typography = {

@@ -6,8 +6,12 @@ export { Typography } from './component.js';

import 'react';
import 'react-merge-refs';
import 'classnames';
import './colors.module-d9f55bc3.js';
import './hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
import './colors.module-64858915.js';
import './title/index.js';
import './title/component.js';
import './common.module-39c4c6a5.js';
import './common.module-a0a4a875.js';
import './title-mobile/component.js';
import './title-responsive/component.js';

@@ -5,3 +5,3 @@ /// <reference types="react" />

import { Color } from "../colors";
import { TextElementType } from "../types";
import { TextElementType, TextSkeletonProps } from "../types";
type NativeProps = HTMLAttributes<HTMLSpanElement>;

@@ -49,2 +49,10 @@ type TextBaseProps = {

rowLimit?: 1 | 2 | 3;
/**
* Показать скелетон
*/
showSkeleton?: boolean;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps;
};

@@ -51,0 +59,0 @@ type TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {

import { __rest, __assign } from 'tslib';
import React, { forwardRef } from 'react';
import mergeRefs from 'react-merge-refs';
import cn from 'classnames';
import { c as colors } from '../colors.module-d9f55bc3.js';
import { useSkeleton } from '../hooks/useSkeleton.js';
import { c as colors } from '../colors.module-64858915.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
var styles = {"paragraph":"typography__paragraph_pm003","paragraphWithMargins":"typography__paragraphWithMargins_pm003","primary-large":"typography__primary-large_pm003","primary-medium":"typography__primary-medium_pm003","primary-small":"typography__primary-small_pm003","secondary-large":"typography__secondary-large_pm003","secondary-medium":"typography__secondary-medium_pm003","secondary-small":"typography__secondary-small_pm003","component":"typography__component_pm003","caps":"typography__caps_pm003","bold":"typography__bold_pm003","medium":"typography__medium_pm003","regular":"typography__regular_pm003","monospace":"typography__monospace_pm003","rowLimit1":"typography__rowLimit1_pm003","rowLimit2":"typography__rowLimit2_pm003","rowLimit3":"typography__rowLimit3_pm003"};
var styles = {"paragraph":"typography__paragraph_rpr5l","paragraphWithMargins":"typography__paragraphWithMargins_rpr5l","primary-large":"typography__primary-large_rpr5l","primary-medium":"typography__primary-medium_rpr5l","primary-small":"typography__primary-small_rpr5l","secondary-large":"typography__secondary-large_rpr5l","secondary-medium":"typography__secondary-medium_rpr5l","secondary-small":"typography__secondary-small_rpr5l","component":"typography__component_rpr5l","caps":"typography__caps_rpr5l","bold":"typography__bold_rpr5l","medium":"typography__medium_rpr5l","regular":"typography__regular_rpr5l","monospace":"typography__monospace_rpr5l","rowLimit1":"typography__rowLimit1_rpr5l","rowLimit2":"typography__rowLimit2_rpr5l","rowLimit3":"typography__rowLimit3_rpr5l"};
require('./index.css')
var Text = forwardRef(function (_a, ref) {
var _b;
var _c = _a.view, view = _c === void 0 ? 'primary-medium' : _c, _d = _a.tag, Component = _d === void 0 ? 'span' : _d, weight = _a.weight, _e = _a.monospaceNumbers, monospaceNumbers = _e === void 0 ? false : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? true : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, restProps = __rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit"]);
return (React.createElement(Component, __assign({ className: cn((_b = {},
_b[styles.paragraph] = Component === 'p' && !defaultMargins,
var _b, _c;
var _d = _a.view, view = _d === void 0 ? 'primary-medium' : _d, _e = _a.tag, Component = _e === void 0 ? 'span' : _e, weight = _a.weight, _f = _a.monospaceNumbers, monospaceNumbers = _f === void 0 ? false : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? true : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, showSkeleton = _a.showSkeleton, skeletonProps = _a.skeletonProps, restProps = __rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "showSkeleton", "skeletonProps"]);
var _h = useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _h.renderSkeleton, textRef = _h.textRef;
var skeleton = renderSkeleton({
wrapperClassName: cn((_b = {},
_b[styles.paragraphWithMargins] = Component === 'p' && defaultMargins,
_b[styles.monospace] = monospaceNumbers,
_b[styles["rowLimit".concat(rowLimit)]] = rowLimit,
_b), className, color && colors[color], styles[view], weight && styles[weight]), "data-test-id": dataTestId, ref: ref }, restProps), children));
_b)),
dataTestId: dataTestId,
});
if (skeleton) {
return skeleton;
}
return (React.createElement(Component, __assign({ className: cn((_c = {},
_c[styles.paragraph] = Component === 'p' && !defaultMargins,
_c[styles.paragraphWithMargins] = Component === 'p' && defaultMargins,
_c[styles.monospace] = monospaceNumbers,
_c[styles["rowLimit".concat(rowLimit)]] = rowLimit,
_c), className, color && colors[color], styles[view], weight && styles[weight]), "data-test-id": dataTestId, ref: mergeRefs([ref, textRef]) }, restProps), children));
});
export { Text };
export { Text } from './component.js';
import 'tslib';
import 'react';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d9f55bc3.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
import '../colors.module-64858915.js';
import { __assign } from 'tslib';
import React from 'react';
import { Title } from '../title/component.js';
import { c as commonStyles } from '../common.module-39c4c6a5.js';
import { c as commonStyles } from '../common.module-a0a4a875.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d9f55bc3.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
import '../colors.module-64858915.js';
var styles = {"styrene-xlarge":"typography__styrene-xlarge_1ovqs","styrene-large":"typography__styrene-large_1ovqs","styrene-medium":"typography__styrene-medium_1ovqs","styrene-small":"typography__styrene-small_1ovqs","styrene-xsmall":"typography__styrene-xsmall_1ovqs","system-xlarge":"typography__system-xlarge_1ovqs","system-large":"typography__system-large_1ovqs","system-medium":"typography__system-medium_1ovqs","system-small":"typography__system-small_1ovqs","system-xsmall":"typography__system-xsmall_1ovqs"};
var styles = {"styrene-xlarge":"typography__styrene-xlarge_kymfk","styrene-large":"typography__styrene-large_kymfk","styrene-medium":"typography__styrene-medium_kymfk","styrene-small":"typography__styrene-small_kymfk","styrene-xsmall":"typography__styrene-xsmall_kymfk","system-xlarge":"typography__system-xlarge_kymfk","system-large":"typography__system-large_kymfk","system-medium":"typography__system-medium_kymfk","system-small":"typography__system-small_kymfk","system-xsmall":"typography__system-xsmall_kymfk"};
require('./index.css')

@@ -10,0 +14,0 @@

@@ -5,4 +5,8 @@ export { TitleMobile } from './component.js';

import '../title/component.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d9f55bc3.js';
import '../common.module-39c4c6a5.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
import '../colors.module-64858915.js';
import '../common.module-a0a4a875.js';
import { __assign } from 'tslib';
import React from 'react';
import { Title } from '../title/component.js';
import { c as commonStyles } from '../common.module-39c4c6a5.js';
import { c as commonStyles } from '../common.module-a0a4a875.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d9f55bc3.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
import '../colors.module-64858915.js';
var styles = {"styrene-xlarge":"typography__styrene-xlarge_z4yoi","styrene-large":"typography__styrene-large_z4yoi","styrene-medium":"typography__styrene-medium_z4yoi","styrene-small":"typography__styrene-small_z4yoi","styrene-xsmall":"typography__styrene-xsmall_z4yoi","system-xlarge":"typography__system-xlarge_z4yoi","system-large":"typography__system-large_z4yoi","system-medium":"typography__system-medium_z4yoi","system-small":"typography__system-small_z4yoi","system-xsmall":"typography__system-xsmall_z4yoi","margins-xlarge":"typography__margins-xlarge_z4yoi","margins-large":"typography__margins-large_z4yoi","margins-medium":"typography__margins-medium_z4yoi","margins-small":"typography__margins-small_z4yoi","margins-xsmall":"typography__margins-xsmall_z4yoi"};
var styles = {"styrene-xlarge":"typography__styrene-xlarge_1h9yc","styrene-large":"typography__styrene-large_1h9yc","styrene-medium":"typography__styrene-medium_1h9yc","styrene-small":"typography__styrene-small_1h9yc","styrene-xsmall":"typography__styrene-xsmall_1h9yc","system-xlarge":"typography__system-xlarge_1h9yc","system-large":"typography__system-large_1h9yc","system-medium":"typography__system-medium_1h9yc","system-small":"typography__system-small_1h9yc","system-xsmall":"typography__system-xsmall_1h9yc","margins-xlarge":"typography__margins-xlarge_1h9yc","margins-large":"typography__margins-large_1h9yc","margins-medium":"typography__margins-medium_1h9yc","margins-small":"typography__margins-small_1h9yc","margins-xsmall":"typography__margins-xsmall_1h9yc"};
require('./index.css')

@@ -10,0 +14,0 @@

@@ -5,4 +5,8 @@ export { TitleResponsive } from './component.js';

import '../title/component.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d9f55bc3.js';
import '../common.module-39c4c6a5.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
import '../colors.module-64858915.js';
import '../common.module-a0a4a875.js';

@@ -5,2 +5,3 @@ /// <reference types="react" />

import { Color } from "../colors";
import { TextSkeletonProps } from "../types";
type NativeProps = HTMLAttributes<HTMLHeadingElement>;

@@ -48,2 +49,10 @@ type TitleProps = Omit<NativeProps, 'color'> & {

rowLimit?: 1 | 2 | 3;
/**
* Показать скелетон
*/
showSkeleton?: boolean;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps;
};

@@ -64,3 +73,3 @@ type Styles = {

*/
view?: "medium" | "xlarge" | "large" | "small" | "xsmall" | undefined;
view?: "small" | "medium" | "xlarge" | "large" | "xsmall" | undefined;
/**

@@ -73,3 +82,3 @@ * Цвет текста

*/
weight?: "regular" | "medium" | "bold" | undefined;
weight?: "bold" | "regular" | "medium" | undefined;
/**

@@ -99,3 +108,11 @@ * Шрифт текста

rowLimit?: 1 | 2 | 3 | undefined;
/**
* Показать скелетон
*/
showSkeleton?: boolean | undefined;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps | undefined;
} & Styles & React.RefAttributes<TitleElementType>>;
export { TitleProps, Title };
import { __rest, __assign } from 'tslib';
import React, { forwardRef } from 'react';
import mergeRefs from 'react-merge-refs';
import cn from 'classnames';
import { c as colors } from '../colors.module-d9f55bc3.js';
import { useSkeleton } from '../hooks/useSkeleton.js';
import { c as colors } from '../colors.module-64858915.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
var Title = forwardRef(function (_a, ref) {
var _b;
var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d, _e = _a.font, font = _e === void 0 ? 'styrene' : _e, _f = _a.weight, weight = _f === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? false : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, styles = _a.styles, restProps = __rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles"]);
return (React.createElement(Component, __assign({ className: cn(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors[color], (_b = {}, _b[styles["rowLimit".concat(rowLimit)]] = rowLimit, _b)), "data-test-id": dataTestId, ref: ref }, restProps), children));
var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d, _e = _a.font, font = _e === void 0 ? 'styrene' : _e, _f = _a.weight, weight = _f === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? false : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, styles = _a.styles, skeletonProps = _a.skeletonProps, showSkeleton = _a.showSkeleton, restProps = __rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles", "skeletonProps", "showSkeleton"]);
var _h = useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _h.renderSkeleton, textRef = _h.textRef;
var skeleton = renderSkeleton({
wrapperClassName: cn(defaultMargins && styles["margins-".concat(view)]),
dataTestId: dataTestId,
});
if (skeleton) {
return skeleton;
}
return (React.createElement(Component, __assign({ className: cn(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors[color], (_b = {}, _b[styles["rowLimit".concat(rowLimit)]] = rowLimit, _b)), "data-test-id": dataTestId, ref: mergeRefs([ref, textRef]) }, restProps), children));
});
export { Title };
import { __assign } from 'tslib';
import React from 'react';
import { Title as Title$1 } from './component.js';
import { c as commonStyles } from '../common.module-39c4c6a5.js';
import { c as commonStyles } from '../common.module-a0a4a875.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d9f55bc3.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/esm';
import '@alfalab/hooks';
import '../colors.module-64858915.js';
var styles = {"styrene-xlarge":"typography__styrene-xlarge_1mab3","styrene-large":"typography__styrene-large_1mab3","styrene-medium":"typography__styrene-medium_1mab3","styrene-small":"typography__styrene-small_1mab3","styrene-xsmall":"typography__styrene-xsmall_1mab3","system-xlarge":"typography__system-xlarge_1mab3","system-large":"typography__system-large_1mab3","system-medium":"typography__system-medium_1mab3","system-small":"typography__system-small_1mab3","system-xsmall":"typography__system-xsmall_1mab3","margins-xlarge":"typography__margins-xlarge_1mab3","margins-large":"typography__margins-large_1mab3","margins-medium":"typography__margins-medium_1mab3","margins-small":"typography__margins-small_1mab3","margins-xsmall":"typography__margins-xsmall_1mab3","rowLimit1":"typography__rowLimit1_1mab3","rowLimit2":"typography__rowLimit2_1mab3","rowLimit3":"typography__rowLimit3_1mab3"};
var styles = {"styrene-xlarge":"typography__styrene-xlarge_1jblj","styrene-large":"typography__styrene-large_1jblj","styrene-medium":"typography__styrene-medium_1jblj","styrene-small":"typography__styrene-small_1jblj","styrene-xsmall":"typography__styrene-xsmall_1jblj","system-xlarge":"typography__system-xlarge_1jblj","system-large":"typography__system-large_1jblj","system-medium":"typography__system-medium_1jblj","system-small":"typography__system-small_1jblj","system-xsmall":"typography__system-xsmall_1jblj","margins-xlarge":"typography__margins-xlarge_1jblj","margins-large":"typography__margins-large_1jblj","margins-medium":"typography__margins-medium_1jblj","margins-small":"typography__margins-small_1jblj","margins-xsmall":"typography__margins-xsmall_1jblj","rowLimit1":"typography__rowLimit1_1jblj","rowLimit2":"typography__rowLimit2_1jblj","rowLimit3":"typography__rowLimit3_1jblj"};
require('./index.css')

@@ -10,0 +14,0 @@

type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
export { TextElementType };
type WidthUnit = number | string;
type TextSkeletonProps = {
/**
* Кол-во строк текста
*/
rows?: number;
/**
* Ширина строки
*/
width?: WidthUnit | WidthUnit[];
};
export { TextElementType, TextSkeletonProps };

@@ -10,7 +10,11 @@ 'use strict';

require('react');
require('react-merge-refs');
require('classnames');
require('./colors.module-1c06b16d.js');
require('./hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');
require('./colors.module-69def6bf.js');
require('./title/index.js');
require('./title/component.js');
require('./common.module-00fb3f71.js');
require('./common.module-59cc11ca.js');
require('./title-mobile/component.js');

@@ -17,0 +21,0 @@ require('./title-responsive/component.js');

@@ -6,6 +6,10 @@ import { Text } from './text/component.js';

import 'react';
import 'react-merge-refs';
import 'classnames';
import './colors.module-d0f9b310.js';
import './hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
import './colors.module-58e8caae.js';
import './title/component.js';
import './common.module-47d6bc91.js';
import './common.module-3d6095da.js';

@@ -12,0 +16,0 @@ const Typography = {

@@ -5,8 +5,12 @@ export { Typography } from './component.js';

import 'react';
import 'react-merge-refs';
import 'classnames';
import './colors.module-d0f9b310.js';
import './hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
import './colors.module-58e8caae.js';
import './title/index.js';
import './title/component.js';
import './common.module-47d6bc91.js';
import './common.module-3d6095da.js';
import './title-mobile/component.js';
import './title-responsive/component.js';

@@ -5,3 +5,3 @@ /// <reference types="react" />

import { Color } from "../colors";
import { TextElementType } from "../types";
import { TextElementType, TextSkeletonProps } from "../types";
type NativeProps = HTMLAttributes<HTMLSpanElement>;

@@ -49,2 +49,10 @@ type TextBaseProps = {

rowLimit?: 1 | 2 | 3;
/**
* Показать скелетон
*/
showSkeleton?: boolean;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps;
};

@@ -51,0 +59,0 @@ type TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {

import React, { forwardRef } from 'react';
import mergeRefs from 'react-merge-refs';
import cn from 'classnames';
import { c as colors } from '../colors.module-d0f9b310.js';
import { useSkeleton } from '../hooks/useSkeleton.js';
import { c as colors } from '../colors.module-58e8caae.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
const styles = {"paragraph":"typography__paragraph_pm003","paragraphWithMargins":"typography__paragraphWithMargins_pm003","primary-large":"typography__primary-large_pm003","primary-medium":"typography__primary-medium_pm003","primary-small":"typography__primary-small_pm003","secondary-large":"typography__secondary-large_pm003","secondary-medium":"typography__secondary-medium_pm003","secondary-small":"typography__secondary-small_pm003","component":"typography__component_pm003","caps":"typography__caps_pm003","bold":"typography__bold_pm003","medium":"typography__medium_pm003","regular":"typography__regular_pm003","monospace":"typography__monospace_pm003","rowLimit1":"typography__rowLimit1_pm003","rowLimit2":"typography__rowLimit2_pm003","rowLimit3":"typography__rowLimit3_pm003"};
const styles = {"paragraph":"typography__paragraph_rpr5l","paragraphWithMargins":"typography__paragraphWithMargins_rpr5l","primary-large":"typography__primary-large_rpr5l","primary-medium":"typography__primary-medium_rpr5l","primary-small":"typography__primary-small_rpr5l","secondary-large":"typography__secondary-large_rpr5l","secondary-medium":"typography__secondary-medium_rpr5l","secondary-small":"typography__secondary-small_rpr5l","component":"typography__component_rpr5l","caps":"typography__caps_rpr5l","bold":"typography__bold_rpr5l","medium":"typography__medium_rpr5l","regular":"typography__regular_rpr5l","monospace":"typography__monospace_rpr5l","rowLimit1":"typography__rowLimit1_rpr5l","rowLimit2":"typography__rowLimit2_rpr5l","rowLimit3":"typography__rowLimit3_rpr5l"};
require('./index.css')
const Text = forwardRef(({ view = 'primary-medium', tag: Component = 'span', weight, monospaceNumbers = false, defaultMargins = true, color, className, dataTestId, children, rowLimit, ...restProps }, ref) => (React.createElement(Component, { className: cn({
[styles.paragraph]: Component === 'p' && !defaultMargins,
[styles.paragraphWithMargins]: Component === 'p' && defaultMargins,
[styles.monospace]: monospaceNumbers,
[styles[`rowLimit${rowLimit}`]]: rowLimit,
}, className, color && colors[color], styles[view], weight && styles[weight]), "data-test-id": dataTestId, ref: ref, ...restProps }, children)));
const Text = forwardRef(({ view = 'primary-medium', tag: Component = 'span', weight, monospaceNumbers = false, defaultMargins = true, color, className, dataTestId, children, rowLimit, showSkeleton, skeletonProps, ...restProps }, ref) => {
const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);
const skeleton = renderSkeleton({
wrapperClassName: cn({
[styles.paragraphWithMargins]: Component === 'p' && defaultMargins,
}),
dataTestId,
});
if (skeleton) {
return skeleton;
}
return (React.createElement(Component, { className: cn({
[styles.paragraph]: Component === 'p' && !defaultMargins,
[styles.paragraphWithMargins]: Component === 'p' && defaultMargins,
[styles.monospace]: monospaceNumbers,
[styles[`rowLimit${rowLimit}`]]: rowLimit,
}, className, color && colors[color], styles[view], weight && styles[weight]), "data-test-id": dataTestId, ref: mergeRefs([ref, textRef]), ...restProps }, children));
});
export { Text };
export { Text } from './component.js';
import 'react';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d0f9b310.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
import '../colors.module-58e8caae.js';
import React from 'react';
import { Title } from '../title/component.js';
import { c as commonStyles } from '../common.module-47d6bc91.js';
import { c as commonStyles } from '../common.module-3d6095da.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d0f9b310.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
import '../colors.module-58e8caae.js';
const styles = {"styrene-xlarge":"typography__styrene-xlarge_1ovqs","styrene-large":"typography__styrene-large_1ovqs","styrene-medium":"typography__styrene-medium_1ovqs","styrene-small":"typography__styrene-small_1ovqs","styrene-xsmall":"typography__styrene-xsmall_1ovqs","system-xlarge":"typography__system-xlarge_1ovqs","system-large":"typography__system-large_1ovqs","system-medium":"typography__system-medium_1ovqs","system-small":"typography__system-small_1ovqs","system-xsmall":"typography__system-xsmall_1ovqs"};
const styles = {"styrene-xlarge":"typography__styrene-xlarge_kymfk","styrene-large":"typography__styrene-large_kymfk","styrene-medium":"typography__styrene-medium_kymfk","styrene-small":"typography__styrene-small_kymfk","styrene-xsmall":"typography__styrene-xsmall_kymfk","system-xlarge":"typography__system-xlarge_kymfk","system-large":"typography__system-large_kymfk","system-medium":"typography__system-medium_kymfk","system-small":"typography__system-small_kymfk","system-xsmall":"typography__system-xsmall_kymfk"};
require('./index.css')

@@ -9,0 +13,0 @@

export { TitleMobile } from './component.js';
import 'react';
import '../title/component.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d0f9b310.js';
import '../common.module-47d6bc91.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
import '../colors.module-58e8caae.js';
import '../common.module-3d6095da.js';
import React from 'react';
import { Title } from '../title/component.js';
import { c as commonStyles } from '../common.module-47d6bc91.js';
import { c as commonStyles } from '../common.module-3d6095da.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d0f9b310.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
import '../colors.module-58e8caae.js';
const styles = {"styrene-xlarge":"typography__styrene-xlarge_z4yoi","styrene-large":"typography__styrene-large_z4yoi","styrene-medium":"typography__styrene-medium_z4yoi","styrene-small":"typography__styrene-small_z4yoi","styrene-xsmall":"typography__styrene-xsmall_z4yoi","system-xlarge":"typography__system-xlarge_z4yoi","system-large":"typography__system-large_z4yoi","system-medium":"typography__system-medium_z4yoi","system-small":"typography__system-small_z4yoi","system-xsmall":"typography__system-xsmall_z4yoi","margins-xlarge":"typography__margins-xlarge_z4yoi","margins-large":"typography__margins-large_z4yoi","margins-medium":"typography__margins-medium_z4yoi","margins-small":"typography__margins-small_z4yoi","margins-xsmall":"typography__margins-xsmall_z4yoi"};
const styles = {"styrene-xlarge":"typography__styrene-xlarge_1h9yc","styrene-large":"typography__styrene-large_1h9yc","styrene-medium":"typography__styrene-medium_1h9yc","styrene-small":"typography__styrene-small_1h9yc","styrene-xsmall":"typography__styrene-xsmall_1h9yc","system-xlarge":"typography__system-xlarge_1h9yc","system-large":"typography__system-large_1h9yc","system-medium":"typography__system-medium_1h9yc","system-small":"typography__system-small_1h9yc","system-xsmall":"typography__system-xsmall_1h9yc","margins-xlarge":"typography__margins-xlarge_1h9yc","margins-large":"typography__margins-large_1h9yc","margins-medium":"typography__margins-medium_1h9yc","margins-small":"typography__margins-small_1h9yc","margins-xsmall":"typography__margins-xsmall_1h9yc"};
require('./index.css')

@@ -9,0 +13,0 @@

export { TitleResponsive } from './component.js';
import 'react';
import '../title/component.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d0f9b310.js';
import '../common.module-47d6bc91.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
import '../colors.module-58e8caae.js';
import '../common.module-3d6095da.js';

@@ -5,2 +5,3 @@ /// <reference types="react" />

import { Color } from "../colors";
import { TextSkeletonProps } from "../types";
type NativeProps = HTMLAttributes<HTMLHeadingElement>;

@@ -48,2 +49,10 @@ type TitleProps = Omit<NativeProps, 'color'> & {

rowLimit?: 1 | 2 | 3;
/**
* Показать скелетон
*/
showSkeleton?: boolean;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps;
};

@@ -64,3 +73,3 @@ type Styles = {

*/
view?: "medium" | "xlarge" | "large" | "small" | "xsmall" | undefined;
view?: "small" | "medium" | "xlarge" | "large" | "xsmall" | undefined;
/**

@@ -73,3 +82,3 @@ * Цвет текста

*/
weight?: "regular" | "medium" | "bold" | undefined;
weight?: "bold" | "regular" | "medium" | undefined;
/**

@@ -99,3 +108,11 @@ * Шрифт текста

rowLimit?: 1 | 2 | 3 | undefined;
/**
* Показать скелетон
*/
showSkeleton?: boolean | undefined;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps | undefined;
} & Styles & React.RefAttributes<TitleElementType>>;
export { TitleProps, Title };
import React, { forwardRef } from 'react';
import mergeRefs from 'react-merge-refs';
import cn from 'classnames';
import { c as colors } from '../colors.module-d0f9b310.js';
import { useSkeleton } from '../hooks/useSkeleton.js';
import { c as colors } from '../colors.module-58e8caae.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
const Title = forwardRef(({ tag: Component = 'div', view = 'medium', font = 'styrene', weight = font === 'styrene' ? 'medium' : 'bold', defaultMargins = false, color, className, dataTestId, children, rowLimit, styles, ...restProps }, ref) => (React.createElement(Component, { className: cn(styles.component, className, styles[`${font}-${view}`], defaultMargins && styles[`margins-${view}`], styles[weight], color && colors[color], { [styles[`rowLimit${rowLimit}`]]: rowLimit }), "data-test-id": dataTestId, ref: ref, ...restProps }, children)));
const Title = forwardRef(({ tag: Component = 'div', view = 'medium', font = 'styrene', weight = font === 'styrene' ? 'medium' : 'bold', defaultMargins = false, color, className, dataTestId, children, rowLimit, styles, skeletonProps, showSkeleton, ...restProps }, ref) => {
const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);
const skeleton = renderSkeleton({
wrapperClassName: cn(defaultMargins && styles[`margins-${view}`]),
dataTestId,
});
if (skeleton) {
return skeleton;
}
return (React.createElement(Component, { className: cn(styles.component, className, styles[`${font}-${view}`], defaultMargins && styles[`margins-${view}`], styles[weight], color && colors[color], { [styles[`rowLimit${rowLimit}`]]: rowLimit }), "data-test-id": dataTestId, ref: mergeRefs([ref, textRef]), ...restProps }, children));
});
export { Title };
import React from 'react';
import { Title as Title$1 } from './component.js';
import { c as commonStyles } from '../common.module-47d6bc91.js';
import { c as commonStyles } from '../common.module-3d6095da.js';
import 'react-merge-refs';
import 'classnames';
import '../colors.module-d0f9b310.js';
import '../hooks/useSkeleton.js';
import '@alfalab/core-components-skeleton/modern';
import '@alfalab/hooks';
import '../colors.module-58e8caae.js';
const styles = {"styrene-xlarge":"typography__styrene-xlarge_1mab3","styrene-large":"typography__styrene-large_1mab3","styrene-medium":"typography__styrene-medium_1mab3","styrene-small":"typography__styrene-small_1mab3","styrene-xsmall":"typography__styrene-xsmall_1mab3","system-xlarge":"typography__system-xlarge_1mab3","system-large":"typography__system-large_1mab3","system-medium":"typography__system-medium_1mab3","system-small":"typography__system-small_1mab3","system-xsmall":"typography__system-xsmall_1mab3","margins-xlarge":"typography__margins-xlarge_1mab3","margins-large":"typography__margins-large_1mab3","margins-medium":"typography__margins-medium_1mab3","margins-small":"typography__margins-small_1mab3","margins-xsmall":"typography__margins-xsmall_1mab3","rowLimit1":"typography__rowLimit1_1mab3","rowLimit2":"typography__rowLimit2_1mab3","rowLimit3":"typography__rowLimit3_1mab3"};
const styles = {"styrene-xlarge":"typography__styrene-xlarge_1jblj","styrene-large":"typography__styrene-large_1jblj","styrene-medium":"typography__styrene-medium_1jblj","styrene-small":"typography__styrene-small_1jblj","styrene-xsmall":"typography__styrene-xsmall_1jblj","system-xlarge":"typography__system-xlarge_1jblj","system-large":"typography__system-large_1jblj","system-medium":"typography__system-medium_1jblj","system-small":"typography__system-small_1jblj","system-xsmall":"typography__system-xsmall_1jblj","margins-xlarge":"typography__margins-xlarge_1jblj","margins-large":"typography__margins-large_1jblj","margins-medium":"typography__margins-medium_1jblj","margins-small":"typography__margins-small_1jblj","margins-xsmall":"typography__margins-xsmall_1jblj","rowLimit1":"typography__rowLimit1_1jblj","rowLimit2":"typography__rowLimit2_1jblj","rowLimit3":"typography__rowLimit3_1jblj"};
require('./index.css')

@@ -9,0 +13,0 @@

type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
export { TextElementType };
type WidthUnit = number | string;
type TextSkeletonProps = {
/**
* Кол-во строк текста
*/
rows?: number;
/**
* Ширина строки
*/
width?: WidthUnit | WidthUnit[];
};
export { TextElementType, TextSkeletonProps };
{
"name": "@alfalab/core-components-typography",
"version": "4.0.0",
"version": "4.1.0",
"description": "",

@@ -17,5 +17,8 @@ "keywords": [],

"dependencies": {
"@alfalab/core-components-skeleton": "^4.1.0",
"@alfalab/hooks": "^1.13.0",
"classnames": "^2.3.1",
"react-merge-refs": "^1.1.0",
"tslib": "^2.4.0"
}
}
export type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
type WidthUnit = number | string;
export type TextSkeletonProps = {
/**
* Кол-во строк текста
*/
rows?: number;
/**
* Ширина строки
*/
width?: WidthUnit | WidthUnit[];
};

@@ -5,3 +5,3 @@ /// <reference types="react" />

import { Color } from "../colors";
import { TextElementType } from "../types";
import { TextElementType, TextSkeletonProps } from "../types";
type NativeProps = HTMLAttributes<HTMLSpanElement>;

@@ -49,2 +49,10 @@ type TextBaseProps = {

rowLimit?: 1 | 2 | 3;
/**
* Показать скелетон
*/
showSkeleton?: boolean;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps;
};

@@ -51,0 +59,0 @@ type TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {

@@ -7,4 +7,8 @@ 'use strict';

var React = require('react');
var mergeRefs = require('react-merge-refs');
var cn = require('classnames');
var colors_module = require('../colors.module-1c06b16d.js');
var hooks_useSkeleton = require('../hooks/useSkeleton.js');
var colors_module = require('../colors.module-69def6bf.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');

@@ -14,18 +18,29 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefaultCompat(React);
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
var styles = {"paragraph":"typography__paragraph_pm003","paragraphWithMargins":"typography__paragraphWithMargins_pm003","primary-large":"typography__primary-large_pm003","primary-medium":"typography__primary-medium_pm003","primary-small":"typography__primary-small_pm003","secondary-large":"typography__secondary-large_pm003","secondary-medium":"typography__secondary-medium_pm003","secondary-small":"typography__secondary-small_pm003","component":"typography__component_pm003","caps":"typography__caps_pm003","bold":"typography__bold_pm003","medium":"typography__medium_pm003","regular":"typography__regular_pm003","monospace":"typography__monospace_pm003","rowLimit1":"typography__rowLimit1_pm003","rowLimit2":"typography__rowLimit2_pm003","rowLimit3":"typography__rowLimit3_pm003"};
var styles = {"paragraph":"typography__paragraph_rpr5l","paragraphWithMargins":"typography__paragraphWithMargins_rpr5l","primary-large":"typography__primary-large_rpr5l","primary-medium":"typography__primary-medium_rpr5l","primary-small":"typography__primary-small_rpr5l","secondary-large":"typography__secondary-large_rpr5l","secondary-medium":"typography__secondary-medium_rpr5l","secondary-small":"typography__secondary-small_rpr5l","component":"typography__component_rpr5l","caps":"typography__caps_rpr5l","bold":"typography__bold_rpr5l","medium":"typography__medium_rpr5l","regular":"typography__regular_rpr5l","monospace":"typography__monospace_rpr5l","rowLimit1":"typography__rowLimit1_rpr5l","rowLimit2":"typography__rowLimit2_rpr5l","rowLimit3":"typography__rowLimit3_rpr5l"};
require('./index.css')
var Text = React.forwardRef(function (_a, ref) {
var _b;
var _c = _a.view, view = _c === void 0 ? 'primary-medium' : _c, _d = _a.tag, Component = _d === void 0 ? 'span' : _d, weight = _a.weight, _e = _a.monospaceNumbers, monospaceNumbers = _e === void 0 ? false : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? true : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, restProps = tslib.__rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit"]);
return (React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default((_b = {},
_b[styles.paragraph] = Component === 'p' && !defaultMargins,
var _b, _c;
var _d = _a.view, view = _d === void 0 ? 'primary-medium' : _d, _e = _a.tag, Component = _e === void 0 ? 'span' : _e, weight = _a.weight, _f = _a.monospaceNumbers, monospaceNumbers = _f === void 0 ? false : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? true : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, showSkeleton = _a.showSkeleton, skeletonProps = _a.skeletonProps, restProps = tslib.__rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "showSkeleton", "skeletonProps"]);
var _h = hooks_useSkeleton.useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _h.renderSkeleton, textRef = _h.textRef;
var skeleton = renderSkeleton({
wrapperClassName: cn__default.default((_b = {},
_b[styles.paragraphWithMargins] = Component === 'p' && defaultMargins,
_b[styles.monospace] = monospaceNumbers,
_b[styles["rowLimit".concat(rowLimit)]] = rowLimit,
_b), className, color && colors_module.colors[color], styles[view], weight && styles[weight]), "data-test-id": dataTestId, ref: ref }, restProps), children));
_b)),
dataTestId: dataTestId,
});
if (skeleton) {
return skeleton;
}
return (React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default((_c = {},
_c[styles.paragraph] = Component === 'p' && !defaultMargins,
_c[styles.paragraphWithMargins] = Component === 'p' && defaultMargins,
_c[styles.monospace] = monospaceNumbers,
_c[styles["rowLimit".concat(rowLimit)]] = rowLimit,
_c), className, color && colors_module.colors[color], styles[view], weight && styles[weight]), "data-test-id": dataTestId, ref: mergeRefs__default.default([ref, textRef]) }, restProps), children));
});
exports.Text = Text;

@@ -8,4 +8,8 @@ 'use strict';

require('react');
require('react-merge-refs');
require('classnames');
require('../colors.module-1c06b16d.js');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');
require('../colors.module-69def6bf.js');

@@ -12,0 +16,0 @@

@@ -8,5 +8,9 @@ 'use strict';

var title_component = require('../title/component.js');
var common_module = require('../common.module-00fb3f71.js');
var common_module = require('../common.module-59cc11ca.js');
require('react-merge-refs');
require('classnames');
require('../colors.module-1c06b16d.js');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');
require('../colors.module-69def6bf.js');

@@ -17,3 +21,3 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var styles = {"styrene-xlarge":"typography__styrene-xlarge_1ovqs","styrene-large":"typography__styrene-large_1ovqs","styrene-medium":"typography__styrene-medium_1ovqs","styrene-small":"typography__styrene-small_1ovqs","styrene-xsmall":"typography__styrene-xsmall_1ovqs","system-xlarge":"typography__system-xlarge_1ovqs","system-large":"typography__system-large_1ovqs","system-medium":"typography__system-medium_1ovqs","system-small":"typography__system-small_1ovqs","system-xsmall":"typography__system-xsmall_1ovqs"};
var styles = {"styrene-xlarge":"typography__styrene-xlarge_kymfk","styrene-large":"typography__styrene-large_kymfk","styrene-medium":"typography__styrene-medium_kymfk","styrene-small":"typography__styrene-small_kymfk","styrene-xsmall":"typography__styrene-xsmall_kymfk","system-xlarge":"typography__system-xlarge_kymfk","system-large":"typography__system-large_kymfk","system-medium":"typography__system-medium_kymfk","system-small":"typography__system-small_kymfk","system-xsmall":"typography__system-xsmall_kymfk"};
require('./index.css')

@@ -20,0 +24,0 @@

@@ -9,5 +9,9 @@ 'use strict';

require('../title/component.js');
require('react-merge-refs');
require('classnames');
require('../colors.module-1c06b16d.js');
require('../common.module-00fb3f71.js');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');
require('../colors.module-69def6bf.js');
require('../common.module-59cc11ca.js');

@@ -14,0 +18,0 @@

@@ -8,5 +8,9 @@ 'use strict';

var title_component = require('../title/component.js');
var common_module = require('../common.module-00fb3f71.js');
var common_module = require('../common.module-59cc11ca.js');
require('react-merge-refs');
require('classnames');
require('../colors.module-1c06b16d.js');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');
require('../colors.module-69def6bf.js');

@@ -17,3 +21,3 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var styles = {"styrene-xlarge":"typography__styrene-xlarge_z4yoi","styrene-large":"typography__styrene-large_z4yoi","styrene-medium":"typography__styrene-medium_z4yoi","styrene-small":"typography__styrene-small_z4yoi","styrene-xsmall":"typography__styrene-xsmall_z4yoi","system-xlarge":"typography__system-xlarge_z4yoi","system-large":"typography__system-large_z4yoi","system-medium":"typography__system-medium_z4yoi","system-small":"typography__system-small_z4yoi","system-xsmall":"typography__system-xsmall_z4yoi","margins-xlarge":"typography__margins-xlarge_z4yoi","margins-large":"typography__margins-large_z4yoi","margins-medium":"typography__margins-medium_z4yoi","margins-small":"typography__margins-small_z4yoi","margins-xsmall":"typography__margins-xsmall_z4yoi"};
var styles = {"styrene-xlarge":"typography__styrene-xlarge_1h9yc","styrene-large":"typography__styrene-large_1h9yc","styrene-medium":"typography__styrene-medium_1h9yc","styrene-small":"typography__styrene-small_1h9yc","styrene-xsmall":"typography__styrene-xsmall_1h9yc","system-xlarge":"typography__system-xlarge_1h9yc","system-large":"typography__system-large_1h9yc","system-medium":"typography__system-medium_1h9yc","system-small":"typography__system-small_1h9yc","system-xsmall":"typography__system-xsmall_1h9yc","margins-xlarge":"typography__margins-xlarge_1h9yc","margins-large":"typography__margins-large_1h9yc","margins-medium":"typography__margins-medium_1h9yc","margins-small":"typography__margins-small_1h9yc","margins-xsmall":"typography__margins-xsmall_1h9yc"};
require('./index.css')

@@ -20,0 +24,0 @@

@@ -9,5 +9,9 @@ 'use strict';

require('../title/component.js');
require('react-merge-refs');
require('classnames');
require('../colors.module-1c06b16d.js');
require('../common.module-00fb3f71.js');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');
require('../colors.module-69def6bf.js');
require('../common.module-59cc11ca.js');

@@ -14,0 +18,0 @@

@@ -5,2 +5,3 @@ /// <reference types="react" />

import { Color } from "../colors";
import { TextSkeletonProps } from "../types";
type NativeProps = HTMLAttributes<HTMLHeadingElement>;

@@ -48,2 +49,10 @@ type TitleProps = Omit<NativeProps, 'color'> & {

rowLimit?: 1 | 2 | 3;
/**
* Показать скелетон
*/
showSkeleton?: boolean;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps;
};

@@ -64,3 +73,3 @@ type Styles = {

*/
view?: "medium" | "xlarge" | "large" | "small" | "xsmall" | undefined;
view?: "small" | "medium" | "xlarge" | "large" | "xsmall" | undefined;
/**

@@ -73,3 +82,3 @@ * Цвет текста

*/
weight?: "regular" | "medium" | "bold" | undefined;
weight?: "bold" | "regular" | "medium" | undefined;
/**

@@ -99,3 +108,11 @@ * Шрифт текста

rowLimit?: 1 | 2 | 3 | undefined;
/**
* Показать скелетон
*/
showSkeleton?: boolean | undefined;
/**
* Пропы для скелетона
*/
skeletonProps?: TextSkeletonProps | undefined;
} & Styles & React.RefAttributes<TitleElementType>>;
export { TitleProps, Title };

@@ -7,4 +7,8 @@ 'use strict';

var React = require('react');
var mergeRefs = require('react-merge-refs');
var cn = require('classnames');
var colors_module = require('../colors.module-1c06b16d.js');
var hooks_useSkeleton = require('../hooks/useSkeleton.js');
var colors_module = require('../colors.module-69def6bf.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');

@@ -14,2 +18,3 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefaultCompat(React);
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);

@@ -19,6 +24,14 @@

var _b;
var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d, _e = _a.font, font = _e === void 0 ? 'styrene' : _e, _f = _a.weight, weight = _f === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? false : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, styles = _a.styles, restProps = tslib.__rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles"]);
return (React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors_module.colors[color], (_b = {}, _b[styles["rowLimit".concat(rowLimit)]] = rowLimit, _b)), "data-test-id": dataTestId, ref: ref }, restProps), children));
var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d, _e = _a.font, font = _e === void 0 ? 'styrene' : _e, _f = _a.weight, weight = _f === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? false : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, styles = _a.styles, skeletonProps = _a.skeletonProps, showSkeleton = _a.showSkeleton, restProps = tslib.__rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles", "skeletonProps", "showSkeleton"]);
var _h = hooks_useSkeleton.useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _h.renderSkeleton, textRef = _h.textRef;
var skeleton = renderSkeleton({
wrapperClassName: cn__default.default(defaultMargins && styles["margins-".concat(view)]),
dataTestId: dataTestId,
});
if (skeleton) {
return skeleton;
}
return (React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors_module.colors[color], (_b = {}, _b[styles["rowLimit".concat(rowLimit)]] = rowLimit, _b)), "data-test-id": dataTestId, ref: mergeRefs__default.default([ref, textRef]) }, restProps), children));
});
exports.Title = Title;

@@ -8,5 +8,9 @@ 'use strict';

var title_component = require('./component.js');
var common_module = require('../common.module-00fb3f71.js');
var common_module = require('../common.module-59cc11ca.js');
require('react-merge-refs');
require('classnames');
require('../colors.module-1c06b16d.js');
require('../hooks/useSkeleton.js');
require('@alfalab/core-components-skeleton');
require('@alfalab/hooks');
require('../colors.module-69def6bf.js');

@@ -17,3 +21,3 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var styles = {"styrene-xlarge":"typography__styrene-xlarge_1mab3","styrene-large":"typography__styrene-large_1mab3","styrene-medium":"typography__styrene-medium_1mab3","styrene-small":"typography__styrene-small_1mab3","styrene-xsmall":"typography__styrene-xsmall_1mab3","system-xlarge":"typography__system-xlarge_1mab3","system-large":"typography__system-large_1mab3","system-medium":"typography__system-medium_1mab3","system-small":"typography__system-small_1mab3","system-xsmall":"typography__system-xsmall_1mab3","margins-xlarge":"typography__margins-xlarge_1mab3","margins-large":"typography__margins-large_1mab3","margins-medium":"typography__margins-medium_1mab3","margins-small":"typography__margins-small_1mab3","margins-xsmall":"typography__margins-xsmall_1mab3","rowLimit1":"typography__rowLimit1_1mab3","rowLimit2":"typography__rowLimit2_1mab3","rowLimit3":"typography__rowLimit3_1mab3"};
var styles = {"styrene-xlarge":"typography__styrene-xlarge_1jblj","styrene-large":"typography__styrene-large_1jblj","styrene-medium":"typography__styrene-medium_1jblj","styrene-small":"typography__styrene-small_1jblj","styrene-xsmall":"typography__styrene-xsmall_1jblj","system-xlarge":"typography__system-xlarge_1jblj","system-large":"typography__system-large_1jblj","system-medium":"typography__system-medium_1jblj","system-small":"typography__system-small_1jblj","system-xsmall":"typography__system-xsmall_1jblj","margins-xlarge":"typography__margins-xlarge_1jblj","margins-large":"typography__margins-large_1jblj","margins-medium":"typography__margins-medium_1jblj","margins-small":"typography__margins-small_1jblj","margins-xsmall":"typography__margins-xsmall_1jblj","rowLimit1":"typography__rowLimit1_1jblj","rowLimit2":"typography__rowLimit2_1jblj","rowLimit3":"typography__rowLimit3_1jblj"};
require('./index.css')

@@ -20,0 +24,0 @@

type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
export { TextElementType };
type WidthUnit = number | string;
type TextSkeletonProps = {
/**
* Кол-во строк текста
*/
rows?: number;
/**
* Ширина строки
*/
width?: WidthUnit | WidthUnit[];
};
export { TextElementType, TextSkeletonProps };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc