@bolttech/ob-atoms-button 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,9 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var jsxRuntime = require('react/jsx-runtime');
4
3
  var react = require('react');
5
4
  var uiUtils = require('@bolttech/ui-utils');
6
5
  var obAtomsIcon = require('@bolttech/ob-atoms-icon');
6
+ var jsxDevRuntime = require('react/jsx-dev-runtime');
7
+
8
+ function _objectWithoutPropertiesLoose(r, e) {
9
+ if (null == r) return {};
10
+ var t = {};
11
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
12
+ if (-1 !== e.indexOf(n)) continue;
13
+ t[n] = r[n];
14
+ }
15
+ return t;
16
+ }
7
17
 
8
18
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
9
19
 
@@ -45,7 +55,7 @@ var fails$7 = fails$9;
45
55
 
46
56
  var functionBindNative = !fails$7(function () {
47
57
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
48
- var test = (function () { /* empty */ }).bind();
58
+ var test = function () { /* empty */ }.bind();
49
59
  // eslint-disable-next-line no-prototype-builtins -- safe
50
60
  return typeof test != 'function' || test.hasOwnProperty('prototype');
51
61
  });
@@ -323,10 +333,10 @@ var SHARED = '__core-js_shared__';
323
333
  var store$3 = sharedStore.exports = globalThis$6[SHARED] || defineGlobalProperty$2(SHARED, {});
324
334
 
325
335
  (store$3.versions || (store$3.versions = [])).push({
326
- version: '3.48.0',
336
+ version: '3.49.0',
327
337
  mode: 'global',
328
338
  copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
329
- license: 'https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE',
339
+ license: 'https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE',
330
340
  source: 'https://github.com/zloirock/core-js'
331
341
  });
332
342
 
@@ -1066,42 +1076,10 @@ $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign },
1066
1076
  assign: assign
1067
1077
  });
1068
1078
 
