@salutejs/plasma-sb-utils 0.211.0-canary.2370.19885960439.0 → 0.211.0-canary.2371.19919666002.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/TextField/TextField.d.ts +258 -0
- package/lib/components/TextField/TextField.js +64 -0
- package/lib/components/TextField/TextField.js.map +1 -0
- package/lib/components/TextField/fixtures.d.ts +9 -0
- package/lib/components/TextField/fixtures.js +24 -0
- package/lib/components/TextField/fixtures.js.map +1 -0
- package/lib/components/TextField/index.d.ts +1 -0
- package/lib/components/TextField/index.js +2 -0
- package/lib/components/TextField/index.js.map +1 -0
- package/lib/components/TextField/meta.d.ts +230 -0
- package/lib/components/TextField/meta.js +192 -0
- package/lib/components/TextField/meta.js.map +1 -0
- package/lib/components/TextField/stories.d.ts +2 -0
- package/lib/components/TextField/stories.js +71 -0
- package/lib/components/TextField/stories.js.map +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
declare type CreateStoriesProps = {
|
|
2
|
+
component: any;
|
|
3
|
+
componentConfig: any;
|
|
4
|
+
customIcon?: (size: string) => JSX.Element;
|
|
5
|
+
title?: string;
|
|
6
|
+
disablePropsList?: string[];
|
|
7
|
+
defaultArgs?: {};
|
|
8
|
+
additionalArgTypes?: {};
|
|
9
|
+
additionalComponents?: {};
|
|
10
|
+
};
|
|
11
|
+
export declare const getTextFieldStories: (config: CreateStoriesProps) => {
|
|
12
|
+
meta: {
|
|
13
|
+
title: string;
|
|
14
|
+
decorators: any[];
|
|
15
|
+
component: any;
|
|
16
|
+
args: {
|
|
17
|
+
id: string;
|
|
18
|
+
appearance: string;
|
|
19
|
+
hasDivider: boolean;
|
|
20
|
+
size: string;
|
|
21
|
+
view: string;
|
|
22
|
+
label: string;
|
|
23
|
+
labelPlacement: string;
|
|
24
|
+
keepPlaceholder: boolean;
|
|
25
|
+
titleCaption: string;
|
|
26
|
+
textBefore: string;
|
|
27
|
+
textAfter: string;
|
|
28
|
+
placeholder: string;
|
|
29
|
+
leftHelper: string;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
readOnly: boolean;
|
|
32
|
+
enableContentLeft: boolean;
|
|
33
|
+
enableContentRight: boolean;
|
|
34
|
+
optional: boolean;
|
|
35
|
+
optionalText: string;
|
|
36
|
+
required: boolean;
|
|
37
|
+
requiredPlacement: string;
|
|
38
|
+
hasRequiredIndicator: boolean;
|
|
39
|
+
hasHint: boolean;
|
|
40
|
+
hintText: string;
|
|
41
|
+
hintTrigger: string;
|
|
42
|
+
hintView: string;
|
|
43
|
+
hintSize: string;
|
|
44
|
+
hintTargetPlacement: string;
|
|
45
|
+
hintPlacement: string;
|
|
46
|
+
hintWidth: string;
|
|
47
|
+
hintHasArrow: boolean;
|
|
48
|
+
};
|
|
49
|
+
argTypes: {
|
|
50
|
+
view: {
|
|
51
|
+
options: any;
|
|
52
|
+
control: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
size: {
|
|
57
|
+
options: any;
|
|
58
|
+
control: {
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
appearance: {
|
|
63
|
+
options: string[];
|
|
64
|
+
control: {
|
|
65
|
+
type: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
hasDivider: {
|
|
69
|
+
control: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
if: {
|
|
73
|
+
arg: string;
|
|
74
|
+
eq: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
requiredPlacement: {
|
|
78
|
+
options: string[];
|
|
79
|
+
control: {
|
|
80
|
+
type: string;
|
|
81
|
+
};
|
|
82
|
+
if: {
|
|
83
|
+
arg: string;
|
|
84
|
+
truthy: boolean;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
required: {
|
|
88
|
+
control: {
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
if: {
|
|
92
|
+
arg: string;
|
|
93
|
+
truthy: boolean;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
hasRequiredIndicator: {
|
|
97
|
+
control: {
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
if: {
|
|
101
|
+
arg: string;
|
|
102
|
+
truthy: boolean;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
optional: {
|
|
106
|
+
control: {
|
|
107
|
+
type: string;
|
|
108
|
+
};
|
|
109
|
+
if: {
|
|
110
|
+
arg: string;
|
|
111
|
+
truthy: boolean;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
optionalText: {
|
|
115
|
+
control: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
if: {
|
|
119
|
+
arg: string;
|
|
120
|
+
truthy: boolean;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
maxLength: {
|
|
124
|
+
control: {
|
|
125
|
+
type: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
labelPlacement: {
|
|
129
|
+
options: string[];
|
|
130
|
+
control: {
|
|
131
|
+
type: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
keepPlaceholder: {
|
|
135
|
+
control: {
|
|
136
|
+
type: string;
|
|
137
|
+
};
|
|
138
|
+
if: {
|
|
139
|
+
arg: string;
|
|
140
|
+
eq: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
titleCaption: {
|
|
144
|
+
control: {
|
|
145
|
+
type: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
leftHelper: {
|
|
149
|
+
control: {
|
|
150
|
+
type: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
hintText: {
|
|
154
|
+
control: {
|
|
155
|
+
type: string;
|
|
156
|
+
};
|
|
157
|
+
if: {
|
|
158
|
+
arg: string;
|
|
159
|
+
truthy: boolean;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
hintView: {
|
|
163
|
+
options: string[];
|
|
164
|
+
control: {
|
|
165
|
+
type: string;
|
|
166
|
+
};
|
|
167
|
+
if: {
|
|
168
|
+
arg: string;
|
|
169
|
+
truthy: boolean;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
hintSize: {
|
|
173
|
+
options: string[];
|
|
174
|
+
control: {
|
|
175
|
+
type: string;
|
|
176
|
+
};
|
|
177
|
+
if: {
|
|
178
|
+
arg: string;
|
|
179
|
+
truthy: boolean;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
hintTargetPlacement: {
|
|
183
|
+
options: string[];
|
|
184
|
+
control: {
|
|
185
|
+
type: string;
|
|
186
|
+
};
|
|
187
|
+
if: {
|
|
188
|
+
arg: string;
|
|
189
|
+
truthy: boolean;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
hintTrigger: {
|
|
193
|
+
options: string[];
|
|
194
|
+
control: {
|
|
195
|
+
type: string;
|
|
196
|
+
};
|
|
197
|
+
if: {
|
|
198
|
+
arg: string;
|
|
199
|
+
truthy: boolean;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
hintPlacement: {
|
|
203
|
+
options: string[];
|
|
204
|
+
control: {
|
|
205
|
+
type: string;
|
|
206
|
+
};
|
|
207
|
+
if: {
|
|
208
|
+
arg: string;
|
|
209
|
+
truthy: boolean;
|
|
210
|
+
};
|
|
211
|
+
mappers: string[];
|
|
212
|
+
};
|
|
213
|
+
hintHasArrow: {
|
|
214
|
+
control: {
|
|
215
|
+
type: string;
|
|
216
|
+
};
|
|
217
|
+
if: {
|
|
218
|
+
arg: string;
|
|
219
|
+
truthy: boolean;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
hintWidth: {
|
|
223
|
+
control: {
|
|
224
|
+
type: string;
|
|
225
|
+
};
|
|
226
|
+
if: {
|
|
227
|
+
arg: string;
|
|
228
|
+
truthy: boolean;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
Default: {
|
|
234
|
+
render: (args: any) => JSX.Element;
|
|
235
|
+
};
|
|
236
|
+
Chips: {
|
|
237
|
+
render: (args: any) => JSX.Element;
|
|
238
|
+
args: {
|
|
239
|
+
leftHelper: string;
|
|
240
|
+
chipView: string;
|
|
241
|
+
chips: string[];
|
|
242
|
+
chipType: string;
|
|
243
|
+
};
|
|
244
|
+
argTypes: {
|
|
245
|
+
chipView: {
|
|
246
|
+
options: string[];
|
|
247
|
+
control: {
|
|
248
|
+
type: string;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
chipType: {
|
|
252
|
+
control: string;
|
|
253
|
+
options: string[];
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { getConfigVariations } from '../../helpers';
|
|
25
|
+
import { createMeta } from './meta';
|
|
26
|
+
import { createChipsStory, createDefaultStory } from './stories';
|
|
27
|
+
import { chipViews } from './fixtures';
|
|
28
|
+
export var getTextFieldStories = function (config) {
|
|
29
|
+
var component = config.component, componentConfig = config.componentConfig, customIcon = config.customIcon, rest = __rest(config, ["component", "componentConfig", "customIcon"]);
|
|
30
|
+
var textFieldConfig = getConfigVariations(componentConfig);
|
|
31
|
+
var meta = createMeta(__assign({ component: component, componentConfig: textFieldConfig }, rest));
|
|
32
|
+
var DefaultStoryComponent = createDefaultStory(component, customIcon);
|
|
33
|
+
var ChipsStoryComponent = createChipsStory(component, customIcon);
|
|
34
|
+
var Default = {
|
|
35
|
+
render: function (args) { return React.createElement(DefaultStoryComponent, __assign({}, args)); },
|
|
36
|
+
};
|
|
37
|
+
var Chips = {
|
|
38
|
+
render: function (args) { return React.createElement(ChipsStoryComponent, __assign({}, args)); },
|
|
39
|
+
args: {
|
|
40
|
+
leftHelper: 'Для первого чипа валидация вернула view="negative"',
|
|
41
|
+
chipView: 'secondary',
|
|
42
|
+
chips: ['1 value', '2 value', '3 value', '4 value'],
|
|
43
|
+
chipType: 'default',
|
|
44
|
+
},
|
|
45
|
+
argTypes: {
|
|
46
|
+
chipView: {
|
|
47
|
+
options: chipViews,
|
|
48
|
+
control: {
|
|
49
|
+
type: 'select',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
chipType: {
|
|
53
|
+
control: 'select',
|
|
54
|
+
options: ['default', 'text'],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
meta: meta,
|
|
60
|
+
Default: Default,
|
|
61
|
+
Chips: Chips,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=TextField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAavC,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,MAA0B;IAClD,IAAA,SAAS,GAA2C,MAAM,UAAjD,EAAE,eAAe,GAA0B,MAAM,gBAAhC,EAAE,UAAU,GAAc,MAAM,WAApB,EAAK,IAAI,UAAK,MAAM,EAA5D,8CAAmD,CAAF,CAAY;IAEnE,IAAM,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAE7D,IAAM,IAAI,GAAG,UAAU,YACnB,SAAS,WAAA,EACT,eAAe,EAAE,eAAe,IAC7B,IAAI,EACT,CAAC;IAEH,IAAM,qBAAqB,GAAG,kBAAkB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACxE,IAAM,mBAAmB,GAAG,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAEpE,IAAM,OAAO,GAAG;QACZ,MAAM,EAAE,UAAC,IAAS,IAAK,OAAA,oBAAC,qBAAqB,eAAK,IAAI,EAAI,EAAnC,CAAmC;KAC7D,CAAC;IAEF,IAAM,KAAK,GAAG;QACV,MAAM,EAAE,UAAC,IAAS,IAAK,OAAA,oBAAC,mBAAmB,eAAK,IAAI,EAAI,EAAjC,CAAiC;QACxD,IAAI,EAAE;YACF,UAAU,EAAE,oDAAoD;YAChE,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;YACnD,QAAQ,EAAE,SAAS;SACtB;QACD,QAAQ,EAAE;YACN,QAAQ,EAAE;gBACN,OAAO,EAAE,SAAS;gBAClB,OAAO,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACjB;aACJ;YACD,QAAQ,EAAE;gBACN,OAAO,EAAE,QAAQ;gBACjB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;aAC/B;SACJ;KACJ,CAAC;IAEF,OAAO;QACH,IAAI,MAAA;QACJ,OAAO,SAAA;QACP,KAAK,OAAA;KACR,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const appearances: string[];
|
|
2
|
+
export declare const chipViews: string[];
|
|
3
|
+
export declare const hintViews: string[];
|
|
4
|
+
export declare const hintSizes: string[];
|
|
5
|
+
export declare const hintTriggers: string[];
|
|
6
|
+
export declare const hintTargetPlacements: string[];
|
|
7
|
+
export declare const labelPlacements: string[];
|
|
8
|
+
export declare const requiredPlacements: string[];
|
|
9
|
+
export declare const placements: string[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export var appearances = ['default', 'clear'];
|
|
2
|
+
export var chipViews = ['default', 'secondary', 'accent', 'positive', 'warning', 'negative'];
|
|
3
|
+
export var hintViews = ['default'];
|
|
4
|
+
export var hintSizes = ['m', 's'];
|
|
5
|
+
export var hintTriggers = ['hover', 'click'];
|
|
6
|
+
export var hintTargetPlacements = ['outer', 'inner'];
|
|
7
|
+
export var labelPlacements = ['outer', 'inner'];
|
|
8
|
+
export var requiredPlacements = ['left', 'right'];
|
|
9
|
+
export var placements = [
|
|
10
|
+
'top',
|
|
11
|
+
'top-start',
|
|
12
|
+
'top-end',
|
|
13
|
+
'bottom',
|
|
14
|
+
'bottom-start',
|
|
15
|
+
'bottom-end',
|
|
16
|
+
'left',
|
|
17
|
+
'left-start',
|
|
18
|
+
'left-end',
|
|
19
|
+
'right',
|
|
20
|
+
'right-start',
|
|
21
|
+
'right-end',
|
|
22
|
+
'auto',
|
|
23
|
+
];
|
|
24
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src/components/TextField/fixtures.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAChD,MAAM,CAAC,IAAM,SAAS,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/F,MAAM,CAAC,IAAM,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC;AACrC,MAAM,CAAC,IAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACpC,MAAM,CAAC,IAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,MAAM,CAAC,IAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACvD,MAAM,CAAC,IAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAClD,MAAM,CAAC,IAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,MAAM,CAAC,IAAM,UAAU,GAAG;IACtB,KAAK;IACL,WAAW;IACX,SAAS;IAET,QAAQ;IACR,cAAc;IACd,YAAY;IAEZ,MAAM;IACN,YAAY;IACZ,UAAU;IAEV,OAAO;IACP,aAAa;IACb,WAAW;IAEX,MAAM;CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TextField';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TextField/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
declare type CreateMetaProps = {
|
|
2
|
+
component: any;
|
|
3
|
+
componentConfig: any;
|
|
4
|
+
title?: string;
|
|
5
|
+
defaultArgs?: {};
|
|
6
|
+
additionalArgTypes?: {};
|
|
7
|
+
disablePropsList?: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare const createMeta: ({ component, componentConfig, title, defaultArgs, additionalArgTypes, disablePropsList, }: CreateMetaProps) => {
|
|
10
|
+
title: string;
|
|
11
|
+
decorators: any[];
|
|
12
|
+
component: any;
|
|
13
|
+
args: {
|
|
14
|
+
id: string;
|
|
15
|
+
appearance: string;
|
|
16
|
+
hasDivider: boolean;
|
|
17
|
+
size: string;
|
|
18
|
+
view: string;
|
|
19
|
+
label: string;
|
|
20
|
+
labelPlacement: string;
|
|
21
|
+
keepPlaceholder: boolean;
|
|
22
|
+
titleCaption: string;
|
|
23
|
+
textBefore: string;
|
|
24
|
+
textAfter: string;
|
|
25
|
+
placeholder: string;
|
|
26
|
+
leftHelper: string;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
readOnly: boolean;
|
|
29
|
+
enableContentLeft: boolean;
|
|
30
|
+
enableContentRight: boolean;
|
|
31
|
+
optional: boolean;
|
|
32
|
+
optionalText: string;
|
|
33
|
+
required: boolean;
|
|
34
|
+
requiredPlacement: string;
|
|
35
|
+
hasRequiredIndicator: boolean;
|
|
36
|
+
hasHint: boolean;
|
|
37
|
+
hintText: string;
|
|
38
|
+
hintTrigger: string;
|
|
39
|
+
hintView: string;
|
|
40
|
+
hintSize: string;
|
|
41
|
+
hintTargetPlacement: string;
|
|
42
|
+
hintPlacement: string;
|
|
43
|
+
hintWidth: string;
|
|
44
|
+
hintHasArrow: boolean;
|
|
45
|
+
};
|
|
46
|
+
argTypes: {
|
|
47
|
+
view: {
|
|
48
|
+
options: any;
|
|
49
|
+
control: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
size: {
|
|
54
|
+
options: any;
|
|
55
|
+
control: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
appearance: {
|
|
60
|
+
options: string[];
|
|
61
|
+
control: {
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
hasDivider: {
|
|
66
|
+
control: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
if: {
|
|
70
|
+
arg: string;
|
|
71
|
+
eq: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
requiredPlacement: {
|
|
75
|
+
options: string[];
|
|
76
|
+
control: {
|
|
77
|
+
type: string;
|
|
78
|
+
};
|
|
79
|
+
if: {
|
|
80
|
+
arg: string;
|
|
81
|
+
truthy: boolean;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
required: {
|
|
85
|
+
control: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
if: {
|
|
89
|
+
arg: string;
|
|
90
|
+
truthy: boolean;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
hasRequiredIndicator: {
|
|
94
|
+
control: {
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
if: {
|
|
98
|
+
arg: string;
|
|
99
|
+
truthy: boolean;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
optional: {
|
|
103
|
+
control: {
|
|
104
|
+
type: string;
|
|
105
|
+
};
|
|
106
|
+
if: {
|
|
107
|
+
arg: string;
|
|
108
|
+
truthy: boolean;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
optionalText: {
|
|
112
|
+
control: {
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
if: {
|
|
116
|
+
arg: string;
|
|
117
|
+
truthy: boolean;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
maxLength: {
|
|
121
|
+
control: {
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
labelPlacement: {
|
|
126
|
+
options: string[];
|
|
127
|
+
control: {
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
keepPlaceholder: {
|
|
132
|
+
control: {
|
|
133
|
+
type: string;
|
|
134
|
+
};
|
|
135
|
+
if: {
|
|
136
|
+
arg: string;
|
|
137
|
+
eq: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
titleCaption: {
|
|
141
|
+
control: {
|
|
142
|
+
type: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
leftHelper: {
|
|
146
|
+
control: {
|
|
147
|
+
type: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
hintText: {
|
|
151
|
+
control: {
|
|
152
|
+
type: string;
|
|
153
|
+
};
|
|
154
|
+
if: {
|
|
155
|
+
arg: string;
|
|
156
|
+
truthy: boolean;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
hintView: {
|
|
160
|
+
options: string[];
|
|
161
|
+
control: {
|
|
162
|
+
type: string;
|
|
163
|
+
};
|
|
164
|
+
if: {
|
|
165
|
+
arg: string;
|
|
166
|
+
truthy: boolean;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
hintSize: {
|
|
170
|
+
options: string[];
|
|
171
|
+
control: {
|
|
172
|
+
type: string;
|
|
173
|
+
};
|
|
174
|
+
if: {
|
|
175
|
+
arg: string;
|
|
176
|
+
truthy: boolean;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
hintTargetPlacement: {
|
|
180
|
+
options: string[];
|
|
181
|
+
control: {
|
|
182
|
+
type: string;
|
|
183
|
+
};
|
|
184
|
+
if: {
|
|
185
|
+
arg: string;
|
|
186
|
+
truthy: boolean;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
hintTrigger: {
|
|
190
|
+
options: string[];
|
|
191
|
+
control: {
|
|
192
|
+
type: string;
|
|
193
|
+
};
|
|
194
|
+
if: {
|
|
195
|
+
arg: string;
|
|
196
|
+
truthy: boolean;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
hintPlacement: {
|
|
200
|
+
options: string[];
|
|
201
|
+
control: {
|
|
202
|
+
type: string;
|
|
203
|
+
};
|
|
204
|
+
if: {
|
|
205
|
+
arg: string;
|
|
206
|
+
truthy: boolean;
|
|
207
|
+
};
|
|
208
|
+
mappers: string[];
|
|
209
|
+
};
|
|
210
|
+
hintHasArrow: {
|
|
211
|
+
control: {
|
|
212
|
+
type: string;
|
|
213
|
+
};
|
|
214
|
+
if: {
|
|
215
|
+
arg: string;
|
|
216
|
+
truthy: boolean;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
hintWidth: {
|
|
220
|
+
control: {
|
|
221
|
+
type: string;
|
|
222
|
+
};
|
|
223
|
+
if: {
|
|
224
|
+
arg: string;
|
|
225
|
+
truthy: boolean;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
export {};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
13
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
14
|
+
to[j] = from[i];
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
import { disableProps, InSpacingDecorator } from '../../index';
|
|
18
|
+
import { appearances, hintViews, hintSizes, hintTriggers, hintTargetPlacements, labelPlacements, placements, requiredPlacements, } from './fixtures';
|
|
19
|
+
export var createMeta = function (_a) {
|
|
20
|
+
var component = _a.component, componentConfig = _a.componentConfig, _b = _a.title, title = _b === void 0 ? 'Data Entry/TextField' : _b, _c = _a.defaultArgs, defaultArgs = _c === void 0 ? {} : _c, _d = _a.additionalArgTypes, additionalArgTypes = _d === void 0 ? {} : _d, _e = _a.disablePropsList, disablePropsList = _e === void 0 ? [] : _e;
|
|
21
|
+
return {
|
|
22
|
+
title: title,
|
|
23
|
+
decorators: [InSpacingDecorator],
|
|
24
|
+
component: component,
|
|
25
|
+
args: __assign({ id: 'example-text-field', appearance: 'default', hasDivider: false, size: 'm', view: 'default', label: 'Лейбл', labelPlacement: 'outer', keepPlaceholder: false, titleCaption: 'Подпись к полю', textBefore: '', textAfter: '', placeholder: 'Заполните поле', leftHelper: 'Подсказка к полю', disabled: false, readOnly: false, enableContentLeft: true, enableContentRight: true, optional: false, optionalText: 'опционально', required: false, requiredPlacement: 'right', hasRequiredIndicator: true, hasHint: true, hintText: 'Текст подсказки', hintTrigger: 'hover', hintView: 'default', hintSize: 'm', hintTargetPlacement: 'outer', hintPlacement: 'auto', hintWidth: '10rem', hintHasArrow: true }, defaultArgs),
|
|
26
|
+
argTypes: __assign(__assign({ view: {
|
|
27
|
+
options: componentConfig.views,
|
|
28
|
+
control: { type: 'select' },
|
|
29
|
+
}, size: {
|
|
30
|
+
options: componentConfig.sizes,
|
|
31
|
+
control: { type: 'select' },
|
|
32
|
+
}, appearance: {
|
|
33
|
+
options: appearances,
|
|
34
|
+
control: {
|
|
35
|
+
type: 'select',
|
|
36
|
+
},
|
|
37
|
+
}, hasDivider: {
|
|
38
|
+
control: {
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
},
|
|
41
|
+
if: {
|
|
42
|
+
arg: 'appearance',
|
|
43
|
+
eq: 'clear',
|
|
44
|
+
},
|
|
45
|
+
}, requiredPlacement: {
|
|
46
|
+
options: requiredPlacements,
|
|
47
|
+
control: {
|
|
48
|
+
type: 'select',
|
|
49
|
+
},
|
|
50
|
+
if: {
|
|
51
|
+
arg: 'optional',
|
|
52
|
+
truthy: false,
|
|
53
|
+
},
|
|
54
|
+
}, required: {
|
|
55
|
+
control: {
|
|
56
|
+
type: 'boolean',
|
|
57
|
+
},
|
|
58
|
+
if: {
|
|
59
|
+
arg: 'optional',
|
|
60
|
+
truthy: false,
|
|
61
|
+
},
|
|
62
|
+
}, hasRequiredIndicator: {
|
|
63
|
+
control: {
|
|
64
|
+
type: 'boolean',
|
|
65
|
+
},
|
|
66
|
+
if: {
|
|
67
|
+
arg: 'required',
|
|
68
|
+
truthy: true,
|
|
69
|
+
},
|
|
70
|
+
}, optional: {
|
|
71
|
+
control: {
|
|
72
|
+
type: 'boolean',
|
|
73
|
+
},
|
|
74
|
+
if: {
|
|
75
|
+
arg: 'required',
|
|
76
|
+
truthy: false,
|
|
77
|
+
},
|
|
78
|
+
}, optionalText: {
|
|
79
|
+
control: {
|
|
80
|
+
type: 'text',
|
|
81
|
+
},
|
|
82
|
+
if: {
|
|
83
|
+
arg: 'required',
|
|
84
|
+
truthy: false,
|
|
85
|
+
},
|
|
86
|
+
}, maxLength: {
|
|
87
|
+
control: {
|
|
88
|
+
type: 'number',
|
|
89
|
+
},
|
|
90
|
+
}, labelPlacement: {
|
|
91
|
+
options: labelPlacements,
|
|
92
|
+
control: {
|
|
93
|
+
type: 'inline-radio',
|
|
94
|
+
},
|
|
95
|
+
}, keepPlaceholder: {
|
|
96
|
+
control: {
|
|
97
|
+
type: 'boolean',
|
|
98
|
+
},
|
|
99
|
+
if: {
|
|
100
|
+
arg: 'labelPlacement',
|
|
101
|
+
eq: 'inner',
|
|
102
|
+
},
|
|
103
|
+
}, titleCaption: {
|
|
104
|
+
control: { type: 'text' },
|
|
105
|
+
}, leftHelper: {
|
|
106
|
+
control: { type: 'text' },
|
|
107
|
+
}, hintText: {
|
|
108
|
+
control: { type: 'text' },
|
|
109
|
+
if: {
|
|
110
|
+
arg: 'hasHint',
|
|
111
|
+
truthy: true,
|
|
112
|
+
},
|
|
113
|
+
}, hintView: {
|
|
114
|
+
options: hintViews,
|
|
115
|
+
control: {
|
|
116
|
+
type: 'select',
|
|
117
|
+
},
|
|
118
|
+
if: {
|
|
119
|
+
arg: 'hasHint',
|
|
120
|
+
truthy: true,
|
|
121
|
+
},
|
|
122
|
+
}, hintSize: {
|
|
123
|
+
options: hintSizes,
|
|
124
|
+
control: {
|
|
125
|
+
type: 'select',
|
|
126
|
+
},
|
|
127
|
+
if: {
|
|
128
|
+
arg: 'hasHint',
|
|
129
|
+
truthy: true,
|
|
130
|
+
},
|
|
131
|
+
}, hintTargetPlacement: {
|
|
132
|
+
options: hintTargetPlacements,
|
|
133
|
+
control: {
|
|
134
|
+
type: 'inline-radio',
|
|
135
|
+
},
|
|
136
|
+
if: {
|
|
137
|
+
arg: 'hasHint',
|
|
138
|
+
truthy: true,
|
|
139
|
+
},
|
|
140
|
+
}, hintTrigger: {
|
|
141
|
+
options: hintTriggers,
|
|
142
|
+
control: {
|
|
143
|
+
type: 'inline-radio',
|
|
144
|
+
},
|
|
145
|
+
if: {
|
|
146
|
+
arg: 'hasHint',
|
|
147
|
+
truthy: true,
|
|
148
|
+
},
|
|
149
|
+
}, hintPlacement: {
|
|
150
|
+
options: placements,
|
|
151
|
+
control: {
|
|
152
|
+
type: 'select',
|
|
153
|
+
},
|
|
154
|
+
if: {
|
|
155
|
+
arg: 'hasHint',
|
|
156
|
+
truthy: true,
|
|
157
|
+
},
|
|
158
|
+
mappers: placements,
|
|
159
|
+
}, hintHasArrow: {
|
|
160
|
+
control: { type: 'boolean' },
|
|
161
|
+
if: {
|
|
162
|
+
arg: 'hasHint',
|
|
163
|
+
truthy: true,
|
|
164
|
+
},
|
|
165
|
+
}, hintWidth: {
|
|
166
|
+
control: { type: 'text' },
|
|
167
|
+
if: {
|
|
168
|
+
arg: 'hasHint',
|
|
169
|
+
truthy: true,
|
|
170
|
+
},
|
|
171
|
+
} }, additionalArgTypes), disableProps(__spreadArray([
|
|
172
|
+
'theme',
|
|
173
|
+
'loader',
|
|
174
|
+
'onClick',
|
|
175
|
+
'onFocus',
|
|
176
|
+
'onBlur',
|
|
177
|
+
'outlined',
|
|
178
|
+
'contentLeft',
|
|
179
|
+
'contentRight',
|
|
180
|
+
'shiftLeft',
|
|
181
|
+
'shiftRight',
|
|
182
|
+
'stretch',
|
|
183
|
+
'as',
|
|
184
|
+
'forwardedAs',
|
|
185
|
+
'pin',
|
|
186
|
+
'focused',
|
|
187
|
+
'blur',
|
|
188
|
+
'square'
|
|
189
|
+
], disablePropsList))),
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/TextField/meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EACH,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,kBAAkB,GACrB,MAAM,YAAY,CAAC;AAWpB,MAAM,CAAC,IAAM,UAAU,GAAG,UAAC,EAOT;QANd,SAAS,eAAA,EACT,eAAe,qBAAA,EACf,aAA8B,EAA9B,KAAK,mBAAG,sBAAsB,KAAA,EAC9B,mBAAgB,EAAhB,WAAW,mBAAG,EAAE,KAAA,EAChB,0BAAuB,EAAvB,kBAAkB,mBAAG,EAAE,KAAA,EACvB,wBAAqB,EAArB,gBAAgB,mBAAG,EAAE,KAAA;IAErB,OAAO;QACH,KAAK,OAAA;QACL,UAAU,EAAE,CAAC,kBAAkB,CAAC;QAChC,SAAS,WAAA;QACT,IAAI,aACA,EAAE,EAAE,oBAAoB,EACxB,UAAU,EAAE,SAAS,EACrB,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,GAAG,EACT,IAAI,EAAE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;iBACf;aACJ,IACE,kBAAkB,GAClB,YAAY;YACX,OAAO;YACP,QAAQ;YACR,SAAS;YACT,SAAS;YACT,QAAQ;YACR,UAAU;YACV,aAAa;YACb,cAAc;YACd,WAAW;YACX,YAAY;YACZ,SAAS;YACT,IAAI;YACJ,aAAa;YACb,KAAK;YACL,SAAS;YACT,MAAM;YACN,QAAQ;WACL,gBAAgB,EACrB,CACL;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const createDefaultStory: (TextField: any, customIcon?: ((size: string) => JSX.Element) | undefined) => ({ enableContentLeft, enableContentRight, view, readOnly, ...rest }: any) => JSX.Element;
|
|
2
|
+
export declare const createChipsStory: (TextField: any, customIcon?: ((size: string) => JSX.Element) | undefined) => ({ enableContentLeft, enableContentRight, view, readOnly, ...rest }: any) => JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { useState } from 'react';
|
|
24
|
+
import { action } from '@storybook/addon-actions';
|
|
25
|
+
import { IconBellFill } from '@salutejs/plasma-icons';
|
|
26
|
+
var onChange = action('onChange');
|
|
27
|
+
var onFocus = action('onFocus');
|
|
28
|
+
var onBlur = action('onBlur');
|
|
29
|
+
var onSearch = action('onSearch');
|
|
30
|
+
var onChipsChange = action('onChipsChange');
|
|
31
|
+
var getIcon = function (IconComponent, size) {
|
|
32
|
+
var iconSize = size === 'xs' ? 'xs' : 's';
|
|
33
|
+
return React.createElement(IconComponent, { size: iconSize, color: "inherit" });
|
|
34
|
+
};
|
|
35
|
+
export var createDefaultStory = function (TextField, customIcon) {
|
|
36
|
+
return function (_a) {
|
|
37
|
+
var enableContentLeft = _a.enableContentLeft, enableContentRight = _a.enableContentRight, view = _a.view, readOnly = _a.readOnly, rest = __rest(_a, ["enableContentLeft", "enableContentRight", "view", "readOnly"]);
|
|
38
|
+
var _b = useState('Значение поля'), text = _b[0], setText = _b[1];
|
|
39
|
+
var innerGetIcon = customIcon ? customIcon(rest.size) : getIcon(IconBellFill, rest.size);
|
|
40
|
+
var contentRight = enableContentRight || readOnly ? innerGetIcon : undefined;
|
|
41
|
+
return (React.createElement("div", { style: {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexDirection: 'column',
|
|
44
|
+
gap: '2rem',
|
|
45
|
+
width: '70%',
|
|
46
|
+
margin: '0 auto',
|
|
47
|
+
} },
|
|
48
|
+
React.createElement(TextField, __assign({}, rest, { value: text, readOnly: readOnly, contentLeft: enableContentLeft ? innerGetIcon : undefined, contentRight: contentRight, view: view, onChange: function (e) {
|
|
49
|
+
setText(e.target.value);
|
|
50
|
+
onChange(e.target.value);
|
|
51
|
+
}, onFocus: onFocus, onBlur: onBlur, onSearch: onSearch })),
|
|
52
|
+
React.createElement(TextField, __assign({}, rest, { label: "Uncontrolled TextField", defaultValue: "\u0414\u0435\u0444\u043E\u043B\u0442\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", contentLeft: enableContentLeft ? innerGetIcon : undefined, contentRight: contentRight, view: view, readOnly: readOnly, onFocus: onFocus, onBlur: onBlur, onSearch: onSearch }))));
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export var createChipsStory = function (TextField, customIcon) {
|
|
56
|
+
return function (_a) {
|
|
57
|
+
var enableContentLeft = _a.enableContentLeft, enableContentRight = _a.enableContentRight, view = _a.view, readOnly = _a.readOnly, rest = __rest(_a, ["enableContentLeft", "enableContentRight", "view", "readOnly"]);
|
|
58
|
+
var _b = useState('Значение поля'), text = _b[0], setText = _b[1];
|
|
59
|
+
var innerGetIcon = customIcon ? customIcon(rest.size) : getIcon(IconBellFill, rest.size);
|
|
60
|
+
var contentRight = enableContentRight || readOnly ? innerGetIcon : undefined;
|
|
61
|
+
var validateChip = function (value) { return (value === '1 value' ? { view: 'negative' } : {}); };
|
|
62
|
+
return (React.createElement(TextField, __assign({}, rest, { enumerationType: "chip", value: text, contentLeft: enableContentLeft ? innerGetIcon : undefined, contentRight: contentRight, view: view, readOnly: readOnly, onChange: function (e) {
|
|
63
|
+
setText(e.target.value);
|
|
64
|
+
onChange(e.target.value);
|
|
65
|
+
}, onFocus: onFocus, onBlur: onBlur, onChangeChips: onChipsChange, chipValidator: validateChip, style: {
|
|
66
|
+
width: '70%',
|
|
67
|
+
margin: '0 auto',
|
|
68
|
+
} })));
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/TextField/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAe,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,O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AAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAE3F,IAAM,YAAY,GAAG,kBAAkB,IAAI,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;QAE/E,IAAM,YAAY,GAAG,UAAC,KAAa,IAAK,OAAA,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAjD,CAAiD,CAAC;QAE1F,OAAO,CACH,oBAAC,SAAS,eACF,IAAI,IACR,eAAe,EAAC,MAAM,EACtB,KAAK,EAAE,IAAI,EACX,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACzD,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,UAAC,CAAgC;gBACvC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACxB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC,EACD,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,YAAY,EAC3B,KAAK,EAAE;gBACH,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,QAAQ;aACnB,IACH,CACL,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -5,4 +5,5 @@ export { InSpacing as InSpacingDecorator } from './StoryDecorators';
|
|
|
5
5
|
export { ThemeColors } from './ThemeColors';
|
|
6
6
|
export { withReactStrictMode, reactStrictModePreviewOption } from './ReactStrictModeDecorator';
|
|
7
7
|
export * from './Button';
|
|
8
|
+
export * from './TextField';
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC/F,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC/F,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salutejs/plasma-sb-utils",
|
|
3
|
-
"version": "0.211.0-canary.
|
|
3
|
+
"version": "0.211.0-canary.2371.19919666002.0",
|
|
4
4
|
"description": "Code shared between ui libraries.",
|
|
5
5
|
"author": "Salute Frontend Team <salute.developers@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@salutejs/plasma-colors": "0.16.0",
|
|
23
|
-
"@salutejs/plasma-core": "1.211.0-canary.
|
|
24
|
-
"@salutejs/plasma-icons": "1.
|
|
23
|
+
"@salutejs/plasma-core": "1.211.0-canary.2371.19919666002.0",
|
|
24
|
+
"@salutejs/plasma-icons": "1.228.0-canary.2371.19919666002.0",
|
|
25
25
|
"@storybook/addon-actions": "8.6.14",
|
|
26
26
|
"@storybook/react": "8.6.14",
|
|
27
27
|
"param-case": "^3.0.4"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"files": [
|
|
47
47
|
"lib"
|
|
48
48
|
],
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "6965b0395198f24c7d40d2a6d10c3b2d09c69482"
|
|
50
50
|
}
|