@osdk/react-components 0.18.0-main-1f635101dcdf13bf3201bcaa21c641715744dbb6 → 0.18.0

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 (79) hide show
  1. package/CHANGELOG.md +16 -21
  2. package/build/browser/action-form/FormField.js +11 -5
  3. package/build/browser/action-form/FormField.js.map +1 -1
  4. package/build/browser/action-form/FormField.module.css +17 -0
  5. package/build/browser/action-form/FormField.module.css.js +1 -0
  6. package/build/browser/action-form/fields/FieldBridge.js +7 -1
  7. package/build/browser/action-form/fields/FieldBridge.js.map +1 -1
  8. package/build/browser/action-form/fields/FormFieldRenderer.js +2 -0
  9. package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
  10. package/build/browser/styles.css +38 -0
  11. package/build/browser/tokens/component-tokens/form.css +21 -0
  12. package/build/browser/util/UserAgent.js +1 -1
  13. package/build/browser/util/UserAgent.js.map +1 -1
  14. package/build/cjs/{chunk-T535MGC4.cjs → chunk-3ZTI3X34.cjs} +4 -4
  15. package/build/cjs/{chunk-T535MGC4.cjs.map → chunk-3ZTI3X34.cjs.map} +1 -1
  16. package/build/cjs/{chunk-3MZS45DK.cjs → chunk-4VBZDFNF.cjs} +19 -9
  17. package/build/cjs/chunk-4VBZDFNF.cjs.map +1 -0
  18. package/build/cjs/chunk-4WN66RSZ.cjs +11 -0
  19. package/build/cjs/{chunk-UKGRBSSF.cjs.map → chunk-4WN66RSZ.cjs.map} +1 -1
  20. package/build/cjs/chunk-5BNDEXWF.cjs +11 -0
  21. package/build/cjs/{chunk-EE2OFLAZ.cjs.map → chunk-5BNDEXWF.cjs.map} +1 -1
  22. package/build/cjs/{chunk-DY5TM2V6.cjs → chunk-5YC6ASJW.cjs} +4 -4
  23. package/build/cjs/{chunk-DY5TM2V6.cjs.map → chunk-5YC6ASJW.cjs.map} +1 -1
  24. package/build/cjs/{chunk-CGCF5U65.cjs → chunk-DDXYP26C.cjs} +4 -4
  25. package/build/cjs/{chunk-CGCF5U65.cjs.map → chunk-DDXYP26C.cjs.map} +1 -1
  26. package/build/cjs/{chunk-HHNCKBQD.cjs → chunk-G7ASG6Y4.cjs} +4 -4
  27. package/build/cjs/{chunk-HHNCKBQD.cjs.map → chunk-G7ASG6Y4.cjs.map} +1 -1
  28. package/build/cjs/{chunk-2OWD7MYY.cjs → chunk-GU5FOAQH.cjs} +3 -3
  29. package/build/cjs/chunk-GU5FOAQH.cjs.map +1 -0
  30. package/build/cjs/{chunk-PQB7LUTF.cjs → chunk-JYNEP3MG.cjs} +4 -4
  31. package/build/cjs/{chunk-PQB7LUTF.cjs.map → chunk-JYNEP3MG.cjs.map} +1 -1
  32. package/build/cjs/{chunk-H43DG4GH.cjs → chunk-LPGTPRYE.cjs} +4 -4
  33. package/build/cjs/{chunk-H43DG4GH.cjs.map → chunk-LPGTPRYE.cjs.map} +1 -1
  34. package/build/cjs/chunk-RR3VWKZH.cjs +11 -0
  35. package/build/cjs/{chunk-YYSCXUYI.cjs.map → chunk-RR3VWKZH.cjs.map} +1 -1
  36. package/build/cjs/chunk-URQCTCDJ.cjs +11 -0
  37. package/build/cjs/{chunk-L3U64NY4.cjs.map → chunk-URQCTCDJ.cjs.map} +1 -1
  38. package/build/cjs/chunk-WVP6Y6QL.cjs +11 -0
  39. package/build/cjs/{chunk-357LAJ2P.cjs.map → chunk-WVP6Y6QL.cjs.map} +1 -1
  40. package/build/cjs/public/experimental/action-form.cjs +4 -4
  41. package/build/cjs/public/experimental/action-form.css +15 -0
  42. package/build/cjs/public/experimental/action-form.css.map +1 -1
  43. package/build/cjs/public/experimental/document-viewer.cjs +4 -4
  44. package/build/cjs/public/experimental/email-viewer.cjs +3 -3
  45. package/build/cjs/public/experimental/excel-viewer.cjs +3 -3
  46. package/build/cjs/public/experimental/filter-list.cjs +13 -13
  47. package/build/cjs/public/experimental/image-viewer.cjs +3 -3
  48. package/build/cjs/public/experimental/markdown-renderer.cjs +3 -3
  49. package/build/cjs/public/experimental/object-table.cjs +8 -8
  50. package/build/cjs/public/experimental/pdf-viewer.cjs +7 -7
  51. package/build/cjs/public/experimental/tiff-renderer.cjs +3 -3
  52. package/build/cjs/public/experimental/video-viewer.cjs +3 -3
  53. package/build/cjs/public/experimental/xml-viewer.cjs +3 -3
  54. package/build/cjs/public/experimental.cjs +46 -46
  55. package/build/cjs/public/experimental.css +15 -0
  56. package/build/cjs/public/experimental.css.map +1 -1
  57. package/build/esm/action-form/FormField.js +11 -5
  58. package/build/esm/action-form/FormField.js.map +1 -1
  59. package/build/esm/action-form/FormField.module.css +17 -0
  60. package/build/esm/action-form/fields/FieldBridge.js +7 -1
  61. package/build/esm/action-form/fields/FieldBridge.js.map +1 -1
  62. package/build/esm/action-form/fields/FormFieldRenderer.js +2 -0
  63. package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
  64. package/build/esm/tokens/component-tokens/form.css +21 -0
  65. package/build/esm/util/UserAgent.js +1 -1
  66. package/build/esm/util/UserAgent.js.map +1 -1
  67. package/build/types/action-form/FormField.d.ts +1 -0
  68. package/build/types/action-form/FormField.d.ts.map +1 -1
  69. package/build/types/action-form/fields/FieldBridge.d.ts.map +1 -1
  70. package/build/types/action-form/fields/FormFieldRenderer.d.ts +1 -0
  71. package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
  72. package/package.json +8 -8
  73. package/build/cjs/chunk-2OWD7MYY.cjs.map +0 -1
  74. package/build/cjs/chunk-357LAJ2P.cjs +0 -11
  75. package/build/cjs/chunk-3MZS45DK.cjs.map +0 -1
  76. package/build/cjs/chunk-EE2OFLAZ.cjs +0 -11
  77. package/build/cjs/chunk-L3U64NY4.cjs +0 -11
  78. package/build/cjs/chunk-UKGRBSSF.cjs +0 -11
  79. package/build/cjs/chunk-YYSCXUYI.cjs +0 -11
