@bigbinary/neeto-molecules 5.2.27 → 5.2.28
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/dist/v2/OptionFields.js
CHANGED
|
@@ -62,7 +62,6 @@ var BulkOptionModal = function BulkOptionModal(_ref) {
|
|
|
62
62
|
};
|
|
63
63
|
return /*#__PURE__*/jsxs(Dialog, {
|
|
64
64
|
isOpen: isOpen,
|
|
65
|
-
"aria-describedby": undefined,
|
|
66
65
|
onClose: handleClose,
|
|
67
66
|
children: [/*#__PURE__*/jsx(Dialog.Header, {
|
|
68
67
|
children: /*#__PURE__*/jsx(Dialog.Title, {
|
|
@@ -82,6 +81,7 @@ var BulkOptionModal = function BulkOptionModal(_ref) {
|
|
|
82
81
|
Link: /*#__PURE__*/jsx(Button, {
|
|
83
82
|
className: "text-xs",
|
|
84
83
|
href: bulkAddHelpDocUrl,
|
|
84
|
+
rel: "noreferrer",
|
|
85
85
|
target: "_blank",
|
|
86
86
|
variant: "link"
|
|
87
87
|
})
|
|
@@ -157,13 +157,14 @@ var OptionActions = withT(function (_ref) {
|
|
|
157
157
|
_ref$className = _ref.className,
|
|
158
158
|
className = _ref$className === void 0 ? "" : _ref$className;
|
|
159
159
|
return /*#__PURE__*/jsxs("div", {
|
|
160
|
-
className: "flex items-center gap-
|
|
160
|
+
className: "flex items-center gap-2 ".concat(className),
|
|
161
161
|
children: [!hideCloneOption && /*#__PURE__*/jsx(Button, {
|
|
162
162
|
disabled: disabled,
|
|
163
|
-
className: "p-0.5",
|
|
164
163
|
"data-testid": "clone-option-button-".concat(optionIndex),
|
|
165
|
-
icon: Copy,
|
|
166
|
-
|
|
164
|
+
icon: /*#__PURE__*/jsx(Copy, {
|
|
165
|
+
className: "size-4"
|
|
166
|
+
}),
|
|
167
|
+
size: "icon-xs",
|
|
167
168
|
variant: "ghost",
|
|
168
169
|
tooltipProps: {
|
|
169
170
|
content: t("neetoMolecules.common.actions.clone"),
|
|
@@ -174,10 +175,11 @@ var OptionActions = withT(function (_ref) {
|
|
|
174
175
|
}
|
|
175
176
|
}), !hideDeleteOption && /*#__PURE__*/jsx(Button, {
|
|
176
177
|
disabled: disabled,
|
|
177
|
-
className: "p-0.5",
|
|
178
178
|
"data-testid": "delete-option-button-".concat(optionIndex),
|
|
179
|
-
icon: Trash2,
|
|
180
|
-
|
|
179
|
+
icon: /*#__PURE__*/jsx(Trash2, {
|
|
180
|
+
className: "size-4"
|
|
181
|
+
}),
|
|
182
|
+
size: "icon-xs",
|
|
181
183
|
variant: "ghost",
|
|
182
184
|
tooltipProps: {
|
|
183
185
|
content: t("neetoMolecules.common.actions.delete"),
|
|
@@ -250,7 +252,7 @@ var EditorOption = function EditorOption(_ref) {
|
|
|
250
252
|
_onBlur === null || _onBlur === void 0 || _onBlur(id, value);
|
|
251
253
|
}
|
|
252
254
|
}), /*#__PURE__*/jsx("div", {
|
|
253
|
-
className: "absolute end-2 top-
|
|
255
|
+
className: "absolute end-2 top-0 flex h-[34px] items-center",
|
|
254
256
|
children: /*#__PURE__*/jsx(OptionActions, {
|
|
255
257
|
arrayHelpers: arrayHelpers,
|
|
256
258
|
disabled: disabled,
|
|
@@ -311,6 +313,11 @@ var ImageOption = function ImageOption(_ref) {
|
|
|
311
313
|
fieldType: "image"
|
|
312
314
|
});
|
|
313
315
|
};
|
|
316
|
+
|
|
317
|
+
// The actions are absolutely positioned, so the card has to reserve room for
|
|
318
|
+
// them: the end-2 inset, 24px per button plus the 8px gap between them, and a
|
|
319
|
+
// trailing 8px matching the card's own padding.
|
|
320
|
+
var actionCount = (hideCloneOption ? 0 : 1) + (hideDeleteOption ? 0 : 1);
|
|
314
321
|
return /*#__PURE__*/jsx("div", _objectSpread$6(_objectSpread$6({
|
|
315
322
|
ref: innerRef
|
|
316
323
|
}, _objectSpread$6(_objectSpread$6({}, draggableProps), dragHandleProps)), {}, {
|
|
@@ -327,7 +334,10 @@ var ImageOption = function ImageOption(_ref) {
|
|
|
327
334
|
"pointer-events-none opacity-80": disabled
|
|
328
335
|
}),
|
|
329
336
|
children: /*#__PURE__*/jsxs("div", {
|
|
330
|
-
className: "border-border bg-
|
|
337
|
+
className: classnames("border-border bg-card group relative flex w-full flex-col gap-2 rounded-lg border p-2", {
|
|
338
|
+
"pe-10": actionCount === 1,
|
|
339
|
+
"pe-18": actionCount === 2
|
|
340
|
+
}),
|
|
331
341
|
children: [/*#__PURE__*/jsx("div", {
|
|
332
342
|
className: "flex-shrink-0",
|
|
333
343
|
"data-testid": "picture-choice-option-".concat(optionIndex),
|
|
@@ -462,7 +472,12 @@ var InputOption = function InputOption(_ref) {
|
|
|
462
472
|
autoFocus: shouldFocus,
|
|
463
473
|
className: "flex-1",
|
|
464
474
|
"data-testid": "".concat(isTextArea ? "option-textarea" : "option-input", "-").concat(optionIndex),
|
|
465
|
-
suffix:
|
|
475
|
+
suffix:
|
|
476
|
+
/*#__PURE__*/
|
|
477
|
+
// `size-auto` overrides the icon-size class atoms injects into
|
|
478
|
+
// addons, which would otherwise collapse the actions to 16px and
|
|
479
|
+
// clip the second button when cloning is enabled.
|
|
480
|
+
jsx(OptionActions, {
|
|
466
481
|
arrayHelpers: arrayHelpers,
|
|
467
482
|
disabled: disabled,
|
|
468
483
|
hideCloneOption: hideCloneOption,
|
|
@@ -470,7 +485,8 @@ var InputOption = function InputOption(_ref) {
|
|
|
470
485
|
id: id,
|
|
471
486
|
onClone: onClone,
|
|
472
487
|
onDelete: onDelete,
|
|
473
|
-
optionIndex: optionIndex
|
|
488
|
+
optionIndex: optionIndex,
|
|
489
|
+
className: "size-auto"
|
|
474
490
|
}),
|
|
475
491
|
onChange: function onChange(_ref2) {
|
|
476
492
|
var target = _ref2.target;
|
|
@@ -716,7 +732,8 @@ var FormError = function FormError(_ref) {
|
|
|
716
732
|
var error = _ref.error;
|
|
717
733
|
if (isNotPresent(error) || typeof error !== "string") return null;
|
|
718
734
|
return /*#__PURE__*/jsx(Typography, {
|
|
719
|
-
className: "
|
|
735
|
+
className: "mt-1",
|
|
736
|
+
color: "destructive",
|
|
720
737
|
"data-testid": "validation-error-container",
|
|
721
738
|
variant: "body3",
|
|
722
739
|
children: error
|
|
@@ -941,10 +958,10 @@ var BlockOption = withT(function (_ref) {
|
|
|
941
958
|
ref: innerRef
|
|
942
959
|
}, draggableProps), dragHandleProps), {}, {
|
|
943
960
|
children: /*#__PURE__*/jsxs("div", {
|
|
944
|
-
className: "border-border hover:bg-muted group relative ms-3 mb-2 flex h-10 cursor-pointer items-center gap-2 rounded border p-3 shadow-xs transition-colors duration-300 ease-in-out",
|
|
961
|
+
className: "border-border hover:bg-muted group relative ms-3 mb-2 flex h-10 cursor-pointer items-center gap-2 rounded-lg border p-3 shadow-xs transition-colors duration-300 ease-in-out",
|
|
945
962
|
"data-testid": "address-field-block",
|
|
946
963
|
children: [isDraggable && /*#__PURE__*/jsx(DragHandle, _objectSpread$2(_objectSpread$2({}, dragHandleProps), {}, {
|
|
947
|
-
className: "absolute -start-0.5 top-1/2 -translate-x-full -translate-y-1/2",
|
|
964
|
+
className: "absolute -start-0.5 top-1/2 -translate-x-full -translate-y-1/2 rtl:translate-x-full",
|
|
948
965
|
"data-testid": "drag-handle-".concat(optionIndex)
|
|
949
966
|
})), isCheckboxEnabled && /*#__PURE__*/jsx(Checkbox, {
|
|
950
967
|
name: name,
|
|
@@ -959,10 +976,12 @@ var BlockOption = withT(function (_ref) {
|
|
|
959
976
|
}), /*#__PURE__*/jsxs("div", {
|
|
960
977
|
className: "flex items-center justify-end gap-2 opacity-0 group-hover:opacity-100",
|
|
961
978
|
children: [/*#__PURE__*/jsx(Button, {
|
|
962
|
-
className: "hover:bg-muted
|
|
979
|
+
className: "hover:bg-muted",
|
|
963
980
|
"data-testid": "address-field-edit-button",
|
|
964
|
-
icon: Pencil,
|
|
965
|
-
|
|
981
|
+
icon: /*#__PURE__*/jsx(Pencil, {
|
|
982
|
+
className: "size-4"
|
|
983
|
+
}),
|
|
984
|
+
size: "icon-xs",
|
|
966
985
|
variant: "ghost",
|
|
967
986
|
tooltipProps: {
|
|
968
987
|
content: t("neetoMolecules.common.actions.edit"),
|
|
@@ -978,7 +997,6 @@ var BlockOption = withT(function (_ref) {
|
|
|
978
997
|
id: id,
|
|
979
998
|
onClone: onClone,
|
|
980
999
|
optionIndex: optionIndex,
|
|
981
|
-
className: "flex items-center gap-2",
|
|
982
1000
|
onDelete: handleDeleteClick
|
|
983
1001
|
})]
|
|
984
1002
|
})]
|
|
@@ -1268,7 +1286,7 @@ var OptionFields = function OptionFields(_ref) {
|
|
|
1268
1286
|
disabled: !isEditable,
|
|
1269
1287
|
label: t("neetoMolecules.optionFields.addBulk"),
|
|
1270
1288
|
size: "sm",
|
|
1271
|
-
variant: "
|
|
1289
|
+
variant: "link",
|
|
1272
1290
|
onClick: function onClick() {
|
|
1273
1291
|
return setIsBulkOptionModalOpen(true);
|
|
1274
1292
|
}
|