@overmap-ai/forms 1.0.12 → 1.0.13

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.
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("formik"), require("react"), require("@radix-ui/react-icons"), require("@radix-ui/themes"), require("@hello-pangea/dnd"), require("@overmap-ai/core"), require("lodash.get"), require("lodash.set"), require("lodash.clonedeep")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "@overmap-ai/blocks", "formik", "react", "@radix-ui/react-icons", "@radix-ui/themes", "@hello-pangea/dnd", "@overmap-ai/core", "lodash.get", "lodash.set", "lodash.clonedeep"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.forms = {}, global.jsxRuntime, global.blocks, global.formik, global.React, global.reactIcons, global.themes, global.dnd, global.core, global.get, global.set, global.cloneDeep));
3
- })(this, function(exports2, jsxRuntime, blocks, formik, React, reactIcons, themes, dnd, core, get, set, cloneDeep) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("formik"), require("react"), require("@radix-ui/react-icons"), require("@radix-ui/themes"), require("linkify-react"), require("@overmap-ai/core"), require("@hello-pangea/dnd"), require("lodash.get"), require("lodash.set"), require("lodash.clonedeep")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "@overmap-ai/blocks", "formik", "react", "@radix-ui/react-icons", "@radix-ui/themes", "linkify-react", "@overmap-ai/core", "@hello-pangea/dnd", "lodash.get", "lodash.set", "lodash.clonedeep"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.forms = {}, global.jsxRuntime, global.blocks, global.formik, global.React, global.reactIcons, global.themes, global.Linkify, global.core, global.dnd, global.get, global.set, global.cloneDeep));
3
+ })(this, function(exports2, jsxRuntime, blocks, formik, React, reactIcons, themes, Linkify, core, dnd, get, set, cloneDeep) {
4
4
  "use strict";var __defProp = Object.defineProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
6
  var __publicField = (obj, key, value) => {
@@ -99,7 +99,7 @@ var __publicField = (obj, key, value) => {
99
99
  __publicField(BaseField, "fieldTypeName");
100
100
  __publicField(BaseField, "fieldTypeDescription");
101
101
  const description$1 = "_description_17zed_1";
102
- const styles$3 = {
102
+ const styles$4 = {
103
103
  description: description$1
104
104
  };
105
105
  const InputWithLabel = (props) => {
@@ -113,7 +113,7 @@ var __publicField = (obj, key, value) => {
113
113
  const { helpText, children, severity } = props;
114
114
  return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "1", children: [
115
115
  children,
116
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "1", severity, className: styles$3.description, children: helpText }) })
116
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "1", severity, className: styles$4.description, children: helpText }) })
117
117
  ] });
118
118
  };
119
119
  const useFormikInput = (props) => {
@@ -465,10 +465,37 @@ var __publicField = (obj, key, value) => {
465
465
  }
466
466
  return null;
467
467
  });
468
+ const clickableLinkContainer = "_clickableLinkContainer_1ace7_1";
469
+ const TextFieldInputCopy = "_TextFieldInputCopy_1ace7_5";
470
+ const styles$3 = {
471
+ clickableLinkContainer,
472
+ TextFieldInputCopy
473
+ };
468
474
  const StringInput = React.memo(function StringInput2(props) {
469
475
  const [{ inputId, labelId, severity, helpText, label, fieldProps, field }, rest] = useFormikInput(props);
470
476
  const color = blocks.useSeverityColor(severity);
471
- return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(InputWithLabel, { severity, inputId, labelId, label, children: /* @__PURE__ */ jsxRuntime.jsx(themes.TextField.Input, { ...rest, ...fieldProps, type: field.inputType, id: inputId, color }) }) });
477
+ return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(InputWithLabel, { severity, inputId, labelId, label, children: !rest.disabled ? /* @__PURE__ */ jsxRuntime.jsx(themes.TextField.Input, { ...rest, ...fieldProps, type: field.inputType, id: inputId, color }) : /* @__PURE__ */ jsxRuntime.jsxs(themes.TextField.Root, { className: styles$3.clickableLinkContainer, children: [
478
+ /* @__PURE__ */ jsxRuntime.jsx(
479
+ "div",
480
+ {
481
+ className: core.classNames(
482
+ "rt-TextFieldInput rt-r-size-2 rt-variant-surface",
483
+ styles$3.TextFieldInputCopy
484
+ ),
485
+ children: /* @__PURE__ */ jsxRuntime.jsx(
486
+ Linkify,
487
+ {
488
+ options: {
489
+ target: "_blank",
490
+ rel: "noopener"
491
+ },
492
+ children: fieldProps.value
493
+ }
494
+ )
495
+ }
496
+ ),
497
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rt-TextFieldChrome" })
498
+ ] }) }) });
472
499
  });
473
500
  const _StringField = class _StringField extends StringOrTextField {
474
501
  constructor(options) {
@@ -1004,7 +1031,7 @@ var __publicField = (obj, key, value) => {
1004
1031
  return /* @__PURE__ */ jsxRuntime.jsx(themes.Card, { children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "3", children: [
1005
1032
  /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", children: [
1006
1033
  /* @__PURE__ */ jsxRuntime.jsx(themes.Heading, { as: "h3", size: "3", children: label }),
1007
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$3.description, children: description2 })
1034
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$4.description, children: description2 })
1008
1035
  ] }),
1009
1036
  inputs
1010
1037
  ] }) });
@@ -1527,7 +1554,7 @@ var __publicField = (obj, key, value) => {
1527
1554
  [schema.title]
1528
1555
  );
1529
1556
  const Description = React.useMemo(
1530
- () => typeof schema.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$3.description, children: schema.description }) : schema.description,
1557
+ () => typeof schema.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$4.description, children: schema.description }) : schema.description,
1531
1558
  [schema.description]
1532
1559
  );
1533
1560
  const inputs = useFieldInputs(schema.fields, { formId: formId2, disabled: readonly });
@@ -2146,7 +2173,6 @@ var __publicField = (obj, key, value) => {
2146
2173
  blocks.DropdownItemMenu,
2147
2174
  {
2148
2175
  trigger: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { variant: "ghost", "aria-label": "Actions menu", children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DotsVerticalIcon, {}) }),
2149
- closeOnSelect: false,
2150
2176
  items: actions.map((Action) => {
2151
2177
  var _a;
2152
2178
  if (Action.disableOnMobile)
@@ -2392,7 +2418,7 @@ var __publicField = (obj, key, value) => {
2392
2418
  /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "2", grow: "1", children: [
2393
2419
  /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", children: [
2394
2420
  /* @__PURE__ */ jsxRuntime.jsx(themes.Heading, { as: "h3", size: "3", children: field.label }),
2395
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$3.description, children: field.description })
2421
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$4.description, children: field.description })
2396
2422
  ] }),
2397
2423
  field.condition && /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "1", children: /* @__PURE__ */ jsxRuntime.jsxs(themes.Em, { children: [
2398
2424
  "Display only if ",