@pushwoosh/dumb-components 1.0.69 → 1.0.71

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.
@@ -0,0 +1,3 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { GetStartedPageProps } from './types';
3
+ export declare function GetStartedPage(props: GetStartedPageProps): ReactElement;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Color } from '@pushwoosh/kit-constants';
3
+ import { Vertical } from '@pushwoosh/kit-helpers';
4
+ import { CheckRoundIcon, LockIcon } from '@pushwoosh/kit-icons';
5
+ import { H1, Paragraph } from '@pushwoosh/kit-typography';
6
+ import { Banner } from '../Banner';
7
+ import { GradientBackground, Wrapper, ContentBox, UnorderedList, UnorderedListItem, UnorderedListIcon, UnorderedListText, Image } from './styles';
8
+ export function GetStartedPage(props) {
9
+ const {
10
+ title,
11
+ description,
12
+ image,
13
+ helpText,
14
+ checkList = [],
15
+ actions = null
16
+ } = props;
17
+ return React.createElement(GradientBackground, null, React.createElement(Wrapper, null, React.createElement(ContentBox, null, React.createElement(Vertical, {
18
+ "$gap": 16
19
+ }, React.createElement(Vertical, {
20
+ "$gap": 4
21
+ }, React.createElement(H1, null, title), React.createElement(Paragraph, null, description)), !!checkList.length && React.createElement(UnorderedList, null, checkList.map(text => React.createElement(UnorderedListItem, {
22
+ key: `item-${text}`
23
+ }, React.createElement(UnorderedListIcon, null, React.createElement(CheckRoundIcon, {
24
+ color: Color.SUCCESS,
25
+ size: "small",
26
+ type: "fill",
27
+ view: "filled"
28
+ })), React.createElement(UnorderedListText, null, text))))), helpText && React.createElement(Banner, {
29
+ type: "info",
30
+ view: "ghost",
31
+ title: helpText,
32
+ icon: React.createElement(LockIcon, {
33
+ view: "filled",
34
+ size: "small"
35
+ })
36
+ }), actions && !helpText && actions), React.createElement(Image, {
37
+ alt: title,
38
+ src: image
39
+ })));
40
+ }
@@ -0,0 +1,2 @@
1
+ export { GetStartedPage } from './GetStartedPage';
2
+ export type { GetStartedPageProps } from './types';
@@ -0,0 +1 @@
1
+ export { GetStartedPage } from './GetStartedPage';
@@ -1,6 +1,13 @@
1
- export declare const RootBox: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ export declare const GradientBackground: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
3
  export declare const ContentBox: import("styled-components").StyledComponent<"div", any, {}, never>;
3
4
  export declare const UnorderedList: import("styled-components").StyledComponent<"ul", any, {}, never>;
4
5
  export declare const UnorderedListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
6
+ export declare const UnorderedListText: import("styled-components").StyledComponent<"span", any, {
7
+ $color?: string | undefined;
8
+ $uppercase?: boolean | undefined;
9
+ $ellipsis?: boolean | undefined;
10
+ $variant?: import("@pushwoosh/kit-typography").TypographyVariant | undefined;
11
+ }, never>;
5
12
  export declare const UnorderedListIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
6
13
  export declare const Image: import("styled-components").StyledComponent<"img", any, {}, never>;
