@parallelworks/ui 0.14.0 → 0.15.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.
@@ -1,11 +1,11 @@
1
1
  import { AngleRightIcon, EyeIcon, EyeOffIcon, SuccessCheckmark, TrashIcon } from "../icons.js";
2
2
  import { c as useStrings, s as useSlots } from "../chunks/Provider-CbFVFB7O.js";
3
3
  import { n as TOOLTIP_ID, r as TooltipInfo } from "../chunks/Tooltip-n9w7Tkt1.js";
4
- import { n as StatusDot, s as isCategory } from "../chunks/StatusBadge-RRUI78iS.js";
5
- import { a as UncontrolledCollapsiblePanel, c as Dropdown, n as SectionHeader, o as MultiSelectDropdown, r as ControlledCollapsiblePanel, s as CustomListbox, t as SwitchToggle } from "../chunks/SwitchToggle-DbW0Q__L.js";
4
+ import { n as StatusDot, s as isCategory } from "../chunks/StatusBadge-zvEtK16a.js";
5
+ import { a as UncontrolledCollapsiblePanel, c as Dropdown, n as SectionHeader, o as MultiSelectDropdown, r as ControlledCollapsiblePanel, s as CustomListbox, t as SwitchToggle } from "../chunks/SwitchToggle-3V836Cn7.js";
6
6
  import { t as Loader } from "../chunks/Loader-BXoXTZGc.js";
7
7
  import { n as Table } from "../chunks/Table-CutP1bRt.js";
8
- import { a as resolvedFlag, c as FieldWrapper, d as useFieldLabelledByProps, f as useFieldRequired, i as initializeValues, l as FieldProvider, n as flattenGroups, o as applySecondaryField, r as impureSetValueFromPath, s as findSecondaryOption, t as enforceOneMustBeTrue, u as useFieldControlProps } from "../chunks/lib-DyJvmbzj.js";
8
+ import { a as resolvedFlag, c as FieldWrapper, d as useFieldLabelledByProps, f as useFieldRequired, i as initializeValues, l as FieldProvider, n as flattenGroups, o as applySecondaryField, r as impureSetValueFromPath, s as findSecondaryOption, t as enforceOneMustBeTrue, u as useFieldControlProps } from "../chunks/lib-CUTRDpa6.js";
9
9
  import cx from "classnames";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
