UNPKG

@atlaskit/button

Version:

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

41 lines • 1.35 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'; const buttonStyles = { primaryButton: "_1g6vidpf _k9paidpf _7k5eidpf _10t6idpf", secondaryButton: "_jw1uidpf _1uoaidpf _zb8tidpf _3yvgidpf" }; export const SplitButton = ({ children, appearance = 'default', spacing = 'default', isDisabled = false }) => { const { PrimaryAction, SecondaryAction } = getActions(children); return /*#__PURE__*/React.createElement(SplitButtonContainer, { appearance: appearance, isDisabled: isDisabled }, /*#__PURE__*/React.createElement(SplitButtonContext.Provider, { value: { appearance, spacing, 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))); };