@salutejs/plasma-sb-utils 0.231.0-next-sbcom.0 → 0.231.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.
Files changed (94) hide show
  1. package/lib/components/Attach/Attach.d.ts +248 -0
  2. package/lib/components/Attach/Attach.js +35 -0
  3. package/lib/components/Attach/Attach.js.map +1 -0
  4. package/lib/components/Attach/fixtures.d.ts +6 -0
  5. package/lib/components/Attach/fixtures.js +7 -0
  6. package/lib/components/Attach/fixtures.js.map +1 -0
  7. package/lib/components/Attach/index.d.ts +1 -0
  8. package/lib/components/Attach/index.js +2 -0
  9. package/lib/components/Attach/index.js.map +1 -0
  10. package/lib/components/Attach/meta.d.ts +243 -0
  11. package/lib/components/Attach/meta.js +150 -0
  12. package/lib/components/Attach/meta.js.map +1 -0
  13. package/lib/components/Attach/stories.d.ts +1 -0
  14. package/lib/components/Attach/stories.js +71 -0
  15. package/lib/components/Attach/stories.js.map +1 -0
  16. package/lib/components/Badge/Badge.d.ts +119 -0
  17. package/lib/components/Badge/Badge.js +40 -0
  18. package/lib/components/Badge/Badge.js.map +1 -0
  19. package/lib/components/Badge/fixtures.d.ts +3 -0
  20. package/lib/components/Badge/fixtures.js +7 -0
  21. package/lib/components/Badge/fixtures.js.map +1 -0
  22. package/lib/components/Badge/index.d.ts +1 -0
  23. package/lib/components/Badge/index.js +2 -0
  24. package/lib/components/Badge/index.js.map +1 -0
  25. package/lib/components/Badge/meta.d.ts +114 -0
  26. package/lib/components/Badge/meta.js +67 -0
  27. package/lib/components/Badge/meta.js.map +1 -0
  28. package/lib/components/Badge/stories.d.ts +1 -0
  29. package/lib/components/Badge/stories.js +34 -0
  30. package/lib/components/Badge/stories.js.map +1 -0
  31. package/lib/components/Button/Button.d.ts +50 -4
  32. package/lib/components/Button/meta.d.ts +50 -4
  33. package/lib/components/Button/meta.js +25 -6
  34. package/lib/components/Button/meta.js.map +1 -1
  35. package/lib/components/Chip/meta.js +1 -1
  36. package/lib/components/Chip/meta.js.map +1 -1
  37. package/lib/components/CodeField/CodeField.d.ts +156 -0
  38. package/lib/components/CodeField/CodeField.js +40 -0
  39. package/lib/components/CodeField/CodeField.js.map +1 -0
  40. package/lib/components/CodeField/fixtures.d.ts +6 -0
  41. package/lib/components/CodeField/fixtures.js +7 -0
  42. package/lib/components/CodeField/fixtures.js.map +1 -0
  43. package/lib/components/CodeField/index.d.ts +1 -0
  44. package/lib/components/CodeField/index.js +2 -0
  45. package/lib/components/CodeField/index.js.map +1 -0
  46. package/lib/components/CodeField/meta.d.ts +151 -0
  47. package/lib/components/CodeField/meta.js +84 -0
  48. package/lib/components/CodeField/meta.js.map +1 -0
  49. package/lib/components/CodeField/stories.d.ts +1 -0
  50. package/lib/components/CodeField/stories.js +38 -0
  51. package/lib/components/CodeField/stories.js.map +1 -0
  52. package/lib/components/CodeInput/CodeInput.d.ts +147 -0
  53. package/lib/components/CodeInput/CodeInput.js +40 -0
  54. package/lib/components/CodeInput/CodeInput.js.map +1 -0
  55. package/lib/components/CodeInput/fixtures.d.ts +5 -0
  56. package/lib/components/CodeInput/fixtures.js +6 -0
  57. package/lib/components/CodeInput/fixtures.js.map +1 -0
  58. package/lib/components/CodeInput/index.d.ts +1 -0
  59. package/lib/components/CodeInput/index.js +2 -0
  60. package/lib/components/CodeInput/index.js.map +1 -0
  61. package/lib/components/CodeInput/meta.d.ts +142 -0
  62. package/lib/components/CodeInput/meta.js +80 -0
  63. package/lib/components/CodeInput/meta.js.map +1 -0
  64. package/lib/components/CodeInput/stories.d.ts +1 -0
  65. package/lib/components/CodeInput/stories.js +38 -0
  66. package/lib/components/CodeInput/stories.js.map +1 -0
  67. package/lib/components/DatePicker/DatePicker.d.ts +443 -2
  68. package/lib/components/DatePicker/meta.d.ts +443 -2
  69. package/lib/components/DatePicker/meta.js +176 -154
  70. package/lib/components/DatePicker/meta.js.map +1 -1
  71. package/lib/components/DatePicker/stories.js +3 -0
  72. package/lib/components/DatePicker/stories.js.map +1 -1
  73. package/lib/components/DateTimePicker/stories.d.ts +1 -1
  74. package/lib/components/DateTimePicker/stories.js +2 -2
  75. package/lib/components/DateTimePicker/stories.js.map +1 -1
  76. package/lib/components/Range/stories.js +2 -0
  77. package/lib/components/Range/stories.js.map +1 -1
  78. package/lib/components/Steps/Steps.js +1 -4
  79. package/lib/components/Steps/Steps.js.map +1 -1
  80. package/lib/components/TextField/TextField.d.ts +143 -0
  81. package/lib/components/TextField/meta.d.ts +143 -0
  82. package/lib/components/TextField/meta.js +69 -45
  83. package/lib/components/TextField/meta.js.map +1 -1
  84. package/lib/components/TimePicker/TimePicker.d.ts +20 -0
  85. package/lib/components/TimePicker/fixtures.d.ts +1 -0
  86. package/lib/components/TimePicker/fixtures.js +1 -0
  87. package/lib/components/TimePicker/fixtures.js.map +1 -1
  88. package/lib/components/TimePicker/meta.d.ts +20 -0
  89. package/lib/components/TimePicker/meta.js +10 -2
  90. package/lib/components/TimePicker/meta.js.map +1 -1
  91. package/lib/components/index.d.ts +4 -0
  92. package/lib/components/index.js +4 -0
  93. package/lib/components/index.js.map +1 -1
  94. package/package.json +4 -4
