@snack-uikit/card 0.4.9-preview-85c5f47b.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/CHANGELOG.md +322 -0
- package/LICENSE +201 -0
- package/README.md +46 -0
- package/dist/components/Card/Card.d.ts +36 -0
- package/dist/components/Card/Card.js +36 -0
- package/dist/components/Card/constants.d.ts +5 -0
- package/dist/components/Card/constants.js +7 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +1 -0
- package/dist/components/Card/styles.module.css +142 -0
- package/dist/components/Footer/components/Action/Action.d.ts +11 -0
- package/dist/components/Footer/components/Action/Action.js +22 -0
- package/dist/components/Footer/components/Action/index.d.ts +1 -0
- package/dist/components/Footer/components/Action/index.js +1 -0
- package/dist/components/Footer/components/Action/styles.module.css +7 -0
- package/dist/components/Footer/components/CallToAction/CallToAction.d.ts +11 -0
- package/dist/components/Footer/components/CallToAction/CallToAction.js +20 -0
- package/dist/components/Footer/components/CallToAction/index.d.ts +1 -0
- package/dist/components/Footer/components/CallToAction/index.js +1 -0
- package/dist/components/Footer/components/CallToAction/styles.module.css +22 -0
- package/dist/components/Footer/components/Dimension/Dimension.d.ts +12 -0
- package/dist/components/Footer/components/Dimension/Dimension.js +10 -0
- package/dist/components/Footer/components/Dimension/constants.d.ts +4 -0
- package/dist/components/Footer/components/Dimension/constants.js +6 -0
- package/dist/components/Footer/components/Dimension/index.d.ts +1 -0
- package/dist/components/Footer/components/Dimension/index.js +1 -0
- package/dist/components/Footer/components/Dimension/styles.module.css +27 -0
- package/dist/components/Footer/components/Promo/Promo.d.ts +18 -0
- package/dist/components/Footer/components/Promo/Promo.js +25 -0
- package/dist/components/Footer/components/Promo/index.d.ts +1 -0
- package/dist/components/Footer/components/Promo/index.js +1 -0
- package/dist/components/Footer/components/Promo/styles.module.css +6 -0
- package/dist/components/Footer/components/index.d.ts +3 -0
- package/dist/components/Footer/components/index.js +3 -0
- package/dist/components/Footer/index.d.ts +11 -0
- package/dist/components/Footer/index.js +6 -0
- package/dist/components/FunctionBadge/FunctionBadge.d.ts +9 -0
- package/dist/components/FunctionBadge/FunctionBadge.js +23 -0
- package/dist/components/FunctionBadge/constants.d.ts +2 -0
- package/dist/components/FunctionBadge/constants.js +5 -0
- package/dist/components/FunctionBadge/index.d.ts +1 -0
- package/dist/components/FunctionBadge/index.js +1 -0
- package/dist/components/FunctionBadge/styles.module.css +39 -0
- package/dist/components/Header/Header.d.ts +21 -0
- package/dist/components/Header/Header.js +28 -0
- package/dist/components/Header/constants.d.ts +8 -0
- package/dist/components/Header/constants.js +10 -0
- package/dist/components/Header/index.d.ts +1 -0
- package/dist/components/Header/index.js +1 -0
- package/dist/components/Header/styles.module.css +34 -0
- package/dist/components/Image/Image.d.ts +17 -0
- package/dist/components/Image/Image.js +7 -0
- package/dist/components/Image/constants.d.ts +5 -0
- package/dist/components/Image/constants.js +6 -0
- package/dist/components/Image/index.d.ts +1 -0
- package/dist/components/Image/index.js +1 -0
- package/dist/components/Image/styles.module.css +27 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/index.js +10 -0
- package/dist/constants.d.ts +16 -0
- package/dist/constants.js +17 -0
- package/dist/context.d.ts +14 -0
- package/dist/context.js +13 -0
- package/dist/helperComponents/Check/Check.d.ts +5 -0
- package/dist/helperComponents/Check/Check.js +8 -0
- package/dist/helperComponents/Check/index.d.ts +1 -0
- package/dist/helperComponents/Check/index.js +1 -0
- package/dist/helperComponents/Check/styles.module.css +16 -0
- package/dist/helperComponents/Emblem/Emblem.d.ts +11 -0
- package/dist/helperComponents/Emblem/Emblem.js +17 -0
- package/dist/helperComponents/Emblem/index.d.ts +1 -0
- package/dist/helperComponents/Emblem/index.js +1 -0
- package/dist/helperComponents/Emblem/styled.module.css +21 -0
- package/dist/helperComponents/FunctionBadgeWrapper/FunctionBadgeWrapper.d.ts +6 -0
- package/dist/helperComponents/FunctionBadgeWrapper/FunctionBadgeWrapper.js +8 -0
- package/dist/helperComponents/FunctionBadgeWrapper/index.d.ts +1 -0
- package/dist/helperComponents/FunctionBadgeWrapper/index.js +1 -0
- package/dist/helperComponents/FunctionBadgeWrapper/styles.module.css +26 -0
- package/dist/helperComponents/PromoBadge/PromoBadge.d.ts +4 -0
- package/dist/helperComponents/PromoBadge/PromoBadge.js +7 -0
- package/dist/helperComponents/PromoBadge/index.d.ts +1 -0
- package/dist/helperComponents/PromoBadge/index.js +1 -0
- package/dist/helperComponents/PromoBadge/styles.module.css +8 -0
- package/dist/helperComponents/index.d.ts +4 -0
- package/dist/helperComponents/index.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +46 -0
- package/src/components/Card/Card.tsx +121 -0
- package/src/components/Card/constants.ts +10 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Card/styles.module.scss +181 -0
- package/src/components/Footer/components/Action/Action.tsx +39 -0
- package/src/components/Footer/components/Action/index.ts +1 -0
- package/src/components/Footer/components/Action/styles.module.scss +10 -0
- package/src/components/Footer/components/CallToAction/CallToAction.tsx +25 -0
- package/src/components/Footer/components/CallToAction/index.ts +1 -0
- package/src/components/Footer/components/CallToAction/styles.module.scss +27 -0
- package/src/components/Footer/components/Dimension/Dimension.tsx +50 -0
- package/src/components/Footer/components/Dimension/constants.ts +8 -0
- package/src/components/Footer/components/Dimension/index.ts +1 -0
- package/src/components/Footer/components/Dimension/styles.module.scss +31 -0
- package/src/components/Footer/components/Promo/Promo.tsx +40 -0
- package/src/components/Footer/components/Promo/index.ts +1 -0
- package/src/components/Footer/components/Promo/styles.module.scss +8 -0
- package/src/components/Footer/components/index.ts +3 -0
- package/src/components/Footer/index.ts +20 -0
- package/src/components/FunctionBadge/FunctionBadge.tsx +79 -0
- package/src/components/FunctionBadge/constants.ts +6 -0
- package/src/components/FunctionBadge/index.ts +1 -0
- package/src/components/FunctionBadge/styles.module.scss +48 -0
- package/src/components/Header/Header.tsx +79 -0
- package/src/components/Header/constants.ts +13 -0
- package/src/components/Header/index.ts +1 -0
- package/src/components/Header/styles.module.scss +39 -0
- package/src/components/Image/Image.tsx +18 -0
- package/src/components/Image/constants.ts +5 -0
- package/src/components/Image/index.ts +1 -0
- package/src/components/Image/styles.module.scss +38 -0
- package/src/components/index.ts +28 -0
- package/src/constants.ts +17 -0
- package/src/context.ts +27 -0
- package/src/helperComponents/Check/Check.tsx +20 -0
- package/src/helperComponents/Check/index.ts +1 -0
- package/src/helperComponents/Check/styles.module.scss +17 -0
- package/src/helperComponents/Emblem/Emblem.tsx +44 -0
- package/src/helperComponents/Emblem/index.ts +1 -0
- package/src/helperComponents/Emblem/styled.module.scss +20 -0
- package/src/helperComponents/FunctionBadgeWrapper/FunctionBadgeWrapper.tsx +23 -0
- package/src/helperComponents/FunctionBadgeWrapper/index.ts +1 -0
- package/src/helperComponents/FunctionBadgeWrapper/styles.module.scss +30 -0
- package/src/helperComponents/PromoBadge/PromoBadge.tsx +16 -0
- package/src/helperComponents/PromoBadge/index.ts +1 -0
- package/src/helperComponents/PromoBadge/styles.module.scss +10 -0
- package/src/helperComponents/index.ts +4 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
.functionBadgeWrapper{
|
|
2
|
+
position:absolute;
|
|
3
|
+
top:0;
|
|
4
|
+
right:0;
|
|
5
|
+
display:none;
|
|
6
|
+
}
|
|
7
|
+
.functionBadgeWrapper[data-visible]{
|
|
8
|
+
display:block;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.composition{
|
|
12
|
+
border-radius:var(--radius-card-container, 20px);
|
|
13
|
+
box-sizing:border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.card{
|
|
17
|
+
--snack-ui-card-background-color:var(--sys-neutral-background1-level, #f9f9f9);
|
|
18
|
+
border-radius:var(--radius-card-container, 20px);
|
|
19
|
+
border-width:var(--border-width-card-container, 1px);
|
|
20
|
+
position:relative;
|
|
21
|
+
overflow:hidden;
|
|
22
|
+
box-sizing:border-box;
|
|
23
|
+
margin:0;
|
|
24
|
+
padding:0;
|
|
25
|
+
text-align:left;
|
|
26
|
+
background-color:var(--snack-ui-card-background-color);
|
|
27
|
+
border:0;
|
|
28
|
+
outline-color:transparent;
|
|
29
|
+
}
|
|
30
|
+
.card:hover .functionBadgeWrapper{
|
|
31
|
+
display:block;
|
|
32
|
+
}
|
|
33
|
+
.card:hover, .card:focus-visible{
|
|
34
|
+
--snack-ui-card-background-color:var(--sys-neutral-background2-level, #fdfdfd);
|
|
35
|
+
}
|
|
36
|
+
.card:focus-visible{
|
|
37
|
+
outline-width:var(--border-state-focus-l-border-width, 4px);
|
|
38
|
+
outline-style:var(--border-state-focus-l-border-style, solid);
|
|
39
|
+
outline-color:var(--border-state-focus-l-border-color, );
|
|
40
|
+
outline-color:var(--sys-primary-accent-default, #794ed3);
|
|
41
|
+
}
|
|
42
|
+
.card:focus-visible .functionBadgeWrapper{
|
|
43
|
+
display:block;
|
|
44
|
+
}
|
|
45
|
+
.card:focus-visible .check{
|
|
46
|
+
background-color:var(--sys-primary-accent-default, #794ed3);
|
|
47
|
+
}
|
|
48
|
+
.card:focus-within .functionBadgeWrapper{
|
|
49
|
+
display:block;
|
|
50
|
+
}
|
|
51
|
+
.card[data-outline]{
|
|
52
|
+
outline-width:var(--border-state-focus-s-border-width, 2px);
|
|
53
|
+
outline-style:var(--border-state-focus-s-border-style, solid);
|
|
54
|
+
outline-color:var(--border-state-focus-s-border-color, );
|
|
55
|
+
outline-color:var(--sys-neutral-decor-default, #dedede);
|
|
56
|
+
outline-width:var(--border-width-card-container, 1px);
|
|
57
|
+
}
|
|
58
|
+
.card[data-pointer] *{
|
|
59
|
+
cursor:pointer;
|
|
60
|
+
}
|
|
61
|
+
.card[data-pointer][data-outline]:hover{
|
|
62
|
+
outline-color:var(--sys-neutral-decor-hovered, #d2d2d2);
|
|
63
|
+
box-shadow:none;
|
|
64
|
+
}
|
|
65
|
+
.card[data-pointer][data-outline]:focus-visible{
|
|
66
|
+
outline-width:var(--border-state-focus-l-border-width, 4px);
|
|
67
|
+
outline-style:var(--border-state-focus-l-border-style, solid);
|
|
68
|
+
outline-color:var(--border-state-focus-l-border-color, );
|
|
69
|
+
outline-color:var(--sys-primary-accent-default, #794ed3);
|
|
70
|
+
}
|
|
71
|
+
.card[data-pointer][data-checked]{
|
|
72
|
+
outline-width:var(--border-state-focus-s-border-width, 2px);
|
|
73
|
+
outline-style:var(--border-state-focus-s-border-style, solid);
|
|
74
|
+
outline-color:var(--border-state-focus-s-border-color, );
|
|
75
|
+
outline-color:var(--sys-primary-decor-activated, #c5b2f1);
|
|
76
|
+
outline-width:var(--border-width-card-container, 1px);
|
|
77
|
+
}
|
|
78
|
+
.card[data-pointer][data-checked]:hover{
|
|
79
|
+
outline-color:var(--sys-primary-decor-hovered, #decdfb);
|
|
80
|
+
box-shadow:none;
|
|
81
|
+
}
|
|
82
|
+
.card[data-pointer][data-checked] .contentWrapper{
|
|
83
|
+
background-color:color-mix(in srgb, var(--sys-primary-accent-default, #794ed3), var(--snack-ui-card-background-color) calc((1 - var(--opacity-a008, 0.08)) * 100%));
|
|
84
|
+
}
|
|
85
|
+
.card[data-pointer][data-checked] .check{
|
|
86
|
+
color:var(--sys-primary-on-accent, #fdfbff);
|
|
87
|
+
background-color:var(--sys-primary-accent-default, #794ed3);
|
|
88
|
+
}
|
|
89
|
+
.card[data-pointer][data-checked]:focus-visible{
|
|
90
|
+
outline-width:var(--border-state-focus-l-border-width, 4px);
|
|
91
|
+
outline-style:var(--border-state-focus-l-border-style, solid);
|
|
92
|
+
outline-color:var(--border-state-focus-l-border-color, );
|
|
93
|
+
outline-color:var(--sys-primary-accent-default, #794ed3);
|
|
94
|
+
}
|
|
95
|
+
.card[data-pointer][data-checked]:focus-visible .check{
|
|
96
|
+
color:var(--sys-primary-on-accent, #fdfbff);
|
|
97
|
+
background-color:var(--sys-primary-accent-default, #794ed3);
|
|
98
|
+
}
|
|
99
|
+
.card[data-pointer]:hover{
|
|
100
|
+
box-shadow:var(--box-shadow-elevation-level2, 0px 0px 4px 0px rgba(0, 0, 0, 0.0392156863), 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863));
|
|
101
|
+
}
|
|
102
|
+
.card[data-disabled]{
|
|
103
|
+
outline-width:var(--border-state-focus-s-border-width, 2px);
|
|
104
|
+
outline-style:var(--border-state-focus-s-border-style, solid);
|
|
105
|
+
outline-color:var(--border-state-focus-s-border-color, );
|
|
106
|
+
cursor:not-allowed;
|
|
107
|
+
background-color:var(--sys-neutral-background, #f0f0f0);
|
|
108
|
+
outline-color:var(--sys-neutral-decor-default, #dedede);
|
|
109
|
+
outline-width:var(--border-width-card-container, 1px);
|
|
110
|
+
}
|
|
111
|
+
.card[data-disabled] *{
|
|
112
|
+
cursor:not-allowed;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.body{
|
|
116
|
+
display:block;
|
|
117
|
+
color:var(--sys-neutral-text-support, #565656);
|
|
118
|
+
text-align:initial;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.content{
|
|
122
|
+
display:flex;
|
|
123
|
+
flex-direction:column;
|
|
124
|
+
align-items:flex-start;
|
|
125
|
+
justify-content:flex-start;
|
|
126
|
+
box-sizing:border-box;
|
|
127
|
+
max-width:100%;
|
|
128
|
+
}
|
|
129
|
+
.content[data-size=m]{
|
|
130
|
+
padding:var(--space-card-padding-container, 16px);
|
|
131
|
+
gap:var(--space-card-gap-m, 8px);
|
|
132
|
+
}
|
|
133
|
+
.content[data-size=l]{
|
|
134
|
+
padding:var(--space-card-padding-container, 16px);
|
|
135
|
+
gap:var(--space-card-gap-l, 16px);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.footer{
|
|
139
|
+
padding:var(--space-card-padding-container, 16px);
|
|
140
|
+
position:relative;
|
|
141
|
+
box-sizing:border-box;
|
|
142
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ButtonFilledProps, ButtonTonalProps } from '@snack-uikit/button';
|
|
2
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
3
|
+
export type FooterActionProps = WithSupportProps<{
|
|
4
|
+
/** Параметры для основной кнопки */
|
|
5
|
+
button: Pick<ButtonFilledProps, 'label' | 'onClick' | 'loading' | 'icon'>;
|
|
6
|
+
/** Параметры для вторичной кнопки */
|
|
7
|
+
secondaryButton?: Pick<ButtonTonalProps, 'label' | 'onClick' | 'loading' | 'icon'>;
|
|
8
|
+
/** CSS-класс для элемента с контентом */
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function FooterAction({ button, secondaryButton, className, ...rest }: FooterActionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import cn from 'classnames';
|
|
14
|
+
import { ButtonFilled, ButtonTonal } from '@snack-uikit/button';
|
|
15
|
+
import { excludeSupportProps } from '@snack-uikit/utils';
|
|
16
|
+
import { useCardContext } from '../../../../context';
|
|
17
|
+
import styles from './styles.module.css';
|
|
18
|
+
export function FooterAction(_a) {
|
|
19
|
+
var { button, secondaryButton, className } = _a, rest = __rest(_a, ["button", "secondaryButton", "className"]);
|
|
20
|
+
const { disabled } = useCardContext();
|
|
21
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.action, className) }, excludeSupportProps(rest), { children: [_jsx(ButtonFilled, Object.assign({}, button, { appearance: ButtonFilled.appearances.Primary, size: ButtonFilled.sizes.M, disabled: disabled })), secondaryButton && (_jsx(ButtonTonal, Object.assign({}, secondaryButton, { appearance: ButtonTonal.appearances.Neutral, size: ButtonTonal.sizes.M, disabled: disabled })))] })));
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Action';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Action';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
3
|
+
export type FooterCallToActionProps = WithSupportProps<{
|
|
4
|
+
/** Лейбл */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Иконка */
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/** CSS-класс для элемента с контентом */
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function FooterCallToAction({ label, icon, className, ...rest }: FooterCallToActionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import cn from 'classnames';
|
|
14
|
+
import { Typography } from '@snack-uikit/typography';
|
|
15
|
+
import { excludeSupportProps } from '@snack-uikit/utils';
|
|
16
|
+
import styles from './styles.module.css';
|
|
17
|
+
export function FooterCallToAction(_a) {
|
|
18
|
+
var { label, icon, className } = _a, rest = __rest(_a, ["label", "icon", "className"]);
|
|
19
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.callToAction, className) }, excludeSupportProps(rest), { children: [_jsx(Typography.SansLabelL, Object.assign({ className: styles.label }, { children: label })), _jsx("span", Object.assign({ className: styles.icon }, { children: icon }))] })));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CallToAction';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CallToAction';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.callToAction{
|
|
2
|
+
gap:var(--space-card-gap-s, 4px);
|
|
3
|
+
display:flex;
|
|
4
|
+
align-items:center;
|
|
5
|
+
justify-content:flex-start;
|
|
6
|
+
box-sizing:border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.label{
|
|
10
|
+
color:var(--sys-primary-accent-default, #794ed3);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.icon{
|
|
14
|
+
display:flex;
|
|
15
|
+
align-items:center;
|
|
16
|
+
justify-content:center;
|
|
17
|
+
color:var(--sys-primary-accent-default, #794ed3);
|
|
18
|
+
}
|
|
19
|
+
.icon svg{
|
|
20
|
+
width:var(--dimension-3m, 24px) !important;
|
|
21
|
+
height:var(--dimension-3m, 24px) !important;
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Size } from '../../../../constants';
|
|
2
|
+
export type DimensionProps = {
|
|
3
|
+
/** Единица измерения */
|
|
4
|
+
dimension?: string;
|
|
5
|
+
/** Текущее значение */
|
|
6
|
+
currentValue: string;
|
|
7
|
+
/** Старое значение */
|
|
8
|
+
oldValue?: string;
|
|
9
|
+
/** Размер */
|
|
10
|
+
size?: Size;
|
|
11
|
+
};
|
|
12
|
+
export declare function Dimension({ dimension, currentValue, oldValue, size: sizeProp }: DimensionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from '@snack-uikit/typography';
|
|
3
|
+
import { useCardContext } from '../../../../context';
|
|
4
|
+
import { TYPOGRAPHY_SIZE_MAP } from './constants';
|
|
5
|
+
import styles from './styles.module.css';
|
|
6
|
+
export function Dimension({ dimension, currentValue, oldValue, size: sizeProp }) {
|
|
7
|
+
const { size: sizeContext } = useCardContext();
|
|
8
|
+
const size = TYPOGRAPHY_SIZE_MAP[sizeProp || sizeContext];
|
|
9
|
+
return (_jsxs("div", Object.assign({ className: styles.wrapper }, { children: [dimension && (_jsx(Typography, Object.assign({ role: Typography.roles.Title, family: Typography.families.Sans, size: size, className: styles.dimension }, { children: dimension }))), _jsxs("div", Object.assign({ className: styles.valueContainer }, { children: [_jsx(Typography, Object.assign({ role: Typography.roles.Title, family: Typography.families.Sans, size: size, className: styles.currentValue }, { children: currentValue })), oldValue && _jsx(Typography.CrossedOutBodyS, Object.assign({ className: styles.oldValue }, { children: oldValue }))] }))] })));
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dimension';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dimension';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.wrapper{
|
|
2
|
+
gap:var(--space-card-gap-s, 4px);
|
|
3
|
+
display:flex;
|
|
4
|
+
flex:1 0 auto;
|
|
5
|
+
justify-content:flex-end;
|
|
6
|
+
box-sizing:border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.valueContainer{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-end;
|
|
13
|
+
justify-content:flex-start;
|
|
14
|
+
box-sizing:border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.currentValue{
|
|
18
|
+
color:var(--sys-neutral-text-main, #333333);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.oldValue{
|
|
22
|
+
color:var(--sys-neutral-text-light, #898989);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dimension{
|
|
26
|
+
color:var(--sys-neutral-text-light, #898989);
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ButtonFilledProps } from '@snack-uikit/button';
|
|
2
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
3
|
+
import { Size } from '../../../../constants';
|
|
4
|
+
import { DimensionProps } from '../Dimension';
|
|
5
|
+
export type FooterPromoProps = WithSupportProps<{
|
|
6
|
+
/** Параметры для блока значений */
|
|
7
|
+
volume?: DimensionProps;
|
|
8
|
+
/** Параметры для основной кнопки */
|
|
9
|
+
button?: Pick<ButtonFilledProps, 'label' | 'onClick' | 'loading' | 'icon'>;
|
|
10
|
+
/** CSS-класс для элемента с контентом */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Размер */
|
|
13
|
+
size?: Size;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function FooterPromo({ volume, button, className, size, ...rest }: FooterPromoProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare namespace FooterPromo {
|
|
17
|
+
var sizes: typeof Size;
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import cn from 'classnames';
|
|
14
|
+
import { ButtonFilled } from '@snack-uikit/button';
|
|
15
|
+
import { excludeSupportProps } from '@snack-uikit/utils';
|
|
16
|
+
import { Size } from '../../../../constants';
|
|
17
|
+
import { useCardContext } from '../../../../context';
|
|
18
|
+
import { Dimension } from '../Dimension';
|
|
19
|
+
import styles from './styles.module.css';
|
|
20
|
+
export function FooterPromo(_a) {
|
|
21
|
+
var { volume, button, className, size } = _a, rest = __rest(_a, ["volume", "button", "className", "size"]);
|
|
22
|
+
const { disabled } = useCardContext();
|
|
23
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.promo, className) }, excludeSupportProps(rest), { children: [button && (_jsx(ButtonFilled, Object.assign({}, button, { appearance: ButtonFilled.appearances.Primary, size: ButtonFilled.sizes.M, disabled: disabled }))), volume && _jsx(Dimension, Object.assign({}, volume, { size: size }))] })));
|
|
24
|
+
}
|
|
25
|
+
FooterPromo.sizes = Size;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Promo';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Promo';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FooterAction, FooterActionProps, FooterCallToAction, FooterCallToActionProps, FooterPromo, FooterPromoProps } from './components';
|
|
2
|
+
export declare const Footer: {
|
|
3
|
+
Promo: typeof FooterPromo;
|
|
4
|
+
Action: typeof FooterAction;
|
|
5
|
+
CallToAction: typeof FooterCallToAction;
|
|
6
|
+
};
|
|
7
|
+
export declare namespace Footer {
|
|
8
|
+
type PromoProps = FooterPromoProps;
|
|
9
|
+
type ActionProps = FooterActionProps;
|
|
10
|
+
type CallToActionProps = FooterCallToActionProps;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ItemSingleProps } from '@snack-uikit/droplist';
|
|
3
|
+
export type FunctionBadgeProps = {
|
|
4
|
+
/** Иконка */
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
/** Вложенные опции */
|
|
7
|
+
options: Pick<ItemSingleProps, 'tagLabel' | 'onClick' | 'option' | 'icon' | 'disabled' | 'description' | 'caption'>[];
|
|
8
|
+
};
|
|
9
|
+
export declare function FunctionBadge({ icon, options }: FunctionBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as _createElement } from "react";
|
|
3
|
+
import { useCallback, useContext, useLayoutEffect, useState } from 'react';
|
|
4
|
+
import { Droplist } from '@snack-uikit/droplist';
|
|
5
|
+
import { KebabSVG } from '@snack-uikit/icons';
|
|
6
|
+
import { TEST_IDS } from '../../constants';
|
|
7
|
+
import { FunctionBadgeContext } from '../../context';
|
|
8
|
+
import styles from './styles.module.css';
|
|
9
|
+
export function FunctionBadge({ icon, options }) {
|
|
10
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
11
|
+
const { setVisible } = useContext(FunctionBadgeContext);
|
|
12
|
+
useLayoutEffect(() => {
|
|
13
|
+
setVisible && setVisible(isOpen);
|
|
14
|
+
}, [isOpen, setVisible]);
|
|
15
|
+
const { firstElementRefCallback, triggerElementRef, handleDroplistFocusLeave, handleDroplistItemClick, handleTriggerKeyDown, handleDroplistItemKeyDown, } = Droplist.useKeyboardNavigation({ setDroplistOpen: setIsOpen });
|
|
16
|
+
const onClick = useCallback((e) => {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
setIsOpen(isOpen => !isOpen);
|
|
19
|
+
}, []);
|
|
20
|
+
return (_jsx("span", Object.assign({ className: styles.wrapper }, { children: _jsx(Droplist, Object.assign({ open: isOpen, onOpenChange: setIsOpen, firstElementRefCallback: firstElementRefCallback, widthStrategy: Droplist.widthStrategies.Gte, useScroll: true, onFocusLeave: handleDroplistFocusLeave, "data-test-id": TEST_IDS.droplist, triggerClassName: styles.triggerClassName, placement: Droplist.placements.BottomEnd, triggerElement: _jsx("button", Object.assign({ "data-test-id": TEST_IDS.functionBadge, className: styles.button, onKeyDown: handleTriggerKeyDown, onClick: onClick, ref: triggerElementRef }, { children: icon || _jsx(KebabSVG, {}) })) }, { children: options.map(item => (_createElement(Droplist.ItemSingle, Object.assign({}, item, { key: item.option, className: styles.item, "data-test-id": TEST_IDS.option, onClick: e => {
|
|
21
|
+
handleDroplistItemClick(e, item.onClick);
|
|
22
|
+
}, onKeyDown: handleDroplistItemKeyDown })))) })) })));
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FunctionBadge';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FunctionBadge';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.button{
|
|
2
|
+
width:var(--size-card-button, 32px);
|
|
3
|
+
height:var(--size-card-button, 32px);
|
|
4
|
+
border-radius:var(--radius-card-button, 12px);
|
|
5
|
+
cursor:pointer;
|
|
6
|
+
position:relative;
|
|
7
|
+
display:flex;
|
|
8
|
+
align-items:center;
|
|
9
|
+
justify-content:center;
|
|
10
|
+
color:var(--sys-neutral-text-main, #333333);
|
|
11
|
+
background-color:transparent;
|
|
12
|
+
border:0;
|
|
13
|
+
outline-color:transparent;
|
|
14
|
+
}
|
|
15
|
+
.button:hover{
|
|
16
|
+
color:var(--sys-neutral-text-support, #565656);
|
|
17
|
+
}
|
|
18
|
+
.button:focus-visible{
|
|
19
|
+
outline-width:var(--border-state-focus-s-border-width, 2px);
|
|
20
|
+
outline-style:var(--border-state-focus-s-border-style, solid);
|
|
21
|
+
outline-color:var(--border-state-focus-s-border-color, );
|
|
22
|
+
color:var(--sys-neutral-text-support, #565656);
|
|
23
|
+
outline-color:var(--sys-available-complementary, #131313);
|
|
24
|
+
}
|
|
25
|
+
.button:active{
|
|
26
|
+
color:var(--sys-neutral-text-light, #898989);
|
|
27
|
+
}
|
|
28
|
+
.button svg{
|
|
29
|
+
width:var(--dimension-3m, 24px) !important;
|
|
30
|
+
height:var(--dimension-3m, 24px) !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.triggerClassName{
|
|
34
|
+
--offset:var(--space-drop-list-drop-offset, 4px);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.wrapper{
|
|
38
|
+
position:relative;
|
|
39
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
2
|
+
import { Size } from '../../constants';
|
|
3
|
+
import { EmblemProps } from '../../helperComponents';
|
|
4
|
+
export type HeaderProps = WithSupportProps<{
|
|
5
|
+
/** Заголовок */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Подзаголовок */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Метаинформация */
|
|
10
|
+
metadata?: string;
|
|
11
|
+
/** Эмблема иконка/картинка */
|
|
12
|
+
emblem?: EmblemProps;
|
|
13
|
+
/** CSS-класс для элемента с контентом */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Размер */
|
|
16
|
+
size?: Size;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function Header({ title, description, metadata, emblem, className, size: sizeProp, ...rest }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare namespace Header {
|
|
20
|
+
var emblemIconAppearances: typeof import("@snack-uikit/icon-predefined/dist/constants").Appearance;
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import cn from 'classnames';
|
|
14
|
+
import { TruncateString } from '@snack-uikit/truncate-string';
|
|
15
|
+
import { Typography } from '@snack-uikit/typography';
|
|
16
|
+
import { excludeSupportProps } from '@snack-uikit/utils';
|
|
17
|
+
import { TEST_IDS } from '../../constants';
|
|
18
|
+
import { useCardContext } from '../../context';
|
|
19
|
+
import { Emblem } from '../../helperComponents';
|
|
20
|
+
import { DESCRIPTION_SIZE_MAP, TITLE_SIZE_MAP } from './constants';
|
|
21
|
+
import styles from './styles.module.css';
|
|
22
|
+
export function Header(_a) {
|
|
23
|
+
var { title, description, metadata, emblem, className, size: sizeProp } = _a, rest = __rest(_a, ["title", "description", "metadata", "emblem", "className", "size"]);
|
|
24
|
+
const { size: sizeContext } = useCardContext();
|
|
25
|
+
const size = sizeProp || sizeContext;
|
|
26
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.titleLayout, className) }, excludeSupportProps(rest), { "data-size": size }, { children: [emblem && _jsx(Emblem, Object.assign({}, emblem)), _jsxs("div", Object.assign({ className: styles.contentLayout }, { children: [_jsx(Typography, Object.assign({ family: Typography.families.Sans, size: TITLE_SIZE_MAP[size], role: Typography.roles.Title, className: styles.title, "data-test-id": TEST_IDS.title }, { children: _jsx(TruncateString, { variant: TruncateString.variants.End, maxLines: 1, text: title }) })), metadata && (_jsx(Typography.SansBodyS, Object.assign({ className: styles.metadata }, { children: _jsx(TruncateString, { variant: TruncateString.variants.End, maxLines: 1, text: metadata, "data-test-id": TEST_IDS.metadata }) }))), description && (_jsx(Typography, Object.assign({ family: Typography.families.Sans, size: DESCRIPTION_SIZE_MAP[size], role: Typography.roles.Body, className: styles.description }, { children: _jsx(TruncateString, { variant: TruncateString.variants.End, maxLines: 2, text: description, "data-test-id": TEST_IDS.description }) })))] }))] })));
|
|
27
|
+
}
|
|
28
|
+
Header.emblemIconAppearances = Emblem.appearances;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TITLE_SIZE_MAP: {
|
|
2
|
+
m: import("@snack-uikit/typography/dist/components/contants").Size;
|
|
3
|
+
l: import("@snack-uikit/typography/dist/components/contants").Size;
|
|
4
|
+
};
|
|
5
|
+
export declare const DESCRIPTION_SIZE_MAP: {
|
|
6
|
+
m: import("@snack-uikit/typography/dist/components/contants").Size;
|
|
7
|
+
l: import("@snack-uikit/typography/dist/components/contants").Size;
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Typography } from '@snack-uikit/typography';
|
|
2
|
+
import { Size } from '../../constants';
|
|
3
|
+
export const TITLE_SIZE_MAP = {
|
|
4
|
+
[Size.M]: Typography.sizes.S,
|
|
5
|
+
[Size.L]: Typography.sizes.L,
|
|
6
|
+
};
|
|
7
|
+
export const DESCRIPTION_SIZE_MAP = {
|
|
8
|
+
[Size.M]: Typography.sizes.M,
|
|
9
|
+
[Size.L]: Typography.sizes.L,
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Header';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Header';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.titleLayout{
|
|
2
|
+
display:flex;
|
|
3
|
+
align-items:center;
|
|
4
|
+
box-sizing:border-box;
|
|
5
|
+
width:100%;
|
|
6
|
+
}
|
|
7
|
+
.titleLayout[data-size=m]{
|
|
8
|
+
gap:var(--space-card-gap-m, 8px);
|
|
9
|
+
}
|
|
10
|
+
.titleLayout[data-size=l]{
|
|
11
|
+
gap:var(--space-card-gap-l, 16px);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.contentLayout{
|
|
15
|
+
overflow:hidden;
|
|
16
|
+
display:block;
|
|
17
|
+
max-width:100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.title{
|
|
21
|
+
display:block;
|
|
22
|
+
max-width:100%;
|
|
23
|
+
color:var(--sys-neutral-text-main, #333333);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.metadata{
|
|
27
|
+
max-width:100%;
|
|
28
|
+
color:var(--sys-neutral-text-light, #898989);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.description{
|
|
32
|
+
max-width:100%;
|
|
33
|
+
color:var(--sys-neutral-text-support, #565656);
|
|
34
|
+
}
|