@raketa-builder/next-form 0.2.0 → 0.4.0
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/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-lint.log +12 -12
- package/CHANGELOG.md +6 -0
- package/dist/index.js +474 -740
- package/package.json +1 -2
- package/src/Fields.js +1 -1
- package/src/Fieldset.js +32 -42
- package/src/FormNavigation.js +10 -27
- package/src/styles.css +67 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raketa-builder/next-form",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"dev": "tsup src/index.js --format cjs --loader \".js=jsx\" --watch"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"styled-components": "^5.1.0",
|
|
14
13
|
"react": "18.2.0",
|
|
15
14
|
"react-dom": "18.2.0"
|
|
16
15
|
},
|
package/src/Fields.js
CHANGED
package/src/Fieldset.js
CHANGED
|
@@ -1,48 +1,38 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import { reset } from "@raketa-builder/ui";
|
|
2
|
+
import { cn } from "@raketa-builder/ui";
|
|
4
3
|
import slugify from "./utils/slugify";
|
|
5
4
|
|
|
6
|
-
const Wrapper =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const Description = styled.small`
|
|
38
|
-
${reset};
|
|
39
|
-
opacity: 0.5;
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
const FieldWrapper = styled.div`
|
|
43
|
-
${reset};
|
|
44
|
-
width: 100%;
|
|
45
|
-
`;
|
|
5
|
+
const Wrapper = ({ className, ...rest }) => (
|
|
6
|
+
<div
|
|
7
|
+
className={cn("r-reset", "r-next-form-fieldset-wrapper", className)}
|
|
8
|
+
{...rest}
|
|
9
|
+
/>
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
const LegendWrapper = ({ className, ...rest }) => (
|
|
13
|
+
<div
|
|
14
|
+
className={cn("r-reset", "r-next-form-legend-wrapper", className)}
|
|
15
|
+
{...rest}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const Legend = ({ className, ...rest }) => (
|
|
20
|
+
<div className={cn("r-reset", "r-next-form-legend", className)} {...rest} />
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const Description = ({ className, ...rest }) => (
|
|
24
|
+
<div
|
|
25
|
+
className={cn("r-reset", "r-next-form-description", className)}
|
|
26
|
+
{...rest}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const FieldWrapper = ({ className, ...rest }) => (
|
|
31
|
+
<div
|
|
32
|
+
className={cn("r-reset", "r-next-form-field-wrapper", className)}
|
|
33
|
+
{...rest}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
46
36
|
|
|
47
37
|
const Fieldset = ({ label, description, children }) => (
|
|
48
38
|
<Wrapper id={slugify(label)}>
|
package/src/FormNavigation.js
CHANGED
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import { reset } from "@raketa-builder/ui";
|
|
2
|
+
import { cn } from "@raketa-builder/ui";
|
|
4
3
|
import slugify from "./utils/slugify";
|
|
5
4
|
|
|
6
|
-
const Wrapper =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@media (max-width: 1183px) {
|
|
13
|
-
margin-bottom: 2em;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@media (min-width: 1184px) {
|
|
17
|
-
position: sticky;
|
|
18
|
-
top: 80px;
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
const Link = styled.a`
|
|
23
|
-
${reset};
|
|
24
|
-
color: ${(props) => props.theme.colors.primary};
|
|
25
|
-
font-weight: 500;
|
|
26
|
-
text-decoration: none;
|
|
5
|
+
const Wrapper = ({ className, ...rest }) => (
|
|
6
|
+
<div
|
|
7
|
+
className={cn("r-reset", "r-next-form-nav-wrapper", className)}
|
|
8
|
+
{...rest}
|
|
9
|
+
/>
|
|
10
|
+
);
|
|
27
11
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
`;
|
|
12
|
+
const Link = ({ className, ...rest }) => (
|
|
13
|
+
<a className={cn("r-reset", "r-next-form-nav-link", className)} {...rest} />
|
|
14
|
+
);
|
|
32
15
|
|
|
33
16
|
const FormNavigation = ({ sections, children }) => (
|
|
34
17
|
<Wrapper>
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@layer raketa-builder {
|
|
2
|
+
.r-fieldset-wrapper {
|
|
3
|
+
margin: 0;
|
|
4
|
+
margin-bottom: 2em;
|
|
5
|
+
padding: 0;
|
|
6
|
+
border: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.r-next-form-legend {
|
|
10
|
+
margin-bottom: 1em;
|
|
11
|
+
font-weight: 700;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.r-next-form-description {
|
|
15
|
+
opacity: 0.5;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.r-next-form-field-wrapper {
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.r-next-form-nav-wrapper {
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 1em;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.r-next-form-nav-link {
|
|
29
|
+
color: var(--r-primary);
|
|
30
|
+
font-weight: 500;
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.r-next-form-nav-link:hover {
|
|
35
|
+
text-decoration: underline;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (min-width: 1184px) {
|
|
39
|
+
.r-next-form-fieldset-wrapper {
|
|
40
|
+
display: flex;
|
|
41
|
+
gap: 1em;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.r-next-form-legend-wrapper {
|
|
45
|
+
width: 250px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.r-next-form-nav-wrapper {
|
|
49
|
+
position: sticky;
|
|
50
|
+
top: 80px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media (max-width: 1183px) {
|
|
55
|
+
.r-next-form-fieldset-wrapper {
|
|
56
|
+
width: 100%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.r-next-form-legend-wrapper {
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.r-next-form-nav-wrapper {
|
|
64
|
+
margin-bottom: 2em;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|