@granto-umbrella/umbrella-components 3.0.57 → 3.0.59

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": "@granto-umbrella/umbrella-components",
3
- "version": "3.0.57",
3
+ "version": "3.0.59",
4
4
  "description": "Umbrella Components for React",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -4,7 +4,6 @@ import {
4
4
  semanticBorders,
5
5
  semanticColors,
6
6
  semanticRadius,
7
- semanticShadows,
8
7
  typographyTokens,
9
8
  } from '../../../styles/tokens';
10
9
  import CreatableSelect from 'react-select/creatable';
@@ -34,17 +33,52 @@ export const CustomSelect = styled(CreatableSelect)<{
34
33
  $error?: boolean;
35
34
  $size?: 'sm' | 'md' | 'lg';
36
35
  }>`
37
- .react-select__control {
38
- min-height: ${primitiveSizes.size.x12};
39
- border-radius: ${semanticRadius.global.radius.md};
40
- border: ${semanticBorders.global.sm} solid
41
- ${({ $error }) =>
42
- $error
43
- ? semanticColors.global.border.danger.enabled
44
- : semanticColors.global.border.medium};
45
-
46
- &:focus-within {
47
- box-shadow: ${semanticShadows.shadow.md};
48
- }
49
- }
36
+ ${({ $size = 'md' }) => {
37
+ const sizeMap = {
38
+ sm: {
39
+ minHeight: primitiveSizes.size.x10,
40
+ paddingY: primitiveSizes.size.x1,
41
+ paddingX: primitiveSizes.size.x2,
42
+ fontSize: typographyTokens.fontSizes.bodyS,
43
+ },
44
+ md: {
45
+ minHeight: primitiveSizes.size.x12,
46
+ paddingY: primitiveSizes.size.x2,
47
+ paddingX: primitiveSizes.size.x3,
48
+ fontSize: typographyTokens.fontSizes.bodyM,
49
+ },
50
+ lg: {
51
+ minHeight: primitiveSizes.size.x14,
52
+ paddingY: primitiveSizes.size.x3,
53
+ paddingX: primitiveSizes.size.x4,
54
+ fontSize: typographyTokens.fontSizes.bodyL,
55
+ },
56
+ };
57
+
58
+ const size = sizeMap[$size];
59
+
60
+ return `
61
+ .react-select__control {
62
+ min-height: ${size.minHeight};
63
+ border-radius: ${semanticRadius.global.radius.md};
64
+ border: ${semanticBorders.global.sm} solid
65
+ ${semanticColors.global.border.medium};
66
+ }
67
+
68
+ .react-select__value-container {
69
+ padding: ${size.paddingY} ${size.paddingX};
70
+ }
71
+
72
+ .react-select__single-value,
73
+ .react-select__placeholder,
74
+ .react-select__input-container {
75
+ font-size: ${size.fontSize};
76
+ }
77
+
78
+ .react-select__input {
79
+ margin: 0;
80
+ padding: 0;
81
+ }
82
+ `;
83
+ }}
50
84
  `;
@@ -64,6 +64,7 @@ export default function EditableDurationSelect({
64
64
  size = 'md',
65
65
  testId,
66
66
  baseLimit = BASE_LIMIT,
67
+ placeholder = 'Selecione ou insira a duração',
67
68
  }: EditableDurationSelectProps) {
68
69
  const [inputValue, setInputValue] = useState('');
69
70
 
@@ -114,13 +115,14 @@ export default function EditableDurationSelect({
114
115
  {label && <Label>{label}</Label>}
115
116
 
116
117
  <CustomSelect
118
+ classNamePrefix="react-select"
117
119
  isSearchable
118
120
  isDisabled={disabled}
119
121
  $size={size}
120
122
  $error={error}
121
123
  options={mergedOptions}
122
124
  value={value}
123
- placeholder="Digite ou selecione"
125
+ placeholder={placeholder}
124
126
  onInputChange={handleInputChange}
125
127
  onChange={(opt) => handleChange(opt as DurationOption | null)}
126
128
  formatCreateLabel={() => null}
@@ -15,4 +15,5 @@ export interface EditableDurationSelectProps {
15
15
  size?: 'sm' | 'md' | 'lg';
16
16
  testId?: string;
17
17
  baseLimit?: number;
18
+ placeholder?: string;
18
19
  }