agroptima-design-system 0.30.3 → 0.30.4-beta.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "agroptima-design-system",
3
- "version": "0.30.3",
3
+ "version": "0.30.4-beta.0",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -1,13 +1,14 @@
1
- import NextLink from 'next/link'
1
+ import NextLink, { type LinkProps } from 'next/link'
2
+ import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react'
2
3
 
3
4
  interface CommonProps {
4
5
  disabled?: boolean
5
6
  visible?: boolean
6
7
  }
7
8
 
8
- type HtmlButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>
9
+ type HtmlButtonProps = ButtonHTMLAttributes<HTMLButtonElement>
9
10
 
10
- type AnchorProps = React.AnchorHTMLAttributes<HTMLAnchorElement>
11
+ type AnchorProps = AnchorHTMLAttributes<HTMLAnchorElement> & LinkProps
11
12
 
12
13
  export type BaseButtonProps =
13
14
  | (HtmlButtonProps & CommonProps)
@@ -24,8 +25,9 @@ export function BaseButton({
24
25
  if (!visible) return null
25
26
  const isLink = !props.disabled && hasHref(props)
26
27
  if (isLink) {
28
+ const { href, prefetch = false, ...restProps } = props
27
29
  return (
28
- <NextLink href={props.href || ''} {...props}>
30
+ <NextLink href={href} {...restProps} prefetch={prefetch}>
29
31
  {children}
30
32
  </NextLink>
31
33
  )
@@ -4,6 +4,10 @@ import { Meta } from "@storybook/blocks";
4
4
 
5
5
  # Changelog
6
6
 
7
+ ## 0.30.4
8
+
9
+ * Add NextLink props to button link component.
10
+
7
11
  ## 0.30.3
8
12
 
9
13
  * Autofocus on search input in the Select and MultiSelect components.