@salutejs/plasma-new-hope 0.108.0-canary.1307.9999104864.0 → 0.108.0-canary.1308.10006347697.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Portal/Portal.js +1 -1
- package/cjs/components/Portal/Portal.js.map +1 -1
- package/cjs/components/Typography/Old/Subtitle/Subtitle.js +5 -2
- package/cjs/components/Typography/Old/Subtitle/Subtitle.js.map +1 -1
- package/cjs/components/Typography/Old/TypographyOld.js +5 -2
- package/cjs/components/Typography/Old/TypographyOld.js.map +1 -1
- package/cjs/components/Typography/Typography.js +5 -2
- package/cjs/components/Typography/Typography.js.map +1 -1
- package/cjs/index.css +0 -3
- package/cjs/index.js +0 -3
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Portal/Portal.js +1 -1
- package/emotion/cjs/components/Portal/Portal.template-doc.mdx +1 -1
- package/emotion/cjs/components/Typography/Old/Subtitle/Subtitle.js +5 -2
- package/emotion/cjs/components/Typography/Old/TypographyOld.js +5 -2
- package/emotion/cjs/components/Typography/Typography.js +5 -2
- package/emotion/cjs/index.js +0 -11
- package/emotion/es/components/Portal/Portal.js +1 -1
- package/emotion/es/components/Portal/Portal.template-doc.mdx +1 -1
- package/emotion/es/components/Typography/Old/Subtitle/Subtitle.js +5 -2
- package/emotion/es/components/Typography/Old/TypographyOld.js +5 -2
- package/emotion/es/components/Typography/Typography.js +5 -2
- package/emotion/es/index.js +1 -2
- package/es/components/Portal/Portal.js +1 -1
- package/es/components/Portal/Portal.js.map +1 -1
- package/es/components/Typography/Old/Subtitle/Subtitle.js +5 -2
- package/es/components/Typography/Old/Subtitle/Subtitle.js.map +1 -1
- package/es/components/Typography/Old/TypographyOld.js +5 -2
- package/es/components/Typography/Old/TypographyOld.js.map +1 -1
- package/es/components/Typography/Typography.js +5 -2
- package/es/components/Typography/Typography.js.map +1 -1
- package/es/index.css +0 -3
- package/es/index.js +0 -1
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Portal/Portal.js +1 -1
- package/styled-components/cjs/components/Portal/Portal.template-doc.mdx +1 -1
- package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.js +5 -2
- package/styled-components/cjs/components/Typography/Old/TypographyOld.js +5 -2
- package/styled-components/cjs/components/Typography/Typography.js +5 -2
- package/styled-components/cjs/index.js +0 -11
- package/styled-components/es/components/Portal/Portal.js +1 -1
- package/styled-components/es/components/Portal/Portal.template-doc.mdx +1 -1
- package/styled-components/es/components/Typography/Old/Subtitle/Subtitle.js +5 -2
- package/styled-components/es/components/Typography/Old/TypographyOld.js +5 -2
- package/styled-components/es/components/Typography/Typography.js +5 -2
- package/styled-components/es/index.js +1 -2
- package/types/components/Portal/Portal.d.ts +0 -4
- package/types/components/Portal/Portal.d.ts.map +1 -1
- package/types/components/Portal/index.d.ts.map +1 -1
- package/types/components/Typography/Body/Body.d.ts +10 -2
- package/types/components/Typography/Body/Body.d.ts.map +1 -1
- package/types/components/Typography/Dspl/Dspl.d.ts +10 -2
- package/types/components/Typography/Dspl/Dspl.d.ts.map +1 -1
- package/types/components/Typography/Heading/Heading.d.ts +10 -2
- package/types/components/Typography/Heading/Heading.d.ts.map +1 -1
- package/types/components/Typography/Old/Body/Body.d.ts +6 -2
- package/types/components/Typography/Old/Body/Body.d.ts.map +1 -1
- package/types/components/Typography/Old/Button/Button.d.ts +6 -2
- package/types/components/Typography/Old/Button/Button.d.ts.map +1 -1
- package/types/components/Typography/Old/Caption/Caption.d.ts +6 -2
- package/types/components/Typography/Old/Caption/Caption.d.ts.map +1 -1
- package/types/components/Typography/Old/Display/Display.d.ts +6 -2
- package/types/components/Typography/Old/Display/Display.d.ts.map +1 -1
- package/types/components/Typography/Old/Footnote/Footnote.d.ts +6 -2
- package/types/components/Typography/Old/Footnote/Footnote.d.ts.map +1 -1
- package/types/components/Typography/Old/Headline/Headline.d.ts +6 -2
- package/types/components/Typography/Old/Headline/Headline.d.ts.map +1 -1
- package/types/components/Typography/Old/Paragraph/Paragraph.d.ts +6 -2
- package/types/components/Typography/Old/Paragraph/Paragraph.d.ts.map +1 -1
- package/types/components/Typography/Old/ParagraphText/ParagraphText.d.ts +6 -2
- package/types/components/Typography/Old/ParagraphText/ParagraphText.d.ts.map +1 -1
- package/types/components/Typography/Old/Subtitle/Subtitle.d.ts +9 -3
- package/types/components/Typography/Old/Subtitle/Subtitle.d.ts.map +1 -1
- package/types/components/Typography/Old/TypographyOld.d.ts +6 -2
- package/types/components/Typography/Old/TypographyOld.d.ts.map +1 -1
- package/types/components/Typography/Old/Underline/Underline.d.ts +6 -2
- package/types/components/Typography/Old/Underline/Underline.d.ts.map +1 -1
- package/types/components/Typography/Text/Text.d.ts +10 -2
- package/types/components/Typography/Text/Text.d.ts.map +1 -1
- package/types/components/Typography/Typography.d.ts +3 -1
- package/types/components/Typography/Typography.d.ts.map +1 -1
- package/types/examples/typograpy/components/Old/Body/Body.d.ts +3 -1
- package/types/examples/typograpy/components/Old/Body/Body.d.ts.map +1 -1
- package/types/examples/typograpy/components/Old/Button/Button.d.ts +3 -1
- package/types/examples/typograpy/components/Old/Button/Button.d.ts.map +1 -1
- package/types/examples/typograpy/components/Old/Caption/Caption.d.ts +3 -1
- package/types/examples/typograpy/components/Old/Caption/Caption.d.ts.map +1 -1
- package/types/examples/typograpy/components/Old/Display/Display.d.ts +3 -1
- package/types/examples/typograpy/components/Old/Display/Display.d.ts.map +1 -1
- package/types/examples/typograpy/components/Old/Footnote/Footnote.d.ts +3 -1
- package/types/examples/typograpy/components/Old/Footnote/Footnote.d.ts.map +1 -1
- package/types/examples/typograpy/components/Old/Headline/Headline.d.ts +3 -1
- package/types/examples/typograpy/components/Old/Headline/Headline.d.ts.map +1 -1
- package/types/examples/typograpy/components/Old/Paragraph/Paragraph.d.ts +3 -1
- package/types/examples/typograpy/components/Old/Paragraph/Paragraph.d.ts.map +1 -1
- package/types/examples/typograpy/components/Old/Subtitle/Subtitle.d.ts +3 -1
- package/types/examples/typograpy/components/Old/Subtitle/Subtitle.d.ts.map +1 -1
- package/types/examples/typograpy/components/Old/Underline/Underline.d.ts +3 -1
- package/types/examples/typograpy/components/Old/Underline/Underline.d.ts.map +1 -1
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +1 -1
- package/cjs/components/Price/Price.css +0 -2
- package/cjs/components/Price/Price.js +0 -63
- package/cjs/components/Price/Price.js.map +0 -1
- package/cjs/components/Price/Price.styles.js +0 -31
- package/cjs/components/Price/Price.styles.js.map +0 -1
- package/cjs/components/Price/Price.styles_xao0yv.css +0 -2
- package/cjs/components/Price/utils/formatCurrency.js +0 -22
- package/cjs/components/Price/utils/formatCurrency.js.map +0 -1
- package/cjs/components/Price/variations/_view/base.js +0 -9
- package/cjs/components/Price/variations/_view/base.js.map +0 -1
- package/cjs/components/Price/variations/_view/base_x642ct.css +0 -1
- package/emotion/cjs/components/Price/Price.js +0 -64
- package/emotion/cjs/components/Price/Price.styles.js +0 -29
- package/emotion/cjs/components/Price/Price.template-doc.mdx +0 -24
- package/emotion/cjs/components/Price/Price.types.js +0 -5
- package/emotion/cjs/components/Price/index.js +0 -18
- package/emotion/cjs/components/Price/utils/formatCurrency.js +0 -21
- package/emotion/cjs/components/Price/variations/_view/base.js +0 -8
- package/emotion/cjs/components/Price/variations/_view/tokens.json +0 -1
- package/emotion/cjs/examples/plasma_b2c/components/Price/Price.config.js +0 -14
- package/emotion/cjs/examples/plasma_b2c/components/Price/Price.js +0 -11
- package/emotion/cjs/examples/plasma_b2c/components/Price/Price.stories.tsx +0 -38
- package/emotion/cjs/examples/plasma_web/components/Price/Price.config.js +0 -14
- package/emotion/cjs/examples/plasma_web/components/Price/Price.js +0 -11
- package/emotion/cjs/examples/plasma_web/components/Price/Price.stories.tsx +0 -38
- package/emotion/es/components/Price/Price.js +0 -56
- package/emotion/es/components/Price/Price.styles.js +0 -22
- package/emotion/es/components/Price/Price.template-doc.mdx +0 -24
- package/emotion/es/components/Price/Price.types.js +0 -1
- package/emotion/es/components/Price/index.js +0 -1
- package/emotion/es/components/Price/utils/formatCurrency.js +0 -15
- package/emotion/es/components/Price/variations/_view/base.js +0 -2
- package/emotion/es/components/Price/variations/_view/tokens.json +0 -1
- package/emotion/es/examples/plasma_b2c/components/Price/Price.config.js +0 -8
- package/emotion/es/examples/plasma_b2c/components/Price/Price.js +0 -5
- package/emotion/es/examples/plasma_b2c/components/Price/Price.stories.tsx +0 -38
- package/emotion/es/examples/plasma_web/components/Price/Price.config.js +0 -8
- package/emotion/es/examples/plasma_web/components/Price/Price.js +0 -5
- package/emotion/es/examples/plasma_web/components/Price/Price.stories.tsx +0 -38
- package/es/components/Price/Price.css +0 -2
- package/es/components/Price/Price.js +0 -58
- package/es/components/Price/Price.js.map +0 -1
- package/es/components/Price/Price.styles.js +0 -26
- package/es/components/Price/Price.styles.js.map +0 -1
- package/es/components/Price/Price.styles_xao0yv.css +0 -2
- package/es/components/Price/utils/formatCurrency.js +0 -18
- package/es/components/Price/utils/formatCurrency.js.map +0 -1
- package/es/components/Price/variations/_view/base.js +0 -5
- package/es/components/Price/variations/_view/base.js.map +0 -1
- package/es/components/Price/variations/_view/base_x642ct.css +0 -1
- package/styled-components/cjs/components/Price/Price.js +0 -64
- package/styled-components/cjs/components/Price/Price.styles.js +0 -18
- package/styled-components/cjs/components/Price/Price.template-doc.mdx +0 -24
- package/styled-components/cjs/components/Price/Price.types.js +0 -5
- package/styled-components/cjs/components/Price/index.js +0 -18
- package/styled-components/cjs/components/Price/utils/formatCurrency.js +0 -21
- package/styled-components/cjs/components/Price/variations/_view/base.js +0 -8
- package/styled-components/cjs/components/Price/variations/_view/tokens.json +0 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Price/Price.config.js +0 -14
- package/styled-components/cjs/examples/plasma_b2c/components/Price/Price.js +0 -11
- package/styled-components/cjs/examples/plasma_b2c/components/Price/Price.stories.tsx +0 -38
- package/styled-components/cjs/examples/plasma_web/components/Price/Price.config.js +0 -14
- package/styled-components/cjs/examples/plasma_web/components/Price/Price.js +0 -11
- package/styled-components/cjs/examples/plasma_web/components/Price/Price.stories.tsx +0 -38
- package/styled-components/es/components/Price/Price.js +0 -56
- package/styled-components/es/components/Price/Price.styles.js +0 -11
- package/styled-components/es/components/Price/Price.template-doc.mdx +0 -24
- package/styled-components/es/components/Price/Price.types.js +0 -1
- package/styled-components/es/components/Price/index.js +0 -1
- package/styled-components/es/components/Price/utils/formatCurrency.js +0 -15
- package/styled-components/es/components/Price/variations/_view/base.js +0 -2
- package/styled-components/es/components/Price/variations/_view/tokens.json +0 -1
- package/styled-components/es/examples/plasma_b2c/components/Price/Price.config.js +0 -8
- package/styled-components/es/examples/plasma_b2c/components/Price/Price.js +0 -5
- package/styled-components/es/examples/plasma_b2c/components/Price/Price.stories.tsx +0 -38
- package/styled-components/es/examples/plasma_web/components/Price/Price.config.js +0 -8
- package/styled-components/es/examples/plasma_web/components/Price/Price.js +0 -5
- package/styled-components/es/examples/plasma_web/components/Price/Price.stories.tsx +0 -38
- package/types/components/Price/Price.d.ts +0 -22
- package/types/components/Price/Price.d.ts.map +0 -1
- package/types/components/Price/Price.styles.d.ts +0 -7
- package/types/components/Price/Price.styles.d.ts.map +0 -1
- package/types/components/Price/Price.types.d.ts +0 -41
- package/types/components/Price/Price.types.d.ts.map +0 -1
- package/types/components/Price/index.d.ts +0 -2
- package/types/components/Price/index.d.ts.map +0 -1
- package/types/components/Price/utils/formatCurrency.d.ts +0 -10
- package/types/components/Price/utils/formatCurrency.d.ts.map +0 -1
- package/types/components/Price/variations/_view/base.d.ts +0 -2
- package/types/components/Price/variations/_view/base.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Price/Price.config.d.ts +0 -9
- package/types/examples/plasma_b2c/components/Price/Price.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Price/Price.d.ts +0 -5
- package/types/examples/plasma_b2c/components/Price/Price.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Price/Price.config.d.ts +0 -9
- package/types/examples/plasma_web/components/Price/Price.config.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Price/Price.d.ts +0 -5
- package/types/examples/plasma_web/components/Price/Price.d.ts.map +0 -1
@@ -1,29 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.StyledPrice = exports.StyledPeriodicity = void 0;
|
7
|
-
var _base = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("@emotion/styled/base"));
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
9
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
10
|
-
var StyledPrice = exports.StyledPrice = /*#__PURE__*/(0, _base["default"])("span", {
|
11
|
-
target: "eklg8nc1",
|
12
|
-
label: "plasma-new-hope__StyledPrice"
|
13
|
-
})("text-decoration:", function (_ref) {
|
14
|
-
var stroked = _ref.stroked,
|
15
|
-
stroke = _ref.stroke;
|
16
|
-
return stroked || stroke ? 'line-through' : 'none';
|
17
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUHJpY2UvUHJpY2Uuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUUrRSIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1ByaWNlL1ByaWNlLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuZXhwb3J0IGNvbnN0IFN0eWxlZFByaWNlID0gc3R5bGVkLnNwYW48eyBzdHJva2VkPzogYm9vbGVhbjsgc3Ryb2tlPzogYm9vbGVhbiB9PmBcbiAgICB0ZXh0LWRlY29yYXRpb246ICR7KHsgc3Ryb2tlZCwgc3Ryb2tlIH0pID0+IChzdHJva2VkIHx8IHN0cm9rZSA/ICdsaW5lLXRocm91Z2gnIDogJ25vbmUnKX07XG5gO1xuXG5leHBvcnQgY29uc3QgU3R5bGVkUGVyaW9kaWNpdHkgPSBzdHlsZWQuc3BhbmBcbiAgICBwYWRkaW5nLWxlZnQ6IDAuMjVyZW07XG5gO1xuIl19 */"));
|
18
|
-
var StyledPeriodicity = exports.StyledPeriodicity = /*#__PURE__*/(0, _base["default"])("span", {
|
19
|
-
target: "eklg8nc0",
|
20
|
-
label: "plasma-new-hope__StyledPeriodicity"
|
21
|
-
})(process.env.NODE_ENV === "production" ? {
|
22
|
-
name: "dw047z",
|
23
|
-
styles: "padding-left:0.25rem"
|
24
|
-
} : {
|
25
|
-
name: "dw047z",
|
26
|
-
styles: "padding-left:0.25rem",
|
27
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUHJpY2UvUHJpY2Uuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU00QyIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1ByaWNlL1ByaWNlLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuZXhwb3J0IGNvbnN0IFN0eWxlZFByaWNlID0gc3R5bGVkLnNwYW48eyBzdHJva2VkPzogYm9vbGVhbjsgc3Ryb2tlPzogYm9vbGVhbiB9PmBcbiAgICB0ZXh0LWRlY29yYXRpb246ICR7KHsgc3Ryb2tlZCwgc3Ryb2tlIH0pID0+IChzdHJva2VkIHx8IHN0cm9rZSA/ICdsaW5lLXRocm91Z2gnIDogJ25vbmUnKX07XG5gO1xuXG5leHBvcnQgY29uc3QgU3R5bGVkUGVyaW9kaWNpdHkgPSBzdHlsZWQuc3BhbmBcbiAgICBwYWRkaW5nLWxlZnQ6IDAuMjVyZW07XG5gO1xuIl19 */",
|
28
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
29
|
-
});
|
@@ -1,24 +0,0 @@
|
|
1
|
-
---
|
2
|
-
id: price
|
3
|
-
title: Price
|
4
|
-
---
|
5
|
-
|
6
|
-
import { PropsTable, Description } from '@site/src/components';
|
7
|
-
|
8
|
-
# Price
|
9
|
-
<Description name="Price" />
|
10
|
-
<PropsTable name="Price" exclude={['css']} />
|
11
|
-
|
12
|
-
```tsx live
|
13
|
-
import React from 'react';
|
14
|
-
import { Price } from '@salutejs/{{ package }}';
|
15
|
-
|
16
|
-
export function App() {
|
17
|
-
return (
|
18
|
-
<div style=\{{ display: 'flex', flexDirection: 'column' }}>
|
19
|
-
<Price currency="rub" minimumFractionDigits={3}>12345.67</Price>
|
20
|
-
<Price locale="en" currency="rub" minimumFractionDigits={3} stroked>12345.67</Price>
|
21
|
-
</div>
|
22
|
-
);
|
23
|
-
}
|
24
|
-
```
|
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "priceConfig", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function get() {
|
9
|
-
return _Price.priceConfig;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "priceRoot", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function get() {
|
15
|
-
return _Price.priceRoot;
|
16
|
-
}
|
17
|
-
});
|
18
|
-
var _Price = /*#__PURE__*/require("./Price");
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.formatCurrency = void 0;
|
7
|
-
/**
|
8
|
-
* Форматирование числа в цену.
|
9
|
-
*/
|
10
|
-
var formatCurrency = exports.formatCurrency = function formatCurrency(_ref) {
|
11
|
-
var value = _ref.value,
|
12
|
-
locale = _ref.locale,
|
13
|
-
currency = _ref.currency,
|
14
|
-
minimumFractionDigits = _ref.minimumFractionDigits;
|
15
|
-
var formatter = new Intl.NumberFormat(locale, {
|
16
|
-
style: 'currency',
|
17
|
-
currency: currency,
|
18
|
-
minimumFractionDigits: minimumFractionDigits
|
19
|
-
});
|
20
|
-
return formatter.format(value);
|
21
|
-
};
|
@@ -1,8 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.base = void 0;
|
7
|
-
var _react = /*#__PURE__*/require("@emotion/react");
|
8
|
-
var base = exports.base = /*#__PURE__*/(0, _react.css)(";label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUHJpY2UvdmFyaWF0aW9ucy9fdmlldy9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUV1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1ByaWNlL3ZhcmlhdGlvbnMvX3ZpZXcvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgYDtcbiJdfQ== */"));
|
@@ -1 +0,0 @@
|
|
1
|
-
[]
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Price = void 0;
|
7
|
-
var _Price = /*#__PURE__*/require("../../../../components/Price");
|
8
|
-
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
|
-
var _Price2 = /*#__PURE__*/require("./Price.config");
|
10
|
-
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Price.priceConfig, _Price2.config);
|
11
|
-
var Price = exports.Price = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
2
|
-
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
-
import { disableProps } from '@salutejs/plasma-sb-utils';
|
4
|
-
|
5
|
-
import { WithTheme } from '../../../_helpers';
|
6
|
-
|
7
|
-
import { Price } from './Price';
|
8
|
-
|
9
|
-
const currencies = ['rub', 'usd', 'eur'];
|
10
|
-
|
11
|
-
const meta: Meta<typeof Price> = {
|
12
|
-
title: 'plasma_b2c/Price',
|
13
|
-
decorators: [WithTheme],
|
14
|
-
argTypes: {
|
15
|
-
currency: {
|
16
|
-
options: currencies,
|
17
|
-
control: {
|
18
|
-
type: 'inline-radio',
|
19
|
-
},
|
20
|
-
},
|
21
|
-
...disableProps(['value', 'theme', 'as', 'forwardedAs']),
|
22
|
-
},
|
23
|
-
};
|
24
|
-
|
25
|
-
export default meta;
|
26
|
-
|
27
|
-
type StoryPriceProps = ComponentProps<typeof Price> & { priceLabel: number };
|
28
|
-
|
29
|
-
export const Default: StoryObj<StoryPriceProps> = {
|
30
|
-
args: {
|
31
|
-
locale: 'ru',
|
32
|
-
currency: 'rub',
|
33
|
-
stroked: false,
|
34
|
-
minimumFractionDigits: 0,
|
35
|
-
priceLabel: 12345.67,
|
36
|
-
},
|
37
|
-
render: ({ priceLabel, ...rest }) => <Price {...rest}>{priceLabel}</Price>,
|
38
|
-
};
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Price = void 0;
|
7
|
-
var _Price = /*#__PURE__*/require("../../../../components/Price");
|
8
|
-
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
|
-
var _Price2 = /*#__PURE__*/require("./Price.config");
|
10
|
-
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Price.priceConfig, _Price2.config);
|
11
|
-
var Price = exports.Price = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
2
|
-
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
-
import { disableProps } from '@salutejs/plasma-sb-utils';
|
4
|
-
|
5
|
-
import { WithTheme } from '../../../_helpers';
|
6
|
-
|
7
|
-
import { Price } from './Price';
|
8
|
-
|
9
|
-
const currencies = ['rub', 'usd', 'eur'];
|
10
|
-
|
11
|
-
const meta: Meta<typeof Price> = {
|
12
|
-
title: 'plasma_web/Price',
|
13
|
-
decorators: [WithTheme],
|
14
|
-
argTypes: {
|
15
|
-
currency: {
|
16
|
-
options: currencies,
|
17
|
-
control: {
|
18
|
-
type: 'inline-radio',
|
19
|
-
},
|
20
|
-
},
|
21
|
-
...disableProps(['value', 'theme', 'as', 'forwardedAs']),
|
22
|
-
},
|
23
|
-
};
|
24
|
-
|
25
|
-
export default meta;
|
26
|
-
|
27
|
-
type StoryPriceProps = ComponentProps<typeof Price> & { priceLabel: number };
|
28
|
-
|
29
|
-
export const Default: StoryObj<StoryPriceProps> = {
|
30
|
-
args: {
|
31
|
-
locale: 'ru',
|
32
|
-
currency: 'rub',
|
33
|
-
stroked: false,
|
34
|
-
minimumFractionDigits: 0,
|
35
|
-
priceLabel: 12345.67,
|
36
|
-
},
|
37
|
-
render: ({ priceLabel, ...rest }) => <Price {...rest}>{priceLabel}</Price>,
|
38
|
-
};
|
@@ -1,56 +0,0 @@
|
|
1
|
-
var _excluded = ["children", "locale", "currency", "minimumFractionDigits", "stroked", "periodicity", "view", "stroke"];
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
|
-
import React, { forwardRef } from 'react';
|
6
|
-
import { formatCurrency } from './utils/formatCurrency';
|
7
|
-
import { StyledPeriodicity, StyledPrice } from './Price.styles';
|
8
|
-
import { base as viewCSS } from './variations/_view/base';
|
9
|
-
|
10
|
-
/**
|
11
|
-
* Компонент для отображения цены / стоимости / суммы.
|
12
|
-
*/
|
13
|
-
export var priceRoot = function priceRoot(Root) {
|
14
|
-
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
15
|
-
var children = _ref.children,
|
16
|
-
_ref$locale = _ref.locale,
|
17
|
-
locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
|
18
|
-
_ref$currency = _ref.currency,
|
19
|
-
currency = _ref$currency === void 0 ? 'rub' : _ref$currency,
|
20
|
-
_ref$minimumFractionD = _ref.minimumFractionDigits,
|
21
|
-
minimumFractionDigits = _ref$minimumFractionD === void 0 ? 0 : _ref$minimumFractionD,
|
22
|
-
_ref$stroked = _ref.stroked,
|
23
|
-
stroked = _ref$stroked === void 0 ? false : _ref$stroked,
|
24
|
-
periodicity = _ref.periodicity,
|
25
|
-
view = _ref.view,
|
26
|
-
_ref$stroke = _ref.stroke,
|
27
|
-
stroke = _ref$stroke === void 0 ? false : _ref$stroke,
|
28
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
29
|
-
return /*#__PURE__*/React.createElement(Root, {
|
30
|
-
view: view,
|
31
|
-
ref: outerRootRef
|
32
|
-
}, /*#__PURE__*/React.createElement(StyledPrice, _extends({
|
33
|
-
stroked: stroked,
|
34
|
-
stroke: stroke
|
35
|
-
}, rest), formatCurrency({
|
36
|
-
value: children,
|
37
|
-
locale: locale,
|
38
|
-
currency: currency,
|
39
|
-
minimumFractionDigits: minimumFractionDigits
|
40
|
-
}), periodicity && /*#__PURE__*/React.createElement(StyledPeriodicity, null, periodicity)));
|
41
|
-
});
|
42
|
-
};
|
43
|
-
export var priceConfig = {
|
44
|
-
name: 'Price',
|
45
|
-
tag: 'div',
|
46
|
-
layout: priceRoot,
|
47
|
-
base: '',
|
48
|
-
variations: {
|
49
|
-
view: {
|
50
|
-
css: viewCSS
|
51
|
-
}
|
52
|
-
},
|
53
|
-
defaults: {
|
54
|
-
view: 'default'
|
55
|
-
}
|
56
|
-
};
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
2
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
3
|
-
export var StyledPrice = /*#__PURE__*/_styled("span", {
|
4
|
-
target: "eklg8nc1",
|
5
|
-
label: "plasma-new-hope__StyledPrice"
|
6
|
-
})("text-decoration:", function (_ref) {
|
7
|
-
var stroked = _ref.stroked,
|
8
|
-
stroke = _ref.stroke;
|
9
|
-
return stroked || stroke ? 'line-through' : 'none';
|
10
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUHJpY2UvUHJpY2Uuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUUrRSIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1ByaWNlL1ByaWNlLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuZXhwb3J0IGNvbnN0IFN0eWxlZFByaWNlID0gc3R5bGVkLnNwYW48eyBzdHJva2VkPzogYm9vbGVhbjsgc3Ryb2tlPzogYm9vbGVhbiB9PmBcbiAgICB0ZXh0LWRlY29yYXRpb246ICR7KHsgc3Ryb2tlZCwgc3Ryb2tlIH0pID0+IChzdHJva2VkIHx8IHN0cm9rZSA/ICdsaW5lLXRocm91Z2gnIDogJ25vbmUnKX07XG5gO1xuXG5leHBvcnQgY29uc3QgU3R5bGVkUGVyaW9kaWNpdHkgPSBzdHlsZWQuc3BhbmBcbiAgICBwYWRkaW5nLWxlZnQ6IDAuMjVyZW07XG5gO1xuIl19 */"));
|
11
|
-
export var StyledPeriodicity = /*#__PURE__*/_styled("span", {
|
12
|
-
target: "eklg8nc0",
|
13
|
-
label: "plasma-new-hope__StyledPeriodicity"
|
14
|
-
})(process.env.NODE_ENV === "production" ? {
|
15
|
-
name: "dw047z",
|
16
|
-
styles: "padding-left:0.25rem"
|
17
|
-
} : {
|
18
|
-
name: "dw047z",
|
19
|
-
styles: "padding-left:0.25rem",
|
20
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUHJpY2UvUHJpY2Uuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU00QyIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1ByaWNlL1ByaWNlLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuZXhwb3J0IGNvbnN0IFN0eWxlZFByaWNlID0gc3R5bGVkLnNwYW48eyBzdHJva2VkPzogYm9vbGVhbjsgc3Ryb2tlPzogYm9vbGVhbiB9PmBcbiAgICB0ZXh0LWRlY29yYXRpb246ICR7KHsgc3Ryb2tlZCwgc3Ryb2tlIH0pID0+IChzdHJva2VkIHx8IHN0cm9rZSA/ICdsaW5lLXRocm91Z2gnIDogJ25vbmUnKX07XG5gO1xuXG5leHBvcnQgY29uc3QgU3R5bGVkUGVyaW9kaWNpdHkgPSBzdHlsZWQuc3BhbmBcbiAgICBwYWRkaW5nLWxlZnQ6IDAuMjVyZW07XG5gO1xuIl19 */",
|
21
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
22
|
-
});
|
@@ -1,24 +0,0 @@
|
|
1
|
-
---
|
2
|
-
id: price
|
3
|
-
title: Price
|
4
|
-
---
|
5
|
-
|
6
|
-
import { PropsTable, Description } from '@site/src/components';
|
7
|
-
|
8
|
-
# Price
|
9
|
-
<Description name="Price" />
|
10
|
-
<PropsTable name="Price" exclude={['css']} />
|
11
|
-
|
12
|
-
```tsx live
|
13
|
-
import React from 'react';
|
14
|
-
import { Price } from '@salutejs/{{ package }}';
|
15
|
-
|
16
|
-
export function App() {
|
17
|
-
return (
|
18
|
-
<div style=\{{ display: 'flex', flexDirection: 'column' }}>
|
19
|
-
<Price currency="rub" minimumFractionDigits={3}>12345.67</Price>
|
20
|
-
<Price locale="en" currency="rub" minimumFractionDigits={3} stroked>12345.67</Price>
|
21
|
-
</div>
|
22
|
-
);
|
23
|
-
}
|
24
|
-
```
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export { priceRoot, priceConfig } from './Price';
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Форматирование числа в цену.
|
3
|
-
*/
|
4
|
-
export var formatCurrency = function formatCurrency(_ref) {
|
5
|
-
var value = _ref.value,
|
6
|
-
locale = _ref.locale,
|
7
|
-
currency = _ref.currency,
|
8
|
-
minimumFractionDigits = _ref.minimumFractionDigits;
|
9
|
-
var formatter = new Intl.NumberFormat(locale, {
|
10
|
-
style: 'currency',
|
11
|
-
currency: currency,
|
12
|
-
minimumFractionDigits: minimumFractionDigits
|
13
|
-
});
|
14
|
-
return formatter.format(value);
|
15
|
-
};
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import { css } from '@emotion/react';
|
2
|
-
export var base = /*#__PURE__*/css(";label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvUHJpY2UvdmFyaWF0aW9ucy9fdmlldy9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUV1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1ByaWNlL3ZhcmlhdGlvbnMvX3ZpZXcvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgYDtcbiJdfQ== */"));
|
@@ -1 +0,0 @@
|
|
1
|
-
[]
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { priceConfig } from '../../../../components/Price';
|
2
|
-
import { component, mergeConfig } from '../../../../engines';
|
3
|
-
import { config } from './Price.config';
|
4
|
-
var mergedConfig = /*#__PURE__*/mergeConfig(priceConfig, config);
|
5
|
-
export var Price = /*#__PURE__*/component(mergedConfig);
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
2
|
-
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
-
import { disableProps } from '@salutejs/plasma-sb-utils';
|
4
|
-
|
5
|
-
import { WithTheme } from '../../../_helpers';
|
6
|
-
|
7
|
-
import { Price } from './Price';
|
8
|
-
|
9
|
-
const currencies = ['rub', 'usd', 'eur'];
|
10
|
-
|
11
|
-
const meta: Meta<typeof Price> = {
|
12
|
-
title: 'plasma_b2c/Price',
|
13
|
-
decorators: [WithTheme],
|
14
|
-
argTypes: {
|
15
|
-
currency: {
|
16
|
-
options: currencies,
|
17
|
-
control: {
|
18
|
-
type: 'inline-radio',
|
19
|
-
},
|
20
|
-
},
|
21
|
-
...disableProps(['value', 'theme', 'as', 'forwardedAs']),
|
22
|
-
},
|
23
|
-
};
|
24
|
-
|
25
|
-
export default meta;
|
26
|
-
|
27
|
-
type StoryPriceProps = ComponentProps<typeof Price> & { priceLabel: number };
|
28
|
-
|
29
|
-
export const Default: StoryObj<StoryPriceProps> = {
|
30
|
-
args: {
|
31
|
-
locale: 'ru',
|
32
|
-
currency: 'rub',
|
33
|
-
stroked: false,
|
34
|
-
minimumFractionDigits: 0,
|
35
|
-
priceLabel: 12345.67,
|
36
|
-
},
|
37
|
-
render: ({ priceLabel, ...rest }) => <Price {...rest}>{priceLabel}</Price>,
|
38
|
-
};
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { priceConfig } from '../../../../components/Price';
|
2
|
-
import { component, mergeConfig } from '../../../../engines';
|
3
|
-
import { config } from './Price.config';
|
4
|
-
var mergedConfig = /*#__PURE__*/mergeConfig(priceConfig, config);
|
5
|
-
export var Price = /*#__PURE__*/component(mergedConfig);
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
2
|
-
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
-
import { disableProps } from '@salutejs/plasma-sb-utils';
|
4
|
-
|
5
|
-
import { WithTheme } from '../../../_helpers';
|
6
|
-
|
7
|
-
import { Price } from './Price';
|
8
|
-
|
9
|
-
const currencies = ['rub', 'usd', 'eur'];
|
10
|
-
|
11
|
-
const meta: Meta<typeof Price> = {
|
12
|
-
title: 'plasma_web/Price',
|
13
|
-
decorators: [WithTheme],
|
14
|
-
argTypes: {
|
15
|
-
currency: {
|
16
|
-
options: currencies,
|
17
|
-
control: {
|
18
|
-
type: 'inline-radio',
|
19
|
-
},
|
20
|
-
},
|
21
|
-
...disableProps(['value', 'theme', 'as', 'forwardedAs']),
|
22
|
-
},
|
23
|
-
};
|
24
|
-
|
25
|
-
export default meta;
|
26
|
-
|
27
|
-
type StoryPriceProps = ComponentProps<typeof Price> & { priceLabel: number };
|
28
|
-
|
29
|
-
export const Default: StoryObj<StoryPriceProps> = {
|
30
|
-
args: {
|
31
|
-
locale: 'ru',
|
32
|
-
currency: 'rub',
|
33
|
-
stroked: false,
|
34
|
-
minimumFractionDigits: 0,
|
35
|
-
priceLabel: 12345.67,
|
36
|
-
},
|
37
|
-
render: ({ priceLabel, ...rest }) => <Price {...rest}>{priceLabel}</Price>,
|
38
|
-
};
|
@@ -1,58 +0,0 @@
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
-
import React, { forwardRef } from 'react';
|
3
|
-
import { formatCurrency } from './utils/formatCurrency.js';
|
4
|
-
import { StyledPrice, StyledPeriodicity } from './Price.styles.js';
|
5
|
-
import { base } from './variations/_view/base.js';
|
6
|
-
|
7
|
-
var _excluded = ["children", "locale", "currency", "minimumFractionDigits", "stroked", "periodicity", "view", "stroke"];
|
8
|
-
|
9
|
-
/**
|
10
|
-
* Компонент для отображения цены / стоимости / суммы.
|
11
|
-
*/
|
12
|
-
var priceRoot = function priceRoot(Root) {
|
13
|
-
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
14
|
-
var children = _ref.children,
|
15
|
-
_ref$locale = _ref.locale,
|
16
|
-
locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
|
17
|
-
_ref$currency = _ref.currency,
|
18
|
-
currency = _ref$currency === void 0 ? 'rub' : _ref$currency,
|
19
|
-
_ref$minimumFractionD = _ref.minimumFractionDigits,
|
20
|
-
minimumFractionDigits = _ref$minimumFractionD === void 0 ? 0 : _ref$minimumFractionD,
|
21
|
-
_ref$stroked = _ref.stroked,
|
22
|
-
stroked = _ref$stroked === void 0 ? false : _ref$stroked,
|
23
|
-
periodicity = _ref.periodicity,
|
24
|
-
view = _ref.view,
|
25
|
-
_ref$stroke = _ref.stroke,
|
26
|
-
stroke = _ref$stroke === void 0 ? false : _ref$stroke,
|
27
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
28
|
-
return /*#__PURE__*/React.createElement(Root, {
|
29
|
-
view: view,
|
30
|
-
ref: outerRootRef
|
31
|
-
}, /*#__PURE__*/React.createElement(StyledPrice, _extends({
|
32
|
-
stroked: stroked,
|
33
|
-
stroke: stroke
|
34
|
-
}, rest), formatCurrency({
|
35
|
-
value: children,
|
36
|
-
locale: locale,
|
37
|
-
currency: currency,
|
38
|
-
minimumFractionDigits: minimumFractionDigits
|
39
|
-
}), periodicity && /*#__PURE__*/React.createElement(StyledPeriodicity, null, periodicity)));
|
40
|
-
});
|
41
|
-
};
|
42
|
-
var priceConfig = {
|
43
|
-
name: 'Price',
|
44
|
-
tag: 'div',
|
45
|
-
layout: priceRoot,
|
46
|
-
base: '',
|
47
|
-
variations: {
|
48
|
-
view: {
|
49
|
-
css: base
|
50
|
-
}
|
51
|
-
},
|
52
|
-
defaults: {
|
53
|
-
view: 'default'
|
54
|
-
}
|
55
|
-
};
|
56
|
-
|
57
|
-
export { priceConfig, priceRoot };
|
58
|
-
//# sourceMappingURL=Price.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Price.js","sources":["../../../src/components/Price/Price.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { RootProps } from '../../engines';\n\nimport { formatCurrency } from './utils/formatCurrency';\nimport { PriceProps } from './Price.types';\nimport { StyledPeriodicity, StyledPrice } from './Price.styles';\nimport { base as viewCSS } from './variations/_view/base';\n\n/**\n * Компонент для отображения цены / стоимости / суммы.\n */\nexport const priceRoot = (Root: RootProps<HTMLDivElement, Omit<PriceProps, 'children'>>) =>\n forwardRef<HTMLDivElement, PriceProps>(\n (\n {\n children,\n locale = 'ru',\n currency = 'rub',\n minimumFractionDigits = 0,\n stroked = false,\n periodicity,\n view,\n stroke = false,\n ...rest\n },\n outerRootRef,\n ) => (\n <Root view={view} ref={outerRootRef}>\n <StyledPrice stroked={stroked} stroke={stroke} {...rest}>\n {formatCurrency({ value: children, locale, currency, minimumFractionDigits })}\n {periodicity && <StyledPeriodicity>{periodicity}</StyledPeriodicity>}\n </StyledPrice>\n </Root>\n ),\n );\n\nexport const priceConfig = {\n name: 'Price',\n tag: 'div',\n layout: priceRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'default',\n },\n};\n"],"names":["priceRoot","Root","forwardRef","_ref","outerRootRef","children","_ref$locale","locale","_ref$currency","currency","_ref$minimumFractionD","minimumFractionDigits","_ref$stroked","stroked","periodicity","view","_ref$stroke","stroke","rest","_objectWithoutProperties","_excluded","React","createElement","ref","StyledPrice","_extends","formatCurrency","value","StyledPeriodicity","priceConfig","name","tag","layout","base","variations","css","viewCSS","defaults"],"mappings":";;;;;;;;AASA;AACA;AACA;IACaA,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAA6D,EAAA;AAAA,EAAA,oBACnFC,UAAU,CACN,UAAAC,IAAA,EAYIC,YAAY,EAAA;AAAA,IAAA,IAVRC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;MAAAC,WAAA,GAAAH,IAAA,CACRI,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,WAAA;MAAAE,aAAA,GAAAL,IAAA,CACbM,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,qBAAA,GAAAP,IAAA,CAChBQ,qBAAqB;AAArBA,MAAAA,qBAAqB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,qBAAA;MAAAE,YAAA,GAAAT,IAAA,CACzBU,OAAO;AAAPA,MAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,YAAA;MACfE,WAAW,GAAAX,IAAA,CAAXW,WAAW;MACXC,IAAI,GAAAZ,IAAA,CAAJY,IAAI;MAAAC,WAAA,GAAAb,IAAA,CACJc,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,WAAA;AACXE,MAAAA,IAAI,GAAAC,wBAAA,CAAAhB,IAAA,EAAAiB,SAAA,CAAA,CAAA;AAAA,IAAA,oBAIXC,KAAA,CAAAC,aAAA,CAACrB,IAAI,EAAA;AAACc,MAAAA,IAAI,EAAEA,IAAK;AAACQ,MAAAA,GAAG,EAAEnB,YAAAA;AAAa,KAAA,eAChCiB,KAAA,CAAAC,aAAA,CAACE,WAAW,EAAAC,QAAA,CAAA;AAACZ,MAAAA,OAAO,EAAEA,OAAQ;AAACI,MAAAA,MAAM,EAAEA,MAAAA;KAAYC,EAAAA,IAAI,CAClDQ,EAAAA,cAAc,CAAC;AAAEC,MAAAA,KAAK,EAAEtB,QAAQ;AAAEE,MAAAA,MAAM,EAANA,MAAM;AAAEE,MAAAA,QAAQ,EAARA,QAAQ;AAAEE,MAAAA,qBAAqB,EAArBA,qBAAAA;AAAsB,KAAC,CAAC,EAC5EG,WAAW,iBAAIO,KAAA,CAAAC,aAAA,CAACM,iBAAiB,EAAA,IAAA,EAAEd,WAA+B,CAC1D,CACX,CAAC,CAAA;AAAA,GAEf,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMe,WAAW,GAAG;AACvBC,EAAAA,IAAI,EAAE,OAAO;AACbC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEhC,SAAS;AACjBiC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRnB,IAAAA,IAAI,EAAE;AACFoB,MAAAA,GAAG,EAAEC,IAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtB,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import './Price.styles_xao0yv.css';
|
2
|
-
import { styled } from '@linaria/react';
|
3
|
-
|
4
|
-
var _exp = function _exp() {
|
5
|
-
return function (_ref) {
|
6
|
-
var stroked = _ref.stroked,
|
7
|
-
stroke = _ref.stroke;
|
8
|
-
return stroked || stroke ? 'line-through' : 'none';
|
9
|
-
};
|
10
|
-
};
|
11
|
-
var StyledPrice = /*#__PURE__*/styled('span')({
|
12
|
-
name: "StyledPrice",
|
13
|
-
"class": "svvzdh4",
|
14
|
-
propsAsIs: false,
|
15
|
-
vars: {
|
16
|
-
"svvzdh4-0": [/*#__PURE__*/_exp()]
|
17
|
-
}
|
18
|
-
});
|
19
|
-
var StyledPeriodicity = /*#__PURE__*/styled('span')({
|
20
|
-
name: "StyledPeriodicity",
|
21
|
-
"class": "sqvsx17",
|
22
|
-
propsAsIs: false
|
23
|
-
});
|
24
|
-
|
25
|
-
export { StyledPeriodicity, StyledPrice };
|
26
|
-
//# sourceMappingURL=Price.styles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Price.styles.js","sources":["../../../src/components/Price/Price.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nexport const StyledPrice = styled.span<{ stroked?: boolean; stroke?: boolean }>`\n text-decoration: ${({ stroked, stroke }) => (stroked || stroke ? 'line-through' : 'none')};\n`;\n\nexport const StyledPeriodicity = styled.span`\n padding-left: 0.25rem;\n`;\n"],"names":["_exp","_ref","stroked","stroke","StyledPrice","styled","name","class","propsAsIs","vars","StyledPeriodicity"],"mappings":";;AAAwC,IAAAA,IAAA,GACtBA,SADsBA,IAAAA,GAAA;AAAA,EAAA,OAGjB,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,OAAO,GAAAD,IAAA,CAAPC,OAAO;MAAEC,MAAAA,GAAAA,IAAAA,CAAAA,MAAAA,CAAAA;AAAAA,IAAAA,OAAcD,OAAO,IAAIC,MAAM,GAAG,cAAc,GAAG,MAAO,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AADtF,IAAMC,WAAW,gBAAGC,MAAM,CAAA,MAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAC,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cACVT,IAAsE,EAAA,CAAA;AAAA,GAAA;AAAA,CAC5F,EAAA;AAEM,IAAMU,iBAAiB,gBAAGL,MAAM,CAAA,MAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAEtC;;;;"}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Форматирование числа в цену.
|
3
|
-
*/
|
4
|
-
var formatCurrency = function formatCurrency(_ref) {
|
5
|
-
var value = _ref.value,
|
6
|
-
locale = _ref.locale,
|
7
|
-
currency = _ref.currency,
|
8
|
-
minimumFractionDigits = _ref.minimumFractionDigits;
|
9
|
-
var formatter = new Intl.NumberFormat(locale, {
|
10
|
-
style: 'currency',
|
11
|
-
currency: currency,
|
12
|
-
minimumFractionDigits: minimumFractionDigits
|
13
|
-
});
|
14
|
-
return formatter.format(value);
|
15
|
-
};
|
16
|
-
|
17
|
-
export { formatCurrency };
|
18
|
-
//# sourceMappingURL=formatCurrency.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"formatCurrency.js","sources":["../../../../src/components/Price/utils/formatCurrency.ts"],"sourcesContent":["/**\n * Форматирование числа в цену.\n */\nexport const formatCurrency = ({\n value,\n locale,\n currency,\n minimumFractionDigits,\n}: {\n value: number;\n locale: string;\n currency: string;\n minimumFractionDigits: number;\n}): string => {\n const formatter = new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n minimumFractionDigits,\n });\n\n return formatter.format(value);\n};\n"],"names":["formatCurrency","_ref","value","locale","currency","minimumFractionDigits","formatter","Intl","NumberFormat","style","format"],"mappings":"AAAA;AACA;AACA;IACaA,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAUb;AAAA,EAAA,IATVC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,qBAAqB,GAAAJ,IAAA,CAArBI,qBAAqB,CAAA;EAOrB,IAAMC,SAAS,GAAG,IAAIC,IAAI,CAACC,YAAY,CAACL,MAAM,EAAE;AAC5CM,IAAAA,KAAK,EAAE,UAAU;AACjBL,IAAAA,QAAQ,EAARA,QAAQ;AACRC,IAAAA,qBAAqB,EAArBA,qBAAAA;AACJ,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOC,SAAS,CAACI,MAAM,CAACR,KAAK,CAAC,CAAA;AAClC;;;;"}
|