@overmap-ai/forms 1.0.10-conditional-arrows-2.1 → 1.0.10-conditional-arrows-2.3

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/forms.js CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
8
- import { Flex, Text, useSeverityColor, Checkbox, CheckCircledIcon, TextField as TextField$1, FontFamilyIcon, CalendarIcon, InputIcon, TextArea, RowsIcon, Select, Box, IconButton, PlusIcon, Badge, Cross1Icon, ListBulletIcon, DropdownMenuIcon, MultiSelect, CheckboxIcon, Card, Heading, Button, UploadIcon, ButtonList, divButtonProps, StarFilledIcon, StarIcon, QuestionMarkCircledIcon, PersonIcon, Tooltip, Avatar, Separator, useDiscardAlertDialog, Dialog, Pencil1Icon, TrashIcon, CopyIcon, DropdownMenu, DotsVerticalIcon, useAlertDialog, Em, Strong, useToast, Tabs } from "@overmap-ai/blocks";
8
+ import { Flex, Text, useSeverityColor, Checkbox, CheckCircledIcon, TextField as TextField$1, FontFamilyIcon, CalendarIcon, InputIcon, TextArea, RowsIcon, Select, Box, IconButton, PlusIcon, Badge, Cross1Icon, ListBulletIcon, DropdownMenuIcon, MultiSelect, CheckboxIcon, Card, Heading, Button, UploadIcon, ButtonList, divButtonProps, StarFilledIcon, StarIcon, QuestionMarkCircledIcon, PersonIcon, Tooltip, Avatar, Separator, useDiscardAlertDialog, Dialog, Pencil1Icon, TrashIcon, CopyIcon, DropdownItemMenu, DotsVerticalIcon, useAlertDialog, Em, Strong, useToast, Tabs } from "@overmap-ai/blocks";
9
9
  import { useField, useFormikContext, useFormik, FormikProvider } from "formik";
10
10
  import React, { useMemo, memo, useCallback, useState, useEffect, useRef, forwardRef, useReducer } from "react";
11
11
  import { DragDropContext, Droppable, Draggable } from "@hello-pangea/dnd";
@@ -2102,25 +2102,25 @@ const FieldActions = memo(function FieldActions2(props) {
2102
2102
  ],
2103
2103
  [duplicateProps, editProps, insertAfterProps, remove2, type]
2104
2104
  );
2105
- const actionItems = actions.map((Action) => {
2106
- var _a;
2107
- const Wrapper = Action.Wrapper ?? DefaultWrapper;
2108
- return {
2109
- ...Action.buttonProps,
2110
- onSelect: (_a = Action.buttonProps) == null ? void 0 : _a.onClick,
2111
- content: /* @__PURE__ */ jsx(Wrapper, { ...Action.wrapperProps, children: /* @__PURE__ */ jsxs(Flex, { gap: "2", align: "center", children: [
2112
- /* @__PURE__ */ jsx(Action.Icon, {}),
2113
- Action.text
2114
- ] }) })
2115
- };
2116
- });
2117
- console.log(actionItems);
2105
+ const actionDropdownMenuItems = useMemo(() => {
2106
+ return actions.map((Action) => {
2107
+ var _a;
2108
+ const Wrapper = Action.Wrapper ?? DefaultWrapper;
2109
+ return {
2110
+ ...Action.buttonProps,
2111
+ onSelect: (_a = Action.buttonProps) == null ? void 0 : _a.onClick,
2112
+ content: /* @__PURE__ */ jsx(Wrapper, { ...Action.wrapperProps, children: /* @__PURE__ */ jsxs(Flex, { gap: "2", align: "center", children: [
2113
+ /* @__PURE__ */ jsx(Action.Icon, {}),
2114
+ Action.text
2115
+ ] }) })
2116
+ };
2117
+ });
2118
+ }, [actions]);
2118
2119
  return /* @__PURE__ */ jsx(Box, { display: "block", children: /* @__PURE__ */ jsx(
2119
- DropdownMenu,
2120
+ DropdownItemMenu,
2120
2121
  {
2121
2122
  trigger: /* @__PURE__ */ jsx(IconButton, { variant: "ghost", "aria-label": "Actions menu", children: /* @__PURE__ */ jsx(DotsVerticalIcon, {}) }),
2122
- closeOnSelect: false,
2123
- items: actionItems
2123
+ items: actionDropdownMenuItems
2124
2124
  }
2125
2125
  ) });
2126
2126
  });