@mbao01/ui 0.1.28 → 0.1.30

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mbao01/ui",
3
3
  "private": false,
4
- "version": "0.1.28",
4
+ "version": "0.1.30",
5
5
  "type": "module",
6
6
  "author": "Ayomide Bakare",
7
7
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "test:coverage": "vitest run --coverage"
41
41
  },
42
42
  "dependencies": {
43
- "@mbao01/common": "^0.0.27",
43
+ "@mbao01/common": "^0.0.29",
44
44
  "@radix-ui/react-icons": "^1.3.0",
45
45
  "clsx": "^2.1.0"
46
46
  },
@@ -87,5 +87,5 @@
87
87
  "peerDependencies": {
88
88
  "react-router-dom": "^6.22.0"
89
89
  },
90
- "gitHead": "011f80eb4c8b456df0a2af179f46f57000a603b5"
90
+ "gitHead": "1ccc8b44c98ab629a4ec708e3ee1bee6d9e13be8"
91
91
  }
@@ -14,17 +14,19 @@ export const Link = ({
14
14
  underline = false,
15
15
  ...props
16
16
  }: LinkProps) => {
17
+ const isExternal = target === "_blank";
17
18
  return (
18
19
  <RouterLink
19
20
  to={href}
20
21
  target={target}
21
22
  className={cn(getLinkClasses({ hover, variant, underline }), className)}
22
23
  {...props}
24
+ {...(isExternal && { rel: "noopener noreferrer" })}
23
25
  >
24
26
  {children}
25
- {target === "_blank" && (
27
+ {isExternal ? (
26
28
  <ExternalLinkIcon name="external" className="ml-[2px] inline" />
27
- )}
29
+ ) : null}
28
30
  </RouterLink>
29
31
  );
30
32
  };