@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
66 lines (65 loc) • 3.56 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.spacingProperties = exports.skeletonProperty = exports.pickNumberFormatProps = exports.mainWeightProperty = exports.mainSizeProperty = exports.fontSizeProperty = exports.colorizeBySignProperty = exports.auxiliaryWeightProperty = exports.auxiliarySizeProperty = exports.SharedValueProperties = void 0;
var _NumberFormatDocs = require("../number-format/NumberFormatDocs.js");
const pickNumberFormatProps = keys => {
return Object.fromEntries(keys.map(key => [key, _NumberFormatDocs.NumberFormatPropertiesCamelCase[key]]));
};
exports.pickNumberFormatProps = pickNumberFormatProps;
const mainSizeProperty = exports.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'
};
const fontSizeProperty = exports.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'
};
const mainWeightProperty = exports.mainWeightProperty = {
doc: 'Typography weight for the main content.',
type: ['"regular"', '"medium"'],
defaultValue: 'medium',
status: 'optional'
};
const auxiliaryWeightProperty = exports.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'
};
const auxiliarySizeProperty = exports.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'
};
const skeletonProperty = exports.skeletonProperty = {
doc: 'Applies skeleton loading state.',
type: ['boolean'],
status: 'optional'
};
const colorizeBySignProperty = exports.colorizeBySignProperty = {
doc: 'If `true`, text color follows sign tone (`+` green, `-` red).',
type: ['boolean'],
defaultValue: 'false',
status: 'optional'
};
const spacingProperties = exports.spacingProperties = {
doc: 'Spacing properties like `top` or `bottom` are supported.',
type: ['string', 'object'],
status: 'optional'
};
const SharedValueProperties = exports.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