agroptima-design-system 0.30.2-beta.0 → 0.30.3

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.2-beta.0",
3
+ "version": "0.30.3",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -161,6 +161,7 @@ function OptionList({
161
161
  <div className="select-options">
162
162
  {isSearchable && (
163
163
  <Input
164
+ autoFocus
164
165
  label={searchLabel}
165
166
  hideLabel
166
167
  onChange={(e) => search(e.target.value)}
@@ -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>
@@ -164,6 +164,7 @@ function OptionList({
164
164
  <div className="select-options">
165
165
  {isSearchable && (
166
166
  <Input
167
+ autoFocus
167
168
  label={searchLabel}
168
169
  hideLabel
169
170
  onChange={(e) => search(e.target.value)}
@@ -4,13 +4,14 @@ import { Meta } from "@storybook/blocks";
4
4
 
5
5
  # Changelog
6
6
 
7
- ## 0.30.2
7
+ ## 0.30.3
8
8
 
9
- * Use native increment and decrement buttons on QuantitySelector component.
9
+ * Autofocus on search input in the Select and MultiSelect components.
10
+ * Ignore keyboard tabbing for the `+` and `-` buttons in the QuantitySelector component.
10
11
 
11
- BREAKING CHANGES
12
+ ## 0.30.2
12
13
 
13
- * Remove onIncrement and onDecrement props from QuantitySelector component.
14
+ * Update QuantitySelector decrement & increment logic management
14
15
 
15
16
  ## 0.30.1
16
17
 
@@ -8,7 +8,9 @@ const meta = {
8
8
  docs: {
9
9
  description: {
10
10
  component:
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>',
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
  },
@@ -1,5 +1,4 @@
1
1
  import { render } from '@testing-library/react'
2
- import userEvent from '@testing-library/user-event'
3
2
  import { QuantitySelector } from '../src/atoms/QuantitySelector'
4
3
 
5
4
  describe('QuantitySelector', () => {
@@ -28,34 +27,4 @@ describe('QuantitySelector', () => {
28
27
  )
29
28
  expect(getByRole('spinbutton')).toHaveValue(1)
30
29
  })
31
- it('add one step when press on increment button', async () => {
32
- const user = userEvent.setup()
33
- const { getByRole } = render(
34
- <QuantitySelector
35
- label="Quantity"
36
- name="quantity"
37
- defaultValue={5}
38
- step={1}
39
- />,
40
- )
41
-
42
- await user.click(getByRole('button', { name: '+' }))
43
-
44
- expect(getByRole('spinbutton')).toHaveValue(6)
45
- })
46
- it('remove one step when press on increment button', async () => {
47
- const user = userEvent.setup()
48
- const { getByRole } = render(
49
- <QuantitySelector
50
- label="Quantity"
51
- name="quantity"
52
- defaultValue={5}
53
- step={1}
54
- />,
55
- )
56
-
57
- await user.click(getByRole('button', { name: '-' }))
58
-
59
- expect(getByRole('spinbutton')).toHaveValue(4)
60
- })
61
30
  })