@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,13 @@
|
|
|
1
|
+
import { Typography } from '@snack-uikit/typography';
|
|
2
|
+
|
|
3
|
+
import { Size } from '../../constants';
|
|
4
|
+
|
|
5
|
+
export const TITLE_SIZE_MAP = {
|
|
6
|
+
[Size.M]: Typography.sizes.S,
|
|
7
|
+
[Size.L]: Typography.sizes.L,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const DESCRIPTION_SIZE_MAP = {
|
|
11
|
+
[Size.M]: Typography.sizes.M,
|
|
12
|
+
[Size.L]: Typography.sizes.L,
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Header';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@import '@snack-uikit/figma-tokens/build/scss/components/styles-tokens-card';
|
|
2
|
+
|
|
3
|
+
$sizes: 'm', 'l';
|
|
4
|
+
|
|
5
|
+
.titleLayout {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
width: 100%;
|
|
10
|
+
|
|
11
|
+
@each $size in $sizes {
|
|
12
|
+
&[data-size='#{$size}'] {
|
|
13
|
+
@include composite-var($card, 'content', $size, 'header');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.contentLayout {
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
display: block;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.title {
|
|
25
|
+
display: block;
|
|
26
|
+
max-width: 100%;
|
|
27
|
+
color: $sys-neutral-text-main;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.metadata {
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
color: $sys-neutral-text-light;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.description {
|
|
36
|
+
max-width: 100%;
|
|
37
|
+
color: $sys-neutral-text-support;
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Mode } from './constants';
|
|
2
|
+
import styles from './styles.module.scss';
|
|
3
|
+
|
|
4
|
+
export type ImageProps = {
|
|
5
|
+
/** Путь до картинки */
|
|
6
|
+
src: string;
|
|
7
|
+
/** Описание картинки */
|
|
8
|
+
alt: string;
|
|
9
|
+
} /** Image mode */ & (
|
|
10
|
+
| { mode?: Mode.Little | Mode.Middle; hideFading?: never }
|
|
11
|
+
| { mode: Mode.Background; hideFading?: boolean }
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export function Image({ src, alt, mode = Mode.Little, hideFading }: ImageProps) {
|
|
15
|
+
return <img src={src} alt={alt} data-mode={mode} className={styles.image} data-fading={!hideFading || undefined} />;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Image.modes = Mode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Image';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@import '@snack-uikit/figma-tokens/build/scss/components/styles-tokens-card';
|
|
2
|
+
@import '@snack-uikit/figma-tokens/build/scss/styles-theme-variables';
|
|
3
|
+
|
|
4
|
+
$modes: 'little', 'middle', 'background';
|
|
5
|
+
|
|
6
|
+
.image {
|
|
7
|
+
display: block;
|
|
8
|
+
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: auto;
|
|
12
|
+
|
|
13
|
+
object-fit: cover;
|
|
14
|
+
|
|
15
|
+
@each $mode in $modes {
|
|
16
|
+
&[data-mode='#{$mode}'] {
|
|
17
|
+
@if $mode == 'background' {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
|
|
25
|
+
object-fit: cover;
|
|
26
|
+
|
|
27
|
+
&[data-fading]{
|
|
28
|
+
-webkit-mask-image: $gradient-linear-mask-90deg;
|
|
29
|
+
mask-image: $gradient-linear-mask-90deg;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@else {
|
|
34
|
+
@include composite-var($card, 'image', $mode);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Card as CardComponent, CardProps } from './Card';
|
|
2
|
+
import { Footer } from './Footer';
|
|
3
|
+
import { FunctionBadge, FunctionBadgeProps as FunctionBadgeComponentProps } from './FunctionBadge';
|
|
4
|
+
import { Header, HeaderProps as HeaderComponentProps } from './Header';
|
|
5
|
+
import { Image, ImageProps as ImageComponentProps } from './Image';
|
|
6
|
+
|
|
7
|
+
export const Card = CardComponent as typeof CardComponent & {
|
|
8
|
+
Header: typeof Header;
|
|
9
|
+
Image: typeof Image;
|
|
10
|
+
Footer: typeof Footer;
|
|
11
|
+
FunctionBadge: typeof FunctionBadge;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
Card.Header = Header;
|
|
15
|
+
Card.Footer = Footer;
|
|
16
|
+
Card.Image = Image;
|
|
17
|
+
Card.FunctionBadge = FunctionBadge;
|
|
18
|
+
|
|
19
|
+
export { type CardProps };
|
|
20
|
+
|
|
21
|
+
export namespace Card {
|
|
22
|
+
export type HeaderProps = HeaderComponentProps;
|
|
23
|
+
export type ImageProps = ImageComponentProps;
|
|
24
|
+
export type FooterActionProps = Footer.ActionProps;
|
|
25
|
+
export type FooterPromoProps = Footer.PromoProps;
|
|
26
|
+
export type FooterCallToActionProps = Footer.CallToActionProps;
|
|
27
|
+
export type FunctionBadgeProps = FunctionBadgeComponentProps;
|
|
28
|
+
}
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export enum Size {
|
|
2
|
+
M = 'm',
|
|
3
|
+
L = 'l',
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const TEST_IDS = {
|
|
7
|
+
promoBadge: 'card__promo-badge',
|
|
8
|
+
functionBadge: 'card__function-badge',
|
|
9
|
+
droplist: 'card__function-badge__droplist',
|
|
10
|
+
option: 'card__function-badge__option',
|
|
11
|
+
check: 'card__check',
|
|
12
|
+
emblemPicture: 'card__header__emblem-picture',
|
|
13
|
+
emblemIcon: 'card__header__emblem-icon',
|
|
14
|
+
title: 'card__header__title',
|
|
15
|
+
description: 'card__header__description',
|
|
16
|
+
metadata: 'card__header__metadata',
|
|
17
|
+
};
|
package/src/context.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Size } from './constants';
|
|
4
|
+
|
|
5
|
+
type CardContextValue = {
|
|
6
|
+
size: Size;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const CardContext = createContext<CardContextValue>({
|
|
11
|
+
size: Size.M,
|
|
12
|
+
disabled: false,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export function useCardContext() {
|
|
16
|
+
return useContext(CardContext);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type FunctionBadgeContextValue = {
|
|
20
|
+
visible?: boolean;
|
|
21
|
+
setVisible?(v: boolean): void;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const FunctionBadgeContext = createContext<FunctionBadgeContextValue>({
|
|
25
|
+
visible: false,
|
|
26
|
+
setVisible: () => {},
|
|
27
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import { CheckSVG } from '@snack-uikit/icons';
|
|
4
|
+
|
|
5
|
+
import { TEST_IDS } from '../../constants';
|
|
6
|
+
import styles from './styles.module.scss';
|
|
7
|
+
|
|
8
|
+
type CheckProps = {
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function Check({ className }: CheckProps) {
|
|
13
|
+
return (
|
|
14
|
+
<div className={styles.checkWrapper}>
|
|
15
|
+
<div className={cn(styles.checkContainer, className)} data-test-id={TEST_IDS.check}>
|
|
16
|
+
<CheckSVG size={16} />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Check';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@import '@snack-uikit/figma-tokens/build/scss/components/styles-tokens-card';
|
|
2
|
+
|
|
3
|
+
.checkWrapper {
|
|
4
|
+
@include composite-var($card-check-badge);
|
|
5
|
+
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.checkContainer {
|
|
12
|
+
@include composite-var($card-check);
|
|
13
|
+
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IconPredefined, IconPredefinedProps } from '@snack-uikit/icon-predefined';
|
|
2
|
+
|
|
3
|
+
import { TEST_IDS } from '../../constants';
|
|
4
|
+
import { useCardContext } from '../../context';
|
|
5
|
+
import styles from './styled.module.scss';
|
|
6
|
+
|
|
7
|
+
type PictureProps = {
|
|
8
|
+
src: string;
|
|
9
|
+
alt: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type EmblemProps = PictureProps | Pick<IconPredefinedProps, 'icon' | 'decor' | 'appearance'>;
|
|
13
|
+
|
|
14
|
+
function isPictureProps(props: EmblemProps): props is PictureProps {
|
|
15
|
+
return 'src' in props && 'alt' in props;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function Emblem(props: EmblemProps) {
|
|
19
|
+
const { size } = useCardContext();
|
|
20
|
+
|
|
21
|
+
if (isPictureProps(props)) {
|
|
22
|
+
return (
|
|
23
|
+
<img
|
|
24
|
+
src={props.src}
|
|
25
|
+
alt={props.alt}
|
|
26
|
+
data-size={size || undefined}
|
|
27
|
+
className={styles.img}
|
|
28
|
+
data-test-id={TEST_IDS.emblemPicture}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<IconPredefined
|
|
35
|
+
icon={props.icon}
|
|
36
|
+
appearance={props.appearance ?? IconPredefined.appearances.Primary}
|
|
37
|
+
decor={props.decor ?? true}
|
|
38
|
+
size={size}
|
|
39
|
+
data-test-id={TEST_IDS.emblemIcon}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
Emblem.appearances = IconPredefined.appearances;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Emblem';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import '@snack-uikit/figma-tokens/build/scss/components/styles-tokens-card';
|
|
2
|
+
|
|
3
|
+
$sizes: 'm', 'l';
|
|
4
|
+
|
|
5
|
+
.img {
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
|
|
11
|
+
object-fit: cover;
|
|
12
|
+
border-color: $sys-neutral-decor-disabled;
|
|
13
|
+
border-style: solid;
|
|
14
|
+
|
|
15
|
+
@each $size in $sizes {
|
|
16
|
+
&[data-size='#{$size}'] {
|
|
17
|
+
@include composite-var($card, 'picture', $size);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { FunctionBadgeContext } from '../../context';
|
|
4
|
+
import styles from './styles.module.scss';
|
|
5
|
+
|
|
6
|
+
export type FunctionBadgeWrapperProps = {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function FunctionBadgeWrapper({ children, className }: FunctionBadgeWrapperProps) {
|
|
12
|
+
const [visible, setVisible] = useState<boolean>(false);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<FunctionBadgeContext.Provider value={{ visible, setVisible }}>
|
|
16
|
+
<div className={className} data-visible={visible || undefined} tabIndex={-1}>
|
|
17
|
+
<div className={styles.functionBadge}>
|
|
18
|
+
<div className={styles.functionRow}>{children}</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</FunctionBadgeContext.Provider>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FunctionBadgeWrapper';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import '@snack-uikit/figma-tokens/build/scss/components/styles-tokens-card';
|
|
2
|
+
|
|
3
|
+
.functionBadge {
|
|
4
|
+
@include composite-var($card-function-badge);
|
|
5
|
+
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.functionRow {
|
|
13
|
+
position: relative;
|
|
14
|
+
|
|
15
|
+
&::before {
|
|
16
|
+
@include composite-var($card-function-row-transparent-background);
|
|
17
|
+
|
|
18
|
+
content: '';
|
|
19
|
+
|
|
20
|
+
position: absolute;
|
|
21
|
+
top:0;
|
|
22
|
+
left:0;
|
|
23
|
+
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
|
|
27
|
+
background-color: $sys-neutral-background1-level;
|
|
28
|
+
box-shadow: $box-shadow-elevation-level2;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PromoTag } from '@snack-uikit/promo-tag';
|
|
2
|
+
|
|
3
|
+
import { TEST_IDS } from '../../constants';
|
|
4
|
+
import styles from './styles.module.scss';
|
|
5
|
+
|
|
6
|
+
export type PromoBadgeProps = {
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function PromoBadge({ text }: PromoBadgeProps) {
|
|
11
|
+
return (
|
|
12
|
+
<div className={styles.promoBadge}>
|
|
13
|
+
<PromoTag appearance={PromoTag.appearances.Primary} text={text} data-test-id={TEST_IDS.promoBadge} />
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PromoBadge';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|