UNPKG

@prezly/theme-kit-ui

Version:
97 lines (96 loc) 4.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.Themed = exports.SquareButton = exports.SmallRounded = exports.SecondaryWithIconLeft = exports.SecondaryRounded = exports.Secondary = exports.Rounded = exports.PrimaryWithIconRight = exports.PrimaryWithIconLeft = exports.Primary = exports.DisabledButton = void 0; var _react = _interopRequireDefault(require("react")); var _solid = require("@heroicons/react/24/solid"); var _index = require("../../styler/index.cjs"); var _index2 = require("./index.cjs"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Icon = _solid.PlusIcon; var _default = exports.default = { title: 'Buttons/Button', component: _index2.Button, parameters: { design: { type: 'figma', url: 'https://www.figma.com/file/46dEAasj1iEtrVQOwmMswB/00--%3E-Themes-Design-System?type=design&node-id=599-24589&mode=dev' } } }; var ButtonTemplateWithChild = args => /*#__PURE__*/_react.default.createElement(_index2.Button, args, "Button"); var ButtonTemplateWithoutChild = args => /*#__PURE__*/_react.default.createElement(_index2.Button, args); var Primary = exports.Primary = ButtonTemplateWithChild.bind({}); Primary.args = { type: 'button', variation: 'primary' }; var Secondary = exports.Secondary = ButtonTemplateWithChild.bind({}); Secondary.args = _objectSpread(_objectSpread({}, Primary.args), {}, { variation: 'secondary' }); var PrimaryWithIconLeft = exports.PrimaryWithIconLeft = ButtonTemplateWithChild.bind({}); PrimaryWithIconLeft.args = _objectSpread(_objectSpread({}, Primary.args), {}, { icon: Icon }); var PrimaryWithIconRight = exports.PrimaryWithIconRight = ButtonTemplateWithChild.bind({}); PrimaryWithIconRight.args = _objectSpread(_objectSpread({}, Primary.args), {}, { icon: Icon, iconPlacement: 'right' }); var SecondaryWithIconLeft = exports.SecondaryWithIconLeft = ButtonTemplateWithChild.bind({}); SecondaryWithIconLeft.args = _objectSpread(_objectSpread({}, Secondary.args), {}, { icon: Icon, iconPlacement: 'left' }); var SquareButton = exports.SquareButton = ButtonTemplateWithoutChild.bind({}); SquareButton.args = _objectSpread(_objectSpread({}, Primary.args), {}, { icon: Icon }); var DisabledButton = exports.DisabledButton = ButtonTemplateWithChild.bind({}); DisabledButton.args = _objectSpread(_objectSpread({}, Primary.args), {}, { icon: Icon, disabled: true }); var Rounded = exports.Rounded = ButtonTemplateWithChild.bind({}); Rounded.parameters = { design: { type: 'figma', url: 'https://www.figma.com/file/46dEAasj1iEtrVQOwmMswB/00--%3E-Themes-Design-System?type=design&node-id=1128-39276&mode=dev' } }; Rounded.args = { icon: Icon, rounded: true, iconPlacement: 'right' }; var SecondaryRounded = exports.SecondaryRounded = ButtonTemplateWithChild.bind({}); SecondaryRounded.parameters = Rounded.parameters; SecondaryRounded.args = { icon: Icon, rounded: true, variation: 'secondary', iconPlacement: 'right' }; var SmallRounded = exports.SmallRounded = ButtonTemplateWithChild.bind({}); SmallRounded.parameters = Rounded.parameters; SmallRounded.args = { icon: Icon, rounded: true, size: 'small', iconPlacement: 'right' }; var Themed = exports.Themed = ButtonTemplateWithChild.bind({}); Themed.args = { type: 'button', variation: 'primary', theme: (0, _index.extendTheme)(_index2.Button.theme, { content: 'title-x-large text-gray-50' }) };