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 +1 -1
- package/src/atoms/Button/Button.tsx +5 -6
- package/src/atoms/Button/FloatingButton.tsx +1 -1
- package/src/atoms/Button/IconButton.tsx +3 -2
- package/src/atoms/Select.tsx +0 -2
- package/src/stories/Button.stories.ts +2 -1
- package/src/stories/FloatingButton.stories.ts +4 -0
- package/src/stories/IconButton.stories.ts +4 -0
package/package.json
CHANGED
|
@@ -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
|
-
|
|
51
|
-
|
|
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
|
-
{
|
|
61
|
+
{leftIconName && <Icon name={leftIconName} size="3" />}
|
|
63
62
|
{label}
|
|
64
63
|
{rightIcon && <Icon name={rightIcon} size="3" />}
|
|
65
64
|
</BaseButton>
|
|
@@ -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>
|
package/src/atoms/Select.tsx
CHANGED
|
@@ -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'
|
|
43
|
+
control: { type: 'boolean' },
|
|
43
44
|
},
|
|
44
45
|
},
|
|
45
46
|
}
|