jfs-components 0.1.58 → 0.1.59

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.
@@ -10,6 +10,14 @@ import CircularProgressBar from '../CircularProgressBar/CircularProgressBar';
10
10
  import Divider from '../Divider/Divider';
11
11
  import Nudge from '../Nudge/Nudge';
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ // Match the Figma source defaults: Neutral brand, Nudge&Alert context, and
14
+ // no nudge padding. Caller / global modes merge on top so any key can still
15
+ // be overridden per-instance.
16
+ const COMPONENT_DEFAULT_MODES = Object.freeze({
17
+ AppearanceBrand: 'Neutral',
18
+ Context: 'Nudge&Alert',
19
+ 'Nudge padding': 'None'
20
+ });
13
21
  const toNumber = (value, fallback) => {
14
22
  if (typeof value === 'number') {
15
23
  return Number.isFinite(value) ? value : fallback;
@@ -128,7 +136,9 @@ function CardFinancialCondition({
128
136
  const {
129
137
  modes: globalModes
130
138
  } = useTokens();
131
- const modes = useMemo(() => globalModes === EMPTY_MODES && propModes === EMPTY_MODES ? EMPTY_MODES : {
139
+ // Merge order: component defaults global theme caller props.
140
+ const modes = useMemo(() => globalModes === EMPTY_MODES && propModes === EMPTY_MODES ? COMPONENT_DEFAULT_MODES : {
141
+ ...COMPONENT_DEFAULT_MODES,
132
142
  ...globalModes,
133
143
  ...propModes
134
144
  }, [globalModes, propModes]);