agroptima-design-system 0.29.2-beta.5 → 0.29.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.29.2-beta.5",
3
+ "version": "0.29.2",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -45,21 +45,20 @@ export function Button({
45
45
  disabled,
46
46
  variant = 'primary',
47
47
  loading = false,
48
+ className,
48
49
  ...props
49
50
  }: ButtonProps) {
50
- if (loading) {
51
- leftIcon = 'Loading'
52
- }
53
- const cssClasses = classNames(props.className, 'button', variant)
51
+ const leftIconName = loading ? 'Loading' : leftIcon
52
+ const cssClasses = classNames(className, 'button', variant)
54
53
 
55
54
  return (
56
55
  <BaseButton
57
56
  disabled={loading || disabled}
58
57
  aria-label={accessibilityLabel || label}
59
- {...props}
60
58
  className={cssClasses}
59
+ {...props}
61
60
  >
62
- {leftIcon && <Icon name={leftIcon} size="3" />}
61
+ {leftIconName && <Icon name={leftIconName} size="3" />}
63
62
  {label}
64
63
  {rightIcon && <Icon name={rightIcon} size="3" />}
65
64
  </BaseButton>
@@ -35,7 +35,7 @@ export function FloatingButton({
35
35
 
36
36
  return (
37
37
  <BaseButton
38
- disabled={disabled}
38
+ disabled={loading || disabled}
39
39
  aria-label={accessibilityLabel}
40
40
  className={cssClasses}
41
41
  {...props}
@@ -25,15 +25,16 @@ export function IconButton({
25
25
  variant = 'primary',
26
26
  loading = false,
27
27
  size,
28
+ className,
28
29
  ...props
29
30
  }: IconButtonProps) {
30
31
  const iconName = loading ? 'Loading' : icon
31
32
  return (
32
33
  <BaseButton
33
- disabled={disabled}
34
+ disabled={loading || disabled}
34
35
  aria-label={accessibilityLabel}
36
+ className={classNames(className, 'icon-button', variant)}
35
37
  {...props}
36
- className={classNames(props.className, 'icon-button', variant)}
37
38
  >
38
39
  <Icon title={accessibilityLabel} name={iconName} size={size} />
39
40
  </BaseButton>
@@ -1,4 +1,3 @@
1
- 'use client'
2
1
  import './Select.scss'
3
2
  import React, { useRef, useState } from 'react'
4
3
  import { useOpen } from '../hooks/useOpen'
@@ -161,7 +160,6 @@ function OptionList({
161
160
  searchLabel,
162
161
  }: OptionListProps) {
163
162
  const { findItems, search } = useSearch(options, 'label')
164
-
165
163
  return (
166
164
  <div className="select-options">
167
165
  {isSearchable && (
@@ -24,6 +24,7 @@ const meta = {
24
24
  },
25
25
  loading: {
26
26
  description: 'Is the button in loading state?',
27
+ control: { type: 'boolean', default: false },
27
28
  },
28
29
  leftIcon: {
29
30
  description: 'Button left icon from a list of values',
@@ -39,7 +40,7 @@ const meta = {
39
40
  },
40
41
  visible: {
41
42
  description: 'Is the button visible?',
42
- control: { type: 'boolean', default: true },
43
+ control: { type: 'boolean' },
43
44
  },
44
45
  },
45
46
  }
@@ -23,6 +23,10 @@ const meta = {
23
23
  description:
24
24
  'If a link is provided, the component will be rendered as NextLink, otherwise as button',
25
25
  },
26
+ loading: {
27
+ description: 'Is the button in loading state?',
28
+ control: { type: 'boolean' },
29
+ },
26
30
  },
27
31
  }
28
32
 
@@ -27,6 +27,10 @@ const meta = {
27
27
  description:
28
28
  'If a link is provided, the component will be rendered as NextLink, otherwise as button',
29
29
  },
30
+ loading: {
31
+ description: 'Is the button in loading state?',
32
+ control: { type: 'boolean' },
33
+ },
30
34
  },
31
35
  }
32
36