@salutejs/plasma-new-hope 0.146.0-dev.0 → 0.147.0-canary.1437.10892194926.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Attach/Attach.css +45 -0
- package/cjs/components/Attach/Attach.js +174 -0
- package/cjs/components/Attach/Attach.js.map +1 -0
- package/cjs/components/Attach/Attach.styles.js +23 -0
- package/cjs/components/Attach/Attach.styles.js.map +1 -0
- package/cjs/components/Attach/Attach.styles_17fejif.css +3 -0
- package/cjs/components/Attach/Attach.tokens.js +83 -0
- package/cjs/components/Attach/Attach.tokens.js.map +1 -0
- package/cjs/components/Attach/ui/Button/Button.styles.js +23 -0
- package/cjs/components/Attach/ui/Button/Button.styles.js.map +1 -0
- package/cjs/components/Attach/ui/Button/Button.styles_oi6jxf.css +1 -0
- package/cjs/components/Attach/ui/Cell/Cell.styles.js +25 -0
- package/cjs/components/Attach/ui/Cell/Cell.styles.js.map +1 -0
- package/cjs/components/Attach/ui/Cell/Cell.styles_1dlvsak.css +1 -0
- package/cjs/components/Attach/ui/iconButton/IconButton.styles.js +23 -0
- package/cjs/components/Attach/ui/iconButton/IconButton.styles.js.map +1 -0
- package/cjs/components/Attach/ui/iconButton/IconButton.styles_14dty7n.css +1 -0
- package/cjs/components/Attach/utils/extractExtension.js +10 -0
- package/cjs/components/Attach/utils/extractExtension.js.map +1 -0
- package/cjs/components/Attach/utils/getFileicon.js +27 -0
- package/cjs/components/Attach/utils/getFileicon.js.map +1 -0
- package/cjs/components/Attach/utils/truncateFilename.js +16 -0
- package/cjs/components/Attach/utils/truncateFilename.js.map +1 -0
- package/cjs/components/Attach/variations/_size/base.js +9 -0
- package/cjs/components/Attach/variations/_size/base.js.map +1 -0
- package/cjs/components/Attach/variations/_size/base_eax0b8.css +1 -0
- package/cjs/components/Attach/variations/_view/base.js +9 -0
- package/cjs/components/Attach/variations/_view/base.js.map +1 -0
- package/cjs/components/Attach/variations/_view/base_1nvsg1b.css +1 -0
- package/cjs/components/Cell/Cell.js +3 -2
- package/cjs/components/Cell/Cell.js.map +1 -1
- package/cjs/index.css +14 -0
- package/cjs/index.js +5 -0
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Attach/Attach.js +180 -0
- package/emotion/cjs/components/Attach/Attach.styles.js +36 -0
- package/emotion/cjs/components/Attach/Attach.template-doc.mdx +46 -0
- package/emotion/cjs/components/Attach/Attach.tokens.js +81 -0
- package/emotion/cjs/components/Attach/Attach.types.js +5 -0
- package/emotion/cjs/components/Attach/index.js +25 -0
- package/emotion/cjs/components/Attach/ui/Button/Button.js +12 -0
- package/emotion/cjs/components/Attach/ui/Button/Button.styles.js +17 -0
- package/emotion/cjs/components/Attach/ui/Cell/Cell.js +12 -0
- package/emotion/cjs/components/Attach/ui/Cell/Cell.styles.js +17 -0
- package/emotion/cjs/components/Attach/ui/iconButton/IconButton.js +12 -0
- package/emotion/cjs/components/Attach/ui/iconButton/IconButton.styles.js +17 -0
- package/emotion/cjs/components/Attach/utils/extractExtension.js +9 -0
- package/emotion/cjs/components/Attach/utils/getFileicon.js +26 -0
- package/emotion/cjs/components/Attach/utils/index.js +26 -0
- package/emotion/cjs/components/Attach/utils/truncateFilename.js +15 -0
- package/emotion/cjs/components/Attach/variations/_size/base.js +9 -0
- package/emotion/cjs/components/Attach/variations/_view/base.js +9 -0
- package/emotion/cjs/components/Cell/Cell.js +3 -2
- package/emotion/cjs/examples/plasma_b2c/components/Attach/Attach.config.js +25 -0
- package/emotion/cjs/examples/plasma_b2c/components/Attach/Attach.js +11 -0
- package/emotion/cjs/examples/plasma_b2c/components/Attach/Attach.stories.tsx +61 -0
- package/emotion/cjs/examples/plasma_web/components/Attach/Attach.config.js +25 -0
- package/emotion/cjs/examples/plasma_web/components/Attach/Attach.js +11 -0
- package/emotion/cjs/examples/plasma_web/components/Attach/Attach.stories.tsx +61 -0
- package/emotion/cjs/index.js +11 -0
- package/emotion/es/components/Attach/Attach.js +171 -0
- package/emotion/es/components/Attach/Attach.styles.js +29 -0
- package/emotion/es/components/Attach/Attach.template-doc.mdx +46 -0
- package/emotion/es/components/Attach/Attach.tokens.js +75 -0
- package/emotion/es/components/Attach/Attach.types.js +1 -0
- package/emotion/es/components/Attach/index.js +2 -0
- package/emotion/es/components/Attach/ui/Button/Button.js +1 -0
- package/emotion/es/components/Attach/ui/Button/Button.styles.js +10 -0
- package/emotion/es/components/Attach/ui/Cell/Cell.js +1 -0
- package/emotion/es/components/Attach/ui/Cell/Cell.styles.js +10 -0
- package/emotion/es/components/Attach/ui/iconButton/IconButton.js +1 -0
- package/emotion/es/components/Attach/ui/iconButton/IconButton.styles.js +10 -0
- package/emotion/es/components/Attach/utils/extractExtension.js +3 -0
- package/emotion/es/components/Attach/utils/getFileicon.js +19 -0
- package/emotion/es/components/Attach/utils/index.js +3 -0
- package/emotion/es/components/Attach/utils/truncateFilename.js +9 -0
- package/emotion/es/components/Attach/variations/_size/base.js +3 -0
- package/emotion/es/components/Attach/variations/_view/base.js +3 -0
- package/emotion/es/components/Cell/Cell.js +3 -2
- package/emotion/es/examples/plasma_b2c/components/Attach/Attach.config.js +19 -0
- package/emotion/es/examples/plasma_b2c/components/Attach/Attach.js +5 -0
- package/emotion/es/examples/plasma_b2c/components/Attach/Attach.stories.tsx +61 -0
- package/emotion/es/examples/plasma_web/components/Attach/Attach.config.js +19 -0
- package/emotion/es/examples/plasma_web/components/Attach/Attach.js +5 -0
- package/emotion/es/examples/plasma_web/components/Attach/Attach.stories.tsx +61 -0
- package/emotion/es/index.js +2 -1
- package/es/components/Attach/Attach.css +45 -0
- package/es/components/Attach/Attach.js +169 -0
- package/es/components/Attach/Attach.js.map +1 -0
- package/es/components/Attach/Attach.styles.js +17 -0
- package/es/components/Attach/Attach.styles.js.map +1 -0
- package/es/components/Attach/Attach.styles_17fejif.css +3 -0
- package/es/components/Attach/Attach.tokens.js +78 -0
- package/es/components/Attach/Attach.tokens.js.map +1 -0
- package/es/components/Attach/ui/Button/Button.styles.js +19 -0
- package/es/components/Attach/ui/Button/Button.styles.js.map +1 -0
- package/es/components/Attach/ui/Button/Button.styles_oi6jxf.css +1 -0
- package/es/components/Attach/ui/Cell/Cell.styles.js +21 -0
- package/es/components/Attach/ui/Cell/Cell.styles.js.map +1 -0
- package/es/components/Attach/ui/Cell/Cell.styles_1dlvsak.css +1 -0
- package/es/components/Attach/ui/iconButton/IconButton.styles.js +19 -0
- package/es/components/Attach/ui/iconButton/IconButton.styles.js.map +1 -0
- package/es/components/Attach/ui/iconButton/IconButton.styles_14dty7n.css +1 -0
- package/es/components/Attach/utils/extractExtension.js +6 -0
- package/es/components/Attach/utils/extractExtension.js.map +1 -0
- package/es/components/Attach/utils/getFileicon.js +23 -0
- package/es/components/Attach/utils/getFileicon.js.map +1 -0
- package/es/components/Attach/utils/truncateFilename.js +12 -0
- package/es/components/Attach/utils/truncateFilename.js.map +1 -0
- package/es/components/Attach/variations/_size/base.js +5 -0
- package/es/components/Attach/variations/_size/base.js.map +1 -0
- package/es/components/Attach/variations/_size/base_eax0b8.css +1 -0
- package/es/components/Attach/variations/_view/base.js +5 -0
- package/es/components/Attach/variations/_view/base.js.map +1 -0
- package/es/components/Attach/variations/_view/base_1nvsg1b.css +1 -0
- package/es/components/Cell/Cell.js +3 -2
- package/es/components/Cell/Cell.js.map +1 -1
- package/es/index.css +14 -0
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/package.json +3 -2
- package/styled-components/cjs/components/Attach/Attach.js +180 -0
- package/styled-components/cjs/components/Attach/Attach.styles.js +18 -0
- package/styled-components/cjs/components/Attach/Attach.template-doc.mdx +46 -0
- package/styled-components/cjs/components/Attach/Attach.tokens.js +81 -0
- package/styled-components/cjs/components/Attach/Attach.types.js +5 -0
- package/styled-components/cjs/components/Attach/index.js +25 -0
- package/styled-components/cjs/components/Attach/ui/Button/Button.js +12 -0
- package/styled-components/cjs/components/Attach/ui/Button/Button.styles.js +16 -0
- package/styled-components/cjs/components/Attach/ui/Cell/Cell.js +12 -0
- package/styled-components/cjs/components/Attach/ui/Cell/Cell.styles.js +16 -0
- package/styled-components/cjs/components/Attach/ui/iconButton/IconButton.js +12 -0
- package/styled-components/cjs/components/Attach/ui/iconButton/IconButton.styles.js +16 -0
- package/styled-components/cjs/components/Attach/utils/extractExtension.js +9 -0
- package/styled-components/cjs/components/Attach/utils/getFileicon.js +26 -0
- package/styled-components/cjs/components/Attach/utils/index.js +26 -0
- package/styled-components/cjs/components/Attach/utils/truncateFilename.js +15 -0
- package/styled-components/cjs/components/Attach/variations/_size/base.js +9 -0
- package/styled-components/cjs/components/Attach/variations/_view/base.js +9 -0
- package/styled-components/cjs/components/Cell/Cell.js +3 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Attach/Attach.config.js +25 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Attach/Attach.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Attach/Attach.stories.tsx +61 -0
- package/styled-components/cjs/examples/plasma_web/components/Attach/Attach.config.js +25 -0
- package/styled-components/cjs/examples/plasma_web/components/Attach/Attach.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/Attach/Attach.stories.tsx +61 -0
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Attach/Attach.js +171 -0
- package/styled-components/es/components/Attach/Attach.styles.js +10 -0
- package/styled-components/es/components/Attach/Attach.template-doc.mdx +46 -0
- package/styled-components/es/components/Attach/Attach.tokens.js +75 -0
- package/styled-components/es/components/Attach/Attach.types.js +1 -0
- package/styled-components/es/components/Attach/index.js +2 -0
- package/styled-components/es/components/Attach/ui/Button/Button.js +1 -0
- package/styled-components/es/components/Attach/ui/Button/Button.styles.js +9 -0
- package/styled-components/es/components/Attach/ui/Cell/Cell.js +1 -0
- package/styled-components/es/components/Attach/ui/Cell/Cell.styles.js +9 -0
- package/styled-components/es/components/Attach/ui/iconButton/IconButton.js +1 -0
- package/styled-components/es/components/Attach/ui/iconButton/IconButton.styles.js +9 -0
- package/styled-components/es/components/Attach/utils/extractExtension.js +3 -0
- package/styled-components/es/components/Attach/utils/getFileicon.js +19 -0
- package/styled-components/es/components/Attach/utils/index.js +3 -0
- package/styled-components/es/components/Attach/utils/truncateFilename.js +9 -0
- package/styled-components/es/components/Attach/variations/_size/base.js +3 -0
- package/styled-components/es/components/Attach/variations/_view/base.js +3 -0
- package/styled-components/es/components/Cell/Cell.js +3 -2
- package/styled-components/es/examples/plasma_b2c/components/Attach/Attach.config.js +19 -0
- package/styled-components/es/examples/plasma_b2c/components/Attach/Attach.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/Attach/Attach.stories.tsx +61 -0
- package/styled-components/es/examples/plasma_web/components/Attach/Attach.config.js +19 -0
- package/styled-components/es/examples/plasma_web/components/Attach/Attach.js +5 -0
- package/styled-components/es/examples/plasma_web/components/Attach/Attach.stories.tsx +61 -0
- package/styled-components/es/index.js +2 -1
- package/types/components/Attach/Attach.d.ts +23 -0
- package/types/components/Attach/Attach.d.ts.map +1 -0
- package/types/components/Attach/Attach.styles.d.ts +5 -0
- package/types/components/Attach/Attach.styles.d.ts.map +1 -0
- package/types/components/Attach/Attach.tokens.d.ts +73 -0
- package/types/components/Attach/Attach.tokens.d.ts.map +1 -0
- package/types/components/Attach/Attach.types.d.ts +33 -0
- package/types/components/Attach/Attach.types.d.ts.map +1 -0
- package/types/components/Attach/index.d.ts +4 -0
- package/types/components/Attach/index.d.ts.map +1 -0
- package/types/components/Attach/ui/Button/Button.d.ts +2 -0
- package/types/components/Attach/ui/Button/Button.d.ts.map +1 -0
- package/types/components/Attach/ui/Button/Button.styles.d.ts +45 -0
- package/types/components/Attach/ui/Button/Button.styles.d.ts.map +1 -0
- package/types/components/Attach/ui/Cell/Cell.d.ts +2 -0
- package/types/components/Attach/ui/Cell/Cell.d.ts.map +1 -0
- package/types/components/Attach/ui/Cell/Cell.styles.d.ts +33 -0
- package/types/components/Attach/ui/Cell/Cell.styles.d.ts.map +1 -0
- package/types/components/Attach/ui/iconButton/IconButton.d.ts +2 -0
- package/types/components/Attach/ui/iconButton/IconButton.d.ts.map +1 -0
- package/types/components/Attach/ui/iconButton/IconButton.styles.d.ts +45 -0
- package/types/components/Attach/ui/iconButton/IconButton.styles.d.ts.map +1 -0
- package/types/components/Attach/utils/extractExtension.d.ts +2 -0
- package/types/components/Attach/utils/extractExtension.d.ts.map +1 -0
- package/types/components/Attach/utils/getFileicon.d.ts +3 -0
- package/types/components/Attach/utils/getFileicon.d.ts.map +1 -0
- package/types/components/Attach/utils/index.d.ts +4 -0
- package/types/components/Attach/utils/index.d.ts.map +1 -0
- package/types/components/Attach/utils/truncateFilename.d.ts +2 -0
- package/types/components/Attach/utils/truncateFilename.d.ts.map +1 -0
- package/types/components/Attach/variations/_size/base.d.ts +2 -0
- package/types/components/Attach/variations/_size/base.d.ts.map +1 -0
- package/types/components/Attach/variations/_view/base.d.ts +2 -0
- package/types/components/Attach/variations/_view/base.d.ts.map +1 -0
- package/types/components/Cell/Cell.d.ts.map +1 -1
- package/types/components/Cell/Cell.types.d.ts +1 -1
- package/types/components/Cell/Cell.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Attach/Attach.config.d.ts +18 -0
- package/types/examples/plasma_b2c/components/Attach/Attach.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Attach/Attach.d.ts +13 -0
- package/types/examples/plasma_b2c/components/Attach/Attach.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts +2 -2
- package/types/examples/plasma_web/components/Attach/Attach.config.d.ts +18 -0
- package/types/examples/plasma_web/components/Attach/Attach.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Attach/Attach.d.ts +13 -0
- package/types/examples/plasma_web/components/Attach/Attach.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Cell/Cell.d.ts +2 -2
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"truncateFilename.js","sources":["../../../../src/components/Attach/utils/truncateFilename.ts"],"sourcesContent":["export const truncateFilename = (filename: string, startTruncationIndex: number, separator = '...') => {\n const strings = filename.split('.');\n\n const extension = strings.length > 1 ? strings[strings.length - 1] : null;\n const left = strings.length > 1 ? strings.slice(0, -1).join('.') : strings[0];\n\n const lastFilenameLetter = left[left.length - 1];\n const truncatedFilename = `${left.substring(0, startTruncationIndex)}${separator}${lastFilenameLetter}`;\n\n return extension ? `${truncatedFilename}.${extension}` : truncatedFilename;\n};\n"],"names":["truncateFilename","filename","startTruncationIndex","separator","arguments","length","undefined","strings","split","extension","left","slice","join","lastFilenameLetter","truncatedFilename","concat","substring"],"mappings":";;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,QAAgB,EAAEC,oBAA4B,EAAwB;AAAA,EAAA,IAAtBC,SAAS,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,KAAK,CAAA;AAC9F,EAAA,IAAMG,OAAO,GAAGN,QAAQ,CAACO,KAAK,CAAC,GAAG,CAAC,CAAA;AAEnC,EAAA,IAAMC,SAAS,GAAGF,OAAO,CAACF,MAAM,GAAG,CAAC,GAAGE,OAAO,CAACA,OAAO,CAACF,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAA;EACzE,IAAMK,IAAI,GAAGH,OAAO,CAACF,MAAM,GAAG,CAAC,GAAGE,OAAO,CAACI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,GAAGL,OAAO,CAAC,CAAC,CAAC,CAAA;EAE7E,IAAMM,kBAAkB,GAAGH,IAAI,CAACA,IAAI,CAACL,MAAM,GAAG,CAAC,CAAC,CAAA;EAChD,IAAMS,iBAAiB,MAAAC,MAAA,CAAML,IAAI,CAACM,SAAS,CAAC,CAAC,EAAEd,oBAAoB,CAAC,CAAA,CAAAa,MAAA,CAAGZ,SAAS,EAAAY,MAAA,CAAGF,kBAAkB,CAAE,CAAA;EAEvG,OAAOJ,SAAS,GAAAM,EAAAA,CAAAA,MAAA,CAAMD,iBAAiB,OAAAC,MAAA,CAAIN,SAAS,CAAA,GAAKK,iBAAiB,CAAA;AAC9E;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/Attach/variations/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens, classes } from '../../Attach.tokens';\n\nexport const base = css`\n &.${classes.horizontal} {\n column-gap: var(${tokens.horizontalGap});\n }\n\n &.${classes.vertical} {\n row-gap: var(${tokens.verticalGap});\n }\n\n &.${classes.auto} {\n row-gap: var(${tokens.verticalGap});\n column-gap: var(${tokens.horizontalGap});\n }\n}\n`;\n"],"names":["base"],"mappings":";;;;AAIO,IAAMA,IAAI,GAchB;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.b1pj1390.horizontal{-webkit-column-gap:var(--plasma-attach-horizontal-gap);column-gap:var(--plasma-attach-horizontal-gap);}.b1pj1390.vertical{row-gap:var(--plasma-attach-vertical-gap);}.b1pj1390.auto{row-gap:var(--plasma-attach-vertical-gap);-webkit-column-gap:var(--plasma-attach-horizontal-gap);column-gap:var(--plasma-attach-horizontal-gap);}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/Attach/variations/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes } from '../../Attach.tokens';\n\nexport const base = css`\n &.${classes.horizontal} {\n flex-direction: row;\n }\n\n &.${classes.vertical} {\n flex-direction: column;\n }\n\n &.${classes.auto} {\n flex-wrap: wrap;\n }\n`;\n"],"names":["base"],"mappings":";;;;AAIO,IAAMA,IAAI,GAYhB;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.b438e2d.horizontal{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.b438e2d.vertical{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.b438e2d.auto{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;}
|
@@ -27,7 +27,8 @@ var cellRoot = function cellRoot(Root) {
|
|
27
27
|
description = _ref.description,
|
28
28
|
content = _ref.content,
|
29
29
|
_ref$stretching = _ref.stretching,
|
30
|
-
stretching = _ref$stretching === void 0 ? 'filled' : _ref$stretching
|
30
|
+
stretching = _ref$stretching === void 0 ? 'filled' : _ref$stretching,
|
31
|
+
className = _ref.className;
|
31
32
|
var stretchingClass = Cell_tokens.classes["".concat(stretching, "Stretching")];
|
32
33
|
|
33
34
|
// Импорт старых свойств
|
@@ -37,7 +38,7 @@ var cellRoot = function cellRoot(Root) {
|
|
37
38
|
ref: outerRootRef,
|
38
39
|
size: size,
|
39
40
|
view: view,
|
40
|
-
className: index.cx(stretchingClass, Cell_tokens.classes.cellRoot)
|
41
|
+
className: index.cx(stretchingClass, Cell_tokens.classes.cellRoot, className)
|
41
42
|
}, contentLeftDeprecated && /*#__PURE__*/React.createElement(Cell_styles.CellLeft, {
|
42
43
|
align: alignContentLeft
|
43
44
|
}, contentLeftDeprecated), /*#__PURE__*/React.createElement(Cell_styles.CellContentWrapper, null, /*#__PURE__*/React.createElement(Cell_styles.CellContent, null, titleText || subtitle || label ? /*#__PURE__*/React.createElement(CellTextbox.CellTextbox, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Cell.js","sources":["../../../src/components/Cell/Cell.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { CellProps } from './Cell.types';\nimport { base, CellLeft, CellRight, CellContentWrapper, CellContent } from './Cell.styles';\nimport { classes } from './Cell.tokens';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { CellTextbox } from './ui/CellTextbox/CellTextbox';\n\nexport const cellRoot = (Root: RootProps<HTMLDivElement, CellProps>) =>\n forwardRef<HTMLDivElement, CellProps>(\n (\n {\n size,\n view,\n contentLeft,\n contentRight,\n alignContentLeft = 'center',\n alignContentRight = 'center',\n children,\n title,\n subtitle,\n label,\n description,\n content,\n stretching = 'filled',\n },\n outerRootRef,\n ) => {\n const stretchingClass = classes[`${stretching}Stretching` as keyof typeof classes];\n\n // Импорт старых свойств\n const titleText = title || description;\n const contentLeftDeprecated = contentLeft || content;\n\n return (\n <Root
|
1
|
+
{"version":3,"file":"Cell.js","sources":["../../../src/components/Cell/Cell.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { CellProps } from './Cell.types';\nimport { base, CellLeft, CellRight, CellContentWrapper, CellContent } from './Cell.styles';\nimport { classes } from './Cell.tokens';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { CellTextbox } from './ui/CellTextbox/CellTextbox';\n\nexport const cellRoot = (Root: RootProps<HTMLDivElement, CellProps>) =>\n forwardRef<HTMLDivElement, CellProps>(\n (\n {\n size,\n view,\n contentLeft,\n contentRight,\n alignContentLeft = 'center',\n alignContentRight = 'center',\n children,\n title,\n subtitle,\n label,\n description,\n content,\n stretching = 'filled',\n className,\n },\n outerRootRef,\n ) => {\n const stretchingClass = classes[`${stretching}Stretching` as keyof typeof classes];\n\n // Импорт старых свойств\n const titleText = title || description;\n const contentLeftDeprecated = contentLeft || content;\n\n return (\n <Root\n ref={outerRootRef}\n size={size}\n view={view}\n className={cx(stretchingClass, classes.cellRoot, className)}\n >\n {contentLeftDeprecated && <CellLeft align={alignContentLeft}>{contentLeftDeprecated}</CellLeft>}\n <CellContentWrapper>\n <CellContent>\n {titleText || subtitle || label ? (\n <CellTextbox label={label} title={titleText} subtitle={subtitle} />\n ) : (\n children\n )}\n </CellContent>\n {contentRight && <CellRight align={alignContentRight}>{contentRight}</CellRight>}\n </CellContentWrapper>\n </Root>\n );\n },\n );\n\nexport const cellConfig = {\n name: 'Cell',\n tag: 'div',\n layout: cellRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["cellRoot","Root","forwardRef","_ref","outerRootRef","size","view","contentLeft","contentRight","_ref$alignContentLeft","alignContentLeft","_ref$alignContentRigh","alignContentRight","children","title","subtitle","label","description","content","_ref$stretching","stretching","className","stretchingClass","classes","concat","titleText","contentLeftDeprecated","React","createElement","ref","cx","CellLeft","align","CellContentWrapper","CellContent","CellTextbox","CellRight","cellConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;IAYaA,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,IAA0C,EAAA;AAAA,EAAA,oBAC/DC,gBAAU,CACN,UAAAC,IAAA,EAiBIC,YAAY,EACX;AAAA,IAAA,IAhBGC,IAAI,GAAAF,IAAA,CAAJE,IAAI;MACJC,IAAI,GAAAH,IAAA,CAAJG,IAAI;MACJC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;MACXC,YAAY,GAAAL,IAAA,CAAZK,YAAY;MAAAC,qBAAA,GAAAN,IAAA,CACZO,gBAAgB;AAAhBA,MAAAA,gBAAgB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,qBAAA;MAAAE,qBAAA,GAAAR,IAAA,CAC3BS,iBAAiB;AAAjBA,MAAAA,iBAAiB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,qBAAA;MAC5BE,QAAQ,GAAAV,IAAA,CAARU,QAAQ;MACRC,KAAK,GAAAX,IAAA,CAALW,KAAK;MACLC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;MACRC,KAAK,GAAAb,IAAA,CAALa,KAAK;MACLC,WAAW,GAAAd,IAAA,CAAXc,WAAW;MACXC,O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AAAA;KAAoBJ,EAAAA,YAAwB,CAC/D,CAClB,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAM6B,UAAU,GAAG;AACtBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAExC,QAAQ;AAChByC,EAAAA,IAAI,EAAJA,gBAAI;AACJC,EAAAA,UAAU,EAAE;AACRpC,IAAAA,IAAI,EAAE;AACFqC,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDvC,IAAAA,IAAI,EAAE;AACFsC,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNxC,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
package/cjs/index.css
CHANGED
@@ -680,3 +680,17 @@
|
|
680
680
|
.base_11fpjfv_b14xop9w__3f9dd444 .base_11fpjfv_e1fh2i5t__3f9dd444{background:var( --plasma-editable-icon-background, linear-gradient(270deg,var(--plasma-editable-edit-button-background) 70%,rgba(0,0,0,0) 120%) );color:var(--plasma-editable-edit-button-color);}.base_11fpjfv_b14xop9w__3f9dd444:hover > .base_11fpjfv_e1fh2i5t__3f9dd444{color:var(--plasma-editable-edit-button-color-hover);}
|
681
681
|
|
682
682
|
.base_54y6eh_b1x5zqph__a3c52690 .base_54y6eh_e1fh2i5t__a3c52690{padding-left:var(--plasma-editable-edit-button-padding-left);}.base_54y6eh_b1x5zqph__a3c52690 .base_54y6eh_editableTextBox__a3c52690{margin-right:var(--plasma-editable-text-box-margin-right);padding-right:var(--plasma-editable-text-box-padding-right);}
|
683
|
+
|
684
|
+
.base_eax0b8_b1pj1390__bf96e72c.base_eax0b8_horizontal__bf96e72c{-webkit-column-gap:var(--plasma-attach-horizontal-gap);column-gap:var(--plasma-attach-horizontal-gap);}.base_eax0b8_b1pj1390__bf96e72c.base_eax0b8_vertical__bf96e72c{row-gap:var(--plasma-attach-vertical-gap);}.base_eax0b8_b1pj1390__bf96e72c.base_eax0b8_auto__bf96e72c{row-gap:var(--plasma-attach-vertical-gap);-webkit-column-gap:var(--plasma-attach-horizontal-gap);column-gap:var(--plasma-attach-horizontal-gap);}
|
685
|
+
|
686
|
+
.base_1nvsg1b_b438e2d__83d45116.base_1nvsg1b_horizontal__83d45116{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.base_1nvsg1b_b438e2d__83d45116.base_1nvsg1b_vertical__83d45116{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.base_1nvsg1b_b438e2d__83d45116.base_1nvsg1b_auto__83d45116{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;}
|
687
|
+
|
688
|
+
.Attach_styles_17fejif_by826kf__b001d2f6{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}
|
689
|
+
.Attach_styles_17fejif_sw7vb9c__b001d2f6{display:none;}
|
690
|
+
.Attach_styles_17fejif_suojwhg__b001d2f6{position:absolute;visibility:hidden;font-family:var(--plasma-attach-cell-title-font-family);font-size:var(--plasma-attach-cell-title-font-size);font-style:var(--plasma-attach-cell-title-font-style);font-weight:var(--plasma-attach-cell-title-font-weight);-webkit-letter-spacing:var(--plasma-attach-cell-title-letter-spacing);-moz-letter-spacing:var(--plasma-attach-cell-title-letter-spacing);-ms-letter-spacing:var(--plasma-attach-cell-title-letter-spacing);letter-spacing:var(--plasma-attach-cell-title-letter-spacing);line-height:var(--plasma-attach-cell-title-line-height);}
|
691
|
+
|
692
|
+
.Button_styles_oi6jxf_sfplb1t__92f1711d{--plasma-button-color:var(--plasma-attach-button-color);--plasma-button-background-color:var(--plasma-attach-button-background-color);--plasma-button-color-hover:var(--plasma-attach-button-color-hover);--plasma-button-background-color-hover:var(--plasma-attach-button-background-color-hover);--plasma-button-color-active:var(--plasma-attach-button-color-active);--plasma-button-background-color-active:var(--plasma-attach-button-background-color-active);--plasma-button-height:var(--plasma-attach-button-height);--plasma-button-width:var(--plasma-attach-button-width);--plasma-button-padding:var(--plasma-attach-button-padding);--plasma-button-radius:var(--plasma-attach-button-radius);--plasma-button-font-family:var(--plasma-attach-button-font-family);--plasma-button-font-size:var(--plasma-attach-button-font-size);--plasma-button-font-style:var(--plasma-attach-button-font-style);--plasma-button-font-weight:var(--plasma-attach-button-font-weight);--plasma-button-letter-spacing:var(--plasma-attach-button-letter-spacing);--plasma-button-line-height:var(--plasma-attach-button-line-height);}
|
693
|
+
|
694
|
+
.Cell_styles_1dlvsak_si1k6gv__6095305f{--plasma-cell-label-color:var(--plasma-attach-cell-label-color);--plasma-cell-title-color:var(--plasma-attach-cell-title-color);--plasma-cell-subtitle-color:var(--plasma-attach-cell-subtitle-color);--plasma-cell-background-color:var(--plasma-attach-cell-background-color);--plasma-cell-width:var(--plasma-attach-cell-width);--plasma-cell-padding:var(--plasma-attach-cell-padding);--plasma-cell-padding-left-content:var(--plasma-attach-cell-padding-left-content);--plasma-cell-padding-content:var(--plasma-attach-cell-padding-content);--plasma-cell-padding-right-content:var(--plasma-attach-cell-padding-right-content);--plasma-cell-textbox-gap:var(--plasma-attach-cell-textbox-gap);--plasma-cell-gap:var(--plasma-attach-cell-gap);--plasma-cell-label-font-family:var(--plasma-attach-cell-label-font-family);--plasma-cell-label-font-size:var(--plasma-attach-cell-label-font-size);--plasma-cell-label-font-style:var(--plasma-attach-cell-label-font-style);--plasma-cell-label-font-weight:var(--plasma-attach-cell-label-font-weight);--plasma-cell-label-letter-spacing:var(--plasma-attach-cell-label-letter-spacing);--plasma-cell-label-line-height:var(--plasma-attach-cell-label-line-height);--plasma-cell-title-font-family:var(--plasma-attach-cell-title-font-family);--plasma-cell-title-font-size:var(--plasma-attach-cell-title-font-size);--plasma-cell-title-font-style:var(--plasma-attach-cell-title-font-style);--plasma-cell-title-font-weight:var(--plasma-attach-cell-title-font-weight);--plasma-cell-title-letter-spacing:var(--plasma-attach-cell-title-letter-spacing);--plasma-cell-title-line-height:var(--plasma-attach-cell-title-line-height);--plasma-cell-subtitle-font-family:var(--plasma-attach-cell-subtitle-font-family);--plasma-cell-subtitle-font-size:var(--plasma-attach-cell-subtitle-font-size);--plasma-cell-subtitle-font-style:var(--plasma-attach-cell-subtitle-font-style);--plasma-cell-subtitle-font-weight:var(--plasma-attach-cell-subtitle-font-weight);--plasma-cell-subtitle-letter-spacing:var(--plasma-attach-cell-subtitle-letter-spacing);--plasma-cell-subtitle-line-height:var(--plasma-attach-cell-subtitle-line-height);width:-webkit-fit-content !important;width:-moz-fit-content !important;width:fit-content !important;}.Cell_styles_1dlvsak_si1k6gv__6095305f.Cell_styles_1dlvsak_cellHidden__6095305f{visibility:hidden;}
|
695
|
+
|
696
|
+
.IconButton_styles_14dty7n_sdel9u5__d56017d3{--plasma-icon-button-color:var(--plasma-attach-icon-button-color);--plasma-icon-button-background-color:var(--plasma-attach-icon-button-background-color);--plasma-icon-button-color-hover:var(--plasma-attach-icon-button-color-hover);--plasma-icon-button-background-color-hover:var(--plasma-attach-icon-button-background-color-hover);--plasma-icon-button-color-active:var(--plasma-attach-icon-button-color-active);--plasma-icon-button-background-color-active:var(--plasma-attach-icon-button-background-color-active);--plasma-icon-button-height:var(--plasma-attach-icon-button-height);--plasma-icon-button-width:var(--plasma-attach-icon-button-width);--plasma-icon-button-padding:var(--plasma-attach-icon-button-padding);--plasma-icon-button-radius:var(--plasma-attach-icon-button-radius);--plasma-icon-button-font-family:var(--plasma-attach-icon-button-font-family);--plasma-icon-button-font-size:var(--plasma-attach-icon-button-font-size);--plasma-icon-button-font-style:var(--plasma-attach-icon-button-font-style);--plasma-icon-button-font-weight:var(--plasma-attach-icon-button-font-weight);--plasma-icon-button-letter-spacing:var(--plasma-attach-icon-button-letter-spacing);--plasma-icon-button-line-height:var(--plasma-attach-icon-button-line-height);}
|
package/cjs/index.js
CHANGED
@@ -189,6 +189,8 @@ var EmptyState = require('./components/EmptyState/EmptyState.js');
|
|
189
189
|
var EmptyState_tokens = require('./components/EmptyState/EmptyState.tokens.js');
|
190
190
|
var Editable = require('./components/Editable/Editable.js');
|
191
191
|
var Editable_tokens = require('./components/Editable/Editable.tokens.js');
|
192
|
+
var Attach = require('./components/Attach/Attach.js');
|
193
|
+
var Attach_tokens = require('./components/Attach/Attach.tokens.js');
|
192
194
|
var common = require('./engines/common.js');
|
193
195
|
var canUseDOM = require('./utils/canUseDOM.js');
|
194
196
|
var extractTextFrom = require('./utils/extractTextFrom.js');
|
@@ -559,6 +561,9 @@ exports.emptyStateTokens = EmptyState_tokens.tokens;
|
|
559
561
|
exports.editableConfig = Editable.editableConfig;
|
560
562
|
exports.editableRoot = Editable.editableRoot;
|
561
563
|
exports.editableTokens = Editable_tokens.tokens;
|
564
|
+
exports.attachConfig = Attach.attachConfig;
|
565
|
+
exports.attachRoot = Attach.attachRoot;
|
566
|
+
exports.attachTokens = Attach_tokens.tokens;
|
562
567
|
exports.component = common.component;
|
563
568
|
exports.mergeConfig = common.mergeConfig;
|
564
569
|
exports.canUseDOM = canUseDOM.canUseDOM;
|
package/cjs/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -0,0 +1,180 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.attachRoot = exports.attachConfig = void 0;
|
8
|
+
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
+
var _plasmaIcons = /*#__PURE__*/require("@salutejs/plasma-icons");
|
10
|
+
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
11
|
+
var _utils = /*#__PURE__*/require("../../utils");
|
12
|
+
var _base = /*#__PURE__*/require("./variations/_size/base");
|
13
|
+
var _base2 = /*#__PURE__*/require("./variations/_view/base");
|
14
|
+
var _Attach = /*#__PURE__*/require("./Attach.styles");
|
15
|
+
var _Button = /*#__PURE__*/require("./ui/Button/Button");
|
16
|
+
var _Cell = /*#__PURE__*/require("./ui/Cell/Cell");
|
17
|
+
var _IconButton = /*#__PURE__*/require("./ui/iconButton/IconButton");
|
18
|
+
var _utils2 = /*#__PURE__*/require("./utils");
|
19
|
+
var _Attach2 = /*#__PURE__*/require("./Attach.tokens");
|
20
|
+
var _IconCloseCircleOutli;
|
21
|
+
var _excluded = ["flow", "text", "hasAttachment", "acceptedFileFormats", "size", "view", "className"];
|
22
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
24
|
+
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); }
|
25
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
26
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
27
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
28
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
29
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
30
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
31
|
+
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; }
|
32
|
+
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; }
|
33
|
+
var attachRoot = exports.attachRoot = function attachRoot(Root) {
|
34
|
+
return /*#__PURE__*/(0, _react.forwardRef)(function (props, outerRef) {
|
35
|
+
var _props$flow = props.flow,
|
36
|
+
flow = _props$flow === void 0 ? 'auto' : _props$flow,
|
37
|
+
_props$text = props.text,
|
38
|
+
text = _props$text === void 0 ? 'Загрузить файл' : _props$text,
|
39
|
+
_props$hasAttachment = props.hasAttachment,
|
40
|
+
hasAttachment = _props$hasAttachment === void 0 ? true : _props$hasAttachment,
|
41
|
+
acceptedFileFormats = props.acceptedFileFormats,
|
42
|
+
size = props.size,
|
43
|
+
view = props.view,
|
44
|
+
className = props.className,
|
45
|
+
rest = _objectWithoutProperties(props, _excluded);
|
46
|
+
var inputRef = (0, _react.useRef)(null);
|
47
|
+
var inputHelperRef = (0, _react.useRef)(null);
|
48
|
+
var cellRef = (0, _react.useRef)(null);
|
49
|
+
var innerRef = (0, _react.useRef)(null);
|
50
|
+
var ref = (0, _plasmaCore.useForkRef)(outerRef, innerRef);
|
51
|
+
var _useState = (0, _react.useState)(null),
|
52
|
+
_useState2 = _slicedToArray(_useState, 2),
|
53
|
+
containerWidth = _useState2[0],
|
54
|
+
setContainerWidth = _useState2[1];
|
55
|
+
var _useState3 = (0, _react.useState)(null),
|
56
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
57
|
+
origFilename = _useState4[0],
|
58
|
+
setOrigFilename = _useState4[1];
|
59
|
+
var _useState5 = (0, _react.useState)(null),
|
60
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
61
|
+
filename = _useState6[0],
|
62
|
+
setFilename = _useState6[1];
|
63
|
+
var _useState7 = (0, _react.useState)(false),
|
64
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
65
|
+
shouldUpdateFilename = _useState8[0],
|
66
|
+
setShouldUpdateFilename = _useState8[1];
|
67
|
+
var horizontalClass = flow === 'horizontal' ? _Attach2.classes.horizontal : undefined;
|
68
|
+
var verticalClass = flow === 'vertical' ? _Attach2.classes.vertical : undefined;
|
69
|
+
var autoClass = flow === 'auto' ? _Attach2.classes.auto : undefined;
|
70
|
+
var cellHiddenClass = shouldUpdateFilename ? _Attach2.classes.cellHidden : undefined;
|
71
|
+
var accept = acceptedFileFormats === null || acceptedFileFormats === void 0 ? void 0 : acceptedFileFormats.join(',');
|
72
|
+
var extension = filename ? (0, _utils2.extractExtension)(filename) : null;
|
73
|
+
var contentLeft = extension ? (0, _utils2.getFileicon)(extension) : null;
|
74
|
+
var handleClick = function handleClick() {
|
75
|
+
if (!inputRef.current) {
|
76
|
+
return;
|
77
|
+
}
|
78
|
+
inputRef.current.click();
|
79
|
+
};
|
80
|
+
var handleChange = function handleChange() {
|
81
|
+
if (!inputRef.current || !inputRef.current.files) {
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
setOrigFilename(inputRef.current.files[0].name);
|
85
|
+
};
|
86
|
+
var handleClear = function handleClear() {
|
87
|
+
if (!inputRef.current) {
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
inputRef.current.value = '';
|
91
|
+
setOrigFilename(null);
|
92
|
+
};
|
93
|
+
(0, _plasmaCore.useResizeObserver)(innerRef, function (container) {
|
94
|
+
setContainerWidth(container.offsetWidth);
|
95
|
+
});
|
96
|
+
(0, _react.useEffect)(function () {
|
97
|
+
setFilename(origFilename);
|
98
|
+
setShouldUpdateFilename(true);
|
99
|
+
}, [size, view, flow, origFilename, containerWidth]);
|
100
|
+
(0, _react.useEffect)(function () {
|
101
|
+
if (!cellRef.current || !cellRef.current.parentElement || !inputHelperRef.current || !inputHelperRef.current.textContent || !origFilename || !shouldUpdateFilename) {
|
102
|
+
setShouldUpdateFilename(false);
|
103
|
+
return;
|
104
|
+
}
|
105
|
+
var textWidth = inputHelperRef.current.offsetWidth;
|
106
|
+
var _cellRef$current$getB = cellRef.current.getBoundingClientRect(),
|
107
|
+
cellWidth = _cellRef$current$getB.width,
|
108
|
+
cellLeft = _cellRef$current$getB.left;
|
109
|
+
var _cellRef$current$pare = cellRef.current.parentElement.getBoundingClientRect(),
|
110
|
+
parentWidth = _cellRef$current$pare.width,
|
111
|
+
parentLeft = _cellRef$current$pare.left;
|
112
|
+
var cellLeftRightContentWidth = cellWidth - textWidth;
|
113
|
+
var leftDiff = cellLeft - parentLeft;
|
114
|
+
var index = origFilename.length - 1;
|
115
|
+
var currentTextWidth = textWidth;
|
116
|
+
var resultFilename = origFilename;
|
117
|
+
while (currentTextWidth + cellLeftRightContentWidth + leftDiff > parentWidth && index >= 1) {
|
118
|
+
var truncatedFilename = (0, _utils2.truncateFilename)(inputHelperRef.current.textContent, index);
|
119
|
+
inputHelperRef.current.textContent = truncatedFilename;
|
120
|
+
resultFilename = truncatedFilename;
|
121
|
+
currentTextWidth = inputHelperRef.current.offsetWidth;
|
122
|
+
index -= 1;
|
123
|
+
}
|
124
|
+
inputHelperRef.current.textContent = origFilename;
|
125
|
+
setFilename(resultFilename);
|
126
|
+
setShouldUpdateFilename(false);
|
127
|
+
}, [shouldUpdateFilename]);
|
128
|
+
return /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
129
|
+
className: (0, _utils.cx)(horizontalClass, verticalClass, autoClass, className),
|
130
|
+
size: size,
|
131
|
+
view: view,
|
132
|
+
ref: ref
|
133
|
+
}, rest), /*#__PURE__*/_react["default"].createElement(_Attach.StyledHiddenInput, {
|
134
|
+
ref: inputRef,
|
135
|
+
accept: accept,
|
136
|
+
type: "file",
|
137
|
+
id: "attachHiddenInput",
|
138
|
+
name: "attachHiddenInput",
|
139
|
+
onChange: handleChange
|
140
|
+
}), /*#__PURE__*/_react["default"].createElement(_Attach.StyledHiddenInputHelper, {
|
141
|
+
ref: inputHelperRef,
|
142
|
+
id: "attachHiddenInputHelper"
|
143
|
+
}, origFilename), /*#__PURE__*/_react["default"].createElement(_Button.StyledButton, {
|
144
|
+
size: size,
|
145
|
+
view: view,
|
146
|
+
onClick: handleClick,
|
147
|
+
text: text
|
148
|
+
}), hasAttachment && filename && /*#__PURE__*/_react["default"].createElement(_Cell.StyledCell, {
|
149
|
+
className: cellHiddenClass,
|
150
|
+
ref: cellRef,
|
151
|
+
size: size,
|
152
|
+
view: view,
|
153
|
+
title: filename,
|
154
|
+
contentLeft: contentLeft,
|
155
|
+
contentRight: /*#__PURE__*/_react["default"].createElement(_IconButton.StyledIconButton, {
|
156
|
+
onClick: handleClear
|
157
|
+
}, _IconCloseCircleOutli || (_IconCloseCircleOutli = /*#__PURE__*/_react["default"].createElement(_plasmaIcons.IconCloseCircleOutline, {
|
158
|
+
size: "xs"
|
159
|
+
})))
|
160
|
+
}));
|
161
|
+
});
|
162
|
+
};
|
163
|
+
var attachConfig = exports.attachConfig = {
|
164
|
+
name: 'Attach',
|
165
|
+
tag: 'div',
|
166
|
+
layout: attachRoot,
|
167
|
+
base: _Attach.base,
|
168
|
+
variations: {
|
169
|
+
view: {
|
170
|
+
css: _base2.base
|
171
|
+
},
|
172
|
+
size: {
|
173
|
+
css: _base.base
|
174
|
+
}
|
175
|
+
},
|
176
|
+
defaults: {
|
177
|
+
view: 'default',
|
178
|
+
size: 'm'
|
179
|
+
}
|
180
|
+
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.base = exports.StyledHiddenInputHelper = exports.StyledHiddenInput = void 0;
|
7
|
+
var _base = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("@emotion/styled/base"));
|
8
|
+
var _react = /*#__PURE__*/require("@emotion/react");
|
9
|
+
var _Attach = /*#__PURE__*/require("./Attach.tokens");
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
+
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)."; }
|
12
|
+
var base = exports.base = process.env.NODE_ENV === "production" ? {
|
13
|
+
name: "aoyioq-plasma-new-hope__base",
|
14
|
+
styles: "position:relative;display:flex;width:fit-content;label:plasma-new-hope__base;"
|
15
|
+
} : {
|
16
|
+
name: "aoyioq-plasma-new-hope__base",
|
17
|
+
styles: "position:relative;display:flex;width:fit-content;label:plasma-new-hope__base;",
|
18
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQXR0YWNoL0F0dGFjaC5zdHlsZXMudHM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2tlbnMuY2VsbFRpdGxlTGV0dGVyU3BhY2luZ30pO1xuICAgIGxpbmUtaGVpZ2h0OiB2YXIoJHthdHRhY2hUb2tlbnMuY2VsbFRpdGxlTGluZUhlaWdodH0pO1xuYDtcbiJdfQ== */",
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
20
|
+
};
|
21
|
+
var StyledHiddenInput = exports.StyledHiddenInput = /*#__PURE__*/(0, _base["default"])("input", {
|
22
|
+
target: "e3npccl1",
|
23
|
+
label: "plasma-new-hope__StyledHiddenInput"
|
24
|
+
})(process.env.NODE_ENV === "production" ? {
|
25
|
+
name: "eivff4",
|
26
|
+
styles: "display:none"
|
27
|
+
} : {
|
28
|
+
name: "eivff4",
|
29
|
+
styles: "display:none",
|
30
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQXR0YWNoL0F0dGFjaC5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBVzZDIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQXR0YWNoL0F0dGFjaC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7IHRva2VucyBhcyBhdHRhY2hUb2tlbnMgfSBmcm9tICcuL0F0dGFjaC50b2tlbnMnO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgZGlzcGxheTogZmxleDtcbiAgICB3aWR0aDogZml0LWNvbnRlbnQ7XG5gO1xuXG5leHBvcnQgY29uc3QgU3R5bGVkSGlkZGVuSW5wdXQgPSBzdHlsZWQuaW5wdXRgXG4gICAgZGlzcGxheTogbm9uZTtcbmA7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRIaWRkZW5JbnB1dEhlbHBlciA9IHN0eWxlZC5kaXZgXG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHZpc2liaWxpdHk6IGhpZGRlbjtcblxuICAgIGZvbnQtZmFtaWx5OiB2YXIoJHthdHRhY2hUb2tlbnMuY2VsbFRpdGxlRm9udEZhbWlseX0pO1xuICAgIGZvbnQtc2l6ZTogdmFyKCR7YXR0YWNoVG9rZW5zLmNlbGxUaXRsZUZvbnRTaXplfSk7XG4gICAgZm9udC1zdHlsZTogdmFyKCR7YXR0YWNoVG9rZW5zLmNlbGxUaXRsZUZvbnRTdHlsZX0pO1xuICAgIGZvbnQtd2VpZ2h0OiB2YXIoJHthdHRhY2hUb2tlbnMuY2VsbFRpdGxlRm9udFdlaWdodH0pO1xuICAgIGxldHRlci1zcGFjaW5nOiB2YXIoJHthdHRhY2hUb2tlbnMuY2VsbFRpdGxlTGV0dGVyU3BhY2luZ30pO1xuICAgIGxpbmUtaGVpZ2h0OiB2YXIoJHthdHRhY2hUb2tlbnMuY2VsbFRpdGxlTGluZUhlaWdodH0pO1xuYDtcbiJdfQ== */",
|
31
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
32
|
+
});
|
33
|
+
var StyledHiddenInputHelper = exports.StyledHiddenInputHelper = /*#__PURE__*/(0, _base["default"])("div", {
|
34
|
+
target: "e3npccl0",
|
35
|
+
label: "plasma-new-hope__StyledHiddenInputHelper"
|
36
|
+
})("position:absolute;visibility:hidden;font-family:var(", _Attach.tokens.cellTitleFontFamily, ");font-size:var(", _Attach.tokens.cellTitleFontSize, ");font-style:var(", _Attach.tokens.cellTitleFontStyle, ");font-weight:var(", _Attach.tokens.cellTitleFontWeight, ");letter-spacing:var(", _Attach.tokens.cellTitleLetterSpacing, ");line-height:var(", _Attach.tokens.cellTitleLineHeight, ");" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQXR0YWNoL0F0dGFjaC5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZWlEIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQXR0YWNoL0F0dGFjaC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7IHRva2VucyBhcyBhdHRhY2hUb2tlbnMgfSBmcm9tICcuL0F0dGFjaC50b2tlbnMnO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgZGlzcGxheTogZmxleDtcbiAgICB3aWR0aDogZml0LWNvbnRlbnQ7XG5gO1xuXG5leHBvcnQgY29uc3QgU3R5bGVkSGlkZGVuSW5wdXQgPSBzdHlsZWQuaW5wdXRgXG4gICAgZGlzcGxheTogbm9uZTtcbmA7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRIaWRkZW5JbnB1dEhlbHBlciA9IHN0eWxlZC5kaXZgXG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHZpc2liaWxpdHk6IGhpZGRlbjtcblxuICAgIGZvbnQtZmFtaWx5OiB2YXIoJHthdHRhY2hUb2tlbnMuY2VsbFRpdGxlRm9udEZhbWlseX0pO1xuICAgIGZvbnQtc2l6ZTogdmFyKCR7YXR0YWNoVG9rZW5zLmNlbGxUaXRsZUZvbnRTaXplfSk7XG4gICAgZm9udC1zdHlsZTogdmFyKCR7YXR0YWNoVG9rZW5zLmNlbGxUaXRsZUZvbnRTdHlsZX0pO1xuICAgIGZvbnQtd2VpZ2h0OiB2YXIoJHthdHRhY2hUb2tlbnMuY2VsbFRpdGxlRm9udFdlaWdodH0pO1xuICAgIGxldHRlci1zcGFjaW5nOiB2YXIoJHthdHRhY2hUb2tlbnMuY2VsbFRpdGxlTGV0dGVyU3BhY2luZ30pO1xuICAgIGxpbmUtaGVpZ2h0OiB2YXIoJHthdHRhY2hUb2tlbnMuY2VsbFRpdGxlTGluZUhlaWdodH0pO1xuYDtcbiJdfQ== */"));
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
id: attach
|
3
|
+
title: Attach
|
4
|
+
---
|
5
|
+
|
6
|
+
import { PropsTable, Description } from '@site/src/components';
|
7
|
+
|
8
|
+
# Attach
|
9
|
+
<Description name="Attach" />
|
10
|
+
<PropsTable name="Attach" />
|
11
|
+
|
12
|
+
## Примеры
|
13
|
+
|
14
|
+
### Расположение элементов
|
15
|
+
C помощью свойства `flow` можно регулировать расположение элементов в зависимости от ширины контейнера.
|
16
|
+
|
17
|
+
```tsx live
|
18
|
+
import React from 'react';
|
19
|
+
import { Attach } from '@salutejs/plasma-web';
|
20
|
+
|
21
|
+
export function App() {
|
22
|
+
return (
|
23
|
+
<div style=\{{ display: "flex", flexDirection: "column", gap: "100px"}}>
|
24
|
+
<Attach style=\{{ width: "400px" }} flow="auto" />
|
25
|
+
<Attach style=\{{ width: "400px" }} flow="horizontal" />
|
26
|
+
<Attach style=\{{ width: "400px" }} flow="vertical" />
|
27
|
+
</div>
|
28
|
+
);
|
29
|
+
}
|
30
|
+
```
|
31
|
+
|
32
|
+
### Фильтр форматов файлов
|
33
|
+
Свойство `acceptedFileFormats` устанавливает доступные форматы файлов.
|
34
|
+
|
35
|
+
```tsx live
|
36
|
+
import React from 'react';
|
37
|
+
import { Attach } from '@salutejs/plasma-web';
|
38
|
+
|
39
|
+
export function App() {
|
40
|
+
return (
|
41
|
+
<div>
|
42
|
+
<Attach acceptedFileFormats={['.pdf', '.doc']} />
|
43
|
+
</div>
|
44
|
+
);
|
45
|
+
}
|
46
|
+
```
|
@@ -0,0 +1,81 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.tokens = exports.classes = void 0;
|
7
|
+
var classes = exports.classes = {
|
8
|
+
auto: 'auto',
|
9
|
+
horizontal: 'horizontal',
|
10
|
+
vertical: 'vertical',
|
11
|
+
cellHidden: 'cell-hidden'
|
12
|
+
};
|
13
|
+
var tokens = exports.tokens = {
|
14
|
+
horizontalGap: '--plasma-attach-horizontal-gap',
|
15
|
+
verticalGap: '--plasma-attach-vertical-gap',
|
16
|
+
// Токены для Button
|
17
|
+
buttonColor: '--plasma-attach-button-color',
|
18
|
+
buttonBackgroundColor: '--plasma-attach-button-background-color',
|
19
|
+
buttonColorHover: '--plasma-attach-button-color-hover',
|
20
|
+
buttonBackgroundColorHover: '--plasma-attach-button-background-color-hover',
|
21
|
+
buttonColorActive: '--plasma-attach-button-color-active',
|
22
|
+
buttonBackgroundColorActive: '--plasma-attach-button-background-color-active',
|
23
|
+
buttonHeight: '--plasma-attach-button-height',
|
24
|
+
buttonWidth: '--plasma-attach-button-width',
|
25
|
+
buttonPadding: '--plasma-attach-button-padding',
|
26
|
+
buttonRadius: '--plasma-attach-button-radius',
|
27
|
+
buttonFontFamily: '--plasma-attach-button-font-family',
|
28
|
+
buttonFontSize: '--plasma-attach-button-font-size',
|
29
|
+
buttonFontStyle: '--plasma-attach-button-font-style',
|
30
|
+
buttonFontWeight: '--plasma-attach-button-font-weight',
|
31
|
+
buttonLetterSpacing: '--plasma-attach-button-letter-spacing',
|
32
|
+
buttonLineHeight: '--plasma-attach-button-line-height',
|
33
|
+
// Токены для Cell
|
34
|
+
cellColor: '--plasma-attach-cell-color',
|
35
|
+
cellLabelColor: '--plasma-attach-cell-label-color',
|
36
|
+
cellTitleColor: '--plasma-attach-cell-title-color',
|
37
|
+
cellSubtitleColor: '--plasma-attach-cell-subtitle-color',
|
38
|
+
cellBackgroundColor: '--plasma-attach-cell-background-color',
|
39
|
+
cellWidth: '--plasma-attach-cell-width',
|
40
|
+
cellPadding: '--plasma-attach-cell-padding',
|
41
|
+
cellPaddingLeftContent: '--plasma-attach-cell-padding-left-content',
|
42
|
+
cellPaddingContent: '--plasma-attach-cell-padding-content',
|
43
|
+
cellPaddingRightContent: '--plasma-attach-cell-padding-right-content',
|
44
|
+
cellTextboxGap: '--plasma-attach-cell-textbox-gap',
|
45
|
+
cellGap: '--plasma-attach-cell-gap',
|
46
|
+
cellLabelFontFamily: '--plasma-attach-cell-label-font-family',
|
47
|
+
cellLabelFontSize: '--plasma-attach-cell-label-font-size',
|
48
|
+
cellLabelFontStyle: '--plasma-attach-cell-label-font-style',
|
49
|
+
cellLabelFontWeight: '--plasma-attach-cell-label-font-weight',
|
50
|
+
cellLabelLetterSpacing: '--plasma-attach-cell-label-letter-spacing',
|
51
|
+
cellLabelLineHeight: '--plasma-attach-cell-label-line-height',
|
52
|
+
cellTitleFontFamily: '--plasma-attach-cell-title-font-family',
|
53
|
+
cellTitleFontSize: '--plasma-attach-cell-title-font-size',
|
54
|
+
cellTitleFontStyle: '--plasma-attach-cell-title-font-style',
|
55
|
+
cellTitleFontWeight: '--plasma-attach-cell-title-font-weight',
|
56
|
+
cellTitleLetterSpacing: '--plasma-attach-cell-title-letter-spacing',
|
57
|
+
cellTitleLineHeight: '--plasma-attach-cell-title-line-height',
|
58
|
+
cellSubtitleFontFamily: '--plasma-attach-cell-subtitle-font-family',
|
59
|
+
cellSubtitleFontSize: '--plasma-attach-cell-subtitle-font-size',
|
60
|
+
cellSubtitleFontStyle: '--plasma-attach-cell-subtitle-font-style',
|
61
|
+
cellSubtitleFontWeight: '--plasma-attach-cell-subtitle-font-weight',
|
62
|
+
cellSubtitleLetterSpacing: '--plasma-attach-cell-subtitle-letter-spacing',
|
63
|
+
cellSubtitleLineHeight: '--plasma-attach-cell-subtitle-line-height',
|
64
|
+
// Токены для IconButton
|
65
|
+
iconButtonColor: '--plasma-attach-icon-button-color',
|
66
|
+
iconButtonBackgroundColor: '--plasma-attach-icon-button-background-color',
|
67
|
+
iconButtonColorHover: '--plasma-attach-icon-button-color-hover',
|
68
|
+
iconButtonBackgroundColorHover: '--plasma-attach-icon-button-background-color-hover',
|
69
|
+
iconButtonColorActive: '--plasma-attach-icon-button-color-active',
|
70
|
+
iconButtonBackgroundColorActive: '--plasma-attach-icon-button-background-color-active',
|
71
|
+
iconButtonHeight: '--plasma-attach-icon-button-height',
|
72
|
+
iconButtonWidth: '--plasma-attach-icon-button-width',
|
73
|
+
iconButtonPadding: '--plasma-attach-icon-button-padding',
|
74
|
+
iconButtonRadius: '--plasma-attach-icon-button-radius',
|
75
|
+
iconButtonFontFamily: '--plasma-attach-icon-button-font-family',
|
76
|
+
iconButtonFontSize: '--plasma-attach-icon-button-font-size',
|
77
|
+
iconButtonFontStyle: '--plasma-attach-icon-button-font-style',
|
78
|
+
iconButtonFontWeight: '--plasma-attach-icon-button-font-weight',
|
79
|
+
iconButtonLetterSpacing: '--plasma-attach-icon-button-letter-spacing',
|
80
|
+
iconButtonLineHeight: '--plasma-attach-icon-button-line-height'
|
81
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "attachConfig", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _Attach.attachConfig;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "attachRoot", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _Attach.attachRoot;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
Object.defineProperty(exports, "attachTokens", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function get() {
|
21
|
+
return _Attach2.tokens;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
var _Attach = /*#__PURE__*/require("./Attach");
|
25
|
+
var _Attach2 = /*#__PURE__*/require("./Attach.tokens");
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "StyledButton", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _Button.StyledButton;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
var _Button = /*#__PURE__*/require("./Button.styles");
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.StyledButton = void 0;
|
7
|
+
var _base = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("@emotion/styled/base"));
|
8
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
|
+
var _Button = /*#__PURE__*/require("../../../Button");
|
10
|
+
var _Attach = /*#__PURE__*/require("../../Attach.tokens");
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
12
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Button.buttonConfig);
|
13
|
+
var Button = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
14
|
+
var StyledButton = exports.StyledButton = /*#__PURE__*/(0, _base["default"])(Button, {
|
15
|
+
target: "ecnclho0",
|
16
|
+
label: "plasma-new-hope__StyledButton"
|
17
|
+
})(_Button.buttonTokens.buttonColor, ":var(", _Attach.tokens.buttonColor, ");", _Button.buttonTokens.buttonBackgroundColor, ":var(", _Attach.tokens.buttonBackgroundColor, ");", _Button.buttonTokens.buttonColorHover, ":var(", _Attach.tokens.buttonColorHover, ");", _Button.buttonTokens.buttonBackgroundColorHover, ":var(", _Attach.tokens.buttonBackgroundColorHover, ");", _Button.buttonTokens.buttonColorActive, ":var(", _Attach.tokens.buttonColorActive, ");", _Button.buttonTokens.buttonBackgroundColorActive, ":var(", _Attach.tokens.buttonBackgroundColorActive, ");", _Button.buttonTokens.buttonHeight, ":var(", _Attach.tokens.buttonHeight, ");", _Button.buttonTokens.buttonWidth, ":var(", _Attach.tokens.buttonWidth, ");", _Button.buttonTokens.buttonPadding, ":var(", _Attach.tokens.buttonPadding, ");", _Button.buttonTokens.buttonRadius, ":var(", _Attach.tokens.buttonRadius, ");", _Button.buttonTokens.buttonFontFamily, ":var(", _Attach.tokens.buttonFontFamily, ");", _Button.buttonTokens.buttonFontSize, ":var(", _Attach.tokens.buttonFontSize, ");", _Button.buttonTokens.buttonFontStyle, ":var(", _Attach.tokens.buttonFontStyle, ");", _Button.buttonTokens.buttonFontWeight, ":var(", _Attach.tokens.buttonFontWeight, ");", _Button.buttonTokens.buttonLetterSpacing, ":var(", _Attach.tokens.buttonLetterSpacing, ");", _Button.buttonTokens.buttonLineHeight, ":var(", _Attach.tokens.buttonLineHeight, ");" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQXR0YWNoL3VpL0J1dHRvbi9CdXR0b24uc3R5bGVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFTMEMiLCJmaWxlIjoiLi4vLi4vLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9BdHRhY2gvdWkvQnV0dG9uL0J1dHRvbi5zdHlsZXMudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBjb21wb25lb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|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "StyledCell", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _Cell.StyledCell;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
var _Cell = /*#__PURE__*/require("./Cell.styles");
|