(funct
data-artwork={artwork || undefined}
aria-hidden="true"
>
-
{selected ? (selectedIcon ?? icon) : icon}
+
+ {selected ? (selectedIcon ?? icon) : icon}
+
);
});
diff --git a/libs/designer-ui-v2/src/nodes/primitives/NodeLine.tsx b/libs/designer-ui-v2/src/nodes/primitives/NodeLine.tsx
index f1c24b9044d..a3e8b9a7ebf 100644
--- a/libs/designer-ui-v2/src/nodes/primitives/NodeLine.tsx
+++ b/libs/designer-ui-v2/src/nodes/primitives/NodeLine.tsx
@@ -52,13 +52,13 @@ const useNodeLineStateStyles = makeStyles({
default: {},
taken: {
strokeWidth: nodeLineStateOverrides.taken.strokeWidth,
- '@media (forced-colors: active)': { stroke: 'Highlight' },
+ '@media (forced-colors: active)': { stroke: 'Highlight !important' },
},
notTaken: { opacity: nodeLineStateOverrides.notTaken.opacity },
highlighted: {
stroke: nodeLineStateOverrides.highlighted.stroke,
strokeWidth: nodeLineStateOverrides.highlighted.strokeWidth,
- '@media (forced-colors: active)': { stroke: 'Highlight' },
+ '@media (forced-colors: active)': { stroke: 'Highlight !important' },
},
running: {
stroke: nodeLineStateOverrides.running.stroke,
@@ -74,7 +74,14 @@ const useNodeLineStateStyles = makeStyles({
});
export const useNodeLineStyles = makeStyles({
- base: { fill: 'none', strokeWidth: tokens.strokeWidthThin, '@media (forced-colors: active)': { stroke: 'CanvasText' } },
+ base: {
+ fill: 'none',
+ strokeWidth: tokens.strokeWidthThin,
+ '@media (forced-colors: active)': {
+ stroke: 'CanvasText !important',
+ '&[data-line-highlighted]': { stroke: 'Highlight !important' },
+ },
+ },
solid: { stroke: nodeLineStrokes.solid.stroke },
solidSuccess: {
stroke: nodeLineStrokes.solidSuccess.stroke,
@@ -129,7 +136,11 @@ export const NodeLine = forwardRef
(function NodeLi
data-state={state === 'default' ? undefined : state}
data-arrow={variant === 'solid' && !showArrow ? 'false' : undefined}
>
-
+
);
});
diff --git a/libs/designer-ui-v2/src/nodes/primitives/NodeText.tsx b/libs/designer-ui-v2/src/nodes/primitives/NodeText.tsx
index 62903a3a50c..e131d8c5a78 100644
--- a/libs/designer-ui-v2/src/nodes/primitives/NodeText.tsx
+++ b/libs/designer-ui-v2/src/nodes/primitives/NodeText.tsx
@@ -13,8 +13,9 @@ const useStyles = makeStyles({
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
paddingInlineEnd: `var(${nodeCardVars.textEndReserve}, 0)`,
- fontSize: tokens.fontSizeBase300,
- fontWeight: tokens.fontWeightSemibold,
+ fontFamily: `var(${nodeCardVars.titleFamily}, inherit)`,
+ fontSize: `var(${nodeCardVars.titleSize}, ${tokens.fontSizeBase300})`,
+ fontWeight: `var(${nodeCardVars.titleWeight}, ${tokens.fontWeightSemibold})`,
lineHeight: tokens.lineHeightBase300,
color: tokens.colorNeutralForeground1,
},
@@ -26,6 +27,11 @@ const useStyles = makeStyles({
whiteSpace: 'normal',
overflowWrap: 'anywhere',
},
+ titleFirst: {
+ // Reuse the wrapped card's subtitle space without growing its accepted layout bounds.
+ WebkitLineClamp: 3,
+ lineHeight: `calc(${tokens.lineHeightBase300} - ${tokens.spacingVerticalXXS})`,
+ },
subtitle: {
overflow: 'hidden',
textOverflow: 'ellipsis',
@@ -87,6 +93,8 @@ export interface NodeTextProps extends HTMLAttributes {
subtitleKind?: 'default' | 'status';
/** Maximum title lines; defaults to a single ellipsized line. */
titleLines?: 1 | 2;
+ /** In a wrapped card, let the title use the decorative caption's row. Status and counts keep their row. */
+ prioritizeTitle?: boolean;
/** Preformatted count (for example "3 actions") shown after the subtitle on collapsed container cards. */
count?: string;
countUnit?: NodeFrameCountUnit;
@@ -95,7 +103,7 @@ export interface NodeTextProps extends HTMLAttributes {
}
export const NodeHoverCardActiveContext = createContext(false);
export const NodeText = forwardRef(function NodeText(
- { title, subtitle, subtitleKind = 'default', titleLines = 1, count, countUnit, countId, className, ...rest },
+ { title, subtitle, subtitleKind = 'default', titleLines = 1, prioritizeTitle, count, countUnit, countId, className, ...rest },
ref
) {
const styles = useStyles();
@@ -103,15 +111,22 @@ export const NodeText = forwardRef(function Node
const statusContext = useContext(NodeCardStatusContext);
const statusSubtitle = subtitleKind === 'status' ? statusContext : undefined;
const statusTitle = statusSubtitle ? [statusSubtitle.statusLabel, statusSubtitle.statusDetail].filter(Boolean).join(' ') : undefined;
+ const useCaptionRow = prioritizeTitle && titleLines === 2 && subtitleKind !== 'status' && !count;
return (
-
+
{title}
{statusSubtitle ? (
- {getNodeStatusIcon(statusSubtitle.status, styles.statusIcon)}
+
+ {getNodeStatusIcon(statusSubtitle.status, styles.statusIcon)}
+
{statusSubtitle.statusLabel}
{statusSubtitle.statusDetail ? {statusSubtitle.statusDetail} : null}
@@ -129,7 +144,7 @@ export const NodeText = forwardRef(function Node
) : count ? (
{subtitle ? (
-
+
{subtitle}
·
@@ -141,8 +156,8 @@ export const NodeText = forwardRef(function Node
{count}
- ) : subtitle ? (
-
+ ) : subtitle && !useCaptionRow ? (
+
{subtitle}
) : null}
diff --git a/libs/designer-ui-v2/src/theme/tokens.ts b/libs/designer-ui-v2/src/theme/tokens.ts
index 935d6105cbf..4141ebbaced 100644
--- a/libs/designer-ui-v2/src/theme/tokens.ts
+++ b/libs/designer-ui-v2/src/theme/tokens.ts
@@ -28,4 +28,7 @@ export const nodeCardVars = {
background: '--designer-ui-v2-node-card-background',
footerBackground: '--designer-ui-v2-node-card-footer-background',
textEndReserve: '--designer-ui-v2-node-text-end-reserve',
+ titleFamily: '--designer-ui-v2-node-title-family',
+ titleSize: '--designer-ui-v2-node-title-size',
+ titleWeight: '--designer-ui-v2-node-title-weight',
} as const;
diff --git a/libs/designer-ui-v2/stories/API.mdx b/libs/designer-ui-v2/stories/API.mdx
index 36c7f84304c..18b68983e62 100644
--- a/libs/designer-ui-v2/stories/API.mdx
+++ b/libs/designer-ui-v2/stories/API.mdx
@@ -28,7 +28,7 @@ components or hooks. `/package.json` exposes manifest metadata. Source/build
deep imports and a package `/nodes` subpath are unsupported. Storybook's exact
source aliases do not change the package export map.
-## All 31 nonvisual runtime exports
+## All 39 nonvisual runtime exports
@@ -132,13 +132,14 @@ source aliases do not change the package export map.
-The additional 13 Phase 1a/1b runtime exports are:
+Other nonvisual exports:
| Export | Contract |
|---|---|
| `NodeInactiveContext` | Boolean presentation context (default false); nested cards/ports avoid applying opacity twice. |
| `defaultBranchTakenString` | `(label) => "
)
) : null}
+