@pushwoosh/dumb-components 3.2.0 → 3.3.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.
@@ -2,7 +2,7 @@ import { type ReactElement } from 'react';
2
2
  import type { GetStartedPageProps } from './types';
3
3
  /**
4
4
  * Onboarding/empty-state page with a title, description, illustration, optional
5
- * checklist, help banner and action controls.
5
+ * checklist (check icons or numbered steps), help banner and action controls.
6
6
  *
7
7
  * @example
8
8
  * <GetStartedPage title="Welcome" description="Set up your first app" image={img} actions={<Button color="primary">Start</Button>} />
@@ -4,10 +4,10 @@ import { Vertical } from '@pushwoosh/kit-helpers';
4
4
  import { CheckRoundIcon, LockIcon } from '@pushwoosh/kit-icons';
5
5
  import { H1, Paragraph } from '@pushwoosh/kit-typography';
6
6
  import { Banner } from '../Banner';
7
- import { GradientBackground, Wrapper, ContentBox, UnorderedList, UnorderedListItem, UnorderedListIcon, UnorderedListText, Image } from './styles';
7
+ import { GradientBackground, Wrapper, ContentBox, UnorderedList, UnorderedListItem, UnorderedListIcon, UnorderedListText, OrderedList, OrderedListItem, StepMarker, StepIndex, StepSeparator, Image } from './styles';
8
8
  /**
9
9
  * Onboarding/empty-state page with a title, description, illustration, optional
10
- * checklist, help banner and action controls.
10
+ * checklist (check icons or numbered steps), help banner and action controls.
11
11
  *
12
12
  * @example
13
13
  * <GetStartedPage title="Welcome" description="Set up your first app" image={img} actions={<Button color="primary">Start</Button>} />
@@ -19,6 +19,7 @@ export function GetStartedPage(props) {
19
19
  image,
20
20
  helpText,
21
21
  checkList = [],
22
+ checkListView = 'check',
22
23
  actions = null
23
24
  } = props;
24
25
  return _jsx(GradientBackground, {
@@ -33,7 +34,17 @@ export function GetStartedPage(props) {
33
34
  }), _jsx(Paragraph, {
34
35
  children: description
35
36
  })]
36
- }), !!checkList.length && _jsx(UnorderedList, {
37
+ }), !!checkList.length && (checkListView === 'numbered' ? _jsx(OrderedList, {
38
+ children: checkList.map((text, index) => _jsxs(OrderedListItem, {
39
+ children: [_jsxs(StepMarker, {
40
+ children: [_jsx(StepIndex, {
41
+ children: index + 1
42
+ }), index < checkList.length - 1 && _jsx(StepSeparator, {})]
43
+ }), _jsx(Paragraph, {
44
+ children: text
45
+ })]
46
+ }, `step-${text}`))
47
+ }) : _jsx(UnorderedList, {
37
48
  children: checkList.map(text => _jsxs(UnorderedListItem, {
38
49
  children: [_jsx(UnorderedListIcon, {
39
50
  children: _jsx(CheckRoundIcon, {
@@ -46,7 +57,7 @@ export function GetStartedPage(props) {
46
57
  children: text
47
58
  })]
48
59
  }, `item-${text}`))
49
- })]
60
+ }))]
50
61
  }), (helpText || actions) && _jsxs(Vertical, {
51
62
  "$gap": 16,
52
63
  children: [helpText && _jsx(Banner, {
@@ -1,2 +1,2 @@
1
1
  export { GetStartedPage } from './GetStartedPage';
2
- export type { GetStartedPageProps } from './types';
2
+ export type { GetStartedPageCheckListView, GetStartedPageProps } from './types';
@@ -10,6 +10,21 @@ export declare const ContentBox: import("styled-components/dist/types").IStyledC
10
10
  export declare const UnorderedList: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "style"> & {
11
11
  style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
12
12
  }> & string;
13
+ export declare const OrderedList: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "style"> & {
14
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
15
+ }> & string;
16
+ export declare const OrderedListItem: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "style"> & {
17
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
18
+ }> & string;
19
+ export declare const StepMarker: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
20
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
21
+ }> & string;
22
+ export declare const StepIndex: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
23
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
24
+ }> & string;
25
+ export declare const StepSeparator: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
26
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
27
+ }> & string;
13
28
  export declare const UnorderedListItem: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "style"> & {
14
29
  style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
15
30
  }> & string;
@@ -1,5 +1,5 @@
1
1
  import styled from 'styled-components';
2
- import { Color, UnitSize } from '@pushwoosh/kit-constants';
2
+ import { Color, FontSize, FontWeight, UnitSize } from '@pushwoosh/kit-constants';
3
3
  import { Text } from '@pushwoosh/kit-typography';
4
4
  export const GradientBackground = styled.div.withConfig({
5
5
  displayName: "GradientBackground",
@@ -17,19 +17,39 @@ export const UnorderedList = styled.ul.withConfig({
17
17
  displayName: "UnorderedList",
18
18
  componentId: "sc-6jf7u0-3"
19
19
  })(["display:flex;flex-direction:column;padding:0;margin:0;list-style:none;gap:8px;"]);
20
+ export const OrderedList = styled.ol.withConfig({
21
+ displayName: "OrderedList",
22
+ componentId: "sc-6jf7u0-4"
23
+ })(["display:flex;flex-direction:column;padding:0;margin:0;list-style:none;gap:4px;"]);
24
+ export const OrderedListItem = styled.li.withConfig({
25
+ displayName: "OrderedListItem",
26
+ componentId: "sc-6jf7u0-5"
27
+ })(["display:grid;grid-template-columns:auto 1fr;column-gap:8px;"]);
28
+ export const StepMarker = styled.div.withConfig({
29
+ displayName: "StepMarker",
30
+ componentId: "sc-6jf7u0-6"
31
+ })(["display:flex;flex-direction:column;align-items:center;gap:4px;"]);
32
+ export const StepIndex = styled.div.withConfig({
33
+ displayName: "StepIndex",
34
+ componentId: "sc-6jf7u0-7"
35
+ })(["display:flex;align-items:center;justify-content:center;width:20px;height:20px;border:1px solid ", ";border-radius:50%;background-color:", ";font-size:", ";font-weight:", ";"], Color.DIVIDER, Color.FROZEN, FontSize.SMALL, FontWeight.BOLD);
36
+ export const StepSeparator = styled.div.withConfig({
37
+ displayName: "StepSeparator",
38
+ componentId: "sc-6jf7u0-8"
39
+ })(["height:8px;border-left:1px solid ", ";"], Color.DIVIDER);
20
40
  export const UnorderedListItem = styled.li.withConfig({
21
41
  displayName: "UnorderedListItem",
22
- componentId: "sc-6jf7u0-4"
42
+ componentId: "sc-6jf7u0-9"
23
43
  })(["display:flex;gap:8px;"]);
24
44
  export const UnorderedListText = styled(Text).withConfig({
25
45
  displayName: "UnorderedListText",
26
- componentId: "sc-6jf7u0-5"
46
+ componentId: "sc-6jf7u0-10"
27
47
  })(["padding:4px 0;"]);
28
48
  export const UnorderedListIcon = styled.div.withConfig({
29
49
  displayName: "UnorderedListIcon",
30
- componentId: "sc-6jf7u0-6"
50
+ componentId: "sc-6jf7u0-11"
31
51
  })(["display:flex;align-items:center;justify-content:center;width:28px;height:28px;background:", ";border-radius:50%;padding:4px;"], Color.SUCCESS_LIGHT);
32
52
  export const Image = styled.img.withConfig({
33
53
  displayName: "Image",
34
- componentId: "sc-6jf7u0-7"
54
+ componentId: "sc-6jf7u0-12"
35
55
  })(["width:400px;height:400px;object-fit:contain;"]);
@@ -1,4 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
+ /** Marker of {@link GetStartedPage} checklist items. */
3
+ export type GetStartedPageCheckListView = 'check' | 'numbered';
2
4
  /** Props of {@link GetStartedPage}. */
