Skip to content

Commit

Permalink
chore: migrate vui-source changes to v3.10.0 (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrderyk authored Jan 8, 2025
1 parent 6f780b2 commit 55f1335
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vectara/vectara-ui",
"version": "3.9.0",
"version": "3.10.0",
"homepage": "https://vectara.github.io/vectara-ui/",
"description": "Vectara's design system, codified as a React and Sass component library",
"author": "Vectara",
Expand Down
36 changes: 25 additions & 11 deletions src/docs/pages/button/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
import { VuiButtonPrimary } from "../../../lib";
import { useState } from "react";
import { VuiButtonPrimary, VuiSpacer, VuiToggle } from "../../../lib";

export const Link = () => {
const [isDisabled, setIsDisabled] = useState<boolean>(false);

return (
<VuiButtonPrimary
color="accent"
href="https://vectara.com"
target="_blank"
onClick={() => console.log("click")}
onMouseOver={() => console.log("mouse over")}
onMouseOut={() => console.log("mouse out")}
>
Visit Vectara.com
</VuiButtonPrimary>
<>
<VuiToggle
label="Disabled (not clickable, visual)"
checked={isDisabled}
onChange={() => setIsDisabled(!isDisabled)}
/>

<VuiSpacer size="m" />

<VuiButtonPrimary
color="accent"
href="https://vectara.com"
target="_blank"
onClick={() => console.log("click")}
onMouseOver={() => console.log("mouse over")}
onMouseOut={() => console.log("mouse out")}
isDisabled={isDisabled}
>
Visit Vectara.com
</VuiButtonPrimary>
</>
);
};
4 changes: 3 additions & 1 deletion src/lib/components/button/BaseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export const BaseButton = forwardRef<HTMLButtonElement | null, Props>(
);
}

if (href) {
// Anchor tags can't be disabled, so we'll just render a button instead
// if isDisabled is true.
if (href && !isDisabled) {
const wrapperClasses = classNames("vuiBaseButtonLinkWrapper", {
"vuiBaseButtonLinkWrapper--fullWidth": fullWidth
});
Expand Down

0 comments on commit 55f1335

Please sign in to comment.