@cmdniels/uikit 1.0.6 → 1.0.8

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,4 +1,6 @@
1
1
  import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
2
  import { buttonVariants } from "./buttonVariants";
3
3
  import type { VariantProps } from "class-variance-authority";
4
- export default function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react/jsx-runtime").JSX.Element;
4
+ export default function Button({ className, children, variant, size, loading, disabled, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants> & {
5
+ loading?: boolean;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -9,11 +9,12 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Button as ButtonPrimitive } from "@base-ui/react/button";
14
14
  import cn from "../../cn";
15
+ import Spinner from "../../components/spinner/Spinner";
15
16
  import { buttonVariants } from "./buttonVariants";
16
17
  export default function Button(_a) {
17
- var { className, variant = "default", size = "default" } = _a, props = __rest(_a, ["className", "variant", "size"]);
18
- return (_jsx(ButtonPrimitive, Object.assign({ "data-slot": "button", className: cn(buttonVariants({ variant, size, className })) }, props)));
18
+ var { className, children, variant = "default", size = "default", loading = false, disabled } = _a, props = __rest(_a, ["className", "children", "variant", "size", "loading", "disabled"]);
19
+ return (_jsxs(ButtonPrimitive, Object.assign({ "data-slot": "button", className: cn(buttonVariants({ variant, size, className }), loading && "relative"), disabled: disabled !== null && disabled !== void 0 ? disabled : loading }, props, { children: [loading && _jsx(Spinner, { className: "absolute inset-0 m-auto" }), _jsx("span", { className: cn("contents", loading && "invisible"), children: children })] })));
19
20
  }
@@ -1,5 +1,5 @@
1
1
  import { cva } from "class-variance-authority";
2
- const buttonGroupVariants = cva("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
2
+ const buttonGroupVariants = cva("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 [&>[data-slot=button]]:border-border has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
3
3
  variants: {
4
4
  orientation: {
5
5
  horizontal: "[&>[data-slot]]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",
@@ -1,4 +1,4 @@
1
- declare const TypographyImg: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref" | "height" | "width" | "alt" | "src" | "loading" | "srcSet"> & {
1
+ declare const TypographyImg: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref" | "height" | "width" | "loading" | "alt" | "src" | "srcSet"> & {
2
2
  src: string | import("next/dist/shared/lib/get-img-props").StaticImport;
3
3
  alt: string;
4
4
  width?: number | `${number}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmdniels/uikit",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",