agroptima-design-system 0.26.5 → 0.26.6
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
|
+
form?: boolean
|
|
13
14
|
noHorizontalPadding?: boolean
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -20,6 +21,7 @@ export function Collapsible({
|
|
|
20
21
|
children,
|
|
21
22
|
disabled,
|
|
22
23
|
name,
|
|
24
|
+
form = false,
|
|
23
25
|
noHorizontalPadding = false,
|
|
24
26
|
...props
|
|
25
27
|
}: CollapsibleProps): React.JSX.Element {
|
|
@@ -29,6 +31,7 @@ export function Collapsible({
|
|
|
29
31
|
})
|
|
30
32
|
const contentCssClasses = classNames('content', {
|
|
31
33
|
'no-horizontal-padding': noHorizontalPadding,
|
|
34
|
+
form: form,
|
|
32
35
|
})
|
|
33
36
|
|
|
34
37
|
return (
|
package/src/atoms/Form/Form.scss
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
@use '../../settings/breakpoints';
|
|
3
3
|
@use '../../settings/color_alias';
|
|
4
4
|
|
|
5
|
+
$gap: config.$space-4x;
|
|
6
|
+
|
|
5
7
|
.form {
|
|
6
8
|
display: flex;
|
|
7
9
|
flex-direction: column;
|
|
8
10
|
margin: 0 auto;
|
|
9
|
-
gap:
|
|
11
|
+
gap: $gap;
|
|
10
12
|
padding: 0;
|
|
11
13
|
|
|
12
14
|
width: breakpoints.$medium;
|
|
@@ -25,7 +27,7 @@
|
|
|
25
27
|
.footer-actions {
|
|
26
28
|
display: flex;
|
|
27
29
|
justify-content: flex-end;
|
|
28
|
-
gap:
|
|
30
|
+
gap: $gap;
|
|
29
31
|
|
|
30
32
|
flex-direction: row;
|
|
31
33
|
padding: config.$space-3x config.$space-5x;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { Collapsible } from '@/atoms/Collapsible'
|
|
3
|
+
import { Input } from '@/atoms/Input'
|
|
4
|
+
import { Select } from '@/atoms/Select'
|
|
5
|
+
import { Card } from '@/atoms/Card'
|
|
6
|
+
import { Form as FormComponent, Actions } from '@/atoms/Form'
|
|
7
|
+
import { Button } from '@/atoms/Button'
|
|
7
8
|
|
|
8
9
|
const figmaPrimaryDesign = {
|
|
9
10
|
design: {
|
|
@@ -219,3 +220,18 @@ export const PrimaryDisabled = {
|
|
|
219
220
|
</Collapsible>
|
|
220
221
|
),
|
|
221
222
|
}
|
|
223
|
+
|
|
224
|
+
export const Form = {
|
|
225
|
+
render: () => (
|
|
226
|
+
<FormComponent>
|
|
227
|
+
<Collapsible open form title="User">
|
|
228
|
+
<Input label="First Name" placeholder="First Name" name="firstName" />
|
|
229
|
+
<Input label="Last Name" placeholder="Last Name" name="lastName" />
|
|
230
|
+
<Actions>
|
|
231
|
+
<Button type="button" label="Cancel" variant="primary-outlined" />
|
|
232
|
+
<Button type="submit" label="Sign in" variant="primary" />
|
|
233
|
+
</Actions>
|
|
234
|
+
</Collapsible>
|
|
235
|
+
</FormComponent>
|
|
236
|
+
),
|
|
237
|
+
}
|