@ballistix.digital/react-components 0.1.8 → 0.1.13

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React, { FC, ReactNode, ReactElement } from 'react';
1
+ import React, { FC, ReactNode, RefObject, ReactElement } from 'react';
2
2
  import { Menu } from '@headlessui/react';
3
3
 
4
4
  type StylesType$f = {
@@ -34,6 +34,7 @@ interface Props$d {
34
34
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
35
35
  figure?: 'block' | 'rounded';
36
36
  status?: 'idle' | 'loading' | 'success' | 'error';
37
+ ref?: RefObject<HTMLButtonElement>;
37
38
  isDisabled?: boolean;
38
39
  styles?: StylesType$e;
39
40
  onClick: () => void;
package/dist/index.esm.js CHANGED
@@ -135,7 +135,7 @@ var styles$h = {
135
135
  };
136
136
 
137
137
  var ButtonElement = function (props) {
138
- var children = props.children, _a = props.type, type = _a === void 0 ? 'primary' : _a, _b = props.size, size = _b === void 0 ? 'md' : _b, _c = props.figure, figure = _c === void 0 ? 'block' : _c, _d = props.status, status = _d === void 0 ? 'idle' : _d, isDisabled = props.isDisabled, customStyles = props.styles, onClick = props.onClick;
138
+ var ref = props.ref, children = props.children, _a = props.type, type = _a === void 0 ? 'primary' : _a, _b = props.size, size = _b === void 0 ? 'md' : _b, _c = props.figure, figure = _c === void 0 ? 'block' : _c, _d = props.status, status = _d === void 0 ? 'idle' : _d, isDisabled = props.isDisabled, customStyles = props.styles, onClick = props.onClick;
139
139
  var toClassName = useCallback(function () {
140
140
  var values = [];
141
141
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -154,7 +154,7 @@ var ButtonElement = function (props) {
154
154
  toClassName,
155
155
  type,
156
156
  ]);
157
- return (jsxs("button", __assign({ type: "button", className: style.container, disabled: isDisabled || status !== 'idle', onClick: onClick }, { children: [status === 'idle' && children, status === 'loading' && (jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsx(ArrowPathIcon, { className: styles$g.base.spinner }), jsx("p", { children: "Loading..." })] }))), status === 'error' && (jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsx(ExclamationCircleIcon, { className: styles$g.base.icon }), jsx("p", { children: "Oops" })] }))), status === 'success' && (jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsx(CheckIcon, { className: styles$g.base.icon }), jsx("p", { children: "Success" })] })))] })));
157
+ return (jsxs("button", __assign({ type: "button", className: style.container, disabled: isDisabled || status !== 'idle', onClick: onClick, ref: ref }, { children: [status === 'idle' && children, status === 'loading' && (jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsx(ArrowPathIcon, { className: styles$g.base.spinner }), jsx("p", { children: "Loading..." })] }))), status === 'error' && (jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsx(ExclamationCircleIcon, { className: styles$g.base.icon }), jsx("p", { children: "Oops" })] }))), status === 'success' && (jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsx(CheckIcon, { className: styles$g.base.icon }), jsx("p", { children: "Success" })] })))] })));
158
158
  };
159
159
 
160
160
  var base$4 = {
package/dist/index.js CHANGED
@@ -143,7 +143,7 @@ var styles$h = {
143
143
  };
144
144
 
145
145
  var ButtonElement = function (props) {
146
- var children = props.children, _a = props.type, type = _a === void 0 ? 'primary' : _a, _b = props.size, size = _b === void 0 ? 'md' : _b, _c = props.figure, figure = _c === void 0 ? 'block' : _c, _d = props.status, status = _d === void 0 ? 'idle' : _d, isDisabled = props.isDisabled, customStyles = props.styles, onClick = props.onClick;
146
+ var ref = props.ref, children = props.children, _a = props.type, type = _a === void 0 ? 'primary' : _a, _b = props.size, size = _b === void 0 ? 'md' : _b, _c = props.figure, figure = _c === void 0 ? 'block' : _c, _d = props.status, status = _d === void 0 ? 'idle' : _d, isDisabled = props.isDisabled, customStyles = props.styles, onClick = props.onClick;
147
147
  var toClassName = React.useCallback(function () {
148
148
  var values = [];
149
149
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -162,7 +162,7 @@ var ButtonElement = function (props) {
162
162
  toClassName,
163
163
  type,
164
164
  ]);
165
- return (jsxRuntime.jsxs("button", __assign({ type: "button", className: style.container, disabled: isDisabled || status !== 'idle', onClick: onClick }, { children: [status === 'idle' && children, status === 'loading' && (jsxRuntime.jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsxRuntime.jsx(solid.ArrowPathIcon, { className: styles$g.base.spinner }), jsxRuntime.jsx("p", { children: "Loading..." })] }))), status === 'error' && (jsxRuntime.jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsxRuntime.jsx(solid.ExclamationCircleIcon, { className: styles$g.base.icon }), jsxRuntime.jsx("p", { children: "Oops" })] }))), status === 'success' && (jsxRuntime.jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsxRuntime.jsx(solid.CheckIcon, { className: styles$g.base.icon }), jsxRuntime.jsx("p", { children: "Success" })] })))] })));
165
+ return (jsxRuntime.jsxs("button", __assign({ type: "button", className: style.container, disabled: isDisabled || status !== 'idle', onClick: onClick, ref: ref }, { children: [status === 'idle' && children, status === 'loading' && (jsxRuntime.jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsxRuntime.jsx(solid.ArrowPathIcon, { className: styles$g.base.spinner }), jsxRuntime.jsx("p", { children: "Loading..." })] }))), status === 'error' && (jsxRuntime.jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsxRuntime.jsx(solid.ExclamationCircleIcon, { className: styles$g.base.icon }), jsxRuntime.jsx("p", { children: "Oops" })] }))), status === 'success' && (jsxRuntime.jsxs("div", __assign({ className: styles$g.base.loading }, { children: [jsxRuntime.jsx(solid.CheckIcon, { className: styles$g.base.icon }), jsxRuntime.jsx("p", { children: "Success" })] })))] })));
166
166
  };
167
167
 
168
168
  var base$4 = {
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "email": "info@ballistix.digital",
7
7
  "url": "https://ballistix.digital"
8
8
  },
9
- "version": "0.1.8",
9
+ "version": "0.1.13",
10
10
  "private": false,
11
11
  "main": "dist/index.js",
12
12
  "module": "dist/index.esm.js",