UNPKG

@stokr/components-library

Version:

STOKR - Components Library

132 lines (131 loc) 5.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.SlowAnimation = exports.FullWidth = exports.FastAnimation = exports.Disabled = exports.Default = exports.CustomColors = void 0; var _react = _interopRequireDefault(require("react")); var _GlareButton = _interopRequireDefault(require("./GlareButton")); var _actions = require("storybook/actions"); 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 _default = exports.default = { title: 'Components Library/Buttons/GlareButton', component: _GlareButton.default, parameters: { docs: { description: { component: 'A button with animated glare effect that adds visual interest to important actions.' } } }, argTypes: { children: { control: 'text', description: 'Button content' }, onClick: { action: 'clicked', description: 'Function called when button is clicked' }, disabled: { control: 'boolean', description: 'Disables the button when true' }, nowrap: { control: 'boolean', description: 'When true, button is displayed inline instead of block' }, fullWidth: { control: 'boolean', description: 'Makes the button take full width of its container' }, disabledColor: { control: 'color', description: 'Custom color for disabled state' }, buttonId: { control: 'text', description: 'Custom ID for the button element' }, className: { control: 'text', description: 'Additional CSS classes' }, backgroundColor: { control: 'color', description: 'Custom background color' }, textColor: { control: 'color', description: 'Custom text color' }, borderColor: { control: 'color', description: 'Custom border color' }, glareColorDark: { control: 'color', description: 'The darker, primary color of the animated glare.' }, glareColorLight: { control: 'color', description: 'The lighter, secondary color of the animated glare.' }, animationDuration: { control: { type: 'range', min: 1, max: 10, step: 0.5 }, description: 'Duration of the glare animation in seconds' } } }; const Template = args => /*#__PURE__*/_react.default.createElement("div", { style: { margin: '50px', position: 'relative' } }, /*#__PURE__*/_react.default.createElement(_GlareButton.default, args)); const Default = exports.Default = Template.bind({}); Default.args = { children: 'Default Glare Button', onClick: (0, _actions.action)('button-clicked'), disabled: false, nowrap: false, fullWidth: false }; const Disabled = exports.Disabled = Template.bind({}); Disabled.args = _objectSpread(_objectSpread({}, Default.args), {}, { children: 'Disabled Glare Button', disabled: true }); const FullWidth = exports.FullWidth = Template.bind({}); FullWidth.args = _objectSpread(_objectSpread({}, Default.args), {}, { children: 'Full Width Glare Button', fullWidth: true }); const CustomColors = exports.CustomColors = Template.bind({}); CustomColors.args = _objectSpread(_objectSpread({}, Default.args), {}, { children: 'Custom Colors', backgroundColor: '#6200ee', textColor: '#ffffff', borderColor: '#9d4edd', glareColorDark: '#e0aaff', glareColorLight: '#ffffff' }); const SlowAnimation = exports.SlowAnimation = Template.bind({}); SlowAnimation.args = _objectSpread(_objectSpread({}, Default.args), {}, { children: 'Slow Glare Effect', animationDuration: 8 }); const FastAnimation = exports.FastAnimation = Template.bind({}); FastAnimation.args = _objectSpread(_objectSpread({}, Default.args), {}, { children: 'Fast Glare Effect', animationDuration: 2 });