@salutejs/plasma-sb-utils 0.246.0-next-sbcom.0 → 0.246.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/{Spinner/Spinner.d.ts → Breadcrumbs/Breadcrumbs.d.ts} +39 -10
- package/lib/components/{Spinner/Spinner.js → Breadcrumbs/Breadcrumbs.js} +10 -14
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/lib/components/Breadcrumbs/fixtures.d.ts +13 -0
- package/lib/components/Breadcrumbs/fixtures.js +7 -0
- package/lib/components/Breadcrumbs/fixtures.js.map +1 -0
- package/lib/components/Breadcrumbs/index.d.ts +1 -0
- package/lib/components/Breadcrumbs/index.js +2 -0
- package/lib/components/Breadcrumbs/index.js.map +1 -0
- package/lib/components/{Spinner → Breadcrumbs}/meta.d.ts +33 -3
- package/lib/components/{Spinner → Breadcrumbs}/meta.js +14 -7
- package/lib/components/Breadcrumbs/meta.js.map +1 -0
- package/lib/components/Breadcrumbs/stories.d.ts +3 -0
- package/lib/components/Breadcrumbs/stories.js +45 -0
- package/lib/components/Breadcrumbs/stories.js.map +1 -0
- package/lib/components/Note/meta.js +1 -1
- package/lib/components/Note/meta.js.map +1 -1
- package/lib/components/Note/stories.d.ts +1 -1
- package/lib/components/Note/stories.js +3 -3
- package/lib/components/Note/stories.js.map +1 -1
- package/lib/components/TokenUsage/TokenUsage.d.ts +27 -0
- package/lib/components/TokenUsage/TokenUsage.js +33 -0
- package/lib/components/TokenUsage/TokenUsage.js.map +1 -0
- package/lib/components/TokenUsage/index.d.ts +2 -0
- package/lib/components/TokenUsage/index.js +3 -0
- package/lib/components/TokenUsage/index.js.map +1 -0
- package/lib/components/TokenUsage/meta.d.ts +13 -0
- package/lib/components/TokenUsage/meta.js +12 -0
- package/lib/components/TokenUsage/meta.js.map +1 -0
- package/lib/components/TokenUsage/notify.d.ts +5 -0
- package/lib/components/TokenUsage/notify.js +27 -0
- package/lib/components/TokenUsage/notify.js.map +1 -0
- package/lib/components/TokenUsage/stories.d.ts +10 -0
- package/lib/components/TokenUsage/stories.js +181 -0
- package/lib/components/TokenUsage/stories.js.map +1 -0
- package/lib/components/TokenUsage/styles.d.ts +41 -0
- package/lib/components/TokenUsage/styles.js +71 -0
- package/lib/components/TokenUsage/styles.js.map +1 -0
- package/lib/components/TokenUsage/types.d.ts +6 -0
- package/lib/components/TokenUsage/types.js +2 -0
- package/lib/components/TokenUsage/types.js.map +1 -0
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +2 -1
- package/lib/components/index.js.map +1 -1
- package/lib/helpers/index.d.ts +3 -0
- package/lib/helpers/index.js +2 -0
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/tokenUsage.d.ts +56 -0
- package/lib/helpers/tokenUsage.js +340 -0
- package/lib/helpers/tokenUsage.js.map +1 -0
- package/package.json +5 -5
- package/lib/components/Spinner/Spinner.js.map +0 -1
- package/lib/components/Spinner/fixtures.d.ts +0 -1
- package/lib/components/Spinner/fixtures.js +0 -2
- package/lib/components/Spinner/fixtures.js.map +0 -1
- package/lib/components/Spinner/index.d.ts +0 -1
- package/lib/components/Spinner/index.js +0 -2
- package/lib/components/Spinner/index.js.map +0 -1
- package/lib/components/Spinner/meta.js.map +0 -1
- package/lib/components/Spinner/stories.d.ts +0 -7
- package/lib/components/Spinner/stories.js +0 -60
- package/lib/components/Spinner/stories.js.map +0 -1
|
@@ -1,26 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
type CreateSpinnerStoriesProps = {
|
|
1
|
+
type CreateBreadcrumbsStoriesProps = {
|
|
3
2
|
component: any;
|
|
4
3
|
componentConfig: any;
|
|
5
|
-
additionalComponents: {
|
|
6
|
-
Button: React.ComponentType<any>;
|
|
7
|
-
};
|
|
8
4
|
title?: string;
|
|
9
5
|
disablePropsList?: string[];
|
|
10
6
|
defaultArgs?: {};
|
|
11
7
|
additionalArgTypes?: {};
|
|
8
|
+
additionalComponents: {
|
|
9
|
+
Dropdown: any;
|
|
10
|
+
};
|
|
12
11
|
};
|
|
13
|
-
export declare const
|
|
12
|
+
export declare const getBreadcrumbsStories: (config: CreateBreadcrumbsStoriesProps) => {
|
|
14
13
|
meta: {
|
|
15
14
|
title: string;
|
|
16
15
|
decorators: import("@storybook/react").Decorator[];
|
|
17
16
|
component: any;
|
|
18
17
|
args: {
|
|
19
|
-
size: string;
|
|
20
18
|
view: string;
|
|
19
|
+
size: string;
|
|
20
|
+
showItems: number;
|
|
21
|
+
items: ({
|
|
22
|
+
title: string;
|
|
23
|
+
href: string;
|
|
24
|
+
renderItem?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
renderItem: () => string;
|
|
27
|
+
title?: undefined;
|
|
28
|
+
href?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
title: string;
|
|
31
|
+
href?: undefined;
|
|
32
|
+
renderItem?: undefined;
|
|
33
|
+
})[];
|
|
21
34
|
};
|
|
22
35
|
argTypes: {
|
|
23
|
-
|
|
36
|
+
view: {
|
|
24
37
|
options: any;
|
|
25
38
|
control: {
|
|
26
39
|
type: string;
|
|
@@ -29,7 +42,7 @@ export declare const getSpinnerStories: (config: CreateSpinnerStoriesProps) => {
|
|
|
29
42
|
category: string;
|
|
30
43
|
};
|
|
31
44
|
};
|
|
32
|
-
|
|
45
|
+
size: {
|
|
33
46
|
options: any;
|
|
34
47
|
control: {
|
|
35
48
|
type: string;
|
|
@@ -38,12 +51,28 @@ export declare const getSpinnerStories: (config: CreateSpinnerStoriesProps) => {
|
|
|
38
51
|
category: string;
|
|
39
52
|
};
|
|
40
53
|
};
|
|
54
|
+
showItems: {
|
|
55
|
+
control: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
table: {
|
|
59
|
+
category: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
items: {
|
|
63
|
+
control: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
table: {
|
|
67
|
+
category: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
41
70
|
};
|
|
42
71
|
};
|
|
43
72
|
Default: {
|
|
44
73
|
render: (args: any) => JSX.Element;
|
|
45
74
|
};
|
|
46
|
-
|
|
75
|
+
CustomShorter: {
|
|
47
76
|
render: (args: any) => JSX.Element;
|
|
48
77
|
};
|
|
49
78
|
};
|
|
@@ -23,20 +23,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import React from 'react';
|
|
24
24
|
import { getConfigVariations } from '../../helpers';
|
|
25
25
|
import { createMeta } from './meta';
|
|
26
|
-
import {
|
|
27
|
-
export var
|
|
26
|
+
import { createCustomShorterStory, createDefaultStory } from './stories';
|
|
27
|
+
export var getBreadcrumbsStories = function (config) {
|
|
28
28
|
var component = config.component, componentConfig = config.componentConfig, additionalComponents = config.additionalComponents, rest = __rest(config, ["component", "componentConfig", "additionalComponents"]);
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var meta = createMeta(__assign({ component: component, componentConfig:
|
|
29
|
+
var Dropdown = additionalComponents.Dropdown;
|
|
30
|
+
var breadcrumbsConfig = getConfigVariations(componentConfig);
|
|
31
|
+
var meta = createMeta(__assign({ component: component, componentConfig: breadcrumbsConfig }, rest));
|
|
32
32
|
var DefaultStoryComponent = createDefaultStory(component);
|
|
33
|
-
var
|
|
34
|
-
var Default = {
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
var Live = {
|
|
38
|
-
render: function (args) { return React.createElement(LiveStoryComponent, __assign({}, args)); },
|
|
39
|
-
};
|
|
40
|
-
return { meta: meta, Default: Default, Live: Live };
|
|
33
|
+
var CustomShorterStoryComponent = createCustomShorterStory(component, Dropdown);
|
|
34
|
+
var Default = { render: function (args) { return React.createElement(DefaultStoryComponent, __assign({}, args)); } };
|
|
35
|
+
var CustomShorter = { render: function (args) { return React.createElement(CustomShorterStoryComponent, __assign({}, args)); } };
|
|
36
|
+
return { meta: meta, Default: Default, CustomShorter: CustomShorter };
|
|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,CAAC;IAE3F,OAAO,EAAE,IAAI,MAAA,EAAE,OAAO,SAAA,EAAE,aAAa,eAAA,EAAE,CAAC;AAC5C,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const defaultItems: ({
|
|
2
|
+
title: string;
|
|
3
|
+
href: string;
|
|
4
|
+
renderItem?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
renderItem: () => string;
|
|
7
|
+
title?: undefined;
|
|
8
|
+
href?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
title: string;
|
|
11
|
+
href?: undefined;
|
|
12
|
+
renderItem?: undefined;
|
|
13
|
+
})[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/fixtures.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,YAAY,GAAG;IACxB,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE;IAC5B,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE;IAChC,EAAE,UAAU,EAAE,cAAM,OAAA,aAAa,EAAb,CAAa,EAAE;IACnC,EAAE,KAAK,EAAE,UAAU,EAAE;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Breadcrumbs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -11,11 +11,25 @@ export declare const createMeta: ({ component, componentConfig, title, defaultAr
|
|
|
11
11
|
decorators: import("@storybook/react").Decorator[];
|
|
12
12
|
component: any;
|
|
13
13
|
args: {
|
|
14
|
-
size: string;
|
|
15
14
|
view: string;
|
|
15
|
+
size: string;
|
|
16
|
+
showItems: number;
|
|
17
|
+
items: ({
|
|
18
|
+
title: string;
|
|
19
|
+
href: string;
|
|
20
|
+
renderItem?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
renderItem: () => string;
|
|
23
|
+
title?: undefined;
|
|
24
|
+
href?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
title: string;
|
|
27
|
+
href?: undefined;
|
|
28
|
+
renderItem?: undefined;
|
|
29
|
+
})[];
|
|
16
30
|
};
|
|
17
31
|
argTypes: {
|
|
18
|
-
|
|
32
|
+
view: {
|
|
19
33
|
options: any;
|
|
20
34
|
control: {
|
|
21
35
|
type: string;
|
|
@@ -24,7 +38,7 @@ export declare const createMeta: ({ component, componentConfig, title, defaultAr
|
|
|
24
38
|
category: string;
|
|
25
39
|
};
|
|
26
40
|
};
|
|
27
|
-
|
|
41
|
+
size: {
|
|
28
42
|
options: any;
|
|
29
43
|
control: {
|
|
30
44
|
type: string;
|
|
@@ -33,6 +47,22 @@ export declare const createMeta: ({ component, componentConfig, title, defaultAr
|
|
|
33
47
|
category: string;
|
|
34
48
|
};
|
|
35
49
|
};
|
|
50
|
+
showItems: {
|
|
51
|
+
control: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
54
|
+
table: {
|
|
55
|
+
category: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
items: {
|
|
59
|
+
control: {
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
table: {
|
|
63
|
+
category: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
36
66
|
};
|
|
37
67
|
};
|
|
38
68
|
export {};
|
|
@@ -19,22 +19,29 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
19
19
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
20
|
};
|
|
21
21
|
import { disableProps, InSpacingDecorator } from '../../index';
|
|
22
|
-
|
|
22
|
+
import { defaultItems } from './fixtures';
|
|
23
|
+
var commonDisabledArgs = ['separator'];
|
|
23
24
|
export var createMeta = function (_a) {
|
|
24
|
-
var component = _a.component, componentConfig = _a.componentConfig, _b = _a.title, title = _b === void 0 ? '
|
|
25
|
+
var component = _a.component, componentConfig = _a.componentConfig, _b = _a.title, title = _b === void 0 ? 'Navigation/Breadcrumbs' : _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;
|
|
25
26
|
return ({
|
|
26
27
|
title: title,
|
|
27
28
|
decorators: [InSpacingDecorator],
|
|
28
29
|
component: component,
|
|
29
|
-
args: __assign({
|
|
30
|
-
argTypes: __assign(__assign({
|
|
31
|
-
options: componentConfig.
|
|
30
|
+
args: __assign({ view: 'default', size: 'm', showItems: 2, items: defaultItems }, defaultArgs),
|
|
31
|
+
argTypes: __assign(__assign({ view: {
|
|
32
|
+
options: componentConfig.views,
|
|
32
33
|
control: { type: 'select' },
|
|
33
34
|
table: { category: 'variation' },
|
|
34
|
-
},
|
|
35
|
-
options: componentConfig.
|
|
35
|
+
}, size: {
|
|
36
|
+
options: componentConfig.sizes,
|
|
36
37
|
control: { type: 'select' },
|
|
37
38
|
table: { category: 'variation' },
|
|
39
|
+
}, showItems: {
|
|
40
|
+
control: { type: 'number' },
|
|
41
|
+
table: { category: 'content' },
|
|
42
|
+
}, items: {
|
|
43
|
+
control: { type: 'object' },
|
|
44
|
+
table: { category: 'content' },
|
|
38
45
|
} }, additionalArgTypes), disableProps(__spreadArray(__spreadArray([], commonDisabledArgs, true), disablePropsList, true))),
|
|
39
46
|
});
|
|
40
47
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW1C,IAAM,kBA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45 @@
|
|
|
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
|
+
export var createDefaultStory = function (Breadcrumbs) {
|
|
25
|
+
return function (args) { return React.createElement(Breadcrumbs, __assign({}, args)); };
|
|
26
|
+
};
|
|
27
|
+
export var createCustomShorterStory = function (Breadcrumbs, Dropdown) {
|
|
28
|
+
return function (_a) {
|
|
29
|
+
var size = _a.size, rest = __rest(_a, ["size"]);
|
|
30
|
+
var items = [
|
|
31
|
+
{ title: 'Home', href: '/' },
|
|
32
|
+
{ title: 'About as', href: '/' },
|
|
33
|
+
{
|
|
34
|
+
renderItem: function () { return (React.createElement(Dropdown, { variant: "tight", placement: "bottom", items: [
|
|
35
|
+
{ value: 'Custom Item 1', label: 'Custom Item 1' },
|
|
36
|
+
{ value: 'Custom Item 2', label: 'Custom Item 2' },
|
|
37
|
+
], trigger: "hover", size: size },
|
|
38
|
+
React.createElement("span", null, "..."))); },
|
|
39
|
+
},
|
|
40
|
+
{ title: 'Contacts' },
|
|
41
|
+
];
|
|
42
|
+
return React.createElement(Breadcrumbs, __assign({}, rest, { size: size, items: items }));
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,WAAgB;IAC/C,OAAO,UAAC,IAAS,IAAK,OAAA,oBAAC,WAAW,eAAK,IAAI,EAAI,EAAzB,CAAyB,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,wBAAwB,GAAG,UAAC,WAAgB,EAAE,QAAkC;IACzF,OAAO,UAAC,EAAsB;QAApB,IAAA,IAAI,UAAA,EAAK,IAAI,cAAf,QAAiB,CAAF;QACnB,IAAM,KAAK,GAAG;YACV,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE;YAC5B,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE;YAChC;gBACI,UAAU,EAAE,cAAM,OAAA,CACd,oBAAC,QAAQ,IACL,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,QAAQ,EAClB,KAAK,EAAE;wBACH,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;wBAClD,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;qBACrD,EACD,OAAO,EAAC,OAAO,EACf,IAAI,EAAE,IAAI;oBAEV,wCAAgB,CACT,CACd,EAbiB,CAajB;aACJ;YACD,EAAE,KAAK,EAAE,UAAU,EAAE;SACxB,CAAC;QAEF,OAAO,oBAAC,WAAW,eAAK,IAAI,IAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;IAC/D,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -20,7 +20,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
20
20
|
};
|
|
21
21
|
import { disableProps, InSpacingDecorator } from '../../index';
|
|
22
22
|
import { contentBeforeSizes, orientations } from './fixtures';
|
|
23
|
-
var commonDisabledArgs = ['contentBefore', 'onCloseButtonClick'];
|
|
23
|
+
var commonDisabledArgs = ['contentBefore', 'contentAfter', 'onCloseButtonClick'];
|
|
24
24
|
export var createMeta = function (_a) {
|
|
25
25
|
var component = _a.component, componentConfig = _a.componentConfig, _b = _a.title, title = _b === void 0 ? 'Data Display/Note' : _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
26
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/Note/meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW9D,IAAM,kBAAkB,GAAG,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/Note/meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW9D,IAAM,kBAAkB,GAAG,CAAC,eAAe,EA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KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;aAChC,EACD,WAAW,EAAE;gBACT,OAAO,EAAE,YAAY;gBACrB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC3B,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;aAChC,IACE,kBAAkB,GAClB,YAAY,iCAAK,kBAAkB,SAAK,gBAAgB,QAAE,CAChE;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -3,5 +3,5 @@ type CreateDefaultStoryOptions = {
|
|
|
3
3
|
getIconSize?: typeof defaultGetIconSize;
|
|
4
4
|
linkButtonSize?: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const createDefaultStory: (NoteComponent: any, Components: any, { getIconSize, linkButtonSize }?: CreateDefaultStoryOptions) => ({ enableContentBefore, enableHeightControl, hasActionContent, ...args }: any) => JSX.Element;
|
|
6
|
+
export declare const createDefaultStory: (NoteComponent: any, Components: any, { getIconSize, linkButtonSize }?: CreateDefaultStoryOptions) => ({ enableContentBefore, enableContentAfter, enableHeightControl, hasActionContent, ...args }: any) => JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -21,15 +21,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
|
-
import { IconPlasma } from '@salutejs/plasma-icons';
|
|
24
|
+
import { IconDisclosureRight, IconPlasma } from '@salutejs/plasma-icons';
|
|
25
25
|
import { getIconSize as defaultGetIconSize } from './fixtures';
|
|
26
26
|
export var createDefaultStory = function (NoteComponent, Components, _a) {
|
|
27
27
|
var _b = _a === void 0 ? {} : _a, _c = _b.getIconSize, getIconSize = _c === void 0 ? defaultGetIconSize : _c, linkButtonSize = _b.linkButtonSize;
|
|
28
28
|
var LinkButton = Components.LinkButton;
|
|
29
29
|
return function (_a) {
|
|
30
|
-
var enableContentBefore = _a.enableContentBefore, enableHeightControl = _a.enableHeightControl, hasActionContent = _a.hasActionContent, args = __rest(_a, ["enableContentBefore", "enableHeightControl", "hasActionContent"]);
|
|
30
|
+
var enableContentBefore = _a.enableContentBefore, enableContentAfter = _a.enableContentAfter, enableHeightControl = _a.enableHeightControl, hasActionContent = _a.hasActionContent, args = __rest(_a, ["enableContentBefore", "enableContentAfter", "enableHeightControl", "hasActionContent"]);
|
|
31
31
|
return (React.createElement("div", { style: { height: '100vh' } },
|
|
32
|
-
React.createElement(NoteComponent, __assign({ contentBefore: enableContentBefore ? (React.createElement(IconPlasma, { size: getIconSize(args.size, args.contentBeforeSizing === 'scalable'), color: "inherit" })) : undefined, height: enableHeightControl ? args.height : undefined, actionContent: hasActionContent ? (React.createElement(LinkButton, { text: "Label", size: linkButtonSize !== null && linkButtonSize !== void 0 ? linkButtonSize : args.size, view: args.view === 'default' ? 'positive' : args.view })) : undefined }, args))));
|
|
32
|
+
React.createElement(NoteComponent, __assign({ contentBefore: enableContentBefore ? (React.createElement(IconPlasma, { size: getIconSize(args.size, args.contentBeforeSizing === 'scalable'), color: "inherit" })) : undefined, contentAfter: enableContentAfter ? React.createElement(IconDisclosureRight, { size: "s", color: "inherit" }) : undefined, height: enableHeightControl ? args.height : undefined, actionContent: hasActionContent ? (React.createElement(LinkButton, { text: "Label", size: linkButtonSize !== null && linkButtonSize !== void 0 ? linkButtonSize : args.size, view: args.view === 'default' ? 'positive' : args.view })) : undefined }, args))));
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/Note/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/Note/stories.tsx"],"names":[],"mapp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IAAI,CAAC,IAAI,EACjC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GACxD,CACL,CAAC,CAAC,CAAC,SAAS,IAEb,IAAI,EACV,CACA,CACT,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { NotifyHook, TokenUsageComponents } from './types';
|
|
2
|
+
type GetTokenUsageStoriesProps = TokenUsageComponents & {
|
|
3
|
+
/** Результат `import.meta.glob('../../**\/*.config.{ts,tsx}', { eager: true })` пакета */
|
|
4
|
+
configModules: Record<string, unknown>;
|
|
5
|
+
/** Светлая тема пакета в виде css-строки */
|
|
6
|
+
theme: string;
|
|
7
|
+
/** Провайдер уведомлений пакета */
|
|
8
|
+
provider: any;
|
|
9
|
+
useNotify: NotifyHook;
|
|
10
|
+
providerProps?: Record<string, unknown>;
|
|
11
|
+
title?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const getTokenUsageStories: ({ configModules, theme, provider: Provider, providerProps, useNotify, accordion, accordionItem, textField, title, }: GetTokenUsageStoriesProps) => {
|
|
14
|
+
meta: {
|
|
15
|
+
title: string;
|
|
16
|
+
decorators: import("@storybook/react").Decorator[];
|
|
17
|
+
parameters: {
|
|
18
|
+
controls: {
|
|
19
|
+
hideNoControlsWarning: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
Default: {
|
|
24
|
+
render: () => JSX.Element;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
import React from 'react';
|
|
13
|
+
import { collectTokenUsage, convertTheme } from '../../helpers';
|
|
14
|
+
import { createMeta } from './meta';
|
|
15
|
+
import { createTokenUsageStory } from './stories';
|
|
16
|
+
export var getTokenUsageStories = function (_a) {
|
|
17
|
+
var configModules = _a.configModules, theme = _a.theme, Provider = _a.provider, providerProps = _a.providerProps, useNotify = _a.useNotify, accordion = _a.accordion, accordionItem = _a.accordionItem, textField = _a.textField, title = _a.title;
|
|
18
|
+
var themeTokens = convertTheme(theme);
|
|
19
|
+
var usageIndex = collectTokenUsage(configModules, themeTokens);
|
|
20
|
+
var meta = createMeta({ title: title });
|
|
21
|
+
var StoryTokenUsage = createTokenUsageStory({
|
|
22
|
+
themeTokens: themeTokens,
|
|
23
|
+
usageIndex: usageIndex,
|
|
24
|
+
components: { accordion: accordion, accordionItem: accordionItem, textField: textField },
|
|
25
|
+
useNotify: useNotify,
|
|
26
|
+
});
|
|
27
|
+
var Default = {
|
|
28
|
+
render: function () { return (React.createElement(Provider, __assign({}, providerProps),
|
|
29
|
+
React.createElement(StoryTokenUsage, null))); },
|
|
30
|
+
};
|
|
31
|
+
return { meta: meta, Default: Default };
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=TokenUsage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenUsage.js","sourceRoot":"","sources":["../../../src/components/TokenUsage/TokenUsage.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAelD,MAAM,CAAC,IAAM,oBAAoB,GAAG,UAAC,EAUT;QATxB,aAAa,mBAAA,EACb,KAAK,WAAA,EACK,QAAQ,cAAA,EAClB,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,SAAS,eAAA,EACT,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,KAAK,WAAA;IAEL,IAAM,WAAW,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACxC,IAAM,UAAU,GAAG,iBAAiB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAEjE,IAAM,IAAI,GAAG,UAAU,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC;IAEnC,IAAM,eAAe,GAAG,qBAAqB,CAAC;QAC1C,WAAW,aAAA;QACX,UAAU,YAAA;QACV,UAAU,EAAE,EAAE,SAAS,WAAA,EAAE,aAAa,eAAA,EAAE,SAAS,WAAA,EAAE;QACnD,SAAS,WAAA;KACZ,CAAC,CAAC;IAEH,IAAM,OAAO,GAAG;QACZ,MAAM,EAAE,cAAM,OAAA,CACV,oBAAC,QAAQ,eAAK,aAAa;YACvB,oBAAC,eAAe,OAAG,CACZ,CACd,EAJa,CAIb;KACJ,CAAC;IAEF,OAAO,EAAE,IAAI,MAAA,EAAE,OAAO,SAAA,EAAE,CAAC;AAC7B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TokenUsage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type CreateMetaProps = {
|
|
2
|
+
title?: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const createMeta: ({ title }: CreateMetaProps) => {
|
|
5
|
+
title: string;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
parameters: {
|
|
8
|
+
controls: {
|
|
9
|
+
hideNoControlsWarning: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InSpacing as InSpacingDecorator } from '../StoryDecorators';
|
|
2
|
+
export var createMeta = function (_a) {
|
|
3
|
+
var _b = _a.title, title = _b === void 0 ? 'Tokens/Usage' : _b;
|
|
4
|
+
return ({
|
|
5
|
+
title: title,
|
|
6
|
+
decorators: [InSpacingDecorator],
|
|
7
|
+
parameters: {
|
|
8
|
+
controls: { hideNoControlsWarning: true },
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/TokenUsage/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAMrE,MAAM,CAAC,IAAM,UAAU,GAAG,UAAC,EAA2C;QAAzC,aAAsB,EAAtB,KAAK,mBAAG,cAAc,KAAA;IAAwB,OAAA,CAAC;QACxE,KAAK,OAAA;QACL,UAAU,EAAE,CAAC,kBAAkB,CAAC;QAChC,UAAU,EAAE;YACR,QAAQ,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE;SAC5C;KACJ,CAAC;AANyE,CAMzE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NotifyHook } from './types';
|
|
2
|
+
export declare const createToastNotify: (useToast: () => {
|
|
3
|
+
showToast: (args: any) => void;
|
|
4
|
+
}) => NotifyHook;
|
|
5
|
+
export declare const createNotificationNotify: (addNotification: (args: any, timeout?: number) => void) => NotifyHook;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 toastData = {
|
|
13
|
+
view: 'default',
|
|
14
|
+
size: 'm',
|
|
15
|
+
hasClose: true,
|
|
16
|
+
fade: false,
|
|
17
|
+
position: 'bottom',
|
|
18
|
+
offset: 0,
|
|
19
|
+
timeout: 3000,
|
|
20
|
+
role: 'alert',
|
|
21
|
+
};
|
|
22
|
+
export var createToastNotify = function (useToast) { return function () {
|
|
23
|
+
var showToast = useToast().showToast;
|
|
24
|
+
return function (text) { return showToast(__assign(__assign({}, toastData), { text: text })); };
|
|
25
|
+
}; };
|
|
26
|
+
export var createNotificationNotify = function (addNotification) { return function () { return function (text, isError) { return addNotification({ title: text, view: isError ? 'negative' : 'positive', size: 'xxs', role: 'alert' }, 3000); }; }; };
|
|
27
|
+
//# sourceMappingURL=notify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.js","sourceRoot":"","sources":["../../../src/components/TokenUsage/notify.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,IAAM,SAAS,GAAG;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,GAAG;IACT,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,OAAO;CAChB,CAAC;AAEF,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,QAAkD,IAAiB,OAAA;IACzF,IAAA,SAAS,GAAK,QAAQ,EAAE,UAAf,CAAgB;IAEjC,OAAO,UAAC,IAAY,IAAK,OAAA,SAAS,uBAAM,SAAS,KAAE,IAAI,MAAA,IAAG,EAAjC,CAAiC,CAAC;AAC/D,CAAC,EAJoG,CAIpG,CAAC;AAEF,MAAM,CAAC,IAAM,wBAAwB,GAAG,UAAC,eAAsD,IAAiB,OAAA,cAAM,OAAA,UAClH,IAAY,EACZ,OAAiB,IAChB,OAAA,eAAe,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,EAA3G,CAA2G,EAHM,CAGN,EAHA,CAGA,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TokenUsageIndex } from '../../helpers';
|
|
2
|
+
import type { NotifyHook, TokenUsageComponents } from './types';
|
|
3
|
+
type ThemeTokens = Record<string, string>;
|
|
4
|
+
export declare const createTokenUsageStory: ({ themeTokens, usageIndex, components, useNotify, }: {
|
|
5
|
+
themeTokens: ThemeTokens;
|
|
6
|
+
usageIndex: TokenUsageIndex;
|
|
7
|
+
components: TokenUsageComponents;
|
|
8
|
+
useNotify: NotifyHook;
|
|
9
|
+
}) => () => JSX.Element;
|
|
10
|
+
export {};
|