@lets-events/react 12.3.0 → 12.3.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @lets-events/react@12.3.0 build
2
+ > @lets-events/react@12.3.2 build
3
3
  > tsup src/index.tsx --format esm,cjs --dts --external react
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,11 +9,11 @@
9
9
  CLI Target: es6
10
10
  ESM Build start
11
11
  CJS Build start
12
- CJS dist\index.js 395.67 KB
13
- CJS ⚡️ Build success in 226ms
14
- ESM dist\index.mjs 381.64 KB
15
- ESM ⚡️ Build success in 227ms
12
+ ESM dist\index.mjs 381.68 KB
13
+ ESM ⚡️ Build success in 225ms
14
+ CJS dist\index.js 395.71 KB
15
+ CJS ⚡️ Build success in 224ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 4571ms
17
+ DTS ⚡️ Build success in 4574ms
18
18
  DTS dist\index.d.mts 398.68 KB
19
19
  DTS dist\index.d.ts 398.68 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 12.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - fix button loading state
8
+
9
+ ## 12.3.1
10
+
11
+ ### Patch Changes
12
+
13
+ - fix button loading state
14
+
3
15
  ## 12.3.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.js CHANGED
@@ -1862,7 +1862,7 @@ var import_jsx_runtime3 = require("react/jsx-runtime");
1862
1862
  function Button(_a) {
1863
1863
  var _b = _a, { asChild, children, loading } = _b, props = __objRest(_b, ["asChild", "children", "loading"]);
1864
1864
  const Component = asChild ? import_themes3.Button : "button";
1865
- const { size } = props;
1865
+ const { size, disabled } = props;
1866
1866
  const spinnerSize = (0, import_react2.useMemo)(() => {
1867
1867
  switch (size) {
1868
1868
  case "small":
@@ -1874,10 +1874,10 @@ function Button(_a) {
1874
1874
  case "large":
1875
1875
  return "xl";
1876
1876
  default:
1877
- return "sm";
1877
+ return "md";
1878
1878
  }
1879
1879
  }, [size]);
1880
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonStyled, __spreadProps(__spreadValues({ as: Component }, props), { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SpinningDiv, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: "circle-notch", size: spinnerSize }) }) : children }));
1880
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonStyled, __spreadProps(__spreadValues({ as: Component }, props), { disabled: disabled || loading, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SpinningDiv, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: "circle-notch", size: spinnerSize }) }) : children }));
1881
1881
  }
1882
1882
 
1883
1883
  // src/components/ButtonGroup.tsx
package/dist/index.mjs CHANGED
@@ -1746,7 +1746,7 @@ import { jsx as jsx3 } from "react/jsx-runtime";
1746
1746
  function Button(_a) {
1747
1747
  var _b = _a, { asChild, children, loading } = _b, props = __objRest(_b, ["asChild", "children", "loading"]);
1748
1748
  const Component = asChild ? ButtonRadix2 : "button";
1749
- const { size } = props;
1749
+ const { size, disabled } = props;
1750
1750
  const spinnerSize = useMemo(() => {
1751
1751
  switch (size) {
1752
1752
  case "small":
@@ -1758,10 +1758,10 @@ function Button(_a) {
1758
1758
  case "large":
1759
1759
  return "xl";
1760
1760
  default:
1761
- return "sm";
1761
+ return "md";
1762
1762
  }
1763
1763
  }, [size]);
1764
- return /* @__PURE__ */ jsx3(ButtonStyled, __spreadProps(__spreadValues({ as: Component }, props), { children: loading ? /* @__PURE__ */ jsx3(SpinningDiv, { children: /* @__PURE__ */ jsx3(Icon_default, { name: "circle-notch", size: spinnerSize }) }) : children }));
1764
+ return /* @__PURE__ */ jsx3(ButtonStyled, __spreadProps(__spreadValues({ as: Component }, props), { disabled: disabled || loading, children: loading ? /* @__PURE__ */ jsx3(SpinningDiv, { children: /* @__PURE__ */ jsx3(Icon_default, { name: "circle-notch", size: spinnerSize }) }) : children }));
1765
1765
  }
1766
1766
 
1767
1767
  // src/components/ButtonGroup.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.3.0",
3
+ "version": "12.3.2",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -14,7 +14,7 @@ export interface ButtonProps
14
14
 
15
15
  export function Button({ asChild, children, loading, ...props }: ButtonProps) {
16
16
  const Component = asChild ? ButtonRadix : "button";
17
- const { size } = props;
17
+ const { size, disabled } = props;
18
18
 
19
19
  const spinnerSize = useMemo((): IconProps["size"] => {
20
20
  switch (size) {
@@ -27,12 +27,12 @@ export function Button({ asChild, children, loading, ...props }: ButtonProps) {
27
27
  case "large":
28
28
  return "xl";
29
29
  default:
30
- return "sm";
30
+ return "md";
31
31
  }
32
32
  }, [size]);
33
33
 
34
34
  return (
35
- <ButtonStyled as={Component} {...props}>
35
+ <ButtonStyled as={Component} {...props} disabled={disabled || loading}>
36
36
  {loading ? (
37
37
  <SpinningDiv>
38
38
  <Icon name="circle-notch" size={spinnerSize} />