@camstack/ui-library 1.2.262 → 1.2.263

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.
@@ -45,6 +45,11 @@ interface AddonGlobalSettingsFormProps {
45
45
  */
46
46
  readonly sectionIds?: readonly string[];
47
47
  /**
48
+ * Fields only — no form card, section border or section title. Use when the
49
+ * parent already owns the layout (e.g. Nodes page cluster secret).
50
+ */
51
+ readonly bare?: boolean;
52
+ /**
48
53
  * Render as collapsible. When true, the form body is hidden until
49
54
  * the operator expands the header (click). Defaults to open so
50
55
  * callers that always want the form visible don't have to opt out.
@@ -74,5 +79,5 @@ interface AddonGlobalSettingsFormProps {
74
79
  */
75
80
  readonly onOverrideChange?: (patch: Record<string, unknown>, effective: Record<string, unknown>) => void;
76
81
  }
77
- export declare function AddonGlobalSettingsForm({ trpc, addonId, nodeId, title, disabled, onAfterChange, refreshToken, sectionIds, collapsible, defaultOpen, mode, onOverrideChange }: AddonGlobalSettingsFormProps): JSX.Element | null;
82
+ export declare function AddonGlobalSettingsForm({ trpc, addonId, nodeId, title, disabled, onAfterChange, refreshToken, sectionIds, bare, collapsible, defaultOpen, mode, onOverrideChange }: AddonGlobalSettingsFormProps): JSX.Element | null;
78
83
  export {};
@@ -14,6 +14,11 @@ interface FormBuilderProps {
14
14
  probeResults?: Record<string, ProbeState>;
15
15
  /** Callback to clear a probe result when a field value changes */
16
16
  onClearProbe?: (key: string) => void;
17
+ /**
18
+ * Fields only — no section border, title or description. For a parent that
19
+ * already frames the form (or wants a single field with no chrome).
20
+ */
21
+ bare?: boolean;
17
22
  }
18
- export declare function ConfigFormBuilder({ schema, values, onChange, disabled, translationFn, onTestField, probeResults, onClearProbe }: FormBuilderProps): JSX.Element;
23
+ export declare function ConfigFormBuilder({ schema, values, onChange, disabled, translationFn, onTestField, probeResults, onClearProbe, bare }: FormBuilderProps): JSX.Element;
19
24
  export {};
package/dist/index.cjs CHANGED
@@ -30127,7 +30127,7 @@ function SectionCard$1({ section, values, onChange, disabled, translationFn, onT
30127
30127
  })]
30128
30128
  });
30129
30129
  }
30130
- function ConfigFormBuilder({ schema, values, onChange, disabled, translationFn, onTestField, probeResults, onClearProbe }) {
30130
+ function ConfigFormBuilder({ schema, values, onChange, disabled, translationFn, onTestField, probeResults, onClearProbe, bare = false }) {
30131
30131
  const handleFieldChange = (key, value) => {
30132
30132
  onChange({
30133
30133
  ...values,
@@ -30135,6 +30135,18 @@ function ConfigFormBuilder({ schema, values, onChange, disabled, translationFn,
30135
30135
  });
30136
30136
  onClearProbe?.(key);
30137
30137
  };
30138
+ if (bare) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
30139
+ className: "grid grid-cols-1 gap-y-2.5",
30140
+ children: schema.sections.flatMap((section) => section.fields.map((field) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormField, {
30141
+ field,
30142
+ values,
30143
+ onChange: handleFieldChange,
30144
+ disabled,
30145
+ translationFn,
30146
+ onTestField,
30147
+ externalProbe: probeResults?.[field.key]
30148
+ }, field.key)))
30149
+ });
30138
30150
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
30139
30151
  className: "space-y-4",
30140
30152
  children: schema.sections.map((section) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SectionCard$1, {
@@ -30217,7 +30229,7 @@ function stripValues(schema) {
30217
30229
  }))
30218
30230
  };
30219
30231
  }