@@ -0,0 +1,151 @@
1
+ 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: import("@storybook/react").Decorator[];
12
+ component: any;
13
+ args: {
14
+ view: string;
15
+ size: string;
16
+ shape: string;
17
+ codeLength: number;
18
+ caption: string;
19
+ captionAlign: string;
20
+ width: string;
21
+ isError: boolean;
22
+ itemErrorBehavior: string;
23
+ codeErrorBehavior: string;
24
+ autoFocus: boolean;
25
+ disabled: boolean;
26
+ };
27
+ argTypes: {
28
+ view: {
29
+ options: any;
30
+ control: {
31
+ type: string;
32
+ };
33
+ table: {
34
+ category: string;
35
+ };
36
+ };
37
+ size: {
38
+ options: any;
39
+ control: {
40
+ type: string;
41
+ };
42
+ table: {
43
+ category: string;
44
+ };
45
+ };
46
+ shape: {
47
+ options: string[];
48
+ control: {
49
+ type: string;
50
+ };
51
+ table: {
52
+ category: string;
53
+ };
54
+ };
55
+ disabled: {
56
+ control: {
57
+ type: string;
58
+ };
59
+ table: {
60
+ category: string;
61
+ };
62
+ };
63
+ isError: {
64
+ control: {
65
+ type: string;
66
+ };
67
+ table: {
68
+ category: string;
69
+ };
70
+ };
71
+ autoFocus: {
72
+ control: {
73
+ type: string;
74
+ };
75
+ table: {
76
+ category: string;
77
+ };
78
+ };
79
+ codeLength: {
80
+ options: number[];
81
+ control: {
82
+ type: string;
83
+ };
84
+ table: {
85
+ category: string;
86
+ };
87
+ };
88
+ inputMode: {
89
+ options: string[];
90
+ control: {
91
+ type: string;
92
+ };
93
+ table: {
94
+ category: string;
95
+ subcategory: string;
96
+ };
97
+ };
98
+ itemErrorBehavior: {
99
+ options: string[];
100
+ control: {
101
+ type: string;
102
+ };
103
+ table: {
104
+ category: string;
105
+ };
106
+ };
107
+ codeErrorBehavior: {
108
+ options: string[];
109
+ control: {
110
+ type: string;
111
+ };
112
+ table: {
113
+ category: string;
114
+ };
115
+ };
116
+ caption: {
117
+ control: {
118
+ type: string;
119
+ };
120
+ table: {
121
+ category: string;
122
+ };
123
+ };
124
+ captionAlign: {
125
+ options: string[];
126
+ control: {
127
+ type: string;
128
+ };
129
+ table: {
130
+ category: string;
131
+ };
132
+ };
133
+ width: {
134
+ control: {
135
+ type: string;
136
+ };
137
+ table: {
138
+ category: string;
139
+ };
140
+ };
141
+ placeholder: {
142
+ control: {
143
+ type: string;
144
+ };
145
+ table: {
146
+ category: string;
147
+ };
148
+ };
149
+ };
150
+ };
151
+ export {};
@@ -0,0 +1,84 @@
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, pack) {
13
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
+ if (ar || !(i in from)) {
15
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
+ ar[i] = from[i];
17
+ }
18
+ }
19
+ return to.concat(ar || Array.prototype.slice.call(from));
20
+ };
21
+ import { disableProps, InSpacingDecorator } from '../../index';
22
+ import { shapes, captionAlignVariants, codeLengths, itemErrorBehaviorVariants, codeErrorBehaviorVariants, inputModes, } from './fixtures';
23
+ var commonDisabledArgs = ['value', 'onChange', 'onFullCodeEnter', 'setIsError', 'allowedSymbols'];
24
+ export var createMeta = function (_a) {
25
+ var component = _a.component, componentConfig = _a.componentConfig, _b = _a.title, title = _b === void 0 ? 'Data Entry/CodeField' : _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;
26
+ return {
27
+ title: title,
28
+ decorators: [InSpacingDecorator],
29
+ component: component,
30
+ args: __assign({ view: 'default', size: 'm', shape: 'default', codeLength: 6, caption: 'Caption', captionAlign: 'center', width: '', isError: false, itemErrorBehavior: 'remove-symbol', codeErrorBehavior: 'keep', autoFocus: true, disabled: false }, defaultArgs),
31
+ argTypes: __assign(__assign({ view: {
32
+ options: componentConfig.views,
33
+ control: { type: 'select' },
34
+ table: { category: 'variation' },
35
+ }, size: {
36
+ options: componentConfig.sizes,
37
+ control: { type: 'select' },
38
+ table: { category: 'variation' },
39
+ }, shape: {
40
+ options: shapes,
41
+ control: { type: 'select' },
42
+ table: { category: 'variation' },
43
+ }, disabled: {
44
+ control: { type: 'boolean' },
45
+ table: { category: 'variation' },
46
+ }, isError: {
47
+ control: { type: 'boolean' },
48
+ table: { category: 'variation' },
49
+ }, autoFocus: {
50
+ control: { type: 'boolean' },
51
+ table: { category: 'variation' },
52
+ }, codeLength: {
53
+ options: codeLengths,
54
+ control: { type: 'select' },
55
+ table: { category: 'code-related' },
56
+ }, inputMode: {
57
+ options: inputModes,
58
+ control: { type: 'select' },
59
+ table: { category: 'code-related', subcategory: 'MOBILE INPUT' },
60
+ }, itemErrorBehavior: {
61
+ options: itemErrorBehaviorVariants,
62
+ control: { type: 'select' },
63
+ table: { category: 'code-related' },
64
+ }, codeErrorBehavior: {
65
+ options: codeErrorBehaviorVariants,
66
+ control: { type: 'select' },
67
+ table: { category: 'code-related' },
68
+ }, caption: {
69
+ control: { type: 'text' },
70
+ table: { category: 'layout' },
71
+ }, captionAlign: {
72
+ options: captionAlignVariants,
73
+ control: { type: 'select' },
74
+ table: { category: 'layout' },
75
+ }, width: {
76
+ control: { type: 'text' },
77
+ table: { category: 'layout' },
78
+ }, placeholder: {
79
+ control: { type: 'text' },
80
+ table: { category: 'layout' },
81
+ } }, additionalArgTypes), disableProps(__spreadArray(__spreadArray([], commonDisabledArgs, true), disablePropsList, true))),
82
+ };
83
+ };
84
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/CodeField/meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EACH,MAAM,EACN,oBAAoB,EACpB,WAAW,EACX,yBAAyB,EACzB,yBAAyB,EACzB,UAAU,GACb,MAAM,YAAY,CAAC;AAWpB,IAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;AAEpG,MAAM,CAAC,IAAM,UAAU,GAAG,UAAC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gBACzB,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;aAChC,EACD,WAAW,EAAE;gBACT,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACzB,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;aAChC,IACE,kBAAkB,GAClB,YAAY,iCAAK,kBAAkB,SAAK,gBAAgB,QAAE,CAChE;KACJ,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const createDefaultStory: (CodeField: any) => ({ ...rest }: any) => JSX.Element;
@@ -0,0 +1,38 @@
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/actions';
25
+ var onChange = action('onChange');
26
+ var onFullCodeEnter = action('onFullCodeEnter');
27
+ export var createDefaultStory = function (CodeField) {
28
+ return function (_a) {
29
+ var rest = __rest(_a, []);
30
+ var _b = useState(''), value = _b[0], setValue = _b[1];
31
+ var handleChange = function (newValue) {
32
+ setValue(newValue);
33
+ onChange(newValue);
34
+ };
35
+ return React.createElement(CodeField, __assign({}, rest, { value: value, onChange: handleChange, onFullCodeEnter: onFullCodeEnter }));
36
+ };
37
+ };
38
+ //# sourceMappingURL=stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/CodeField/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,IAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACpC,IAAM,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAElD,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,SAAc;IAC7C,OAAO,UAAC,EAAgB;YAAX,IAAI,cAAT,EAAW,CAAF;QACP,IAAA,KAAoB,QAAQ,CAAC,EAAE,CAAC,EAA/B,KAAK,QAAA,EAAE,QAAQ,QAAgB,CAAC;QAEvC,IAAM,YAAY,GAAG,UAAC,QAAgB;YAClC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACnB,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC,CAAC;QAEF,OAAO,oBAAC,SAAS,eAAK,IAAI,IAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,IAAI,CAAC;IAC3G,CAAC,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,147 @@
1
+ type CreateCodeInputStoriesProps = {
2
+ component: any;
3
+ componentConfig: any;
4
+ title?: string;
5
+ disablePropsList?: string[];
6
+ defaultArgs?: {};
7
+ additionalArgTypes?: {};
8
+ };
9
+ export declare const getCodeInputStories: (config: CreateCodeInputStoriesProps) => {
10
+ meta: {
11
+ title: string;
12
+ decorators: import("@storybook/react").Decorator[];
13
+ component: any;
14
+ args: {
15
+ view: string;
16
+ size: string;
17
+ codeLength: number;
18
+ caption: string;
19
+ captionAlign: string;
20
+ width: string;
21
+ isError: boolean;
22
+ itemErrorBehavior: string;
23
+ codeErrorBehavior: string;
24
+ autoFocus: boolean;
25
+ disabled: boolean;
26
+ hidden: boolean;
27
+ };
28
+ argTypes: {
29
+ view: {
30
+ options: any;
31
+ control: {
32
+ type: string;
33
+ };
34
+ table: {
35
+ category: string;
36
+ };
37
+ };
38
+ size: {
39
+ options: any;
40
+ control: {
41
+ type: string;
42
+ };
43
+ table: {
44
+ category: string;
45
+ };
46
+ };
47
+ disabled: {
48
+ control: {
49
+ type: string;
50
+ };
51
+ table: {
52
+ category: string;
53
+ };
54
+ };
55
+ isError: {
56
+ control: {
57
+ type: string;
58
+ };
59
+ table: {
60
+ category: string;
61
+ };
62
+ };
63
+ autoFocus: {
64
+ control: {
65
+ type: string;
66
+ };
67
+ table: {
68
+ category: string;
69
+ };
70
+ };
71
+ hidden: {
72
+ control: {
73
+ type: string;
74
+ };
75
+ table: {
76
+ category: string;
77
+ };
78
+ };
79
+ codeLength: {
80
+ options: number[];
81
+ control: {
82
+ type: string;
83
+ };
84
+ table: {
85
+ category: string;
86
+ };
87
+ };
88
+ inputMode: {
89
+ options: string[];
90
+ control: {
91
+ type: string;
92
+ };
93
+ table: {
94
+ category: string;
95
+ subcategory: string;
96
+ };
97
+ };
98
+ itemErrorBehavior: {
99
+ options: string[];
100
+ control: {
101
+ type: string;
102
+ };
103
+ table: {
104
+ category: string;
105
+ };
106
+ };
107
+ codeErrorBehavior: {
108
+ options: string[];
109
+ control: {
110
+ type: string;
111
+ };
112
+ table: {
113
+ category: string;
114
+ };
115
+ };
116
+ caption: {
117
+ control: {
118
+ type: string;
119
+ };
120
+ table: {
121
+ category: string;
122
+ };
123
+ };
124
+ captionAlign: {
125
+ options: string[];
126
+ control: {
127
+ type: string;
128
+ };
129
+ table: {
130
+ category: string;
131
+ };
132
+ };
133
+ width: {
134
+ control: {
135
+ type: string;
136
+ };
137
+ table: {
138
+ category: string;
139
+ };
140
+ };
141
+ };
142
+ };
143
+ Default: {
144
+ render: (args: any) => JSX.Element;
145
+ };
146
+ };
147
+ export {};
@@ -0,0 +1,40 @@
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 { createDefaultStory } from './stories';
27
+ export var getCodeInputStories = function (config) {
28
+ var component = config.component, componentConfig = config.componentConfig, rest = __rest(config, ["component", "componentConfig"]);
29
+ var componentConfigVariations = getConfigVariations(componentConfig);
30
+ var meta = createMeta(__assign({ component: component, componentConfig: componentConfigVariations }, rest));
31
+ var DefaultStoryComponent = createDefaultStory(component);
32
+ var Default = {
33
+ render: function (args) { return React.createElement(DefaultStoryComponent, __assign({}, args)); },
34
+ };
35
+ return {
36
+ meta: meta,
37
+ Default: Default,
38
+ };
39
+ };
40
+ //# sourceMappingURL=CodeInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeInput.js","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.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,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAW/C,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,MAAmC;IAC3D,IAAA,SAAS,GAA+B,MAAM,UAArC,EAAE,eAAe,GAAc,MAAM,gBAApB,EAAK,IAAI,UAAK,MAAM,EAAhD,gCAAuC,CAAF,CAAY;IAEvD,IAAM,yBAAyB,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAEvE,IAAM,IAAI,GAAG,UAAU,YAAG,SAAS,WAAA,EAAE,eAAe,EAAE,yBAAyB,IAAK,IAAI,EAAG,CAAC;IAE5F,IAAM,qBAAqB,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAE5D,IAAM,OAAO,GAAG;QACZ,MAAM,EAAE,UAAC,IAAS,IAAK,OAAA,oBAAC,qBAAqB,eAAK,IAAI,EAAI,EAAnC,CAAmC;KAC7D,CAAC;IAEF,OAAO;QACH,IAAI,MAAA;QACJ,OAAO,SAAA;KACV,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const captionAlignVariants: string[];
2
+ export declare const codeLengths: number[];
3
+ export declare const itemErrorBehaviorVariants: string[];
4
+ export declare const codeErrorBehaviorVariants: string[];
5
+ export declare const inputModes: string[];
@@ -0,0 +1,6 @@
1
+ export var captionAlignVariants = ['left', 'center'];
2
+ export var codeLengths = [4, 5, 6];
3
+ export var itemErrorBehaviorVariants = ['remove-symbol', 'forbid-enter'];
4
+ export var codeErrorBehaviorVariants = ['remove-code', 'keep'];
5
+ export var inputModes = ['numeric', 'text'];
6
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src/components/CodeInput/fixtures.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACvD,MAAM,CAAC,IAAM,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,MAAM,CAAC,IAAM,yBAAyB,GAAG,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;AAC3E,MAAM,CAAC,IAAM,yBAAyB,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACjE,MAAM,CAAC,IAAM,UAAU,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './CodeInput';
@@ -0,0 +1,2 @@
1
+ export * from './CodeInput';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CodeInput/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,142 @@
1
+ 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: import("@storybook/react").Decorator[];
12
+ component: any;
13
+ args: {
14
+ view: string;
15
+ size: string;
16
+ codeLength: number;
17
+ caption: string;
18
+ captionAlign: string;
19
+ width: string;
20
+ isError: boolean;
21
+ itemErrorBehavior: string;
22
+ codeErrorBehavior: string;
23
+ autoFocus: boolean;
24
+ disabled: boolean;
25
+ hidden: boolean;
26
+ };
27
+ argTypes: {
28
+ view: {
29
+ options: any;
30
+ control: {
31
+ type: string;
32
+ };
33
+ table: {
34
+ category: string;
35
+ };
36
+ };
37
+ size: {
38
+ options: any;
39
+ control: {
40
+ type: string;
41
+ };
42
+ table: {
43
+ category: string;
44
+ };
45
+ };
46
+ disabled: {
47
+ control: {
48
+ type: string;
49
+ };
50
+ table: {
51
+ category: string;
52
+ };
53
+ };
54
+ isError: {
55
+ control: {
56
+ type: string;
57
+ };
58
+ table: {
59
+ category: string;
60
+ };
61
+ };
62
+ autoFocus: {
63
+ control: {
64
+ type: string;
65
+ };
66
+ table: {
67
+ category: string;
68
+ };
69
+ };
70
+ hidden: {
71
+ control: {
72
+ type: string;
73
+ };
74
+ table: {
75
+ category: string;
76
+ };
77
+ };
78
+ codeLength: {
79
+ options: number[];
80
+ control: {
81
+ type: string;
82
+ };
83
+ table: {
84
+ category: string;
85
+ };
86
+ };
87
+ inputMode: {
88
+ options: string[];
89
+ control: {
90
+ type: string;
91
+ };
92
+ table: {
93
+ category: string;
94
+ subcategory: string;
95
+ };
96
+ };
97
+ itemErrorBehavior: {
98
+ options: string[];
99
+ control: {
100
+ type: string;
101
+ };
102
+ table: {
103
+ category: string;
104
+ };
105
+ };
106
+ codeErrorBehavior: {
107
+ options: string[];
108
+ control: {
109
+ type: string;
110
+ };
111
+ table: {
112
+ category: string;
113
+ };
114
+ };
115
+ caption: {
116
+ control: {
117
+ type: string;
118
+ };
119
+ table: {
120
+ category: string;
121
+ };
122
+ };
123
+ captionAlign: {
124
+ options: string[];
125
+ control: {
126
+ type: string;
127
+ };
128
+ table: {
129
+ category: string;
130
+ };
131
+ };
132
+ width: {
133
+ control: {
134
+ type: string;
135
+ };
136
+ table: {
137
+ category: string;
138
+ };
139
+ };
140
+ };
141
+ };
142
+ export {};