agroptima-design-system 0.24.2 → 0.24.4-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
CHANGED
|
@@ -10,6 +10,7 @@ export interface CollapsibleProps
|
|
|
10
10
|
variant?: Variant
|
|
11
11
|
name?: string
|
|
12
12
|
disabled?: boolean
|
|
13
|
+
noHorizontalPadding: boolean
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export function Collapsible({
|
|
@@ -19,12 +20,16 @@ export function Collapsible({
|
|
|
19
20
|
children,
|
|
20
21
|
disabled,
|
|
21
22
|
name,
|
|
23
|
+
noHorizontalPadding = false,
|
|
22
24
|
...props
|
|
23
25
|
}: CollapsibleProps): React.JSX.Element {
|
|
24
26
|
const cssClasses = classNames('collapsible', variant, className, {
|
|
25
27
|
open: props.open,
|
|
26
28
|
disabled: disabled,
|
|
27
29
|
})
|
|
30
|
+
const contentCssClasses = classNames('content', {
|
|
31
|
+
'no-horizontal-padding': noHorizontalPadding,
|
|
32
|
+
})
|
|
28
33
|
|
|
29
34
|
return (
|
|
30
35
|
<details name={name} className={cssClasses} {...props}>
|
|
@@ -32,7 +37,7 @@ export function Collapsible({
|
|
|
32
37
|
<Icon className="arrow" name="AngleRight" />
|
|
33
38
|
<span className="title">{title}</span>
|
|
34
39
|
</summary>
|
|
35
|
-
<div className=
|
|
40
|
+
<div className={contentCssClasses}>{children}</div>
|
|
36
41
|
</details>
|
|
37
42
|
)
|
|
38
43
|
}
|
package/src/atoms/Modal.scss
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
inset: 0;
|
|
10
10
|
z-index: depth.$z-modal;
|
|
11
11
|
margin: config.$space-4x;
|
|
12
|
+
margin-top: 3rem;
|
|
12
13
|
|
|
13
14
|
.backdrop {
|
|
14
15
|
position: fixed;
|
|
@@ -19,13 +20,13 @@
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
.modal {
|
|
22
|
-
top: 6.25rem;
|
|
23
23
|
margin: auto;
|
|
24
24
|
display: flex;
|
|
25
25
|
position: relative;
|
|
26
26
|
padding: config.$space-5x;
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
align-items: flex-start;
|
|
29
|
+
justify-content: space-between;
|
|
29
30
|
gap: config.$space-2x;
|
|
30
31
|
flex-grow: 1;
|
|
31
32
|
border-radius: config.$corner-radius-xxs;
|
|
@@ -36,37 +37,50 @@
|
|
|
36
37
|
0px 6px 16px 0px rgba(0, 0, 0, 0.08),
|
|
37
38
|
0px 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
38
39
|
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
.scroll-area {
|
|
41
|
+
width: 100%;
|
|
42
|
+
padding-left: config.$space-halfx;
|
|
43
|
+
padding-right: config.$space-halfx;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
overflow-anchor: none;
|
|
46
|
+
|
|
47
|
+
.header {
|
|
48
|
+
display: flex;
|
|
49
|
+
gap: config.$space-2x;
|
|
50
|
+
align-items: flex-start;
|
|
51
|
+
|
|
52
|
+
.icon {
|
|
53
|
+
margin-top: 4px;
|
|
54
|
+
min-width: config.$icon-size-5x;
|
|
55
|
+
width: config.$icon-size-5x;
|
|
56
|
+
height: config.$icon-size-5x;
|
|
57
|
+
> svg {
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.title {
|
|
64
|
+
@include typography.h4;
|
|
52
65
|
}
|
|
53
66
|
}
|
|
54
67
|
|
|
55
|
-
.
|
|
56
|
-
|
|
68
|
+
.divider {
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 1px;
|
|
71
|
+
background: color_alias.$neutral-color-200;
|
|
72
|
+
margin-bottom: config.$space-2x;
|
|
57
73
|
}
|
|
58
|
-
}
|
|
59
74
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
margin-bottom: config.$space-2x;
|
|
75
|
+
.body {
|
|
76
|
+
@include typography.body-regular-primary;
|
|
77
|
+
width: 100%;
|
|
78
|
+
}
|
|
65
79
|
}
|
|
66
80
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
&.details {
|
|
82
|
+
max-width: 50rem;
|
|
83
|
+
height: 100%;
|
|
70
84
|
}
|
|
71
85
|
|
|
72
86
|
.footer {
|
|
@@ -76,14 +90,6 @@
|
|
|
76
90
|
margin-top: config.$space-2x;
|
|
77
91
|
}
|
|
78
92
|
|
|
79
|
-
&.details {
|
|
80
|
-
max-width: 50rem;
|
|
81
|
-
min-height: 400px;
|
|
82
|
-
max-height: 90vh;
|
|
83
|
-
overflow-y: auto;
|
|
84
|
-
overflow-anchor: none;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
93
|
&.info {
|
|
88
94
|
.header {
|
|
89
95
|
.icon {
|
|
@@ -153,7 +159,6 @@
|
|
|
153
159
|
// Mobile & tablet cases
|
|
154
160
|
@media only screen and (max-width: breakpoints.$large) {
|
|
155
161
|
&.details {
|
|
156
|
-
top: 3rem;
|
|
157
162
|
}
|
|
158
163
|
}
|
|
159
164
|
}
|
package/src/atoms/Modal.tsx
CHANGED
|
@@ -47,17 +47,19 @@ export function Modal({
|
|
|
47
47
|
className={cssClasses}
|
|
48
48
|
{...props}
|
|
49
49
|
>
|
|
50
|
-
<div className="
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{title}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
50
|
+
<div className="scroll-area">
|
|
51
|
+
<div className="header">
|
|
52
|
+
{variant !== 'details' && (
|
|
53
|
+
<Icon name={IconVariant[variant]} className={variant} />
|
|
54
|
+
)}
|
|
55
|
+
<h4 id={`${id}-title`} className="title">
|
|
56
|
+
{title}
|
|
57
|
+
</h4>
|
|
58
|
+
</div>
|
|
59
|
+
{variant === 'details' && <div className="divider" />}
|
|
60
|
+
<div id={`${id}-body`} className="body">
|
|
61
|
+
{children}
|
|
62
|
+
</div>
|
|
61
63
|
</div>
|
|
62
64
|
<div className="footer">
|
|
63
65
|
{buttons.map(({ ...button }) => (
|
|
@@ -3,6 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import { Collapsible } from '../atoms/Collapsible'
|
|
4
4
|
import { Input } from '../atoms/Input'
|
|
5
5
|
import { Select } from '../atoms/Select'
|
|
6
|
+
import { Card } from '../atoms/Card'
|
|
6
7
|
|
|
7
8
|
const figmaPrimaryDesign = {
|
|
8
9
|
design: {
|
|
@@ -155,6 +156,15 @@ export const PrimaryOpened = {
|
|
|
155
156
|
<Collapsible title="Another data" name="another-data">
|
|
156
157
|
<Input label="Another data" name="anotherData" placeholder="..." />
|
|
157
158
|
</Collapsible>
|
|
159
|
+
<Collapsible
|
|
160
|
+
noHorizontalPadding
|
|
161
|
+
title="Important information"
|
|
162
|
+
name="no-horizontal-padding-example"
|
|
163
|
+
>
|
|
164
|
+
<Card>
|
|
165
|
+
<p>Not available</p>
|
|
166
|
+
</Card>
|
|
167
|
+
</Collapsible>
|
|
158
168
|
</>
|
|
159
169
|
),
|
|
160
170
|
}
|
|
@@ -3,6 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import { Modal } from '../atoms/Modal'
|
|
4
4
|
import { DetailItem } from '@/atoms/DetailItem'
|
|
5
5
|
import { Collapsible } from '@/atoms/Collapsible'
|
|
6
|
+
import { Card } from '@/atoms/Card'
|
|
6
7
|
|
|
7
8
|
const figmaPrimaryDesign = {
|
|
8
9
|
design: {
|
|
@@ -156,6 +157,12 @@ export const Details = {
|
|
|
156
157
|
<p>RPG genre</p>
|
|
157
158
|
<p>1 player</p>
|
|
158
159
|
</Collapsible>
|
|
160
|
+
<Collapsible noHorizontalPadding open title="Other related games">
|
|
161
|
+
<Card>
|
|
162
|
+
<p>Final Fantasy IX</p>
|
|
163
|
+
<p>Final Fantasy X</p>
|
|
164
|
+
</Card>
|
|
165
|
+
</Collapsible>
|
|
159
166
|
<DetailItem style={{ marginTop: '10px' }} align="right" title="Price">
|
|
160
167
|
59,95 €
|
|
161
168
|
</DetailItem>
|