agroptima-design-system 0.33.0 → 0.33.1
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
|
@@ -22,6 +22,7 @@ export interface RadioGroupProps {
|
|
|
22
22
|
disabled?: boolean
|
|
23
23
|
variant?: Variant
|
|
24
24
|
helpText?: string
|
|
25
|
+
onChange?: (value: string) => void
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export function RadioGroup({
|
|
@@ -35,7 +36,14 @@ export function RadioGroup({
|
|
|
35
36
|
required = false,
|
|
36
37
|
disabled = false,
|
|
37
38
|
variant = 'primary',
|
|
39
|
+
onChange = () => {},
|
|
38
40
|
}: RadioGroupProps) {
|
|
41
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
42
|
+
const value = event.target.value
|
|
43
|
+
if (onChange) {
|
|
44
|
+
onChange(value)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
39
47
|
return (
|
|
40
48
|
<div className={classNames('radio-group', variant, className)}>
|
|
41
49
|
<Label required={required}>{label}</Label>
|
|
@@ -50,6 +58,7 @@ export function RadioGroup({
|
|
|
50
58
|
defaultChecked={defaultValue === option.value}
|
|
51
59
|
variant={variant}
|
|
52
60
|
disabled={disabled}
|
|
61
|
+
onChange={handleChange}
|
|
53
62
|
/>
|
|
54
63
|
))}
|
|
55
64
|
</fieldset>
|
|
@@ -4,6 +4,10 @@ import { Meta } from "@storybook/blocks";
|
|
|
4
4
|
|
|
5
5
|
# Changelog
|
|
6
6
|
|
|
7
|
+
## 0.33.1
|
|
8
|
+
|
|
9
|
+
* Add onChange prop to RadioGroup component
|
|
10
|
+
|
|
7
11
|
## 0.33.0
|
|
8
12
|
|
|
9
13
|
* Add TabMenu component
|
|
@@ -14,7 +18,7 @@ import { Meta } from "@storybook/blocks";
|
|
|
14
18
|
|
|
15
19
|
## 0.32.2
|
|
16
20
|
|
|
17
|
-
* Fix disabled color input
|
|
21
|
+
* Fix disabled color input
|
|
18
22
|
|
|
19
23
|
## 0.32.1
|
|
20
24
|
|
|
@@ -54,7 +58,6 @@ import { Meta } from "@storybook/blocks";
|
|
|
54
58
|
* Review responsive mobile style
|
|
55
59
|
* Return date on DatePicker in ISO format
|
|
56
60
|
|
|
57
|
-
|
|
58
61
|
## 0.31.12
|
|
59
62
|
|
|
60
63
|
* Fix background color in date picker calendar with input
|
|
@@ -211,13 +214,11 @@ import { Meta } from "@storybook/blocks";
|
|
|
211
214
|
|
|
212
215
|
* Fix icon size for Button component
|
|
213
216
|
|
|
214
|
-
|
|
215
217
|
## 0.27.21
|
|
216
218
|
|
|
217
219
|
* No required accessibility label for Badge component.
|
|
218
220
|
* No pass props to div in QuantitySelector component.
|
|
219
221
|
|
|
220
|
-
|
|
221
222
|
## 0.27.20
|
|
222
223
|
|
|
223
224
|
* Fix state for select and multiselect search
|
|
@@ -464,9 +465,11 @@ BREAKING CHANGES
|
|
|
464
465
|
* Change the way to put the classname on Input component.
|
|
465
466
|
|
|
466
467
|
## 0.21.5
|
|
468
|
+
|
|
467
469
|
* Update open state in Collapsible component.
|
|
468
470
|
|
|
469
471
|
## 0.21.5
|
|
472
|
+
|
|
470
473
|
* Update the way in which we import the source.
|
|
471
474
|
* Alignment correction in Cards and CardsTable components.
|
|
472
475
|
* Add css class helpers and common styles.
|
|
@@ -22,6 +22,9 @@ const meta = {
|
|
|
22
22
|
},
|
|
23
23
|
tags: ['autodocs'],
|
|
24
24
|
argTypes: {
|
|
25
|
+
onChange: {
|
|
26
|
+
description: 'Function onChange',
|
|
27
|
+
},
|
|
25
28
|
variant: {
|
|
26
29
|
description: 'Variant used from a list of values',
|
|
27
30
|
},
|
|
@@ -47,6 +50,9 @@ export const Default: Story = {
|
|
|
47
50
|
label: 'Select your videogame preference',
|
|
48
51
|
name: 'videogames-preference',
|
|
49
52
|
helpText: 'This is a help text',
|
|
53
|
+
onChange: (itemId) => {
|
|
54
|
+
console.log('onChange itemId', itemId)
|
|
55
|
+
},
|
|
50
56
|
options: [
|
|
51
57
|
{ label: 'Action games', value: 'action' },
|
|
52
58
|
{ label: 'Party games', value: 'party' },
|