11
  import React, { Suspense, createContext, memo, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
@@ -1130,7 +1130,7 @@ function RangeField(props) {
1130
1130
  children: ({ id, labelId }) => /* @__PURE__ */ jsxs("div", {
1131
1131
  className: "flex items-center",
1132
1132
  children: [/* @__PURE__ */ jsx(Field, {
1133
- className: cx("theme-input h-7 w-1/3 mr-5 text-center rounded border text-[14px]", disabled && "disabled"),
1133
+ className: cx("theme-input h-7 w-1/3 mr-5 text-center rounded border", disabled && "disabled"),
1134
1134
  id,
1135
1135
  type: "number",
1136
1136
  value: currentValue,
@@ -1347,7 +1347,7 @@ var DurationField_default = memo(function DurationField({ field, label, labelPos
1347
1347
  onChange: (e) => handleDisableToggle(e.target.checked),
1348
1348
  className: cx("h-4 w-4 accent-(--theme-link)", disabled ? "cursor-not-allowed" : "cursor-pointer")
1349
1349
  }), /* @__PURE__ */ jsx("span", {
1350
- className: "text-sm theme-text",
1350
+ className: "theme-text",
1351
1351
  children: field.disableLabel
1352
1352
  })]
1353
1353
  })
@@ -1432,7 +1432,7 @@ function ColorField(props) {
1432
1432
  labelPosition,
1433
1433
  spaceCompact,
1434
1434
  children: ({ id }) => /* @__PURE__ */ jsx(Field, {
1435
- className: "theme-input h-8 w-18 rounded border border-neutral-400 text-[14px] placeholder:text-xs",
1435
+ className: "theme-input h-8 w-18 rounded border border-neutral-400 placeholder:text-xs",
1436
1436
  id,
1437
1437
  name: field.name,
1438
1438
  value: fieldState.value || "#fbbf24",
@@ -1458,14 +1458,14 @@ function MultiDropdownField({ field, label, tooltipComponent, labelPosition, spa
1458
1458
  labelPosition,
1459
1459
  spaceCompact,
1460
1460
  children: ({ id }) => disabled ? /* @__PURE__ */ jsx(Field, {
1461
- className: "theme-input h-7 w-full rounded border text-[14px] placeholder:text-xs",
1461
+ className: "theme-input h-7 w-full rounded border placeholder:text-xs",
1462
1462
  id,
1463
1463
  type: "search",
1464
1464
  name: field.name,
1465
1465
  disabled: true,
1466
1466
  onChange
1467
1467
  }, field.name) : /* @__PURE__ */ jsx(MultiSelectionDropdown, {
1468
- className: "themee-input h-7 w-full rounded border text-[14px] flex items-center px-3 py-2",
1468
+ className: "themee-input h-7 w-full rounded border flex items-center px-3 py-2",
1469
1469
  name: field.name,
1470
1470
  label: field.label || label,
1471
1471
  options: Array.isArray(options) ? options : [],
@@ -1531,7 +1531,7 @@ function CheckboxGroupField({ field, label, labelPosition, missing, disabled, on
1531
1531
  }), /* @__PURE__ */ jsxs("div", {
1532
1532
  className: "flex min-w-0 flex-col",
1533
1533
  children: [/* @__PURE__ */ jsx("span", {
1534
- className: "text-sm font-medium leading-tight theme-text",
1534
+ className: "font-medium leading-tight theme-text",
1535
1535
  children: option.label
1536
1536
  }), option.description && /* @__PURE__ */ jsx("span", {
1537
1537
  className: "mt-0.5 text-xs leading-snug theme-muted-text",
@@ -1626,7 +1626,7 @@ function BucketReadOnlyField({ field, disabled, missing, labelPosition, setFormD
1626
1626
  yesLabel: t.readOnly,
1627
1627
  noLabel: t.readWrite
1628
1628
  }), /* @__PURE__ */ jsx("p", {
1629
- className: cx("text-sm theme-muted-text max-w-[65ch]", !forced && "hidden"),
1629
+ className: cx("theme-muted-text max-w-[65ch]", !forced && "hidden"),
1630
1630
  children: t.readOnlyForced
1631
1631
  })]
1632
1632
  })
@@ -1698,7 +1698,10 @@ function listLengthsSignature(options, values = {}, prefix = "") {
1698
1698
  parts.push(`${fullName}:${len}`);
1699
1699
  const template = field.template || field.options;
1700
1700
  if (template && Array.isArray(items)) for (let i = 0; i < items.length; i++) parts.push(listLengthsSignature(template, asRecord(items[i]), `${fullName}[${i}].`));
1701
- } else if (field.type === "group" || field.type === "object") {
1701
+ } else if (field.type === "group") {
1702
+ const groupItems = field.items || field.options;
1703
+ if (groupItems) parts.push(listLengthsSignature(groupItems, values, prefix));
1704
+ } else if (field.type === "object") {
1702
1705
  const groupItems = field.items || field.options;
1703
1706
  if (groupItems) {
1704
1707
  const nestedValues = asRecord(values?.[fieldName]);
@@ -1717,7 +1720,12 @@ function collectFieldsWithDefaults(options, values = {}, prefix = "") {
1717
1720
  if (!field) continue;
1718
1721
  if (fieldName === "$meta") continue;
1719
1722
  const fullName = prefix ? `${prefix}${fieldName}` : fieldName;
1720
- if (field.type === "group" || field.type === "object") {
1723
+ if (field.type === "group") {
1724
+ const groupItems = field.items || field.options;
1725
+ if (groupItems) result.push(...collectFieldsWithDefaults(groupItems, values, prefix));
1726
+ continue;
1727
+ }
1728
+ if (field.type === "object") {
1721
1729
  const groupItems = field.items || field.options;
1722
1730
  if (groupItems) {
1723
1731
  const nestedValues = asRecord(values?.[fieldName]);
@@ -1734,9 +1742,11 @@ function collectFieldsWithDefaults(options, values = {}, prefix = "") {
1734
1742
  }
1735
1743
  continue;
1736
1744
  }
1745
+ if (resolvedFlag(field.hidden) === true && field.ignore !== void 0 && resolvedFlag(field.ignore) !== false) continue;
1737
1746
  if (field.default !== void 0) result.push({
1738
1747
  name: fullName,
1739
- defaultValue: field.default
1748
+ defaultValue: field.default,
1749
+ ...field.secondaryField ? { hasSecondary: true } : {}
1740
1750
  });
1741
1751
  }
1742
1752
  return result;
@@ -1749,17 +1759,29 @@ function defaultReferencesField(defaultValue, fieldPath) {
1749
1759
  function findSelfReferencingFieldNames(schema, values = {}) {
1750
1760
  return collectFieldsWithDefaults(schema, values).filter(({ name, defaultValue }) => defaultReferencesField(defaultValue, name)).map(({ name }) => name);
1751
1761
  }
1752
- /**
1753
- * Re-syncs each field's value when its resolved default changes between
1754
- * renders, unless `meta.touched` (this session) or a synth-touched marker
1755
- * (cross-session, set on first-seen when saved ≠ default) is set. Must be
1756
- * remounted via `key` when the run/config context changes.
1757
- */
1758
- function DynamicDefaultsSync({ options }) {
1759
- const { setFieldValue, getFieldMeta, values } = useFormikContext();
1760
- const fieldsWithDefaults = useMemo(() => collectFieldsWithDefaults(options, values), [options, useMemo(() => listLengthsSignature(options, values), [options, values])]);
1762
+ /** Resolves schema defaults into form values as dependencies change. Store-agnostic so the legacy
1763
+ * form (Formik) and the cluster wizard (its own store) share one implementation. */
1764
+ function useDynamicDefaultsSync({ options, values, setValue, isTouched }) {
1765
+ const listSig = useMemo(() => listLengthsSignature(options, values), [options, values]);
1766
+ const fieldsWithDefaults = useMemo(() => collectFieldsWithDefaults(options, values).map((f) => {
1767
+ if (typeof f.defaultValue !== "string" || !f.defaultValue.includes("${{")) return f;
1768
+ const lastRowIndex = [...f.name.matchAll(/\[(\d+)\]/g)].at(-1)?.[1];
1769
+ const index = lastRowIndex === void 0 ? -1 : Number(lastRowIndex);
1770
+ const parsed = parseStringsOfObj({
1771
+ inputs: values,
1772
+ obj: { v: f.defaultValue },
1773
+ orgVars: {},
1774
+ index
1775
+ });
1776
+ const resolved = parsed && typeof parsed === "object" && "v" in parsed ? parsed.v : f.defaultValue;
1777
+ return {
1778
+ ...f,
1779
+ defaultValue: resolved
1780
+ };
1781
+ }), [options, listSig]);
1761
1782
  const prevDefaultsRef = useRef(/* @__PURE__ */ new Map());
1762
1783
  const synthTouchedRef = useRef(/* @__PURE__ */ new Set());
1784
+ const prevListLensRef = useRef(/* @__PURE__ */ new Map());
1763
1785
  const fieldsWithDefaultsRef = useRef(null);
1764
1786
  if (!deepEqual(fieldsWithDefaultsRef.current, fieldsWithDefaults)) {
1765
1787
  fieldsWithDefaultsRef.current = fieldsWithDefaults;
@@ -1768,23 +1790,53 @@ function DynamicDefaultsSync({ options }) {
1768
1790
  prevDefaultsRef.current.delete(name);
1769
1791
  synthTouchedRef.current.delete(name);
1770
1792
  }
1771
- for (const { name, defaultValue } of fieldsWithDefaults) {
1793
+ const listLens = /* @__PURE__ */ new Map();
1794
+ for (const part of listSig.split("|")) {
1795
+ const sep = part.lastIndexOf(":");
1796
+ if (sep > 0) listLens.set(part.slice(0, sep), Number(part.slice(sep + 1)));
1797
+ }
1798
+ for (const [list, prevLen] of prevListLensRef.current) {
1799
+ const nowLen = listLens.get(list);
1800
+ if (nowLen !== void 0 && nowLen < prevLen) {
1801
+ for (const name of [...prevDefaultsRef.current.keys()]) if (name.startsWith(`${list}[`)) prevDefaultsRef.current.delete(name);
1802
+ for (const name of [...synthTouchedRef.current]) if (name.startsWith(`${list}[`)) synthTouchedRef.current.delete(name);
1803
+ }
1804
+ }
1805
+ prevListLensRef.current = listLens;
1806
+ for (const { name, defaultValue, hasSecondary } of fieldsWithDefaults) {
1807
+ if (hasSecondary) continue;
1772
1808
  if (synthTouchedRef.current.has(name)) continue;
1773
- if (getFieldMeta(name).touched) continue;
1809
+ if (isTouched(name)) continue;
1810
+ if (typeof defaultValue === "string" && defaultValue.includes("${{")) continue;
1774
1811
  const wasSeen = prevDefaultsRef.current.has(name);
1775
1812
  const serializedDefault = JSON.stringify(defaultValue ?? null);
1776
1813
  const prevDefault = prevDefaultsRef.current.get(name);
1777
1814
  prevDefaultsRef.current.set(name, serializedDefault);
1778
1815
  if (!wasSeen) {
1779
- const currVal = JSON.stringify(getValueUsingPath(values, name));
1780
- if (currVal !== void 0 && currVal !== serializedDefault) synthTouchedRef.current.add(name);
1781
- continue;
1816
+ const rawValue = getValueUsingPath(values, name);
1817
+ const currVal = JSON.stringify(rawValue);
1818
+ const trimmedValue = typeof rawValue === "string" ? rawValue.trim() : "";
1819
+ const unresolvedValue = trimmedValue.startsWith("${{") && trimmedValue.endsWith("}}");
1820
+ if (!unresolvedValue && currVal !== void 0 && currVal !== serializedDefault) {
1821
+ synthTouchedRef.current.add(name);
1822
+ continue;
1823
+ }
1824
+ if (!unresolvedValue) continue;
1782
1825
  }
1783
1826
  if (prevDefault === serializedDefault) continue;
1784
1827
  if (defaultValue === null || defaultValue === void 0) continue;
1785
- if (JSON.stringify(getValueUsingPath(values, name)) !== serializedDefault) setFieldValue(name, defaultValue);
1828
+ if (JSON.stringify(getValueUsingPath(values, name)) !== serializedDefault) setValue(name, defaultValue);
1786
1829
  }
1787
1830
  }
1831
+ }
1832
+ function DynamicDefaultsSync({ options }) {
1833
+ const { setFieldValue, getFieldMeta, values } = useFormikContext();
1834
+ useDynamicDefaultsSync({
1835
+ options,
1836
+ values,
1837
+ setValue: setFieldValue,
1838
+ isTouched: (name) => getFieldMeta(name).touched
1839
+ });
1788
1840
  return null;
1789
1841
  }
1790
1842
  function GroupHeader({ children, open, setOpen, title }) {
@@ -1919,7 +1971,7 @@ var InputField = React.memo(function InputField({ label, field, setFormDirty, on
1919
1971
  return /* @__PURE__ */ jsx(TooltipInfo, {
1920
1972
  className: "pr-2",
1921
1973
  place: "top",
1922
- text: typeof fieldObj.tooltip === "string" ? fieldObj.tooltip.replace(/\r/g, "") : fieldObj.tooltip.join("\n")
1974
+ text: typeof fieldObj.tooltip === "string" ? fieldObj.tooltip.replace(/\r/g, "") : fieldObj.tooltip.filter(Boolean).join("\n")
1923
1975
  });
1924
1976
  }, [fieldObj.tooltip]);
1925
1977
  return /* @__PURE__ */ jsx(Registry, {
@@ -2167,7 +2219,7 @@ function DynamicFormContent({ options, setValues, setFormDirty, labelPosition, m
2167
2219
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2168
2220
  /* @__PURE__ */ jsx(DirtyStateBridge, { setFormDirty }),
2169
2221
  /* @__PURE__ */ jsx(FormikStateBridge, { onChange: handleChange }),
2170
- workflowForm && /* @__PURE__ */ jsx(DynamicDefaultsSync, { options: opts }, contextKey ?? ""),
2222
+ /* @__PURE__ */ jsx(DynamicDefaultsSync, { options: opts }, contextKey ?? ""),
2171
2223
  wizardConfig !== null && wizardConfig ? /* @__PURE__ */ jsx(WizardContainer, {
2172
2224
  wizardConfig,
2173
2225
  values,
@@ -2224,7 +2276,7 @@ function DynamicForm({ formJSONs: options = {}, reinitialize = false, initialVal
2224
2276
  },
2225
2277
  ...formikRef ? { innerRef: formikRef } : {},
2226
2278
  children: ({ values }) => /* @__PURE__ */ jsx(Form, {
2227
- className: "w-full text-sm",
2279
+ className: "pw-form w-full text-[13px]",
2228
2280
  children: /* @__PURE__ */ jsx(DynamicFormContent, {
2229
2281
  values,
2230
2282
  options,
@@ -2388,4 +2440,4 @@ function ResourceOptionIcon({ imageUrl, fallbackIcon, alt, variant = "success",
2388
2440
  });
2389
2441
  }
2390
2442
  //#endregion
2391
- export { DropdownWrapper, DynamicDefaultsSync, DynamicForm, FLEX_MAX_DURATION_RANGE, FLEX_WAIT_TIME_RANGE, FieldProvider, FieldRegistryContext, FieldWrapper, FieldsFromOptions, FormikCustomDropdown_default as FormikCustomDropdown, FormikCustomInput, FormikMultiSelectDropdown, FormikNumericInput, GroupHeader, MultiSelectionDropdown, NumberField, Registry, ResourceOptionIcon, STANDARD_MAX_DURATION_RANGE, StatusBlock, applySecondaryField, collectFieldsWithDefaults, collectPartitionDurationIssues, enforceOneMustBeTrue, findSecondaryOption, findSelfReferencingFieldNames, flattenGroups, formatSecondsAsSlurmDuration, getInstanceTypesForForm, getInvalidDurationPaths, getPlaceholder, impureSetValueFromPath, initializeValues, parseSlurmDuration, resolveMetaOverrides, resolvePwString, resolvePwValue, resolvedFlag, setDurationValidity, useFieldControlProps, useFieldLabelledByProps, useFieldRequired, useParsedOpts };
2443
+ export { DropdownWrapper, DynamicDefaultsSync, DynamicForm, FLEX_MAX_DURATION_RANGE, FLEX_WAIT_TIME_RANGE, FieldProvider, FieldRegistryContext, FieldWrapper, FieldsFromOptions, FormikCustomDropdown_default as FormikCustomDropdown, FormikCustomInput, FormikMultiSelectDropdown, FormikNumericInput, GroupHeader, MultiSelectionDropdown, NumberField, Registry, ResourceOptionIcon, STANDARD_MAX_DURATION_RANGE, StatusBlock, applySecondaryField, collectFieldsWithDefaults, collectPartitionDurationIssues, enforceOneMustBeTrue, findSecondaryOption, findSelfReferencingFieldNames, flattenGroups, formatSecondsAsSlurmDuration, getInstanceTypesForForm, getInvalidDurationPaths, getPlaceholder, impureSetValueFromPath, initializeValues, parseSlurmDuration, resolveMetaOverrides, resolvePwString, resolvePwValue, resolvedFlag, setDurationValidity, useDynamicDefaultsSync, useFieldControlProps, useFieldLabelledByProps, useFieldRequired, useParsedOpts };
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { DEFAULT_PRESET, THEME_PRESETS, THEME_TOKENS, applyTheme, contrastRatio, deriveTheme, isDarkColor } from "./theme/index.js";
2
2
  import { AlertIcon, AngleRightIcon, EyeIcon, EyeOffIcon, FilterIcon, LoaderIcon, SortDownIcon, SortUnsortedIcon, SortUpIcon } from "./icons.js";
3
- import { a as CreateModalSelect, c as ConfirmModal, d as primaryButtonClasses, f as Markdown, h as Callout, i as CreateModalField, l as dangerButtonClasses, m as CopyToClipboard, n as CreateModal, o as CreateModalSwitch, p as CopyCodeBlock, r as CreateModalAutocompleteField, s as CreateModalTextarea, t as CREATE_MODAL_SELECT_FILTER_THRESHOLD, u as ghostButtonClasses } from "./chunks/CreateModal-DoA2WsXf.js";
3
+ import { a as CreateModalSelect, c as ConfirmModal, d as primaryButtonClasses, f as Markdown, h as Callout, i as CreateModalField, l as dangerButtonClasses, m as CopyToClipboard, n as CreateModal, o as CreateModalSwitch, p as CopyCodeBlock, r as CreateModalAutocompleteField, s as CreateModalTextarea, t as CREATE_MODAL_SELECT_FILTER_THRESHOLD, u as ghostButtonClasses } from "./chunks/CreateModal-B7smkHkv.js";
4
4
  import { a as useProvisionCorsRules, c as useStrings, i as useNotify, l as useWorkflowJsonResolver, n as useLink, o as useRunFile, r as useNavigation, s as useSlots, t as UIProvider } from "./chunks/Provider-CbFVFB7O.js";
5
5
  import { a as truncationTooltipProps, i as formatTooltipContent, n as TOOLTIP_ID, r as TooltipInfo, t as GlobalTooltip } from "./chunks/Tooltip-n9w7Tkt1.js";
6
- import { c as isOption, i as filterOption, l as toggleSetMember, n as StatusDot, o as flattenOptions, r as DropdownCaret, s as isCategory, t as StatusBadge } from "./chunks/StatusBadge-RRUI78iS.js";
7
- import { a as UncontrolledCollapsiblePanel, c as Dropdown, i as MaybeCollapsible, n as SectionHeader, o as MultiSelectDropdown, r as ControlledCollapsiblePanel, s as CustomListbox, t as SwitchToggle } from "./chunks/SwitchToggle-DbW0Q__L.js";
6
+ import { c as isOption, i as filterOption, l as toggleSetMember, n as StatusDot, o as flattenOptions, r as DropdownCaret, s as isCategory, t as StatusBadge } from "./chunks/StatusBadge-zvEtK16a.js";
7
+ import { a as UncontrolledCollapsiblePanel, c as Dropdown, i as MaybeCollapsible, n as SectionHeader, o as MultiSelectDropdown, r as ControlledCollapsiblePanel, s as CustomListbox, t as SwitchToggle } from "./chunks/SwitchToggle-3V836Cn7.js";
8
8
  import { t as Loader } from "./chunks/Loader-BXoXTZGc.js";
9
9
  import { n as modalPanelClasses, t as BareModal } from "./chunks/BareModal-BqroLbZ5.js";
10
- import { C as useSetDefaultBreadcrumbs, S as useSetBreadcrumbs, a as HeaderAddButton, b as useClearBreadcrumbs, c as PageHeader, i as HeaderActionMenu, l as headerActionButtonClasses, n as BreadcrumbsRightAction, o as HeaderEditButton, r as BreadcrumbsTitleAction, s as HeaderRowMenu, t as BreadcrumbsActionButton, v as BreadcrumbProvider, w as AddMenu, x as useHideBreadcrumbs, y as useBreadcrumb } from "./chunks/PageHeader-CxxbidPp.js";
10
+ import { C as useSetDefaultBreadcrumbs, S as useSetBreadcrumbs, a as HeaderAddButton, b as useClearBreadcrumbs, c as PageHeader, i as HeaderActionMenu, l as headerActionButtonClasses, n as BreadcrumbsRightAction, o as HeaderEditButton, r as BreadcrumbsTitleAction, s as HeaderRowMenu, t as BreadcrumbsActionButton, v as BreadcrumbProvider, w as AddMenu, x as useHideBreadcrumbs, y as useBreadcrumb } from "./chunks/PageHeader-CoZWF0pJ.js";
11
11
  import { t as useCssIsDark } from "./chunks/useCssIsDark-DHr05dG2.js";
12
12
  import { t as Indicator } from "./chunks/Indicator-hBSIxOPK.js";
13
13
  import { t as SwitchToggleSmall } from "./chunks/SwitchToggleSmall-FcsaYSTs.js";
@@ -20,7 +20,7 @@ import Skeleton from "react-loading-skeleton";
20
20
  //#region src/components/DescriptionList.tsx
21
21
  function DescriptionListItem({ label, children, tooltip, className, ...props }) {
22
22
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("dt", {
23
- className: cx("leading-6 col-span-1 font-normal flex gap-1", className),
23
+ className: cx("text-[13px] leading-6 col-span-1 font-normal flex gap-1", className),
24
24
  children: [/* @__PURE__ */ jsx("span", {
25
25
  className: "min-w-0 truncate",
26
26
  children: label
@@ -30,7 +30,7 @@ function DescriptionListItem({ label, children, tooltip, className, ...props })
30
30
  })]
31
31
  }), /* @__PURE__ */ jsx("dd", {
32
32
  ...props,
33
- className: "flex leading-6 col-span-4 font-light items-center overflow-auto",
33
+ className: "flex text-[13px] leading-6 col-span-4 font-light items-center overflow-auto",
34
34
  children
35
35
  })] });
36
36
  }
@@ -39,7 +39,7 @@ function DescriptionList({ children, title, separators = true, subtitle, classNa
39
39
  className: cx("w-full", wrapperClassName),
40
40
  children: [
41
41
  title && /* @__PURE__ */ jsx("h2", {
42
- className: "text-lg font-semibold w-full mb-1",
42
+ className: "text-sm font-semibold w-full mb-1",
43
43
  children: title
44
44
  }),
45
45
  subtitle && /* @__PURE__ */ jsx("div", {
@@ -38,6 +38,8 @@ export interface PinnedRowAction {
38
38
  icon: ReactNode;
39
39
  onSelect: () => void;
40
40
  disabled?: boolean | undefined;
41
+ /** Replaces the label on hover when the action is disabled, explaining why. */
42
+ tooltip?: string | undefined;
41
43
  }
42
44
  export declare function ListRow({ href, items, goTo, openMenu, pinnedActions, selected, selectionActive, onRowSelect, leading, className, children, }: {
43
45
  href: string | null;
@@ -18,11 +18,12 @@ export declare const listTableFixedProps: {
18
18
  readonly tbodyClassName: 'divide-y border-b border-(--theme-border) divide-(--theme-border)';
19
19
  readonly className: string;
20
20
  };
21
- export declare function NameCell({ icon, name, subtitle, href, }: {
21
+ export declare function NameCell({ icon, name, subtitle, href, badge, }: {
22
22
  icon: ReactNode;
23
23
  name: string;
24
24
  subtitle?: string | undefined;
25
25
  href: string | null;
26
+ badge?: ReactNode;
26
27
  }): import("react").JSX.Element;
27
28
  export declare function GroupRow({ label, count, colSpan, }: {
28
29
  label: string;
@@ -12,6 +12,8 @@ export type RowMenuItem = {
12
12
  icon?: ReactNode;
13
13
  destructive?: boolean | undefined;
14
14
  disabled?: boolean | undefined;
15
+ /** Shown on hover when the item is disabled, explaining why. */
16
+ tooltip?: string | undefined;
15
17
  /** Trailing checkmark, e.g. the active option in a radio-style submenu. */
16
18
  selected?: boolean;
17
19
  /** Declarative clipboard copy: the menu performs it and notifies, so
@@ -39,6 +41,8 @@ export interface RowAction {
39
41
  to?: string | undefined;
40
42
  disabled?: boolean | undefined;
41
43
  destructive?: boolean | undefined;
44
+ /** Shown on hover when the action is disabled, explaining why. */
45
+ tooltip?: string | undefined;
42
46
  }
43
47
  /** Converts a single row action to a menu item: a `to` makes it a link, otherwise an action. */
44
48
  export declare function toRowMenuItem(action: RowAction): RowMenuItem;
@@ -54,6 +58,7 @@ export declare function toolbarActionToRowAction(action: {
54
58
  onClick?: (() => void) | undefined;
55
59
  href?: string | undefined;
56
60
  disabled?: boolean | undefined;
61
+ disabledTooltip?: string | undefined;
57
62
  }): RowAction;
58
63
  /** Assembles a row's context menu in the shared order: leading link(s) → middle
59
64
  * actions → extra items → Copy submenu → trailing (destructive) actions last. */
@@ -1,3 +1,3 @@
1
- import { _ as useRowMenuActive, d as assembleRowMenu, f as copySubmenu, g as useRowMenu, h as toolbarActionToRowAction, m as toRowMenuItem, p as rowContextMenuProps, u as MoreButton } from "../chunks/PageHeader-CxxbidPp.js";
2
- import { A as ActionToolbar, C as ListSkeleton, D as actionsColumnWidth, E as RowSelectCheckbox, M as stickyTabsClasses, N as stickyTabsUnderHeaderClasses, O as listTableFixedProps, P as stickyToolbarClasses, S as ListError, T as NameCell, _ as ListRow, a as ListCount, b as GroupRow, c as ListDisplayMenu, d as isTextEntryContext, f as DEFAULT_ORDER, g as ListPage, h as ListColumns, i as ListPager, j as ToolbarButton, k as listTableProps, l as ListFilterMenu, m as useListView, n as useHoverCard, o as ListSearchControl, p as FAVORITE_ORDER, r as LIST_PAGE_SIZES, s as useListSearch, t as HoverCardSurface, u as listControlButtonClasses, v as ListRowActionsProvider, w as NAME_MIN_WIDTH_PX, x as ListActionsHeader, y as useListNavigate } from "../chunks/list-CBZpAYP7.js";
1
+ import { _ as useRowMenuActive, d as assembleRowMenu, f as copySubmenu, g as useRowMenu, h as toolbarActionToRowAction, m as toRowMenuItem, p as rowContextMenuProps, u as MoreButton } from "../chunks/PageHeader-CoZWF0pJ.js";
2
+ import { A as ActionToolbar, C as ListSkeleton, D as actionsColumnWidth, E as RowSelectCheckbox, M as stickyTabsClasses, N as stickyTabsUnderHeaderClasses, O as listTableFixedProps, P as stickyToolbarClasses, S as ListError, T as NameCell, _ as ListRow, a as ListCount, b as GroupRow, c as ListDisplayMenu, d as isTextEntryContext, f as DEFAULT_ORDER, g as ListPage, h as ListColumns, i as ListPager, j as ToolbarButton, k as listTableProps, l as ListFilterMenu, m as useListView, n as useHoverCard, o as ListSearchControl, p as FAVORITE_ORDER, r as LIST_PAGE_SIZES, s as useListSearch, t as HoverCardSurface, u as listControlButtonClasses, v as ListRowActionsProvider, w as NAME_MIN_WIDTH_PX, x as ListActionsHeader, y as useListNavigate } from "../chunks/list-CduoUsMW.js";
3
3
  export { ActionToolbar, DEFAULT_ORDER, FAVORITE_ORDER, GroupRow, HoverCardSurface, LIST_PAGE_SIZES, ListActionsHeader, ListColumns, ListCount, ListDisplayMenu, ListError, ListFilterMenu, ListPage, ListPager, ListRow, ListRowActionsProvider, ListSearchControl, ListSkeleton, MoreButton, NAME_MIN_WIDTH_PX, NameCell, RowSelectCheckbox, ToolbarButton, actionsColumnWidth, assembleRowMenu, copySubmenu, isTextEntryContext, listControlButtonClasses, listTableFixedProps, listTableProps, rowContextMenuProps, stickyTabsClasses, stickyTabsUnderHeaderClasses, stickyToolbarClasses, toRowMenuItem, toolbarActionToRowAction, useHoverCard, useListNavigate, useListSearch, useListView, useRowMenu, useRowMenuActive };
@@ -236,3 +236,43 @@
236
236
  opacity: 1;
237
237
  }
238
238
  }
239
+
240
+ /* Native controls and labels inside a DynamicForm. The ACTIVATE app declares the
241
+ * same rules globally; hosts that only import this package (docs, embeds) get
242
+ * unstyled inputs without them. Base layer so field utilities still win. */
243
+ @layer base {
244
+ .pw-form input,
245
+ .pw-form textarea {
246
+ border-radius: 0.25rem;
247
+ border: 1px solid var(--theme-border, #d1d5db);
248
+ padding: 0.25rem 0.5rem;
249
+ min-height: 1.25rem;
250
+ font-size: 14px;
251
+ background-color: var(--theme-input-bg, #f9fafb);
252
+ color: var(--theme-app, #000000);
253
+ }
254
+ .pw-form input:disabled,
255
+ .pw-form textarea:disabled {
256
+ cursor: not-allowed;
257
+ background-color: var(--theme-input-disabled-bg, #f3f4f6);
258
+ color: var(--theme-input-disabled-text, #9ca3af);
259
+ }
260
+ .pw-form .form-label,
261
+ .pw-form .form-label-compact,
262
+ .pw-form .form-label-top {
263
+ display: flex;
264
+ align-items: center;
265
+ gap: 0.25rem;
266
+ flex-shrink: 0;
267
+ font-weight: 300;
268
+ height: 34px;
269
+ width: 13rem;
270
+ }
271
+ .pw-form .form-label-compact {
272
+ width: fit-content;
273
+ margin-right: 0.5rem;
274
+ }
275
+ .pw-form .form-label-top {
276
+ height: 20px;
277
+ }
278
+ }