@@ -24,11 +24,14 @@ export const FormField = /*#__PURE__*/memo(function ({
24
24
  isRequired,
25
25
  helperText,
26
26
  helperTextPlacement = "tooltip",
27
+ isEdited,
27
28
  error,
28
29
  onBlur,
29
30
  children
30
31
  }) {
31
32
  const hasHelperText = helperText != null && helperText !== "";
33
+ const showTooltip = hasHelperText && helperTextPlacement === "tooltip";
34
+ const showEditedTag = isEdited === true;
32
35
  const labelElement = label != null ? /*#__PURE__*/React.createElement("label", {
33
36
  className: styles.osdkFormFieldLabel,
34
37
  htmlFor: fieldKey
@@ -36,14 +39,17 @@ export const FormField = /*#__PURE__*/memo(function ({
36
39
  className: styles.osdkFormFieldRequired,
37
40
  "aria-label": "required"
38
41
  }, " ", "*")) : null;
42
+ const labelRow = labelElement != null || showTooltip || showEditedTag ? /*#__PURE__*/React.createElement("div", {
43
+ className: styles.osdkFormFieldLabelRow
44
+ }, labelElement, showTooltip && /*#__PURE__*/React.createElement(InfoTip, {
45
+ label: label
46
+ }, helperText), showEditedTag && /*#__PURE__*/React.createElement("span", {
47
+ className: styles.osdkFormFieldEditedTag
48
+ }, "Edited")) : null;
39
49
  return /*#__PURE__*/React.createElement("div", {
40
50
  className: styles.osdkFormField,
41
51
  onBlur: onBlur
42
- }, hasHelperText && helperTextPlacement === "tooltip" ? /*#__PURE__*/React.createElement("div", {
43
- className: styles.osdkFormFieldLabelRow
44
- }, labelElement, /*#__PURE__*/React.createElement(InfoTip, {
45
- label: label
46
- }, helperText)) : labelElement, hasHelperText && helperTextPlacement === "bottom" && /*#__PURE__*/React.createElement("div", {
52
+ }, labelRow, hasHelperText && helperTextPlacement === "bottom" && /*#__PURE__*/React.createElement("div", {
47
53
  className: styles.osdkFormFieldHelperText
48
54
  }, helperText), children, /*#__PURE__*/React.createElement("div", {
49
55
  className: styles.osdkFormFieldErrorSlot,
@@ -1 +1 @@
1
- {"version":3,"file":"FormField.js","names":["Popover","InfoSign","React","memo","styles","FormField","fieldKey","label","isRequired","helperText","helperTextPlacement","error","onBlur","children","hasHelperText","labelElement","createElement","className","osdkFormFieldLabel","htmlFor","osdkFormFieldRequired","osdkFormField","osdkFormFieldLabelRow","InfoTip","osdkFormFieldHelperText","osdkFormFieldErrorSlot","osdkFormFieldError","role","Root","Trigger","render","osdkFormFieldInfoIcon","nativeButton","openOnHover","size","Portal","Positioner","sideOffset","Popup","osdkFormFieldInfoPopup"],"sources":["FormField.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Popover } from \"@base-ui/react/popover\";\nimport { InfoSign } from \"@blueprintjs/icons\";\nimport React, { memo } from \"react\";\nimport styles from \"./FormField.module.css\";\n\ninterface FormFieldProps {\n fieldKey: string;\n label?: string;\n isRequired?: boolean;\n helperText?: React.ReactNode;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n error?: string;\n onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void;\n children: React.ReactNode;\n}\n\nexport const FormField: React.FC<FormFieldProps> = memo(function FormFieldFn({\n fieldKey,\n label,\n isRequired,\n helperText,\n helperTextPlacement = \"tooltip\",\n error,\n onBlur,\n children,\n}: FormFieldProps): React.ReactElement {\n const hasHelperText = helperText != null && helperText !== \"\";\n const showTooltip = hasHelperText && helperTextPlacement === \"tooltip\";\n const showBottomText = hasHelperText && helperTextPlacement === \"bottom\";\n\n const labelElement = label != null\n ? (\n <label className={styles.osdkFormFieldLabel} htmlFor={fieldKey}>\n {label}\n {isRequired === true && (\n <span className={styles.osdkFormFieldRequired} aria-label=\"required\">\n {\" \"}\n *\n </span>\n )}\n </label>\n )\n : null;\n\n return (\n <div className={styles.osdkFormField} onBlur={onBlur}>\n {showTooltip\n ? (\n <div className={styles.osdkFormFieldLabelRow}>\n {labelElement}\n <InfoTip label={label}>{helperText}</InfoTip>\n </div>\n )\n : labelElement}\n {showBottomText && (\n <div className={styles.osdkFormFieldHelperText}>{helperText}</div>\n )}\n {children}\n <div\n className={styles.osdkFormFieldErrorSlot}\n data-osdk-form-field-error-slot=\"\"\n >\n {error != null && (\n <div className={styles.osdkFormFieldError} role=\"alert\">\n {error}\n </div>\n )}\n </div>\n </div>\n );\n});\n\ninterface InfoTipProps {\n label?: string;\n children: React.ReactNode;\n}\n\n// Uses Popover (not Tooltip) because helper text may contain interactive\n// content like links that need focus management and keyboard navigation.\n// See https://base-ui.com/react/components/tooltip#infotips\nfunction InfoTip({ label, children }: InfoTipProps): React.ReactElement {\n return (\n <Popover.Root>\n <Popover.Trigger\n render={<span className={styles.osdkFormFieldInfoIcon} />}\n nativeButton={false}\n openOnHover={true}\n aria-label={label != null ? `Info about ${label}` : \"More information\"}\n >\n <InfoSign size={12} />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Positioner sideOffset={4}>\n <Popover.Popup className={styles.osdkFormFieldInfoPopup}>\n {children}\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,wBAAwB;AAChD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,OAAOC,MAAM,MAAM,wBAAwB;AAa3C,OAAO,MAAMC,SAAmC,gBAAGF,IAAI,CAAC,UAAqB;EAC3EG,QAAQ;EACRC,KAAK;EACLC,UAAU;EACVC,UAAU;EACVC,mBAAmB,GAAG,SAAS;EAC/BC,KAAK;EACLC,MAAM;EACNC;AACc,CAAC,EAAsB;EACrC,MAAMC,aAAa,GAAGL,UAAU,IAAI,IAAI,IAAIA,UAAU,KAAK,EAAE;EAI7D,MAAMM,YAAY,GAAGR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5B,KAAA,CAAAc,aAAA;MAAMC,SAAS,EAAEb,MAAM,CAAC2B;IAAsB,CAAE,CAAE;IAC1DC,YAAY,EAAE,KAAM;IACpBC,WAAW,EAAE,IAAK;IAClB,cAAY1B,KAAK,IAAI,IAAI,GAAG,cAAcA,KAAK,EAAE,GAAG;EAAmB,gBAEvEL,KAAA,CAAAc,aAAA,CAACf,QAAQ;IAACiC,IAAI,EAAE;EAAG,CAAE,CACN,CAAC,eAClBhC,KAAA,CAAAc,aAAA,CAAChB,OAAO,CAACmC,MAAM,qBACbjC,KAAA,CAAAc,aAAA,CAAChB,OAAO,CAACoC,UAAU;IAACC,UAAU,EAAE;EAAE,gBAChCnC,KAAA,CAAAc,aAAA,CAAChB,OAAO,CAACsC,KAAK;IAACrB,SAAS,EAAEb,MAAM,CAACmC;EAAuB,GACrD1B,QACY,CACG,CACN,CACJ,CAAC;AAEnB","ignoreList":[]}
1
+ {"version":3,"file":"FormField.js","names":["Popover","InfoSign","React","memo","styles","FormField","fieldKey","label","isRequired","helperText","helperTextPlacement","isEdited","error","onBlur","children","hasHelperText","showTooltip","showEditedTag","labelElement","createElement","className","osdkFormFieldLabel","htmlFor","osdkFormFieldRequired","labelRow","osdkFormFieldLabelRow","InfoTip","osdkFormFieldEditedTag","osdkFormField","osdkFormFieldHelperText","osdkFormFieldErrorSlot","osdkFormFieldError","role","Root","Trigger","render","osdkFormFieldInfoIcon","nativeButton","openOnHover","size","Portal","Positioner","sideOffset","Popup","osdkFormFieldInfoPopup"],"sources":["FormField.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Popover } from \"@base-ui/react/popover\";\nimport { InfoSign } from \"@blueprintjs/icons\";\nimport React, { memo } from \"react\";\nimport styles from \"./FormField.module.css\";\n\ninterface FormFieldProps {\n fieldKey: string;\n label?: string;\n isRequired?: boolean;\n helperText?: React.ReactNode;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n isEdited?: boolean;\n error?: string;\n onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void;\n children: React.ReactNode;\n}\n\nexport const FormField: React.FC<FormFieldProps> = memo(function FormFieldFn({\n fieldKey,\n label,\n isRequired,\n helperText,\n helperTextPlacement = \"tooltip\",\n isEdited,\n error,\n onBlur,\n children,\n}: FormFieldProps): React.ReactElement {\n const hasHelperText = helperText != null && helperText !== \"\";\n const showTooltip = hasHelperText && helperTextPlacement === \"tooltip\";\n const showBottomText = hasHelperText && helperTextPlacement === \"bottom\";\n const showEditedTag = isEdited === true;\n\n const labelElement = label != null\n ? (\n <label className={styles.osdkFormFieldLabel} htmlFor={fieldKey}>\n {label}\n {isRequired === true && (\n <span className={styles.osdkFormFieldRequired} aria-label=\"required\">\n {\" \"}\n *\n </span>\n )}\n </label>\n )\n : null;\n const labelRow = labelElement != null || showTooltip || showEditedTag\n ? (\n <div className={styles.osdkFormFieldLabelRow}>\n {labelElement}\n {showTooltip && <InfoTip label={label}>{helperText}</InfoTip>}\n {showEditedTag && (\n <span className={styles.osdkFormFieldEditedTag}>Edited</span>\n )}\n </div>\n )\n : null;\n\n return (\n <div className={styles.osdkFormField} onBlur={onBlur}>\n {labelRow}\n {showBottomText && (\n <div className={styles.osdkFormFieldHelperText}>{helperText}</div>\n )}\n {children}\n <div\n className={styles.osdkFormFieldErrorSlot}\n data-osdk-form-field-error-slot=\"\"\n >\n {error != null && (\n <div className={styles.osdkFormFieldError} role=\"alert\">\n {error}\n </div>\n )}\n </div>\n </div>\n );\n});\n\ninterface InfoTipProps {\n label?: string;\n children: React.ReactNode;\n}\n\n// Uses Popover (not Tooltip) because helper text may contain interactive\n// content like links that need focus management and keyboard navigation.\n// See https://base-ui.com/react/components/tooltip#infotips\nfunction InfoTip({ label, children }: InfoTipProps): React.ReactElement {\n return (\n <Popover.Root>\n <Popover.Trigger\n render={<span className={styles.osdkFormFieldInfoIcon} />}\n nativeButton={false}\n openOnHover={true}\n aria-label={label != null ? `Info about ${label}` : \"More information\"}\n >\n <InfoSign size={12} />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Positioner sideOffset={4}>\n <Popover.Popup className={styles.osdkFormFieldInfoPopup}>\n {children}\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,wBAAwB;AAChD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,OAAOC,MAAM,MAAM,wBAAwB;AAc3C,OAAO,MAAMC,SAAmC,gBAAGF,IAAI,CAAC,UAAqB;EAC3EG,QAAQ;EACRC,KAAK;EACLC,UAAU;EACVC,UAAU;EACVC,mBAAmB,GAAG,SAAS;EAC/BC,QAAQ;EACRC,KAAK;EACLC,MAAM;EACNC;AACc,CAAC,EAAsB;EACrC,MAAMC,aAAa,GAAGN,UAAU,IAAI,IAAI,IAAIA,UAAU,KAAK,EAAE;EAC7D,MAAMO,WAAW,GAAGD,aAAa,IAAIL,mBAAmB,KAAK,SAAS;EAEtE,MAAMO,aAAa,GAAGN,QAAQ,KAAK,IAAI;EAEvC,MAAMO,YAAY,GAAGX,KAAK,IAAI,IAAI,gBAE9BL,KAAA,CAAAiB,aAAA;IAAOC,SAAS,EAAEhB,MAAM,CAACiB,kBAAmB;IAACC,OAAO,EAAEhB;EAAS,GAC5DC,KAAK,EACLC,UAAU,KAAK,IAAI,iBAClBN,K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ACdC,MAAM,eAAEjC,KAAA,CAAAiB,aAAA;MAAMC,SAAS,EAAEhB,MAAM,CAACgC;IAAsB,CAAE,CAAE;IAC1DC,YAAY,EAAE,KAAM;IACpBC,WAAW,EAAE,IAAK;IAClB,cAAY/B,KAAK,IAAI,IAAI,GAAG,cAAcA,KAAK,EAAE,GAAG;EAAmB,gBAEvEL,KAAA,CAAAiB,aAAA,CAAClB,QAAQ;IAACsC,IAAI,EAAE;EAAG,CAAE,CACN,CAAC,eAClBrC,KAAA,CAAAiB,aAAA,CAACnB,OAAO,CAACwC,MAAM,qBACbtC,KAAA,CAAAiB,aAAA,CAACnB,OAAO,CAACyC,UAAU;IAACC,UAAU,EAAE;EAAE,gBAChCxC,KAAA,CAAAiB,aAAA,CAACnB,OAAO,CAAC2C,KAAK;IAACvB,SAAS,EAAEhB,MAAM,CAACwC;EAAuB,GACrD9B,QACY,CACG,CACN,CACJ,CAAC;AAEnB","ignoreList":[]}
@@ -44,6 +44,23 @@
44
44
  display: flex;
45
45
  align-items: center;
46
46
  gap: var(--osdk-form-label-row-gap);
47
+ /* Reserve the edited pill's block size so showing it does not grow the label row. */
48
+ min-block-size: var(--osdk-form-label-row-min-block-size);
49
+ }
50
+
51
+ .osdkFormFieldEditedTag {
52
+ display: inline-flex;
53
+ align-items: center;
54
+ flex-shrink: 0;
55
+ margin-inline-start: auto;
56
+ padding-block: var(--osdk-form-edited-tag-padding-block);
57
+ padding-inline: var(--osdk-form-edited-tag-padding-inline);
58
+ border-radius: var(--osdk-form-edited-tag-border-radius);
59
+ background-color: var(--osdk-form-edited-tag-bg);
60
+ color: var(--osdk-form-edited-tag-color);
61
+ font-size: var(--osdk-form-edited-tag-font-size);
62
+ font-weight: var(--osdk-form-edited-tag-font-weight);
63
+ line-height: var(--osdk-form-edited-tag-line-height);
47
64
  }
48
65
 
49
66
  .osdkFormFieldInfoIcon {
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import React, { memo, useCallback, useMemo } from "react";
17
+ import React, { memo, useCallback, useMemo, useState } from "react";
18
18
  import { useController } from "react-hook-form";
19
19
  import { extractValidationRules } from "../utils/extractValidationRules.js";
20
20
  import { FormFieldRenderer } from "./FormFieldRenderer.js";
@@ -42,8 +42,13 @@ export const FieldBridge = /*#__PURE__*/memo(function ({
42
42
  });
43
43
  const isSelectLike = SELECT_LIKE_FIELDS.has(fieldDef.fieldComponent);
44
44
  const isDropdown = fieldDef.fieldComponent === "DROPDOWN";
45
+ // RHF's touched state is blur-based and dirty state is value-comparison
46
+ // based. The tag represents an actual user edit, so set it from the
47
+ // field change path and keep it visible even if the value is restored.
48
+ const [isEdited, setIsEdited] = useState(false);
45
49
  const handleChange = useCallback(newValue => {
46
50
  onChange(newValue);
51
+ setIsEdited(true);
47
52
  onExternalChange?.(fieldDef.fieldKey, newValue);
48
53
  // Select-like fields are "pick once" interactions — mark as touched
49
54
  // immediately so RHF revalidates (clears errors) on selection rather
@@ -72,6 +77,7 @@ export const FieldBridge = /*#__PURE__*/memo(function ({
72
77
  ,
73
78
  onBlur: isDropdown ? undefined : handleBlur,
74
79
  onFieldBlur: isDropdown ? onBlur : undefined,
80
+ isEdited: isEdited,
75
81
  error: fieldError?.message,
76
82
  portalContainer: portalContainer
77
83
  });
@@ -1 +1 @@
1
- {"version":3,"file":"FieldBridge.js","names":["React","memo","useCallback","useMemo","useController","extractValidationRules","FormFieldRenderer","SELECT_LIKE_FIELDS","Set","FieldBridge","fieldDef","control","onExternalChange","portalContainer","rules","field","onChange","onBlur","value","fieldState","error","fieldError","name","fieldKey","isSelectLike","has","fieldComponent","isDropdown","handleChange","newValue","handleBlur","e","currentTarget","contains","relatedTarget","createElement","fieldDefinition","onFieldValueChange","undefined","onFieldBlur","message"],"sources":["FieldBridge.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo, useCallback, useMemo } from \"react\";\nimport type { Control } from \"react-hook-form\";\nimport { useController } from \"react-hook-form\";\nimport type {\n FieldComponent,\n PortalContainer,\n RendererFieldDefinition,\n} from \"../FormFieldApi.js\";\nimport { extractValidationRules } from \"../utils/extractValidationRules.js\";\nimport { FormFieldRenderer } from \"./FormFieldRenderer.js\";\n\nexport interface FieldBridgeProps {\n fieldDef: RendererFieldDefinition;\n control: Control<Record<string, unknown>>;\n onExternalChange?: (fieldKey: string, value: unknown) => void;\n portalContainer?: PortalContainer;\n}\nconst SELECT_LIKE_FIELDS: ReadonlySet<FieldComponent> = new Set<FieldComponent>(\n [\n \"RADIO_BUTTONS\",\n \"SWITCH\",\n ],\n);\n\nexport const FieldBridge: React.FC<FieldBridgeProps> = memo(\n function FieldBridgeFn({\n fieldDef,\n control,\n onExternalChange,\n portalContainer,\n }: FieldBridgeProps): React.ReactElement {\n const rules = useMemo(\n () => extractValidationRules(fieldDef),\n [fieldDef],\n );\n\n const {\n field: { onChange, onBlur, value },\n fieldState: { error: fieldError },\n } = useController({\n name: fieldDef.fieldKey,\n control,\n rules,\n });\n\n const isSelectLike = SELECT_LIKE_FIELDS.has(fieldDef.fieldComponent);\n const isDropdown = fieldDef.fieldComponent === \"DROPDOWN\";\n\n const handleChange = useCallback(\n (newValue: unknown) => {\n onChange(newValue);\n onExternalChange?.(fieldDef.fieldKey, newValue);\n // Select-like fields are \"pick once\" interactions — mark as touched\n // immediately so RHF revalidates (clears errors) on selection rather\n // than waiting for focus to leave the container.\n if (isSelectLike) {\n onBlur();\n }\n },\n [onChange, onBlur, onExternalChange, fieldDef.fieldKey, isSelectLike],\n );\n\n // Ignore blur events where focus stays within the field container\n // (e.g. moving between radio buttons in a group). Only fire RHF's\n // onBlur when focus truly leaves the field.\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLDivElement>) => {\n if (e.currentTarget.contains(e.relatedTarget)) {\n return;\n }\n onBlur();\n },\n [onBlur],\n );\n\n return (\n <FormFieldRenderer\n value={value}\n fieldDefinition={fieldDef}\n onFieldValueChange={handleChange}\n // Dropdown fields own their blur signal because their popover renders\n // in a portal outside the container div — the container-level blur\n // would fire prematurely when the popover opens.\n onBlur={isDropdown ? undefined : handleBlur}\n onFieldBlur={isDropdown ? onBlur : undefined}\n error={fieldError?.message}\n portalContainer={portalContainer}\n />\n );\n },\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAEzD,SAASC,aAAa,QAAQ,iBAAiB;AAM/C,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,iBAAiB,QAAQ,wBAAwB;AAQ1D,MAAMC,kBAA+C,GAAG,IAAIC,GAAG,CAC7D,CACE,eAAe,EACf,QAAQ,CAEZ,CAAC;AAED,OAAO,MAAMC,WAAuC,gBAAGR,IAAI,CACzD,UAAuB;EACrBS,QAAQ;EACRC,OAAO;EACPC,gBAAgB;EAChBC;AACgB,CAAC,EAAsB;EACvC,MAAMC,KAAK,GAAGX,OAAO,CACnB,MAAME,sBAAsB,CAACK,QAAQ,CAAC,EACtC,CAACA,QAAQ,CACX,CAAC;EAED,MAAM;IACJK,KAAK,EAAE;MAAEC,QAAQ;MAAEC,MAAM;MAAEC;IAAM,CAAC;IAClCC,UAAU,EAAE;MAAEC,KAAK,EAAEC;IAAW;EAClC,CAAC,GAAGjB,aAAa,CAAC;IAChBkB,IAAI,EAAEZ,QAAQ,CAACa,QAAQ;IACvBZ,OAAO;IACPG;EACF,CAAC,CAAC;EAEF,MAAMU,YAAY,GAAGjB,kBAAkB,CAACkB,GAAG,CAACf,QAAQ,CAACgB,cAAc,CAAC;EACpE,MAAMC,UAAU,GAAGjB,QAAQ,CAACgB,cAAc,KAAK,UAAU;EAEzD,MAAME,YAAY,GAAG1B,WAAW,CAC7B2B,QAAiB,IAAK;IACrBb,QAAQ,CAACa,QAAQ,CAAC;IAClBjB,gBAAgB,GAAGF,QAAQ,CAACa,QAAQ,EAAEM,QAAQ,CAAC;IAC/C;IACA;IACA;IACA,IAAIL,YAAY,EAAE;MAChBP,MAAM,CAAC,CAAC;IACV;EACF,CAAC,EACD,CAACD,QAAQ,EAAEC,MAAM,EAAEL,gBAAgB,EAAEF,QAAQ,CAACa,QAAQ,EAAEC,YAAY,CACtE,CAAC;;EAED;EACA;EACA;EACA,MAAMM,UAAU,GAAG5B,WAAW,CAC3B6B,CAAmC,IAAK;IACvC,IAAIA,CAAC,CAACC,aAAa,CAACC,QAAQ,CAACF,CAAC,CAACG,aAAa,CAAC,EAAE;MAC7C;IACF;IACAjB,MAAM,CAAC,CAAC;EACV,CAAC,EACD,CAACA,MAAM,CACT,CAAC;EAED,oBACEjB,KAAA,CAAAmC,aAAA,CAAC7B,iBAAiB;IAChBY,KAAK,EAAEA,KAAM;IACbkB,eAAe,EAAE1B,QAAS;IAC1B2B,kBAAkB,EAAET;IACpB;IACA;IACA;IAAA;IACAX,MAAM,EAAEU,UAAU,GAAGW,SAAS,GAAGR,UAAW;IAC5CS,WAAW,EAAEZ,UAAU,GAAGV,MAAM,GAAGqB,SAAU;IAC7ClB,KAAK,EAAEC,UAAU,EAAEmB,OAAQ;IAC3B3B,eAAe,EAAEA;EAAgB,CAClC,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"FieldBridge.js","names":["React","memo","useCallback","useMemo","useState","useController","extractValidationRules","FormFieldRenderer","SELECT_LIKE_FIELDS","Set","FieldBridge","fieldDef","control","onExternalChange","portalContainer","rules","field","onChange","onBlur","value","fieldState","error","fieldError","name","fieldKey","isSelectLike","has","fieldComponent","isDropdown","isEdited","setIsEdited","handleChange","newValue","handleBlur","e","currentTarget","contains","relatedTarget","createElement","fieldDefinition","onFieldValueChange","undefined","onFieldBlur","message"],"sources":["FieldBridge.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo, useCallback, useMemo, useState } from \"react\";\nimport type { Control } from \"react-hook-form\";\nimport { useController } from \"react-hook-form\";\nimport type {\n FieldComponent,\n PortalContainer,\n RendererFieldDefinition,\n} from \"../FormFieldApi.js\";\nimport { extractValidationRules } from \"../utils/extractValidationRules.js\";\nimport { FormFieldRenderer } from \"./FormFieldRenderer.js\";\n\nexport interface FieldBridgeProps {\n fieldDef: RendererFieldDefinition;\n control: Control<Record<string, unknown>>;\n onExternalChange?: (fieldKey: string, value: unknown) => void;\n portalContainer?: PortalContainer;\n}\nconst SELECT_LIKE_FIELDS: ReadonlySet<FieldComponent> = new Set<FieldComponent>(\n [\"RADIO_BUTTONS\", \"SWITCH\"],\n);\n\nexport const FieldBridge: React.FC<FieldBridgeProps> = memo(\n function FieldBridgeFn({\n fieldDef,\n control,\n onExternalChange,\n portalContainer,\n }: FieldBridgeProps): React.ReactElement {\n const rules = useMemo(() => extractValidationRules(fieldDef), [fieldDef]);\n\n const {\n field: { onChange, onBlur, value },\n fieldState: { error: fieldError },\n } = useController({\n name: fieldDef.fieldKey,\n control,\n rules,\n });\n\n const isSelectLike = SELECT_LIKE_FIELDS.has(fieldDef.fieldComponent);\n const isDropdown = fieldDef.fieldComponent === \"DROPDOWN\";\n // RHF's touched state is blur-based and dirty state is value-comparison\n // based. The tag represents an actual user edit, so set it from the\n // field change path and keep it visible even if the value is restored.\n const [isEdited, setIsEdited] = useState(false);\n\n const handleChange = useCallback(\n (newValue: unknown) => {\n onChange(newValue);\n setIsEdited(true);\n onExternalChange?.(fieldDef.fieldKey, newValue);\n // Select-like fields are \"pick once\" interactions — mark as touched\n // immediately so RHF revalidates (clears errors) on selection rather\n // than waiting for focus to leave the container.\n if (isSelectLike) {\n onBlur();\n }\n },\n [onChange, onBlur, onExternalChange, fieldDef.fieldKey, isSelectLike],\n );\n\n // Ignore blur events where focus stays within the field container\n // (e.g. moving between radio buttons in a group). Only fire RHF's\n // onBlur when focus truly leaves the field.\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLDivElement>) => {\n if (e.currentTarget.contains(e.relatedTarget)) {\n return;\n }\n onBlur();\n },\n [onBlur],\n );\n\n return (\n <FormFieldRenderer\n value={value}\n fieldDefinition={fieldDef}\n onFieldValueChange={handleChange}\n // Dropdown fields own their blur signal because their popover renders\n // in a portal outside the container div — the container-level blur\n // would fire prematurely when the popover opens.\n onBlur={isDropdown ? undefined : handleBlur}\n onFieldBlur={isDropdown ? onBlur : undefined}\n isEdited={isEdited}\n error={fieldError?.message}\n portalContainer={portalContainer}\n />\n );\n },\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAEnE,SAASC,aAAa,QAAQ,iBAAiB;AAM/C,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,iBAAiB,QAAQ,wBAAwB;AAQ1D,MAAMC,kBAA+C,GAAG,IAAIC,GAAG,CAC7D,CAAC,eAAe,EAAE,QAAQ,CAC5B,CAAC;AAED,OAAO,MAAMC,W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C,CAAC;EACV,CAAC,EACD,CAACA,MAAM,CACT,CAAC;EAED,oBACElB,KAAA,CAAAsC,aAAA,CAAC/B,iBAAiB;IAChBY,KAAK,EAAEA,KAAM;IACboB,eAAe,EAAE5B,QAAS;IAC1B6B,kBAAkB,EAAET;IACpB;IACA;IACA;IAAA;IACAb,MAAM,EAAEU,UAAU,GAAGa,SAAS,GAAGR,UAAW;IAC5CS,WAAW,EAAEd,UAAU,GAAGV,MAAM,GAAGuB,SAAU;IAC7CZ,QAAQ,EAAEA,QAAS;IACnBR,KAAK,EAAEC,UAAU,EAAEqB,OAAQ;IAC3B7B,eAAe,EAAEA;EAAgB,CAClC,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
@@ -35,6 +35,7 @@ export const FormFieldRenderer = /*#__PURE__*/memo(function ({
35
35
  onFieldValueChange,
36
36
  onBlur,
37
37
  onFieldBlur,
38
+ isEdited,
38
39
  error,
39
40
  portalContainer
40
41
  }) {
@@ -50,6 +51,7 @@ export const FormFieldRenderer = /*#__PURE__*/memo(function ({
50
51
  fieldKey: fieldDefinition.fieldKey,
51
52
  helperText: helperText,
52
53
  helperTextPlacement: helperTextPlacement,
54
+ isEdited: isEdited,
53
55
  error: error,
54
56
  onBlur: onBlur
55
57
  }, renderFieldComponent(fieldDefinition, value, onFieldValueChange, error, portalContainer, onFieldBlur));
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldRenderer.js","names":["React","memo","DatePicker","DateRangePicker","EMPTY_RANGE","FormField","CustomField","DropdownField","FilePickerField","NumberInputField","ObjectSelectField","ObjectSetField","RadioButtonsField","SwitchField","TextAreaField","TextInputField","UNSUPPORTED_FIELD_MESSAGE","FormFieldRenderer","fieldDefinition","value","onFieldValueChange","onBlur","onFieldBlur","error","portalContainer","label","isRequired","helperText","helperTextPlacement","createElement","fieldKey","renderFieldComponent","onChange","fieldComponent","_extends","id","coerceToDateRange","placeholderStart","placeholder","fieldComponentProps","resolvePortalContainer","String","disabled","Date","coerceToFileValue","narrowToOsdkObject","assertUnreachableFieldComponent","formPortalContainer","Object","hasOwn","Array","isArray","length","start","end","isFileArray","every","v","File","Error"],"sources":["FormFieldRenderer.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectTypeDefinition, Osdk } from \"@osdk/api\";\nimport React, { memo } from \"react\";\nimport {\n DatePicker,\n type DateRange,\n DateRangePicker,\n EMPTY_RANGE,\n} from \"../../shared/calendar/index.js\";\nimport { FormField } from \"../FormField.js\";\nimport {\n type PortalContainer,\n type RendererFieldDefinition,\n} from \"../FormFieldApi.js\";\nimport { CustomField } from \"./CustomField.js\";\nimport { DropdownField } from \"./DropdownField.js\";\nimport { FilePickerField } from \"./FilePickerField.js\";\nimport { NumberInputField } from \"./NumberInputField.js\";\nimport { ObjectSelectField } from \"./ObjectSelectField.js\";\nimport { ObjectSetField } from \"./ObjectSetField.js\";\nimport { RadioButtonsField } from \"./RadioButtonsField.js\";\nimport { SwitchField } from \"./SwitchField.js\";\nimport { TextAreaField } from \"./TextAreaField.js\";\nimport { TextInputField } from \"./TextInputField.js\";\n\nconst UNSUPPORTED_FIELD_MESSAGE =\n \"Unsupported field type. Use a CUSTOM field instead\";\n\nexport interface FormFieldRendererProps {\n fieldDefinition: RendererFieldDefinition;\n value: unknown;\n onFieldValueChange: (value: unknown) => void;\n onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void;\n /** Field-level blur for fields that own their touched state (e.g. dropdowns). */\n onFieldBlur?: () => void;\n error: string | undefined;\n portalContainer?: PortalContainer;\n}\n\nexport const FormFieldRenderer: React.FC<FormFieldRendererProps> = memo(\n function FormFieldRendererFn({\n fieldDefinition,\n value,\n onFieldValueChange,\n onBlur,\n onFieldBlur,\n error,\n portalContainer,\n }: FormFieldRendererProps): React.ReactElement {\n const { label, isRequired, helperText, helperTextPlacement } =\n fieldDefinition;\n\n return (\n <FormField\n label={label}\n isRequired={isRequired}\n fieldKey={fieldDefinition.fieldKey}\n helperText={helperText}\n helperTextPlacement={helperTextPlacement}\n error={error}\n onBlur={onBlur}\n >\n {renderFieldComponent(\n fieldDefinition,\n value,\n onFieldValueChange,\n error,\n portalContainer,\n onFieldBlur,\n )}\n </FormField>\n );\n },\n);\n\nfunction renderFieldComponent(\n fieldDefinition: RendererFieldDefinition,\n value: unknown,\n onChange: (value: unknown) => void,\n error: string | undefined,\n portalContainer: PortalContainer | undefined,\n onFieldBlur: (() => void) | undefined,\n): React.ReactElement {\n switch (fieldDefinition.fieldComponent) {\n case \"DATE_RANGE_INPUT\":\n return (\n <DateRangePicker\n id={fieldDefinition.fieldKey}\n value={coerceToDateRange(value)}\n onChange={onChange}\n placeholderStart={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n portalContainer={resolvePortalContainer(\n fieldDefinition.fieldComponentProps,\n portalContainer,\n )}\n />\n );\n case \"TEXT_INPUT\":\n return (\n <TextInputField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"UNSUPPORTED\":\n return (\n <TextInputField\n {...fieldDefinition.fieldComponentProps}\n id={fieldDefinition.fieldKey}\n value={UNSUPPORTED_FIELD_MESSAGE}\n error={error}\n disabled={true}\n />\n );\n case \"TEXT_AREA\":\n return (\n <TextAreaField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"DROPDOWN\": {\n return (\n <DropdownField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n portalContainer={resolvePortalContainer(\n fieldDefinition.fieldComponentProps,\n portalContainer,\n )}\n onBlur={onFieldBlur}\n />\n );\n }\n case \"DATETIME_PICKER\":\n return (\n <DatePicker\n id={fieldDefinition.fieldKey}\n placeholder={fieldDefinition.placeholder}\n // TODO: Use coerceFieldValue\n value={value instanceof Date ? value : null}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n portalContainer={resolvePortalContainer(\n fieldDefinition.fieldComponentProps,\n portalContainer,\n )}\n />\n );\n case \"RADIO_BUTTONS\":\n return (\n <RadioButtonsField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"SWITCH\":\n return (\n <SwitchField\n id={fieldDefinition.fieldKey}\n label={fieldDefinition.label}\n value={!!value}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"CUSTOM\":\n return (\n <CustomField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"NUMBER_INPUT\":\n // TODO: Use coerceFieldValue\n return (\n <NumberInputField\n id={fieldDefinition.fieldKey}\n value={typeof value === \"number\" ? value : null}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"FILE_PICKER\":\n return (\n <FilePickerField\n id={fieldDefinition.fieldKey}\n value={coerceToFileValue(value)}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"OBJECT_SELECT\":\n return (\n <ObjectSelectField\n id={fieldDefinition.fieldKey}\n value={narrowToOsdkObject(value)}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n portalContainer={resolvePortalContainer(\n fieldDefinition.fieldComponentProps,\n portalContainer,\n )}\n />\n );\n case \"OBJECT_SET\":\n return (\n <ObjectSetField\n id={fieldDefinition.fieldKey}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n default:\n return assertUnreachableFieldComponent(fieldDefinition);\n }\n}\n\nfunction resolvePortalContainer(\n fieldComponentProps: { portalContainer?: PortalContainer },\n formPortalContainer: PortalContainer | undefined,\n): PortalContainer | undefined {\n // A field-level value, including null, is an explicit override. That lets a\n // single field opt out of a form-level dialog portal when needed.\n return Object.hasOwn(fieldComponentProps, \"portalContainer\")\n ? fieldComponentProps.portalContainer\n : formPortalContainer;\n}\n\nfunction coerceToDateRange(value: unknown): DateRange {\n if (!Array.isArray(value) || value.length !== 2) return EMPTY_RANGE;\n const start = value[0] instanceof Date ? value[0] : null;\n const end = value[1] instanceof Date ? value[1] : null;\n if (start == null && end == null) return EMPTY_RANGE;\n return [start, end];\n}\n\n// TODO: Move and share with `coerceFieldValue`\nfunction isFileArray(value: unknown[]): value is File[] {\n return value.every((v) => v instanceof File);\n}\n\nfunction coerceToFileValue(value: unknown): File | File[] | null {\n if (value instanceof File) {\n return value;\n }\n if (Array.isArray(value) && isFileArray(value)) {\n return value;\n }\n return null;\n}\n\n/** Narrows the untyped form value to an OsdkObject by checking for $primaryKey. */\nfunction narrowToOsdkObject(\n value: unknown,\n): Osdk.Instance<ObjectTypeDefinition> | null {\n if (value != null && typeof value === \"object\" && \"$primaryKey\" in value) {\n return value as Osdk.Instance<ObjectTypeDefinition>;\n }\n return null;\n}\n\nfunction assertUnreachableFieldComponent(value: never): never {\n throw new Error(`Unhandled field component: ${String(value)}`);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SACEC,UAAU,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B;EAC/D,IAAIA,KAAK,YAAYuC,IAAI,EAAE;IACzB,OAAOvC,KAAK;EACd;EACA,IAAI+B,KAAK,CAACC,OAAO,CAAChC,KAAK,CAAC,IAAIoC,WAAW,CAACpC,KAAK,CAAC,EAAE;IAC9C,OAAOA,KAAK;EACd;EACA,OAAO,IAAI;AACb;;AAEA;AACA,SAAS0B,kBAAkBA,CACzB1B,KAAc,EAC8B;EAC5C,IAAIA,KAAK,IAAI,IAAI,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,aAAa,IAAIA,KAAK,EAAE;IACxE,OAAOA,KAAK;EACd;EACA,OAAO,IAAI;AACb;AAEA,SAAS2B,+BAA+BA,CAAC3B,KAAY,EAAS;EAC5D,MAAM,IAAIwC,KAAK,CAAC,8BAA8BlB,MAAM,CAACtB,KAAK,CAAC,EAAE,CAAC;AAChE","ignoreList":[]}
1
+ {"version":3,"file":"FormFieldRenderer.js","names":["React","memo","DatePicker","DateRangePicker","EMPTY_RANGE","FormField","CustomField","DropdownField","FilePickerField","NumberInputField","ObjectSelectField","ObjectSetField","RadioButtonsField","SwitchField","TextAreaField","TextInputField","UNSUPPORTED_FIELD_MESSAGE","FormFieldRenderer","fieldDefinition","value","onFieldValueChange","onBlur","onFieldBlur","isEdited","error","portalContainer","label","isRequired","helperText","helperTextPlacement","createElement","fieldKey","renderFieldComponent","onChange","fieldComponent","_extends","id","coerceToDateRange","placeholderStart","placeholder","fieldComponentProps","resolvePortalContainer","String","disabled","Date","coerceToFileValue","narrowToOsdkObject","assertUnreachableFieldComponent","formPortalContainer","Object","hasOwn","Array","isArray","length","start","end","isFileArray","every","v","File","Error"],"sources":["FormFieldRenderer.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectTypeDefinition, Osdk } from \"@osdk/api\";\nimport React, { memo } from \"react\";\nimport {\n DatePicker,\n type DateRange,\n DateRangePicker,\n EMPTY_RANGE,\n} from \"../../shared/calendar/index.js\";\nimport { FormField } from \"../FormField.js\";\nimport {\n type PortalContainer,\n type RendererFieldDefinition,\n} from \"../FormFieldApi.js\";\nimport { CustomField } from \"./CustomField.js\";\nimport { DropdownField } from \"./DropdownField.js\";\nimport { FilePickerField } from \"./FilePickerField.js\";\nimport { NumberInputField } from \"./NumberInputField.js\";\nimport { ObjectSelectField } from \"./ObjectSelectField.js\";\nimport { ObjectSetField } from \"./ObjectSetField.js\";\nimport { RadioButtonsField } from \"./RadioButtonsField.js\";\nimport { SwitchField } from \"./SwitchField.js\";\nimport { TextAreaField } from \"./TextAreaField.js\";\nimport { TextInputField } from \"./TextInputField.js\";\n\nconst UNSUPPORTED_FIELD_MESSAGE =\n \"Unsupported field type. Use a CUSTOM field instead\";\n\nexport interface FormFieldRendererProps {\n fieldDefinition: RendererFieldDefinition;\n value: unknown;\n onFieldValueChange: (value: unknown) => void;\n onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void;\n /** Field-level blur for fields that own their touched state (e.g. dropdowns). */\n onFieldBlur?: () => void;\n isEdited: boolean;\n error: string | undefined;\n portalContainer?: PortalContainer;\n}\n\nexport const FormFieldRenderer: React.FC<FormFieldRendererProps> = memo(\n function FormFieldRendererFn({\n fieldDefinition,\n value,\n onFieldValueChange,\n onBlur,\n onFieldBlur,\n isEdited,\n error,\n portalContainer,\n }: FormFieldRendererProps): React.ReactElement {\n const { label, isRequired, helperText, helperTextPlacement } =\n fieldDefinition;\n\n return (\n <FormField\n label={label}\n isRequired={isRequired}\n fieldKey={fieldDefinition.fieldKey}\n helperText={helperText}\n helperTextPlacement={helperTextPlacement}\n isEdited={isEdited}\n error={error}\n onBlur={onBlur}\n >\n {renderFieldComponent(\n fieldDefinition,\n value,\n onFieldValueChange,\n error,\n portalContainer,\n onFieldBlur,\n )}\n </FormField>\n );\n },\n);\n\nfunction renderFieldComponent(\n fieldDefinition: RendererFieldDefinition,\n value: unknown,\n onChange: (value: unknown) => void,\n error: string | undefined,\n portalContainer: PortalContainer | undefined,\n onFieldBlur: (() => void) | undefined,\n): React.ReactElement {\n switch (fieldDefinition.fieldComponent) {\n case \"DATE_RANGE_INPUT\":\n return (\n <DateRangePicker\n id={fieldDefinition.fieldKey}\n value={coerceToDateRange(value)}\n onChange={onChange}\n placeholderStart={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n portalContainer={resolvePortalContainer(\n fieldDefinition.fieldComponentProps,\n portalContainer,\n )}\n />\n );\n case \"TEXT_INPUT\":\n return (\n <TextInputField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"UNSUPPORTED\":\n return (\n <TextInputField\n {...fieldDefinition.fieldComponentProps}\n id={fieldDefinition.fieldKey}\n value={UNSUPPORTED_FIELD_MESSAGE}\n error={error}\n disabled={true}\n />\n );\n case \"TEXT_AREA\":\n return (\n <TextAreaField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"DROPDOWN\": {\n return (\n <DropdownField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n portalContainer={resolvePortalContainer(\n fieldDefinition.fieldComponentProps,\n portalContainer,\n )}\n onBlur={onFieldBlur}\n />\n );\n }\n case \"DATETIME_PICKER\":\n return (\n <DatePicker\n id={fieldDefinition.fieldKey}\n placeholder={fieldDefinition.placeholder}\n // TODO: Use coerceFieldValue\n value={value instanceof Date ? value : null}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n portalContainer={resolvePortalContainer(\n fieldDefinition.fieldComponentProps,\n portalContainer,\n )}\n />\n );\n case \"RADIO_BUTTONS\":\n return (\n <RadioButtonsField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"SWITCH\":\n return (\n <SwitchField\n id={fieldDefinition.fieldKey}\n label={fieldDefinition.label}\n value={!!value}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"CUSTOM\":\n return (\n <CustomField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"NUMBER_INPUT\":\n // TODO: Use coerceFieldValue\n return (\n <NumberInputField\n id={fieldDefinition.fieldKey}\n value={typeof value === \"number\" ? value : null}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"FILE_PICKER\":\n return (\n <FilePickerField\n id={fieldDefinition.fieldKey}\n value={coerceToFileValue(value)}\n onChange={onChange}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"OBJECT_SELECT\":\n return (\n <ObjectSelectField\n id={fieldDefinition.fieldKey}\n value={narrowToOsdkObject(value)}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n error={error}\n {...fieldDefinition.fieldComponentProps}\n portalContainer={resolvePortalContainer(\n fieldDefinition.fieldComponentProps,\n portalContainer,\n )}\n />\n );\n case \"OBJECT_SET\":\n return (\n <ObjectSetField\n id={fieldDefinition.fieldKey}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n default:\n return assertUnreachableFieldComponent(fieldDefinition);\n }\n}\n\nfunction resolvePortalContainer(\n fieldComponentProps: { portalContainer?: PortalContainer },\n formPortalContainer: PortalContainer | undefined,\n): PortalContainer | undefined {\n // A field-level value, including null, is an explicit override. That lets a\n // single field opt out of a form-level dialog portal when needed.\n return Object.hasOwn(fieldComponentProps, \"portalContainer\")\n ? fieldComponentProps.portalContainer\n : formPortalContainer;\n}\n\nfunction coerceToDateRange(value: unknown): DateRange {\n if (!Array.isArray(value) || value.length !== 2) return EMPTY_RANGE;\n const start = value[0] instanceof Date ? value[0] : null;\n const end = value[1] instanceof Date ? value[1] : null;\n if (start == null && end == null) return EMPTY_RANGE;\n return [start, end];\n}\n\n// TODO: Move and share with `coerceFieldValue`\nfunction isFileArray(value: unknown[]): value is File[] {\n return value.every((v) => v instanceof File);\n}\n\nfunction coerceToFileValue(value: unknown): File | File[] | null {\n if (value instanceof File) {\n return value;\n }\n if (Array.isArray(value) && isFileArray(value)) {\n return value;\n }\n return null;\n}\n\n/** Narrows the untyped form value to an OsdkObject by checking for $primaryKey. */\nfunction narrowToOsdkObject(\n value: unknown,\n): Osdk.Instance<ObjectTypeDefinition> | null {\n if (value != null && typeof value === \"object\" && \"$primaryKey\" in value) {\n return value as Osdk.Instance<ObjectTypeDefinition>;\n }\n return null;\n}\n\nfunction assertUnreachableFieldComponent(value: never): never {\n throw new Error(`Unhandled field component: ${String(value)}`);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SACEC,UAAU,EAEVC,eAAe,EACfC,WAAW,QACN,gCAAgC;AACvC,SAASC,SAAS,QAAQ,iBAAiB;AAK3C,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,c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BA,CACzB3B,KAAc,EAC8B;EAC5C,IAAIA,KAAK,IAAI,IAAI,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,aAAa,IAAIA,KAAK,EAAE;IACxE,OAAOA,KAAK;EACd;EACA,OAAO,IAAI;AACb;AAEA,SAAS4B,+BAA+BA,CAAC5B,KAAY,EAAS;EAC5D,MAAM,IAAIyC,KAAK,CAAC,8BAA8BlB,MAAM,CAACvB,KAAK,CAAC,EAAE,CAAC;AAChE","ignoreList":[]}
@@ -44,6 +44,27 @@
44
44
  );
45
45
  --osdk-form-error-color: var(--osdk-typography-color-danger-rest);
46
46
 
47
+ /* Edited tag */
48
+ --osdk-form-edited-tag-bg: var(--osdk-custom-color-gray-2);
49
+ --osdk-form-edited-tag-color: var(--osdk-typography-color-default-rest);
50
+ --osdk-form-edited-tag-font-size: var(--osdk-typography-size-body-small);
51
+ --osdk-form-edited-tag-font-weight: var(--osdk-typography-weight-bold);
52
+ --osdk-form-edited-tag-line-height: var(
53
+ --osdk-typography-line-height-default
54
+ );
55
+ --osdk-form-edited-tag-padding-block: calc(var(--osdk-surface-spacing) * 0.5);
56
+ --osdk-form-edited-tag-padding-inline: calc(
57
+ var(--osdk-surface-spacing) * 1.5
58
+ );
59
+ --osdk-form-edited-tag-border-radius: var(--osdk-surface-border-radius);
60
+
61
+ /* Label row reserved height (accounts for edited tag) to avoid layout shift */
62
+ --osdk-form-label-row-min-block-size: calc(
63
+ var(--osdk-form-edited-tag-font-size) *
64
+ var(--osdk-form-edited-tag-line-height) +
65
+ var(--osdk-form-edited-tag-padding-block) * 2
66
+ );
67
+
47
68
  /* Form footer error indicator */
48
69
  --osdk-form-footer-error-color: var(--osdk-form-error-color);
49
70
  --osdk-form-footer-error-font-size: var(--osdk-typography-size-body-medium);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- const PACKAGE_USER_AGENT = `osdk-react-components/${"0.18.0-main-1f635101dcdf13bf3201bcaa21c641715744dbb6"}`;
17
+ const PACKAGE_USER_AGENT = `osdk-react-components/${"0.18.0"}`;
18
18
  export function componentUserAgent(componentName) {
19
19
  return `${PACKAGE_USER_AGENT}/${componentName}`;
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,iFAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
1
+ {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,mCAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
@@ -5,6 +5,7 @@ interface FormFieldProps {
5
5
  isRequired?: boolean;
6
6
  helperText?: React.ReactNode;
7
7
  helperTextPlacement?: "bottom" | "tooltip";
8
+ isEdited?: boolean;
8
9
  error?: string;
9
10
  onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void;
10
11
  children: React.ReactNode;
@@ -1 +1 @@
1
- {"mappings":"AAkBA,OAAO,WAAqB,OAAQ;UAG1B,eAAe;CACvB;CACA;CACA;CACA,aAAa,MAAM;CACnB,sBAAsB,WAAW;CACjC;CACA,UAAUA,GAAG,MAAM,WAAW;CAC9B,UAAU,MAAM;AACjB;AAED,OAAO,cAAMC,WAAW,MAAM,GAAG","names":["e: React.FocusEvent<HTMLDivElement>","FormField: React.FC<FormFieldProps>"],"sources":["../../../src/action-form/FormField.tsx"],"version":3,"file":"FormField.d.ts"}
1
+ {"mappings":"AAkBA,OAAO,WAAqB,OAAQ;UAG1B,eAAe;CACvB;CACA;CACA;CACA,aAAa,MAAM;CACnB,sBAAsB,WAAW;CACjC;CACA;CACA,UAAUA,GAAG,MAAM,WAAW;CAC9B,UAAU,MAAM;AACjB;AAED,OAAO,cAAMC,WAAW,MAAM,GAAG","names":["e: React.FocusEvent<HTMLDivElement>","FormField: React.FC<FormFieldProps>"],"sources":["../../../src/action-form/FormField.tsx"],"version":3,"file":"FormField.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,OAAO,WAA2C,OAAQ;AAC1D,cAAc,eAAe,iBAAkB;AAE/C,cAEE,iBACA,+BACK,oBAAqB;AAI5B,iBAAiB,iBAAiB;CAChC,UAAU;CACV,SAAS,QAAQ;CACjB,oBAAoBA,kBAAkBC;CACtC,kBAAkB;AACnB;AAQD,OAAO,cAAMC,aAAa,MAAM,GAAG","names":["fieldKey: string","value: unknown","FieldBridge: React.FC<FieldBridgeProps>"],"sources":["../../../../src/action-form/fields/FieldBridge.tsx"],"version":3,"file":"FieldBridge.d.ts"}
1
+ {"mappings":"AAgBA,OAAO,WAAqD,OAAQ;AACpE,cAAc,eAAe,iBAAkB;AAE/C,cAEE,iBACA,+BACK,oBAAqB;AAI5B,iBAAiB,iBAAiB;CAChC,UAAU;CACV,SAAS,QAAQ;CACjB,oBAAoBA,kBAAkBC;CACtC,kBAAkB;AACnB;AAKD,OAAO,cAAMC,aAAa,MAAM,GAAG","names":["fieldKey: string","value: unknown","FieldBridge: React.FC<FieldBridgeProps>"],"sources":["../../../../src/action-form/fields/FieldBridge.tsx"],"version":3,"file":"FieldBridge.d.ts"}
@@ -7,6 +7,7 @@ export interface FormFieldRendererProps {
7
7
  onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void;
8
8
  /** Field-level blur for fields that own their touched state (e.g. dropdowns). */
9
9
  onFieldBlur?: () => void;
10
+ isEdited: boolean;
10
11
  error: string | undefined;
11
12
  portalContainer?: PortalContainer;
12
13
  }
@@ -1 +1 @@
1
- {"mappings":"AAiBA,OAAO,WAAqB,OAAQ;AAQpC,cACO,sBACA,+BACA,oBAAqB;AAe5B,iBAAiB,uBAAuB;CACtC,iBAAiB;CACjB;CACA,qBAAqBA;CACrB,UAAUC,GAAG,MAAM,WAAW;;CAE9B;CACA;CACA,kBAAkB;AACnB;AAED,OAAO,cAAMC,mBAAmB,MAAM,GAAG","names":["value: unknown","e: React.FocusEvent<HTMLDivElement>","FormFieldRenderer: React.FC<FormFieldRendererProps>"],"sources":["../../../../src/action-form/fields/FormFieldRenderer.tsx"],"version":3,"file":"FormFieldRenderer.d.ts"}
1
+ {"mappings":"AAiBA,OAAO,WAAqB,OAAQ;AAQpC,cACO,sBACA,+BACA,oBAAqB;AAe5B,iBAAiB,uBAAuB;CACtC,iBAAiB;CACjB;CACA,qBAAqBA;CACrB,UAAUC,GAAG,MAAM,WAAW;;CAE9B;CACA;CACA;CACA,kBAAkB;AACnB;AAED,OAAO,cAAMC,mBAAmB,MAAM,GAAG","names":["value: unknown","e: React.FocusEvent<HTMLDivElement>","FormFieldRenderer: React.FC<FormFieldRendererProps>"],"sources":["../../../../src/action-form/fields/FormFieldRenderer.tsx"],"version":3,"file":"FormFieldRenderer.d.ts"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/react-components",
3
- "version": "0.18.0-main-1f635101dcdf13bf3201bcaa21c641715744dbb6",
3
+ "version": "0.18.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -184,9 +184,9 @@
184
184
  "xlsx": "^0.18.5"
185
185
  },
186
186
  "peerDependencies": {
187
- "@osdk/api": ">=2.21.1-beta.0",
188
- "@osdk/client": ">=2.21.1-beta.0",
189
- "@osdk/react": ">=2.21.1-beta.0",
187
+ "@osdk/api": "^2.8.0",
188
+ "@osdk/client": "^2.8.0",
189
+ "@osdk/react": "^2.8.0",
190
190
  "@types/react": "^17 || ^18 || ^19",
191
191
  "classnames": "^2.0.0",
192
192
  "react": "^17 || ^18 || ^19",
@@ -211,11 +211,11 @@
211
211
  "react-dom": "^18.3.1",
212
212
  "typescript": "~5.5.4",
213
213
  "@osdk/aip-core": "0.4.0",
214
- "@osdk/api": "2.21.1-main-1f635101dcdf13bf3201bcaa21c641715744dbb6",
215
- "@osdk/client": "2.21.1-main-1f635101dcdf13bf3201bcaa21c641715744dbb6",
214
+ "@osdk/client": "2.22.0",
215
+ "@osdk/api": "2.22.0",
216
216
  "@osdk/monorepo.api-extractor": "~0.7.0",
217
- "@osdk/monorepo.tsconfig": "~0.7.0",
218
- "@osdk/react": "2.21.1-main-1f635101dcdf13bf3201bcaa21c641715744dbb6"
217
+ "@osdk/react": "2.22.0",
218
+ "@osdk/monorepo.tsconfig": "~0.7.0"
219
219
  },
220
220
  "publishConfig": {
221
221
  "access": "public"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/util/UserAgent.ts","../../src/util/withOsdkMetrics.ts"],"names":["useRegisterUserAgent","React"],"mappings":";;;;;;;;;;;;AAgBA,IAAM,kBAAA,GAAqB,yBAAyB,sDAA2B,CAAA,CAAA;AACxE,SAAS,mBAAmB,aAAA,EAAe;AAChD,EAAA,OAAO,CAAA,EAAG,kBAAkB,CAAA,CAAA,EAAI,aAAa,CAAA,CAAA;AAC/C;;;ACKO,SAAS,eAAA,CAAgB,WAAW,IAAA,EAAM;AAC/C,EAAA,MAAM,UAAU,CAAA,KAAA,KAAS;AACvB,IAAAA,0BAAA,CAAqB,kBAAA,CAAmB,IAAI,CAAC,CAAA;AAC7C,IAAA,uBAAoBC,sBAAA,CAAM,aAAA,CAAc,SAAA,EAAW,KAAK,CAAA;AAAA,EAC1D,CAAA;AACA,EAAA,OAAA,CAAQ,WAAA,GAAc,mBAAmB,IAAI,CAAA,CAAA,CAAA;AAC7C,EAAA,OAAO,OAAA;AACT","file":"chunk-2OWD7MYY.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT = `osdk-react-components/${process.env.PACKAGE_VERSION}`;\nexport function componentUserAgent(componentName) {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useRegisterUserAgent } from \"@osdk/react\";\nimport React from \"react\";\nimport { componentUserAgent } from \"./UserAgent.js\";\n\n// `any` is required: FunctionComponent defaults to FunctionComponent<{}> which\n// rejects components with required props. A generic P parameter doesn't help\n// because TS can't infer both P and C simultaneously from a single argument.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withOsdkMetrics(Component, name) {\n const Wrapped = props => {\n useRegisterUserAgent(componentUserAgent(name));\n return /*#__PURE__*/React.createElement(Component, props);\n };\n Wrapped.displayName = `withOsdkMetrics(${name})`;\n return Wrapped;\n}"]}
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkOUJQJQ7N_cjs = require('./chunk-OUJQJQ7N.cjs');
4
- var chunk2OWD7MYY_cjs = require('./chunk-2OWD7MYY.cjs');
5
-
6
- // src/public/experimental/xml-viewer.ts
7
- var XmlViewer2 = chunk2OWD7MYY_cjs.withOsdkMetrics(chunkOUJQJQ7N_cjs.XmlViewer, "XmlViewer");
8
-
9
- exports.XmlViewer = XmlViewer2;
10
- //# sourceMappingURL=chunk-357LAJ2P.cjs.map
11
- //# sourceMappingURL=chunk-357LAJ2P.cjs.map