agroptima-design-system 0.30.2 → 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,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 =
|
|
9
|
+
type HtmlButtonProps = ButtonHTMLAttributes<HTMLButtonElement>
|
|
9
10
|
|
|
10
|
-
type AnchorProps =
|
|
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={
|
|
30
|
+
<NextLink href={href} {...restProps} prefetch={prefetch}>
|
|
29
31
|
{children}
|
|
30
32
|
</NextLink>
|
|
31
33
|
)
|
|
@@ -60,6 +60,7 @@ export function QuantitySelector({
|
|
|
60
60
|
className="decrement-button"
|
|
61
61
|
disabled={disabled}
|
|
62
62
|
onClick={handleDecrement}
|
|
63
|
+
tabIndex={-1}
|
|
63
64
|
/>
|
|
64
65
|
<Input
|
|
65
66
|
id={id}
|
|
@@ -79,6 +80,7 @@ export function QuantitySelector({
|
|
|
79
80
|
className="increment-button"
|
|
80
81
|
disabled={disabled}
|
|
81
82
|
onClick={handleIncrement}
|
|
83
|
+
tabIndex={-1}
|
|
82
84
|
/>
|
|
83
85
|
</div>
|
|
84
86
|
</div>
|
package/src/atoms/Select.tsx
CHANGED
|
@@ -4,6 +4,15 @@ 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
|
+
|
|
11
|
+
## 0.30.3
|
|
12
|
+
|
|
13
|
+
* Autofocus on search input in the Select and MultiSelect components.
|
|
14
|
+
* Ignore keyboard tabbing for the `+` and `-` buttons in the QuantitySelector component.
|
|
15
|
+
|
|
7
16
|
## 0.30.2
|
|
8
17
|
|
|
9
18
|
* Update QuantitySelector decrement & increment logic management
|
|
@@ -8,7 +8,9 @@ const meta = {
|
|
|
8
8
|
docs: {
|
|
9
9
|
description: {
|
|
10
10
|
component:
|
|
11
|
-
'<h2>Usage guidelines</h2
|
|
11
|
+
'<h2>Usage guidelines</h2>' +
|
|
12
|
+
'<p>Quantity Selector component is similar to text inputs, but is used to specify only a numeric value. Quantity Selector incrementally increases or decreases the value with a two-segment control.</p>' +
|
|
13
|
+
'<p>When using keyboard controls, increment and decrement buttons are ignored so the user is taken to the quantity input.</p>',
|
|
12
14
|
},
|
|
13
15
|
},
|
|
14
16
|
},
|