@mailstep/design-system 0.9.2 → 0.9.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": "@mailstep/design-system",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -91,7 +91,7 @@ const StyledButton = styled$1.button`
91
91
  &[data-variant='outline'] {
92
92
  background-color: white;
93
93
  border: slim;
94
-
94
+
95
95
  &[data-appearance='primary'] {
96
96
  color: typoPrimary;
97
97
  border-color: typoPrimary;
@@ -114,7 +114,7 @@ const StyledButton = styled$1.button`
114
114
  }
115
115
  }
116
116
 
117
- &[data-appearance='tertiary'] {
117
+ &[data-appearance='tertiary'] {
118
118
  color: dangerColor;
119
119
  border-color: dangerColor;
120
120
 
@@ -1,5 +1,4 @@
1
- import { SelectProps, CustomTheme } from '../types';
2
- import { Option } from '../types';
1
+ import { type SelectProps, type CustomTheme, type Option } from '../types';
3
2
  type Props = {
4
3
  onCustomSelectAll: ({ options }: {
5
4
  options?: Option[];
@@ -50,13 +50,11 @@ const SelectAll = ({ onCustomSelectAll, onCustomDeselectAll, value, options, max
50
50
  value
51
51
  ]);
52
52
  useEffect(() => {
53
- if (value && Array.isArray(value)) {
54
- options?.length === value.length && setIsSelected(true);
55
- options?.length !== value.length && setIsSelected(false);
56
- }
53
+ const selectedValues = Array.isArray(value) ? value.map((option) => option && typeof option === "object" ? option.value : option) : [];
54
+ setIsSelected(!!options?.length && options.every((option) => selectedValues.includes(option.value)));
57
55
  }, [
58
56
  maxMenuHeight,
59
- options?.length,
57
+ options,
60
58
  value
61
59
  ]);
62
60
  if (!options?.length) return null;