@@ -0,0 +1,35 @@
1
+ import styled from 'styled-components';
2
+ import { Color, UnitSize } from '@pushwoosh/kit-constants';
3
+ import { Text } from '@pushwoosh/kit-typography';
4
+ export const GradientBackground = styled.div.withConfig({
5
+ displayName: "GradientBackground",
6
+ componentId: "sc-6jf7u0-0"
7
+ })(["display:flex;align-items:center;justify-content:center;width:100%;height:100vh;background:linear-gradient(98.98deg,#F4F9FD 0%,#CBD7FF 100%);"]);
8
+ export const Wrapper = styled.div.withConfig({
9
+ displayName: "Wrapper",
10
+ componentId: "sc-6jf7u0-1"
11
+ })(["display:flex;align-items:center;justify-content:center;width:", ";gap:40px;"], UnitSize.PAGE_WIDTH);
12
+ export const ContentBox = styled.div.withConfig({
13
+ displayName: "ContentBox",
14
+ componentId: "sc-6jf7u0-2"
15
+ })(["display:flex;flex-direction:column;width:340px;gap:24px;"]);
16
+ export const UnorderedList = styled.ul.withConfig({
17
+ displayName: "UnorderedList",
18
+ componentId: "sc-6jf7u0-3"
19
+ })(["display:flex;flex-direction:column;padding:0;margin:0;list-style:none;gap:8px;"]);
20
+ export const UnorderedListItem = styled.li.withConfig({
21
+ displayName: "UnorderedListItem",
22
+ componentId: "sc-6jf7u0-4"
23
+ })(["display:flex;gap:8px;"]);
24
+ export const UnorderedListText = styled(Text).withConfig({
25
+ displayName: "UnorderedListText",
26
+ componentId: "sc-6jf7u0-5"
27
+ })(["padding:4px 0;"]);
28
+ export const UnorderedListIcon = styled.div.withConfig({
29
+ displayName: "UnorderedListIcon",
30
+ componentId: "sc-6jf7u0-6"
31
+ })(["display:flex;align-items:center;justify-content:center;width:28px;height:28px;background:", ";border-radius:50%;padding:4px;"], Color.SUCCESS_LIGHT);
32
+ export const Image = styled.img.withConfig({
33
+ displayName: "Image",
34
+ componentId: "sc-6jf7u0-7"
35
+ })(["width:400px;"]);
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface GetStartedPageProps {
3
+ title: string;
4
+ description: string;
5
+ image: string;
6
+ helpText?: string;
7
+ checkList?: string[];
8
+ actions?: ReactNode;
9
+ }
package/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { Checkbox } from './Checkbox';
6
6
  export { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs, } from './Drawer';
7
7
  export { DatePicker, DatePickerField, DateTimePicker, DateTimePickerField, } from './DateTimePicker';
8
8
  export { DropdownMenu, DropdownMenuButton, DropdownMenuSection, DropdownMenuItem, } from './DropdownMenu';
9
- export { EmptyPage } from './EmptyPage';
9
+ export { GetStartedPage } from './GetStartedPage';
10
10
  export { EditableField } from './EditableField';
11
11
  export { InputFile } from './InputFile';
12
12
  export { Modal, ModalTitle, ModalConfirm, ModalConfirmProvider, useModalConfirm, ModalHeader, ModalBodyGroup, ModalBodyItem, ModalBody, ModalFooter, } from './Modal';
package/index.js CHANGED
@@ -6,7 +6,7 @@ export { Checkbox } from './Checkbox';
6
6
  export { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs } from './Drawer';
7
7
  export { DatePicker, DatePickerField, DateTimePicker, DateTimePickerField } from './DateTimePicker';
8
8
  export { DropdownMenu, DropdownMenuButton, DropdownMenuSection, DropdownMenuItem } from './DropdownMenu';
9
- export { EmptyPage } from './EmptyPage';
9
+ export { GetStartedPage } from './GetStartedPage';
10
10
  export { EditableField } from './EditableField';
11
11
  export { InputFile } from './InputFile';
12
12
  export { Modal, ModalTitle, ModalConfirm, ModalConfirmProvider, useModalConfirm, ModalHeader, ModalBodyGroup, ModalBodyItem, ModalBody, ModalFooter } from './Modal';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
+ import styled from 'styled-components';
2
3
  import { Color } from '@pushwoosh/kit-constants';
3
- import { Text } from '@pushwoosh/kit-typography';
4
+ import { variants } from '@pushwoosh/kit-typography/map';
4
5
  import { filters } from './filters';
5
6
  import { stringifyScalarOrVariable, unpackScalarOrValue } from './helpers';
6
7
  import { ifOperatorFns } from './parser';
@@ -84,25 +85,25 @@ function getColor(color) {
84
85
  }
85
86
  return color;
86
87
  }
