@soul-refiner/design-system 0.2.111 → 0.2.113

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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { COLORS } from 'common';
3
- type NativeProps = Pick<React.HTMLAttributes<HTMLDivElement>, 'children' | 'onBlur' | 'onBlurCapture' | 'onClick' | 'onChange' | 'onMouseDown' | 'onMouseDownCapture' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseOut' | 'onMouseOver'>;
3
+ type NativeProps = Pick<React.HTMLAttributes<HTMLDivElement>, 'className' | 'children' | 'onBlur' | 'onBlurCapture' | 'onClick' | 'onChange' | 'onMouseDown' | 'onMouseDownCapture' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseOut' | 'onMouseOver'>;
4
4
  export interface DropdownProps extends NativeProps, React.PropsWithChildren {
5
5
  checkbox?: boolean;
6
6
  closeOnChange?: boolean;
@@ -5,8 +5,8 @@ import { Box, P } from '../../';
5
5
  export const Toggle = ({ checked, label, onChange }) => {
6
6
  const status = checked === undefined ? 'indeterminate' : checked ? 'checked' : 'unchecked';
7
7
  return (React.createElement(Box, { "$align": "center", "$gap": 8 },
8
- React.createElement(Wrapper, { as: "label", onClick: onChange },
9
- React.createElement(Input, { checked: !!checked, onChange: onChange, type: "checkbox" }),
8
+ React.createElement(Wrapper, { as: "label", onChange: onChange },
9
+ React.createElement(Input, { checked: !!checked, type: "checkbox" }),
10
10
  React.createElement(Slider, { "$status": status })),
11
11
  label && React.createElement(P, { "$fontSize": 14 }, label)));
12
12
  };
@@ -4,9 +4,10 @@ export interface FeatureCardProps {
4
4
  editable?: boolean;
5
5
  href?: string;
6
6
  image: string;
7
+ onDelete?: () => void;
7
8
  onSave?: (title: string, content: string) => void;
8
9
  sx?: string;
9
10
  title: string;
10
11
  uploadModal?: React.ReactElement;
11
12
  }
12
- export declare const FeatureCard: ({ content, editable, href, image, onSave, sx, title, uploadModal, }: FeatureCardProps) => React.JSX.Element;
13
+ export declare const FeatureCard: ({ content, editable, href, image, onDelete, onSave, sx, title, uploadModal, }: FeatureCardProps) => React.JSX.Element;
@@ -2,8 +2,8 @@
2
2
  import React from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { Box, Button, Modal } from '../../';
5
- import { Camera, Checkmark, Close, Pencil } from '../../../icons';
6
- export const FeatureCard = ({ content = '', editable, href, image, onSave, sx, title = '', uploadModal, }) => {
5
+ import { Camera, Checkmark, Close, Pencil, Trash } from '../../../icons';
6
+ export const FeatureCard = ({ content = '', editable, href, image, onDelete, onSave, sx, title = '', uploadModal, }) => {
7
7
  const [editing, setEditing] = React.useState(false);
8
8
  const [editingTitle, setTitle] = React.useState(() => title);
9
9
  const [editingContent, setContent] = React.useState(() => content);
@@ -60,13 +60,24 @@ export const FeatureCard = ({ content = '', editable, href, image, onSave, sx, t
60
60
  &:hover {
61
61
  background-color: var(--color-grey-10);
62
62
  }
63
- ` })))))));
63
+ ` }),
64
+ onDelete && (React.createElement(Trash, { onClick: onDelete, sx: `
65
+ padding: 8px;
66
+ border-radius: 4px;
67
+ cursor: pointer;
68
+ background-color: var(--color-white);
69
+ box-shadow: var(--elevation-1);
70
+ &:hover {
71
+ background-color: var(--color-grey-10);
72
+ }
73
+ ` }))))))));
64
74
  };
65
75
  const Wrapper = styled.div `
66
76
  text-decoration: none;
67
77
  `;
68
78
  const Figure = styled.figure `
69
79
  max-width: 352px;
80
+ box-sizing: border-box;
70
81
  display: flex;
71
82
  flex-flow: column nowrap;
72
83
  gap: 16px;
@@ -145,6 +156,12 @@ const Content = styled.figcaption `
145
156
  font-weight: 400;
146
157
  line-height: 20px;
147
158
  letter-spacing: -0.084px;
