agroptima-design-system 0.16.0 → 0.16.2-beta.1
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/package.json +3 -2
- package/src/atoms/Alert.scss +1 -0
- package/src/atoms/Button/Button.scss +6 -6
- package/src/atoms/Card/Card.scss +5 -9
- package/src/atoms/Card/Card.tsx +5 -2
- package/src/atoms/CardMenu/CardMenu.scss +14 -1
- package/src/atoms/CardMenu/CardMenuOption.tsx +17 -7
- package/src/atoms/CardsTable/CardsTable.scss +55 -45
- package/src/icons/calendar.svg +1 -0
- package/src/icons/change-password.svg +1 -0
- package/src/icons/client.svg +1 -0
- package/src/icons/comment.svg +1 -0
- package/src/icons/double-arrow-left.svg +1 -0
- package/src/icons/double-arrow-right.svg +1 -0
- package/src/icons/export.svg +1 -1
- package/src/icons/import.svg +1 -0
- package/src/icons/index.tsx +22 -0
- package/src/icons/logout.svg +1 -0
- package/src/icons/product.svg +1 -0
- package/src/icons/salesman.svg +1 -0
- package/src/icons/settings.svg +1 -0
- package/src/stories/Card.stories.js +27 -3
- package/src/stories/CardMenu.stories.js +40 -11
- package/src/stories/CardsTableList.stories.ts +2 -1
- package/src/stories/Changelog.stories.mdx +11 -0
- package/tests/CardMenuOption.spec.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agroptima-design-system",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2-beta.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "npm run storybook",
|
|
6
6
|
"storybook": "storybook dev -p 6006 --ci",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"lint:fix": "eslint src --fix",
|
|
11
11
|
"types": "tsc --noEmit",
|
|
12
12
|
"chromatic": "npx chromatic --exit-zero-on-changes",
|
|
13
|
-
"test": "jest"
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"publish:beta": "npm publish --tag beta"
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
16
17
|
"@storybook/addon-designs": "^7.0.5",
|
package/src/atoms/Alert.scss
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
&.primary-outlined {
|
|
57
57
|
@include button-style(
|
|
58
|
-
|
|
58
|
+
transparent,
|
|
59
59
|
color_alias.$primary-color-600,
|
|
60
60
|
color_alias.$primary-color-50
|
|
61
61
|
);
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
|
|
85
85
|
&.error-outlined {
|
|
86
86
|
@include button-style(
|
|
87
|
-
|
|
87
|
+
transparent,
|
|
88
88
|
color_alias.$error-color-600,
|
|
89
89
|
color_alias.$error-color-50
|
|
90
90
|
);
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
|
|
126
126
|
&.success-outlined {
|
|
127
127
|
@include button-style(
|
|
128
|
-
|
|
128
|
+
transparent,
|
|
129
129
|
color_alias.$neutral-color-900,
|
|
130
130
|
color_alias.$success-color-50
|
|
131
131
|
);
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
|
|
167
167
|
&.warning-outlined {
|
|
168
168
|
@include button-style(
|
|
169
|
-
|
|
169
|
+
transparent,
|
|
170
170
|
color_alias.$neutral-color-900,
|
|
171
171
|
color_alias.$warning-color-50
|
|
172
172
|
);
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
|
|
196
196
|
&.info-outlined {
|
|
197
197
|
@include button-style(
|
|
198
|
-
|
|
198
|
+
transparent,
|
|
199
199
|
color_alias.$info-color-600,
|
|
200
200
|
color_alias.$info-color-50
|
|
201
201
|
);
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
|
|
225
225
|
&.neutral-outlined {
|
|
226
226
|
@include button-style(
|
|
227
|
-
|
|
227
|
+
transparent,
|
|
228
228
|
color_alias.$neutral-color-1000,
|
|
229
229
|
color_alias.$neutral-color-50
|
|
230
230
|
);
|
package/src/atoms/Card/Card.scss
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
gap: config.$space-1x;
|
|
10
10
|
padding: config.$space-3x;
|
|
11
|
+
width: 100%;
|
|
11
12
|
|
|
12
13
|
p {
|
|
13
14
|
margin: 0;
|
|
@@ -57,15 +58,10 @@
|
|
|
57
58
|
@include typography.body-regular-disabled;
|
|
58
59
|
background: color_alias.$neutral-color-50;
|
|
59
60
|
}
|
|
60
|
-
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
// Tablet & Desktop cases
|
|
68
|
-
@media only screen and (min-width: breakpoints.$medium) {
|
|
69
|
-
width: 18.625rem;
|
|
62
|
+
&.active {
|
|
63
|
+
border: 1px solid color_alias.$primary-color-1000;
|
|
64
|
+
box-shadow: none;
|
|
65
|
+
}
|
|
70
66
|
}
|
|
71
67
|
}
|
package/src/atoms/Card/Card.tsx
CHANGED
|
@@ -7,22 +7,25 @@ export type Variant = 'primary'
|
|
|
7
7
|
export interface CardProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
8
8
|
variant?: Variant
|
|
9
9
|
isDisabled?: boolean
|
|
10
|
+
isActive?: boolean
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export function Card({
|
|
13
14
|
className,
|
|
14
15
|
variant = 'primary',
|
|
15
16
|
isDisabled = false,
|
|
17
|
+
isActive = false,
|
|
16
18
|
children,
|
|
17
19
|
...props
|
|
18
20
|
}: CardProps): React.JSX.Element {
|
|
19
21
|
const cssClasses = classNames('card', className, variant, {
|
|
20
22
|
disabled: isDisabled,
|
|
23
|
+
active: isActive,
|
|
21
24
|
})
|
|
22
25
|
|
|
23
26
|
return (
|
|
24
|
-
<
|
|
27
|
+
<article className={cssClasses} {...props}>
|
|
25
28
|
{children}
|
|
26
|
-
</
|
|
29
|
+
</article>
|
|
27
30
|
)
|
|
28
31
|
}
|
|
@@ -13,12 +13,16 @@
|
|
|
13
13
|
gap: config.$space-3x;
|
|
14
14
|
border-radius: config.$corner-radius-xxs;
|
|
15
15
|
border-bottom: 1px solid color_alias.$neutral-color-200;
|
|
16
|
+
text-decoration: none;
|
|
16
17
|
cursor: default;
|
|
17
|
-
|
|
18
|
+
&:hover {
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
}
|
|
18
21
|
@include typography.body-regular-primary;
|
|
19
22
|
|
|
20
23
|
.icon {
|
|
21
24
|
width: config.$icon-size-4x;
|
|
25
|
+
min-width: config.$icon-size-4x;
|
|
22
26
|
height: config.$icon-size-4x;
|
|
23
27
|
> svg {
|
|
24
28
|
width: 100%;
|
|
@@ -54,6 +58,15 @@
|
|
|
54
58
|
&.primary {
|
|
55
59
|
background: color_alias.$neutral-white;
|
|
56
60
|
|
|
61
|
+
&.active {
|
|
62
|
+
background-color: color_alias.$primary-color-50;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.error {
|
|
66
|
+
border: 1px solid color_alias.$error-color-600;
|
|
67
|
+
background-color: color_alias.$error-color-50;
|
|
68
|
+
}
|
|
69
|
+
|
|
57
70
|
.icon {
|
|
58
71
|
> svg {
|
|
59
72
|
fill: color_alias.$primary-color-600;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { Icon, IconType } from '../Icon'
|
|
2
2
|
import './CardMenu.scss'
|
|
3
3
|
import { classNames } from '../../utils/classNames'
|
|
4
|
+
import Link, { LinkProps as NextLinkProps } from 'next/link'
|
|
4
5
|
|
|
5
6
|
export type Variant = 'primary'
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
type LinkProps = NextLinkProps & React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
9
|
+
export interface CardMenuOptionProps extends LinkProps {
|
|
9
10
|
id?: string
|
|
10
11
|
variant?: Variant
|
|
11
12
|
icon: IconType
|
|
12
13
|
title: string
|
|
13
14
|
description?: string
|
|
14
15
|
disabled?: boolean
|
|
16
|
+
href: string
|
|
17
|
+
active?: boolean
|
|
18
|
+
error?: boolean
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
export function CardMenuOption({
|
|
@@ -22,29 +26,35 @@ export function CardMenuOption({
|
|
|
22
26
|
title,
|
|
23
27
|
description,
|
|
24
28
|
disabled,
|
|
29
|
+
href,
|
|
30
|
+
active,
|
|
31
|
+
error,
|
|
25
32
|
...props
|
|
26
33
|
}: CardMenuOptionProps): React.JSX.Element {
|
|
27
34
|
const cssClasses = classNames('card-menu-option', variant, className, {
|
|
28
|
-
disabled
|
|
35
|
+
disabled,
|
|
36
|
+
active,
|
|
37
|
+
error,
|
|
29
38
|
})
|
|
30
39
|
|
|
31
40
|
return (
|
|
32
|
-
<
|
|
41
|
+
<Link
|
|
33
42
|
role="menuitem"
|
|
34
43
|
className={cssClasses}
|
|
35
|
-
{
|
|
44
|
+
href={disabled ? '#' : href}
|
|
36
45
|
aria-disabled={disabled}
|
|
46
|
+
{...props}
|
|
37
47
|
>
|
|
38
48
|
<div className="left">
|
|
39
49
|
<div className="title-container">
|
|
40
50
|
<Icon name={icon} className={variant} />
|
|
41
51
|
<span className="title">{title}</span>
|
|
42
52
|
</div>
|
|
43
|
-
<p className="content">{description}</p>
|
|
53
|
+
{description && <p className="content">{description}</p>}
|
|
44
54
|
</div>
|
|
45
55
|
<div className="right">
|
|
46
56
|
<Icon name="AngleRight" className={variant} />
|
|
47
57
|
</div>
|
|
48
|
-
</
|
|
58
|
+
</Link>
|
|
49
59
|
)
|
|
50
60
|
}
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
gap: config.$space-3x;
|
|
15
|
+
|
|
16
|
+
tr {
|
|
17
|
+
box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.25);
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
tr {
|
|
@@ -111,13 +115,10 @@
|
|
|
111
115
|
border-radius: 0px config.$corner-radius-xxs config.$corner-radius-xxs 0px;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
|
-
tr {
|
|
115
|
-
box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.25);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
118
|
tr {
|
|
119
119
|
td {
|
|
120
120
|
@include typography.cards-table-list-text;
|
|
121
|
+
overflow: hidden;
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
124
|
|
|
@@ -138,6 +139,45 @@
|
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
|
|
142
|
+
// Desktop
|
|
143
|
+
thead {
|
|
144
|
+
display: flex;
|
|
145
|
+
}
|
|
146
|
+
tr {
|
|
147
|
+
flex-direction: row;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
th,
|
|
151
|
+
td {
|
|
152
|
+
display: flex;
|
|
153
|
+
justify-content: flex-start;
|
|
154
|
+
align-items: center;
|
|
155
|
+
flex: 2;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
td {
|
|
159
|
+
padding: config.$space-2x config.$space-3x;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
th.actions {
|
|
163
|
+
justify-content: center;
|
|
164
|
+
flex: 1;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
td.actions {
|
|
168
|
+
order: 0;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
flex: 1;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
td:has(.badge) {
|
|
174
|
+
gap: config.$space-2x;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.alignment-right {
|
|
178
|
+
justify-content: flex-end;
|
|
179
|
+
}
|
|
180
|
+
|
|
141
181
|
// Media queries
|
|
142
182
|
// Mobile & tablet cases
|
|
143
183
|
@media only screen and (max-width: breakpoints.$large) {
|
|
@@ -145,16 +185,20 @@
|
|
|
145
185
|
display: none;
|
|
146
186
|
}
|
|
147
187
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
188
|
+
tbody {
|
|
189
|
+
tr {
|
|
190
|
+
flex-direction: row;
|
|
191
|
+
flex-wrap: wrap;
|
|
192
|
+
position: relative;
|
|
193
|
+
gap: config.$space-1x;
|
|
194
|
+
padding: config.$space-2x config.$space-3x;
|
|
195
|
+
}
|
|
154
196
|
}
|
|
155
197
|
|
|
156
198
|
td {
|
|
157
199
|
width: 100%;
|
|
200
|
+
flex: inherit;
|
|
201
|
+
padding: 0px;
|
|
158
202
|
}
|
|
159
203
|
|
|
160
204
|
td:first-child {
|
|
@@ -184,43 +228,9 @@
|
|
|
184
228
|
position: absolute;
|
|
185
229
|
inset: auto config.$space-3x config.$space-3x auto;
|
|
186
230
|
}
|
|
187
|
-
}
|
|
188
|
-
// Desktop case
|
|
189
|
-
@media only screen and (min-width: breakpoints.$large) {
|
|
190
|
-
thead {
|
|
191
|
-
display: flex;
|
|
192
|
-
}
|
|
193
|
-
tr {
|
|
194
|
-
flex-direction: row;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
th,
|
|
198
|
-
td {
|
|
199
|
-
display: flex;
|
|
200
|
-
justify-content: flex-start;
|
|
201
|
-
align-items: center;
|
|
202
|
-
flex: 2;
|
|
203
|
-
}
|
|
204
|
-
th.actions {
|
|
205
|
-
justify-content: center;
|
|
206
|
-
flex: 1;
|
|
207
|
-
}
|
|
208
|
-
td {
|
|
209
|
-
padding: config.$space-5x config.$space-3x;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
td.actions {
|
|
213
|
-
order: 0;
|
|
214
|
-
justify-content: center;
|
|
215
|
-
flex: 1;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
td:has(.badge) {
|
|
219
|
-
gap: config.$space-2x;
|
|
220
|
-
}
|
|
221
231
|
|
|
222
232
|
.alignment-right {
|
|
223
|
-
justify-content: flex-
|
|
233
|
+
justify-content: flex-start;
|
|
224
234
|
}
|
|
225
235
|
}
|
|
226
236
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17 2h-1V0h-2v2H6V0H4v2H3c-1.11 0-1.99.9-1.99 2L1 18a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Zm0 16H3V8h14v10Zm0-12H3V4h14v2Zm-7 5h5v5h-5v-5Z" fill="#444"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M.91 13.167h18.18V15H.91v-1.833Zm1.045-3.713.772-1.357.773 1.357 1.182-.687-.773-1.357h1.546V6.035H3.909l.773-1.348L3.5 4l-.773 1.348L1.955 4l-1.182.688.772 1.347H0V7.41h1.545L.773 8.767l1.182.687Zm6.09-.687 1.182.687L10 8.097l.773 1.357 1.181-.687-.772-1.357h1.545V6.035h-1.545l.772-1.348L10.773 4 10 5.348 9.227 4l-1.182.688.773 1.347H7.273V7.41h1.545l-.773 1.357ZM20 6.035h-1.546l.773-1.348L18.046 4l-.773 1.348L16.5 4l-1.182.688.773 1.347h-1.546V7.41h1.546l-.773 1.357 1.182.687.773-1.357.773 1.357 1.181-.687-.773-1.357H20V6.035Z" fill="#444"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><g clip-path="url(#client__a)"><path d="M10 2.375a2.625 2.625 0 1 1 0 5.25 2.625 2.625 0 0 1 0-5.25Zm0 11.25c3.713 0 7.625 1.825 7.625 2.625v1.375H2.375V16.25c0-.8 3.912-2.625 7.625-2.625ZM10 0C7.237 0 5 2.237 5 5s2.237 5 5 5c2.762 0 5-2.237 5-5s-2.238-5-5-5Zm0 11.25c-3.338 0-10 1.675-10 5V20h20v-3.75c0-3.325-6.662-5-10-5Z" fill="#444"/></g><defs><clipPath id="client__a"><path fill="#fff" d="M0 0h20v20H0z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><g clip-path="url(#comment__a)"><path d="M19.99 2c0-1.1-.89-2-1.99-2H2C.9 0 0 .9 0 2v12c0 1.1.9 2 2 2h14l4 4-.01-18ZM18 2v13.17L16.83 14H2V2h16ZM4 10h12v2H4v-2Zm0-3h12v2H4V7Zm0-3h12v2H4V4Z" fill="#444"/></g><defs><clipPath id="comment__a"><path fill="#fff" d="M0 0h20v20H0z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.907 19 20 16.885 13.201 10 20 3.115 17.907 1 9 10l8.907 9Z" fill="#444"/><path d="M8.907 19 11 16.885 4.201 10 11 3.115 8.907 1 0 10l8.907 9Z" fill="#444"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.093 1 0 3.115 6.799 10 0 16.885 2.093 19 11 10 2.093 1Z" fill="#444"/><path d="M11.093 1 9 3.115 15.799 10 9 16.885 11.093 19 20 10l-8.907-9Z" fill="#444"/></svg>
|
package/src/icons/export.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#export__a)"><path d="M17.5 13.75v3.75h-15v-3.75H0v3.75C0 18.875 1.125 20 2.5 20h15c1.375 0 2.5-1.125 2.5-2.5v-3.75h-2.5ZM3.75 6.25l1.763 1.762L8.75 4.787V15h2.5V4.787l3.238 3.225L16.25 6.25 10 0 3.75 6.25Z" fill="#444"/></g><defs><clipPath id="export__a"><path fill="#fff" d="M0 0h20v20H0z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 13.75v3.75h-15v-3.75H0v3.75C0 18.875 1.125 20 2.5 20h15c1.375 0 2.5-1.125 2.5-2.5v-3.75h-2.5Zm-1.25-5-1.762-1.763-3.238 3.226V0h-2.5v10.213L5.513 6.988 3.75 8.75 10 15l6.25-6.25Z" fill="#444"/></svg>
|
package/src/icons/index.tsx
CHANGED
|
@@ -4,20 +4,31 @@ import AngleDown from './angle-down.svg'
|
|
|
4
4
|
import AngleLeft from './angle-left.svg'
|
|
5
5
|
import AngleRight from './angle-right.svg'
|
|
6
6
|
import AngleUp from './angle-up.svg'
|
|
7
|
+
import Calendar from './calendar.svg'
|
|
7
8
|
import Check from './check.svg'
|
|
8
9
|
import CheckboxActive from './checkbox-active.svg'
|
|
9
10
|
import CheckboxInactive from './checkbox-inactive.svg'
|
|
11
|
+
import ChangePassword from './change-password.svg'
|
|
12
|
+
import Client from './client.svg'
|
|
10
13
|
import Close from './close.svg'
|
|
14
|
+
import Comment from './comment.svg'
|
|
11
15
|
import Delete from './delete.svg'
|
|
12
16
|
import Done from './done.svg'
|
|
17
|
+
import DoubleArrowLeft from './double-arrow-left.svg'
|
|
18
|
+
import DoubleArrowRight from './double-arrow-right.svg'
|
|
13
19
|
import Edit from './edit.svg'
|
|
14
20
|
import EditColumns from './edit-columns.svg'
|
|
15
21
|
import EmptyState from './empty-customize.svg'
|
|
16
22
|
import Error from './error.svg'
|
|
17
23
|
import Export from './export.svg'
|
|
24
|
+
import Import from './import.svg'
|
|
18
25
|
import Info from './info.svg'
|
|
19
26
|
import Loading from './loading.svg'
|
|
27
|
+
import Logout from './logout.svg'
|
|
28
|
+
import Product from './product.svg'
|
|
29
|
+
import Salesman from './salesman.svg'
|
|
20
30
|
import Search from './search.svg'
|
|
31
|
+
import Settings from './settings.svg'
|
|
21
32
|
import Show from './show.svg'
|
|
22
33
|
import ShowOff from './show-off.svg'
|
|
23
34
|
import Sorter from './sorter.svg'
|
|
@@ -30,20 +41,31 @@ export {
|
|
|
30
41
|
AngleLeft,
|
|
31
42
|
AngleRight,
|
|
32
43
|
AngleUp,
|
|
44
|
+
Calendar,
|
|
45
|
+
ChangePassword,
|
|
33
46
|
Check,
|
|
34
47
|
CheckboxActive,
|
|
35
48
|
CheckboxInactive,
|
|
49
|
+
Client,
|
|
36
50
|
Close,
|
|
51
|
+
Comment,
|
|
37
52
|
Delete,
|
|
38
53
|
Done,
|
|
54
|
+
DoubleArrowLeft,
|
|
55
|
+
DoubleArrowRight,
|
|
39
56
|
Edit,
|
|
40
57
|
EditColumns,
|
|
41
58
|
EmptyState,
|
|
42
59
|
Error,
|
|
43
60
|
Export,
|
|
61
|
+
Import,
|
|
44
62
|
Info,
|
|
45
63
|
Loading,
|
|
64
|
+
Logout,
|
|
65
|
+
Product,
|
|
66
|
+
Salesman,
|
|
46
67
|
Search,
|
|
68
|
+
Settings,
|
|
47
69
|
Show,
|
|
48
70
|
ShowOff,
|
|
49
71
|
Sorter,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#logout__a)"><path d="m15.556 5.556-1.567 1.566 1.755 1.767H6.667v2.222h9.077l-1.755 1.756 1.567 1.577L20 10l-4.444-4.444ZM2.222 2.222H10V0H2.222C1 0 0 1 0 2.222v15.556C0 19 1 20 2.222 20H10v-2.222H2.222V2.222Z" fill="#444"/></g><defs><clipPath id="logout__a"><path fill="#fff" d="M0 0h20v20H0z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#product__a)" fill="#444"><path d="M11.404 0H8.596v2.922h2.808V0Zm0 4.832V3.596H8.596v1.236c0 1.46-2.023 2.022-2.023 4.607v9.606c0 .528.428.955.955.955h4.944a.955.955 0 0 0 .955-.955V9.439c0-2.585-2.023-3.147-2.023-4.607Zm.45 11.91H8.146V9.325h3.708v7.415Z"/></g><defs><clipPath id="product__a"><path fill="#fff" d="M0 0h20v20H0z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18.333 2.5H1.667C.75 2.5 0 3.25 0 4.167v11.666C0 16.75.75 17.5 1.667 17.5h16.666c.917 0 1.659-.75 1.659-1.667L20 4.167c0-.917-.75-1.667-1.667-1.667Zm0 13.333H1.667V4.167h16.666v11.666ZM7.5 10C8.875 10 10 8.875 10 7.5S8.875 5 7.5 5A2.507 2.507 0 0 0 5 7.5C5 8.875 6.125 10 7.5 10Zm0-3.333c.458 0 .833.375.833.833a.836.836 0 0 1-.833.833.836.836 0 0 1-.833-.833c0-.458.375-.833.833-.833Zm5 7.158c0-2.083-3.308-2.983-5-2.983-1.692 0-5 .9-5 2.983V15h10v-1.175Zm-7.933-.492c.616-.416 1.85-.833 2.933-.833 1.083 0 2.308.408 2.933.833H4.567Z" fill="#444"/><path d="M17.5 7.5h-4.583v1.25H17.5V7.5Zm0 2.5h-4.583v1.25H17.5V10Z" fill="#444"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#settings__a)"><path d="M17.64 10.98c.042-.32.073-.64.073-.98 0-.34-.031-.66-.072-.98l2.169-1.65a.495.495 0 0 0 .123-.64l-2.056-3.46a.517.517 0 0 0-.452-.25.492.492 0 0 0-.175.03l-2.56 1c-.534-.4-1.11-.73-1.737-.98l-.39-2.65a.497.497 0 0 0-.505-.42H7.946a.497.497 0 0 0-.504.42l-.39 2.65a7.97 7.97 0 0 0-1.738.98l-2.56-1a.597.597 0 0 0-.185-.03c-.174 0-.35.09-.442.25L.071 6.73a.484.484 0 0 0 .124.64l2.169 1.65a7.74 7.74 0 0 0-.072.98c0 .33.03.66.072.98l-2.17 1.65a.495.495 0 0 0-.123.64l2.056 3.46c.093.16.268.25.453.25.061 0 .123-.01.175-.03l2.56-1c.534.4 1.11.73 1.737.98l.39 2.65c.031.24.247.42.504.42h4.112c.257 0 .473-.18.504-.42l.39-2.65a7.955 7.955 0 0 0 1.738-.98l2.56 1c.062.02.123.03.185.03a.51.51 0 0 0 .442-.25l2.056-3.46a.495.495 0 0 0-.123-.64l-2.17-1.65Zm-2.035-1.71c.041.31.052.52.052.73 0 .21-.021.43-.052.73l-.144 1.13.915.7 1.11.84-.72 1.21-1.305-.51-1.069-.42-.925.68c-.442.32-.864.56-1.285.73l-1.09.43-.165 1.13-.205 1.35h-1.44l-.195-1.35-.164-1.13-1.09-.43a5.876 5.876 0 0 1-1.264-.71l-.936-.7-1.09.43-1.305.51-.72-1.21 1.11-.84.915-.7-.144-1.13a8.1 8.1 0 0 1-.051-.74c0-.2.02-.43.051-.73l.144-1.13-.915-.7-1.11-.84.72-1.21 1.305.51 1.07.42.925-.68a6.05 6.05 0 0 1 1.285-.73l1.09-.43.164-1.13L9.283 2h1.429l.195 1.35.164 1.13 1.09.43c.442.18.854.41 1.265.71l.935.7 1.09-.43 1.306-.51.72 1.21-1.1.85-.916.7.144 1.13ZM10.002 6C7.73 6 5.89 7.79 5.89 10s1.84 4 4.112 4c2.272 0 4.112-1.79 4.112-4s-1.84-4-4.112-4Zm0 6c-1.13 0-2.056-.9-2.056-2s.925-2 2.056-2 2.056.9 2.056 2-.925 2-2.056 2Z" fill="#444"/></g><defs><clipPath id="settings__a"><path fill="#fff" d="M0 0h20v20H0z"/></clipPath></defs></svg>
|
|
@@ -399,7 +399,13 @@ export const Primary = {
|
|
|
399
399
|
/>
|
|
400
400
|
</CardHeader>
|
|
401
401
|
<CardContent>
|
|
402
|
-
<p>
|
|
402
|
+
<p>
|
|
403
|
+
TEKKEN 8 will feature exciting new gameplay focused on “Aggressive”
|
|
404
|
+
tactics. Retaining TEKKEN's unique fighting game identity, the game
|
|
405
|
+
will provide both players and spectators with the series' most
|
|
406
|
+
thrilling experience yet with visceral screen-jarring attacks and
|
|
407
|
+
environments that are both dynamic and destructible.
|
|
408
|
+
</p>
|
|
403
409
|
</CardContent>
|
|
404
410
|
<CardFooter>
|
|
405
411
|
<Button variant="primary-outlined" label="Add to wishlist" />
|
|
@@ -412,12 +418,18 @@ export const Primary = {
|
|
|
412
418
|
export const Disabled = {
|
|
413
419
|
render: () => (
|
|
414
420
|
<div style={{ display: 'flex' }}>
|
|
415
|
-
<Card isDisabled
|
|
421
|
+
<Card isDisabled variant="primary">
|
|
416
422
|
<CardHeader title="Tekken 8">
|
|
417
423
|
<IconButton disabled icon="Delete" accessibilityLabel="Delete game" />
|
|
418
424
|
</CardHeader>
|
|
419
425
|
<CardContent>
|
|
420
|
-
<p>
|
|
426
|
+
<p>
|
|
427
|
+
TEKKEN 8 will feature exciting new gameplay focused on “Aggressive”
|
|
428
|
+
tactics. Retaining TEKKEN's unique fighting game identity, the game
|
|
429
|
+
will provide both players and spectators with the series' most
|
|
430
|
+
thrilling experience yet with visceral screen-jarring attacks and
|
|
431
|
+
environments that are both dynamic and destructible.
|
|
432
|
+
</p>
|
|
421
433
|
</CardContent>
|
|
422
434
|
<CardFooter>
|
|
423
435
|
<Button variant="primary-outlined" disabled label="Add to wishlist" />
|
|
@@ -426,3 +438,15 @@ export const Disabled = {
|
|
|
426
438
|
</div>
|
|
427
439
|
),
|
|
428
440
|
}
|
|
441
|
+
|
|
442
|
+
export const Active = {
|
|
443
|
+
render: () => (
|
|
444
|
+
<div style={{ display: 'flex' }}>
|
|
445
|
+
<Card isActive>
|
|
446
|
+
<CardHeader title="Fallout 3">
|
|
447
|
+
<IconButton icon="Delete" accessibilityLabel="Delete game" />
|
|
448
|
+
</CardHeader>
|
|
449
|
+
</Card>
|
|
450
|
+
</div>
|
|
451
|
+
),
|
|
452
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import { CardMenu, CardMenuOption } from '../atoms/CardMenu'
|
|
4
|
+
import { isErrored } from 'stream'
|
|
4
5
|
|
|
5
6
|
const figmaPrimaryDesign = {
|
|
6
7
|
design: {
|
|
@@ -29,11 +30,14 @@ const meta = {
|
|
|
29
30
|
description: {
|
|
30
31
|
description: 'Component description text',
|
|
31
32
|
},
|
|
32
|
-
|
|
33
|
+
disabled: {
|
|
33
34
|
description: 'Is the component disabled?',
|
|
34
35
|
},
|
|
35
|
-
|
|
36
|
-
description: '
|
|
36
|
+
active: {
|
|
37
|
+
description: 'Is the component active?',
|
|
38
|
+
},
|
|
39
|
+
error: {
|
|
40
|
+
description: 'Is the component error?',
|
|
37
41
|
},
|
|
38
42
|
},
|
|
39
43
|
parameters: figmaPrimaryDesign,
|
|
@@ -45,12 +49,11 @@ export const Option = {
|
|
|
45
49
|
render: () => (
|
|
46
50
|
<CardMenuOption
|
|
47
51
|
id="first-menu-option"
|
|
52
|
+
href="#"
|
|
48
53
|
icon="Info"
|
|
49
54
|
variant="primary"
|
|
50
55
|
title="It's dangerous to go alone!"
|
|
51
56
|
description="Take this 🗡️ and this 🛡️ and this 💣 and this 🏹 and this 🔪 and this 🐴 and this 🔫 and this 🔪"
|
|
52
|
-
isDisabled={false}
|
|
53
|
-
onClick={() => alert('click')}
|
|
54
57
|
/>
|
|
55
58
|
),
|
|
56
59
|
}
|
|
@@ -59,6 +62,7 @@ export const DisabledOption = {
|
|
|
59
62
|
render: () => (
|
|
60
63
|
<CardMenuOption
|
|
61
64
|
id="first-menu-option"
|
|
65
|
+
href="#"
|
|
62
66
|
icon="Info"
|
|
63
67
|
variant="primary"
|
|
64
68
|
title="It's dangerous to go alone!"
|
|
@@ -68,35 +72,60 @@ export const DisabledOption = {
|
|
|
68
72
|
),
|
|
69
73
|
}
|
|
70
74
|
|
|
75
|
+
export const ActiveOption = {
|
|
76
|
+
render: () => (
|
|
77
|
+
<CardMenuOption
|
|
78
|
+
id="first-menu-option"
|
|
79
|
+
href="#"
|
|
80
|
+
icon="Info"
|
|
81
|
+
variant="primary"
|
|
82
|
+
title="It's dangerous to go alone!"
|
|
83
|
+
description="Take this 🗡️"
|
|
84
|
+
active
|
|
85
|
+
/>
|
|
86
|
+
),
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const ErrorOption = {
|
|
90
|
+
render: () => (
|
|
91
|
+
<CardMenuOption
|
|
92
|
+
id="first-menu-option"
|
|
93
|
+
href="#"
|
|
94
|
+
icon="Info"
|
|
95
|
+
variant="primary"
|
|
96
|
+
title="It's dangerous to go alone!"
|
|
97
|
+
description="Take this 🗡️"
|
|
98
|
+
error
|
|
99
|
+
/>
|
|
100
|
+
),
|
|
101
|
+
}
|
|
102
|
+
|
|
71
103
|
export const Menu = {
|
|
72
104
|
render: () => (
|
|
73
105
|
<CardMenu>
|
|
74
106
|
<CardMenuOption
|
|
75
107
|
id="first-menu-option"
|
|
108
|
+
href="#"
|
|
76
109
|
icon="AddCircle"
|
|
77
110
|
variant="primary"
|
|
78
111
|
title="Title"
|
|
79
112
|
description="Name of the videogame"
|
|
80
|
-
isDisabled={false}
|
|
81
|
-
onClick={() => alert('click title')}
|
|
82
113
|
/>
|
|
83
114
|
<CardMenuOption
|
|
84
115
|
id="second-menu-option"
|
|
116
|
+
href="#"
|
|
85
117
|
icon="Edit"
|
|
86
118
|
variant="primary"
|
|
87
119
|
title="Address"
|
|
88
120
|
description="Videogame company address"
|
|
89
|
-
isDisabled={false}
|
|
90
|
-
onClick={() => alert('click address')}
|
|
91
121
|
/>
|
|
92
122
|
<CardMenuOption
|
|
93
123
|
id="third-menu-option"
|
|
124
|
+
href="#"
|
|
94
125
|
icon="Info"
|
|
95
126
|
variant="primary"
|
|
96
127
|
title="Email"
|
|
97
128
|
description="Videogame company email"
|
|
98
|
-
isDisabled={false}
|
|
99
|
-
onClick={() => alert('click email')}
|
|
100
129
|
/>
|
|
101
130
|
</CardMenu>
|
|
102
131
|
),
|
|
@@ -64,7 +64,8 @@ export const WithSorting: Story = {
|
|
|
64
64
|
name: 'Metal Gear Solid 5: The Phantom Pain',
|
|
65
65
|
address:
|
|
66
66
|
'Konami Digital Entertainment Co., Ltd. 1-11-1, Ginza, Chuo-ku, Tokyo, 104-0061 Japan',
|
|
67
|
-
email:
|
|
67
|
+
email:
|
|
68
|
+
'konami@fakemailreallyreallyreallyreallyreallyreallyreallyreallyreallylongemail.com',
|
|
68
69
|
},
|
|
69
70
|
},
|
|
70
71
|
{
|
|
@@ -3,6 +3,17 @@ import { Meta } from "@storybook/addon-docs";
|
|
|
3
3
|
<Meta title="Changelog" />
|
|
4
4
|
# Changelog
|
|
5
5
|
|
|
6
|
+
|
|
7
|
+
## 0.16.2
|
|
8
|
+
- Add link to CardMenuOption component
|
|
9
|
+
- Add active and error state to CardMenuOption component
|
|
10
|
+
|
|
11
|
+
## 0.16.1
|
|
12
|
+
- Updated Oultined Button background color
|
|
13
|
+
- Added new icons
|
|
14
|
+
- Added fix to Alert component button
|
|
15
|
+
- Fixed responsive glitch bug on CardsTable components
|
|
16
|
+
|
|
6
17
|
## 0.16.0
|
|
7
18
|
- Added new shape for FloatingButton component
|
|
8
19
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
3
|
import { CardMenuOption } from '@/atoms/CardMenu/CardMenuOption'
|
|
4
4
|
|
|
5
5
|
describe('CardMenuOption', () => {
|
|
@@ -7,6 +7,7 @@ describe('CardMenuOption', () => {
|
|
|
7
7
|
const { getByRole, getByText, getAllByRole } = render(
|
|
8
8
|
<CardMenuOption
|
|
9
9
|
id="option-one"
|
|
10
|
+
href="#"
|
|
10
11
|
icon="Info"
|
|
11
12
|
title="It's dangerous to go alone!"
|
|
12
13
|
description="Take this sword!"
|