@granto-umbrella/umbrella-components 2.3.9 → 2.3.11

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": "2.3.9",
3
+ "version": "2.3.11",
4
4
  "description": "Umbrella Components for React",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -17,7 +17,9 @@ registerLocale("pt-BR", ptBR);
17
17
 
18
18
  // global overrides for the popup calendar
19
19
  export const DatePickerGlobalStyles = createGlobalStyle`
20
- /* … your existing .react-datepicker* overrides … */
20
+ .react-datepicker-wrapper {
21
+ display: flex !important;
22
+ }
21
23
  `;
22
24
 
23
25
  // wrapper around input + icon
@@ -26,11 +28,11 @@ export const InputWrapper = styled.div`
26
28
  width: 100%;
27
29
  `;
28
30
 
29
- // absolutely positioned icon
31
+ // ícone absolutizado à esquerda
30
32
  export const IconWrapper = styled.div`
31
33
  position: absolute;
32
34
  top: 50%;
33
- left: ${semanticSizes.global.padding.md};
35
+ left: ${semanticSizes.global.padding.lg};
34
36
  transform: translateY(-50%);
35
37
  pointer-events: none;
36
38
  color: ${semanticColors.neutral[500]};
@@ -43,7 +45,7 @@ export const StyledDatePicker = styled(
43
45
  width: 100%;
44
46
  padding: ${semanticSizes.global.padding.md} ${semanticSizes.global.padding.lg};
45
47
  padding-left: calc(
46
- ${semanticSizes.global.padding.md} ${semanticSizes.global.padding.md}
48
+ ${semanticSizes.global.padding.lg} ${primitiveSizes.size.x4}
47
49
  );
48
50
  border: 1px solid ${semanticColors.neutral[300]};
49
51
  border-radius: ${semanticRadius.global.radius.md};
@@ -10,9 +10,11 @@ import {
10
10
  IconWrapper,
11
11
  } from "./DatePicker.styles";
12
12
 
13
+ import "react-datepicker/dist/react-datepicker.css";
14
+
13
15
  interface DatePickerInputProps {
14
16
  mode?: "single" | "range";
15
- selected: Date | [Date, Date];
17
+ selected: Date | [Date, Date] | null;
16
18
  onChange: (date: Date | [Date, Date]) => void;
17
19
  minDate?: Date;
18
20
  maxDate?: Date;
@@ -39,7 +41,6 @@ export const DatePickerInput: React.FC<DatePickerInputProps> = ({
39
41
  <DatePickerGlobalStyles />
40
42
 
41
43
  <InputWrapper>
42
- {/* the calendar icon */}
43
44
  <IconWrapper>
44
45
  <CalendarIcon size={16} />
45
46
  </IconWrapper>
@@ -48,9 +49,9 @@ export const DatePickerInput: React.FC<DatePickerInputProps> = ({
48
49
  <StyledDatePicker
49
50
  locale="pt-BR"
50
51
  selectsRange
51
- startDate={(selected as [Date, Date])[0] || undefined}
52
- endDate={(selected as [Date, Date])[1] || undefined}
53
- selected={(selected as [Date, Date])[0] || undefined}
52
+ startDate={(selected as [Date, Date])[0] || undefined || null}
53
+ endDate={(selected as [Date, Date])[1] || undefined || null}
54
+ selected={(selected as [Date, Date])[0] || undefined || null}
54
55
  onChange={(d) => onChange(d as [Date, Date])}
55
56
  minDate={minDate}
56
57
  maxDate={maxDate}
@@ -0,0 +1,3 @@
1
+ // src/global.d.ts
2
+ // Allow import of any ".css" file
3
+ declare module "*.css";