1069
- /******************************************************************************
1070
- Copyright (c) Microsoft Corporation.
1071
-
1072
- Permission to use, copy, modify, and/or distribute this software for any
1073
- purpose with or without fee is hereby granted.
1074
-
1075
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1076
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1077
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1078
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1079
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1080
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1081
- PERFORMANCE OF THIS SOFTWARE.
1082
- ***************************************************************************** */
1083
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
1084
-
1085
-
1086
- function __rest(s, e) {
1087
- var t = {};
1088
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1089
- t[p] = s[p];
1090
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1091
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1092
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1093
- t[p[i]] = s[p[i]];
1094
- }
1095
- return t;
1096
- }
1097
-
1098
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
1099
- var e = new Error(message);
1100
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1101
- };
1102
-
1103
- const Button = /*#__PURE__*/react.forwardRef((_a, ref) => {
1104
- var {
1079
+ const _excluded = ["id", "title", "variant", "size", "disabled", "fullWidth", "onClick", "type", "iconLeft", "iconRight", "dataTestId"];
1080
+ var _jsxFileName = "/home/anderson-francisco/development/bolttech-ui/libs/ob/atoms/button/src/lib/button.tsx";
1081
+ const Button = /*#__PURE__*/react.forwardRef((_ref, ref) => {
1082
+ let {
1105
1083
  id,
1106
1084
  title,
1107
1085
  variant,
@@ -1113,31 +1091,47 @@ const Button = /*#__PURE__*/react.forwardRef((_a, ref) => {
1113
1091
  iconLeft,
1114
1092
  iconRight,
1115
1093
  dataTestId
1116
- } = _a,
1117
- props = __rest(_a, ["id", "title", "variant", "size", "disabled", "fullWidth", "onClick", "type", "iconLeft", "iconRight", "dataTestId"]);
1118
- return jsxRuntime.jsxs("button", Object.assign({}, props, {
1094
+ } = _ref,
1095
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
1096
+ return /*#__PURE__*/jsxDevRuntime.jsxDEV("button", Object.assign({}, props, {
1119
1097
  ref: ref,
1120
1098
  "data-testid": dataTestId,
1121
1099
  id: id,
1122
- className: `flex align-center button-container ${variant} ${size}${fullWidth ? ' full-width' : ''}`,
1100
+ className: `flex align-center items-center button-container ${variant} ${size}${fullWidth ? ' full-width' : ''}`,
1123
1101
  disabled: disabled,
1124
1102
  onClick: onClick,
1125
1103
  type: type
1126
1104
  }, disabled ? {
1127
1105
  'aria-disabled': disabled
1128
1106
  } : {}, uiUtils.applyDataAttributes(props), {
1129
- children: [iconLeft && jsxRuntime.jsx(obAtomsIcon.Icon, Object.assign({
1107
+ children: [iconLeft && /*#__PURE__*/jsxDevRuntime.jsxDEV(obAtomsIcon.Icon, Object.assign({
1130
1108
  icon: iconLeft,
1131
1109
  dataTestId: `buttonIcon-${iconLeft}`,
1132
1110
  "aria-hidden": true
1133
- }, uiUtils.applyDataAttributes(props, 'icon-left'))), title && jsxRuntime.jsx("span", Object.assign({}, uiUtils.applyDataAttributes(props, 'label'), {
1111
+ }, uiUtils.applyDataAttributes(props, 'icon-left')), void 0, false, {
1112
+ fileName: _jsxFileName,
1113
+ lineNumber: 40,
1114
+ columnNumber: 11
1115
+ }, undefined), title && /*#__PURE__*/jsxDevRuntime.jsxDEV("span", Object.assign({}, uiUtils.applyDataAttributes(props, 'label'), {
1134
1116
  children: title
1135
- })), iconRight && jsxRuntime.jsx(obAtomsIcon.Icon, Object.assign({
1117
+ }), void 0, false, {
1118
+ fileName: _jsxFileName,
1119
+ lineNumber: 47,
1120
+ columnNumber: 19
1121
+ }, undefined), iconRight && /*#__PURE__*/jsxDevRuntime.jsxDEV(obAtomsIcon.Icon, Object.assign({
1136
1122
  dataTestId: `buttonIcon-${iconRight}`,
1137
1123
  icon: iconRight,
1138
1124
  "aria-hidden": true
1139
- }, uiUtils.applyDataAttributes(props, 'icon-right')))]
1140
- }));
1125
+ }, uiUtils.applyDataAttributes(props, 'icon-right')), void 0, false, {
1126
+ fileName: _jsxFileName,
1127
+ lineNumber: 49,
1128
+ columnNumber: 11
1129
+ }, undefined)]
1130
+ }), void 0, true, {
1131
+ fileName: _jsxFileName,
1132
+ lineNumber: 27,
1133
+ columnNumber: 7
1134
+ }, undefined);
1141
1135
  });
1142
1136
 
1143
1137
  exports.Button = Button;
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@bolttech/ob-atoms-button",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "dependencies": {
5
- "@bolttech/ui-utils": "0.6.5"
5
+ "@bolttech/ui-utils": "0.6.7",
6
+ "react": "19.1.2",
7
+ "@bolttech/ob-atoms-icon": "1.0.1"
6
8
  },
7
9
  "main": "./index.cjs.js",
8
10
  "type": "commonjs",
package/src/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './lib/button';
2
- export type { IButtonProps, ButtonVariants } from './lib/button.interface';
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { IButtonProps } from './button.interface';
3
- import './button.css';
4
- export declare const Button: React.ForwardRefExoticComponent<IButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -1,27 +0,0 @@
1
- import { DefaultProps } from '@bolttech/ui-utils';
2
- export type ButtonVariants = 'transaction' | 'brand' | 'alternative' | 'outline' | 'ghost';
3
- export type ButtonSizes = 'sm' | 'md' | 'lg';
4
- export type ButtonTypes = 'button' | 'submit';
5
- export interface IButtonProps extends DefaultProps {
6
- dataTestId?: string;
7
- disabled?: boolean;
8
- title?: string;
9
- variant: ButtonVariants;
10
- size: ButtonSizes;
11
- /**
12
- * The HTML `id` attribute for the button.
13
- *
14
- * Must be unique within the document and conform to
15
- * HTML `id` naming rules (no spaces, not starting with a digit, etc.).
16
- * Useful for targeting the button in scripts, automated tests,
17
- * or associating it with a `<label>` for accessibility.
18
- *
19
- * @defaultValue - no `id` attribute is rendered
20
- */
21
- id?: string;
22
- iconRight?: string;
23
- iconLeft?: string;
24
- type?: ButtonTypes;
25
- fullWidth?: boolean;
26
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
27
- }
@@ -1,12 +0,0 @@
1
- import type { StoryObj } from '@storybook/react-vite';
2
- declare const meta: {
3
- component: import("react").ForwardRefExoticComponent<import("./button.interface").IButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
4
- title: string;
5
- };
6
- export default meta;
7
- type Story = StoryObj<typeof meta>;
8
- export declare const Alternative: Story;
9
- export declare const Brand: Story;
10
- export declare const Ghost: Story;
11
- export declare const Outline: Story;
12
- export declare const Transaction: Story;