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

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.4-beta.0",
3
+ "version": "0.30.4-beta.2",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -1,18 +1,17 @@
1
1
  import './Card.scss'
2
- import Link from 'next/link'
2
+ import Link, { type LinkProps } from 'next/link'
3
3
  import React from 'react'
4
4
  import { classNames } from '../../utils/classNames'
5
5
 
6
6
  export type Variant = 'primary'
7
7
 
8
- export interface CardProps {
8
+ export interface CardProps extends LinkProps {
9
9
  visible?: boolean
10
10
  className?: string
11
11
  variant?: Variant
12
12
  isDisabled?: boolean
13
13
  isActive?: boolean
14
14
  error?: boolean
15
- href?: string
16
15
  onClick?: () => void
17
16
  role?: string
18
17
  children: React.ReactNode
@@ -25,6 +24,7 @@ export function Card({
25
24
  isDisabled = false,
26
25
  isActive = false,
27
26
  error = false,
27
+ prefetch = false,
28
28
  children,
29
29
  href,
30
30
  ...props
@@ -40,7 +40,7 @@ export function Card({
40
40
 
41
41
  if (href && !isDisabled) {
42
42
  return (
43
- <Link href={href} className={cssClasses} {...props}>
43
+ <Link href={href} className={cssClasses} prefetch={prefetch} {...props}>
44
44
  {children}
45
45
  </Link>
46
46
  )
@@ -1,19 +1,19 @@
1
1
  import './Menu.scss'
2
- import Link from 'next/link'
3
- import React from 'react'
2
+ import Link, { type LinkProps } from 'next/link'
3
+ import React, { type AnchorHTMLAttributes } from 'react'
4
4
  import { classNames } from '../../utils/classNames'
5
5
  import type { IconType } from '../Icon'
6
6
  import { Icon } from '../Icon'
7
7
 
8
8
  export type Variant = 'primary'
9
9
 
10
- export interface MenuLinkProps
11
- extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
10
+ type AnchorProps = AnchorHTMLAttributes<HTMLAnchorElement> & LinkProps
11
+
12
+ export interface MenuLinkProps extends AnchorProps {
12
13
  title: string
13
14
  variant?: Variant
14
15
  icon?: IconType
15
16
  isActive?: boolean
16
- href: string
17
17
  }
18
18
 
19
19
  export function MenuLink({
@@ -22,7 +22,7 @@ export function MenuLink({
22
22
  className,
23
23
  icon,
24
24
  title,
25
- href,
25
+ prefetch = false,
26
26
  ...props
27
27
  }: MenuLinkProps): React.JSX.Element {
28
28
  const cssClasses = classNames('menu-item', variant, className, {
@@ -31,7 +31,7 @@ export function MenuLink({
31
31
 
32
32
  return (
33
33
  <li tabIndex={0} role="menuitem">
34
- <Link href={href} {...props} className={cssClasses}>
34
+ <Link {...props} prefetch={prefetch} className={cssClasses}>
35
35
  {icon && <Icon name={icon} size="3" />}
36
36
  <span className="title">{title}</span>
37
37
  </Link>
@@ -161,7 +161,6 @@ function OptionList({
161
161
  <div className="select-options">
162
162
  {isSearchable && (
163
163
  <Input
164
- autoFocus
165
164
  label={searchLabel}
166
165
  hideLabel
167
166
  onChange={(e) => search(e.target.value)}
@@ -1,4 +1,5 @@
1
1
  import './Pagination.scss'
2
+ import type { LinkProps } from 'next/link'
2
3
  import React from 'react'
3
4
  import { classNames } from '../../utils/classNames'
4
5
  import type { IconButtonProps } from '../Button'
@@ -6,7 +7,7 @@ import { IconButton } from '../Button'
6
7
 
7
8
  export type Variant = 'primary'
8
9
 
9
- export interface CustomProps {
10
+ export interface CustomProps extends LinkProps {
10
11
  href: string
11
12
  accessibilityLabel?: string
12
13
  variant?: Variant
@@ -20,6 +21,7 @@ export function PaginationArrow({
20
21
  href,
21
22
  className,
22
23
  disabled,
24
+ prefetch = false,
23
25
  ...props
24
26
  }: PaginationArrowProps): React.JSX.Element {
25
27
  const cssClasses = classNames('pagination-button', variant, className, {
@@ -32,6 +34,7 @@ export function PaginationArrow({
32
34
  href={disabled ? '#' : href}
33
35
  className={cssClasses}
34
36
  accessibilityLabel={accessibilityLabel}
37
+ prefetch={prefetch}
35
38
  {...props}
36
39
  />
37
40
  )
@@ -1,11 +1,12 @@
1
1
  import './Popover.scss'
2
2
  import type { LinkProps as NextLinkProps } from 'next/link'
3
3
  import Link from 'next/link'
4
+ import React, { type AnchorHTMLAttributes } from 'react'
4
5
  import { classNames } from '../../utils/classNames'
5
6
 
6
7
  export type Variant = 'primary'
7
8
 
8
- type LinkProps = NextLinkProps & React.AnchorHTMLAttributes<HTMLAnchorElement>
9
+ type LinkProps = NextLinkProps & AnchorHTMLAttributes<HTMLAnchorElement>
9
10
  export interface PopoverMenuOptionProps extends LinkProps {
10
11
  variant?: Variant
11
12
  title: string
@@ -21,6 +22,7 @@ export function PopoverMenuOption({
21
22
  disabled,
22
23
  href,
23
24
  active,
25
+ prefetch = false,
24
26
  ...props
25
27
  }: PopoverMenuOptionProps): React.JSX.Element {
26
28
  const cssClasses = classNames('popover-menu-option', variant, className, {
@@ -34,6 +36,7 @@ export function PopoverMenuOption({
34
36
  className={cssClasses}
35
37
  href={disabled ? '#' : href}
36
38
  aria-disabled={disabled}
39
+ prefetch={prefetch}
37
40
  {...props}
38
41
  >
39
42
  <span className="title">{title}</span>
@@ -60,7 +60,6 @@ export function QuantitySelector({
60
60
  className="decrement-button"
61
61
  disabled={disabled}
62
62
  onClick={handleDecrement}
63
- tabIndex={-1}
64
63
  />
65
64
  <Input
66
65
  id={id}
@@ -80,7 +79,6 @@ export function QuantitySelector({
80
79
  className="increment-button"
81
80
  disabled={disabled}
82
81
  onClick={handleIncrement}
83
- tabIndex={-1}
84
82
  />
85
83
  </div>
86
84
  </div>
@@ -164,7 +164,6 @@ function OptionList({
164
164
  <div className="select-options">
165
165
  {isSearchable && (
166
166
  <Input
167
- autoFocus
168
167
  label={searchLabel}
169
168
  hideLabel
170
169
  onChange={(e) => search(e.target.value)}
@@ -8,9 +8,7 @@ const meta = {
8
8
  docs: {
9
9
  description: {
10
10
  component:
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>',
11
+ '<h2>Usage guidelines</h2><p>Quantity Selector component is similar to text inputs, but is used to specify only a numeric value. Quantity Selector incrementally increase or decrease the value with a two-segment control.</p>',
14
12
  },
15
13
  },
16
14
  },