agroptima-design-system 1.2.32-beta.1 → 1.2.32

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": "1.2.32-beta.1",
3
+ "version": "1.2.32",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -99,11 +99,11 @@
99
99
  }
100
100
  }
101
101
 
102
- > .icon {
102
+ .icon {
103
103
  @include mixins.svg-color(var(--neutral-color-400));
104
104
  }
105
105
 
106
- > .password-icon {
106
+ .password-icon {
107
107
  @include mixins.svg-color(var(--neutral-color-600));
108
108
  }
109
109
  }
@@ -28,7 +28,6 @@
28
28
  -webkit-appearance: none;
29
29
  -moz-appearance: none;
30
30
  appearance: none;
31
- @include mixins.icon-color(var(--primary-color-600));
32
31
 
33
32
  &:focus-visible {
34
33
  outline: none;
@@ -38,6 +37,13 @@
38
37
  border-left: 1px solid var(--neutral-color-400);
39
38
  color: var(--neutral-color-400);
40
39
  cursor: default;
40
+ }
41
+ }
42
+
43
+ .input-with-select .input-container .input-suffix .select-suffix-trigger {
44
+ @include mixins.icon-color(var(--primary-color-600));
45
+
46
+ &:disabled {
41
47
  @include mixins.icon-color(var(--neutral-color-400));
42
48
  }
43
49
  }
@@ -9,7 +9,7 @@ const meta = {
9
9
  description: {
10
10
  component:
11
11
  '<h2>Usage guidelines</h2>' +
12
- '<p>The InputWithSelect component is used when the value the user types needs a unit or symbol attached to it, such as a discount percentage or a measurement. It combines an input field with a compact select fused into the same field, placed as a suffix.</p>' +
12
+ '<p>The InputWithSelect component is used when the value the user types needs a unit or symbol attached to it, such as a percentage or a measurement. It combines an input field with a compact select fused into the same field, placed as a suffix.</p>' +
13
13
  '<ul>' +
14
14
  ' <li>Use when the unit is closely tied to the value and only a short, fixed list of symbols applies (e.g. %, kg, m²)</li>' +
15
15
  ' <li>Keep the list of options short, these are not meant to be searched</li>' +
@@ -61,24 +61,25 @@ type Story = StoryObj<typeof meta>
61
61
 
62
62
  export const Primary: Story = {
63
63
  args: {
64
- label: 'Discount',
65
- name: 'discount',
64
+ label: 'Weight',
65
+ name: 'weight',
66
66
  type: 'number',
67
67
  defaultValue: 10,
68
- helpText: 'Applied to the total amount',
69
- selectAccessibilityLabel: 'Select discount unit',
68
+ helpText: 'This text can help you',
69
+ selectAccessibilityLabel: 'Select weight unit',
70
70
  options: [
71
- { id: '%', label: '%' },
72
- { id: 'eur', label: '€' },
71
+ { id: 'kg', label: 'kg' },
72
+ { id: 'g', label: 'g' },
73
+ { id: 'lb', label: 'lb' },
73
74
  ],
74
- id: 'discount',
75
+ id: 'weight',
75
76
  },
76
77
  }
77
78
 
78
79
  export const WithErrors: Story = {
79
80
  args: {
80
81
  ...Primary.args,
81
- errors: ['Discount must be lower than 100%'],
82
+ errors: ['Weight must be greater than 0'],
82
83
  },
83
84
  }
84
85
 
@@ -4,8 +4,8 @@ import React from 'react'
4
4
  import { InputWithSelect } from '../src/atoms/InputWithSelect'
5
5
 
6
6
  const options = [
7
- { id: '%', label: '%' },
8
- { id: 'kg', label: 'kg' },
7
+ { id: 'percentage', label: '%' },
8
+ { id: 'kilogram', label: 'kg' },
9
9
  ]
10
10
 
11
11
  describe('InputWithSelect', () => {
@@ -45,7 +45,7 @@ describe('InputWithSelect', () => {
45
45
 
46
46
  await user.click(screen.getByRole('option', { name: 'kg' }))
47
47
 
48
- expect(handleSelectChange).toHaveBeenCalledWith('kg')
48
+ expect(handleSelectChange).toHaveBeenCalledWith('kilogram')
49
49
  expect(
50
50
  screen.getByRole('combobox', { name: 'Select unit: kg' }),
51
51
  ).toHaveTextContent('kg')