159
+ overflow: hidden;
160
+ text-overflow: ellipsis;
161
+ display: -webkit-box;
162
+ line-clamp: 1;
163
+ -webkit-line-clamp: 1;
164
+ -webkit-box-orient: vertical;
148
165
  `;
149
166
  const EditTitle = styled.input `
150
167
  width: calc(100% - 24px);
@@ -1,10 +1,13 @@
1
1
  import React from 'react';
2
+ import { DropdownOptionProps } from '../../';
2
3
  export interface PriceCardProps {
3
4
  actions: React.ReactElement;
4
5
  content: string;
6
+ dotsActions?: (Omit<DropdownOptionProps, 'selected'> | 'break')[];
5
7
  features: string[];
6
8
  featureTitle: string;
9
+ label?: string;
7
10
  price: string;
8
11
  title: string;
9
12
  }
10
- export declare const PriceCard: ({ actions, content, featureTitle, features, price, title, }: PriceCardProps) => React.JSX.Element;
13
+ export declare const PriceCard: ({ actions, content, dotsActions, featureTitle, features, label, price, title, }: PriceCardProps) => React.JSX.Element;
@@ -1,11 +1,24 @@
1
1
  'use client';
2
2
  import React from 'react';
3
3
  import styled from 'styled-components';
4
- import { Box, H, P } from '../../';
5
- import { Checkmark } from '../../../icons';
6
- export const PriceCard = ({ actions, content, featureTitle, features, price, title, }) => {
4
+ import { Box, Button, H, P, Dropdown } from '../../';
5
+ import { Checkmark, EllipsisHorizontal } from '../../../icons';
6
+ export const PriceCard = ({ actions, content, dotsActions, featureTitle, features, label, price, title, }) => {
7
7
  const id = React.useId();
8
8
  return (React.createElement(Price, null,
9
+ dotsActions && !!dotsActions.length && (React.createElement(Dropdown, { className: "dot-dropdown", hasArrow: true, maintainState: false, offset: [0, 32], options: dotsActions, sx: `
10
+ position: absolute;
11
+ top: 6px;
12
+ right: 6px;
13
+ display: none;
14
+ `, trigger: React.createElement(Button, { icon: React.createElement(EllipsisHorizontal, null), showChevron: false, type: "outlined", size: "small", className: "icon" }), onClick: (e) => e.preventDefault() })),
15
+ label && (React.createElement(Box, { "$justify": "center", sx: `
16
+ width: 100%;
17
+ position: absolute;
18
+ z-index: -1;
19
+ top: -33px;` },
20
+ React.createElement(Label, null,
21
+ React.createElement(P, { as: "span", "$fontSize": 12, "$lineHeight": 16, "$mediumBold": true, "$textClampLines": 1 }, label)))),
9
22
  React.createElement(Box, { "$align": "stretch", "$display": "flex", "$dir": "column", "$gap": 24, sx: `
10
23
  padding: 24px 48px;
11
24
  background-color: var(--color-grey-10);
@@ -26,6 +39,8 @@ export const PriceCard = ({ actions, content, featureTitle, features, price, tit
26
39
  React.createElement(P, { "$fontSize": 14, "$lineHeight": 20 }, item))))))));
27
40
  };
28
41
  const Price = styled.figure `
42
+ position: relative;
43
+ z-index: 1;
29
44
  margin: 0px;
30
45
  padding: 0px;
31
46
  width: 280px;
@@ -33,11 +48,25 @@ const Price = styled.figure `
33
48
  border-radius: 16px;
34
49
  box-shadow: var(--elevation-2);
35
50
  user-select: none;
51
+ border: 1px solid transparent;
36
52
 
37
53
  &:hover {
38
54
  border: 1px solid var(--color-primary-blue-3);
55
+
56
+ .dot-dropdown {
57
+ display: flex;
58
+ }
39
59
  }
40
60
  `;
61
+ const Label = styled.div `
62
+ max-width: calc(100% - 32px);
63
+ box-sizing: border-box;
64
+ padding: 8px 24px;
65
+ border-radius: 16px 16px 0px 0px;
66
+ background-color: var(--color-grey-10);
67
+ box-shadow: var(--elevation-2);
68
+ border-bottom: 1px solid var(--color-grey-9);
69
+ `;
41
70
  const Divider = styled.div `
42
71
  height: 1px;
43
72
  width: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "0.2.111",
3
+ "version": "0.2.113",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {