@salutejs/plasma-new-hope 0.194.0-canary.1568.11891833298.0 → 0.195.0-canary.1534.11893340297.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +333 -0
  2. package/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  3. package/cjs/components/Dropzone/Dropzone.css +15 -0
  4. package/cjs/components/Dropzone/Dropzone.js +252 -0
  5. package/cjs/components/Dropzone/Dropzone.js.map +1 -0
  6. package/cjs/components/Dropzone/Dropzone.styles.js +47 -0
  7. package/cjs/components/Dropzone/Dropzone.styles.js.map +1 -0
  8. package/cjs/components/Dropzone/Dropzone.styles_1fo7dbq.css +7 -0
  9. package/cjs/components/Dropzone/Dropzone.tokens.js +46 -0
  10. package/cjs/components/Dropzone/Dropzone.tokens.js.map +1 -0
  11. package/cjs/components/Dropzone/variations/_disabled/base.js +9 -0
  12. package/cjs/components/Dropzone/variations/_disabled/base.js.map +1 -0
  13. package/cjs/components/Dropzone/variations/_disabled/base_3qwygi.css +1 -0
  14. package/cjs/components/Dropzone/variations/_size/base.js +9 -0
  15. package/cjs/components/Dropzone/variations/_size/base.js.map +1 -0
  16. package/cjs/components/Dropzone/variations/_size/base_1cl61bm.css +1 -0
  17. package/cjs/components/Dropzone/variations/_view/base.js +9 -0
  18. package/cjs/components/Dropzone/variations/_view/base.js.map +1 -0
  19. package/cjs/components/Dropzone/variations/_view/base_cipwu9.css +1 -0
  20. package/cjs/components/_Icon/Icon.assets/ArrowBarDown.js +24 -0
  21. package/cjs/components/_Icon/Icon.assets/ArrowBarDown.js.map +1 -0
  22. package/cjs/components/_Icon/Icons/IconArrowBarDown.js +23 -0
  23. package/cjs/components/_Icon/Icons/IconArrowBarDown.js.map +1 -0
  24. package/cjs/index.css +14 -0
  25. package/cjs/index.js +6 -0
  26. package/cjs/index.js.map +1 -1
  27. package/emotion/cjs/components/Dropzone/Dropzone.js +271 -0
  28. package/emotion/cjs/components/Dropzone/Dropzone.styles.js +67 -0
  29. package/emotion/cjs/components/Dropzone/Dropzone.template-docs.mdx +136 -0
  30. package/emotion/cjs/components/Dropzone/Dropzone.tokens.js +43 -0
  31. package/emotion/cjs/components/Dropzone/Dropzone.types.js +5 -0
  32. package/emotion/cjs/components/Dropzone/index.js +31 -0
  33. package/emotion/cjs/components/Dropzone/variations/_disabled/base.js +9 -0
  34. package/emotion/cjs/components/Dropzone/variations/_disabled/tokens.json +4 -0
  35. package/emotion/cjs/components/Dropzone/variations/_size/base.js +10 -0
  36. package/emotion/cjs/components/Dropzone/variations/_size/tokens.json +19 -0
  37. package/emotion/cjs/components/Dropzone/variations/_view/base.js +10 -0
  38. package/emotion/cjs/components/Dropzone/variations/_view/tokens.json +9 -0
  39. package/emotion/cjs/components/_Icon/Icon.assets/ArrowBarDown.js +23 -0
  40. package/emotion/cjs/components/_Icon/Icons/IconArrowBarDown.js +22 -0
  41. package/emotion/cjs/components/_Icon/index.js +8 -1
  42. package/emotion/cjs/examples/plasma_b2c/components/Dropzone/Dropzone.config.js +25 -0
  43. package/emotion/cjs/examples/plasma_b2c/components/Dropzone/Dropzone.js +11 -0
  44. package/emotion/cjs/examples/plasma_b2c/components/Dropzone/Dropzone.stories.tsx +57 -0
  45. package/emotion/cjs/examples/plasma_web/components/Dropzone/Dropzone.config.js +25 -0
  46. package/emotion/cjs/examples/plasma_web/components/Dropzone/Dropzone.js +11 -0
  47. package/emotion/cjs/examples/plasma_web/components/Dropzone/Dropzone.stories.tsx +57 -0
  48. package/emotion/cjs/index.js +11 -0
  49. package/emotion/es/components/Dropzone/Dropzone.js +263 -0
  50. package/emotion/es/components/Dropzone/Dropzone.styles.js +60 -0
  51. package/emotion/es/components/Dropzone/Dropzone.template-docs.mdx +136 -0
  52. package/emotion/es/components/Dropzone/Dropzone.tokens.js +37 -0
  53. package/emotion/es/components/Dropzone/Dropzone.types.js +1 -0
  54. package/emotion/es/components/Dropzone/index.js +2 -0
  55. package/emotion/es/components/Dropzone/variations/_disabled/base.js +3 -0
  56. package/emotion/es/components/Dropzone/variations/_disabled/tokens.json +4 -0
  57. package/emotion/es/components/Dropzone/variations/_size/base.js +4 -0
  58. package/emotion/es/components/Dropzone/variations/_size/tokens.json +19 -0
  59. package/emotion/es/components/Dropzone/variations/_view/base.js +4 -0
  60. package/emotion/es/components/Dropzone/variations/_view/tokens.json +9 -0
  61. package/emotion/es/components/_Icon/Icon.assets/ArrowBarDown.js +16 -0
  62. package/emotion/es/components/_Icon/Icons/IconArrowBarDown.js +15 -0
  63. package/emotion/es/components/_Icon/index.js +2 -1
  64. package/emotion/es/examples/plasma_b2c/components/Dropzone/Dropzone.config.js +19 -0
  65. package/emotion/es/examples/plasma_b2c/components/Dropzone/Dropzone.js +5 -0
  66. package/emotion/es/examples/plasma_b2c/components/Dropzone/Dropzone.stories.tsx +57 -0
  67. package/emotion/es/examples/plasma_web/components/Dropzone/Dropzone.config.js +19 -0
  68. package/emotion/es/examples/plasma_web/components/Dropzone/Dropzone.js +5 -0
  69. package/emotion/es/examples/plasma_web/components/Dropzone/Dropzone.stories.tsx +57 -0
  70. package/emotion/es/index.js +2 -1
  71. package/es/_virtual/_rollupPluginBabelHelpers.js +332 -1
  72. package/es/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  73. package/es/components/Dropzone/Dropzone.css +15 -0
  74. package/es/components/Dropzone/Dropzone.js +247 -0
  75. package/es/components/Dropzone/Dropzone.js.map +1 -0
  76. package/es/components/Dropzone/Dropzone.styles.js +37 -0
  77. package/es/components/Dropzone/Dropzone.styles.js.map +1 -0
  78. package/es/components/Dropzone/Dropzone.styles_1fo7dbq.css +7 -0
  79. package/es/components/Dropzone/Dropzone.tokens.js +40 -0
  80. package/es/components/Dropzone/Dropzone.tokens.js.map +1 -0
  81. package/es/components/Dropzone/variations/_disabled/base.js +5 -0
  82. package/es/components/Dropzone/variations/_disabled/base.js.map +1 -0
  83. package/es/components/Dropzone/variations/_disabled/base_3qwygi.css +1 -0
  84. package/es/components/Dropzone/variations/_size/base.js +5 -0
  85. package/es/components/Dropzone/variations/_size/base.js.map +1 -0
  86. package/es/components/Dropzone/variations/_size/base_1cl61bm.css +1 -0
  87. package/es/components/Dropzone/variations/_view/base.js +5 -0
  88. package/es/components/Dropzone/variations/_view/base.js.map +1 -0
  89. package/es/components/Dropzone/variations/_view/base_cipwu9.css +1 -0
  90. package/es/components/_Icon/Icon.assets/ArrowBarDown.js +20 -0
  91. package/es/components/_Icon/Icon.assets/ArrowBarDown.js.map +1 -0
  92. package/es/components/_Icon/Icons/IconArrowBarDown.js +19 -0
  93. package/es/components/_Icon/Icons/IconArrowBarDown.js.map +1 -0
  94. package/es/index.css +14 -0
  95. package/es/index.js +2 -0
  96. package/es/index.js.map +1 -1
  97. package/package.json +2 -2
  98. package/styled-components/cjs/components/Dropzone/Dropzone.js +271 -0
  99. package/styled-components/cjs/components/Dropzone/Dropzone.styles.js +29 -0
  100. package/styled-components/cjs/components/Dropzone/Dropzone.template-docs.mdx +136 -0
  101. package/styled-components/cjs/components/Dropzone/Dropzone.tokens.js +43 -0
  102. package/styled-components/cjs/components/Dropzone/Dropzone.types.js +5 -0
  103. package/styled-components/cjs/components/Dropzone/index.js +31 -0
  104. package/styled-components/cjs/components/Dropzone/variations/_disabled/base.js +9 -0
  105. package/styled-components/cjs/components/Dropzone/variations/_disabled/tokens.json +4 -0
  106. package/styled-components/cjs/components/Dropzone/variations/_size/base.js +10 -0
  107. package/styled-components/cjs/components/Dropzone/variations/_size/tokens.json +19 -0
  108. package/styled-components/cjs/components/Dropzone/variations/_view/base.js +10 -0
  109. package/styled-components/cjs/components/Dropzone/variations/_view/tokens.json +9 -0
  110. package/styled-components/cjs/components/_Icon/Icon.assets/ArrowBarDown.js +23 -0
  111. package/styled-components/cjs/components/_Icon/Icons/IconArrowBarDown.js +22 -0
  112. package/styled-components/cjs/components/_Icon/index.js +8 -1
  113. package/styled-components/cjs/examples/plasma_b2c/components/Dropzone/Dropzone.config.js +25 -0
  114. package/styled-components/cjs/examples/plasma_b2c/components/Dropzone/Dropzone.js +11 -0
  115. package/styled-components/cjs/examples/plasma_b2c/components/Dropzone/Dropzone.stories.tsx +57 -0
  116. package/styled-components/cjs/examples/plasma_web/components/Dropzone/Dropzone.config.js +25 -0
  117. package/styled-components/cjs/examples/plasma_web/components/Dropzone/Dropzone.js +11 -0
  118. package/styled-components/cjs/examples/plasma_web/components/Dropzone/Dropzone.stories.tsx +57 -0
  119. package/styled-components/cjs/index.js +11 -0
  120. package/styled-components/es/components/Dropzone/Dropzone.js +263 -0
  121. package/styled-components/es/components/Dropzone/Dropzone.styles.js +21 -0
  122. package/styled-components/es/components/Dropzone/Dropzone.template-docs.mdx +136 -0
  123. package/styled-components/es/components/Dropzone/Dropzone.tokens.js +37 -0
  124. package/styled-components/es/components/Dropzone/Dropzone.types.js +1 -0
  125. package/styled-components/es/components/Dropzone/index.js +2 -0
  126. package/styled-components/es/components/Dropzone/variations/_disabled/base.js +3 -0
  127. package/styled-components/es/components/Dropzone/variations/_disabled/tokens.json +4 -0
  128. package/styled-components/es/components/Dropzone/variations/_size/base.js +4 -0
  129. package/styled-components/es/components/Dropzone/variations/_size/tokens.json +19 -0
  130. package/styled-components/es/components/Dropzone/variations/_view/base.js +4 -0
  131. package/styled-components/es/components/Dropzone/variations/_view/tokens.json +9 -0
  132. package/styled-components/es/components/_Icon/Icon.assets/ArrowBarDown.js +16 -0
  133. package/styled-components/es/components/_Icon/Icons/IconArrowBarDown.js +15 -0
  134. package/styled-components/es/components/_Icon/index.js +2 -1
  135. package/styled-components/es/examples/plasma_b2c/components/Dropzone/Dropzone.config.js +19 -0
  136. package/styled-components/es/examples/plasma_b2c/components/Dropzone/Dropzone.js +5 -0
  137. package/styled-components/es/examples/plasma_b2c/components/Dropzone/Dropzone.stories.tsx +57 -0
  138. package/styled-components/es/examples/plasma_web/components/Dropzone/Dropzone.config.js +19 -0
  139. package/styled-components/es/examples/plasma_web/components/Dropzone/Dropzone.js +5 -0
  140. package/styled-components/es/examples/plasma_web/components/Dropzone/Dropzone.stories.tsx +57 -0
  141. package/styled-components/es/index.js +2 -1
  142. package/types/components/Dropzone/Dropzone.d.ts +59 -0
  143. package/types/components/Dropzone/Dropzone.d.ts.map +1 -0
  144. package/types/components/Dropzone/Dropzone.styles.d.ts +9 -0
  145. package/types/components/Dropzone/Dropzone.styles.d.ts.map +1 -0
  146. package/types/components/Dropzone/Dropzone.tokens.d.ts +38 -0
  147. package/types/components/Dropzone/Dropzone.tokens.d.ts.map +1 -0
  148. package/types/components/Dropzone/Dropzone.types.d.ts +77 -0
  149. package/types/components/Dropzone/Dropzone.types.d.ts.map +1 -0
  150. package/types/components/Dropzone/index.d.ts +3 -0
  151. package/types/components/Dropzone/index.d.ts.map +1 -0
  152. package/types/components/Dropzone/variations/_disabled/base.d.ts +2 -0
  153. package/types/components/Dropzone/variations/_disabled/base.d.ts.map +1 -0
  154. package/types/components/Dropzone/variations/_size/base.d.ts +2 -0
  155. package/types/components/Dropzone/variations/_size/base.d.ts.map +1 -0
  156. package/types/components/Dropzone/variations/_view/base.d.ts +2 -0
  157. package/types/components/Dropzone/variations/_view/base.d.ts.map +1 -0
  158. package/types/components/_Icon/Icon.assets/ArrowBarDown.d.ts +4 -0
  159. package/types/components/_Icon/Icon.assets/ArrowBarDown.d.ts.map +1 -0
  160. package/types/components/_Icon/Icons/IconArrowBarDown.d.ts +4 -0
  161. package/types/components/_Icon/Icons/IconArrowBarDown.d.ts.map +1 -0
  162. package/types/components/_Icon/index.d.ts +1 -0
  163. package/types/components/_Icon/index.d.ts.map +1 -1
  164. package/types/examples/plasma_b2c/components/Dropzone/Dropzone.config.d.ts +18 -0
  165. package/types/examples/plasma_b2c/components/Dropzone/Dropzone.config.d.ts.map +1 -0
  166. package/types/examples/plasma_b2c/components/Dropzone/Dropzone.d.ts +29 -0
  167. package/types/examples/plasma_b2c/components/Dropzone/Dropzone.d.ts.map +1 -0
  168. package/types/examples/plasma_web/components/Dropzone/Dropzone.config.d.ts +18 -0
  169. package/types/examples/plasma_web/components/Dropzone/Dropzone.config.d.ts.map +1 -0
  170. package/types/examples/plasma_web/components/Dropzone/Dropzone.d.ts +29 -0
  171. package/types/examples/plasma_web/components/Dropzone/Dropzone.d.ts.map +1 -0
  172. package/types/index.d.ts +1 -0
  173. package/types/index.d.ts.map +1 -1
  174. package/emotion/cjs/components/Card/Card.api.mdx +0 -184
  175. package/emotion/es/components/Card/Card.api.mdx +0 -184
  176. package/styled-components/cjs/components/Card/Card.api.mdx +0 -184
  177. package/styled-components/es/components/Card/Card.api.mdx +0 -184
