@aarhus-university/au-lib-react-components 10.20.0 → 10.20.2

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,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "@aarhus-university/au-lib-react-components",
4
- "version": "10.20.0",
4
+ "version": "10.20.2",
5
5
  "description": "Library for shared React components for various applications on au.dk",
6
6
  "scripts": {
7
7
  "test": "jest",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "dependencies": {
75
75
  "@aarhus-university/au-designsystem-delphinus": "0.30.1",
76
- "@aarhus-university/types": "0.13.5",
76
+ "@aarhus-university/types": "0.13.6",
77
77
  "@reduxjs/toolkit": "^1.8.3",
78
78
  "@types/google.analytics": "^0.0.42",
79
79
  "@types/history": "^5.0.0",
@@ -20,6 +20,7 @@ const AUDatepickerComponent: FC<AUDatepickerComponentProps> = ({
20
20
  limitStart,
21
21
  limitEnd,
22
22
  disabled,
23
+ sideBySideGrowth,
23
24
  }: AUDatepickerComponentProps) => {
24
25
  const [showCalendar, setShowCalendar] = useState(false);
25
26
  const [sDate, setDate] = useState<Date>(date as Date);
@@ -30,7 +31,7 @@ const AUDatepickerComponent: FC<AUDatepickerComponentProps> = ({
30
31
  onHide(sDate, dateFormatted);
31
32
  };
32
33
 
33
- let className = 'form__field';
34
+ let className = 'datepicker form__field';
34
35
  if (fullWidth) {
35
36
  className = `${className} form__field--full-width`;
36
37
  }
@@ -43,29 +44,31 @@ const AUDatepickerComponent: FC<AUDatepickerComponentProps> = ({
43
44
  className = `${className} visually-disabled`;
44
45
  }
45
46
 
47
+ if (typeof sideBySideGrowth !== 'undefined' && sideBySideGrowth > 0) {
48
+ className = `${className} form__field--width-relative-${sideBySideGrowth}`;
49
+ }
50
+
46
51
  return (
47
52
  <div
48
- className="datepicker"
53
+ className={className}
49
54
  aria-owns={`${id}-calendar`}
50
55
  aria-haspopup="true"
51
56
  aria-expanded={showCalendar}
52
57
  >
53
- <div className={className}>
54
- {showLabel && <label htmlFor={id}>{labelText}</label>}
55
- <input
56
- id={id}
57
- type="text"
58
- value={dateFormatted}
59
- title={
60
- lang === 'da'
61
- ? 'Klik for at åbne datovælger'
62
- : 'Click to open datepicker'
63
- }
64
- readOnly
65
- disabled={disabled}
66
- onClick={() => setShowCalendar(!showCalendar)}
67
- />
68
- </div>
58
+ {showLabel && <label htmlFor={id}>{labelText}</label>}
59
+ <input
60
+ id={id}
61
+ type="text"
62
+ value={dateFormatted}
63
+ title={
64
+ lang === 'da'
65
+ ? 'Klik for at åbne datovælger'
66
+ : 'Click to open datepicker'
67
+ }
68
+ readOnly
69
+ disabled={disabled}
70
+ onClick={() => setShowCalendar(!showCalendar)}
71
+ />
69
72
  {showCalendar && (
70
73
  <div className="datepicker__calendar-container">
71
74
  <AUCalendarComponent
@@ -111,6 +114,7 @@ AUDatepickerComponent.defaultProps = {
111
114
  limitStart: null,
112
115
  limitEnd: null,
113
116
  disabled: false,
117
+ sideBySideGrowth: 0,
114
118
  };
115
119
 
116
120
  AUDatepickerComponent.displayName = 'AUDatepickerComponent';