30220
- function AddonGlobalSettingsForm({ trpc, addonId, nodeId, title, disabled, onAfterChange, refreshToken, sectionIds, collapsible, defaultOpen, mode, onOverrideChange }) {
30232
+ function AddonGlobalSettingsForm({ trpc, addonId, nodeId, title, disabled, onAfterChange, refreshToken, sectionIds, bare = false, collapsible, defaultOpen, mode, onOverrideChange }) {
30221
30233
  const effectiveMode = mode ?? "persist";
30222
30234
  const [hydrated, setHydrated] = (0, react$1.useState)(null);
30223
30235
  const [loading, setLoading] = (0, react$1.useState)(true);
@@ -30361,9 +30373,11 @@ function AddonGlobalSettingsForm({ trpc, addonId, nodeId, title, disabled, onAft
30361
30373
  schema: schemaNoValues,
30362
30374
  values: effectiveValues,
30363
30375
  onChange: handleChange,
30364
- disabled: disabled === true
30376
+ disabled: disabled === true,
30377
+ bare
30365
30378
  })
30366
30379
  ] });
30380
+ if (bare) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: body });
30367
30381
  if (collapsible === true) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
30368
30382
  className: "rounded-lg border border-border bg-surface overflow-hidden",
30369
30383
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
package/dist/index.js CHANGED
@@ -30103,7 +30103,7 @@ function SectionCard$1({ section, values, onChange, disabled, translationFn, onT
30103
30103
  })]
30104
30104
  });
30105
30105
  }
30106
- function ConfigFormBuilder({ schema, values, onChange, disabled, translationFn, onTestField, probeResults, onClearProbe }) {
30106
+ function ConfigFormBuilder({ schema, values, onChange, disabled, translationFn, onTestField, probeResults, onClearProbe, bare = false }) {
30107
30107
  const handleFieldChange = (key, value) => {
30108
30108
  onChange({
30109
30109
  ...values,
@@ -30111,6 +30111,18 @@ function ConfigFormBuilder({ schema, values, onChange, disabled, translationFn,
30111
30111
  });
30112
30112
  onClearProbe?.(key);
30113
30113
  };
30114
+ if (bare) return /* @__PURE__ */ jsx("div", {
30115
+ className: "grid grid-cols-1 gap-y-2.5",
30116
+ children: schema.sections.flatMap((section) => section.fields.map((field) => /* @__PURE__ */ jsx(FormField, {
30117
+ field,
30118
+ values,
30119
+ onChange: handleFieldChange,
30120
+ disabled,
30121
+ translationFn,
30122
+ onTestField,
30123
+ externalProbe: probeResults?.[field.key]
30124
+ }, field.key)))
30125
+ });
30114
30126
  return /* @__PURE__ */ jsx("div", {
30115
30127
  className: "space-y-4",
30116
30128
  children: schema.sections.map((section) => /* @__PURE__ */ jsx(SectionCard$1, {
@@ -30193,7 +30205,7 @@ function stripValues(schema) {
30193
30205
  }))
30194
30206
  };
30195
30207
  }
30196
- function AddonGlobalSettingsForm({ trpc, addonId, nodeId, title, disabled, onAfterChange, refreshToken, sectionIds, collapsible, defaultOpen, mode, onOverrideChange }) {
30208
+ function AddonGlobalSettingsForm({ trpc, addonId, nodeId, title, disabled, onAfterChange, refreshToken, sectionIds, bare = false, collapsible, defaultOpen, mode, onOverrideChange }) {
30197
30209
  const effectiveMode = mode ?? "persist";
30198
30210
  const [hydrated, setHydrated] = useState(null);
30199
30211
  const [loading, setLoading] = useState(true);
@@ -30337,9 +30349,11 @@ function AddonGlobalSettingsForm({ trpc, addonId, nodeId, title, disabled, onAft
30337
30349
  schema: schemaNoValues,
30338
30350
  values: effectiveValues,
30339
30351
  onChange: handleChange,
30340
- disabled: disabled === true
30352
+ disabled: disabled === true,
30353
+ bare
30341
30354
  })
30342
30355
  ] });
30356
+ if (bare) return /* @__PURE__ */ jsx("div", { children: body });
30343
30357
  if (collapsible === true) return /* @__PURE__ */ jsxs("section", {
30344
30358
  className: "rounded-lg border border-border bg-surface overflow-hidden",
30345
30359
  children: [/* @__PURE__ */ jsxs("button", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/ui-library",
3
- "version": "1.2.262",
3
+ "version": "1.2.263",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",