@viraui/react 2026.3.7 → 2026.3.9
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.
|
@@ -10,7 +10,7 @@ import * as React from 'react';
|
|
|
10
10
|
*
|
|
11
11
|
* @default Renders an `a` root; pass `render` for framework Link composition.
|
|
12
12
|
*/
|
|
13
|
-
export type ButtonLinkProps = Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {
|
|
13
|
+
export type ButtonLinkProps = Omit<React.ComponentPropsWithRef<'a'>, 'type' | 'disabled'> & {
|
|
14
14
|
/**
|
|
15
15
|
* Replaces the default `a` root using Base UI render semantics (e.g. Next.js `Link`).
|
|
16
16
|
*
|
|
@@ -43,6 +43,7 @@ export type ButtonLinkProps = Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {
|
|
|
43
43
|
addonPosition?: ButtonAddonPosition;
|
|
44
44
|
/**
|
|
45
45
|
* Shows a centered spinner overlay while preserving the original content width.
|
|
46
|
+
* Sets `aria-disabled` / `aria-busy` for loading chrome; link stays activatable.
|
|
46
47
|
*
|
|
47
48
|
* @defaultValue false
|
|
48
49
|
*/
|
|
@@ -53,11 +54,5 @@ export type ButtonLinkProps = Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {
|
|
|
53
54
|
* @defaultValue false
|
|
54
55
|
*/
|
|
55
56
|
pill?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Marks the link inert via `aria-disabled` and prevents activation.
|
|
58
|
-
*
|
|
59
|
-
* @defaultValue false
|
|
60
|
-
*/
|
|
61
|
-
disabled?: boolean;
|
|
62
57
|
};
|
|
63
58
|
export declare const ButtonLink: React.FC<ButtonLinkProps>;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"whenNotToUse": ["In-page actions that do not navigate — use Button", "Icon-only navigation — use IconButtonLink"],
|
|
11
11
|
"accessibility": [
|
|
12
12
|
"Renders a real link root so assistive tech get link role and keyboard behavior",
|
|
13
|
-
"
|
|
13
|
+
"loading sets aria-disabled / aria-busy for loading chrome; no disabled prop — native links stay activatable",
|
|
14
14
|
"Loading sets aria-busy; Spinner stays decorative"
|
|
15
15
|
],
|
|
16
16
|
"antiPatterns": ["Using Button with render={<a />} instead of ButtonLink", "Forcing role=button on a link"],
|
|
@@ -23,11 +23,8 @@
|
|
|
23
23
|
"addonPosition": {
|
|
24
24
|
"description": "Controls whether the addon appears before or after the label."
|
|
25
25
|
},
|
|
26
|
-
"disabled": {
|
|
27
|
-
"description": "Marks the link inert via `aria-disabled` and prevents activation."
|
|
28
|
-
},
|
|
29
26
|
"loading": {
|
|
30
|
-
"description": "Shows a centered spinner overlay while preserving the original content width."
|
|
27
|
+
"description": "Shows a centered spinner overlay while preserving the original content width. Sets `aria-disabled` / `aria-busy` for loading chrome; link stays activatable."
|
|
31
28
|
},
|
|
32
29
|
"pill": {
|
|
33
30
|
"description": "Applies a fully rounded pill shape."
|
|
@@ -5,18 +5,10 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import "react";
|
|
6
6
|
import { useRender } from "@base-ui/react/use-render";
|
|
7
7
|
//#region src/components/button/button-link.tsx
|
|
8
|
-
var ButtonLink = ({ children, className,
|
|
9
|
-
const isDisabled = Boolean(disabled || loading);
|
|
8
|
+
var ButtonLink = ({ children, className, addon, addonPosition = "start", loading = false, pill = false, size = "medium", variant = "primary", render, ref, ...otherProps }) => {
|
|
10
9
|
const isIconOnly = Boolean(addon) && (children == null || children === "");
|
|
11
10
|
const loadingAttr = loading ? "true" : "false";
|
|
12
11
|
const spinnerSize = size === "large" ? "medium" : "small";
|
|
13
|
-
const handleClick = (event) => {
|
|
14
|
-
if (isDisabled) {
|
|
15
|
-
event.preventDefault();
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
onClick?.(event);
|
|
19
|
-
};
|
|
20
12
|
return useRender({
|
|
21
13
|
defaultTagName: "a",
|
|
22
14
|
render,
|
|
@@ -31,8 +23,7 @@ var ButtonLink = ({ children, className, disabled = false, addon, addonPosition
|
|
|
31
23
|
"data-icon-only": isIconOnly ? "true" : "false",
|
|
32
24
|
"data-addon-position": addon && !isIconOnly ? addonPosition : void 0,
|
|
33
25
|
"data-variant": variant,
|
|
34
|
-
|
|
35
|
-
...isDisabled && { "aria-disabled": true },
|
|
26
|
+
...loading && { "aria-disabled": true },
|
|
36
27
|
children: /* @__PURE__ */ jsxs(Fragment, { children: [isIconOnly ? /* @__PURE__ */ jsx("span", {
|
|
37
28
|
"aria-hidden": "true",
|
|
38
29
|
className: button_module_default.Content,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"accessibility": [
|
|
16
16
|
"Provide aria-label or aria-labelledby on every IconButtonLink — icon alone is not a name",
|
|
17
17
|
"Renders a real link root so assistive tech get link role",
|
|
18
|
-
"
|
|
18
|
+
"loading sets aria-disabled / aria-busy for loading chrome; no disabled prop — native links stay activatable"
|
|
19
19
|
],
|
|
20
20
|
"antiPatterns": [
|
|
21
21
|
"Passing children, addon, or addonPosition — not part of the public API",
|
|
@@ -24,14 +24,11 @@
|
|
|
24
24
|
"related": ["IconButton", "ButtonLink", "Button", "Icon", "Spinner"],
|
|
25
25
|
"properties": {
|
|
26
26
|
"react": {
|
|
27
|
-
"disabled": {
|
|
28
|
-
"description": "Marks the link inert via `aria-disabled` and prevents activation."
|
|
29
|
-
},
|
|
30
27
|
"icon": {
|
|
31
28
|
"description": "Icon rendered as the sole visible control content."
|
|
32
29
|
},
|
|
33
30
|
"loading": {
|
|
34
|
-
"description": "Shows a centered spinner overlay while preserving the original content width."
|
|
31
|
+
"description": "Shows a centered spinner overlay while preserving the original content width. Sets `aria-disabled` / `aria-busy` for loading chrome; link stays activatable."
|
|
35
32
|
},
|
|
36
33
|
"pill": {
|
|
37
34
|
"description": "Applies a fully rounded pill shape."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viraui/react",
|
|
3
|
-
"version": "2026.3.
|
|
3
|
+
"version": "2026.3.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@base-ui/react": ">=1.7.0",
|
|
31
|
-
"@viraui/foundation": "2026.3.
|
|
31
|
+
"@viraui/foundation": "2026.3.9",
|
|
32
32
|
"@viraui/icons": "2026.0.3",
|
|
33
33
|
"@viraui/postcss-config": "2026.0.0",
|
|
34
34
|
"@viraui/tsconfig": "2026.0.0",
|