@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.
- package/lib/components/Attach/Attach.d.ts +248 -0
- package/lib/components/Attach/Attach.js +35 -0
- package/lib/components/Attach/Attach.js.map +1 -0
- package/lib/components/Attach/fixtures.d.ts +6 -0
- package/lib/components/Attach/fixtures.js +7 -0
- package/lib/components/Attach/fixtures.js.map +1 -0
- package/lib/components/Attach/index.d.ts +1 -0
- package/lib/components/Attach/index.js +2 -0
- package/lib/components/Attach/index.js.map +1 -0
- package/lib/components/Attach/meta.d.ts +243 -0
- package/lib/components/Attach/meta.js +150 -0
- package/lib/components/Attach/meta.js.map +1 -0
- package/lib/components/Attach/stories.d.ts +1 -0
- package/lib/components/Attach/stories.js +71 -0
- package/lib/components/Attach/stories.js.map +1 -0
- package/lib/components/Badge/Badge.d.ts +119 -0
- package/lib/components/Badge/Badge.js +40 -0
- package/lib/components/Badge/Badge.js.map +1 -0
- package/lib/components/Badge/fixtures.d.ts +3 -0
- package/lib/components/Badge/fixtures.js +7 -0
- package/lib/components/Badge/fixtures.js.map +1 -0
- package/lib/components/Badge/index.d.ts +1 -0
- package/lib/components/Badge/index.js +2 -0
- package/lib/components/Badge/index.js.map +1 -0
- package/lib/components/Badge/meta.d.ts +114 -0
- package/lib/components/Badge/meta.js +67 -0
- package/lib/components/Badge/meta.js.map +1 -0
- package/lib/components/Badge/stories.d.ts +1 -0
- package/lib/components/Badge/stories.js +34 -0
- package/lib/components/Badge/stories.js.map +1 -0
- package/lib/components/Button/Button.d.ts +50 -4
- package/lib/components/Button/meta.d.ts +50 -4
- package/lib/components/Button/meta.js +25 -6
- package/lib/components/Button/meta.js.map +1 -1
- package/lib/components/Chip/meta.js +1 -1
- package/lib/components/Chip/meta.js.map +1 -1
- package/lib/components/CodeField/CodeField.d.ts +156 -0
- package/lib/components/CodeField/CodeField.js +40 -0
- package/lib/components/CodeField/CodeField.js.map +1 -0
- package/lib/components/CodeField/fixtures.d.ts +6 -0
- package/lib/components/CodeField/fixtures.js +7 -0
- package/lib/components/CodeField/fixtures.js.map +1 -0
- package/lib/components/CodeField/index.d.ts +1 -0
- package/lib/components/CodeField/index.js +2 -0
- package/lib/components/CodeField/index.js.map +1 -0
- package/lib/components/CodeField/meta.d.ts +151 -0
- package/lib/components/CodeField/meta.js +84 -0
- package/lib/components/CodeField/meta.js.map +1 -0
- package/lib/components/CodeField/stories.d.ts +1 -0
- package/lib/components/CodeField/stories.js +38 -0
- package/lib/components/CodeField/stories.js.map +1 -0
- package/lib/components/CodeInput/CodeInput.d.ts +147 -0
- package/lib/components/CodeInput/CodeInput.js +40 -0
- package/lib/components/CodeInput/CodeInput.js.map +1 -0
- package/lib/components/CodeInput/fixtures.d.ts +5 -0
- package/lib/components/CodeInput/fixtures.js +6 -0
- package/lib/components/CodeInput/fixtures.js.map +1 -0
- package/lib/components/CodeInput/index.d.ts +1 -0
- package/lib/components/CodeInput/index.js +2 -0
- package/lib/components/CodeInput/index.js.map +1 -0
- package/lib/components/CodeInput/meta.d.ts +142 -0
- package/lib/components/CodeInput/meta.js +80 -0
- package/lib/components/CodeInput/meta.js.map +1 -0
- package/lib/components/CodeInput/stories.d.ts +1 -0
- package/lib/components/CodeInput/stories.js +38 -0
- package/lib/components/CodeInput/stories.js.map +1 -0
- package/lib/components/DatePicker/DatePicker.d.ts +443 -2
- package/lib/components/DatePicker/meta.d.ts +443 -2
- package/lib/components/DatePicker/meta.js +176 -154
- package/lib/components/DatePicker/meta.js.map +1 -1
- package/lib/components/DatePicker/stories.js +3 -0
- package/lib/components/DatePicker/stories.js.map +1 -1
- package/lib/components/DateTimePicker/stories.d.ts +1 -1
- package/lib/components/DateTimePicker/stories.js +2 -2
- package/lib/components/DateTimePicker/stories.js.map +1 -1
- package/lib/components/Range/stories.js +2 -0
- package/lib/components/Range/stories.js.map +1 -1
- package/lib/components/Steps/Steps.js +1 -4
- package/lib/components/Steps/Steps.js.map +1 -1
- package/lib/components/TextField/TextField.d.ts +143 -0
- package/lib/components/TextField/meta.d.ts +143 -0
- package/lib/components/TextField/meta.js +69 -45
- package/lib/components/TextField/meta.js.map +1 -1
- package/lib/components/TimePicker/TimePicker.d.ts +20 -0
- package/lib/components/TimePicker/fixtures.d.ts +1 -0
- package/lib/components/TimePicker/fixtures.js +1 -0
- package/lib/components/TimePicker/fixtures.js.map +1 -1
- package/lib/components/TimePicker/meta.d.ts +20 -0
- package/lib/components/TimePicker/meta.js +10 -2
- package/lib/components/TimePicker/meta.js.map +1 -1
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +4 -0
- package/lib/components/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,150 @@
|
|
|
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 { flowOptions, fileFormatOptions, placements, triggers, buttonTypeVariants, helperTextViews } from './fixtures';
|
|
23
|
+
var commonDisabledArgs = [
|
|
24
|
+
'contentLeft',
|
|
25
|
+
'contentRight',
|
|
26
|
+
'onClear',
|
|
27
|
+
'acceptedFileFormats',
|
|
28
|
+
'text',
|
|
29
|
+
'value',
|
|
30
|
+
'dropdownOptions',
|
|
31
|
+
];
|
|
32
|
+
export var createMeta = function (_a) {
|
|
33
|
+
var component = _a.component, componentConfig = _a.componentConfig, _b = _a.title, title = _b === void 0 ? 'Data Entry/Attach' : _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;
|
|
34
|
+
return {
|
|
35
|
+
title: title,
|
|
36
|
+
decorators: [InSpacingDecorator],
|
|
37
|
+
component: component,
|
|
38
|
+
parameters: {
|
|
39
|
+
controls: {
|
|
40
|
+
disableSaveFromUI: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
args: __assign({ controlled: false, size: 'm', view: 'accent', width: '400px', fileFormat: 'all', multiple: false, flow: 'horizontal', hasAttachment: true, hideButtonOnAttach: false, buttonType: 'button', buttonText: 'Загрузить файл', buttonValue: '', enableContentLeft: false, enableContentRight: false, helperTextView: 'default', helperText: 'Подсказка', placement: 'bottom-start', trigger: 'click', listWidth: '300px', closeOnOverlayClick: true }, defaultArgs),
|
|
44
|
+
argTypes: __assign(__assign({ controlled: {
|
|
45
|
+
control: { type: 'boolean' },
|
|
46
|
+
table: { category: 'controlled variant' },
|
|
47
|
+
}, view: {
|
|
48
|
+
options: componentConfig.views,
|
|
49
|
+
control: {
|
|
50
|
+
type: 'select',
|
|
51
|
+
},
|
|
52
|
+
table: { category: 'variation' },
|
|
53
|
+
}, size: {
|
|
54
|
+
options: componentConfig.sizes,
|
|
55
|
+
control: {
|
|
56
|
+
type: 'select',
|
|
57
|
+
},
|
|
58
|
+
table: { category: 'variation' },
|
|
59
|
+
}, helperTextView: {
|
|
60
|
+
options: helperTextViews,
|
|
61
|
+
control: {
|
|
62
|
+
type: 'select',
|
|
63
|
+
},
|
|
64
|
+
table: { category: 'variation' },
|
|
65
|
+
}, buttonType: {
|
|
66
|
+
options: buttonTypeVariants,
|
|
67
|
+
control: {
|
|
68
|
+
type: 'select',
|
|
69
|
+
},
|
|
70
|
+
table: { category: 'variation' },
|
|
71
|
+
}, disabled: {
|
|
72
|
+
control: { type: 'boolean' },
|
|
73
|
+
table: { category: 'variation' },
|
|
74
|
+
}, buttonText: {
|
|
75
|
+
control: {
|
|
76
|
+
type: 'text',
|
|
77
|
+
},
|
|
78
|
+
if: { arg: 'buttonType', eq: 'button' },
|
|
79
|
+
table: { category: 'layout' },
|
|
80
|
+
}, buttonValue: {
|
|
81
|
+
control: {
|
|
82
|
+
type: 'text',
|
|
83
|
+
},
|
|
84
|
+
if: { arg: 'buttonType', eq: 'button' },
|
|
85
|
+
table: { category: 'layout' },
|
|
86
|
+
}, enableContentLeft: {
|
|
87
|
+
control: {
|
|
88
|
+
type: 'boolean',
|
|
89
|
+
},
|
|
90
|
+
if: { arg: 'buttonType', eq: 'button' },
|
|
91
|
+
table: { category: 'layout' },
|
|
92
|
+
}, enableContentRight: {
|
|
93
|
+
control: {
|
|
94
|
+
type: 'boolean',
|
|
95
|
+
},
|
|
96
|
+
if: { arg: 'buttonType', eq: 'button' },
|
|
97
|
+
table: { category: 'layout' },
|
|
98
|
+
}, width: {
|
|
99
|
+
control: { type: 'text' },
|
|
100
|
+
table: { category: 'layout' },
|
|
101
|
+
}, helperText: {
|
|
102
|
+
control: { type: 'text' },
|
|
103
|
+
table: { category: 'layout' },
|
|
104
|
+
}, fileFormat: {
|
|
105
|
+
options: fileFormatOptions,
|
|
106
|
+
control: {
|
|
107
|
+
type: 'select',
|
|
108
|
+
},
|
|
109
|
+
table: { category: 'file' },
|
|
110
|
+
}, multiple: {
|
|
111
|
+
control: { type: 'boolean' },
|
|
112
|
+
table: { category: 'file' },
|
|
113
|
+
}, flow: {
|
|
114
|
+
options: flowOptions,
|
|
115
|
+
control: {
|
|
116
|
+
type: 'select',
|
|
117
|
+
},
|
|
118
|
+
table: { category: 'layout' },
|
|
119
|
+
}, hasAttachment: {
|
|
120
|
+
control: {
|
|
121
|
+
type: 'boolean',
|
|
122
|
+
},
|
|
123
|
+
if: { arg: 'hideButtonOnAttach', truthy: false },
|
|
124
|
+
table: { category: 'layout' },
|
|
125
|
+
}, hideButtonOnAttach: {
|
|
126
|
+
control: { type: 'boolean' },
|
|
127
|
+
table: { category: 'layout' },
|
|
128
|
+
}, placement: {
|
|
129
|
+
options: placements,
|
|
130
|
+
control: {
|
|
131
|
+
type: 'select',
|
|
132
|
+
},
|
|
133
|
+
table: { category: 'dropdown' },
|
|
134
|
+
}, trigger: {
|
|
135
|
+
options: triggers,
|
|
136
|
+
control: {
|
|
137
|
+
type: 'select',
|
|
138
|
+
},
|
|
139
|
+
table: { category: 'dropdown' },
|
|
140
|
+
}, closeOnOverlayClick: {
|
|
141
|
+
control: { type: 'boolean' },
|
|
142
|
+
if: { arg: 'alwaysOpened', truthy: false },
|
|
143
|
+
table: { category: 'dropdown' },
|
|
144
|
+
}, listWidth: {
|
|
145
|
+
control: { type: 'text' },
|
|
146
|
+
table: { category: 'dropdown' },
|
|
147
|
+
} }, additionalArgTypes), disableProps(__spreadArray(__spreadArray([], commonDisabledArgs, true), disablePropsList, true))),
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/Attach/meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,EAAE,QAAQ,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAWvH,IAAM,kBAAkB,GAAG;IACvB,aA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AAQ,EAAE,QAAQ,EAAE;aAChC,EACD,SAAS,EAAE;gBACP,OAAO,EAAE,UAAU;gBACnB,OAAO,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACjB;gBACD,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;aAClC,EACD,OAAO,EAAE;gBACL,OAAO,EAAE,QAAQ;gBACjB,OAAO,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACjB;gBACD,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;aAClC,EACD,mBAAmB,EAAE;gBACjB,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC5B,EAAE,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE;gBAC1C,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;aAClC,EACD,SAAS,EAAE;gBACP,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACzB,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;aAClC,IACE,kBAAkB,GAClB,YAAY,iCAAK,kBAAkB,SAAK,gBAAgB,QAAE,CAChE;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createDefaultStory: (Attach: any) => ({ controlled, buttonType, buttonText, buttonValue, width, size, fileFormat, multiple, enableContentLeft, enableContentRight, placement, trigger, listWidth, closeOnOverlayClick, ...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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
|
+
if (ar || !(i in from)) {
|
|
26
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
27
|
+
ar[i] = from[i];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
+
};
|
|
32
|
+
import React, { useState } from 'react';
|
|
33
|
+
import { action } from 'storybook/actions';
|
|
34
|
+
import { IconPlasma } from '@salutejs/plasma-icons';
|
|
35
|
+
var onChangeAction = action('onChange');
|
|
36
|
+
var onClearAction = action('onClear');
|
|
37
|
+
export var createDefaultStory = function (Attach) {
|
|
38
|
+
return function (_a) {
|
|
39
|
+
var controlled = _a.controlled, buttonType = _a.buttonType, buttonText = _a.buttonText, buttonValue = _a.buttonValue, width = _a.width, size = _a.size, fileFormat = _a.fileFormat, multiple = _a.multiple, enableContentLeft = _a.enableContentLeft, enableContentRight = _a.enableContentRight, placement = _a.placement, trigger = _a.trigger, listWidth = _a.listWidth, closeOnOverlayClick = _a.closeOnOverlayClick, rest = __rest(_a, ["controlled", "buttonType", "buttonText", "buttonValue", "width", "size", "fileFormat", "multiple", "enableContentLeft", "enableContentRight", "placement", "trigger", "listWidth", "closeOnOverlayClick"]);
|
|
40
|
+
var _b = useState([]), files = _b[0], setFiles = _b[1];
|
|
41
|
+
var accepted = fileFormat && fileFormat !== 'all' ? [fileFormat] : undefined;
|
|
42
|
+
var iconSize = size === 'xs' ? 'xs' : 's';
|
|
43
|
+
var dropdownOptions = {
|
|
44
|
+
placement: placement,
|
|
45
|
+
trigger: trigger,
|
|
46
|
+
listWidth: listWidth,
|
|
47
|
+
closeOnOverlayClick: closeOnOverlayClick,
|
|
48
|
+
};
|
|
49
|
+
var handleChange = function (e) {
|
|
50
|
+
onChangeAction(e);
|
|
51
|
+
if (!controlled) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
var fileList = e.target.files;
|
|
55
|
+
if (!fileList) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
var incoming = Array.from(fileList);
|
|
59
|
+
setFiles(multiple ? function (prev) { return __spreadArray(__spreadArray([], prev, true), incoming, true); } : incoming);
|
|
60
|
+
};
|
|
61
|
+
var handleClear = function (fileInfo) {
|
|
62
|
+
onClearAction(fileInfo);
|
|
63
|
+
if (!controlled) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
setFiles(function (prev) { return prev.filter(function (f) { return f !== fileInfo.file; }); });
|
|
67
|
+
};
|
|
68
|
+
return (React.createElement(Attach, __assign({ style: { width: width }, size: size, multiple: multiple, buttonType: buttonType, contentLeft: enableContentLeft ? React.createElement(IconPlasma, { size: iconSize, color: "inherit" }) : undefined, contentRight: enableContentRight ? React.createElement(IconPlasma, { size: iconSize, color: "inherit" }) : undefined, acceptedFileFormats: accepted, text: buttonText, value: buttonValue, files: controlled ? files : undefined, onChange: handleChange, onClear: handleClear }, rest, { dropdownOptions: dropdownOptions })));
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stories.js","sourceR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,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EACrC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,WAAW,IAChB,IAAI,IACR,eAAe,EAAE,eAAe,IAClC,CACL,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
type CreateBadgeStoriesProps = {
|
|
2
|
+
component: any;
|
|
3
|
+
componentConfig: any;
|
|
4
|
+
title?: string;
|
|
5
|
+
disablePropsList?: string[];
|
|
6
|
+
defaultArgs?: {};
|
|
7
|
+
additionalArgTypes?: {};
|
|
8
|
+
};
|
|
9
|
+
export declare const getBadgeStories: (config: CreateBadgeStoriesProps) => {
|
|
10
|
+
meta: {
|
|
11
|
+
title: string;
|
|
12
|
+
decorators: import("@storybook/react").Decorator[];
|
|
13
|
+
component: any;
|
|
14
|
+
args: {
|
|
15
|
+
view: string;
|
|
16
|
+
size: string;
|
|
17
|
+
appearance: string;
|
|
18
|
+
enableText: boolean;
|
|
19
|
+
text: string;
|
|
20
|
+
enableContentLeft: boolean;
|
|
21
|
+
enableContentRight: boolean;
|
|
22
|
+
pilled: boolean;
|
|
23
|
+
maxWidth: string;
|
|
24
|
+
};
|
|
25
|
+
argTypes: {
|
|
26
|
+
view: {
|
|
27
|
+
options: any;
|
|
28
|
+
control: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
table: {
|
|
32
|
+
category: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
size: {
|
|
36
|
+
options: any;
|
|
37
|
+
control: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
table: {
|
|
41
|
+
category: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
appearance: {
|
|
45
|
+
options: string[];
|
|
46
|
+
control: {
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
49
|
+
table: {
|
|
50
|
+
category: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
pilled: {
|
|
54
|
+
control: {
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
table: {
|
|
58
|
+
category: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
text: {
|
|
62
|
+
control: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
if: {
|
|
66
|
+
arg: string;
|
|
67
|
+
truthy: boolean;
|
|
68
|
+
};
|
|
69
|
+
table: {
|
|
70
|
+
category: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
maxWidth: {
|
|
74
|
+
control: {
|
|
75
|
+
type: string;
|
|
76
|
+
};
|
|
77
|
+
table: {
|
|
78
|
+
category: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
enableText: {
|
|
82
|
+
control: {
|
|
83
|
+
type: string;
|
|
84
|
+
};
|
|
85
|
+
table: {
|
|
86
|
+
category: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
enableContentLeft: {
|
|
90
|
+
control: {
|
|
91
|
+
type: string;
|
|
92
|
+
};
|
|
93
|
+
if: {
|
|
94
|
+
arg: string;
|
|
95
|
+
truthy: boolean;
|
|
96
|
+
};
|
|
97
|
+
table: {
|
|
98
|
+
category: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
enableContentRight: {
|
|
102
|
+
control: {
|
|
103
|
+
type: string;
|
|
104
|
+
};
|
|
105
|
+
if: {
|
|
106
|
+
arg: string;
|
|
107
|
+
truthy: boolean;
|
|
108
|
+
};
|
|
109
|
+
table: {
|
|
110
|
+
category: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
Default: {
|
|
116
|
+
render: (args: any) => JSX.Element;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
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 getBadgeStories = function (config) {
|
|
28
|
+
var component = config.component, componentConfig = config.componentConfig, rest = __rest(config, ["component", "componentConfig"]);
|
|
29
|
+
var badgeConfig = getConfigVariations(componentConfig);
|
|
30
|
+
var meta = createMeta(__assign({ component: component, componentConfig: badgeConfig }, 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=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../src/components/Badge/Badge.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,eAAe,GAAG,UAAC,MAA+B;IACnD,IAAA,SAAS,GAA+B,MAAM,UAArC,EAAE,eAAe,GAAc,MAAM,gBAApB,EAAK,IAAI,UAAK,MAAM,EAAhD,gCAAuC,CAAF,CAAY;IAEvD,IAAM,WAAW,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAEzD,IAAM,IAAI,GAAG,UAAU,YACnB,SAAS,WAAA,EACT,eAAe,EAAE,WAAW,IACzB,IAAI,EACT,CAAC;IAEH,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,7 @@
|
|
|
1
|
+
export var appearances = ['default', 'clear', 'transparent'];
|
|
2
|
+
export var iconSizeMap = {
|
|
3
|
+
l: '1rem',
|
|
4
|
+
xs: '0.625rem',
|
|
5
|
+
};
|
|
6
|
+
export var getIconSize = function (size) { var _a; return (_a = iconSizeMap[size]) !== null && _a !== void 0 ? _a : '0.75rem'; };
|
|
7
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src/components/Badge/fixtures.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;AAC/D,MAAM,CAAC,IAAM,WAAW,GAA2B;IAC/C,CAAC,EAAE,MAAM;IACT,EAAE,EAAE,UAAU;CACjB,CAAC;AAEF,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,IAAY,YAAa,OAAA,MAAA,WAAW,CAAC,IAAI,CAAC,mCAAI,SAAS,CAAA,EAAA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Badge';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
appearance: string;
|
|
17
|
+
enableText: boolean;
|
|
18
|
+
text: string;
|
|
19
|
+
enableContentLeft: boolean;
|
|
20
|
+
enableContentRight: boolean;
|
|
21
|
+
pilled: boolean;
|
|
22
|
+
maxWidth: string;
|
|
23
|
+
};
|
|
24
|
+
argTypes: {
|
|
25
|
+
view: {
|
|
26
|
+
options: any;
|
|
27
|
+
control: {
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
table: {
|
|
31
|
+
category: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
size: {
|
|
35
|
+
options: any;
|
|
36
|
+
control: {
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
table: {
|
|
40
|
+
category: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
appearance: {
|
|
44
|
+
options: string[];
|
|
45
|
+
control: {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
48
|
+
table: {
|
|
49
|
+
category: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
pilled: {
|
|
53
|
+
control: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
table: {
|
|
57
|
+
category: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
text: {
|
|
61
|
+
control: {
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
if: {
|
|
65
|
+
arg: string;
|
|
66
|
+
truthy: boolean;
|
|
67
|
+
};
|
|
68
|
+
table: {
|
|
69
|
+
category: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
maxWidth: {
|
|
73
|
+
control: {
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
table: {
|
|
77
|
+
category: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
enableText: {
|
|
81
|
+
control: {
|
|
82
|
+
type: string;
|
|
83
|
+
};
|
|
84
|
+
table: {
|
|
85
|
+
category: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
enableContentLeft: {
|
|
89
|
+
control: {
|
|
90
|
+
type: string;
|
|
91
|
+
};
|
|
92
|
+
if: {
|
|
93
|
+
arg: string;
|
|
94
|
+
truthy: boolean;
|
|
95
|
+
};
|
|
96
|
+
table: {
|
|
97
|
+
category: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
enableContentRight: {
|
|
101
|
+
control: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
if: {
|
|
105
|
+
arg: string;
|
|
106
|
+
truthy: boolean;
|
|
107
|
+
};
|
|
108
|
+
table: {
|
|
109
|
+
category: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { appearances } from './fixtures';
|
|
23
|
+
var commonDisabledArgs = ['contentLeft', 'contentRight', 'textGradientOption'];
|
|
24
|
+
export var createMeta = function (_a) {
|
|
25
|
+
var component = _a.component, componentConfig = _a.componentConfig, _b = _a.title, title = _b === void 0 ? 'Data Display/Badge' : _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', appearance: 'default', enableText: true, text: 'Hello', enableContentLeft: false, enableContentRight: false, pilled: false, maxWidth: '' }, 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
|
+
}, appearance: {
|
|
40
|
+
options: appearances,
|
|
41
|
+
control: { type: 'select' },
|
|
42
|
+
table: { category: 'variation' },
|
|
43
|
+
}, pilled: {
|
|
44
|
+
control: { type: 'boolean' },
|
|
45
|
+
table: { category: 'variation' },
|
|
46
|
+
}, text: {
|
|
47
|
+
control: { type: 'text' },
|
|
48
|
+
if: { arg: 'enableText', truthy: true },
|
|
49
|
+
table: { category: 'layout' },
|
|
50
|
+
}, maxWidth: {
|
|
51
|
+
control: { type: 'text' },
|
|
52
|
+
table: { category: 'layout' },
|
|
53
|
+
}, enableText: {
|
|
54
|
+
control: { type: 'boolean' },
|
|
55
|
+
table: { category: 'layout' },
|
|
56
|
+
}, enableContentLeft: {
|
|
57
|
+
control: { type: 'boolean' },
|
|
58
|
+
if: { arg: 'enableContentRight', truthy: false },
|
|
59
|
+
table: { category: 'layout' },
|
|
60
|
+
}, enableContentRight: {
|
|
61
|
+
control: { type: 'boolean' },
|
|
62
|
+
if: { arg: 'enableText', truthy: true },
|
|
63
|
+
table: { category: 'layout' },
|
|
64
|
+
} }, additionalArgTypes), disableProps(__spreadArray(__spreadArray([], commonDisabledArgs, true), disablePropsList, true))),
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/Badge/meta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any) => ({ enableContentLeft, enableContentRight, enableText, size, appearance, ...rest }: any) => JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { getIconSize } from './fixtures';
|
|
25
|
+
var BellIcon = function (props) { return (React.createElement("svg", __assign({ width: "100%", viewBox: "0 0 24 24", fill: "none" }, props),
|
|
26
|
+
React.createElement("path", { d: "M11.501 21.28c1.088 0 1.978-.889 1.978-1.977H9.524c0 1.088.88 1.978 1.977 1.978zm5.933-5.932v-4.944c0-3.035-1.622-5.576-4.45-6.248v-.673c0-.82-.662-1.483-1.483-1.483-.82 0-1.483.662-1.483 1.483v.672c-2.838.673-4.45 3.204-4.45 6.25v4.943l-1.275 1.276c-.623.623-.188 1.69.692 1.69h13.022c.88 0 1.325-1.067.702-1.69l-1.275-1.276z", fill: "currentColor" }))); };
|
|
27
|
+
export var createDefaultStory = function (Badge) {
|
|
28
|
+
return function (_a) {
|
|
29
|
+
var enableContentLeft = _a.enableContentLeft, enableContentRight = _a.enableContentRight, enableText = _a.enableText, size = _a.size, appearance = _a.appearance, rest = __rest(_a, ["enableContentLeft", "enableContentRight", "enableText", "size", "appearance"]);
|
|
30
|
+
var iconSize = getIconSize(size);
|
|
31
|
+
return (React.createElement(Badge, __assign({ contentLeft: enableContentLeft || !enableText ? React.createElement(BellIcon, { width: iconSize, height: iconSize }) : undefined, contentRight: enableContentRight ? React.createElement(BellIcon, { width: iconSize, height: iconSize }) : undefined, size: size, appearance: appearance !== 'default' ? appearance : undefined }, rest)));
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=stories.js.map
|