@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
85 lines (84 loc) • 2.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.text = exports.textStyleFns = exports.textStyleFnConfigs = void 0;
const buildStyleFns_1 = require("./buildStyleFns");
exports.textStyleFnConfigs = [
{
name: 'fontFamily',
properties: ['fontFamily'],
system: 'font',
},
{
name: 'fontSize',
properties: ['fontSize'],
system: 'fontSize',
},
{
name: 'fontStyle',
properties: ['fontStyle'],
system: 'none',
},
{
name: 'fontWeight',
properties: ['fontWeight'],
system: 'fontWeight',
},
{
name: 'lineHeight',
properties: ['lineHeight'],
system: 'none',
},
{
name: 'letterSpacing',
properties: ['letterSpacing'],
system: 'none',
},
{
name: 'textAlign',
properties: ['textAlign'],
system: 'none',
},
{
name: 'textDecoration',
properties: ['textDecoration'],
system: 'none',
},
{
name: 'textOverflow',
properties: ['textOverflow'],
system: 'none',
},
{
name: 'textTransform',
properties: ['textTransform'],
system: 'none',
},
{
name: 'textShadow',
properties: ['textShadow'],
system: 'none',
},
{
name: 'whiteSpace',
properties: ['whiteSpace'],
system: 'none',
},
{
name: 'wordBreak',
properties: ['wordBreak'],
system: 'none',
},
];
exports.textStyleFns = (0, buildStyleFns_1.buildStyleFns)(exports.textStyleFnConfigs);
/**
* A style prop function that takes component props and returns font and text styles.
* If no `TextStyleProps` are found, it returns an empty object.
*
* @example
* ```
* const BoxExample = () => (
* <Box textAlign="center" fontWeight="medium">Hello, alignment!</Box>
* );
* ```
*/
exports.text = (0, buildStyleFns_1.buildStylePropFn)(exports.textStyleFns);