UNPKG

@atlaskit/button

Version:

A button triggers an event or action. They let users know what will happen next.

42 lines • 1.74 kB
/* split-button.tsx generated by @compiled/babel-plugin v3.0.2 */ import "./split-button.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { Divider } from './divider'; import { SplitButtonContainer } from './split-button-container'; import { SplitButtonContext } from './split-button-context'; import { getActions } from './utils'; var buttonStyles = { primaryButton: "_1g6vidpf _k9paidpf _7k5eidpf _10t6idpf", secondaryButton: "_jw1uidpf _1uoaidpf _zb8tidpf _3yvgidpf" }; export var SplitButton = function SplitButton(_ref) { var children = _ref.children, _ref$appearance = _ref.appearance, appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance, _ref$spacing = _ref.spacing, spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing, _ref$isDisabled = _ref.isDisabled, isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled; var _getActions = getActions(children), PrimaryAction = _getActions.PrimaryAction, SecondaryAction = _getActions.SecondaryAction; return /*#__PURE__*/React.createElement(SplitButtonContainer, { appearance: appearance, isDisabled: isDisabled }, /*#__PURE__*/React.createElement(SplitButtonContext.Provider, { value: { appearance: appearance, spacing: spacing, isDisabled: isDisabled } }, /*#__PURE__*/React.createElement("div", { className: ax([buttonStyles.primaryButton]) }, PrimaryAction), /*#__PURE__*/React.createElement(Divider, { appearance: appearance, spacing: spacing, isDisabled: isDisabled }), /*#__PURE__*/React.createElement("div", { className: ax([buttonStyles.secondaryButton]) }, SecondaryAction))); };