3
5
  export interface GetStartedPageProps {
4
6
  /** Page title. */
@@ -9,8 +11,10 @@ export interface GetStartedPageProps {
9
11
  image: string;
10
12
  /** Optional help banner text. */
11
13
  helpText?: string;
12
- /** Checklist items rendered with check icons. */
14
+ /** Checklist items rendered with check icons, or numbered steps when `checkListView` is `numbered`. */
13
15
  checkList?: string[];
16
+ /** Marker of checklist items: check icons (default) or step numbers. */
17
+ checkListView?: GetStartedPageCheckListView;
14
18
  /** Call-to-action controls. */
15
19
  actions?: ReactNode;
16
20
  }
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { Divider } from './Divider';
9
9
  export { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs, } from './Drawer';
10
10
  export { CalendarSuperForm, CalendarDropdown, addPeriod, compareStructs, dateToStruct, dateToStructTz, getTimezoneOffset, getPeriodEnd, getPeriodStart, structToDate, structToDateTz, stringifyValue, pickDateStruct, type CalendarDropdownProps, type CalendarDropdownRangeDateProps, type CalendarSuperFormProps, type DateStruct, type RangeValue, } from './Calendar';
11
11
  export { DropdownMenu, DropdownMenuButton, DropdownMenuSection, DropdownMenuItem, DropdownMenuSubmenu, } from './DropdownMenu';
12
- export { GetStartedPage } from './GetStartedPage';
12
+ export { GetStartedPage, type GetStartedPageCheckListView, type GetStartedPageProps } from './GetStartedPage';
13
13
  export { EditableField } from './EditableField';
14
14
  export { EmojiPicker } from './EmojiPicker';
15
15
  export { InputFile } from './InputFile';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",