@bigbinary/neeto-molecules 5.2.27 → 5.2.29

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.
@@ -64,7 +64,6 @@ var BulkOptionModal = function BulkOptionModal(_ref) {
64
64
  };
65
65
  return /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Dialog, {
66
66
  isOpen: isOpen,
67
- "aria-describedby": undefined,
68
67
  onClose: handleClose,
69
68
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Dialog.Header, {
70
69
  children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Dialog.Title, {
@@ -84,6 +83,7 @@ var BulkOptionModal = function BulkOptionModal(_ref) {
84
83
  Link: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
85
84
  className: "text-xs",
86
85
  href: bulkAddHelpDocUrl,
86
+ rel: "noreferrer",
87
87
  target: "_blank",
88
88
  variant: "link"
89
89
  })
@@ -159,13 +159,14 @@ var OptionActions = reactUtils.withT(function (_ref) {
159
159
  _ref$className = _ref.className,
160
160
  className = _ref$className === void 0 ? "" : _ref$className;
161
161
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
162
- className: "flex items-center gap-1 ".concat(className),
162
+ className: "flex items-center gap-2 ".concat(className),
163
163
  children: [!hideCloneOption && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
164
164
  disabled: disabled,
165
- className: "p-0.5",
166
165
  "data-testid": "clone-option-button-".concat(optionIndex),
167
- icon: copy.Copy,
168
- size: "sm",
166
+ icon: /*#__PURE__*/jsxRuntime.jsx(copy.Copy, {
167
+ className: "size-4"
168
+ }),
169
+ size: "icon-xs",
169
170
  variant: "ghost",
170
171
  tooltipProps: {
171
172
  content: t("neetoMolecules.common.actions.clone"),
@@ -176,10 +177,11 @@ var OptionActions = reactUtils.withT(function (_ref) {
176
177
  }
177
178
  }), !hideDeleteOption && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
178
179
  disabled: disabled,
179
- className: "p-0.5",
180
180
  "data-testid": "delete-option-button-".concat(optionIndex),
181
- icon: trash2.Trash2,
182
- size: "sm",
181
+ icon: /*#__PURE__*/jsxRuntime.jsx(trash2.Trash2, {
182
+ className: "size-4"
183
+ }),
184
+ size: "icon-xs",
183
185
  variant: "ghost",
184
186
  tooltipProps: {
185
187
  content: t("neetoMolecules.common.actions.delete"),
@@ -252,7 +254,7 @@ var EditorOption = function EditorOption(_ref) {
252
254
  _onBlur === null || _onBlur === void 0 || _onBlur(id, value);
253
255
  }
254
256
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
255
- className: "absolute end-2 top-2",
257
+ className: "absolute end-2 top-0 flex h-[34px] items-center",
256
258
  children: /*#__PURE__*/jsxRuntime.jsx(OptionActions, {
257
259
  arrayHelpers: arrayHelpers,
258
260
  disabled: disabled,
@@ -313,6 +315,11 @@ var ImageOption = function ImageOption(_ref) {
313
315
  fieldType: "image"
314
316
  });
315
317
  };
318
+
319
+ // The actions are absolutely positioned, so the card has to reserve room for
320
+ // them: the end-2 inset, 24px per button plus the 8px gap between them, and a
321
+ // trailing 8px matching the card's own padding.
322
+ var actionCount = (hideCloneOption ? 0 : 1) + (hideDeleteOption ? 0 : 1);
316
323
  return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread$6(_objectSpread$6({
317
324
  ref: innerRef
318
325
  }, _objectSpread$6(_objectSpread$6({}, draggableProps), dragHandleProps)), {}, {
@@ -329,7 +336,10 @@ var ImageOption = function ImageOption(_ref) {
329
336
  "pointer-events-none opacity-80": disabled
330
337
  }),
331
338
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
332
- className: "border-border bg-background group relative flex w-full flex-col gap-2 rounded-lg border p-2 pe-8",
339
+ className: classnames("border-border bg-card group relative flex w-full flex-col gap-2 rounded-lg border p-2", {
340
+ "pe-10": actionCount === 1,
341
+ "pe-18": actionCount === 2
342
+ }),
333
343
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
334
344
  className: "flex-shrink-0",
335
345
  "data-testid": "picture-choice-option-".concat(optionIndex),
@@ -464,7 +474,12 @@ var InputOption = function InputOption(_ref) {
464
474
  autoFocus: shouldFocus,
465
475
  className: "flex-1",
466
476
  "data-testid": "".concat(isTextArea ? "option-textarea" : "option-input", "-").concat(optionIndex),
467
- suffix: /*#__PURE__*/jsxRuntime.jsx(OptionActions, {
477
+ suffix:
478
+ /*#__PURE__*/
479
+ // `size-auto` overrides the icon-size class atoms injects into
480
+ // addons, which would otherwise collapse the actions to 16px and
481
+ // clip the second button when cloning is enabled.
482
+ jsxRuntime.jsx(OptionActions, {
468
483
  arrayHelpers: arrayHelpers,
469
484
  disabled: disabled,
470
485
  hideCloneOption: hideCloneOption,
@@ -472,7 +487,8 @@ var InputOption = function InputOption(_ref) {
472
487
  id: id,
473
488
  onClone: onClone,
474
489
  onDelete: onDelete,
475
- optionIndex: optionIndex
490
+ optionIndex: optionIndex,
491
+ className: "size-auto"
476
492
  }),
477
493
  onChange: function onChange(_ref2) {
478
494
  var target = _ref2.target;
@@ -718,7 +734,8 @@ var FormError = function FormError(_ref) {
718
734
  var error = _ref.error;
719
735
  if (neetoCist.isNotPresent(error) || typeof error !== "string") return null;
720
736
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
721
- className: "text-destructive mt-1",
737
+ className: "mt-1",
738
+ color: "destructive",
722
739
  "data-testid": "validation-error-container",
723
740
  variant: "body3",
724
741
  children: error
@@ -943,10 +960,10 @@ var BlockOption = reactUtils.withT(function (_ref) {
943
960
  ref: innerRef
944
961
  }, draggableProps), dragHandleProps), {}, {
945
962
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
946
- 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",
963
+ 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",
947
964
  "data-testid": "address-field-block",
948
965
  children: [isDraggable && /*#__PURE__*/jsxRuntime.jsx(DragHandle, _objectSpread$2(_objectSpread$2({}, dragHandleProps), {}, {
949
- className: "absolute -start-0.5 top-1/2 -translate-x-full -translate-y-1/2",
966
+ className: "absolute -start-0.5 top-1/2 -translate-x-full -translate-y-1/2 rtl:translate-x-full",
950
967
  "data-testid": "drag-handle-".concat(optionIndex)
951
968
  })), isCheckboxEnabled && /*#__PURE__*/jsxRuntime.jsx(Checkbox, {
952
969
  name: name,
@@ -961,10 +978,12 @@ var BlockOption = reactUtils.withT(function (_ref) {
961
978
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
962
979
  className: "flex items-center justify-end gap-2 opacity-0 group-hover:opacity-100",
963
980
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
964
- className: "hover:bg-muted rounded p-1",
981
+ className: "hover:bg-muted",
965
982
  "data-testid": "address-field-edit-button",
966
- icon: Pencil,
967
- size: "sm",
983
+ icon: /*#__PURE__*/jsxRuntime.jsx(Pencil, {
984
+ className: "size-4"
985
+ }),
986
+ size: "icon-xs",
968
987
  variant: "ghost",
969
988
  tooltipProps: {
970
989
  content: t("neetoMolecules.common.actions.edit"),
@@ -980,7 +999,6 @@ var BlockOption = reactUtils.withT(function (_ref) {
980
999
  id: id,
981
1000
  onClone: onClone,
982
1001
  optionIndex: optionIndex,
983
- className: "flex items-center gap-2",
984
1002
  onDelete: handleDeleteClick
985
1003
  })]
986
1004
  })]
@@ -1270,7 +1288,7 @@ var OptionFields = function OptionFields(_ref) {
1270
1288
  disabled: !isEditable,
1271
1289
  label: t("neetoMolecules.optionFields.addBulk"),
1272
1290
  size: "sm",
1273
- variant: "ghost",
1291
+ variant: "link",
1274
1292
  onClick: function onClick() {
1275
1293
  return setIsBulkOptionModalOpen(true);
1276
1294
  }