@homebound/beam 4.10.0 → 4.11.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.cjs +328 -240
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -5
- package/dist/index.d.ts +20 -5
- package/dist/index.js +300 -212
- package/dist/index.js.map +1 -1
- package/dist/truss.css +2 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6055,13 +6055,14 @@ function IconButton(props) {
|
|
|
6055
6055
|
const isCircle = variant === "circle";
|
|
6056
6056
|
const isOutline = variant === "outline";
|
|
6057
6057
|
const styles = (0, import_react8.useMemo)(() => {
|
|
6058
|
-
const variantKey = isCircle ? "circle" : isOutline ? "outline" : compact ? "compact" : "default";
|
|
6059
6058
|
const {
|
|
6060
6059
|
base,
|
|
6061
6060
|
hover,
|
|
6062
6061
|
focus,
|
|
6063
6062
|
pressed
|
|
6064
|
-
} = variantStyles
|
|
6063
|
+
} = variantStyles(variant, {
|
|
6064
|
+
compact
|
|
6065
|
+
});
|
|
6065
6066
|
return {
|
|
6066
6067
|
...iconButtonStylesReset,
|
|
6067
6068
|
...base,
|
|
@@ -6075,7 +6076,7 @@ function IconButton(props) {
|
|
|
6075
6076
|
}]
|
|
6076
6077
|
}
|
|
6077
6078
|
};
|
|
6078
|
-
}, [isHovered, isFocusVisible, isDisabled, compact,
|
|
6079
|
+
}, [isHovered, isFocusVisible, isDisabled, compact, variant, isPressing, bgColor, forceFocusStyles]);
|
|
6079
6080
|
const iconColor = isCircle ? circleIconColor : defaultIconColor;
|
|
6080
6081
|
const buttonAttrs = {
|
|
6081
6082
|
...testIds,
|
|
@@ -6112,36 +6113,93 @@ var iconButtonStylesDisabled = {
|
|
|
6112
6113
|
"--backgroundColor": "var(--b-surface-disabled)"
|
|
6113
6114
|
}]
|
|
6114
6115
|
};
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6116
|
+
function variantStyles(variant, {
|
|
6117
|
+
compact
|
|
6118
|
+
}) {
|
|
6119
|
+
if (variant === "circle") {
|
|
6120
|
+
return {
|
|
6121
|
+
base: {
|
|
6122
|
+
borderRadius: "br100",
|
|
6123
|
+
height: ["sq_var", {
|
|
6124
|
+
"--height": `${compact ? 32 : 48}px`
|
|
6125
|
+
}],
|
|
6126
|
+
width: ["sq_var", {
|
|
6127
|
+
"--width": `${compact ? 32 : 48}px`
|
|
6128
|
+
}],
|
|
6129
|
+
borderColor: ["bc_var", {
|
|
6130
|
+
"--borderColor": "var(--b-field-border-default)"
|
|
6131
|
+
}],
|
|
6132
|
+
borderStyle: "bss",
|
|
6133
|
+
borderWidth: "bw1",
|
|
6134
|
+
display: "df",
|
|
6135
|
+
justifyContent: "jcc",
|
|
6136
|
+
alignItems: "aic",
|
|
6137
|
+
backgroundColor: ["bgColor_var", {
|
|
6138
|
+
"--backgroundColor": "var(--b-surface-raised)"
|
|
6139
|
+
}]
|
|
6140
|
+
},
|
|
6141
|
+
hover: {
|
|
6142
|
+
backgroundColor: "bgBlue100",
|
|
6143
|
+
borderColor: "bcBlue200"
|
|
6144
|
+
},
|
|
6145
|
+
focus: {
|
|
6146
|
+
backgroundColor: "bgBlue100",
|
|
6147
|
+
borderColor: ["bc_var", {
|
|
6148
|
+
"--borderColor": "var(--b-field-border-focus)"
|
|
6149
|
+
}]
|
|
6150
|
+
},
|
|
6151
|
+
pressed: {
|
|
6152
|
+
backgroundColor: ["bgColor_var", {
|
|
6153
|
+
"--backgroundColor": "var(--b-neutral-fill-pressed)"
|
|
6154
|
+
}],
|
|
6155
|
+
borderColor: ["bc_var", {
|
|
6156
|
+
"--borderColor": "var(--b-neutral-fill-pressed)"
|
|
6157
|
+
}]
|
|
6158
|
+
}
|
|
6159
|
+
};
|
|
6160
|
+
}
|
|
6161
|
+
if (variant === "outline") {
|
|
6162
|
+
return {
|
|
6163
|
+
base: {
|
|
6164
|
+
borderRadius: "br8",
|
|
6165
|
+
width: "w_42px",
|
|
6166
|
+
height: "h_40px",
|
|
6167
|
+
borderColor: "bcGray300",
|
|
6168
|
+
borderStyle: "bss",
|
|
6169
|
+
borderWidth: "bw1",
|
|
6170
|
+
display: "df",
|
|
6171
|
+
justifyContent: "jcc",
|
|
6172
|
+
alignItems: "aic",
|
|
6173
|
+
backgroundColor: ["bgColor_var", {
|
|
6174
|
+
"--backgroundColor": "var(--b-surface-raised)"
|
|
6175
|
+
}]
|
|
6176
|
+
},
|
|
6177
|
+
hover: {
|
|
6178
|
+
backgroundColor: ["bgColor_var", {
|
|
6179
|
+
"--backgroundColor": "var(--b-surface-raised-hover)"
|
|
6180
|
+
}]
|
|
6181
|
+
},
|
|
6182
|
+
focus: {
|
|
6183
|
+
boxShadow: "bshFocus"
|
|
6184
|
+
},
|
|
6185
|
+
pressed: {
|
|
6186
|
+
backgroundColor: ["bgColor_var", {
|
|
6187
|
+
"--backgroundColor": "var(--b-surface-raised-pressed)"
|
|
6188
|
+
}]
|
|
6189
|
+
}
|
|
6190
|
+
};
|
|
6191
|
+
}
|
|
6192
|
+
return {
|
|
6193
|
+
base: compact ? {
|
|
6141
6194
|
height: "h_18px",
|
|
6142
6195
|
width: "w_18px",
|
|
6143
6196
|
borderRadius: "br4",
|
|
6144
6197
|
borderWidth: "bw1"
|
|
6198
|
+
} : {
|
|
6199
|
+
height: "h_28px",
|
|
6200
|
+
width: "w_28px",
|
|
6201
|
+
borderRadius: "br8",
|
|
6202
|
+
borderWidth: "bw2"
|
|
6145
6203
|
},
|
|
6146
6204
|
hover: {
|
|
6147
6205
|
backgroundColor: ["bgColor_var", {
|
|
@@ -6158,71 +6216,8 @@ var variantStyles = {
|
|
|
6158
6216
|
"--backgroundColor": "var(--b-neutral-fill-hover-strong)"
|
|
6159
6217
|
}]
|
|
6160
6218
|
}
|
|
6161
|
-
}
|
|
6162
|
-
|
|
6163
|
-
// Blue100/200 hover fills have no semantic tokens — keep palette for those.
|
|
6164
|
-
base: {
|
|
6165
|
-
borderRadius: "br100",
|
|
6166
|
-
height: "h_48px",
|
|
6167
|
-
width: "w_48px",
|
|
6168
|
-
borderColor: ["bc_var", {
|
|
6169
|
-
"--borderColor": "var(--b-field-border-default)"
|
|
6170
|
-
}],
|
|
6171
|
-
borderStyle: "bss",
|
|
6172
|
-
borderWidth: "bw1",
|
|
6173
|
-
display: "df",
|
|
6174
|
-
justifyContent: "jcc",
|
|
6175
|
-
alignItems: "aic"
|
|
6176
|
-
},
|
|
6177
|
-
hover: {
|
|
6178
|
-
backgroundColor: "bgBlue100",
|
|
6179
|
-
borderColor: "bcBlue200"
|
|
6180
|
-
},
|
|
6181
|
-
focus: {
|
|
6182
|
-
backgroundColor: "bgBlue100",
|
|
6183
|
-
borderColor: ["bc_var", {
|
|
6184
|
-
"--borderColor": "var(--b-field-border-focus)"
|
|
6185
|
-
}]
|
|
6186
|
-
},
|
|
6187
|
-
pressed: {
|
|
6188
|
-
backgroundColor: ["bgColor_var", {
|
|
6189
|
-
"--backgroundColor": "var(--b-neutral-fill-pressed)"
|
|
6190
|
-
}],
|
|
6191
|
-
borderColor: ["bc_var", {
|
|
6192
|
-
"--borderColor": "var(--b-neutral-fill-pressed)"
|
|
6193
|
-
}]
|
|
6194
|
-
}
|
|
6195
|
-
},
|
|
6196
|
-
outline: {
|
|
6197
|
-
base: {
|
|
6198
|
-
borderRadius: "br8",
|
|
6199
|
-
width: "w_42px",
|
|
6200
|
-
height: "h_40px",
|
|
6201
|
-
borderColor: "bcGray300",
|
|
6202
|
-
borderStyle: "bss",
|
|
6203
|
-
borderWidth: "bw1",
|
|
6204
|
-
display: "df",
|
|
6205
|
-
justifyContent: "jcc",
|
|
6206
|
-
alignItems: "aic",
|
|
6207
|
-
backgroundColor: ["bgColor_var", {
|
|
6208
|
-
"--backgroundColor": "var(--b-surface-raised)"
|
|
6209
|
-
}]
|
|
6210
|
-
},
|
|
6211
|
-
hover: {
|
|
6212
|
-
backgroundColor: ["bgColor_var", {
|
|
6213
|
-
"--backgroundColor": "var(--b-surface-raised-hover)"
|
|
6214
|
-
}]
|
|
6215
|
-
},
|
|
6216
|
-
focus: {
|
|
6217
|
-
boxShadow: "bshFocus"
|
|
6218
|
-
},
|
|
6219
|
-
pressed: {
|
|
6220
|
-
backgroundColor: ["bgColor_var", {
|
|
6221
|
-
"--backgroundColor": "var(--b-surface-raised-pressed)"
|
|
6222
|
-
}]
|
|
6223
|
-
}
|
|
6224
|
-
}
|
|
6225
|
-
};
|
|
6219
|
+
};
|
|
6220
|
+
}
|
|
6226
6221
|
|
|
6227
6222
|
// src/components/Table/utils/TableState.ts
|
|
6228
6223
|
var import_mobx8 = require("mobx");
|
|
@@ -6439,6 +6434,8 @@ var zIndices = {
|
|
|
6439
6434
|
scrollShadow: 50,
|
|
6440
6435
|
// Document-scroll detail pane (DocumentScrollOverlayRightPaneLayout) — above table sticky chrome, below page sticky headers.
|
|
6441
6436
|
rightPane: 60,
|
|
6437
|
+
// Workflow floating right-pane triggers — above the pane, below sticky headers.
|
|
6438
|
+
rightPaneTriggers: 65,
|
|
6442
6439
|
pageStickyHeader: 70,
|
|
6443
6440
|
// Sticky mobile action footer (workflow layouts) — same tier as pageStickyHeader; header and footer never overlap on screen.
|
|
6444
6441
|
pageStickyFooter: 70,
|
|
@@ -24045,50 +24042,65 @@ function DocumentScrollRightPane({
|
|
|
24045
24042
|
height: paneBounds.heightPx,
|
|
24046
24043
|
maxHeight: paneBounds.heightPx
|
|
24047
24044
|
} : void 0;
|
|
24048
|
-
const pane = /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(import_framer_motion3.AnimatePresence, { children: isRightPaneOpen && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
|
|
24049
|
-
|
|
24050
|
-
|
|
24051
|
-
|
|
24052
|
-
|
|
24053
|
-
|
|
24054
|
-
|
|
24055
|
-
|
|
24056
|
-
|
|
24057
|
-
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
|
|
24061
|
-
|
|
24062
|
-
|
|
24063
|
-
|
|
24064
|
-
|
|
24065
|
-
|
|
24066
|
-
|
|
24067
|
-
|
|
24068
|
-
|
|
24069
|
-
|
|
24070
|
-
|
|
24071
|
-
|
|
24072
|
-
|
|
24073
|
-
|
|
24074
|
-
|
|
24075
|
-
|
|
24076
|
-
|
|
24077
|
-
|
|
24078
|
-
|
|
24079
|
-
|
|
24080
|
-
|
|
24081
|
-
|
|
24082
|
-
|
|
24083
|
-
|
|
24084
|
-
|
|
24085
|
-
|
|
24086
|
-
|
|
24087
|
-
|
|
24088
|
-
|
|
24089
|
-
|
|
24090
|
-
|
|
24091
|
-
|
|
24045
|
+
const pane = /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(import_framer_motion3.AnimatePresence, { children: isRightPaneOpen && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
|
|
24046
|
+
import_framer_motion3.motion.div,
|
|
24047
|
+
{
|
|
24048
|
+
ref: paneRef,
|
|
24049
|
+
...{
|
|
24050
|
+
[rightPaneContentDataAttribute]: true
|
|
24051
|
+
},
|
|
24052
|
+
...tid,
|
|
24053
|
+
...(0, import_runtime111.mergeProps)(void 0, paneStyle, mobile ? {
|
|
24054
|
+
position: "fixed",
|
|
24055
|
+
right: "right0",
|
|
24056
|
+
bottom: "bottom0",
|
|
24057
|
+
left: "left0",
|
|
24058
|
+
overflowY: "oya",
|
|
24059
|
+
backgroundColor: ["bgColor_var", {
|
|
24060
|
+
"--backgroundColor": "var(--b-surface)"
|
|
24061
|
+
}],
|
|
24062
|
+
zIndex: ["z_var", {
|
|
24063
|
+
"--zIndex": (0, import_runtime111.maybeCssVar)(zIndices.rightPaneMobile)
|
|
24064
|
+
}]
|
|
24065
|
+
} : {
|
|
24066
|
+
position: "fixed",
|
|
24067
|
+
right: "right0",
|
|
24068
|
+
overflowY: "oya",
|
|
24069
|
+
width: ["w_var", {
|
|
24070
|
+
"--width": (0, import_runtime111.maybeCssVar)(__maybeInc20(paneWidthCss))
|
|
24071
|
+
}],
|
|
24072
|
+
backgroundColor: ["bgColor_var", {
|
|
24073
|
+
"--backgroundColor": "var(--b-surface)"
|
|
24074
|
+
}],
|
|
24075
|
+
zIndex: ["z_var", {
|
|
24076
|
+
"--zIndex": (0, import_runtime111.maybeCssVar)(zIndices.rightPane)
|
|
24077
|
+
}],
|
|
24078
|
+
borderLeftStyle: "bls_solid",
|
|
24079
|
+
borderLeftWidth: "blw_1px",
|
|
24080
|
+
borderColor: ["bc_var", {
|
|
24081
|
+
"--borderColor": "var(--b-surface-separator)"
|
|
24082
|
+
}]
|
|
24083
|
+
}),
|
|
24084
|
+
initial: {
|
|
24085
|
+
x: slideX
|
|
24086
|
+
},
|
|
24087
|
+
animate: {
|
|
24088
|
+
x: 0
|
|
24089
|
+
},
|
|
24090
|
+
exit: {
|
|
24091
|
+
x: slideX
|
|
24092
|
+
},
|
|
24093
|
+
transition: {
|
|
24094
|
+
duration: 0.2,
|
|
24095
|
+
ease: [0.4, 0, 0.2, 1]
|
|
24096
|
+
},
|
|
24097
|
+
onAnimationComplete: (definition) => {
|
|
24098
|
+
if (definition.x !== 0 && definition.x !== void 0) releaseAfterExit();
|
|
24099
|
+
},
|
|
24100
|
+
children: rightPaneContent
|
|
24101
|
+
},
|
|
24102
|
+
"documentScrollRightPane"
|
|
24103
|
+
) });
|
|
24092
24104
|
return (0, import_react_dom6.createPortal)(pane, document.body);
|
|
24093
24105
|
}
|
|
24094
24106
|
|
|
@@ -24186,7 +24198,8 @@ function DocumentScrollOverlayRightPaneLayout({
|
|
|
24186
24198
|
}, {
|
|
24187
24199
|
flexShrink: "fs0",
|
|
24188
24200
|
flexGrow: "fg0",
|
|
24189
|
-
height: "h1"
|
|
24201
|
+
height: "h1",
|
|
24202
|
+
transition: "transitionWidth"
|
|
24190
24203
|
}), ...tid.spacer })
|
|
24191
24204
|
] }),
|
|
24192
24205
|
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(DocumentScrollOverlayRightPaneHost, { anchorRef: anchorRef.ref, spacerRef, paneWidth })
|
|
@@ -24211,26 +24224,24 @@ function DocumentScrollOverlayRightPaneHost(props) {
|
|
|
24211
24224
|
return waitForRightPaneExit(() => setKeepOverlayChrome(false));
|
|
24212
24225
|
}, [isRightPaneOpen]);
|
|
24213
24226
|
(0, import_react124.useLayoutEffect)(() => {
|
|
24214
|
-
const layoutRoot = anchorRef.current;
|
|
24215
24227
|
const spacer = spacerRef.current;
|
|
24228
|
+
if (!spacer) return;
|
|
24229
|
+
spacer.style.width = isRightPaneOpen ? paneWidthCss : "0px";
|
|
24230
|
+
}, [isRightPaneOpen, paneWidthCss, spacerRef]);
|
|
24231
|
+
(0, import_react124.useLayoutEffect)(() => {
|
|
24232
|
+
const layoutRoot = anchorRef.current;
|
|
24216
24233
|
if (!layoutRoot) return;
|
|
24217
24234
|
const openPaneWidth = keepOverlayChrome ? paneWidthCss : "0px";
|
|
24218
24235
|
const contentMin = keepOverlayChrome ? `${minDocumentScrollContentWidthPx}px` : "0px";
|
|
24219
24236
|
layoutRoot.style.setProperty(beamRightPaneWidthVar, openPaneWidth);
|
|
24220
24237
|
layoutRoot.style.setProperty(beamRightPaneContentMinVar, contentMin);
|
|
24221
24238
|
document.documentElement.style.setProperty(beamFloatingRightOffsetVar, openPaneWidth);
|
|
24222
|
-
if (spacer) {
|
|
24223
|
-
spacer.style.width = openPaneWidth;
|
|
24224
|
-
}
|
|
24225
24239
|
return () => {
|
|
24226
24240
|
layoutRoot.style.setProperty(beamRightPaneWidthVar, "0px");
|
|
24227
24241
|
layoutRoot.style.setProperty(beamRightPaneContentMinVar, "0px");
|
|
24228
24242
|
document.documentElement.style.setProperty(beamFloatingRightOffsetVar, "0px");
|
|
24229
|
-
if (spacer) {
|
|
24230
|
-
spacer.style.width = "0px";
|
|
24231
|
-
}
|
|
24232
24243
|
};
|
|
24233
|
-
}, [anchorRef, keepOverlayChrome, paneWidthCss
|
|
24244
|
+
}, [anchorRef, keepOverlayChrome, paneWidthCss]);
|
|
24234
24245
|
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(DocumentScrollRightPane, { paneWidth, mobile: false, anchorRef });
|
|
24235
24246
|
}
|
|
24236
24247
|
|
|
@@ -24865,7 +24876,7 @@ function RightPaneLayout(props) {
|
|
|
24865
24876
|
width: ["w_var", {
|
|
24866
24877
|
"--width": (0, import_runtime118.maybeCssVar)(__maybeInc22(`calc(100% - ${paneWidth + 24}px)`))
|
|
24867
24878
|
}],
|
|
24868
|
-
transition: "
|
|
24879
|
+
transition: "transitionWidth",
|
|
24869
24880
|
height: "h100",
|
|
24870
24881
|
marginRight: "mr3",
|
|
24871
24882
|
overflowX: "oxa"
|
|
@@ -24928,13 +24939,13 @@ function RightPaneLayout(props) {
|
|
|
24928
24939
|
x: 0
|
|
24929
24940
|
},
|
|
24930
24941
|
transition: {
|
|
24931
|
-
|
|
24932
|
-
|
|
24942
|
+
duration: 0.2,
|
|
24943
|
+
ease: [0.4, 0, 0.2, 1]
|
|
24933
24944
|
},
|
|
24934
24945
|
exit: {
|
|
24935
24946
|
transition: {
|
|
24936
|
-
|
|
24937
|
-
|
|
24947
|
+
duration: 0.2,
|
|
24948
|
+
ease: [0.4, 0, 0.2, 1]
|
|
24938
24949
|
},
|
|
24939
24950
|
x: paneWidth
|
|
24940
24951
|
},
|
|
@@ -24978,7 +24989,7 @@ function RightPanePanel(props) {
|
|
|
24978
24989
|
flexShrink: "fs0"
|
|
24979
24990
|
}), ...tid.header, children: [
|
|
24980
24991
|
/* @__PURE__ */ (0, import_jsx_runtime180.jsx)("div", { className: "fw6 fz_16px lh_24px", children: title }),
|
|
24981
|
-
withClose && /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(IconButton, { icon: "x", label: "Close", onClick: closeRightPane, ...tid.close })
|
|
24992
|
+
withClose && /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(IconButton, { icon: "x", label: "Close", autoFocus: true, onClick: closeRightPane, ...tid.close })
|
|
24982
24993
|
] }),
|
|
24983
24994
|
/* @__PURE__ */ (0, import_jsx_runtime180.jsx)("div", { className: "fg1 mh0 oya pt2 pb2 pr2 pl2", ...tid.body, children })
|
|
24984
24995
|
] });
|
|
@@ -29389,7 +29400,7 @@ function PageHeaderLayout(props) {
|
|
|
29389
29400
|
}
|
|
29390
29401
|
|
|
29391
29402
|
// src/layouts/Workflow/WorkflowPageLayout.tsx
|
|
29392
|
-
var
|
|
29403
|
+
var import_react169 = require("react");
|
|
29393
29404
|
|
|
29394
29405
|
// src/components/Headers/WorkflowHeader.tsx
|
|
29395
29406
|
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
@@ -29405,19 +29416,83 @@ function WorkflowHeader(props) {
|
|
|
29405
29416
|
);
|
|
29406
29417
|
}
|
|
29407
29418
|
|
|
29408
|
-
// src/layouts/Workflow/
|
|
29419
|
+
// src/layouts/Workflow/RightPaneTriggers.tsx
|
|
29409
29420
|
var import_react167 = require("react");
|
|
29410
|
-
var
|
|
29421
|
+
var import_runtime157 = require("@homebound/truss/runtime");
|
|
29411
29422
|
var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
29423
|
+
var __maybeInc36 = (inc) => {
|
|
29424
|
+
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
29425
|
+
};
|
|
29426
|
+
function WorkflowPageRightPaneTriggers(props) {
|
|
29427
|
+
const {
|
|
29428
|
+
triggers
|
|
29429
|
+
} = props;
|
|
29430
|
+
const {
|
|
29431
|
+
sm: isMobile
|
|
29432
|
+
} = useBreakpoint();
|
|
29433
|
+
const {
|
|
29434
|
+
isRightPaneOpen
|
|
29435
|
+
} = useRightPane();
|
|
29436
|
+
const {
|
|
29437
|
+
openRightPane
|
|
29438
|
+
} = useRightPaneActions();
|
|
29439
|
+
const tid = useTestIds(props, "rightPaneTriggers");
|
|
29440
|
+
const pageTriggerInsetPx = 24;
|
|
29441
|
+
const onClick = (0, import_react167.useCallback)((trigger) => {
|
|
29442
|
+
openRightPane({
|
|
29443
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(RightPanePanel, { title: trigger.label, children: trigger.content })
|
|
29444
|
+
});
|
|
29445
|
+
}, [openRightPane]);
|
|
29446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime237.jsx)("div", { ...tid, "aria-hidden": isRightPaneOpen, ...isRightPaneOpen ? {
|
|
29447
|
+
inert: true
|
|
29448
|
+
} : {}, ...(0, import_runtime157.trussProps)({
|
|
29449
|
+
...{
|
|
29450
|
+
display: "df",
|
|
29451
|
+
alignItems: "aic",
|
|
29452
|
+
gap: "gap2",
|
|
29453
|
+
flexShrink: "fs0",
|
|
29454
|
+
...!isMobile ? {
|
|
29455
|
+
transition: "transitionTransform",
|
|
29456
|
+
flexDirection: "fdc"
|
|
29457
|
+
} : {}
|
|
29458
|
+
},
|
|
29459
|
+
...!isMobile && {
|
|
29460
|
+
position: "fixed",
|
|
29461
|
+
top: ["top_var", {
|
|
29462
|
+
"--top": (0, import_runtime157.maybeCssVar)(__maybeInc36(stickyNavAndHeaderOffset(pageTriggerInsetPx)))
|
|
29463
|
+
}],
|
|
29464
|
+
right: ["right_var", {
|
|
29465
|
+
"--right": `${pageTriggerInsetPx}px`
|
|
29466
|
+
}],
|
|
29467
|
+
zIndex: ["z_var", {
|
|
29468
|
+
"--zIndex": (0, import_runtime157.maybeCssVar)(zIndices.rightPaneTriggers)
|
|
29469
|
+
}]
|
|
29470
|
+
},
|
|
29471
|
+
// Desktop only — on `sm` the full-bleed pane covers the header slot.
|
|
29472
|
+
...!isMobile && (isRightPaneOpen ? {
|
|
29473
|
+
transform: ["transform_var", {
|
|
29474
|
+
"--transform": (0, import_runtime157.maybeCssVar)(`translateX(calc(100% + ${pageTriggerInsetPx}px))`)
|
|
29475
|
+
}],
|
|
29476
|
+
pointerEvents: "pe_none"
|
|
29477
|
+
} : {
|
|
29478
|
+
transform: "tf_translateX_0"
|
|
29479
|
+
})
|
|
29480
|
+
}), children: triggers.map((trigger) => /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(IconButton, { icon: trigger.icon, label: trigger.label, variant: "circle", compact: isMobile, onClick: () => onClick(trigger), ...tid[trigger.icon] }, trigger.label)) });
|
|
29481
|
+
}
|
|
29482
|
+
|
|
29483
|
+
// src/layouts/Workflow/useUnsavedChangesGuard.tsx
|
|
29484
|
+
var import_react168 = require("react");
|
|
29485
|
+
var import_react_router_dom9 = require("react-router-dom");
|
|
29486
|
+
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
29412
29487
|
function useUnsavedChangesGuard(options) {
|
|
29413
29488
|
const { isDirty, allowNavigation, onCancel } = options;
|
|
29414
29489
|
const { openModal } = useModal();
|
|
29415
|
-
const isDirtyRef = (0,
|
|
29490
|
+
const isDirtyRef = (0, import_react168.useRef)(isDirty);
|
|
29416
29491
|
isDirtyRef.current = isDirty;
|
|
29417
|
-
const allowNavigationRef = (0,
|
|
29492
|
+
const allowNavigationRef = (0, import_react168.useRef)(allowNavigation);
|
|
29418
29493
|
allowNavigationRef.current = allowNavigation;
|
|
29419
|
-
const allowCancelNavigationRef = (0,
|
|
29420
|
-
(0,
|
|
29494
|
+
const allowCancelNavigationRef = (0, import_react168.useRef)(false);
|
|
29495
|
+
(0, import_react168.useEffect)(() => {
|
|
29421
29496
|
const onBeforeUnload = (e) => {
|
|
29422
29497
|
if (isDirtyRef.current?.()) {
|
|
29423
29498
|
e.preventDefault();
|
|
@@ -29444,7 +29519,7 @@ function useUnsavedChangesGuard(options) {
|
|
|
29444
29519
|
}
|
|
29445
29520
|
openModal({
|
|
29446
29521
|
allowClosing: false,
|
|
29447
|
-
content: /* @__PURE__ */ (0,
|
|
29522
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ConfirmCloseModal, { onClose: () => confirmCancel(e) })
|
|
29448
29523
|
});
|
|
29449
29524
|
};
|
|
29450
29525
|
const navigationBlocker = blocker.state === "blocked" ? { proceed: () => blocker.proceed?.(), cancelNavigation: () => blocker.reset?.() } : void 0;
|
|
@@ -29453,10 +29528,10 @@ function useUnsavedChangesGuard(options) {
|
|
|
29453
29528
|
function UnsavedChangesNavigationModal(props) {
|
|
29454
29529
|
const { proceed, cancelNavigation } = props;
|
|
29455
29530
|
const { openModal, closeModal } = useModal();
|
|
29456
|
-
(0,
|
|
29531
|
+
(0, import_react168.useEffect)(() => {
|
|
29457
29532
|
openModal({
|
|
29458
29533
|
allowClosing: false,
|
|
29459
|
-
content: /* @__PURE__ */ (0,
|
|
29534
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ConfirmCloseModal, { title: "Leave page?", onClose: proceed, onContinue: cancelNavigation })
|
|
29460
29535
|
});
|
|
29461
29536
|
return () => closeModal();
|
|
29462
29537
|
}, []);
|
|
@@ -29464,7 +29539,7 @@ function UnsavedChangesNavigationModal(props) {
|
|
|
29464
29539
|
}
|
|
29465
29540
|
|
|
29466
29541
|
// src/layouts/Workflow/WorkflowActions.tsx
|
|
29467
|
-
var
|
|
29542
|
+
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
29468
29543
|
function WorkflowActions(props) {
|
|
29469
29544
|
const {
|
|
29470
29545
|
onCancel,
|
|
@@ -29482,12 +29557,12 @@ function WorkflowActions(props) {
|
|
|
29482
29557
|
sm: isMobile
|
|
29483
29558
|
} = useBreakpoint();
|
|
29484
29559
|
const primaryVariant = aiMode ? "ai" : "primary";
|
|
29485
|
-
return /* @__PURE__ */ (0,
|
|
29486
|
-
/* @__PURE__ */ (0,
|
|
29487
|
-
/* @__PURE__ */ (0,
|
|
29488
|
-
/* @__PURE__ */ (0,
|
|
29489
|
-
onSaveAndExit && /* @__PURE__ */ (0,
|
|
29490
|
-
isLastStep ? /* @__PURE__ */ (0,
|
|
29560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime239.jsxs)("div", { className: "df aic jcsb sm_w100", children: [
|
|
29561
|
+
/* @__PURE__ */ (0, import_jsx_runtime239.jsx)("div", { className: "df aic", children: !isFirstStep && isMobile && onBack && /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(IconButton, { icon: "arrowBack", label: "Back", onClick: onBack }) }),
|
|
29562
|
+
/* @__PURE__ */ (0, import_jsx_runtime239.jsxs)("div", { className: "df aic gap1", children: [
|
|
29563
|
+
/* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Button, { label: "Cancel", variant: "quaternary", onClick: onCancel }),
|
|
29564
|
+
onSaveAndExit && /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Button, { label: "Save & Exit", variant: "secondary", onClick: onSaveAndExit }),
|
|
29565
|
+
isLastStep ? /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Button, { label: completeLabel, variant: primaryVariant, onClick: onComplete, disabled: primaryDisabled }) : /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Button, { label: "Continue", variant: primaryVariant, onClick: async () => {
|
|
29491
29566
|
await onContinue?.();
|
|
29492
29567
|
}, disabled: primaryDisabled })
|
|
29493
29568
|
] })
|
|
@@ -29495,9 +29570,9 @@ function WorkflowActions(props) {
|
|
|
29495
29570
|
}
|
|
29496
29571
|
|
|
29497
29572
|
// src/layouts/Workflow/WorkflowPageLayout.tsx
|
|
29498
|
-
var
|
|
29499
|
-
var
|
|
29500
|
-
var
|
|
29573
|
+
var import_runtime158 = require("@homebound/truss/runtime");
|
|
29574
|
+
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
29575
|
+
var __maybeInc37 = (inc) => {
|
|
29501
29576
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
29502
29577
|
};
|
|
29503
29578
|
var mobileFooterHeightPx = 80;
|
|
@@ -29512,6 +29587,7 @@ function WorkflowPageLayout(props) {
|
|
|
29512
29587
|
documentTitleSuffix,
|
|
29513
29588
|
breadcrumbs,
|
|
29514
29589
|
onCancel,
|
|
29590
|
+
rightPaneTriggers,
|
|
29515
29591
|
...actionProps
|
|
29516
29592
|
} = props;
|
|
29517
29593
|
const tid = useTestIds(props, "workflowPageLayout");
|
|
@@ -29526,8 +29602,10 @@ function WorkflowPageLayout(props) {
|
|
|
29526
29602
|
allowNavigation,
|
|
29527
29603
|
onCancel
|
|
29528
29604
|
});
|
|
29529
|
-
const actions = /* @__PURE__ */ (0,
|
|
29530
|
-
const
|
|
29605
|
+
const actions = /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(WorkflowActions, { ...actionProps, aiMode, onCancel: onCancelClick });
|
|
29606
|
+
const triggers = rightPaneTriggers ?? [];
|
|
29607
|
+
const pageTriggers = triggers.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(WorkflowPageRightPaneTriggers, { triggers }) : void 0;
|
|
29608
|
+
const headerMetricsRef = (0, import_react169.useRef)(null);
|
|
29531
29609
|
const headerHeight = useMeasuredHeight(headerMetricsRef, true);
|
|
29532
29610
|
const headerWidth = documentScrollChromeWidth();
|
|
29533
29611
|
const outerTop = bannerAndNavbarChromeTop();
|
|
@@ -29535,7 +29613,7 @@ function WorkflowPageLayout(props) {
|
|
|
29535
29613
|
[beamPageHeaderLayoutHeightVar]: `${headerHeight}px`
|
|
29536
29614
|
} : void 0;
|
|
29537
29615
|
const showFooter = isMobile;
|
|
29538
|
-
(0,
|
|
29616
|
+
(0, import_react169.useLayoutEffect)(() => {
|
|
29539
29617
|
const root = document.documentElement;
|
|
29540
29618
|
const previous = root.style.getPropertyValue(beamWorkflowLayoutFooterHeightVar);
|
|
29541
29619
|
root.style.setProperty(beamWorkflowLayoutFooterHeightVar, showFooter ? `${mobileFooterHeightPx}px` : "0px");
|
|
@@ -29547,32 +29625,32 @@ function WorkflowPageLayout(props) {
|
|
|
29547
29625
|
}
|
|
29548
29626
|
};
|
|
29549
29627
|
}, [showFooter]);
|
|
29550
|
-
return /* @__PURE__ */ (0,
|
|
29551
|
-
/* @__PURE__ */ (0,
|
|
29628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(DocumentScrollLayoutProvider, { children: [
|
|
29629
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsxs)("div", { ...(0, import_runtime158.mergeProps)(void 0, cssVars, {
|
|
29552
29630
|
display: "df",
|
|
29553
29631
|
flexDirection: "fdc",
|
|
29554
29632
|
width: "w100"
|
|
29555
29633
|
}), ...tid, children: [
|
|
29556
|
-
/* @__PURE__ */ (0,
|
|
29634
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)("div", { ...(0, import_runtime158.mergeProps)(void 0, {
|
|
29557
29635
|
height: headerHeight
|
|
29558
29636
|
}, {
|
|
29559
29637
|
flexShrink: "fs0",
|
|
29560
29638
|
width: "w100"
|
|
29561
|
-
}), children: /* @__PURE__ */ (0,
|
|
29639
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)("div", { ref: headerMetricsRef, ...(0, import_runtime158.trussProps)({
|
|
29562
29640
|
position: "fixed",
|
|
29563
29641
|
left: "left0",
|
|
29564
29642
|
width: ["w_var", {
|
|
29565
|
-
"--width": (0,
|
|
29643
|
+
"--width": (0, import_runtime158.maybeCssVar)(__maybeInc37(headerWidth))
|
|
29566
29644
|
}],
|
|
29567
29645
|
zIndex: ["z_var", {
|
|
29568
|
-
"--zIndex": (0,
|
|
29646
|
+
"--zIndex": (0, import_runtime158.maybeCssVar)(zIndices.pageStickyHeader)
|
|
29569
29647
|
}],
|
|
29570
29648
|
top: ["top_var", {
|
|
29571
|
-
"--top": (0,
|
|
29649
|
+
"--top": (0, import_runtime158.maybeCssVar)(__maybeInc37(outerTop))
|
|
29572
29650
|
}],
|
|
29573
29651
|
transition: "transitionAll"
|
|
29574
|
-
}), ...tid.header, children: /* @__PURE__ */ (0,
|
|
29575
|
-
/* @__PURE__ */ (0,
|
|
29652
|
+
}), ...tid.header, children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(WorkflowHeader, { title, documentTitleSuffix, breadcrumbs, rightSlot: isMobile ? pageTriggers : actions, stepperTabs }) }) }),
|
|
29653
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)("div", { ...(0, import_runtime158.trussProps)({
|
|
29576
29654
|
...{
|
|
29577
29655
|
display: "df",
|
|
29578
29656
|
flexDirection: "fdc",
|
|
@@ -29584,28 +29662,29 @@ function WorkflowPageLayout(props) {
|
|
|
29584
29662
|
...aiMode && {
|
|
29585
29663
|
backgroundImage: "aiBackground",
|
|
29586
29664
|
minHeight: ["mh_var", {
|
|
29587
|
-
"--minHeight": (0,
|
|
29665
|
+
"--minHeight": (0, import_runtime158.maybeCssVar)(documentScrollBodyMinHeight())
|
|
29588
29666
|
}]
|
|
29589
29667
|
}
|
|
29590
|
-
}), ...tid.body, children }),
|
|
29591
|
-
|
|
29668
|
+
}), ...tid.body, children: triggers.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(DocumentScrollOverlayRightPaneLayout, { children }) : children }),
|
|
29669
|
+
!isMobile && pageTriggers,
|
|
29670
|
+
showFooter && /* @__PURE__ */ (0, import_jsx_runtime240.jsx)("div", { ...(0, import_runtime158.trussProps)({
|
|
29592
29671
|
flexShrink: "fs0",
|
|
29593
29672
|
width: "w100",
|
|
29594
29673
|
height: ["h_var", {
|
|
29595
29674
|
"--height": `${mobileFooterHeightPx}px`
|
|
29596
29675
|
}]
|
|
29597
|
-
}), children: /* @__PURE__ */ (0,
|
|
29676
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)("div", { ...(0, import_runtime158.trussProps)({
|
|
29598
29677
|
...{
|
|
29599
29678
|
position: "fixed",
|
|
29600
29679
|
bottom: "bottom0",
|
|
29601
29680
|
width: ["w_var", {
|
|
29602
|
-
"--width": (0,
|
|
29681
|
+
"--width": (0, import_runtime158.maybeCssVar)(__maybeInc37(headerWidth))
|
|
29603
29682
|
}],
|
|
29604
29683
|
height: ["h_var", {
|
|
29605
29684
|
"--height": `${mobileFooterHeightPx}px`
|
|
29606
29685
|
}],
|
|
29607
29686
|
zIndex: ["z_var", {
|
|
29608
|
-
"--zIndex": (0,
|
|
29687
|
+
"--zIndex": (0, import_runtime158.maybeCssVar)(zIndices.pageStickyFooter)
|
|
29609
29688
|
}],
|
|
29610
29689
|
display: "df",
|
|
29611
29690
|
alignItems: "aic",
|
|
@@ -29623,12 +29702,12 @@ function WorkflowPageLayout(props) {
|
|
|
29623
29702
|
...pageContentPaddingX
|
|
29624
29703
|
}), ...tid.footer, children: actions }) })
|
|
29625
29704
|
] }),
|
|
29626
|
-
navigationBlocker && /* @__PURE__ */ (0,
|
|
29705
|
+
navigationBlocker && /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(UnsavedChangesNavigationModal, { ...navigationBlocker })
|
|
29627
29706
|
] });
|
|
29628
29707
|
}
|
|
29629
29708
|
|
|
29630
29709
|
// src/layouts/Workflow/FocusedFormLayout.tsx
|
|
29631
|
-
var
|
|
29710
|
+
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
29632
29711
|
function FocusedFormLayout(props) {
|
|
29633
29712
|
const {
|
|
29634
29713
|
onCancel,
|
|
@@ -29639,11 +29718,12 @@ function FocusedFormLayout(props) {
|
|
|
29639
29718
|
isDirty,
|
|
29640
29719
|
allowNavigation,
|
|
29641
29720
|
aiMode,
|
|
29721
|
+
rightPaneTriggers,
|
|
29642
29722
|
children,
|
|
29643
29723
|
...headerProps
|
|
29644
29724
|
} = props;
|
|
29645
29725
|
const tid = useTestIds(props, "focusedFormLayout");
|
|
29646
|
-
return /* @__PURE__ */ (0,
|
|
29726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
29647
29727
|
WorkflowPageLayout,
|
|
29648
29728
|
{
|
|
29649
29729
|
...tid,
|
|
@@ -29656,14 +29736,15 @@ function FocusedFormLayout(props) {
|
|
|
29656
29736
|
completeLabel,
|
|
29657
29737
|
onComplete,
|
|
29658
29738
|
primaryDisabled,
|
|
29739
|
+
rightPaneTriggers,
|
|
29659
29740
|
children
|
|
29660
29741
|
}
|
|
29661
29742
|
);
|
|
29662
29743
|
}
|
|
29663
29744
|
|
|
29664
29745
|
// src/layouts/Workflow/StepperLayout.tsx
|
|
29665
|
-
var
|
|
29666
|
-
var
|
|
29746
|
+
var import_react170 = require("react");
|
|
29747
|
+
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
29667
29748
|
function StepperLayout(props) {
|
|
29668
29749
|
const {
|
|
29669
29750
|
steps,
|
|
@@ -29678,32 +29759,39 @@ function StepperLayout(props) {
|
|
|
29678
29759
|
...headerProps
|
|
29679
29760
|
} = props;
|
|
29680
29761
|
const stepTabs = steps.map((step) => ({ ...step, value: defaultTestId(step.label) }));
|
|
29681
|
-
const [currentStep, setCurrentStep] = (0,
|
|
29762
|
+
const [currentStep, setCurrentStep] = (0, import_react170.useState)(() => getInitialStep(stepTabs, defaultStep));
|
|
29682
29763
|
const tid = useTestIds(props, "stepperLayout");
|
|
29764
|
+
const { closeRightPane } = useRightPaneActions();
|
|
29683
29765
|
const currentIndex = hasStep(stepTabs, currentStep) ? stepTabs.findIndex((step) => step.value === currentStep) : 0;
|
|
29684
29766
|
const isFirstStep = currentIndex <= 0;
|
|
29685
29767
|
const isLastStep = currentIndex >= stepTabs.length - 1;
|
|
29686
29768
|
const activeStep = stepTabs[currentIndex];
|
|
29687
|
-
|
|
29769
|
+
function goToStep(value) {
|
|
29770
|
+
if (value === currentStep) return;
|
|
29771
|
+
closeRightPane();
|
|
29772
|
+
setCurrentStep(value);
|
|
29773
|
+
}
|
|
29774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
29688
29775
|
WorkflowPageLayout,
|
|
29689
29776
|
{
|
|
29690
29777
|
...tid,
|
|
29691
29778
|
...headerProps,
|
|
29692
29779
|
aiMode,
|
|
29693
|
-
stepperTabs: { steps: stepTabs, currentStep, onChange:
|
|
29780
|
+
stepperTabs: { steps: stepTabs, currentStep, onChange: goToStep },
|
|
29694
29781
|
isDirty,
|
|
29695
29782
|
allowNavigation,
|
|
29696
29783
|
isFirstStep,
|
|
29697
29784
|
isLastStep,
|
|
29698
29785
|
onBack: () => {
|
|
29699
29786
|
const prev = stepTabs[currentIndex - 1];
|
|
29700
|
-
if (prev)
|
|
29787
|
+
if (prev) goToStep(prev.value);
|
|
29701
29788
|
},
|
|
29702
29789
|
onCancel,
|
|
29703
29790
|
onSaveAndExit,
|
|
29704
29791
|
completeLabel,
|
|
29705
29792
|
onComplete,
|
|
29706
29793
|
primaryDisabled: activeStep?.primaryDisabled,
|
|
29794
|
+
rightPaneTriggers: activeStep?.rightPaneTriggers,
|
|
29707
29795
|
onContinue: async () => {
|
|
29708
29796
|
const onContinue = activeStep?.onContinue;
|
|
29709
29797
|
if (onContinue) {
|
|
@@ -29711,7 +29799,7 @@ function StepperLayout(props) {
|
|
|
29711
29799
|
if (allowed === false) return;
|
|
29712
29800
|
}
|
|
29713
29801
|
const next = stepTabs[currentIndex + 1];
|
|
29714
|
-
if (next)
|
|
29802
|
+
if (next) goToStep(next.value);
|
|
29715
29803
|
},
|
|
29716
29804
|
children: activeStep?.content
|
|
29717
29805
|
}
|
|
@@ -29726,7 +29814,7 @@ function getInitialStep(steps, defaultStep) {
|
|
|
29726
29814
|
|
|
29727
29815
|
// src/forms/BoundChipSelectField.tsx
|
|
29728
29816
|
var import_mobx_react23 = require("mobx-react");
|
|
29729
|
-
var
|
|
29817
|
+
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
29730
29818
|
function BoundChipSelectField(props) {
|
|
29731
29819
|
const {
|
|
29732
29820
|
field,
|
|
@@ -29742,7 +29830,7 @@ function BoundChipSelectField(props) {
|
|
|
29742
29830
|
...others
|
|
29743
29831
|
} = props;
|
|
29744
29832
|
const testId = useTestIds(props, field.key);
|
|
29745
|
-
return /* @__PURE__ */ (0,
|
|
29833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_mobx_react23.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
29746
29834
|
ChipSelectField,
|
|
29747
29835
|
{
|
|
29748
29836
|
label,
|
|
@@ -29772,12 +29860,12 @@ function BoundChipSelectField(props) {
|
|
|
29772
29860
|
}
|
|
29773
29861
|
|
|
29774
29862
|
// src/forms/BoundSelectAndTextField.tsx
|
|
29775
|
-
var
|
|
29863
|
+
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
29776
29864
|
function BoundSelectAndTextField(props) {
|
|
29777
29865
|
const { selectFieldProps, textFieldProps, compact = true } = props;
|
|
29778
29866
|
const tid = useTestIds(props);
|
|
29779
|
-
return /* @__PURE__ */ (0,
|
|
29780
|
-
/* @__PURE__ */ (0,
|
|
29867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(CompoundField, { children: [
|
|
29868
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
29781
29869
|
BoundSelectField,
|
|
29782
29870
|
{
|
|
29783
29871
|
...tid[defaultTestId(selectFieldProps.label ?? selectFieldProps.field.key)],
|
|
@@ -29786,7 +29874,7 @@ function BoundSelectAndTextField(props) {
|
|
|
29786
29874
|
compact
|
|
29787
29875
|
}
|
|
29788
29876
|
),
|
|
29789
|
-
/* @__PURE__ */ (0,
|
|
29877
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
29790
29878
|
BoundTextField,
|
|
29791
29879
|
{
|
|
29792
29880
|
...tid[defaultTestId(textFieldProps.label ?? textFieldProps.field.key)],
|
|
@@ -29798,8 +29886,8 @@ function BoundSelectAndTextField(props) {
|
|
|
29798
29886
|
}
|
|
29799
29887
|
|
|
29800
29888
|
// src/forms/FormHeading.tsx
|
|
29801
|
-
var
|
|
29802
|
-
var
|
|
29889
|
+
var import_runtime159 = require("@homebound/truss/runtime");
|
|
29890
|
+
var import_jsx_runtime245 = (
|
|
29803
29891
|
// Add space before the heading, but only if it's not first.
|
|
29804
29892
|
require("react/jsx-runtime")
|
|
29805
29893
|
);
|
|
@@ -29810,7 +29898,7 @@ function FormHeading(props) {
|
|
|
29810
29898
|
isFirst = false,
|
|
29811
29899
|
...others
|
|
29812
29900
|
} = props;
|
|
29813
|
-
return /* @__PURE__ */ (0,
|
|
29901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)("h3", { ...(0, import_runtime159.trussProps)({
|
|
29814
29902
|
...{
|
|
29815
29903
|
fontWeight: "fw4",
|
|
29816
29904
|
fontSize: "fz_16px",
|
|
@@ -29826,8 +29914,8 @@ FormHeading.isFormHeading = true;
|
|
|
29826
29914
|
|
|
29827
29915
|
// src/forms/StaticField.tsx
|
|
29828
29916
|
var import_utils49 = require("@react-aria/utils");
|
|
29829
|
-
var
|
|
29830
|
-
var
|
|
29917
|
+
var import_runtime160 = require("@homebound/truss/runtime");
|
|
29918
|
+
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
29831
29919
|
function StaticField(props) {
|
|
29832
29920
|
const {
|
|
29833
29921
|
fieldProps
|
|
@@ -29840,14 +29928,14 @@ function StaticField(props) {
|
|
|
29840
29928
|
} = props;
|
|
29841
29929
|
const tid = useTestIds(props, typeof label === "string" ? defaultTestId(label) : "staticField");
|
|
29842
29930
|
const id = (0, import_utils49.useId)();
|
|
29843
|
-
return /* @__PURE__ */ (0,
|
|
29931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)("div", { ...(0, import_runtime160.trussProps)({
|
|
29844
29932
|
...labelStyle === "left" ? {
|
|
29845
29933
|
display: "df",
|
|
29846
29934
|
justifyContent: "jcsb",
|
|
29847
29935
|
maxWidth: "maxw100"
|
|
29848
29936
|
} : {}
|
|
29849
29937
|
}), ...tid.container, children: [
|
|
29850
|
-
/* @__PURE__ */ (0,
|
|
29938
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)("label", { ...(0, import_runtime160.trussProps)({
|
|
29851
29939
|
display: "db",
|
|
29852
29940
|
fontWeight: "fw4",
|
|
29853
29941
|
fontSize: "fz_14px",
|
|
@@ -29857,7 +29945,7 @@ function StaticField(props) {
|
|
|
29857
29945
|
}],
|
|
29858
29946
|
marginBottom: "mb_4px"
|
|
29859
29947
|
}), htmlFor: id, ...tid.label, children: label }),
|
|
29860
|
-
/* @__PURE__ */ (0,
|
|
29948
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)("div", { id, ...(0, import_runtime160.trussProps)({
|
|
29861
29949
|
fontWeight: "fw4",
|
|
29862
29950
|
fontSize: "fz_14px",
|
|
29863
29951
|
lineHeight: "lh_20px",
|
|
@@ -29874,9 +29962,9 @@ function StaticField(props) {
|
|
|
29874
29962
|
}
|
|
29875
29963
|
|
|
29876
29964
|
// src/hooks/useFilter.ts
|
|
29877
|
-
var
|
|
29965
|
+
var import_react171 = require("react");
|
|
29878
29966
|
function useFilter4({ filterDefs }) {
|
|
29879
|
-
const [filter, setFilter] = (0,
|
|
29967
|
+
const [filter, setFilter] = (0, import_react171.useState)(
|
|
29880
29968
|
Object.fromEntries(
|
|
29881
29969
|
safeEntries(filterDefs).filter(([key, def]) => def(key).defaultValue !== void 0).map(([key, def]) => [key, def(key).defaultValue])
|
|
29882
29970
|
)
|
|
@@ -29885,10 +29973,10 @@ function useFilter4({ filterDefs }) {
|
|
|
29885
29973
|
}
|
|
29886
29974
|
|
|
29887
29975
|
// src/inputs/Autocomplete.tsx
|
|
29888
|
-
var
|
|
29976
|
+
var import_react172 = require("react");
|
|
29889
29977
|
var import_react_aria66 = require("react-aria");
|
|
29890
29978
|
var import_react_stately18 = require("react-stately");
|
|
29891
|
-
var
|
|
29979
|
+
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
29892
29980
|
function Autocomplete(props) {
|
|
29893
29981
|
const {
|
|
29894
29982
|
onSelect,
|
|
@@ -29905,8 +29993,8 @@ function Autocomplete(props) {
|
|
|
29905
29993
|
} = props;
|
|
29906
29994
|
const { effectiveValue, proposalProps } = useAiProposal(value, proposedValue);
|
|
29907
29995
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
29908
|
-
const comboBoxChildren = (0,
|
|
29909
|
-
(item) => /* @__PURE__ */ (0,
|
|
29996
|
+
const comboBoxChildren = (0, import_react172.useCallback)(
|
|
29997
|
+
(item) => /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(import_react_stately18.Item, { textValue: getOptionLabel(item), children: getOptionMenuLabel ? getOptionMenuLabel(item) : getOptionLabel(item) }, getOptionValue(item)),
|
|
29910
29998
|
[getOptionValue, getOptionLabel, getOptionMenuLabel]
|
|
29911
29999
|
);
|
|
29912
30000
|
const comboBoxProps = {
|
|
@@ -29930,10 +30018,10 @@ function Autocomplete(props) {
|
|
|
29930
30018
|
...others
|
|
29931
30019
|
};
|
|
29932
30020
|
const state = (0, import_react_stately18.useComboBoxState)(comboBoxProps);
|
|
29933
|
-
const inputWrapRef = (0,
|
|
29934
|
-
const inputRef = (0,
|
|
29935
|
-
const listBoxRef = (0,
|
|
29936
|
-
const popoverRef = (0,
|
|
30021
|
+
const inputWrapRef = (0, import_react172.useRef)(null);
|
|
30022
|
+
const inputRef = (0, import_react172.useRef)(null);
|
|
30023
|
+
const listBoxRef = (0, import_react172.useRef)(null);
|
|
30024
|
+
const popoverRef = (0, import_react172.useRef)(null);
|
|
29937
30025
|
const { inputProps, listBoxProps, labelProps } = (0, import_react_aria66.useComboBox)(
|
|
29938
30026
|
{
|
|
29939
30027
|
...comboBoxProps,
|
|
@@ -29959,8 +30047,8 @@ function Autocomplete(props) {
|
|
|
29959
30047
|
// Ensures the menu never gets too small.
|
|
29960
30048
|
minWidth: 200
|
|
29961
30049
|
};
|
|
29962
|
-
return /* @__PURE__ */ (0,
|
|
29963
|
-
/* @__PURE__ */ (0,
|
|
30050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(import_jsx_runtime247.Fragment, { children: [
|
|
30051
|
+
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(
|
|
29964
30052
|
TextFieldBase,
|
|
29965
30053
|
{
|
|
29966
30054
|
inputRef,
|
|
@@ -29970,11 +30058,11 @@ function Autocomplete(props) {
|
|
|
29970
30058
|
onChange: onInputChange,
|
|
29971
30059
|
...proposalProps,
|
|
29972
30060
|
clearable: true,
|
|
29973
|
-
startAdornment: "startAdornment" in props ? props.startAdornment : /* @__PURE__ */ (0,
|
|
30061
|
+
startAdornment: "startAdornment" in props ? props.startAdornment : /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Icon, { icon: "search" }),
|
|
29974
30062
|
...others
|
|
29975
30063
|
}
|
|
29976
30064
|
),
|
|
29977
|
-
state.isOpen && /* @__PURE__ */ (0,
|
|
30065
|
+
state.isOpen && /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(
|
|
29978
30066
|
Popover,
|
|
29979
30067
|
{
|
|
29980
30068
|
triggerRef: inputRef,
|
|
@@ -29983,7 +30071,7 @@ function Autocomplete(props) {
|
|
|
29983
30071
|
onClose: () => state.close(),
|
|
29984
30072
|
isOpen: state.isOpen,
|
|
29985
30073
|
minWidth: 200,
|
|
29986
|
-
children: /* @__PURE__ */ (0,
|
|
30074
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(
|
|
29987
30075
|
ListBox,
|
|
29988
30076
|
{
|
|
29989
30077
|
...listBoxProps,
|
|
@@ -30001,11 +30089,11 @@ function Autocomplete(props) {
|
|
|
30001
30089
|
}
|
|
30002
30090
|
|
|
30003
30091
|
// src/inputs/ToggleButton.tsx
|
|
30004
|
-
var
|
|
30092
|
+
var import_react173 = require("react");
|
|
30005
30093
|
var import_react_aria67 = require("react-aria");
|
|
30006
30094
|
var import_react_stately19 = require("react-stately");
|
|
30007
|
-
var
|
|
30008
|
-
var
|
|
30095
|
+
var import_runtime161 = require("@homebound/truss/runtime");
|
|
30096
|
+
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
30009
30097
|
function ToggleButton(props) {
|
|
30010
30098
|
const {
|
|
30011
30099
|
selected: isSelected = false,
|
|
@@ -30016,7 +30104,7 @@ function ToggleButton(props) {
|
|
|
30016
30104
|
__storyState,
|
|
30017
30105
|
...otherProps
|
|
30018
30106
|
} = props;
|
|
30019
|
-
const [asyncInProgress, setAsyncInProgress] = (0,
|
|
30107
|
+
const [asyncInProgress, setAsyncInProgress] = (0, import_react173.useState)(false);
|
|
30020
30108
|
const isDisabled = !!disabled || asyncInProgress;
|
|
30021
30109
|
const ariaProps = {
|
|
30022
30110
|
"aria-label": label,
|
|
@@ -30035,8 +30123,8 @@ function ToggleButton(props) {
|
|
|
30035
30123
|
return result;
|
|
30036
30124
|
}
|
|
30037
30125
|
});
|
|
30038
|
-
const labelRef = (0,
|
|
30039
|
-
const ref = (0,
|
|
30126
|
+
const labelRef = (0, import_react173.useRef)(null);
|
|
30127
|
+
const ref = (0, import_react173.useRef)(null);
|
|
30040
30128
|
const tid = useTestIds(otherProps, label);
|
|
30041
30129
|
const {
|
|
30042
30130
|
isPressed: isPressedFromEvents,
|
|
@@ -30069,7 +30157,7 @@ function ToggleButton(props) {
|
|
|
30069
30157
|
...focusProps,
|
|
30070
30158
|
...hoverProps,
|
|
30071
30159
|
...pressProps,
|
|
30072
|
-
...(0,
|
|
30160
|
+
...(0, import_runtime161.trussProps)({
|
|
30073
30161
|
// Gray500 off-state has no semantic match — keep palette (OnSurfaceMuted is Gray700).
|
|
30074
30162
|
...{
|
|
30075
30163
|
borderRadius: "br4",
|
|
@@ -30109,10 +30197,10 @@ function ToggleButton(props) {
|
|
|
30109
30197
|
return maybeTooltip({
|
|
30110
30198
|
title: tooltip,
|
|
30111
30199
|
placement: "top",
|
|
30112
|
-
children: /* @__PURE__ */ (0,
|
|
30113
|
-
icon && /* @__PURE__ */ (0,
|
|
30200
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)("label", { ...labelAttrs, children: [
|
|
30201
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(Icon, { icon }),
|
|
30114
30202
|
label,
|
|
30115
|
-
/* @__PURE__ */ (0,
|
|
30203
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_react_aria67.VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("input", { ref, ...inputProps, ...tid.value }) })
|
|
30116
30204
|
] })
|
|
30117
30205
|
});
|
|
30118
30206
|
}
|