UNPKG

@zohodesk/components

Version:

Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development

107 lines (96 loc) 6.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.propTypes = void 0; var _propTypes = _interopRequireDefault(require("prop-types")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // Define prop types once to avoid duplication var propTypeDefinitions = { shouldReset: _propTypes["default"].bool, display: _propTypes["default"].oneOf(['block', 'inlineBlock', 'inline', 'initial']), weight: _propTypes["default"].oneOf(['regular', 'light', 'semibold', 'bold']), isDotted: _propTypes["default"].bool, textAlign: _propTypes["default"].oneOf(['left', 'right', 'center', 'justify']), transform: _propTypes["default"].oneOf(['default', 'upper', 'lower', 'capital']), lineClamp: _propTypes["default"].oneOf(['1', '2', '3', '4', '5']), typeFace: _propTypes["default"].oneOf(['normal', 'italic']), decoration: _propTypes["default"].oneOf(['default', 'underline', 'strike', 'overline']), size: _propTypes["default"].oneOf(['7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '24', '25', '26', '28', '29', '30', '32', '34', '35', '36', '40', '50', 'inherit']), lineHeight: _propTypes["default"].oneOf(['0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '2', 'normal', 'initial', 'inherit']), letterSpacing: _propTypes["default"].oneOf(['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '2', 'inherit']), wordBreak: _propTypes["default"].oneOf(['breakAll', 'keepAll', 'breakWord']), wordWrap: _propTypes["default"].oneOf(['normal', 'break']), whiteSpace: _propTypes["default"].oneOf(['normal', 'noWrap', 'pre', 'preLine', 'preWrap', 'breakSpaces']), customClass: _propTypes["default"].string }; var typoStyleProps = { $flag_reset: propTypeDefinitions.shouldReset, shouldReset: propTypeDefinitions.shouldReset, $flag_dotted: propTypeDefinitions.isDotted, isDotted: propTypeDefinitions.isDotted, $ui_display: propTypeDefinitions.display, display: propTypeDefinitions.display, $ui_weight: propTypeDefinitions.weight, weight: propTypeDefinitions.weight, $ui_textAlign: propTypeDefinitions.textAlign, textAlign: propTypeDefinitions.textAlign, $ui_transform: propTypeDefinitions.transform, transform: propTypeDefinitions.transform, $ui_lineClamp: propTypeDefinitions.lineClamp, lineClamp: propTypeDefinitions.lineClamp, $ui_typeFace: propTypeDefinitions.typeFace, typeFace: propTypeDefinitions.typeFace, $ui_decoration: propTypeDefinitions.decoration, decoration: propTypeDefinitions.decoration, $ui_size: propTypeDefinitions.size, size: propTypeDefinitions.size, $ui_lineHeight: propTypeDefinitions.lineHeight, lineHeight: propTypeDefinitions.lineHeight, $ui_letterSpacing: propTypeDefinitions.letterSpacing, letterSpacing: propTypeDefinitions.letterSpacing, $ui_wordBreak: propTypeDefinitions.wordBreak, wordBreak: propTypeDefinitions.wordBreak, $ui_wordWrap: propTypeDefinitions.wordWrap, wordWrap: propTypeDefinitions.wordWrap, $ui_whiteSpace: propTypeDefinitions.whiteSpace, whiteSpace: propTypeDefinitions.whiteSpace, $ui_className: propTypeDefinitions.customClass, customClass: propTypeDefinitions.customClass }; var highlightProps = { customStyle: _propTypes["default"].object, shouldExcludeIndices: _propTypes["default"].bool, isCaseSensitive: _propTypes["default"].bool, isWholeWord: _propTypes["default"].bool, as: _propTypes["default"].string, renderHighlight: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].node]), styleConfiguration: _propTypes["default"].shape(typoStyleProps) }; var highlightDataItemShape = _propTypes["default"].shape(_objectSpread({ text: _propTypes["default"].string, index: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].number), _propTypes["default"].number]) }, highlightProps)); var highlightConfigShape = _propTypes["default"].shape(_objectSpread({ data: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, highlightDataItemShape])) }, highlightProps)); var propTypes = _objectSpread(_objectSpread({}, typoStyleProps), {}, { children: _propTypes["default"].node, $ui_tagName: _propTypes["default"].string, as: _propTypes["default"].string, $i18n_dataTitle: _propTypes["default"].string, dataTitle: _propTypes["default"].string, testId: _propTypes["default"].string, customId: _propTypes["default"].string, customStyle: _propTypes["default"].object, $a11yAttributes_text: _propTypes["default"].object, a11yAttributes: _propTypes["default"].object, $tagAttributes_text: _propTypes["default"].object, tagAttributes: _propTypes["default"].object, $ui_highlightConfig: highlightConfigShape, highlightConfig: highlightConfigShape }); exports.propTypes = propTypes;