@arcfusionz/arc-primitive-ui 0.2.11 → 0.2.12

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.
@@ -8,6 +8,8 @@ interface ButtonVariantsOptions {
8
8
  size?: ButtonSize;
9
9
  fullWidth?: boolean;
10
10
  iconOnly?: boolean;
11
+ /** Render an icon-only button as a circle instead of the default rounded square. */
12
+ circular?: boolean;
11
13
  className?: string;
12
14
  }
13
15
  /**
@@ -18,7 +20,7 @@ interface ButtonVariantsOptions {
18
20
  *
19
21
  * <a href="/docs" className={buttonVariants({ variant: "primary" })}>Docs</a>
20
22
  */
21
- declare function buttonVariants({ variant, size, fullWidth, iconOnly, className }?: ButtonVariantsOptions): string;
23
+ declare function buttonVariants({ variant, size, fullWidth, iconOnly, circular, className }?: ButtonVariantsOptions): string;
22
24
  interface ButtonBaseProps extends Omit<ComponentPropsWithoutRef<typeof Button>, "className"> {
23
25
  /** Visual style of the button */
24
26
  variant?: ButtonVariant;
@@ -43,13 +45,18 @@ interface ButtonBaseProps extends Omit<ComponentPropsWithoutRef<typeof Button>,
43
45
  }
44
46
  /** Icon-only buttons have no visible label, so an accessible name is required. */
45
47
  type ButtonIconOnlyProps = {
48
+ /** Button that renders only an icon; requires an accessible name. */
46
49
  iconOnly: true;
50
+ /** Use a circular shape instead of the default rounded square. */
51
+ circular?: boolean;
47
52
  "aria-label": string;
48
53
  } | {
49
54
  iconOnly: true;
55
+ circular?: boolean;
50
56
  "aria-labelledby": string;
51
57
  } | {
52
58
  iconOnly?: false;
59
+ circular?: never;
53
60
  };
54
61
  type ButtonProps = ButtonBaseProps & ButtonIconOnlyProps;
55
62
  declare const Button$1: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -30,8 +30,8 @@ const iconOnlySizeClasses = {
30
30
  *
31
31
  * <a href="/docs" className={buttonVariants({ variant: "primary" })}>Docs</a>
32
32
  */
33
- function buttonVariants({ variant = "primary", size = "md", fullWidth = false, iconOnly = false, className } = {}) {
34
- return cn(baseClasses, variantClasses[variant], sizeClasses[size], iconOnly && iconOnlySizeClasses[size], fullWidth && "w-full", className);
33
+ function buttonVariants({ variant = "primary", size = "md", fullWidth = false, iconOnly = false, circular = false, className } = {}) {
34
+ return cn(baseClasses, variantClasses[variant], sizeClasses[size], iconOnly && iconOnlySizeClasses[size], iconOnly && circular && "rounded-full", fullWidth && "w-full", className);
35
35
  }
36
36
  const loadingDataAttributes = { "data-loading": "" };
37
37
  const RIPPLE_DURATION_MS = 550;
@@ -106,7 +106,7 @@ function Spinner() {
106
106
  })]
107
107
  });
108
108
  }
109
- const Button$1 = forwardRef(({ variant = "primary", size = "md", fullWidth = false, iconOnly = false, loading = false, loadingText, startIcon, endIcon, disabled = false, focusableWhenDisabled = false, onPointerDown, onClick, className, children, ...rest }, ref) => {
109
+ const Button$1 = forwardRef(({ variant = "primary", size = "md", fullWidth = false, iconOnly = false, circular = false, loading = false, loadingText, startIcon, endIcon, disabled = false, focusableWhenDisabled = false, onPointerDown, onClick, className, children, ...rest }, ref) => {
110
110
  const rippleContainerRef = useRef(null);
111
111
  const handleRipplePointerDown = (event) => {
112
112
  const container = rippleContainerRef.current;
@@ -152,7 +152,8 @@ const Button$1 = forwardRef(({ variant = "primary", size = "md", fullWidth = fal
152
152
  variant,
153
153
  size,
154
154
  fullWidth,
155
- iconOnly
155
+ iconOnly,
156
+ circular
156
157
  }), loading && "data-disabled:opacity-100", className),
157
158
  ...loading ? loadingDataAttributes : void 0,
158
159
  ...rest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcfusionz/arc-primitive-ui",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "ArcFusion primitive UI components",
5
5
  "license": "MIT",
6
6
  "type": "module",