UNPKG

@pushchain/ui-kit

Version:
39 lines (38 loc) 1.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Button = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const styled_components_1 = tslib_1.__importDefault(require("styled-components")); const StyledButton = styled_components_1.default.button ` /* Common Button CSS */ align-items: center; cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')}; background: ${(props) => (props.bgColor ? props.bgColor : '#d548ec')}; color: ${(props) => props.textColor ? props.textColor : 'rgba(255, 255, 255, 1)'}; display: flex; font-family: var(--pw-int-font-family); justify-content: center; white-space: nowrap; flex-shrink: 0; font-size: 16px; font-style: normal; font-weight: 500; line-height: 16px; padding: ${(props) => props.padding ? props.padding : '16px 24px'}; min-width: 100px; width: inherit; height: 48px; gap: ${(props) => props.gap ? props.gap : '4px'}; border: none; border-radius: ${(props) => props.borderRadius ? props.borderRadius : '12px'}; white-space: nowrap; `; const Button = (0, react_1.forwardRef)((_a, ref) => { var { disabled, bgColor, textColor, borderRadius, gap, padding, children } = _a, props = tslib_1.__rest(_a, ["disabled", "bgColor", "textColor", "borderRadius", "gap", "padding", "children"]); return ((0, jsx_runtime_1.jsx)(StyledButton, Object.assign({}, (disabled ? { 'aria-disabled': true } : {}), { disabled: disabled, role: "button", ref: ref, bgColor: bgColor, textColor: textColor, borderRadius: borderRadius, gap: gap, padding: padding }, props, { children: children }))); }); exports.Button = Button; Button.displayName = 'Button'; //# sourceMappingURL=Button.js.map