UNPKG

@ozen-ui/kit

Version:

React component library

29 lines (28 loc) 1.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Link = exports.cnLink = void 0; var tslib_1 = require("tslib"); require("./Link.css"); var react_1 = tslib_1.__importDefault(require("react")); var classnames_1 = require("@bem-react/classnames"); var useThemeProps_1 = require("../../hooks/useThemeProps"); var classname_1 = require("../../utils/classname"); var polymorphicComponentWithRef_1 = require("../../utils/polymorphicComponentWithRef"); var Typography_1 = require("../Typography"); exports.cnLink = (0, classname_1.cn)('Link'); exports.Link = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (inProps, ref) { var props = (0, useThemeProps_1.useThemeProps)({ props: inProps, name: 'Link', }); var _a = props.variant, variant = _a === void 0 ? 'text-m' : _a, _b = props.as, Tag = _b === void 0 ? 'a' : _b, display = props.display, noWrap = props.noWrap, align = props.align, defaultMargin = props.defaultMargin, children = props.children, className = props.className, other = tslib_1.__rest(props, ["variant", "as", "display", "noWrap", "align", "defaultMargin", "children", "className"]); return (react_1.default.createElement(Tag, tslib_1.__assign({ className: (0, classnames_1.classnames)((0, exports.cnLink)(), (0, Typography_1.cnTypography)({ variant: variant, display: display, defaultMargin: defaultMargin, align: align, noWrap: noWrap, link: true, }), className) }, other, { ref: ref }), children)); }); exports.Link.displayName = 'Link';