88
+ const Txt = styled.span.withConfig({
89
+ displayName: "Txt",
90
+ componentId: "sc-nm71u5-0"
91
+ })(["", " ", ""], ({
92
+ $color
93
+ }) => $color && `color: ${$color};`, ({
94
+ $variant
95
+ }) => $variant && variants[$variant]);
87
96
  export function renderToReact(ast, context) {
88
97
  return renderNodesToArray(ast, context, (tagNode, children, key) => {
89
98
  const TagName = tagNode.name;
90
99
  const props = Object.fromEntries(Object.entries(tagNode.params).map(([key, value]) => [key, unpackScalarOrValue(value, context)]));
91
100
  if (TagName === 'text') {
92
- return [React.createElement(Text, {
101
+ return [React.createElement(Txt, {
93
102
  "$variant": props.variant,
94
103
  "$color": getColor(props.color),
95
104
  key: key
96
105
  }, children)];
97
106
  }
98
- if (TagName === 'color') {
99
- return [React.createElement("span", {
100
- style: {
101
- color: getColor(props.color)
102
- },
103
- key: key
104
- }, children)];
105
- }
106
107
  return [React.createElement(TagName, {
107
108
  ...props,
108
109
  key: key
@@ -1,3 +0,0 @@
1
- import { type ReactElement } from 'react';
2
- import type { EmptyPageProps } from './types';
3
- export declare function EmptyPage(props: EmptyPageProps): ReactElement;
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { Color } from '@pushwoosh/kit-constants';
3
- import { Vertical } from '@pushwoosh/kit-helpers';
4
- import { CheckRoundIcon } from '@pushwoosh/kit-icons';
5
- import { H1, Paragraph } from '@pushwoosh/kit-typography';
6
- import { RootBox, ContentBox, UnorderedList, UnorderedListItem, UnorderedListIcon, Image } from './styles';
7
- export function EmptyPage(props) {
8
- const {
9
- title,
10
- description,
11
- checkList = [],
12
- image,
13
- actions
14
- } = props;
15
- return React.createElement(RootBox, null, React.createElement(ContentBox, null, React.createElement(Vertical, {
16
- "$gap": 16
17
- }, React.createElement(Vertical, {
18
- "$gap": 4
19
- }, React.createElement(H1, null, title), React.createElement(Paragraph, null, description)), !!checkList.length && React.createElement(UnorderedList, null, checkList.map(text => React.createElement(UnorderedListItem, {
20
- key: `item-${text}`
21
- }, React.createElement(UnorderedListIcon, null, React.createElement(CheckRoundIcon, {
22
- color: Color.SUCCESS,
23
- size: "small",
24
- type: "fill",
25
- view: "filled"
26
- })), text)))), actions), React.createElement(Image, {
27
- alt: title,
28
- src: image
29
- }));
30
- }
@@ -1,2 +0,0 @@
1
- export { EmptyPage } from './EmptyPage';
2
- export type { EmptyPageProps } from './types';
@@ -1 +0,0 @@
1
- export { EmptyPage } from './EmptyPage';
@@ -1,26 +0,0 @@
1
- import styled from 'styled-components';
2
- import { UnitSize } from '@pushwoosh/kit-constants';
3
- export const RootBox = styled.div.withConfig({
4
- displayName: "RootBox",
5
- componentId: "sc-rxhe82-0"
6
- })(["display:flex;align-items:center;justify-content:center;width:", ";gap:40px;"], UnitSize.PAGE_WIDTH);
7
- export const ContentBox = styled.div.withConfig({
8
- displayName: "ContentBox",
9
- componentId: "sc-rxhe82-1"
10
- })(["display:flex;flex-direction:column;width:340px;gap:24px;"]);
11
- export const UnorderedList = styled.ul.withConfig({
12
- displayName: "UnorderedList",
13
- componentId: "sc-rxhe82-2"
14
- })(["display:flex;flex-direction:column;padding:0;margin:0;list-style:none;gap:8px;"]);
15
- export const UnorderedListItem = styled.li.withConfig({
16
- displayName: "UnorderedListItem",
17
- componentId: "sc-rxhe82-3"
18
- })(["display:flex;align-items:center;gap:8px;"]);
19
- export const UnorderedListIcon = styled.div.withConfig({
20
- displayName: "UnorderedListIcon",
21
- componentId: "sc-rxhe82-4"
22
- })(["display:flex;align-items:center;justify-content:center;width:28px;height:28px;background:#64DB2C24;border-radius:50%;padding:4px;"]);
23
- export const Image = styled.img.withConfig({
24
- displayName: "Image",
25
- componentId: "sc-rxhe82-5"
26
- })(["max-width:380px;"]);
@@ -1,8 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- export interface EmptyPageProps {
3
- title: string;
4
- description: string;
5
- checkList: string[];
6
- image: string;
7
- actions: ReactNode;
8
- }
File without changes