@@ -0,0 +1,136 @@
1
+ ---
2
+ id: dropzone
3
+ title: Dropzone
4
+ ---
5
+
6
+ import { PropsTable } from '@site/src/components';
7
+
8
+ # Dropzone
9
+ Компонент для загрузки файлов, без отображения индикации загрузки.
10
+ Компонент не предполагает наличия валиации, так как является частью Upload.
11
+ Но валидацию можно задать с помощью callback `validator`.
12
+ <PropsTable name="Dropzone" />
13
+
14
+ # Типизация
15
+
16
+ ```tsx
17
+ type DropzoneProps = {
18
+ /**
19
+ * Массив форматов файлов, которые могут быть прикреплены (см. HTML-атрибут 'accept' для 'input').
20
+ */
21
+ acceptedFileFormats?: string[];
22
+ /**
23
+ * Позовляет выбирать несколько файлов для загрузки
24
+ */
25
+ multiple?: boolean;
26
+ /**
27
+ * Слот для Title
28
+ */
29
+ title?: string;
30
+ /**
31
+ * Слот для описания
32
+ */
33
+ description?: ReactNode;
34
+ /**
35
+ * Слот для иконки
36
+ */
37
+ icon?: ReactNode;
38
+ /**
39
+ * Расположение иконки
40
+ * @default 'left'
41
+ */
42
+ iconPlacement?: 'top' | 'left';
43
+ /**
44
+ * Размер компонента
45
+ */
46
+ size?: string;
47
+ /**
48
+ * Вид компонента
49
+ */
50
+ view?: string;
51
+ /**
52
+ * Компонент неактивен
53
+ */
54
+ disabled?: boolean;
55
+ /**
56
+ * Компонент растягивается на всю доступную ширину
57
+ */
58
+ stretch?: boolean;
59
+ /**
60
+ * Функция, вызываемая в момент вхождения курсора внутрь границ Dropzone
61
+ */
62
+ onDragEnter?: () => void;
63
+ /**
64
+ * Функция, вызываемая в момент выхода курсора из Dropzone
65
+ */
66
+ onDragLeave?: () => void;
67
+ /**
68
+ * Функция, вызываемая при нахождении курсора внутри Dropzone
69
+ */
70
+ onDragOver?: () => void;
71
+ /**
72
+ * Функция, вызываемая при drop файлов
73
+ */
74
+ onDrop?: () => void;
75
+ /**
76
+ * Функция, вызываемая для валидации файлов, перед onDropFiles
77
+ */
78
+ validator?: (files: File[]) => ValidatorReturnType;
79
+ /**
80
+ * Функция, вызываемая при наличии файлов, после onDrop
81
+ */
82
+ onDropFiles?: FileProcessHandler;
83
+ /**
84
+ * Функция, вызываемая при выборе файлов
85
+ */
86
+ onChoseFiles?: FileProcessHandler;
87
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, 'accept'>;
88
+ ```
89
+
90
+ # Пример
91
+
92
+ ```tsx live
93
+ import React from 'react';
94
+ import { Dropzone } from '@salutejs/{{ package }}';
95
+
96
+ export function App() {
97
+ const onDragEnter = () => {
98
+ console.log("onDragEnter")
99
+ }
100
+
101
+ const onDragLeave = () => {
102
+ console.log("onDragLeave")
103
+ }
104
+
105
+ const onDrop = () => {
106
+ console.log("onDrop")
107
+ }
108
+
109
+ const onDropFiles = () => {
110
+ console.log("onDropFiles")
111
+ }
112
+
113
+ const onChange = () => {
114
+ console.log("onChange")
115
+ }
116
+
117
+ const onChoseFiles = () => {
118
+ console.log("onChoseFiles")
119
+ }
120
+
121
+ return (
122
+ <Dropzone
123
+ iconPlacement="top"
124
+ width="240"
125
+ title="Click to upload"
126
+ description="or drag and drop files here"
127
+ onDragEnter={onDragEnter}
128
+ onDragLeave={onDragLeave}
129
+ onDrop={onDrop}
130
+ onDropFiles={onDropFiles}
131
+ onChange={onChange}
132
+ onChoseFiles={onChoseFiles}
133
+ />
134
+ );
135
+ }
136
+ ```
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tokens = exports.privateTokens = exports.classes = void 0;
7
+ var classes = exports.classes = {
8
+ stretch: 'dropzone-stretch',
9
+ active: 'dropzone-active',
10
+ verticalContentPlacing: 'dropzone-vertical-content-placing',
11
+ disabled: 'dropzone-disabled'
12
+ };
13
+ var privateTokens = exports.privateTokens = {
14
+ width: '--plasma_private-dropzone-width',
15
+ height: '--plasma_private-dropzone-height'
16
+ };
17
+ var tokens = exports.tokens = {
18
+ background: '--plasma-dropzone-background',
19
+ overlayColorActive: '--plasma-dropzone-overlay-color-active',
20
+ border: '--plasma-dropzone-border-color',
21
+ borderColorHover: '--plasma-dropzone-border-color-hover',
22
+ borderColorActive: '--plasma-dropzone-border-color-active',
23
+ titleColor: '--plasma-dropzone-title-color',
24
+ descriptionColor: '--plasma-dropzone-description-color',
25
+ padding: '--plasma-dropzone-padding',
26
+ borderRadius: '--plasma-dropzone-border-radius',
27
+ contentGap: '--plasma-dropzone-content-gap',
28
+ titleWrapperGap: '--plasma-dropzone-title-wrapper-gap',
29
+ titleWrapperGapColumn: '--plasma-dropzone-title-wrapper-column-gap',
30
+ titleFontFamily: '--plasma-dropzone-title-font-family',
31
+ titleFontSize: '--plasma-dropzone-title-font-size',
32
+ titleFontStyle: '--plasma-dropzone-title-font-style',
33
+ titleFontWeight: '--plasma-dropzone-title-font-weight',
34
+ titleLetterSpacing: '--plasma-dropzone-title-letter-spacing',
35
+ titleLineHeight: '--plasma-dropzone-title-line-height',
36
+ descriptionFontFamily: '--plasma-dropzone-description-font-family',
37
+ descriptionFontSize: '--plasma-dropzone-description-font-size',
38
+ descriptionFontStyle: '--plasma-dropzone-description-font-style',
39
+ descriptionFontWeight: '--plasma-dropzone-description-font-weight',
40
+ descriptionLetterSpacing: '--plasma-dropzone-description-letter-spacing',
41
+ descriptionLineHeight: '--plasma-dropzone-description-line-height',
42
+ disabledOpacity: '--plasma-dropzone-disabled-opacity'
43
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "dropzoneClasses", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _Dropzone2.classes;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "dropzoneConfig", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _Dropzone.dropzoneConfig;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "dropzoneRoot", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _Dropzone.dropzoneRoot;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "dropzoneTokens", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _Dropzone2.tokens;
28
+ }
29
+ });
30
+ var _Dropzone = /*#__PURE__*/require("./Dropzone");
31
+ var _Dropzone2 = /*#__PURE__*/require("./Dropzone.tokens");
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var _Dropzone = /*#__PURE__*/require("../../Dropzone.tokens");
9
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["&.", "{opacity:var(", ");cursor:not-allowed;}"], _Dropzone.classes.disabled, _Dropzone.tokens.disabledOpacity);
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "boolean",
3
+ "tokens": ["--plasma-dropzone-disabled-opacity"]
4
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var _Dropzone = /*#__PURE__*/require("../../Dropzone.tokens");
9
+ var _Dropzone2 = /*#__PURE__*/require("../../Dropzone.styles");
10
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["padding:var(", ");border-radius:var(", ");height:var(", ");width:var(", ");&.", "{width:100%;}", "{gap:var(", ");}", "{display:flex;align-items:center;justify-content:center;gap:var(", ");&.", "{flex-direction:column;gap:var(", ");}}", "{font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");}", "{font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");}"], _Dropzone.tokens.padding, _Dropzone.tokens.borderRadius, _Dropzone.privateTokens.height, _Dropzone.privateTokens.width, _Dropzone.classes.stretch, _Dropzone2.Content, _Dropzone.tokens.contentGap, _Dropzone2.TitleWrapper, _Dropzone.tokens.titleWrapperGap, _Dropzone.classes.verticalContentPlacing, _Dropzone.tokens.titleWrapperGapColumn, _Dropzone2.Title, _Dropzone.tokens.titleFontFamily, _Dropzone.tokens.titleFontSize, _Dropzone.tokens.titleFontStyle, _Dropzone.tokens.titleFontWeight, _Dropzone.tokens.titleLetterSpacing, _Dropzone.tokens.titleLineHeight, _Dropzone2.Description, _Dropzone.tokens.descriptionFontFamily, _Dropzone.tokens.descriptionFontSize, _Dropzone.tokens.descriptionFontStyle, _Dropzone.tokens.descriptionFontWeight, _Dropzone.tokens.descriptionLetterSpacing, _Dropzone.tokens.descriptionLineHeight);
@@ -0,0 +1,19 @@
1
+ [
2
+ "--plasma-dropzone-padding",
3
+ "--plasma-dropzone-border-radius",
4
+ "--plasma-dropzone-content-gap",
5
+ "--plasma-dropzone-title-wrapper-gap",
6
+ "--plasma-dropzone-title-wrapper-gap",
7
+ "--plasma-dropzone-title-font-family",
8
+ "--plasma-dropzone-title-font-size",
9
+ "--plasma-dropzone-title-font-style",
10
+ "--plasma-dropzone-title-font-weight",
11
+ "--plasma-dropzone-title-letter-spacing",
12
+ "--plasma-dropzone-title-line-height",
13
+ "--plasma-dropzone-description-font-family",
14
+ "--plasma-dropzone-description-font-size",
15
+ "--plasma-dropzone-description-font-style",
16
+ "--plasma-dropzone-description-font-weight",
17
+ "--plasma-dropzone-description-letter-spacing",
18
+ "--plasma-dropzone-description-line-height"
19
+ ]
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var _Dropzone = /*#__PURE__*/require("../../Dropzone.tokens");
9
+ var _Dropzone2 = /*#__PURE__*/require("../../Dropzone.styles");
10
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["background:var(", ");border:var(", ");&:not(.", "):hover,&:not(.", "):focus-within{border-color:var(", ");outline:none;}&.", "{border-color:var(", ");&:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background:var(", ");}}", "{color:var(", ");}", "{color:var(", ");}"], _Dropzone.tokens.background, _Dropzone.tokens.border, _Dropzone.classes.active, _Dropzone.classes.active, _Dropzone.tokens.borderColorHover, _Dropzone.classes.active, _Dropzone.tokens.borderColorActive, _Dropzone.tokens.overlayColorActive, _Dropzone2.TitleWrapper, _Dropzone.tokens.titleColor, _Dropzone2.Description, _Dropzone.tokens.descriptionColor);
@@ -0,0 +1,9 @@
1
+ [
2
+ "--plasma-dropzone-background",
3
+ "--plasma-dropzone-overlay-color-active",
4
+ "--plasma-dropzone-border-color",
5
+ "--plasma-dropzone-border-color-hover",
6
+ "--plasma-dropzone-border-color-active",
7
+ "--plasma-dropzone-title-color",
8
+ "--plasma-dropzone-description-color"
9
+ ]
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ArrowBarDown = void 0;
7
+ var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
8
+ var _path;
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+ 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); }
11
+ var ArrowBarDown = exports.ArrowBarDown = function ArrowBarDown(props) {
12
+ return /*#__PURE__*/_react["default"].createElement("svg", _extends({
13
+ width: "100%",
14
+ viewBox: "0 0 16 16",
15
+ fill: "none",
16
+ xmlns: "http://www.w3.org/2000/svg"
17
+ }, props), _path || (_path = /*#__PURE__*/_react["default"].createElement("path", {
18
+ fillRule: "evenodd",
19
+ clipRule: "evenodd",
20
+ d: "M7.95833 1.875C8.23448 1.875 8.45833 2.09886 8.45833 2.375V10.4043L11.2686 7.54868C11.4623 7.35186 11.7789 7.34933 11.9757 7.54302C12.1725 7.73672 12.1751 8.05329 11.9814 8.25011L8.3147 11.9759C8.21782 12.0744 8.08453 12.1283 7.94645 12.1251C7.80837 12.1218 7.67779 12.0615 7.5857 11.9586L4.25237 8.23278C4.06824 8.02698 4.08582 7.71088 4.29162 7.52676C4.49742 7.34264 4.81351 7.36021 4.99763 7.56601L7.45833 10.3164V2.375C7.45833 2.09886 7.68219 1.875 7.95833 1.875ZM2.5 14.0001C2.5 13.724 2.72386 13.5001 3 13.5001H13C13.2761 13.5001 13.5 13.724 13.5 14.0001C13.5 14.2763 13.2761 14.5001 13 14.5001H3C2.72386 14.5001 2.5 14.2763 2.5 14.0001Z",
21
+ fill: "currentColor"
22
+ })));
23
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.IconArrowBarDown = void 0;
7
+ var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
8
+ var _ArrowBarDown = /*#__PURE__*/require("../Icon.assets/ArrowBarDown");
9
+ var _IconRoot = /*#__PURE__*/require("../IconRoot");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ var IconArrowBarDown = exports.IconArrowBarDown = function IconArrowBarDown(_ref) {
12
+ var _ref$size = _ref.size,
13
+ size = _ref$size === void 0 ? 'xs' : _ref$size,
14
+ color = _ref.color,
15
+ className = _ref.className;
16
+ return /*#__PURE__*/_react["default"].createElement(_IconRoot.IconRoot, {
17
+ className: className,
18
+ size: size,
19
+ color: color,
20
+ icon: _ArrowBarDown.ArrowBarDown
21
+ });
22
+ };
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "IconArrowBarDown", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _IconArrowBarDown.IconArrowBarDown;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "IconBlankCsvOutline", {
7
13
  enumerable: true,
8
14
  get: function get() {
@@ -191,4 +197,5 @@ var _IconBlankOutline = /*#__PURE__*/require("./Icons/IconBlankOutline");
191
197
  var _IconBlankPdfOutline = /*#__PURE__*/require("./Icons/IconBlankPdfOutline");
192
198
  var _IconBlankTxtOutline = /*#__PURE__*/require("./Icons/IconBlankTxtOutline");
193
199
  var _IconBlankXlsOutline = /*#__PURE__*/require("./Icons/IconBlankXlsOutline");
194
- var _IconInfoCircleOutline = /*#__PURE__*/require("./Icons/IconInfoCircleOutline");
200
+ var _IconInfoCircleOutline = /*#__PURE__*/require("./Icons/IconInfoCircleOutline");
201
+ var _IconArrowBarDown = /*#__PURE__*/require("./Icons/IconArrowBarDown");
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.config = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var _Dropzone = /*#__PURE__*/require("../../../../components/Dropzone");
9
+ var config = exports.config = {
10
+ defaults: {
11
+ view: 'default',
12
+ size: 'm'
13
+ },
14
+ variations: {
15
+ view: {
16
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-solid-card);", ":var(--overlay-soft);", ":0.063rem dashed var(--outline-secondary);", ":var(--outline-secondary);", ":var(--outline-accent);", ":var(--text-primary);", ":var(--text-secondary);"], _Dropzone.dropzoneTokens.background, _Dropzone.dropzoneTokens.overlayColorActive, _Dropzone.dropzoneTokens.border, _Dropzone.dropzoneTokens.borderColorHover, _Dropzone.dropzoneTokens.borderColorActive, _Dropzone.dropzoneTokens.titleColor, _Dropzone.dropzoneTokens.descriptionColor)
17
+ },
18
+ size: {
19
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":1.25rem;", ":0.75rem;", ":0.375rem;", ":0.5rem;", ":var(--plasma-typo-body-h4-font-family);", ":var(--plasma-typo-body-h4-font-size);", ":var(--plasma-typo-body-h4-font-style);", ":var(--plasma-typo-body-h4-bold-font-weight);", ":var(--plasma-typo-body-h4-letter-spacing);", ":var(--plasma-typo-body-h4-line-height);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], _Dropzone.dropzoneTokens.padding, _Dropzone.dropzoneTokens.borderRadius, _Dropzone.dropzoneTokens.contentGap, _Dropzone.dropzoneTokens.titleWrapperGap, _Dropzone.dropzoneTokens.titleWrapperGapColumn, _Dropzone.dropzoneTokens.titleFontFamily, _Dropzone.dropzoneTokens.titleFontSize, _Dropzone.dropzoneTokens.titleFontStyle, _Dropzone.dropzoneTokens.titleFontWeight, _Dropzone.dropzoneTokens.titleLetterSpacing, _Dropzone.dropzoneTokens.titleLineHeight, _Dropzone.dropzoneTokens.descriptionFontFamily, _Dropzone.dropzoneTokens.descriptionFontSize, _Dropzone.dropzoneTokens.descriptionFontStyle, _Dropzone.dropzoneTokens.descriptionFontWeight, _Dropzone.dropzoneTokens.descriptionLetterSpacing, _Dropzone.dropzoneTokens.descriptionLineHeight)
20
+ },
21
+ disabled: {
22
+ "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Dropzone.dropzoneTokens.disabledOpacity)
23
+ }
24
+ }
25
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Dropzone = void 0;
7
+ var _Dropzone = /*#__PURE__*/require("../../../../components/Dropzone");
8
+ var _engines = /*#__PURE__*/require("../../../../engines");
9
+ var _Dropzone2 = /*#__PURE__*/require("./Dropzone.config");
10
+ var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Dropzone.dropzoneConfig, _Dropzone2.config);
11
+ var Dropzone = exports.Dropzone = /*#__PURE__*/(0, _engines.component)(mergedConfig);
@@ -0,0 +1,57 @@
1
+ import React, { ComponentProps } from 'react';
2
+ import type { StoryObj, Meta } from '@storybook/react';
3
+ import { action } from '@storybook/addon-actions';
4
+ import { disableProps } from '@salutejs/plasma-sb-utils';
5
+
6
+ import { WithTheme } from '../../../_helpers';
7
+
8
+ import { Dropzone } from './Dropzone';
9
+
10
+ const onDragEnter = action('onDragEnter');
11
+ const onDragLeave = action('onDragLeave');
12
+ const onDrop = action('onDrop');
13
+ const onChange = action('onChange');
14
+ const onChoseFiles = action('onChoseFiles');
15
+
16
+ const iconPlacements = ['top', 'left'];
17
+
18
+ const meta: Meta<typeof Dropzone> = {
19
+ title: 'plasma_b2c/Dropzone',
20
+ component: Dropzone,
21
+ decorators: [WithTheme],
22
+ argTypes: {
23
+ iconPlacement: {
24
+ options: iconPlacements,
25
+ control: {
26
+ type: 'inline-radio',
27
+ },
28
+ defaultValue: 'top',
29
+ },
30
+ ...disableProps(['view', 'size']),
31
+ },
32
+ };
33
+
34
+ export default meta;
35
+
36
+ type StoryPropsDefault = ComponentProps<typeof Dropzone>;
37
+
38
+ export const Default: StoryObj<StoryPropsDefault> = {
39
+ args: {
40
+ iconPlacement: 'top',
41
+ width: 400,
42
+ height: 280,
43
+ disabled: false,
44
+ title: 'Click to upload',
45
+ description: 'or drag and drop files here',
46
+ },
47
+ render: (args) => (
48
+ <Dropzone
49
+ {...args}
50
+ onDragEnter={onDragEnter}
51
+ onDragLeave={onDragLeave}
52
+ onDrop={onDrop}
53
+ onChange={onChange}
54
+ onChoseFiles={onChoseFiles}
55
+ />
56
+ ),
57
+ };
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.config = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var _Dropzone = /*#__PURE__*/require("../../../../components/Dropzone");
9
+ var config = exports.config = {
10
+ defaults: {
11
+ view: 'default',
12
+ size: 'm'
13
+ },
14
+ variations: {
15
+ view: {
16
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-solid-card);", ":var(--overlay-soft);", ":0.063rem dashed var(--outline-secondary);", ":var(--outline-secondary);", ":var(--outline-accent);", ":var(--text-primary);", ":var(--text-secondary);"], _Dropzone.dropzoneTokens.background, _Dropzone.dropzoneTokens.overlayColorActive, _Dropzone.dropzoneTokens.border, _Dropzone.dropzoneTokens.borderColorHover, _Dropzone.dropzoneTokens.borderColorActive, _Dropzone.dropzoneTokens.titleColor, _Dropzone.dropzoneTokens.descriptionColor)
17
+ },
18
+ size: {
19
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":1.25rem;", ":0.75rem;", ":0.375rem;", ":0.5rem;", ":var(--plasma-typo-body-h4-font-family);", ":var(--plasma-typo-body-h4-font-size);", ":var(--plasma-typo-body-h4-font-style);", ":var(--plasma-typo-body-h4-bold-font-weight);", ":var(--plasma-typo-body-h4-letter-spacing);", ":var(--plasma-typo-body-h4-line-height);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], _Dropzone.dropzoneTokens.padding, _Dropzone.dropzoneTokens.borderRadius, _Dropzone.dropzoneTokens.contentGap, _Dropzone.dropzoneTokens.titleWrapperGap, _Dropzone.dropzoneTokens.titleWrapperGapColumn, _Dropzone.dropzoneTokens.titleFontFamily, _Dropzone.dropzoneTokens.titleFontSize, _Dropzone.dropzoneTokens.titleFontStyle, _Dropzone.dropzoneTokens.titleFontWeight, _Dropzone.dropzoneTokens.titleLetterSpacing, _Dropzone.dropzoneTokens.titleLineHeight, _Dropzone.dropzoneTokens.descriptionFontFamily, _Dropzone.dropzoneTokens.descriptionFontSize, _Dropzone.dropzoneTokens.descriptionFontStyle, _Dropzone.dropzoneTokens.descriptionFontWeight, _Dropzone.dropzoneTokens.descriptionLetterSpacing, _Dropzone.dropzoneTokens.descriptionLineHeight)
20
+ },
21
+ disabled: {
22
+ "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Dropzone.dropzoneTokens.disabledOpacity)
23
+ }
24
+ }
25
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Dropzone = void 0;
7
+ var _Dropzone = /*#__PURE__*/require("../../../../components/Dropzone");
8
+ var _engines = /*#__PURE__*/require("../../../../engines");
9
+ var _Dropzone2 = /*#__PURE__*/require("./Dropzone.config");
10
+ var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Dropzone.dropzoneConfig, _Dropzone2.config);
11
+ var Dropzone = exports.Dropzone = /*#__PURE__*/(0, _engines.component)(mergedConfig);
@@ -0,0 +1,57 @@
1
+ import React, { ComponentProps } from 'react';
2
+ import type { StoryObj, Meta } from '@storybook/react';
3
+ import { action } from '@storybook/addon-actions';
4
+ import { disableProps } from '@salutejs/plasma-sb-utils';
5
+
6
+ import { WithTheme } from '../../../_helpers';
7
+
8
+ import { Dropzone } from './Dropzone';
9
+
10
+ const onDragEnter = action('onDragEnter');
11
+ const onDragLeave = action('onDragLeave');
12
+ const onDrop = action('onDrop');
13
+ const onChange = action('onChange');
14
+ const onChoseFiles = action('onChoseFiles');
15
+
16
+ const iconPlacements = ['top', 'left'];
17
+
18
+ const meta: Meta<typeof Dropzone> = {
19
+ title: 'plasma_web/Dropzone',
20
+ component: Dropzone,
21
+ decorators: [WithTheme],
22
+ argTypes: {
23
+ iconPlacement: {
24
+ options: iconPlacements,
25
+ control: {
26
+ type: 'inline-radio',
27
+ },
28
+ defaultValue: 'top',
29
+ },
30
+ ...disableProps(['view', 'size']),
31
+ },
32
+ };
33
+
34
+ export default meta;
35
+
36
+ type StoryPropsDefault = ComponentProps<typeof Dropzone>;
37
+
38
+ export const Default: StoryObj<StoryPropsDefault> = {
39
+ args: {
40
+ iconPlacement: 'top',
41
+ width: 400,
42
+ height: 280,
43
+ disabled: false,
44
+ title: 'Click to upload',
45
+ description: 'or drag and drop files here',
46
+ },
47
+ render: (args) => (
48
+ <Dropzone
49
+ {...args}
50
+ onDragEnter={onDragEnter}
51
+ onDragLeave={onDragLeave}
52
+ onDrop={onDrop}
53
+ onChange={onChange}
54
+ onChoseFiles={onChoseFiles}
55
+ />
56
+ ),
57
+ };
@@ -706,4 +706,15 @@ Object.keys(_NumberInput).forEach(function (key) {
706
706
  return _NumberInput[key];
707
707
  }
708
708
  });
709
+ });
710
+ var _Dropzone = /*#__PURE__*/require("./components/Dropzone");
711
+ Object.keys(_Dropzone).forEach(function (key) {
712
+ if (key === "default" || key === "__esModule") return;
713
+ if (key in exports && exports[key] === _Dropzone[key]) return;
714
+ Object.defineProperty(exports, key, {
715
+ enumerable: true,
716
+ get: function get() {
717
+ return _Dropzone[key];
718
+ }
719
+ });
709
720
  });