@pushwoosh/dumb-components 1.0.15 → 1.0.16

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.
@@ -1,19 +1,50 @@
1
1
  import React from 'react';
2
- import { Color, Spacing } from '@pushwoosh/kit-constants';
3
- import { Vertical } from '@pushwoosh/kit-helpers';
2
+ import { Color, Spacing, Tag } from '@pushwoosh/kit-constants';
3
+ import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
4
+ import { OpenIcon, InfoRoundIcon } from '@pushwoosh/kit-icons';
4
5
  import { Text } from '@pushwoosh/kit-typography';
6
+ import { Tooltip } from '../Tooltip';
7
+ import { TitleBox, Link } from './styles';
5
8
  export function FieldBox(props) {
6
9
  const {
7
10
  title,
8
11
  description,
12
+ isOptional,
13
+ link,
14
+ tooltip,
15
+ actions,
9
16
  error,
10
17
  children
11
18
  } = props;
12
19
  return React.createElement(Vertical, {
13
20
  "$gap": Spacing.S1
14
- }, React.createElement(Text, {
21
+ }, React.createElement(Horizontal, {
22
+ "$alignItems": "center",
23
+ "$justifyContent": "space-between"
24
+ }, React.createElement(TitleBox, null, React.createElement(Text, {
15
25
  "$variant": "h5"
16
- }, title), children, description && React.createElement(Text, {
26
+ }, title), isOptional && React.createElement(Text, {
27
+ "$color": Color.LOCKED,
28
+ "$variant": "footnote"
29
+ }, "(optional)"), tooltip && React.createElement(Tooltip, {
30
+ content: tooltip,
31
+ position: "right-middle"
32
+ }, React.createElement("div", null, React.createElement(InfoRoundIcon, {
33
+ color: Color.LOCKED,
34
+ size: "small",
35
+ view: "lined"
36
+ }))), link && React.createElement(Link, {
37
+ as: Tag.A,
38
+ href: link,
39
+ target: "_blank",
40
+ rel: "noopener noreferrer"
41
+ }, React.createElement(OpenIcon, {
42
+ size: "small",
43
+ view: "lined"
44
+ }))), actions && React.createElement(Horizontal, {
45
+ "$alignItems": "center",
46
+ "$gap": Spacing.S1
47
+ }, actions)), children, description && !error && React.createElement(Text, {
17
48
  "$variant": "h5",
18
49
  "$color": Color.LOCKED
19
50
  }, description), error && React.createElement(Text, {
@@ -0,0 +1,20 @@
1
+ import { Spacing } from '@pushwoosh/kit-constants';
2
+ import { Link as LinkBase } from '../Link';
3
+ export declare const TitleBox: import("styled-components").StyledComponent<"div", any, {
4
+ $alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
5
+ $alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
6
+ $gap?: string | number | undefined;
7
+ $gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
8
+ $justifyContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
9
+ $justifyItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
10
+ $margin?: string | number | undefined;
11
+ $padding?: string | number | undefined;
12
+ $placeItems?: "end" | "start" | "center" | "stretch" | undefined;
13
+ } & {
14
+ $gridAutoFlow: string;
15
+ } & {
16
+ $alignItems: string;
17
+ $justifyContent: string;
18
+ $gap: Spacing;
19
+ }, "$gap" | "$gridAutoFlow" | "$alignItems" | "$justifyContent">;
20
+ export declare const Link: import("styled-components").StyledComponent<typeof LinkBase, any, {}, never>;
@@ -0,0 +1,16 @@
1
+ import styled from 'styled-components';
2
+ import { Color, Spacing } from '@pushwoosh/kit-constants';
3
+ import { Horizontal } from '@pushwoosh/kit-helpers';
4
+ import { Link as LinkBase } from '../Link';
5
+ export const TitleBox = styled(Horizontal).attrs({
6
+ $alignItems: 'center',
7
+ $justifyContent: 'start',
8
+ $gap: Spacing.S1
9
+ }).withConfig({
10
+ displayName: "TitleBox",
11
+ componentId: "sc-lzrphm-0"
12
+ })(["text-transform:uppercase;"]);
13
+ export const Link = styled(LinkBase).withConfig({
14
+ displayName: "Link",
15
+ componentId: "sc-lzrphm-1"
16
+ })(["color:", ";&:hover{color:", ";}&:active{opacity:0.5;}"], Color.SOFT, Color.PRIMARY_HOVER);
@@ -2,5 +2,9 @@ import { type PropsWithChildren, type ReactNode } from 'react';
2
2
  export type FieldBoxProps = PropsWithChildren<{
3
3
  title: ReactNode;
4
4
  description?: ReactNode;
5
+ isOptional?: boolean;
6
+ link?: string;
7
+ tooltip?: string;
8
+ actions?: ReactNode;
5
9
  error?: ReactNode;
6
10
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",