cozy-ui 111.15.1 → 111.15.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [111.15.2](https://github.com/cozy/cozy-ui/compare/v111.15.1...v111.15.2) (2024-10-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **BottomSheet:** Add safe area and flagship app height to compute toolbar height ([f452eca](https://github.com/cozy/cozy-ui/commit/f452eca))
|
|
7
|
+
|
|
1
8
|
## [111.15.1](https://github.com/cozy/cozy-ui/compare/v111.15.0...v111.15.1) (2024-10-09)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -14,7 +14,11 @@ export const computeToolbarHeight = (toolbarProps = {}) => {
|
|
|
14
14
|
computedToolbarHeight = ref.current.offsetHeight
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
return
|
|
17
|
+
return (
|
|
18
|
+
computedToolbarHeight +
|
|
19
|
+
(getFlagshipMetadata().statusBarHeight || 0) +
|
|
20
|
+
getSafeAreaValue('top')
|
|
21
|
+
)
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
export const computeMaxHeight = toolbarProps => {
|
|
@@ -22,19 +22,19 @@ describe('computeMaxHeight', () => {
|
|
|
22
22
|
it('should return correct value if no arg', () => {
|
|
23
23
|
const res = computeMaxHeight({})
|
|
24
24
|
|
|
25
|
-
expect(res).toBe(
|
|
25
|
+
expect(res).toBe(784)
|
|
26
26
|
})
|
|
27
27
|
|
|
28
28
|
it('should return correct value with height arg', () => {
|
|
29
29
|
const res = computeMaxHeight({ height: 50 })
|
|
30
30
|
|
|
31
|
-
expect(res).toBe(
|
|
31
|
+
expect(res).toBe(735)
|
|
32
32
|
})
|
|
33
33
|
|
|
34
34
|
it('should return correct value with ref arg', () => {
|
|
35
35
|
const res = computeMaxHeight({ ref: { current: { offsetHeight: 50 } } })
|
|
36
36
|
|
|
37
|
-
expect(res).toBe(
|
|
37
|
+
expect(res).toBe(735)
|
|
38
38
|
})
|
|
39
39
|
})
|
|
40
40
|
|
|
@@ -397,7 +397,7 @@ describe('computeBottomSpacer', () => {
|
|
|
397
397
|
offset: 0
|
|
398
398
|
})
|
|
399
399
|
|
|
400
|
-
expect(res).toBe(
|
|
400
|
+
expect(res).toBe(16)
|
|
401
401
|
})
|
|
402
402
|
|
|
403
403
|
it('should return the toolbar height', () => {
|
|
@@ -409,7 +409,7 @@ describe('computeBottomSpacer', () => {
|
|
|
409
409
|
offset: 0
|
|
410
410
|
})
|
|
411
411
|
|
|
412
|
-
expect(res).toBe(
|
|
412
|
+
expect(res).toBe(65)
|
|
413
413
|
})
|
|
414
414
|
|
|
415
415
|
it('should return the offset value and border', () => {
|
|
@@ -420,7 +420,7 @@ describe('computeBottomSpacer', () => {
|
|
|
420
420
|
offset: 48
|
|
421
421
|
})
|
|
422
422
|
|
|
423
|
-
expect(res).toBe(
|
|
423
|
+
expect(res).toBe(64)
|
|
424
424
|
})
|
|
425
425
|
|
|
426
426
|
it('should return the offset value and border and toolbar height', () => {
|
|
@@ -432,7 +432,7 @@ describe('computeBottomSpacer', () => {
|
|
|
432
432
|
offset: 48
|
|
433
433
|
})
|
|
434
434
|
|
|
435
|
-
expect(res).toBe(
|
|
435
|
+
expect(res).toBe(113)
|
|
436
436
|
})
|
|
437
437
|
})
|
|
438
438
|
})
|
|
@@ -495,7 +495,7 @@ describe('computeBottomSpacer', () => {
|
|
|
495
495
|
offset: 0
|
|
496
496
|
})
|
|
497
497
|
|
|
498
|
-
expect(res).toBe(
|
|
498
|
+
expect(res).toBe(16)
|
|
499
499
|
})
|
|
500
500
|
|
|
501
501
|
it('should return the toolbar height', () => {
|
|
@@ -507,7 +507,7 @@ describe('computeBottomSpacer', () => {
|
|
|
507
507
|
offset: 0
|
|
508
508
|
})
|
|
509
509
|
|
|
510
|
-
expect(res).toBe(
|
|
510
|
+
expect(res).toBe(65)
|
|
511
511
|
})
|
|
512
512
|
|
|
513
513
|
it('should return the offset value', () => {
|
|
@@ -518,7 +518,7 @@ describe('computeBottomSpacer', () => {
|
|
|
518
518
|
offset: 48
|
|
519
519
|
})
|
|
520
520
|
|
|
521
|
-
expect(res).toBe(
|
|
521
|
+
expect(res).toBe(64)
|
|
522
522
|
})
|
|
523
523
|
|
|
524
524
|
it('should return the offset value and toolbar height', () => {
|
|
@@ -530,7 +530,7 @@ describe('computeBottomSpacer', () => {
|
|
|
530
530
|
offset: 48
|
|
531
531
|
})
|
|
532
532
|
|
|
533
|
-
expect(res).toBe(
|
|
533
|
+
expect(res).toBe(113)
|
|
534
534
|
})
|
|
535
535
|
})
|
|
536
536
|
})
|
|
@@ -540,18 +540,18 @@ describe('computeToolbarHeight', () => {
|
|
|
540
540
|
it('should return the height prop', () => {
|
|
541
541
|
const res = computeToolbarHeight({ height: 50 })
|
|
542
542
|
|
|
543
|
-
expect(res).toBe(
|
|
543
|
+
expect(res).toBe(65)
|
|
544
544
|
})
|
|
545
545
|
|
|
546
546
|
it('should return the height from ref', () => {
|
|
547
547
|
const res = computeToolbarHeight({ ref: { current: { offsetHeight: 50 } } })
|
|
548
548
|
|
|
549
|
-
expect(res).toBe(
|
|
549
|
+
expect(res).toBe(65)
|
|
550
550
|
})
|
|
551
551
|
|
|
552
552
|
it('should return default value', () => {
|
|
553
553
|
const res = computeToolbarHeight()
|
|
554
554
|
|
|
555
|
-
expect(res).toBe(
|
|
555
|
+
expect(res).toBe(16)
|
|
556
556
|
})
|
|
557
557
|
})
|
|
@@ -92,6 +92,8 @@ const hideBottomSheet = () => setState({ bottomSheetOpened: false })
|
|
|
92
92
|
const showBottomSheet = () => setState({ bottomSheetOpened: true })
|
|
93
93
|
const hideSecondConfirmDialog = () => setState({ secondConfirmDialogOpened: false })
|
|
94
94
|
const showSecondConfirmDialog = () => setState({ secondConfirmDialogOpened: true })
|
|
95
|
+
const hideSecondDialog = () => setState({ secondDialogOpened: false })
|
|
96
|
+
const showSecondDialog = () => setState({ secondDialogOpened: true })
|
|
95
97
|
const hideBSConfirmDialog = () => setState({ BSConfirmDialogOpened: false })
|
|
96
98
|
const showBSConfirmDialog = () => setState({ BSConfirmDialogOpened: true })
|
|
97
99
|
|
|
@@ -188,6 +190,7 @@ initialState = {
|
|
|
188
190
|
modalOpened: isTesting(),
|
|
189
191
|
bottomSheetOpened: false,
|
|
190
192
|
secondConfirmDialogOpened: false,
|
|
193
|
+
secondDialogOpened: false,
|
|
191
194
|
BSConfirmDialogOpened: false,
|
|
192
195
|
modal: Dialog,
|
|
193
196
|
size: 'medium',
|
|
@@ -323,6 +326,9 @@ const initialVariants = [{
|
|
|
323
326
|
<div>
|
|
324
327
|
<Button label="Show inner confirm dialog" onClick={showSecondConfirmDialog}/>
|
|
325
328
|
</div>
|
|
329
|
+
<div>
|
|
330
|
+
<Button label="Show inner dialog" onClick={showSecondDialog}/>
|
|
331
|
+
</div>
|
|
326
332
|
</Stack>
|
|
327
333
|
</Typography>
|
|
328
334
|
|
|
@@ -333,6 +339,13 @@ const initialVariants = [{
|
|
|
333
339
|
/>
|
|
334
340
|
)}
|
|
335
341
|
|
|
342
|
+
{state.secondDialogOpened && (
|
|
343
|
+
<Dialog open onClose={hideSecondDialog}
|
|
344
|
+
title="This is a simple title"
|
|
345
|
+
content="This is a simple content"
|
|
346
|
+
/>
|
|
347
|
+
)}
|
|
348
|
+
|
|
336
349
|
{state.bottomSheetOpened && (
|
|
337
350
|
<BottomSheet backdrop onClose={hideBottomSheet}>
|
|
338
351
|
<BottomSheetItem>
|
|
@@ -14,7 +14,7 @@ export var computeToolbarHeight = function computeToolbarHeight() {
|
|
|
14
14
|
computedToolbarHeight = ref.current.offsetHeight;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
return computedToolbarHeight;
|
|
17
|
+
return computedToolbarHeight + (getFlagshipMetadata().statusBarHeight || 0) + getSafeAreaValue('top');
|
|
18
18
|
};
|
|
19
19
|
export var computeMaxHeight = function computeMaxHeight(toolbarProps) {
|
|
20
20
|
var toolbarHeight = computeToolbarHeight(toolbarProps);
|