@homebound/beam 4.55.1 → 4.56.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.
package/dist/index.d.cts CHANGED
@@ -10268,6 +10268,7 @@ type WorkflowDestructiveAction = {
10268
10268
  confirmTitle?: ReactNode;
10269
10269
  confirmMessage?: ReactNode;
10270
10270
  };
10271
+ type WorkflowCompleteLabel = "Create" | "Save" | "Publish";
10271
10272
  type WorkflowActionsProps = {
10272
10273
  /** Leaves the workflow without saving. Always shown. */
10273
10274
  onCancel: (e: PressEvent) => void;
@@ -10275,10 +10276,12 @@ type WorkflowActionsProps = {
10275
10276
  onSaveAndExit?: (e: PressEvent) => void | Promise<void>;
10276
10277
  /** Destructive action on the workflow, rendered as a `danger` button before Continue/Complete. */
10277
10278
  destructiveAction?: WorkflowDestructiveAction;
10278
- /** Label for the completion button shown on the last step (or when there is no next step). */
10279
- completeLabel: "Create" | "Save";
10280
10279
  /** Called when the completion button is clicked. */
10281
10280
  onComplete: (e: PressEvent) => void | Promise<void>;
10281
+ /** `"Create"`, `"Save"`, or `"Publish"`. Defaults to `"Save"`. */
10282
+ completeLabel?: WorkflowCompleteLabel;
10283
+ /** One-off label. Wins over `completeLabel`. Confirm with product and/or design first. */
10284
+ nonStandardCompleteLabel?: string;
10282
10285
  /** Continue/Complete is disabled. A ReactNode is shown in Beam's tooltip. */
10283
10286
  primaryDisabled?: boolean | ReactNode;
10284
10287
  /** When true, Continue/Complete use the `ai` button variant instead of `primary`. */
@@ -11640,14 +11643,14 @@ type RightPaneTrigger = {
11640
11643
  /** The pending in-app navigation, as React Router reports it (pathnames are basename-stripped). */
11641
11644
  type AllowNavigationArgs = Parameters<BlockerFunction>[0];
11642
11645
 
11643
- type FocusedFormLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix" | "breadcrumbs"> & Pick<WorkflowActionsProps, "onCancel" | "completeLabel" | "onComplete" | "onSaveAndExit" | "destructiveAction"> & {
11644
- /** Create/Save is disabled. A ReactNode is shown in Beam's tooltip. */
11646
+ type FocusedFormLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix" | "breadcrumbs"> & Pick<WorkflowActionsProps, "onCancel" | "onComplete" | "onSaveAndExit" | "destructiveAction" | "completeLabel" | "nonStandardCompleteLabel"> & {
11647
+ /** Create/Save/Publish is disabled. A ReactNode is shown in Beam's tooltip. */
11645
11648
  primaryDisabled?: WorkflowActionsProps["primaryDisabled"];
11646
11649
  /** Read on Cancel / leave — a callback so flipping dirty does not re-render. */
11647
11650
  isDirty?: () => boolean;
11648
11651
  /** Consulted only while dirty — return true to allow a route change that stays on this form. */
11649
11652
  allowNavigation?: (args: AllowNavigationArgs) => boolean;
11650
- /** Full-bleed AI wash on the body and the `ai` Create/Save variant. Pair with body `aiMode` (e.g. FormSectionLayout). */
11653
+ /** Full-bleed AI wash on the body and the `ai` Create/Save/Publish variant. Pair with body `aiMode` (e.g. FormSectionLayout). */
11651
11654
  aiMode?: boolean;
11652
11655
  /** Icon triggers that open the document-scroll right pane. Hosts the pane — do not also set `withRightPane` on the body. */
11653
11656
  rightPaneTriggers?: RightPaneTrigger[];
@@ -11676,7 +11679,7 @@ type StepperLayoutStep = Omit<StepperTabsStep, "value" | "disabled"> & {
11676
11679
  /** Icon triggers for this step. Chrome is rendered by the workflow; the pane closes on step change. */
11677
11680
  rightPaneTriggers?: RightPaneTrigger[];
11678
11681
  };
11679
- type StepperLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix" | "breadcrumbs"> & Pick<WorkflowActionsProps, "onCancel" | "completeLabel" | "onComplete" | "onSaveAndExit" | "destructiveAction"> & {
11682
+ type StepperLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix" | "breadcrumbs"> & Pick<WorkflowActionsProps, "onCancel" | "onComplete" | "onSaveAndExit" | "destructiveAction" | "completeLabel" | "nonStandardCompleteLabel"> & {
11680
11683
  /** The workflow's steps; the active step's `content` is the body, and it drives the header's tab strip. */
11681
11684
  steps: StepperLayoutStep[];
11682
11685
  /** The step shown initially (matched against `defaultTestId(step.label)`); falls back to the first step if omitted or if it doesn't match any step. Uncontrolled — the layout owns step navigation from here. */
package/dist/index.d.ts CHANGED
@@ -10268,6 +10268,7 @@ type WorkflowDestructiveAction = {
10268
10268
  confirmTitle?: ReactNode;
10269
10269
  confirmMessage?: ReactNode;
10270
10270
  };
10271
+ type WorkflowCompleteLabel = "Create" | "Save" | "Publish";
10271
10272
  type WorkflowActionsProps = {
10272
10273
  /** Leaves the workflow without saving. Always shown. */
10273
10274
  onCancel: (e: PressEvent) => void;
@@ -10275,10 +10276,12 @@ type WorkflowActionsProps = {
10275
10276
  onSaveAndExit?: (e: PressEvent) => void | Promise<void>;
10276
10277
  /** Destructive action on the workflow, rendered as a `danger` button before Continue/Complete. */
10277
10278
  destructiveAction?: WorkflowDestructiveAction;
10278
- /** Label for the completion button shown on the last step (or when there is no next step). */
10279
- completeLabel: "Create" | "Save";
10280
10279
  /** Called when the completion button is clicked. */
10281
10280
  onComplete: (e: PressEvent) => void | Promise<void>;
10281
+ /** `"Create"`, `"Save"`, or `"Publish"`. Defaults to `"Save"`. */
10282
+ completeLabel?: WorkflowCompleteLabel;
10283
+ /** One-off label. Wins over `completeLabel`. Confirm with product and/or design first. */
10284
+ nonStandardCompleteLabel?: string;
10282
10285
  /** Continue/Complete is disabled. A ReactNode is shown in Beam's tooltip. */
10283
10286
  primaryDisabled?: boolean | ReactNode;
10284
10287
  /** When true, Continue/Complete use the `ai` button variant instead of `primary`. */
@@ -11640,14 +11643,14 @@ type RightPaneTrigger = {
11640
11643
  /** The pending in-app navigation, as React Router reports it (pathnames are basename-stripped). */
11641
11644
  type AllowNavigationArgs = Parameters<BlockerFunction>[0];
11642
11645
 
11643
- type FocusedFormLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix" | "breadcrumbs"> & Pick<WorkflowActionsProps, "onCancel" | "completeLabel" | "onComplete" | "onSaveAndExit" | "destructiveAction"> & {
11644
- /** Create/Save is disabled. A ReactNode is shown in Beam's tooltip. */
11646
+ type FocusedFormLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix" | "breadcrumbs"> & Pick<WorkflowActionsProps, "onCancel" | "onComplete" | "onSaveAndExit" | "destructiveAction" | "completeLabel" | "nonStandardCompleteLabel"> & {
11647
+ /** Create/Save/Publish is disabled. A ReactNode is shown in Beam's tooltip. */
11645
11648
  primaryDisabled?: WorkflowActionsProps["primaryDisabled"];
11646
11649
  /** Read on Cancel / leave — a callback so flipping dirty does not re-render. */
11647
11650
  isDirty?: () => boolean;
11648
11651
  /** Consulted only while dirty — return true to allow a route change that stays on this form. */
11649
11652
  allowNavigation?: (args: AllowNavigationArgs) => boolean;
11650
- /** Full-bleed AI wash on the body and the `ai` Create/Save variant. Pair with body `aiMode` (e.g. FormSectionLayout). */
11653
+ /** Full-bleed AI wash on the body and the `ai` Create/Save/Publish variant. Pair with body `aiMode` (e.g. FormSectionLayout). */
11651
11654
  aiMode?: boolean;
11652
11655
  /** Icon triggers that open the document-scroll right pane. Hosts the pane — do not also set `withRightPane` on the body. */
11653
11656
  rightPaneTriggers?: RightPaneTrigger[];
@@ -11676,7 +11679,7 @@ type StepperLayoutStep = Omit<StepperTabsStep, "value" | "disabled"> & {
11676
11679
  /** Icon triggers for this step. Chrome is rendered by the workflow; the pane closes on step change. */
11677
11680
  rightPaneTriggers?: RightPaneTrigger[];
11678
11681
  };
11679
- type StepperLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix" | "breadcrumbs"> & Pick<WorkflowActionsProps, "onCancel" | "completeLabel" | "onComplete" | "onSaveAndExit" | "destructiveAction"> & {
11682
+ type StepperLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix" | "breadcrumbs"> & Pick<WorkflowActionsProps, "onCancel" | "onComplete" | "onSaveAndExit" | "destructiveAction" | "completeLabel" | "nonStandardCompleteLabel"> & {
11680
11683
  /** The workflow's steps; the active step's `content` is the body, and it drives the header's tab strip. */
11681
11684
  steps: StepperLayoutStep[];
11682
11685
  /** The step shown initially (matched against `defaultTestId(step.label)`); falls back to the first step if omitted or if it doesn't match any step. Uncontrolled — the layout owns step navigation from here. */
package/dist/index.js CHANGED
@@ -33945,26 +33945,28 @@ function WorkflowActions(props) {
33945
33945
  onCancel,
33946
33946
  onSaveAndExit,
33947
33947
  destructiveAction,
33948
- completeLabel,
33949
33948
  onComplete,
33950
33949
  primaryDisabled,
33951
33950
  aiMode = false,
33952
33951
  isFirstStep = true,
33953
33952
  isLastStep = true,
33954
33953
  onBack,
33955
- onContinue
33954
+ onContinue,
33955
+ completeLabel,
33956
+ nonStandardCompleteLabel
33956
33957
  } = props;
33957
33958
  const {
33958
33959
  sm: isMobile
33959
33960
  } = useBreakpoint();
33960
33961
  const primaryVariant = aiMode ? "ai" : "primary";
33962
+ const completeButtonLabel = nonStandardCompleteLabel ?? completeLabel ?? "Save";
33961
33963
  return /* @__PURE__ */ jsxs147("div", { className: "df aic jcsb sm_w100", children: [
33962
33964
  /* @__PURE__ */ jsx273("div", { className: "df aic", children: !isFirstStep && isMobile && onBack && /* @__PURE__ */ jsx273(IconButton, { icon: "arrowBack", label: "Back", onClick: onBack }) }),
33963
33965
  /* @__PURE__ */ jsxs147("div", { className: "df aic g_1", children: [
33964
33966
  /* @__PURE__ */ jsx273(Button, { label: "Cancel", variant: "quaternary", onClick: onCancel }),
33965
33967
  onSaveAndExit && /* @__PURE__ */ jsx273(Button, { label: "Save & Exit", variant: "secondary", onClick: onSaveAndExit }),
33966
33968
  destructiveAction && /* @__PURE__ */ jsx273(Button, { label: destructiveAction.label ?? "Remove", variant: "danger", onClick: destructiveAction.onConfirm }),
33967
- isLastStep ? /* @__PURE__ */ jsx273(Button, { label: completeLabel, variant: primaryVariant, onClick: onComplete, disabled: primaryDisabled }) : /* @__PURE__ */ jsx273(Button, { label: "Continue", variant: primaryVariant, onClick: async () => {
33969
+ isLastStep ? /* @__PURE__ */ jsx273(Button, { label: completeButtonLabel, variant: primaryVariant, onClick: onComplete, disabled: primaryDisabled }) : /* @__PURE__ */ jsx273(Button, { label: "Continue", variant: primaryVariant, onClick: async () => {
33968
33970
  await onContinue?.();
33969
33971
  }, disabled: primaryDisabled })
33970
33972
  ] })
@@ -33992,7 +33994,15 @@ function WorkflowPageLayout(props) {
33992
33994
  destructiveAction,
33993
33995
  rightPaneTriggers,
33994
33996
  banner: bannerProp,
33995
- ...actionProps
33997
+ onSaveAndExit,
33998
+ onComplete,
33999
+ primaryDisabled,
34000
+ isFirstStep,
34001
+ isLastStep,
34002
+ onBack,
34003
+ onContinue,
34004
+ completeLabel,
34005
+ nonStandardCompleteLabel
33996
34006
  } = props;
33997
34007
  const tid = useTestIds(props, "workflowPageLayout");
33998
34008
  const {
@@ -34012,7 +34022,7 @@ function WorkflowPageLayout(props) {
34012
34022
  onCancel,
34013
34023
  destructiveAction
34014
34024
  });
34015
- const actions = /* @__PURE__ */ jsx274(WorkflowActions, { ...actionProps, aiMode, onCancel: onCancelClick, destructiveAction: destructiveAction && {
34025
+ const actions = /* @__PURE__ */ jsx274(WorkflowActions, { completeLabel, nonStandardCompleteLabel, onSaveAndExit, onComplete, primaryDisabled, isFirstStep, isLastStep, onBack, onContinue, aiMode, onCancel: onCancelClick, destructiveAction: destructiveAction && {
34016
34026
  ...destructiveAction,
34017
34027
  onConfirm: onDestructiveActionClick
34018
34028
  } });
@@ -34140,7 +34150,6 @@ import { jsx as jsx275 } from "react/jsx-runtime";
34140
34150
  function FocusedFormLayout(props) {
34141
34151
  const {
34142
34152
  onCancel,
34143
- completeLabel,
34144
34153
  onComplete,
34145
34154
  onSaveAndExit,
34146
34155
  destructiveAction,
@@ -34151,14 +34160,20 @@ function FocusedFormLayout(props) {
34151
34160
  rightPaneTriggers,
34152
34161
  banner,
34153
34162
  children,
34154
- ...headerProps
34163
+ title,
34164
+ documentTitleSuffix,
34165
+ breadcrumbs,
34166
+ completeLabel,
34167
+ nonStandardCompleteLabel
34155
34168
  } = props;
34156
34169
  const tid = useTestIds(props, "focusedFormLayout");
34157
34170
  return /* @__PURE__ */ jsx275(
34158
34171
  WorkflowPageLayout,
34159
34172
  {
34160
34173
  ...tid,
34161
- ...headerProps,
34174
+ title,
34175
+ documentTitleSuffix,
34176
+ breadcrumbs,
34162
34177
  banner,
34163
34178
  aiMode,
34164
34179
  isDirty,
@@ -34167,6 +34182,7 @@ function FocusedFormLayout(props) {
34167
34182
  onSaveAndExit,
34168
34183
  destructiveAction,
34169
34184
  completeLabel,
34185
+ nonStandardCompleteLabel,
34170
34186
  onComplete,
34171
34187
  primaryDisabled,
34172
34188
  rightPaneTriggers,
@@ -34183,7 +34199,6 @@ function StepperLayout(props) {
34183
34199
  steps,
34184
34200
  defaultStep,
34185
34201
  onCancel,
34186
- completeLabel,
34187
34202
  onComplete,
34188
34203
  onSaveAndExit,
34189
34204
  destructiveAction,
@@ -34191,7 +34206,11 @@ function StepperLayout(props) {
34191
34206
  allowNavigation,
34192
34207
  aiMode,
34193
34208
  banner,
34194
- ...headerProps
34209
+ title,
34210
+ documentTitleSuffix,
34211
+ breadcrumbs,
34212
+ completeLabel,
34213
+ nonStandardCompleteLabel
34195
34214
  } = props;
34196
34215
  const stepTabs = steps.map((step) => ({ ...step, value: defaultTestId(step.label) }));
34197
34216
  const [currentStep, setCurrentStep] = useState72(() => getInitialStep(stepTabs, defaultStep));
@@ -34208,7 +34227,9 @@ function StepperLayout(props) {
34208
34227
  WorkflowPageLayout,
34209
34228
  {
34210
34229
  ...tid,
34211
- ...headerProps,
34230
+ title,
34231
+ documentTitleSuffix,
34232
+ breadcrumbs,
34212
34233
  banner,
34213
34234
  aiMode,
34214
34235
  stepperTabs: { steps: stepTabs, currentStep, onChange: goToStep },
@@ -34224,6 +34245,7 @@ function StepperLayout(props) {
34224
34245
  onSaveAndExit,
34225
34246
  destructiveAction,
34226
34247
  completeLabel,
34248
+ nonStandardCompleteLabel,
34227
34249
  onComplete,
34228
34250
  primaryDisabled: activeStep?.primaryDisabled,
34229
34251
  rightPaneTriggers: activeStep?.rightPaneTriggers,