@salutejs/plasma-new-hope 0.142.0-canary.1421.10790809666.0 → 0.142.0-canary.1424.10789422667.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Badge/Badge.css +2 -0
- package/cjs/components/Badge/Badge.js +12 -3
- package/cjs/components/Badge/Badge.js.map +1 -1
- package/cjs/components/Badge/Badge.tokens.js +3 -1
- package/cjs/components/Badge/Badge.tokens.js.map +1 -1
- package/cjs/components/Badge/variations/_clear/base.js +9 -0
- package/cjs/components/Badge/variations/_clear/base.js.map +1 -0
- package/cjs/components/Badge/variations/_clear/base_oopyb7.css +1 -0
- package/cjs/components/TextArea/TextArea.js +2 -4
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/index.css +2 -0
- package/cjs/index.js +0 -3
- package/cjs/index.js.map +1 -1
- package/cjs/utils/index.js.map +1 -1
- package/emotion/cjs/components/Badge/Badge.js +12 -3
- package/emotion/cjs/components/Badge/Badge.template-doc.mdx +19 -28
- package/emotion/cjs/components/Badge/Badge.tokens.js +3 -1
- package/emotion/cjs/components/Badge/variations/_clear/base.js +9 -0
- package/emotion/cjs/components/Badge/variations/_clear/tokens.json +1 -0
- package/emotion/cjs/components/TextArea/TextArea.js +3 -4
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +15 -12
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +38 -6
- package/emotion/cjs/examples/plasma_web/components/Badge/Badge.config.js +15 -12
- package/emotion/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +39 -6
- package/emotion/cjs/utils/index.js +0 -15
- package/emotion/es/components/Badge/Badge.js +12 -3
- package/emotion/es/components/Badge/Badge.template-doc.mdx +19 -28
- package/emotion/es/components/Badge/Badge.tokens.js +3 -1
- package/emotion/es/components/Badge/variations/_clear/base.js +3 -0
- package/emotion/es/components/Badge/variations/_clear/tokens.json +1 -0
- package/emotion/es/components/TextArea/TextArea.js +4 -5
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +15 -12
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +38 -6
- package/emotion/es/examples/plasma_web/components/Badge/Badge.config.js +15 -12
- package/emotion/es/examples/plasma_web/components/Badge/Badge.stories.tsx +39 -6
- package/emotion/es/utils/index.js +0 -1
- package/es/components/Badge/Badge.css +2 -0
- package/es/components/Badge/Badge.js +12 -3
- package/es/components/Badge/Badge.js.map +1 -1
- package/es/components/Badge/Badge.tokens.js +3 -1
- package/es/components/Badge/Badge.tokens.js.map +1 -1
- package/es/components/Badge/variations/_clear/base.js +5 -0
- package/es/components/Badge/variations/_clear/base.js.map +1 -0
- package/es/components/Badge/variations/_clear/base_oopyb7.css +1 -0
- package/es/components/TextArea/TextArea.js +2 -4
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/index.css +2 -0
- package/es/index.js +0 -1
- package/es/index.js.map +1 -1
- package/es/utils/index.js.map +1 -1
- package/package.json +2 -3
- package/styled-components/cjs/components/Badge/Badge.js +12 -3
- package/styled-components/cjs/components/Badge/Badge.template-doc.mdx +19 -28
- package/styled-components/cjs/components/Badge/Badge.tokens.js +3 -1
- package/styled-components/cjs/components/Badge/variations/_clear/base.js +9 -0
- package/styled-components/cjs/components/Badge/variations/_clear/tokens.json +1 -0
- package/styled-components/cjs/components/TextArea/TextArea.js +2 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +10 -7
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +38 -6
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +10 -7
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +39 -6
- package/styled-components/cjs/utils/index.js +0 -15
- package/styled-components/es/components/Badge/Badge.js +12 -3
- package/styled-components/es/components/Badge/Badge.template-doc.mdx +19 -28
- package/styled-components/es/components/Badge/Badge.tokens.js +3 -1
- package/styled-components/es/components/Badge/variations/_clear/base.js +3 -0
- package/styled-components/es/components/Badge/variations/_clear/tokens.json +1 -0
- package/styled-components/es/components/TextArea/TextArea.js +3 -4
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +10 -7
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +38 -6
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +10 -7
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +39 -6
- package/styled-components/es/utils/index.js +0 -1
- package/types/components/Badge/Badge.d.ts +7 -23
- package/types/components/Badge/Badge.d.ts.map +1 -1
- package/types/components/Badge/Badge.tokens.d.ts +2 -0
- package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
- package/types/components/Badge/Badge.types.d.ts +60 -9
- package/types/components/Badge/Badge.types.d.ts.map +1 -1
- package/types/components/Badge/variations/_clear/base.d.ts +2 -0
- package/types/components/Badge/variations/_clear/base.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +32 -3
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.config.d.ts +3 -0
- package/types/examples/plasma_web/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.d.ts +32 -3
- package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
- package/types/utils/index.d.ts +0 -1
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/utils/setRefList.js +0 -28
- package/cjs/utils/setRefList.js.map +0 -1
- package/emotion/cjs/examples/plasma_b2c/components/Form/Form.stories.tsx +0 -68
- package/emotion/cjs/utils/setRefList.js +0 -27
- package/emotion/es/examples/plasma_b2c/components/Form/Form.stories.tsx +0 -68
- package/emotion/es/utils/setRefList.js +0 -20
- package/es/utils/setRefList.js +0 -23
- package/es/utils/setRefList.js.map +0 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Form/Form.stories.tsx +0 -68
- package/styled-components/cjs/utils/setRefList.js +0 -27
- package/styled-components/es/examples/plasma_b2c/components/Form/Form.stories.tsx +0 -68
- package/styled-components/es/utils/setRefList.js +0 -20
- package/types/utils/setRefList.d.ts +0 -6
- package/types/utils/setRefList.d.ts.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { ComponentProps } from 'react';
|
2
2
|
import { disableProps } from '@salutejs/plasma-sb-utils';
|
3
3
|
import type { StoryObj, Meta } from '@storybook/react';
|
4
4
|
|
@@ -8,6 +8,7 @@ import { Badge } from './Badge';
|
|
8
8
|
|
9
9
|
const meta: Meta<typeof Badge> = {
|
10
10
|
title: 'plasma_web/Badge',
|
11
|
+
component: Badge,
|
11
12
|
decorators: [WithTheme],
|
12
13
|
argTypes: {
|
13
14
|
size: {
|
@@ -22,13 +23,25 @@ const meta: Meta<typeof Badge> = {
|
|
22
23
|
type: 'select',
|
23
24
|
},
|
24
25
|
},
|
26
|
+
pilled: {
|
27
|
+
control: { type: 'boolean' },
|
28
|
+
if: { arg: 'clear', truthy: false },
|
29
|
+
},
|
30
|
+
transparent: {
|
31
|
+
control: { type: 'boolean' },
|
32
|
+
if: { arg: 'clear', truthy: false },
|
33
|
+
},
|
25
34
|
...disableProps(['contentLeft', 'contentRight']),
|
26
35
|
},
|
27
36
|
};
|
28
37
|
|
29
38
|
export default meta;
|
30
39
|
|
31
|
-
type
|
40
|
+
type StoryProps = ComponentProps<typeof Badge> & {
|
41
|
+
enableContentLeft: boolean;
|
42
|
+
enableContentRight: boolean;
|
43
|
+
};
|
44
|
+
type Story = StoryObj<StoryProps>;
|
32
45
|
|
33
46
|
const BellIcon = (props) => (
|
34
47
|
<svg width="100%" viewBox="0 0 24 24" fill="none" {...props}>
|
@@ -40,16 +53,36 @@ const BellIcon = (props) => (
|
|
40
53
|
);
|
41
54
|
|
42
55
|
export const Default: Story = {
|
56
|
+
argTypes: {
|
57
|
+
enableContentLeft: {
|
58
|
+
control: { type: 'boolean' },
|
59
|
+
if: { arg: 'enableContentRight', truthy: false },
|
60
|
+
},
|
61
|
+
enableContentRight: {
|
62
|
+
control: { type: 'boolean' },
|
63
|
+
if: { arg: 'enableContentLeft', truthy: false },
|
64
|
+
},
|
65
|
+
},
|
43
66
|
args: {
|
44
67
|
text: 'Hello',
|
45
68
|
view: 'default',
|
46
69
|
size: 'm',
|
70
|
+
enableContentLeft: false,
|
71
|
+
enableContentRight: false,
|
47
72
|
pilled: false,
|
48
73
|
transparent: false,
|
74
|
+
clear: false,
|
49
75
|
},
|
50
|
-
}
|
76
|
+
render: ({ enableContentLeft, enableContentRight, size, ...rest }: StoryProps) => {
|
77
|
+
const iconSize = size === 'l' ? '1rem' : '0.75rem';
|
51
78
|
|
52
|
-
|
53
|
-
|
54
|
-
|
79
|
+
return (
|
80
|
+
<Badge
|
81
|
+
contentLeft={enableContentLeft ? <BellIcon width={iconSize} height={iconSize} /> : undefined}
|
82
|
+
contentRight={enableContentRight ? <BellIcon width={iconSize} height={iconSize} /> : undefined}
|
83
|
+
size={size}
|
84
|
+
{...rest}
|
85
|
+
/>
|
86
|
+
);
|
87
|
+
},
|
55
88
|
};
|
@@ -3,7 +3,6 @@ export { extractTextFrom } from './extractTextFrom';
|
|
3
3
|
export { getSizeValueFromProp } from './getSizeValueFromProp';
|
4
4
|
export { IS_REACT_18, safeUseId } from './react';
|
5
5
|
export { isNumber } from './isNumber';
|
6
|
-
export { mergeRefs, setRefList } from './setRefList';
|
7
6
|
export { isEmpty } from './isEmpty';
|
8
7
|
export * from './getPopoverPlacement';
|
9
8
|
export var cx = function cx() {
|
@@ -1,31 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import type { RootProps } from '../../engines';
|
3
|
-
import type { BadgeProps } from './Badge.types';
|
4
|
-
export declare const badgeRoot: (Root: RootProps<HTMLDivElement,
|
5
|
-
text?: string | undefined;
|
6
|
-
contentLeft?: React.ReactNode;
|
7
|
-
contentRight?: React.ReactNode;
|
8
|
-
pilled?: boolean | undefined;
|
9
|
-
transparent?: boolean | undefined;
|
10
|
-
size?: string | undefined;
|
11
|
-
view?: string | undefined;
|
12
|
-
} & {
|
13
|
-
children?: React.ReactNode;
|
14
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
3
|
+
import type { BadgeProps, BadgeRootProps } from './Badge.types';
|
4
|
+
export declare const badgeRoot: (Root: RootProps<HTMLDivElement, BadgeRootProps>) => React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLDivElement>>;
|
15
5
|
export declare const badgeConfig: {
|
16
6
|
name: string;
|
17
7
|
tag: string;
|
18
|
-
layout: (Root: RootProps<HTMLDivElement,
|
19
|
-
text?: string | undefined;
|
20
|
-
contentLeft?: React.ReactNode;
|
21
|
-
contentRight?: React.ReactNode;
|
22
|
-
pilled?: boolean | undefined;
|
23
|
-
transparent?: boolean | undefined;
|
24
|
-
size?: string | undefined;
|
25
|
-
view?: string | undefined;
|
26
|
-
} & {
|
27
|
-
children?: React.ReactNode;
|
28
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
8
|
+
layout: (Root: RootProps<HTMLDivElement, BadgeRootProps>) => React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLDivElement>>;
|
29
9
|
base: import("@linaria/core").LinariaClassName;
|
30
10
|
variations: {
|
31
11
|
view: {
|
@@ -42,6 +22,10 @@ export declare const badgeConfig: {
|
|
42
22
|
css: import("@linaria/core").LinariaClassName;
|
43
23
|
attrs: boolean;
|
44
24
|
};
|
25
|
+
clear: {
|
26
|
+
css: import("@linaria/core").LinariaClassName;
|
27
|
+
attrs: boolean;
|
28
|
+
};
|
45
29
|
};
|
46
30
|
defaults: {
|
47
31
|
view: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIhE,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,cAAc,CAAC,sFAqCnE,CAAC;AAEP,eAAO,MAAM,WAAW;;;mBAvCQ,UAAU,cAAc,EAAE,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CAoExE,CAAC"}
|
@@ -1,12 +1,14 @@
|
|
1
1
|
export declare const classes: {
|
2
2
|
badgePilled: string;
|
3
3
|
badgeTransparent: string;
|
4
|
+
badgeClear: string;
|
4
5
|
};
|
5
6
|
export declare const tokens: {
|
6
7
|
background: string;
|
7
8
|
color: string;
|
8
9
|
backgroundTransparent: string;
|
9
10
|
colorTransparent: string;
|
11
|
+
colorClear: string;
|
10
12
|
borderRadius: string;
|
11
13
|
pilledBorderRadius: string;
|
12
14
|
height: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO
|
1
|
+
{"version":3,"file":"Badge.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;CA0BlB,CAAC"}
|
@@ -1,29 +1,75 @@
|
|
1
1
|
import type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
2
|
-
declare type
|
2
|
+
declare type ClearViewProps = {
|
3
3
|
/**
|
4
|
-
*
|
4
|
+
* view применяется с clear-токенами
|
5
|
+
* @default
|
6
|
+
* false
|
5
7
|
*/
|
6
|
-
|
8
|
+
clear?: true;
|
7
9
|
/**
|
8
|
-
*
|
10
|
+
* Компонент c округлым border-radius
|
11
|
+
* @default
|
12
|
+
* false
|
9
13
|
*/
|
10
|
-
|
14
|
+
pilled?: false;
|
11
15
|
/**
|
12
|
-
*
|
16
|
+
* view применяется с учетом прозрачности
|
17
|
+
* @default
|
18
|
+
* false
|
13
19
|
*/
|
14
|
-
|
20
|
+
transparent?: false;
|
21
|
+
} | {
|
15
22
|
/**
|
16
23
|
* Компонент c округлым border-radius
|
17
24
|
* @default
|
18
25
|
* false
|
19
26
|
*/
|
20
|
-
pilled?:
|
27
|
+
pilled?: true;
|
21
28
|
/**
|
22
29
|
* view применяется с учетом прозрачности
|
23
30
|
* @default
|
24
31
|
* false
|
25
32
|
*/
|
26
33
|
transparent?: boolean;
|
34
|
+
/**
|
35
|
+
* view применяется с clear-токенами
|
36
|
+
* @default
|
37
|
+
* false
|
38
|
+
*/
|
39
|
+
clear?: false;
|
40
|
+
} | {
|
41
|
+
/**
|
42
|
+
* Компонент c округлым border-radius
|
43
|
+
* @default
|
44
|
+
* false
|
45
|
+
*/
|
46
|
+
pilled?: boolean;
|
47
|
+
/**
|
48
|
+
* view применяется с учетом прозрачности
|
49
|
+
* @default
|
50
|
+
* false
|
51
|
+
*/
|
52
|
+
transparent?: true;
|
53
|
+
/**
|
54
|
+
* view применяется с clear-токенами
|
55
|
+
* @default
|
56
|
+
* false
|
57
|
+
*/
|
58
|
+
clear?: false;
|
59
|
+
};
|
60
|
+
declare type CustomBadgeProps = {
|
61
|
+
/**
|
62
|
+
* Текстовая надпись
|
63
|
+
*/
|
64
|
+
text?: string;
|
65
|
+
/**
|
66
|
+
* Слот для контента слева, например `Icon`
|
67
|
+
*/
|
68
|
+
contentLeft?: ReactNode;
|
69
|
+
/**
|
70
|
+
* Слот для контента справа, например `Icon`
|
71
|
+
*/
|
72
|
+
contentRight?: ReactNode;
|
27
73
|
/**
|
28
74
|
* Размер Badge
|
29
75
|
* @default
|
@@ -37,6 +83,11 @@ declare type CustomBadgeProps = {
|
|
37
83
|
*/
|
38
84
|
view?: string;
|
39
85
|
} & PropsWithChildren;
|
40
|
-
export declare type BadgeProps = HTMLAttributes<HTMLDivElement> & CustomBadgeProps;
|
86
|
+
export declare type BadgeProps = HTMLAttributes<HTMLDivElement> & CustomBadgeProps & ClearViewProps;
|
87
|
+
export declare type BadgeRootProps = HTMLAttributes<HTMLDivElement> & CustomBadgeProps & {
|
88
|
+
pilled?: boolean;
|
89
|
+
transparent?: boolean;
|
90
|
+
clear?: boolean;
|
91
|
+
};
|
41
92
|
export {};
|
42
93
|
//# sourceMappingURL=Badge.types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1E,aAAK,
|
1
|
+
{"version":3,"file":"Badge.types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1E,aAAK,cAAc,GACb;IACI;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,CAAC;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACvB,GACD;IACI;;;;OAIG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB,GACD;IACI;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAER,aAAK,gBAAgB,GAAG;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,iBAAiB,CAAC;AAEtB,oBAAY,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAC5F,oBAAY,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC,GACvD,gBAAgB,GAAG;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/components/Badge/variations/_clear/base.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,0CAMhB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.config.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_b2c/components/Badge/Badge.config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM
|
1
|
+
{"version":3,"file":"Badge.config.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_b2c/components/Badge/Badge.config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8IlB,CAAC"}
|
@@ -20,15 +20,44 @@ export declare const Badge: import("react").FunctionComponent<import("../../../.
|
|
20
20
|
transparent: {
|
21
21
|
true: import("@linaria/core").LinariaClassName;
|
22
22
|
};
|
23
|
-
|
23
|
+
clear: {
|
24
|
+
true: import("@linaria/core").LinariaClassName;
|
25
|
+
};
|
26
|
+
}> & ((import("react").HTMLAttributes<HTMLDivElement> & {
|
24
27
|
text?: string | undefined;
|
25
28
|
contentLeft?: import("react").ReactNode;
|
26
29
|
contentRight?: import("react").ReactNode;
|
27
|
-
|
30
|
+
size?: string | undefined;
|
31
|
+
view?: string | undefined;
|
32
|
+
} & {
|
33
|
+
children?: import("react").ReactNode;
|
34
|
+
} & {
|
35
|
+
clear?: true | undefined;
|
36
|
+
pilled?: false | undefined;
|
37
|
+
transparent?: false | undefined;
|
38
|
+
} & import("react").RefAttributes<HTMLDivElement>) | (import("react").HTMLAttributes<HTMLDivElement> & {
|
39
|
+
text?: string | undefined;
|
40
|
+
contentLeft?: import("react").ReactNode;
|
41
|
+
contentRight?: import("react").ReactNode;
|
42
|
+
size?: string | undefined;
|
43
|
+
view?: string | undefined;
|
44
|
+
} & {
|
45
|
+
children?: import("react").ReactNode;
|
46
|
+
} & {
|
47
|
+
pilled?: true | undefined;
|
28
48
|
transparent?: boolean | undefined;
|
49
|
+
clear?: false | undefined;
|
50
|
+
} & import("react").RefAttributes<HTMLDivElement>) | (import("react").HTMLAttributes<HTMLDivElement> & {
|
51
|
+
text?: string | undefined;
|
52
|
+
contentLeft?: import("react").ReactNode;
|
53
|
+
contentRight?: import("react").ReactNode;
|
29
54
|
size?: string | undefined;
|
30
55
|
view?: string | undefined;
|
31
56
|
} & {
|
32
57
|
children?: import("react").ReactNode;
|
33
|
-
} &
|
58
|
+
} & {
|
59
|
+
pilled?: boolean | undefined;
|
60
|
+
transparent?: true | undefined;
|
61
|
+
clear?: false | undefined;
|
62
|
+
} & import("react").RefAttributes<HTMLDivElement>))>;
|
34
63
|
//# sourceMappingURL=Badge.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_b2c/components/Badge/Badge.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,KAAK
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_b2c/components/Badge/Badge.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAA0B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.config.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/Badge/Badge.config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM
|
1
|
+
{"version":3,"file":"Badge.config.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/Badge/Badge.config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8IlB,CAAC"}
|
@@ -20,15 +20,44 @@ export declare const Badge: import("react").FunctionComponent<import("../../../.
|
|
20
20
|
transparent: {
|
21
21
|
true: import("@linaria/core").LinariaClassName;
|
22
22
|
};
|
23
|
-
|
23
|
+
clear: {
|
24
|
+
true: import("@linaria/core").LinariaClassName;
|
25
|
+
};
|
26
|
+
}> & ((import("react").HTMLAttributes<HTMLDivElement> & {
|
24
27
|
text?: string | undefined;
|
25
28
|
contentLeft?: import("react").ReactNode;
|
26
29
|
contentRight?: import("react").ReactNode;
|
27
|
-
|
30
|
+
size?: string | undefined;
|
31
|
+
view?: string | undefined;
|
32
|
+
} & {
|
33
|
+
children?: import("react").ReactNode;
|
34
|
+
} & {
|
35
|
+
clear?: true | undefined;
|
36
|
+
pilled?: false | undefined;
|
37
|
+
transparent?: false | undefined;
|
38
|
+
} & import("react").RefAttributes<HTMLDivElement>) | (import("react").HTMLAttributes<HTMLDivElement> & {
|
39
|
+
text?: string | undefined;
|
40
|
+
contentLeft?: import("react").ReactNode;
|
41
|
+
contentRight?: import("react").ReactNode;
|
42
|
+
size?: string | undefined;
|
43
|
+
view?: string | undefined;
|
44
|
+
} & {
|
45
|
+
children?: import("react").ReactNode;
|
46
|
+
} & {
|
47
|
+
pilled?: true | undefined;
|
28
48
|
transparent?: boolean | undefined;
|
49
|
+
clear?: false | undefined;
|
50
|
+
} & import("react").RefAttributes<HTMLDivElement>) | (import("react").HTMLAttributes<HTMLDivElement> & {
|
51
|
+
text?: string | undefined;
|
52
|
+
contentLeft?: import("react").ReactNode;
|
53
|
+
contentRight?: import("react").ReactNode;
|
29
54
|
size?: string | undefined;
|
30
55
|
view?: string | undefined;
|
31
56
|
} & {
|
32
57
|
children?: import("react").ReactNode;
|
33
|
-
} &
|
58
|
+
} & {
|
59
|
+
pilled?: boolean | undefined;
|
60
|
+
transparent?: true | undefined;
|
61
|
+
clear?: false | undefined;
|
62
|
+
} & import("react").RefAttributes<HTMLDivElement>))>;
|
34
63
|
//# sourceMappingURL=Badge.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/Badge/Badge.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,KAAK
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/Badge/Badge.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAA0B,CAAC"}
|
package/types/utils/index.d.ts
CHANGED
@@ -4,7 +4,6 @@ export { extractTextFrom } from './extractTextFrom';
|
|
4
4
|
export { getSizeValueFromProp } from './getSizeValueFromProp';
|
5
5
|
export { IS_REACT_18, safeUseId } from './react';
|
6
6
|
export { isNumber } from './isNumber';
|
7
|
-
export { mergeRefs, setRefList } from './setRefList';
|
8
7
|
export { isEmpty } from './isEmpty';
|
9
8
|
export * from './getPopoverPlacement';
|
10
9
|
export declare const cx: (...classes: (string | undefined)[]) => string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,uBAAuB,CAAC;AAEtC,eAAO,MAAM,EAAE,eAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,WAAuD,CAAC;AAE7G,eAAO,MAAM,eAAe,MAAO,oBAAoB,WAAW,MAAM,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,KAAG,MAQ1G,CAAC"}
|
package/cjs/utils/setRefList.js
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
function mergeRefs() {
|
6
|
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
7
|
-
refs[_key] = arguments[_key];
|
8
|
-
}
|
9
|
-
return function (val) {
|
10
|
-
setRefList.apply(void 0, [val].concat(refs));
|
11
|
-
};
|
12
|
-
}
|
13
|
-
function setRefList(val) {
|
14
|
-
for (var _len2 = arguments.length, refs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
15
|
-
refs[_key2 - 1] = arguments[_key2];
|
16
|
-
}
|
17
|
-
refs.forEach(function (ref) {
|
18
|
-
if (typeof ref === 'function') {
|
19
|
-
ref(val);
|
20
|
-
} else if (ref != null) {
|
21
|
-
ref.current = val;
|
22
|
-
}
|
23
|
-
});
|
24
|
-
}
|
25
|
-
|
26
|
-
exports.mergeRefs = mergeRefs;
|
27
|
-
exports.setRefList = setRefList;
|
28
|
-
//# sourceMappingURL=setRefList.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"setRefList.js","sources":["../../src/utils/setRefList.ts"],"sourcesContent":["import type { MutableRefObject, RefCallback } from 'react';\n\ntype MutableRefList<T> = Array<RefCallback<T> | MutableRefObject<T> | undefined | null>;\n\nexport function mergeRefs<T>(...refs: MutableRefList<T>): RefCallback<T> {\n return (val: T) => {\n setRefList(val, ...refs);\n };\n}\n\nexport function setRefList<T>(val: T, ...refs: MutableRefList<T>): void {\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(val);\n } else if (ref != null) {\n ref.current = val;\n }\n });\n}\n"],"names":["mergeRefs","_len","arguments","length","refs","Array","_key","val","setRefList","apply","concat","_len2","_key2","forEach","ref","current"],"mappings":";;;;AAIO,SAASA,SAASA,GAAgD;AAAA,EAAA,KAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAzCC,IAAI,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EAAA,EAAA;AAAJF,IAAAA,IAAI,CAAAE,IAAA,CAAAJ,GAAAA,SAAA,CAAAI,IAAA,CAAA,CAAA;AAAA,GAAA;EAChC,OAAO,UAACC,GAAM,EAAK;IACfC,UAAU,CAAAC,KAAA,CAACF,KAAAA,CAAAA,EAAAA,CAAAA,GAAG,EAAAG,MAAA,CAAKN,IAAI,CAAC,CAAA,CAAA;GAC3B,CAAA;AACL,CAAA;AAEO,SAASI,UAAUA,CAAID,GAAM,EAAoC;EAAA,KAAAI,IAAAA,KAAA,GAAAT,SAAA,CAAAC,MAAA,EAA/BC,IAAI,OAAAC,KAAA,CAAAM,KAAA,GAAAA,CAAAA,GAAAA,KAAA,WAAAC,KAAA,GAAA,CAAA,EAAAA,KAAA,GAAAD,KAAA,EAAAC,KAAA,EAAA,EAAA;AAAJR,IAAAA,IAAI,CAAAQ,KAAA,GAAAV,CAAAA,CAAAA,GAAAA,SAAA,CAAAU,KAAA,CAAA,CAAA;AAAA,GAAA;AACzCR,EAAAA,IAAI,CAACS,OAAO,CAAC,UAACC,GAAG,EAAK;AAClB,IAAA,IAAI,OAAOA,GAAG,KAAK,UAAU,EAAE;MAC3BA,GAAG,CAACP,GAAG,CAAC,CAAA;AACZ,KAAC,MAAM,IAAIO,GAAG,IAAI,IAAI,EAAE;MACpBA,GAAG,CAACC,OAAO,GAAGR,GAAG,CAAA;AACrB,KAAA;AACJ,GAAC,CAAC,CAAA;AACN;;;;;"}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { useForm } from 'react-hook-form';
|
2
|
-
import React from 'react';
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
4
|
-
|
5
|
-
import { WithTheme } from '../../../_helpers';
|
6
|
-
import { Button } from '../Button/Button';
|
7
|
-
import { TextField } from '../TextField/TextField';
|
8
|
-
import { TextArea } from '../TextArea/TextArea'; // TextArea.tsx 120 строка, не работает из-за некорректного ref
|
9
|
-
import { Checkbox } from '../Checkbox/Checkbox';
|
10
|
-
import { Switch } from '../Switch/Switch';
|
11
|
-
import { Radiobox } from '../Radiobox/Radiobox';
|
12
|
-
import { RadioGroup } from '../../../../components/Radiobox';
|
13
|
-
|
14
|
-
type StoryDropdownProps = {};
|
15
|
-
|
16
|
-
const langName = 'language';
|
17
|
-
const itemsRadiobox = [
|
18
|
-
{ langName, value: 'c', label: 'C', disabled: false },
|
19
|
-
{ langName, value: 'cpp', label: 'C++', disabled: false },
|
20
|
-
{ langName, value: 'assembly', label: 'Assembly', disabled: false },
|
21
|
-
];
|
22
|
-
|
23
|
-
const DefaultForm = () => {
|
24
|
-
const { register, handleSubmit } = useForm();
|
25
|
-
const onSubmit = (data) => {
|
26
|
-
console.log(data);
|
27
|
-
};
|
28
|
-
|
29
|
-
return (
|
30
|
-
<form onSubmit={handleSubmit(onSubmit)} style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
|
31
|
-
<TextField {...register('textfield')} placeholder="Textfield" required={false} />
|
32
|
-
<TextArea {...register('textarea')} autoResize placeholder="Textarea" />
|
33
|
-
<Checkbox {...register('checkbox')} label="Checkbox" />
|
34
|
-
<Switch {...register('switch')} label="Switch" labelPosition="after" />
|
35
|
-
<RadioGroup aria-labelledby="radiogroup-title-id">
|
36
|
-
<div id="radiogroup-title-id" style={{ margin: '1rem 0', fontWeight: '600' }}>
|
37
|
-
Выберите язык программирования для изучения.
|
38
|
-
</div>
|
39
|
-
{itemsRadiobox.map((item) => (
|
40
|
-
<Radiobox
|
41
|
-
key={item.value}
|
42
|
-
value={item.value}
|
43
|
-
label={item.label}
|
44
|
-
disabled={item.disabled}
|
45
|
-
{...register('radiobox')}
|
46
|
-
/>
|
47
|
-
))}
|
48
|
-
</RadioGroup>
|
49
|
-
<Button type="submit">Отправить</Button>
|
50
|
-
</form>
|
51
|
-
);
|
52
|
-
};
|
53
|
-
|
54
|
-
const meta: Meta<StoryDropdownProps> = {
|
55
|
-
title: 'plasma_b2c/Form',
|
56
|
-
decorators: [WithTheme],
|
57
|
-
component: DefaultForm,
|
58
|
-
};
|
59
|
-
|
60
|
-
export default meta;
|
61
|
-
|
62
|
-
const StoryNormal = () => {
|
63
|
-
return <DefaultForm />;
|
64
|
-
};
|
65
|
-
|
66
|
-
export const Default: StoryObj<StoryDropdownProps> = {
|
67
|
-
render: () => <StoryNormal />,
|
68
|
-
};
|
@@ -1,27 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.mergeRefs = mergeRefs;
|
7
|
-
exports.setRefList = setRefList;
|
8
|
-
function mergeRefs() {
|
9
|
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
10
|
-
refs[_key] = arguments[_key];
|
11
|
-
}
|
12
|
-
return function (val) {
|
13
|
-
setRefList.apply(void 0, [val].concat(refs));
|
14
|
-
};
|
15
|
-
}
|
16
|
-
function setRefList(val) {
|
17
|
-
for (var _len2 = arguments.length, refs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
18
|
-
refs[_key2 - 1] = arguments[_key2];
|
19
|
-
}
|
20
|
-
refs.forEach(function (ref) {
|
21
|
-
if (typeof ref === 'function') {
|
22
|
-
ref(val);
|
23
|
-
} else if (ref != null) {
|
24
|
-
ref.current = val;
|
25
|
-
}
|
26
|
-
});
|
27
|
-
}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { useForm } from 'react-hook-form';
|
2
|
-
import React from 'react';
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
4
|
-
|
5
|
-
import { WithTheme } from '../../../_helpers';
|
6
|
-
import { Button } from '../Button/Button';
|
7
|
-
import { TextField } from '../TextField/TextField';
|
8
|
-
import { TextArea } from '../TextArea/TextArea'; // TextArea.tsx 120 строка, не работает из-за некорректного ref
|
9
|
-
import { Checkbox } from '../Checkbox/Checkbox';
|
10
|
-
import { Switch } from '../Switch/Switch';
|
11
|
-
import { Radiobox } from '../Radiobox/Radiobox';
|
12
|
-
import { RadioGroup } from '../../../../components/Radiobox';
|
13
|
-
|
14
|
-
type StoryDropdownProps = {};
|
15
|
-
|
16
|
-
const langName = 'language';
|
17
|
-
const itemsRadiobox = [
|
18
|
-
{ langName, value: 'c', label: 'C', disabled: false },
|
19
|
-
{ langName, value: 'cpp', label: 'C++', disabled: false },
|
20
|
-
{ langName, value: 'assembly', label: 'Assembly', disabled: false },
|
21
|
-
];
|
22
|
-
|
23
|
-
const DefaultForm = () => {
|
24
|
-
const { register, handleSubmit } = useForm();
|
25
|
-
const onSubmit = (data) => {
|
26
|
-
console.log(data);
|
27
|
-
};
|
28
|
-
|
29
|
-
return (
|
30
|
-
<form onSubmit={handleSubmit(onSubmit)} style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
|
31
|
-
<TextField {...register('textfield')} placeholder="Textfield" required={false} />
|
32
|
-
<TextArea {...register('textarea')} autoResize placeholder="Textarea" />
|
33
|
-
<Checkbox {...register('checkbox')} label="Checkbox" />
|
34
|
-
<Switch {...register('switch')} label="Switch" labelPosition="after" />
|
35
|
-
<RadioGroup aria-labelledby="radiogroup-title-id">
|
36
|
-
<div id="radiogroup-title-id" style={{ margin: '1rem 0', fontWeight: '600' }}>
|
37
|
-
Выберите язык программирования для изучения.
|
38
|
-
</div>
|
39
|
-
{itemsRadiobox.map((item) => (
|
40
|
-
<Radiobox
|
41
|
-
key={item.value}
|
42
|
-
value={item.value}
|
43
|
-
label={item.label}
|
44
|
-
disabled={item.disabled}
|
45
|
-
{...register('radiobox')}
|
46
|
-
/>
|
47
|
-
))}
|
48
|
-
</RadioGroup>
|
49
|
-
<Button type="submit">Отправить</Button>
|
50
|
-
</form>
|
51
|
-
);
|
52
|
-
};
|
53
|
-
|
54
|
-
const meta: Meta<StoryDropdownProps> = {
|
55
|
-
title: 'plasma_b2c/Form',
|
56
|
-
decorators: [WithTheme],
|
57
|
-
component: DefaultForm,
|
58
|
-
};
|
59
|
-
|
60
|
-
export default meta;
|
61
|
-
|
62
|
-
const StoryNormal = () => {
|
63
|
-
return <DefaultForm />;
|
64
|
-
};
|
65
|
-
|
66
|
-
export const Default: StoryObj<StoryDropdownProps> = {
|
67
|
-
render: () => <StoryNormal />,
|
68
|
-
};
|
@@ -1,20 +0,0 @@
|
|
1
|
-
export function mergeRefs() {
|
2
|
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
3
|
-
refs[_key] = arguments[_key];
|
4
|
-
}
|
5
|
-
return function (val) {
|
6
|
-
setRefList.apply(void 0, [val].concat(refs));
|
7
|
-
};
|
8
|
-
}
|
9
|
-
export function setRefList(val) {
|
10
|
-
for (var _len2 = arguments.length, refs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
11
|
-
refs[_key2 - 1] = arguments[_key2];
|
12
|
-
}
|
13
|
-
refs.forEach(function (ref) {
|
14
|
-
if (typeof ref === 'function') {
|
15
|
-
ref(val);
|
16
|
-
} else if (ref != null) {
|
17
|
-
ref.current = val;
|
18
|
-
}
|
19
|
-
});
|
20
|
-
}
|