@pushwoosh/smart-components-kit 1.3.34 → 1.3.36
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/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +1 -1
- package/CampaignsConfigurationDrawer/components/Card/Card.js +1 -1
- package/CampaignsConfigurationDrawer/components/Card/{styled.js → styles.js} +3 -3
- package/CampaignsConfigurationDrawer/{styled.js → styles.js} +1 -1
- package/DynamicContentPicker/DynamicContentPicker.js +1 -1
- package/DynamicContentPicker/{styled.js → styles.js} +3 -3
- package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +1 -1
- package/DynamicContentPickerForm/VariedDynamicContentPickerFormSmart.js +1 -1
- package/DynamicContentPickerForm/{styled.js → styles.js} +2 -2
- package/LanguagesSelector/LanguagesSelectForm.js +1 -1
- package/LanguagesSelector/LanguagesSelector.js +1 -1
- package/LanguagesSelector/{styled.js → styles.js} +2 -2
- package/MediaStorage/CreateCropDrawer.js +1 -1
- package/MediaStorage/MediaStorage.js +1 -1
- package/MediaStorage/{styled.js → styles.js} +25 -25
- package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +1 -1
- package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +1 -1
- package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +1 -1
- package/PlatformsConfigurationDrawer/{styled.js → styles.js} +6 -6
- package/Table/styles.js +2 -0
- package/Table/styles.test.d.ts +1 -0
- package/Table/styles.test.js +48 -0
- package/package.json +31 -28
- /package/CampaignsConfigurationDrawer/components/Card/{styled.d.ts → styles.d.ts} +0 -0
- /package/CampaignsConfigurationDrawer/{styled.d.ts → styles.d.ts} +0 -0
- /package/DynamicContentPicker/{styled.d.ts → styles.d.ts} +0 -0
- /package/DynamicContentPickerForm/{styled.d.ts → styles.d.ts} +0 -0
- /package/LanguagesSelector/{styled.d.ts → styles.d.ts} +0 -0
- /package/MediaStorage/{styled.d.ts → styles.d.ts} +0 -0
- /package/PlatformsConfigurationDrawer/{styled.d.ts → styles.d.ts} +0 -0
|
@@ -6,7 +6,7 @@ import { H1, H3 } from '@pushwoosh/kit-typography';
|
|
|
6
6
|
import { Card } from './components/Card';
|
|
7
7
|
import { useCanSendMessages } from './hooks';
|
|
8
8
|
import { useLang } from './polyglot';
|
|
9
|
-
import { CloseButtonWrap } from './
|
|
9
|
+
import { CloseButtonWrap } from './styles';
|
|
10
10
|
export function CampaignsConfigurationDrawer(props) {
|
|
11
11
|
const {
|
|
12
12
|
applicationCode,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Text } from '@pushwoosh/kit-typography';
|
|
4
|
-
import { Container, IconWrap, Title } from './
|
|
4
|
+
import { Container, IconWrap, Title } from './styles';
|
|
5
5
|
export function Card(props) {
|
|
6
6
|
const {
|
|
7
7
|
title,
|
|
@@ -3,13 +3,13 @@ import { Color, ShapeRadius, Shadow } from '@pushwoosh/kit-constants';
|
|
|
3
3
|
import { H4 } from '@pushwoosh/kit-typography';
|
|
4
4
|
export const Container = styled.a.withConfig({
|
|
5
5
|
displayName: "Container",
|
|
6
|
-
componentId: "sc-
|
|
6
|
+
componentId: "sc-1r8stxq-0"
|
|
7
7
|
})(["text-decoration:none;border:1px solid ", ";border-radius:", ";padding:16px;background-color:", ";box-shadow:none;min-width:250px;cursor:pointer;transition:box-shadow 0.15s ease-in;&:hover{box-shadow:", ";text-decoration:none;}&:active{box-shadow:none;opacity:0.5;text-decoration:none;}"], Color.DIVIDER, ShapeRadius.SECTION, Color.CLEAR, Shadow.LARGE);
|
|
8
8
|
export const IconWrap = styled.div.withConfig({
|
|
9
9
|
displayName: "IconWrap",
|
|
10
|
-
componentId: "sc-
|
|
10
|
+
componentId: "sc-1r8stxq-1"
|
|
11
11
|
})(["padding:4px;border-radius:", ";background-color:", ";margin-bottom:8px;width:fit-content;"], ShapeRadius.CONTROL, Color.BRIGHT_LIGHT);
|
|
12
12
|
export const Title = styled(H4).withConfig({
|
|
13
13
|
displayName: "Title",
|
|
14
|
-
componentId: "sc-
|
|
14
|
+
componentId: "sc-1r8stxq-2"
|
|
15
15
|
})(["margin-bottom:2px;color:", ";"], Color.MAIN);
|
|
@@ -2,5 +2,5 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { Color, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const CloseButtonWrap = styled.div.withConfig({
|
|
4
4
|
displayName: "CloseButtonWrap",
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-a4d1y6-0"
|
|
6
6
|
})(["padding:6px;cursor:pointer;border-radius:", ";background-color:transparent;&:hover{background-color:", ";color:", ";}"], ShapeRadius.CONTROL, Color.BRIGHT_LIGHT, Color.PRIMARY_HOVER);
|
|
@@ -8,7 +8,7 @@ import { Text } from '@pushwoosh/kit-typography';
|
|
|
8
8
|
import ArrowIcon from './assets/arrow.svg';
|
|
9
9
|
import { placementToDirection } from './helpers';
|
|
10
10
|
import { Line } from './Line';
|
|
11
|
-
import { Arrow, FieldPlace, TextPlace } from './
|
|
11
|
+
import { Arrow, FieldPlace, TextPlace } from './styles';
|
|
12
12
|
import { VariedDynamicContentPickerFormSmart } from '../DynamicContentPickerForm/VariedDynamicContentPickerFormSmart';
|
|
13
13
|
const initialState = {};
|
|
14
14
|
const reducer = (state, action) => {
|
|
@@ -3,11 +3,11 @@ import { Color, FontSize, FontWeight, ShapeRadius } from '@pushwoosh/kit-constan
|
|
|
3
3
|
import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
4
4
|
export const FieldPlace = styled(Vertical).withConfig({
|
|
5
5
|
displayName: "FieldPlace",
|
|
6
|
-
componentId: "sc-
|
|
6
|
+
componentId: "sc-175bs54-0"
|
|
7
7
|
})(["border:1px solid ", ";border-radius:", ";& > div:first-child{background-color:", ";}"], Color.DIVIDER, ShapeRadius.SECTION, Color.SOFT_LIGHT);
|
|
8
8
|
export const TextPlace = styled.div.withConfig({
|
|
9
9
|
displayName: "TextPlace",
|
|
10
|
-
componentId: "sc-
|
|
10
|
+
componentId: "sc-175bs54-1"
|
|
11
11
|
})(["font-weight:", ";font-size:", ";line-height:140%;& > p{margin:4px 0;vertical-align:center;svg{vertical-align:middle;}&:first-child{margin-top:0;}&:last-child{margin-bottom:0;}}"], FontWeight.REGULAR, FontSize.REGULAR);
|
|
12
12
|
const transforms = {
|
|
13
13
|
left: 'scaleX(-1)',
|
|
@@ -19,7 +19,7 @@ export const Arrow = styled(Horizontal).attrs({
|
|
|
19
19
|
$placeItems: 'center'
|
|
20
20
|
}).withConfig({
|
|
21
21
|
displayName: "Arrow",
|
|
22
|
-
componentId: "sc-
|
|
22
|
+
componentId: "sc-175bs54-2"
|
|
23
23
|
})(["position:absolute;width:20px;height:20px;transform:", " translateX(11px);", ":0;"], ({
|
|
24
24
|
$direction
|
|
25
25
|
}) => transforms[$direction], ({
|
|
@@ -4,7 +4,7 @@ import { Combobox, FieldBox, NativeInput, Spinner } from '@pushwoosh/dumb-compon
|
|
|
4
4
|
import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
5
5
|
import { useDynamicContentTags } from './hooks';
|
|
6
6
|
import { useLang } from './polyglot';
|
|
7
|
-
import { SimpleTagPickerDiv } from './
|
|
7
|
+
import { SimpleTagPickerDiv } from './styles';
|
|
8
8
|
import { allDynamicContentModifiers, buildOptions } from './utils';
|
|
9
9
|
const defaultModifier = 'regular';
|
|
10
10
|
const matchesQuery = (value, query) => value.toLowerCase().includes(query.trim().toLowerCase());
|
|
@@ -7,7 +7,7 @@ import { DynamicContentEventPickerForm } from './DynamicContentEventPickerForm';
|
|
|
7
7
|
import { DynamicContentTagPickerForm } from './DynamicContentTagPickerForm';
|
|
8
8
|
import { useVariedDynamicContentTags } from './hooks';
|
|
9
9
|
import { useLang } from './polyglot';
|
|
10
|
-
import { VariedTagPickerDiv } from './
|
|
10
|
+
import { VariedTagPickerDiv } from './styles';
|
|
11
11
|
import { createDefaultDynamicContent } from './utils';
|
|
12
12
|
const defaultVariedDynamicContent = {
|
|
13
13
|
kind: 'tag',
|
|
@@ -7,7 +7,7 @@ export const SimpleTagPickerDiv = styled(Vertical).attrs({
|
|
|
7
7
|
$borderRadius: ShapeRadius.CONTROL
|
|
8
8
|
}).withConfig({
|
|
9
9
|
displayName: "SimpleTagPickerDiv",
|
|
10
|
-
componentId: "sc-
|
|
10
|
+
componentId: "sc-sgqri8-0"
|
|
11
11
|
})(["width:240px;"]);
|
|
12
12
|
export const VariedTagPickerDiv = styled(SimpleTagPickerDiv).attrs({
|
|
13
13
|
$border: `1px solid ${Color.FORM}`,
|
|
@@ -15,5 +15,5 @@ export const VariedTagPickerDiv = styled(SimpleTagPickerDiv).attrs({
|
|
|
15
15
|
$boxShadow: Shadow.REGULAR
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "VariedTagPickerDiv",
|
|
18
|
-
componentId: "sc-
|
|
18
|
+
componentId: "sc-sgqri8-1"
|
|
19
19
|
})([""]);
|
|
@@ -5,7 +5,7 @@ import { Color } from '@pushwoosh/kit-constants';
|
|
|
5
5
|
import { Columns, Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
6
6
|
import { Text } from '@pushwoosh/kit-typography';
|
|
7
7
|
import { useLang } from './polyglot';
|
|
8
|
-
import { ActionButton } from './
|
|
8
|
+
import { ActionButton } from './styles';
|
|
9
9
|
import { fetchLastSelection, useGetLangName } from './utils';
|
|
10
10
|
const AUDIENCE_HINT_MESSAGE = {
|
|
11
11
|
email: 'SMART.LANGUAGES_SELECTOR.AUDIENCE_HINT.EMAIL',
|
|
@@ -5,7 +5,7 @@ import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
|
5
5
|
import { ArrowIcon, ChevronIcon, LanguageIcon, PlusIcon } from '@pushwoosh/kit-icons';
|
|
6
6
|
import { LanguagesModal } from './LanguagesModal';
|
|
7
7
|
import { useLang } from './polyglot';
|
|
8
|
-
import { ButtonGroup } from './
|
|
8
|
+
import { ButtonGroup } from './styles';
|
|
9
9
|
import { useGetLangName } from './utils';
|
|
10
10
|
export const LanguagesSelector = ({
|
|
11
11
|
applicationCode,
|
|
@@ -3,9 +3,9 @@ import { Color } from '@pushwoosh/kit-constants';
|
|
|
3
3
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
4
|
export const ButtonGroup = styled(Horizontal).withConfig({
|
|
5
5
|
displayName: "ButtonGroup",
|
|
6
|
-
componentId: "sc-
|
|
6
|
+
componentId: "sc-1damw8z-0"
|
|
7
7
|
})(["& > *:first-child{border-radius:4px 0 0 4px;}& > *:last-child{border-radius:0 4px 4px 0;}& > *:not(:first-child){border-left:none;}"]);
|
|
8
8
|
export const ActionButton = styled.button.withConfig({
|
|
9
9
|
displayName: "ActionButton",
|
|
10
|
-
componentId: "sc-
|
|
10
|
+
componentId: "sc-1damw8z-1"
|
|
11
11
|
})(["display:grid;grid-auto-flow:column;align-items:center;gap:4px;text-transform:uppercase;color:", ";background-color:transparent;height:16px;padding:0;border:none;font-size:12px;font-style:normal;font-weight:500;line-height:16px;transition:box-shadow 0.5s;cursor:pointer;&:hover{color:", ";}&:active{box-shadow:inset 0 0 0 2em ", ";}"], Color.SOFT, Color.SOFT_HOVER, Color.SOFT_LIGHT);
|
|
@@ -8,7 +8,7 @@ import { useSPAContext } from '@pushwoosh/spa-context';
|
|
|
8
8
|
import { useDeleteMediaFile } from './hooks';
|
|
9
9
|
import { getCropCaption, getThumbUrl } from './mediaFile.utils';
|
|
10
10
|
import { useLang } from './polyglot';
|
|
11
|
-
import { Chips, CropStrip, CropThumb, CropThumbCaption, CropThumbDelete, FieldLabel, PreviewFrame, PreviewImage, PreviewStage, Segment, SegmentItem, SizeInput, TileImage } from './
|
|
11
|
+
import { Chips, CropStrip, CropThumb, CropThumbCaption, CropThumbDelete, FieldLabel, PreviewFrame, PreviewImage, PreviewStage, Segment, SegmentItem, SizeInput, TileImage } from './styles';
|
|
12
12
|
const RATIOS = [{
|
|
13
13
|
value: 'ASPECT_RATIO_1_1',
|
|
14
14
|
label: '1:1',
|
|
@@ -9,7 +9,7 @@ import { CreateCropDrawer } from './CreateCropDrawer';
|
|
|
9
9
|
import { useDeleteMediaFile, useDeleteMediaFiles } from './hooks';
|
|
10
10
|
import { formatBytes, getCropCaption, getThumbUrl } from './mediaFile.utils';
|
|
11
11
|
import { Lang, useLang } from './polyglot';
|
|
12
|
-
import { CropBadge, Dropzone, EmptyState, Grid, HiddenInput, SelectionBar, SelectionCount, Tile, TileActions, TileCheckbox, TileImage, UsageLine, WarningBadge } from './
|
|
12
|
+
import { CropBadge, Dropzone, EmptyState, Grid, HiddenInput, SelectionBar, SelectionCount, Tile, TileActions, TileCheckbox, TileImage, UsageLine, WarningBadge } from './styles';
|
|
13
13
|
const UPLOAD_PATH = '/api/media/upload';
|
|
14
14
|
const ALLOWED_IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.webp'];
|
|
15
15
|
const isAllowedImage = file => {
|
|
@@ -3,11 +3,11 @@ import { NativeInput } from '@pushwoosh/dumb-components';
|
|
|
3
3
|
import { Color, FontSize, FontWeight } from '@pushwoosh/kit-constants';
|
|
4
4
|
export const Grid = styled.div.withConfig({
|
|
5
5
|
displayName: "Grid",
|
|
6
|
-
componentId: "sc-
|
|
6
|
+
componentId: "sc-uu3cbo-0"
|
|
7
7
|
})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;"]);
|
|
8
8
|
export const Tile = styled.div.withConfig({
|
|
9
9
|
displayName: "Tile",
|
|
10
|
-
componentId: "sc-
|
|
10
|
+
componentId: "sc-uu3cbo-1"
|
|
11
11
|
})(["position:relative;border-radius:6px;overflow:hidden;border:1px solid ", ";box-shadow:", ";transition:border-color 0.15s,box-shadow 0.15s;&:hover{border-color:", ";}"], ({
|
|
12
12
|
$selected
|
|
13
13
|
}) => $selected ? Color.PRIMARY : Color.DIVIDER, ({
|
|
@@ -15,39 +15,39 @@ export const Tile = styled.div.withConfig({
|
|
|
15
15
|
}) => $selected ? `0 0 0 1px ${Color.PRIMARY}` : 'none', Color.PRIMARY);
|
|
16
16
|
export const TileImage = styled.img.withConfig({
|
|
17
17
|
displayName: "TileImage",
|
|
18
|
-
componentId: "sc-
|
|
18
|
+
componentId: "sc-uu3cbo-2"
|
|
19
19
|
})(["width:100%;aspect-ratio:1;object-fit:cover;display:block;"]);
|
|
20
20
|
export const CropBadge = styled.span.withConfig({
|
|
21
21
|
displayName: "CropBadge",
|
|
22
|
-
componentId: "sc-
|
|
22
|
+
componentId: "sc-uu3cbo-3"
|
|
23
23
|
})(["position:absolute;top:6px;right:6px;font-size:10px;font-weight:", ";line-height:1;color:", ";background:", ";border-radius:20px;padding:3px 7px;pointer-events:none;"], FontWeight.BOLD, Color.CLEAR, Color.PRIMARY);
|
|
24
24
|
export const WarningBadge = styled.span.withConfig({
|
|
25
25
|
displayName: "WarningBadge",
|
|
26
|
-
componentId: "sc-
|
|
26
|
+
componentId: "sc-uu3cbo-4"
|
|
27
27
|
})(["position:absolute;bottom:0;left:0;right:0;font-size:10px;line-height:1.2;text-align:center;color:", ";background:", ";padding:3px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;"], Color.CLEAR, Color.WARNING);
|
|
28
28
|
export const TileCheckbox = styled.div.withConfig({
|
|
29
29
|
displayName: "TileCheckbox",
|
|
30
|
-
componentId: "sc-
|
|
30
|
+
componentId: "sc-uu3cbo-5"
|
|
31
31
|
})(["position:absolute;top:6px;left:6px;z-index:2;padding:2px;border-radius:4px;background:", ";"], Color.CLEAR);
|
|
32
32
|
export const SelectionBar = styled.div.withConfig({
|
|
33
33
|
displayName: "SelectionBar",
|
|
34
|
-
componentId: "sc-
|
|
34
|
+
componentId: "sc-uu3cbo-6"
|
|
35
35
|
})(["display:flex;align-items:center;gap:12px;min-height:32px;margin-bottom:12px;"]);
|
|
36
36
|
export const SelectionCount = styled.span.withConfig({
|
|
37
37
|
displayName: "SelectionCount",
|
|
38
|
-
componentId: "sc-
|
|
38
|
+
componentId: "sc-uu3cbo-7"
|
|
39
39
|
})(["font-size:", ";color:", ";"], FontSize.SMALL, Color.LOCKED);
|
|
40
40
|
export const TileActions = styled.div.withConfig({
|
|
41
41
|
displayName: "TileActions",
|
|
42
|
-
componentId: "sc-
|
|
42
|
+
componentId: "sc-uu3cbo-8"
|
|
43
43
|
})(["position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;gap:6px;background:rgba(0,0,0,0.45);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.15s;", ":hover &{opacity:1;}@media (hover:none){opacity:1;}"], Tile);
|
|
44
44
|
export const EmptyState = styled.div.withConfig({
|
|
45
45
|
displayName: "EmptyState",
|
|
46
|
-
componentId: "sc-
|
|
46
|
+
componentId: "sc-uu3cbo-9"
|
|
47
47
|
})(["text-align:center;padding:48px 16px;color:", ";"], Color.LOCKED);
|
|
48
48
|
export const Dropzone = styled.button.withConfig({
|
|
49
49
|
displayName: "Dropzone",
|
|
50
|
-
componentId: "sc-
|
|
50
|
+
componentId: "sc-uu3cbo-10"
|
|
51
51
|
})(["width:100%;min-height:96px;margin-bottom:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;font:inherit;font-size:13px;color:", ";cursor:pointer;border:2px dashed ", ";border-radius:8px;background:", ";transition:border-color 0.15s,background 0.15s;&:hover{border-color:", ";}&:disabled{cursor:default;opacity:0.7;}"], Color.LOCKED, ({
|
|
52
52
|
$dragOver
|
|
53
53
|
}) => $dragOver ? Color.PRIMARY : Color.DIVIDER, ({
|
|
@@ -55,46 +55,46 @@ export const Dropzone = styled.button.withConfig({
|
|
|
55
55
|
}) => $dragOver ? Color.SOFT_LIGHT : Color.CLEAR, Color.PRIMARY);
|
|
56
56
|
export const HiddenInput = styled.input.withConfig({
|
|
57
57
|
displayName: "HiddenInput",
|
|
58
|
-
componentId: "sc-
|
|
58
|
+
componentId: "sc-uu3cbo-11"
|
|
59
59
|
})(["display:none;"]);
|
|
60
60
|
export const UsageLine = styled.div.withConfig({
|
|
61
61
|
displayName: "UsageLine",
|
|
62
|
-
componentId: "sc-
|
|
62
|
+
componentId: "sc-uu3cbo-12"
|
|
63
63
|
})(["margin-left:auto;font-size:", ";color:", ";"], FontSize.SMALL, Color.LOCKED);
|
|
64
64
|
/* ---------- CreateCropDrawer ---------- */
|
|
65
65
|
export const PreviewStage = styled.div.withConfig({
|
|
66
66
|
displayName: "PreviewStage",
|
|
67
|
-
componentId: "sc-
|
|
67
|
+
componentId: "sc-uu3cbo-13"
|
|
68
68
|
})(["display:flex;align-items:center;justify-content:center;min-height:200px;max-height:360px;padding:12px;border:1px solid ", ";border-radius:6px;overflow:hidden;background:", ";"], Color.DIVIDER, Color.SOFT_LIGHT);
|
|
69
69
|
export const PreviewFrame = styled.div.withConfig({
|
|
70
70
|
displayName: "PreviewFrame",
|
|
71
|
-
componentId: "sc-
|
|
71
|
+
componentId: "sc-uu3cbo-14"
|
|
72
72
|
})(["aspect-ratio:", ";max-width:100%;max-height:336px;overflow:hidden;border-radius:4px;"], ({
|
|
73
73
|
$ratio
|
|
74
74
|
}) => $ratio);
|
|
75
75
|
export const PreviewImage = styled.img.withConfig({
|
|
76
76
|
displayName: "PreviewImage",
|
|
77
|
-
componentId: "sc-
|
|
77
|
+
componentId: "sc-uu3cbo-15"
|
|
78
78
|
})(["width:100%;height:100%;object-fit:cover;display:block;"]);
|
|
79
79
|
export const FieldLabel = styled.div.withConfig({
|
|
80
80
|
displayName: "FieldLabel",
|
|
81
|
-
componentId: "sc-
|
|
81
|
+
componentId: "sc-uu3cbo-16"
|
|
82
82
|
})(["font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.4px;color:", ";margin-bottom:6px;"], Color.LOCKED);
|
|
83
83
|
export const SizeInput = styled(NativeInput).withConfig({
|
|
84
84
|
displayName: "SizeInput",
|
|
85
|
-
componentId: "sc-
|
|
85
|
+
componentId: "sc-uu3cbo-17"
|
|
86
86
|
})(["&[readonly]{background:", ";color:", ";}"], Color.SOFT_LIGHT, Color.LOCKED);
|
|
87
87
|
export const Chips = styled.div.withConfig({
|
|
88
88
|
displayName: "Chips",
|
|
89
|
-
componentId: "sc-
|
|
89
|
+
componentId: "sc-uu3cbo-18"
|
|
90
90
|
})(["display:flex;flex-wrap:wrap;gap:7px;"]);
|
|
91
91
|
export const Segment = styled.div.withConfig({
|
|
92
92
|
displayName: "Segment",
|
|
93
|
-
componentId: "sc-
|
|
93
|
+
componentId: "sc-uu3cbo-19"
|
|
94
94
|
})(["display:inline-flex;border:1px solid ", ";border-radius:6px;overflow:hidden;"], Color.DIVIDER);
|
|
95
95
|
export const SegmentItem = styled.button.withConfig({
|
|
96
96
|
displayName: "SegmentItem",
|
|
97
|
-
componentId: "sc-
|
|
97
|
+
componentId: "sc-uu3cbo-20"
|
|
98
98
|
})(["font:inherit;font-size:13px;cursor:pointer;padding:7px 14px;border:none;background:", ";color:", ";& + &{border-left:1px solid ", ";}"], ({
|
|
99
99
|
$active
|
|
100
100
|
}) => $active ? Color.PRIMARY : Color.CLEAR, ({
|
|
@@ -102,17 +102,17 @@ export const SegmentItem = styled.button.withConfig({
|
|
|
102
102
|
}) => $active ? Color.CLEAR : Color.MAIN, Color.DIVIDER);
|
|
103
103
|
export const CropStrip = styled.div.withConfig({
|
|
104
104
|
displayName: "CropStrip",
|
|
105
|
-
componentId: "sc-
|
|
105
|
+
componentId: "sc-uu3cbo-21"
|
|
106
106
|
})(["display:flex;gap:10px;flex-wrap:wrap;align-items:flex-start;"]);
|
|
107
107
|
export const CropThumb = styled.div.withConfig({
|
|
108
108
|
displayName: "CropThumb",
|
|
109
|
-
componentId: "sc-
|
|
109
|
+
componentId: "sc-uu3cbo-22"
|
|
110
110
|
})(["position:relative;width:88px;border:1px solid ", ";border-radius:6px;overflow:hidden;background:", ";"], Color.DIVIDER, Color.SOFT_LIGHT);
|
|
111
111
|
export const CropThumbDelete = styled.div.withConfig({
|
|
112
112
|
displayName: "CropThumbDelete",
|
|
113
|
-
componentId: "sc-
|
|
113
|
+
componentId: "sc-uu3cbo-23"
|
|
114
114
|
})(["position:absolute;top:4px;right:4px;opacity:0;transition:opacity 0.15s;", ":hover &{opacity:1;}@media (hover:none){opacity:1;}"], CropThumb);
|
|
115
115
|
export const CropThumbCaption = styled.div.withConfig({
|
|
116
116
|
displayName: "CropThumbCaption",
|
|
117
|
-
componentId: "sc-
|
|
117
|
+
componentId: "sc-uu3cbo-24"
|
|
118
118
|
})(["font-size:10px;text-align:center;padding:3px 2px;color:", ";"], Color.LOCKED);
|
|
@@ -5,7 +5,7 @@ import { Vertical, Columns } from '@pushwoosh/kit-helpers';
|
|
|
5
5
|
import { ArrowRoundIcon, CloseIcon, PlatformLogoIcon } from '@pushwoosh/kit-icons';
|
|
6
6
|
import { H2, H4, Text } from '@pushwoosh/kit-typography';
|
|
7
7
|
import { useLang } from '../../polyglot';
|
|
8
|
-
import { ColumnsWrapper, BreadCrumbs, Header, Close, Card, CardIcon } from '../../
|
|
8
|
+
import { ColumnsWrapper, BreadCrumbs, Header, Close, Card, CardIcon } from '../../styles';
|
|
9
9
|
export function DesktopPage(props) {
|
|
10
10
|
const {
|
|
11
11
|
application,
|
|
@@ -5,7 +5,7 @@ import { Vertical, Columns } from '@pushwoosh/kit-helpers';
|
|
|
5
5
|
import { CloseIcon, DeviceIcon, EmailIcon, WhatsappIcon, SmsIcon } from '@pushwoosh/kit-icons';
|
|
6
6
|
import { H2, Paragraph, H4, Text } from '@pushwoosh/kit-typography';
|
|
7
7
|
import { useLang } from '../../polyglot';
|
|
8
|
-
import { Header, Close, Card, CardIcon } from '../../
|
|
8
|
+
import { Header, Close, Card, CardIcon } from '../../styles';
|
|
9
9
|
export function MainPage(props) {
|
|
10
10
|
const {
|
|
11
11
|
application,
|
|
@@ -5,7 +5,7 @@ import { Columns, Vertical } from '@pushwoosh/kit-helpers';
|
|
|
5
5
|
import { ArrowRoundIcon, CloseIcon, PlatformLogoIcon } from '@pushwoosh/kit-icons';
|
|
6
6
|
import { H2, H4, Text } from '@pushwoosh/kit-typography';
|
|
7
7
|
import { useLang } from '../../polyglot';
|
|
8
|
-
import { ColumnsWrapper, BreadCrumbs, Header, Close, Card, CardIcon } from '../../
|
|
8
|
+
import { ColumnsWrapper, BreadCrumbs, Header, Close, Card, CardIcon } from '../../styles';
|
|
9
9
|
export function MobilePage(props) {
|
|
10
10
|
const {
|
|
11
11
|
application,
|
|
@@ -3,25 +3,25 @@ import { Link } from '@pushwoosh/dumb-components';
|
|
|
3
3
|
import { Color } from '@pushwoosh/kit-constants';
|
|
4
4
|
export const Header = styled.div.withConfig({
|
|
5
5
|
displayName: "Header",
|
|
6
|
-
componentId: "sc-
|
|
6
|
+
componentId: "sc-1hc8gn9-0"
|
|
7
7
|
})(["position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;background:", ";padding:40px 0 8px;gap:8px;"], Color.CLEAR);
|
|
8
8
|
export const Close = styled.div.withConfig({
|
|
9
9
|
displayName: "Close",
|
|
10
|
-
componentId: "sc-
|
|
10
|
+
componentId: "sc-1hc8gn9-1"
|
|
11
11
|
})(["display:flex;justify-content:center;align-items:center;width:36px;height:36px;cursor:pointer;"]);
|
|
12
12
|
export const ColumnsWrapper = styled.div.withConfig({
|
|
13
13
|
displayName: "ColumnsWrapper",
|
|
14
|
-
componentId: "sc-
|
|
14
|
+
componentId: "sc-1hc8gn9-2"
|
|
15
15
|
})(["flex:1;"]);
|
|
16
16
|
export const BreadCrumbs = styled.div.withConfig({
|
|
17
17
|
displayName: "BreadCrumbs",
|
|
18
|
-
componentId: "sc-
|
|
18
|
+
componentId: "sc-1hc8gn9-3"
|
|
19
19
|
})(["padding-left:56px;"]);
|
|
20
20
|
export const Card = styled(Link).withConfig({
|
|
21
21
|
displayName: "Card",
|
|
22
|
-
componentId: "sc-
|
|
22
|
+
componentId: "sc-1hc8gn9-4"
|
|
23
23
|
})(["display:flex;align-items:center;padding:16px;border:1px solid ", ";border-radius:8px;color:", ";gap:16px;cursor:pointer;&:hover,&:focus,&:active{color:", ";text-decoration:none;background-color:", ";}&:focus,&:active{opacity:.5;}"], Color.DIVIDER, Color.MAIN, Color.MAIN, Color.ROW_HOVER);
|
|
24
24
|
export const CardIcon = styled.div.withConfig({
|
|
25
25
|
displayName: "CardIcon",
|
|
26
|
-
componentId: "sc-
|
|
26
|
+
componentId: "sc-1hc8gn9-5"
|
|
27
27
|
})(["padding:4px;color:", ";background-color:", ";border-radius:8px;"], Color.PRIMARY, Color.BRIGHT_LIGHT);
|
package/Table/styles.js
CHANGED
|
@@ -2,6 +2,8 @@ import styled, { css } from 'styled-components';
|
|
|
2
2
|
import { Color, FontSize, FontWeight, LineHeight, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { GridContainer, Horizontal, Vertical, toCssValue } from '@pushwoosh/kit-helpers';
|
|
4
4
|
export const Table = styled(Vertical).withConfig({
|
|
5
|
+
shouldForwardProp: prop => !['columns', 'isBordered'].includes(prop)
|
|
6
|
+
}).withConfig({
|
|
5
7
|
displayName: "Table",
|
|
6
8
|
componentId: "sc-1vdjaze-0"
|
|
7
9
|
})(["--table-columns:", ";border:", ";border-radius:", ";background-color:", ";", " & > *:not(:last-child){border-bottom:1px solid ", ";}"], ({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
3
|
+
import { ServerStyleSheet } from 'styled-components';
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import { Table } from './styles';
|
|
6
|
+
const render = () => {
|
|
7
|
+
const sheet = new ServerStyleSheet();
|
|
8
|
+
try {
|
|
9
|
+
const html = renderToStaticMarkup(sheet.collectStyles(createElement(Table, {
|
|
10
|
+
columns: '1fr 340px',
|
|
11
|
+
width: '100%',
|
|
12
|
+
isBordered: true
|
|
13
|
+
})));
|
|
14
|
+
return {
|
|
15
|
+
html,
|
|
16
|
+
css: sheet.getStyleTags()
|
|
17
|
+
};
|
|
18
|
+
} finally {
|
|
19
|
+
sheet.seal();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
describe('Table', () => {
|
|
23
|
+
it('denies columns and isBordered in shouldForwardProp, which SC 6 uses instead of isPropValid', () => {
|
|
24
|
+
const {
|
|
25
|
+
shouldForwardProp
|
|
26
|
+
} = Table;
|
|
27
|
+
expect(shouldForwardProp?.('columns')).toBe(false);
|
|
28
|
+
expect(shouldForwardProp?.('isBordered')).toBe(false);
|
|
29
|
+
expect(shouldForwardProp?.('width')).toBe(true);
|
|
30
|
+
});
|
|
31
|
+
it('does not forward columns and isBordered to the DOM', () => {
|
|
32
|
+
const {
|
|
33
|
+
html
|
|
34
|
+
} = render();
|
|
35
|
+
expect(html).not.toMatch(/columns=/i);
|
|
36
|
+
expect(html).not.toMatch(/isbordered=/i);
|
|
37
|
+
});
|
|
38
|
+
it('keeps width as a DOM attribute', () => {
|
|
39
|
+
expect(render().html).toContain('width="100%"');
|
|
40
|
+
});
|
|
41
|
+
it('still styles from columns and isBordered', () => {
|
|
42
|
+
const {
|
|
43
|
+
css
|
|
44
|
+
} = render();
|
|
45
|
+
expect(css).toContain('--table-columns:1fr 340px');
|
|
46
|
+
expect(css).toMatch(/border:1px solid/);
|
|
47
|
+
});
|
|
48
|
+
});
|
package/package.json
CHANGED
|
@@ -1,51 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/smart-components-kit",
|
|
3
|
+
"version": "1.3.36",
|
|
4
|
+
"description": "Stateful, data-connected React components shared by Pushwoosh micro-frontends",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://gitlab.corp.pushwoosh.com/frontend/frontend-monorepo.git",
|
|
8
|
+
"directory": "packages/smart-components"
|
|
9
|
+
},
|
|
3
10
|
"main": "index.js",
|
|
4
11
|
"module": "index.js",
|
|
5
12
|
"types": "index.d.ts",
|
|
6
13
|
"sideEffects": false,
|
|
7
14
|
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
|
|
10
|
-
"scripts": {
|
|
11
|
-
"start": "npm run playground",
|
|
12
|
-
"dev": "`pushwoosh-engine app:command:dev`",
|
|
13
|
-
"build": "pushwoosh-engine lib:build",
|
|
14
|
-
"playground": "`pushwoosh-engine lib:command:playground`",
|
|
15
|
-
"check": "npm run check:lint && npm run check:types && npm run test",
|
|
16
|
-
"check:lint": "echo \"Run check:lint\" && NODE_ENV=production eslint src",
|
|
17
|
-
"check:lint-fix": "echo \"Run check:lint\" && NODE_ENV=production eslint src --fix",
|
|
18
|
-
"check:types": "echo \"Run check:types\" && pushwoosh-engine lib:check-types",
|
|
19
|
-
"test": "echo \"Run test\" && vitest run"
|
|
20
|
-
},
|
|
21
|
-
"pre-commit": "check",
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">= 24",
|
|
24
|
-
"npm": ">= 7"
|
|
15
|
+
"access": "public",
|
|
16
|
+
"directory": "dist"
|
|
25
17
|
},
|
|
26
18
|
"dependencies": {
|
|
27
19
|
"@floating-ui/react-dom": "^2.1.2",
|
|
28
|
-
"@pushwoosh/dumb-components": "^2.
|
|
29
|
-
"@pushwoosh/kit-constants": "^2.
|
|
30
|
-
"@pushwoosh/kit-helpers": "^4.12.
|
|
20
|
+
"@pushwoosh/dumb-components": "^2.9.12",
|
|
21
|
+
"@pushwoosh/kit-constants": "^2.1.0",
|
|
22
|
+
"@pushwoosh/kit-helpers": "^4.12.7",
|
|
31
23
|
"@pushwoosh/kit-icons": "^2.3.3",
|
|
32
|
-
"@pushwoosh/kit-typography": "^1.8.
|
|
24
|
+
"@pushwoosh/kit-typography": "^1.8.7",
|
|
33
25
|
"@pushwoosh/rpc-v2-http-api-data": "^0.2.151",
|
|
34
|
-
"@pushwoosh/spa-context": "^1.
|
|
26
|
+
"@pushwoosh/spa-context": "^1.8.1",
|
|
35
27
|
"idb-keyval": "^6.2.2",
|
|
36
28
|
"jwt-decode": "^4.0.0",
|
|
37
29
|
"react-hook-form": "^7.68.0",
|
|
38
30
|
"react-router-dom": "^5.3.4"
|
|
39
31
|
},
|
|
40
32
|
"devDependencies": {
|
|
41
|
-
"@pushwoosh/frontend-builder-engine": "^3.1.
|
|
33
|
+
"@pushwoosh/frontend-builder-engine": "^3.1.3",
|
|
42
34
|
"@svgr/webpack": "^8.1.0",
|
|
43
|
-
"@types/react": "^18.3.
|
|
44
|
-
"@types/react-dom": "^18.3.
|
|
35
|
+
"@types/react": "^18.3.31",
|
|
36
|
+
"@types/react-dom": "^18.3.7",
|
|
45
37
|
"@types/react-router-dom": "^5.3.3",
|
|
46
38
|
"@types/styled-components": "^5.1.34",
|
|
47
39
|
"@types/webpack-env": "^1.18.8",
|
|
48
|
-
"pre-commit": "^1.2.2",
|
|
49
40
|
"react": "^18.3.1",
|
|
50
41
|
"react-dom": "^18.3.1",
|
|
51
42
|
"styled-components": "^5.3.11",
|
|
@@ -55,5 +46,17 @@
|
|
|
55
46
|
"react": "^18.0.0",
|
|
56
47
|
"react-dom": "^18.0.0"
|
|
57
48
|
},
|
|
58
|
-
"
|
|
59
|
-
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">= 24"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"start": "pnpm run playground",
|
|
54
|
+
"build": "pushwoosh-engine lib:build",
|
|
55
|
+
"playground": "`pushwoosh-engine lib:command:playground`",
|
|
56
|
+
"check": "pnpm run check:lint && pnpm run check:types && pnpm run test",
|
|
57
|
+
"check:lint": "echo \"Run check:lint\" && NODE_ENV=production eslint src",
|
|
58
|
+
"check:lint-fix": "echo \"Run check:lint\" && NODE_ENV=production eslint src --fix",
|
|
59
|
+
"check:types": "echo \"Run check:types\" && pushwoosh-engine lib:check-types",
|
|
60
|
+
"test": "echo \"Run test\" && vitest run"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|