@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
59 lines • 2.91 kB
JavaScript
import { NumberFormatPropertiesCamelCase } from "../number-format/NumberFormatDocs.js";
export const pickNumberFormatProps = keys => {
return Object.fromEntries(keys.map(key => [key, NumberFormatPropertiesCamelCase[key]]));
};
export const mainSizeProperty = {
doc: 'Typography size for the main content. When omitted, it falls back to `fontSize` if provided.',
type: ['"x-small"', '"small"', '"basis"', '"medium"', '"large"', '"x-large"', '"xx-large"'],
defaultValue: 'large (`basis` when nested inside `Stat.Trend` or `Stat.Info`, unless `fontSize`, `mainSize`, or `auxiliarySize` is set)',
status: 'optional'
};
export const fontSizeProperty = {
doc: 'Typography size fallback used for both main and auxiliary content. `mainSize` and `auxiliarySize` override this value. If omitted, default is `large` (`basis` when nested inside `Stat.Trend` or `Stat.Info`, unless any size prop is set).',
type: ['"x-small"', '"small"', '"basis"', '"medium"', '"large"', '"x-large"', '"xx-large"'],
status: 'optional'
};
export const mainWeightProperty = {
doc: 'Typography weight for the main content.',
type: ['"regular"', '"medium"'],
defaultValue: 'medium',
status: 'optional'
};
export const auxiliaryWeightProperty = {
doc: 'Typography weight for secondary content like currency sign and affixes. If omitted, and `mainSize` equals `auxiliarySize` while `mainWeight` is omitted, `medium` is used.',
type: ['"regular"', '"medium"'],
status: 'optional'
};
export const auxiliarySizeProperty = {
doc: 'Typography size for secondary content like currency sign and affixes (`prefix` and `suffix`). When omitted, it falls back to `fontSize` if provided.',
type: ['"x-small"', '"small"', '"basis"', '"medium"', '"large"', '"x-large"', '"xx-large"'],
defaultValue: 'large (`basis` when nested inside `Stat.Trend` or `Stat.Info`, unless `fontSize`, `mainSize`, or `auxiliarySize` is set)',
status: 'optional'
};
export const skeletonProperty = {
doc: 'Applies skeleton loading state.',
type: ['boolean'],
status: 'optional'
};
export const colorizeBySignProperty = {
doc: 'If `true`, text color follows sign tone (`+` green, `-` red).',
type: ['boolean'],
defaultValue: 'false',
status: 'optional'
};
export const spacingProperties = {
doc: 'Spacing properties like `top` or `bottom` are supported.',
type: ['string', 'object'],
status: 'optional'
};
export const SharedValueProperties = {
...pickNumberFormatProps(['value', 'decimals', 'rounding', 'signDisplay', 'compact', 'prefix', 'suffix', 'locale', 'srLabel', 'skeleton', 'options']),
fontSize: fontSizeProperty,
mainSize: mainSizeProperty,
mainWeight: mainWeightProperty,
auxiliaryWeight: auxiliaryWeightProperty,
auxiliarySize: auxiliarySizeProperty,
colorizeBySign: colorizeBySignProperty,
'[Space](/uilib/layout/space/properties)': spacingProperties
};
//# sourceMappingURL=StatDocsUtils.js.map