slice-machine-ui 1.18.1-dev-next-release.14 → 1.18.1-dev-next-release.15

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.
Files changed (64) hide show
  1. package/components/ScreenshotPreview/index.tsx +13 -19
  2. package/components/Simulator/components/Header/index.tsx +4 -5
  3. package/lib/builders/SliceBuilder/FieldZones/index.tsx +3 -5
  4. package/lib/builders/SliceBuilder/Sidebar/index.tsx +87 -0
  5. package/lib/builders/SliceBuilder/index.tsx +17 -57
  6. package/lib/builders/common/Zone/Card/components/ErrorTooltip.tsx +2 -6
  7. package/lib/builders/common/Zone/Card/components/NewField.tsx +83 -70
  8. package/lib/builders/common/Zone/Card/index.jsx +1 -3
  9. package/lib/builders/common/Zone/index.jsx +34 -68
  10. package/out/404.html +1 -1
  11. package/out/_next/static/X2WUC5LSmToOvAILmFgvO/_buildManifest.js +1 -0
  12. package/out/_next/static/chunks/482-e6bbd1fcdcdf79ad.js +1 -0
  13. package/out/_next/static/chunks/{113-34b6cf41a62f08ce.js → 770-c75d8245a822c5d9.js} +2 -2
  14. package/out/_next/static/chunks/80-4cd4c6f95d162ef7.js +1 -0
  15. package/out/_next/static/chunks/904-338e9563e841701e.js +1 -0
  16. package/out/_next/static/chunks/958-f575eea195026e39.js +1 -0
  17. package/out/_next/static/chunks/pages/{_app-4f44a310e93b74f9.js → _app-8f2356815e0da495.js} +3 -3
  18. package/out/_next/static/chunks/pages/changes-768c9cb6fef169d1.js +1 -0
  19. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-c9ce77d2fccb503f.js → [customTypeId]-aa37e07c96c8f9b5.js} +1 -1
  20. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-c50a43970c50ead1.js → [pageTypeId]-d445f5cabeb460c0.js} +1 -1
  21. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-39efc79412072ae1.js +1 -0
  22. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-3e75d572516b4f16.js +1 -0
  23. package/out/_next/static/chunks/pages/slices-f77df402117379c6.js +1 -0
  24. package/out/_next/static/css/{a3838b28ab738f1e.css → e4f4acc81f000d9c.css} +1 -1
  25. package/out/changelog.html +1 -1
  26. package/out/changes.html +1 -1
  27. package/out/custom-types/[customTypeId].html +1 -1
  28. package/out/custom-types.html +1 -1
  29. package/out/index.html +1 -1
  30. package/out/labs.html +1 -1
  31. package/out/page-types/[pageTypeId].html +1 -1
  32. package/out/slices/[lib]/[sliceName]/[variation]/screenshot.html +1 -1
  33. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  34. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  35. package/out/slices.html +1 -1
  36. package/package.json +4 -4
  37. package/src/components/List/List.css.ts +1 -0
  38. package/src/components/List/List.stories.tsx +1 -1
  39. package/src/components/List/List.tsx +1 -1
  40. package/src/features/slices/sliceCards/SharedSliceCard.tsx +2 -1
  41. package/src/hooks/useScreenshotChangesModal.ts +0 -2
  42. package/lib/builders/SliceBuilder/Header/index.tsx +0 -64
  43. package/lib/builders/SliceBuilder/SideBar/icons/prismic.svg +0 -12
  44. package/lib/builders/SliceBuilder/SideBar/icons/sb-logo.png +0 -0
  45. package/lib/builders/SliceBuilder/SideBar/icons/storybook.svg +0 -13
  46. package/lib/builders/SliceBuilder/SideBar/icons/storybookGrey.svg +0 -13
  47. package/lib/builders/SliceBuilder/SideBar/index.tsx +0 -97
  48. package/lib/builders/common/Zone/components/ZoneHeader/index.tsx +0 -30
  49. package/out/_next/static/2SUFWetYKOWiRq52mMtdX/_buildManifest.js +0 -1
  50. package/out/_next/static/chunks/377-404ac40f863464df.js +0 -1
  51. package/out/_next/static/chunks/573-8678a91b09707f5d.js +0 -1
  52. package/out/_next/static/chunks/7-b30f3180efb6bb5b.js +0 -1
  53. package/out/_next/static/chunks/904-ae815442efed055f.js +0 -1
  54. package/out/_next/static/chunks/909-e4eec905c21ad8ad.js +0 -1
  55. package/out/_next/static/chunks/pages/changes-b0714ca467c05e08.js +0 -1
  56. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-37ba73cd3c821e04.js +0 -1
  57. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-5b6c6912b66de61f.js +0 -1
  58. package/out/_next/static/chunks/pages/slices-0cd502231524ba59.js +0 -1
  59. /package/{lib/builders/SliceBuilder → components/Simulator/components}/Header/VariationsPopover/MenuList.tsx +0 -0
  60. /package/{lib/builders/SliceBuilder → components/Simulator/components}/Header/VariationsPopover/index.tsx +0 -0
  61. /package/{lib/builders/SliceBuilder → components/Simulator/components/Header}/links.ts +0 -0
  62. /package/lib/builders/SliceBuilder/{Header → Sidebar}/VariationModal.tsx +0 -0
  63. /package/lib/builders/SliceBuilder/{Header/SimulatorButton → SimulatorButton}/index.tsx +0 -0
  64. /package/out/_next/static/{2SUFWetYKOWiRq52mMtdX → X2WUC5LSmToOvAILmFgvO}/_ssgManifest.js +0 -0
@@ -9,11 +9,9 @@ const MemoedImage = memo<{ src: string | undefined }>(({ src }) => (
9
9
  interface ScreenshotPreviewProps {
10
10
  src?: string;
11
11
  sx: { height: string | number } & ThemeUIStyleObject;
12
- hideMissingWarning?: boolean;
13
12
  }
14
13
 
15
14
  export const ScreenshotPreview: React.FC<ScreenshotPreviewProps> = ({
16
- hideMissingWarning = false,
17
15
  src,
18
16
  sx,
19
17
  }) => {
@@ -32,23 +30,19 @@ export const ScreenshotPreview: React.FC<ScreenshotPreviewProps> = ({
32
30
  ...sx,
33
31
  }}
34
32
  >
35
- {hideMissingWarning ? null : (
36
- <>
37
- {src !== undefined ? (
38
- <MemoedImage src={src} />
39
- ) : (
40
- <Text
41
- sx={{
42
- display: "flex",
43
- flexDirection: "column",
44
- alignItems: "center",
45
- }}
46
- >
47
- <MdInfoOutline />
48
- You have no screenshot yet.
49
- </Text>
50
- )}
51
- </>
33
+ {src !== undefined ? (
34
+ <MemoedImage src={src} />
35
+ ) : (
36
+ <Text
37
+ sx={{
38
+ display: "flex",
39
+ flexDirection: "column",
40
+ alignItems: "center",
41
+ }}
42
+ >
43
+ <MdInfoOutline />
44
+ You have no screenshot yet.
45
+ </Text>
52
46
  )}
53
47
  </Flex>
54
48
  );
@@ -1,16 +1,15 @@
1
1
  import router from "next/router";
2
2
  import { Text, Flex, Switch, Label } from "theme-ui";
3
3
 
4
- import VarationsPopover from "@lib/builders/SliceBuilder/Header/VariationsPopover";
5
- import { ComponentUI } from "@lib/models/common/ComponentUI";
6
-
7
4
  import { Button } from "@components/Button";
5
+ import VariationsPopover from "@components/Simulator/components/Header/VariationsPopover";
6
+ import * as Links from "@components/Simulator/components/Header/links";
8
7
  import SliceMachineLogo from "@src/icons/SliceMachineLogo";
9
8
  import { useSelector } from "react-redux";
10
9
  import { selectSavingMock } from "@src/modules/simulator";
11
10
 
12
- import * as Links from "@lib/builders/SliceBuilder/links";
13
11
  import { SliceMachineStoreType } from "@src/redux/type";
12
+ import { ComponentUI } from "@lib/models/common/ComponentUI";
14
13
  import { VariationSM } from "@lib/models/common/Slice";
15
14
 
16
15
  const redirect = (
@@ -80,7 +79,7 @@ const Header: React.FunctionComponent<PropTypes> = ({
80
79
  >
81
80
  {slice.model.name}
82
81
  </Text>
83
- <VarationsPopover
82
+ <VariationsPopover
84
83
  defaultValue={variation}
85
84
  variations={slice.model.variations}
86
85
  onChange={(v) => redirect(slice, v, true)}
@@ -1,5 +1,3 @@
1
- import { Box } from "theme-ui";
2
-
3
1
  import { ensureDnDDestination } from "@lib/utils";
4
2
  import { transformKeyAccessor } from "@utils/str";
5
3
 
@@ -10,6 +8,7 @@ import * as Widgets from "@lib/models/common/widgets";
10
8
  import sliceBuilderWidgetsArray from "@lib/models/common/widgets/sliceBuilderArray";
11
9
 
12
10
  import { DropResult } from "react-beautiful-dnd";
11
+ import { List } from "@src/components/List";
13
12
  import useSliceMachineActions from "@src/modules/useSliceMachineActions";
14
13
  import { VariationSM, WidgetsArea } from "@lib/models/common/Slice";
15
14
 
@@ -118,7 +117,7 @@ const FieldZones: React.FunctionComponent<FieldZonesProps> = ({
118
117
  };
119
118
 
120
119
  return (
121
- <>
120
+ <List>
122
121
  <Zone
123
122
  zoneType="slice"
124
123
  tabId={undefined}
@@ -145,7 +144,6 @@ const FieldZones: React.FunctionComponent<FieldZonesProps> = ({
145
144
  dataCy="slice-non-repeatable-zone"
146
145
  isRepeatableCustomType={undefined}
147
146
  />
148
- <Box mt={4} />
149
147
  <Zone
150
148
  zoneType="slice"
151
149
  tabId={undefined}
@@ -171,7 +169,7 @@ const FieldZones: React.FunctionComponent<FieldZonesProps> = ({
171
169
  dataCy="slice-repeatable-zone"
172
170
  isRepeatableCustomType={undefined}
173
171
  />
174
- </>
172
+ </List>
175
173
  );
176
174
  };
177
175
 
@@ -0,0 +1,87 @@
1
+ import { Box, Button } from "@prismicio/editor-ui";
2
+ import { useRouter } from "next/router";
3
+ import { type FC, useState } from "react";
4
+
5
+ import VariationModal from "@builders/SliceBuilder/Sidebar/VariationModal";
6
+ import ScreenshotChangesModal from "@components/ScreenshotChangesModal";
7
+ import type { ComponentUI } from "@lib/models/common/ComponentUI";
8
+ import type { VariationSM } from "@lib/models/common/Slice";
9
+ import { SharedSliceCard } from "@src/features/slices/sliceCards/SharedSliceCard";
10
+ import { SLICES_CONFIG } from "@src/features/slices/slicesConfig";
11
+ import { useScreenshotChangesModal } from "@src/hooks/useScreenshotChangesModal";
12
+ import useSliceMachineActions from "@src/modules/useSliceMachineActions";
13
+
14
+ type SidebarProps = {
15
+ slice: ComponentUI;
16
+ variation: VariationSM;
17
+ };
18
+
19
+ export const Sidebar: FC<SidebarProps> = ({ slice, variation }) => {
20
+ const router = useRouter();
21
+
22
+ const screenshotChangesModal = useScreenshotChangesModal();
23
+ const { sliceFilterFn, defaultVariationSelector } =
24
+ screenshotChangesModal.modalPayload;
25
+
26
+ const [showVariationModal, setShowVariationModal] = useState(false);
27
+ const { copyVariationSlice } = useSliceMachineActions();
28
+
29
+ return (
30
+ <>
31
+ <Box flexDirection="column" gap={16}>
32
+ {slice.model.variations.map((v) => (
33
+ <SharedSliceCard
34
+ action={{ type: "menu" }}
35
+ key={v.id}
36
+ mode="navigation"
37
+ onUpdateScreenshot={() => {
38
+ screenshotChangesModal.onOpenModal({
39
+ sliceFilterFn: (s) => s,
40
+ defaultVariationSelector: {
41
+ sliceID: slice.model.id,
42
+ variationID: v.id,
43
+ },
44
+ });
45
+ }}
46
+ replace
47
+ selected={v.id === variation.id}
48
+ slice={slice}
49
+ variant="outlined"
50
+ variationId={v.id}
51
+ />
52
+ ))}
53
+ <Button
54
+ onClick={() => {
55
+ setShowVariationModal(true);
56
+ }}
57
+ startIcon="add"
58
+ sx={{ bottom: 72, marginInline: 24, position: "sticky" }}
59
+ variant="secondary"
60
+ >
61
+ Add a new variation
62
+ </Button>
63
+ </Box>
64
+ <ScreenshotChangesModal
65
+ slices={sliceFilterFn([slice])}
66
+ defaultVariationSelector={defaultVariationSelector}
67
+ />
68
+ <VariationModal
69
+ initialVariation={variation}
70
+ isOpen={showVariationModal}
71
+ onClose={() => {
72
+ setShowVariationModal(false);
73
+ }}
74
+ onSubmit={(id, name, copiedVariation) => {
75
+ copyVariationSlice(id, name, copiedVariation);
76
+ const url = SLICES_CONFIG.getBuilderPagePathname({
77
+ libraryName: slice.href,
78
+ sliceName: slice.model.name,
79
+ variationId: id,
80
+ });
81
+ void router.replace(url);
82
+ }}
83
+ variations={slice.model.variations}
84
+ />
85
+ </>
86
+ );
87
+ };
@@ -1,18 +1,16 @@
1
- import { Button } from "@prismicio/editor-ui";
1
+ import { Box, Button } from "@prismicio/editor-ui";
2
2
  import React, { useState, useEffect } from "react";
3
3
 
4
4
  import { handleRemoteResponse } from "@src/modules/toaster/utils";
5
5
 
6
- import { BaseStyles, Box, Grid } from "theme-ui";
7
-
8
6
  import FieldZones from "./FieldZones";
9
- import SideBar from "./SideBar";
10
- import Header from "./Header";
7
+ import { Sidebar } from "./Sidebar";
11
8
 
12
9
  import useSliceMachineActions from "src/modules/useSliceMachineActions";
13
10
  import { useSelector } from "react-redux";
14
11
  import { SliceMachineStoreType } from "@src/redux/type";
15
12
 
13
+ import SimulatorButton from "@builders/SliceBuilder/SimulatorButton";
16
14
  import {
17
15
  AppLayout,
18
16
  AppLayoutActions,
@@ -21,44 +19,28 @@ import {
21
19
  AppLayoutContent,
22
20
  AppLayoutHeader,
23
21
  } from "@components/AppLayout";
24
- import SimulatorButton from "@lib/builders/SliceBuilder/Header/SimulatorButton";
25
- import { SliceSM, VariationSM } from "@lib/models/common/Slice";
22
+ import { VariationSM } from "@lib/models/common/Slice";
26
23
  import { ComponentUI } from "@lib/models/common/ComponentUI";
27
24
 
28
25
  import { FloatingBackButton } from "@src/features/slices/sliceBuilder/FloatingBackButton";
29
26
  import { selectIsSimulatorAvailableForFramework } from "@src/modules/environment";
30
27
  import { isSelectedSliceTouched } from "@src/modules/selectedSlice/selectors";
31
- import { getRemoteSlice } from "@src/modules/slices";
32
- import { useModelStatus } from "@src/hooks/useModelStatus";
33
28
  import { ComponentWithSliceProps } from "@src/layouts/WithSlice";
34
- import {
35
- LocalAndRemoteSlice,
36
- LocalOnlySlice,
37
- } from "@lib/models/common/ModelData";
38
29
 
39
30
  export type SliceBuilderState = {
40
- imageLoading: boolean;
41
31
  loading: boolean;
42
32
  done: boolean;
43
- error: null | string;
44
- status: number | null;
45
33
  };
46
34
 
47
35
  export const initialState: SliceBuilderState = {
48
- imageLoading: false,
49
36
  loading: false,
50
37
  done: false,
51
- error: null,
52
- status: null,
53
38
  };
54
39
 
55
40
  const SliceBuilder: ComponentWithSliceProps = ({ slice, variation }) => {
56
41
  const { openToaster, updateSlice } = useSliceMachineActions();
57
- const { isTouched, remoteSlice } = useSelector(
58
- (store: SliceMachineStoreType) => ({
59
- isTouched: isSelectedSliceTouched(store, slice.from, slice.model.id),
60
- remoteSlice: getRemoteSlice(store, slice.model.id),
61
- }),
42
+ const isTouched = useSelector((store: SliceMachineStoreType) =>
43
+ isSelectedSliceTouched(store, slice.from, slice.model.id),
62
44
  );
63
45
 
64
46
  // We need to move this state to somewhere global to update the UI if any action from anywhere save or update to the filesystem I'd guess
@@ -88,7 +70,6 @@ const SliceBuilder: ComponentWithSliceProps = ({ slice, variation }) => {
88
70
  updateSlice={updateSlice.bind(null, slice, setData)}
89
71
  slice={slice}
90
72
  variation={variation}
91
- remoteSlice={remoteSlice}
92
73
  isTouched={isTouched}
93
74
  data={data}
94
75
  />
@@ -99,7 +80,6 @@ type SliceBuilderForVariationProps = {
99
80
  updateSlice: () => void;
100
81
  slice: ComponentUI;
101
82
  variation: VariationSM;
102
- remoteSlice: SliceSM | undefined;
103
83
  isTouched: boolean;
104
84
  data: SliceBuilderState;
105
85
  };
@@ -107,24 +87,13 @@ const SliceBuilderForVariation: React.FC<SliceBuilderForVariationProps> = ({
107
87
  updateSlice,
108
88
  slice,
109
89
  variation,
110
- remoteSlice,
111
90
  isTouched,
112
91
  data,
113
92
  }) => {
114
- const { isSimulatorAvailableForFramework } = useSelector(
115
- (state: SliceMachineStoreType) => ({
116
- isSimulatorAvailableForFramework:
117
- selectIsSimulatorAvailableForFramework(state),
118
- }),
93
+ const isSimulatorAvailableForFramework = useSelector(
94
+ selectIsSimulatorAvailableForFramework,
119
95
  );
120
96
 
121
- const sliceModel: LocalAndRemoteSlice | LocalOnlySlice = {
122
- local: slice.model,
123
- localScreenshots: slice.screenshots,
124
- ...(remoteSlice ? { remote: remoteSlice } : {}),
125
- };
126
- const { modelsStatuses } = useModelStatus({ slices: [sliceModel] });
127
-
128
97
  return (
129
98
  <AppLayout>
130
99
  <AppLayoutHeader>
@@ -146,24 +115,15 @@ const SliceBuilderForVariation: React.FC<SliceBuilderForVariationProps> = ({
146
115
  </AppLayoutActions>
147
116
  </AppLayoutHeader>
148
117
  <AppLayoutContent>
149
- <BaseStyles>
150
- <Header
151
- component={slice}
152
- status={modelsStatuses.slices[slice.model.id]}
153
- variation={variation}
154
- imageLoading={data.imageLoading}
155
- />
156
- <Grid columns="1fr 320px" gap="16px" sx={{ pt: 4 }}>
157
- <Box>
158
- <FieldZones variation={variation} />
159
- </Box>
160
- <SideBar
161
- component={slice}
162
- variation={variation}
163
- isTouched={isTouched}
164
- />
165
- </Grid>
166
- </BaseStyles>
118
+ <Box
119
+ alignItems="flex-start"
120
+ display="grid"
121
+ gap={16}
122
+ gridTemplateColumns="320px 1fr"
123
+ >
124
+ <Sidebar slice={slice} variation={variation} />
125
+ <FieldZones variation={variation} />
126
+ </Box>
167
127
  <FloatingBackButton />
168
128
  </AppLayoutContent>
169
129
  </AppLayout>
@@ -18,12 +18,8 @@ export const ErrorTooltip: React.FC<ErrorTooltip> = ({ error }) => {
18
18
  <FaRegQuestionCircle
19
19
  color={"tomato"}
20
20
  data-tip={error}
21
- style={{
22
- position: "relative",
23
- right: "24px",
24
- height: "24px",
25
- }}
26
- size={56}
21
+ style={{ position: "absolute", right: "8px" }}
22
+ size={16}
27
23
  />
28
24
  </>
29
25
  );
@@ -1,6 +1,6 @@
1
1
  import { Ref, SetStateAction, useEffect, useRef, useState } from "react";
2
2
  import { Formik, Form, Field } from "formik";
3
- import { Box, Input, Flex, Text, Button, useThemeUI } from "theme-ui";
3
+ import { Input, Flex, Text, Button, useThemeUI } from "theme-ui";
4
4
  import * as CSS from "csstype";
5
5
  import { AnyObjectSchema } from "yup";
6
6
 
@@ -132,48 +132,48 @@ const NewField: React.FC<NewField> = ({
132
132
  variant: "styles.listItem",
133
133
  // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions, @typescript-eslint/prefer-nullish-coalescing
134
134
  border: (t) => `1px solid ${t.colors?.borders?.toString() || ""}`,
135
+ flexWrap: "wrap",
136
+ gap: "12px",
137
+ justifyContent: "flex-start",
135
138
  }}
136
139
  >
140
+ <WidgetIcon
141
+ style={{
142
+ color: theme.colors?.primary as CSS.Property.Color,
143
+ borderRadius: "4px",
144
+ padding: "4px",
145
+ border: "2px solid",
146
+ borderColor: theme.colors?.primary as CSS.Property.Color,
147
+ }}
148
+ size={28}
149
+ />
137
150
  <Flex
138
151
  sx={{
139
152
  alignItems: "center",
153
+ flexGrow: 1,
154
+ gap: 2,
155
+ position: "relative",
140
156
  }}
141
157
  >
142
- <WidgetIcon
143
- style={{
144
- color: theme.colors?.primary as CSS.Property.Color,
145
- marginRight: "8px",
146
- borderRadius: "4px",
147
- padding: "4px",
148
- border: "2px solid",
149
- borderColor: theme.colors?.primary as CSS.Property.Color,
158
+ <Text as="p" sx={{ fontWeight: 500, whiteSpace: "nowrap" }}>
159
+ Field Name
160
+ </Text>
161
+ <Field
162
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
163
+ handleLabelChange(e, values, setValues)
164
+ }
165
+ name="label"
166
+ placeholder="Field Name"
167
+ type="text"
168
+ validate={(value: string) => {
169
+ if (!value.length) {
170
+ return "This field is required";
171
+ }
150
172
  }}
151
- size={28}
152
- />
153
- <Flex
173
+ as={RefInput}
174
+ innerRef={fieldRef}
154
175
  sx={{
155
- display: "flex",
156
- alignItems: "center",
157
- }}
158
- >
159
- <Text as="p" sx={{ mr: 3, minWidth: "86px", fontWeight: 500 }}>
160
- Field Name
161
- </Text>
162
- <Field
163
- onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
164
- handleLabelChange(e, values, setValues)
165
- }
166
- name="label"
167
- placeholder="Field Name"
168
- type="text"
169
- validate={(value: string) => {
170
- if (!value.length) {
171
- return "This field is required";
172
- }
173
- }}
174
- as={RefInput}
175
- innerRef={fieldRef}
176
- sx={getInputFieldStyles(
176
+ ...getInputFieldStyles(
177
177
  // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
178
178
  FormFields.label.disabled
179
179
  ? InputFieldStyles.DISABLED
@@ -181,34 +181,45 @@ const NewField: React.FC<NewField> = ({
181
181
  errors.label
182
182
  ? InputFieldStyles.ERROR
183
183
  : undefined,
184
- )}
185
- aria-label="label-input"
186
- data-cy="new-field-name-input"
187
- />
188
- <ErrorTooltip error={errors.label} />
189
- <Text
190
- as="p"
191
- sx={{ ml: 3, mr: 3, minWidth: "56px", fontWeight: 500 }}
192
- >
193
- field ID
194
- </Text>
195
- <Field
196
- onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
197
- handleIdChange(e, setFieldValue)
198
- }
199
- name="id"
200
- placeholder="e.g. buttonLink"
201
- type="text"
202
- disabled={FormFields.id.disabled}
203
- validate={(value: string) =>
204
- validateId({
205
- value,
206
- fields,
207
- initialId: null,
208
- })
209
- }
210
- as={RefInput}
211
- sx={getInputFieldStyles(
184
+ ),
185
+ flexGrow: 1,
186
+ minWidth: "128px",
187
+ width: "initial",
188
+ }}
189
+ aria-label="label-input"
190
+ data-cy="new-field-name-input"
191
+ />
192
+ <ErrorTooltip error={errors.label} />
193
+ </Flex>
194
+ <Flex
195
+ sx={{
196
+ alignItems: "center",
197
+ flexGrow: 1,
198
+ gap: 2,
199
+ position: "relative",
200
+ }}
201
+ >
202
+ <Text as="p" sx={{ fontWeight: 500, whiteSpace: "nowrap" }}>
203
+ Field ID
204
+ </Text>
205
+ <Field
206
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
207
+ handleIdChange(e, setFieldValue)
208
+ }
209
+ name="id"
210
+ placeholder="e.g. buttonLink"
211
+ type="text"
212
+ disabled={FormFields.id.disabled}
213
+ validate={(value: string) =>
214
+ validateId({
215
+ value,
216
+ fields,
217
+ initialId: null,
218
+ })
219
+ }
220
+ as={RefInput}
221
+ sx={{
222
+ ...getInputFieldStyles(
212
223
  // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
213
224
  FormFields.id.disabled
214
225
  ? InputFieldStyles.DISABLED
@@ -216,13 +227,16 @@ const NewField: React.FC<NewField> = ({
216
227
  errors.id
217
228
  ? InputFieldStyles.ERROR
218
229
  : undefined,
219
- )}
220
- data-cy="new-field-id-input"
221
- />
222
- <ErrorTooltip error={errors.id} />
223
- </Flex>
230
+ ),
231
+ flexGrow: 1,
232
+ minWidth: "128px",
233
+ width: "initial",
234
+ }}
235
+ data-cy="new-field-id-input"
236
+ />
237
+ <ErrorTooltip error={errors.id} />
224
238
  </Flex>
225
- <Box sx={{ minWidth: 150, ml: 3 }}>
239
+ <Flex sx={{ gap: 2 }}>
226
240
  <Button
227
241
  onClick={onCancelNewField}
228
242
  variant="secondary"
@@ -238,13 +252,12 @@ const NewField: React.FC<NewField> = ({
238
252
  fontSize: "14px",
239
253
  borderRadius: "4px",
240
254
  lineHeight: "21px",
241
- ml: 2,
242
255
  }}
243
256
  type="submit"
244
257
  >
245
258
  Add
246
259
  </Button>
247
- </Box>
260
+ </Flex>
248
261
  </Flex>
249
262
  </Form>
250
263
  )}
@@ -23,7 +23,6 @@ const FieldZone = ({
23
23
  isRepeatable,
24
24
  dataCy,
25
25
  isRepeatableCustomType,
26
- sx,
27
26
  }) => {
28
27
  return (
29
28
  <DragDropContext
@@ -41,8 +40,7 @@ const FieldZone = ({
41
40
  {...provided.droppableProps}
42
41
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
43
42
  data-cy={dataCy}
44
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
45
- sx={sx}
43
+ sx={{ paddingInline: "16px !important" }}
46
44
  >
47
45
  {
48
46
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call