@ionic/core 8.8.20-dev.11790592795.1cc6dc2f → 8.8.20-dev.11791573097.1f843ab0
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/components/ion-accordion.js +1 -1
- package/components/ion-action-sheet.js +1 -1
- package/components/ion-alert.js +1 -1
- package/components/ion-avatar.js +1 -1
- package/components/ion-badge.js +1 -1
- package/components/ion-button.js +1 -1
- package/components/ion-card-content.js +1 -1
- package/components/ion-card-subtitle.js +1 -1
- package/components/ion-checkbox.js +1 -1
- package/components/ion-chip.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/ion-input-otp.js +1 -1
- package/components/ion-input-password-toggle.js +1 -1
- package/components/ion-input.js +1 -1
- package/components/ion-item-option.js +1 -1
- package/components/ion-item.js +1 -1
- package/components/ion-list-header.js +1 -1
- package/components/ion-modal.js +1 -1
- package/components/ion-popover.js +1 -1
- package/components/ion-radio-group.js +1 -1
- package/components/ion-radio.js +1 -1
- package/components/ion-range.js +1 -1
- package/components/ion-searchbar.js +1 -1
- package/components/ion-segment-button.js +1 -1
- package/components/ion-select-modal.js +1 -1
- package/components/ion-select-popover.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/ion-tab-bar.js +1 -1
- package/components/ion-tab-button.js +1 -1
- package/components/ion-textarea.js +1 -1
- package/components/ion-title.js +1 -1
- package/components/ion-toast.js +1 -1
- package/components/ion-toggle.js +1 -1
- package/components/p-5SA6gaJK.js +4 -0
- package/components/p-66lMN0uJ.js +4 -0
- package/components/p-Aiebb5BP.js +4 -0
- package/components/p-B4ChegHQ.js +4 -0
- package/components/p-B7oBVBLC.js +4 -0
- package/components/{p-BRCaVT6R.js → p-BWqyO-uf.js} +1 -1
- package/components/p-BZvWmOA3.js +4 -0
- package/components/p-CG9ZBpG3.js +4 -0
- package/components/{p-DRJsuCbz.js → p-ChmqgUIu.js} +1 -1
- package/components/p-D9nsoope.js +4 -0
- package/components/p-DgVHyszQ.js +4 -0
- package/components/p-HEjQpmqR.js +4 -0
- package/components/p-i78swphu.js +4 -0
- package/css/ionic/bundle.ionic.css +1 -1
- package/css/ionic/bundle.ionic.css.map +1 -1
- package/css/ionic/core.ionic.css +1 -1
- package/css/ionic/core.ionic.css.map +1 -1
- package/css/ionic/global.bundle.ionic.css +1 -1
- package/css/ionic/global.bundle.ionic.css.map +1 -1
- package/css/ionic/ionic-swiper.ionic.css +1 -1
- package/css/ionic/ionic-swiper.ionic.css.map +1 -1
- package/css/ionic/link.ionic.css +1 -1
- package/css/ionic/link.ionic.css.map +1 -1
- package/css/ionic/typography.ionic.css +1 -1
- package/css/ionic/typography.ionic.css.map +1 -1
- package/dist/cjs/ion-accordion_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/ion-alert.cjs.entry.js +1 -1
- package/dist/cjs/ion-app_8.cjs.entry.js +1 -1
- package/dist/cjs/ion-avatar_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-button_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-card_5.cjs.entry.js +2 -2
- package/dist/cjs/ion-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ion-chip.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-input-otp.cjs.entry.js +1 -1
- package/dist/cjs/ion-input.cjs.entry.js +1 -1
- package/dist/cjs/ion-item-option_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-modal.cjs.entry.js +57 -86
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-radio_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-range.cjs.entry.js +1 -1
- package/dist/cjs/ion-searchbar.cjs.entry.js +1 -1
- package/dist/cjs/ion-segment_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ion-toast.cjs.entry.js +1 -1
- package/dist/cjs/ion-toggle.cjs.entry.js +1 -1
- package/dist/collection/components/accordion/accordion.ionic.css +2 -2
- package/dist/collection/components/action-sheet/action-sheet.ionic.css +4 -4
- package/dist/collection/components/alert/alert.ionic.css +7 -7
- package/dist/collection/components/avatar/avatar.ionic.css +6 -6
- package/dist/collection/components/badge/badge.ionic.css +3 -3
- package/dist/collection/components/button/button.ionic.css +4 -4
- package/dist/collection/components/card-content/card-content.ionic.css +1 -1
- package/dist/collection/components/card-subtitle/card-subtitle.ionic.css +1 -1
- package/dist/collection/components/checkbox/checkbox.ionic.css +1 -1
- package/dist/collection/components/chip/chip.ionic.css +1 -1
- package/dist/collection/components/datetime/datetime.ionic.css +7 -7
- package/dist/collection/components/input/input.ionic.css +3 -3
- package/dist/collection/components/input-otp/input-otp.ionic.css +2 -2
- package/dist/collection/components/item/item.ionic.css +1 -1
- package/dist/collection/components/item-option/item-option.ionic.css +1 -1
- package/dist/collection/components/list-header/list-header.ionic.css +1 -1
- package/dist/collection/components/modal/gestures/sheet.js +58 -86
- package/dist/collection/components/modal/modal.ionic.css +1 -1
- package/dist/collection/components/popover/popover.ionic.css +1 -1
- package/dist/collection/components/radio/radio.ionic.css +2 -2
- package/dist/collection/components/radio-group/radio-group.ionic.css +1 -1
- package/dist/collection/components/range/range.ionic.css +1 -1
- package/dist/collection/components/searchbar/searchbar.ionic.css +1 -1
- package/dist/collection/components/segment-button/segment-button.ionic.css +1 -1
- package/dist/collection/components/select/select.ionic.css +3 -3
- package/dist/collection/components/select-modal/select-modal.ionic.css +3 -3
- package/dist/collection/components/select-popover/select-popover.ionic.css +2 -2
- package/dist/collection/components/tab-bar/tab-bar.ionic.css +1 -1
- package/dist/collection/components/tab-button/tab-button.ionic.css +1 -1
- package/dist/collection/components/textarea/textarea.ionic.css +3 -3
- package/dist/collection/components/title/title.ionic.css +2 -2
- package/dist/collection/components/toast/toast.ionic.css +4 -4
- package/dist/collection/components/toggle/toggle.ionic.css +2 -2
- package/dist/docs.json +1 -1
- package/dist/esm/ion-accordion_2.entry.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +1 -1
- package/dist/esm/ion-alert.entry.js +1 -1
- package/dist/esm/ion-app_8.entry.js +1 -1
- package/dist/esm/ion-avatar_3.entry.js +2 -2
- package/dist/esm/ion-button_2.entry.js +1 -1
- package/dist/esm/ion-card_5.entry.js +2 -2
- package/dist/esm/ion-checkbox.entry.js +1 -1
- package/dist/esm/ion-chip.entry.js +1 -1
- package/dist/esm/ion-datetime_3.entry.js +1 -1
- package/dist/esm/ion-input-otp.entry.js +1 -1
- package/dist/esm/ion-input.entry.js +1 -1
- package/dist/esm/ion-item-option_3.entry.js +1 -1
- package/dist/esm/ion-item_8.entry.js +2 -2
- package/dist/esm/ion-modal.entry.js +57 -86
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-radio_2.entry.js +2 -2
- package/dist/esm/ion-range.entry.js +1 -1
- package/dist/esm/ion-searchbar.entry.js +1 -1
- package/dist/esm/ion-segment_2.entry.js +1 -1
- package/dist/esm/ion-select-modal.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +2 -2
- package/dist/esm/ion-tab-bar_2.entry.js +2 -2
- package/dist/esm/ion-textarea.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/ion-toggle.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-0f4e1dd6.entry.js +4 -0
- package/dist/ionic/p-13398145.entry.js +4 -0
- package/dist/ionic/p-1e314e2c.entry.js +4 -0
- package/dist/ionic/p-2413a0fc.entry.js +4 -0
- package/dist/ionic/p-35fab94d.entry.js +4 -0
- package/dist/ionic/p-378152d8.entry.js +4 -0
- package/dist/ionic/p-3a4f9b8a.entry.js +4 -0
- package/dist/ionic/p-3d466b08.entry.js +4 -0
- package/dist/ionic/p-511b48f7.entry.js +4 -0
- package/dist/ionic/{p-ab04f606.entry.js → p-551b18d6.entry.js} +1 -1
- package/dist/ionic/p-73cff9a4.entry.js +4 -0
- package/dist/ionic/{p-ce7bdadf.entry.js → p-777df225.entry.js} +1 -1
- package/dist/ionic/p-839a843e.entry.js +4 -0
- package/dist/ionic/p-8eee9154.entry.js +4 -0
- package/dist/ionic/p-9022f64b.entry.js +4 -0
- package/dist/ionic/{p-b92fc2b6.entry.js → p-9994becf.entry.js} +1 -1
- package/dist/ionic/p-9b786c57.entry.js +4 -0
- package/dist/ionic/p-a5994eac.entry.js +4 -0
- package/dist/ionic/p-b14486dc.entry.js +4 -0
- package/dist/ionic/p-b536494c.entry.js +4 -0
- package/dist/ionic/p-bdec9c7b.entry.js +4 -0
- package/dist/ionic/p-e1caa56c.entry.js +4 -0
- package/dist/ionic/p-ec4fa82d.entry.js +4 -0
- package/dist/ionic/{p-00006e47.entry.js → p-f1baf6b9.entry.js} +1 -1
- package/dist/ionic/p-f5e83e40.entry.js +4 -0
- package/dist/ionic/p-fc12f985.entry.js +4 -0
- package/hydrate/index.js +88 -117
- package/hydrate/index.mjs +88 -117
- package/package.json +4 -4
- package/components/p-B1Ckdhof.js +0 -4
- package/components/p-B8Vus3NC.js +0 -4
- package/components/p-BbGeDQXO.js +0 -4
- package/components/p-BooNwQGm.js +0 -4
- package/components/p-BrMzxZsq.js +0 -4
- package/components/p-C7g2sOXQ.js +0 -4
- package/components/p-CE7AgdzL.js +0 -4
- package/components/p-CGezXDvw.js +0 -4
- package/components/p-CuMUiFew.js +0 -4
- package/components/p-DQq1lHJB.js +0 -4
- package/components/p-DRlveqJv.js +0 -4
- package/dist/ionic/p-0e0b77a1.entry.js +0 -4
- package/dist/ionic/p-0ff0409b.entry.js +0 -4
- package/dist/ionic/p-1753c08d.entry.js +0 -4
- package/dist/ionic/p-3276f797.entry.js +0 -4
- package/dist/ionic/p-39ec9cf3.entry.js +0 -4
- package/dist/ionic/p-5a9a921d.entry.js +0 -4
- package/dist/ionic/p-6decd4a6.entry.js +0 -4
- package/dist/ionic/p-732bb10a.entry.js +0 -4
- package/dist/ionic/p-788418c5.entry.js +0 -4
- package/dist/ionic/p-7b3e8dcc.entry.js +0 -4
- package/dist/ionic/p-7efad059.entry.js +0 -4
- package/dist/ionic/p-89ce42f3.entry.js +0 -4
- package/dist/ionic/p-a32fd690.entry.js +0 -4
- package/dist/ionic/p-d1a8bb39.entry.js +0 -4
- package/dist/ionic/p-d6b9ab96.entry.js +0 -4
- package/dist/ionic/p-dd54075e.entry.js +0 -4
- package/dist/ionic/p-e386bba3.entry.js +0 -4
- package/dist/ionic/p-e69338d9.entry.js +0 -4
- package/dist/ionic/p-eb8a0235.entry.js +0 -4
- package/dist/ionic/p-f0436e04.entry.js +0 -4
- package/dist/ionic/p-f8f61876.entry.js +0 -4
- package/dist/ionic/p-fa146a10.entry.js +0 -4
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
79
79
|
font-weight: var(--token-font-weight-regular, 400);
|
|
80
80
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
81
|
-
line-height:
|
|
81
|
+
line-height: 1.714286;
|
|
82
82
|
-webkit-padding-start: var(--token-space-0, var(--token-scale-0, 0px));
|
|
83
83
|
padding-inline-start: var(--token-space-0, var(--token-scale-0, 0px));
|
|
84
84
|
-webkit-padding-end: var(--token-space-0, var(--token-scale-0, 0px));
|
|
@@ -428,7 +428,7 @@ ion-checkbox.select-option-has-rich-content::part(label),
|
|
|
428
428
|
font-size: var(--token-font-size-450, 1.125rem);
|
|
429
429
|
font-weight: var(--token-font-weight-medium, 500);
|
|
430
430
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
431
|
-
line-height:
|
|
431
|
+
line-height: 1.555556;
|
|
432
432
|
color: var(--color);
|
|
433
433
|
text-align: start;
|
|
434
434
|
}
|
|
@@ -438,7 +438,7 @@ ion-checkbox.select-option-has-rich-content::part(label),
|
|
|
438
438
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
439
439
|
font-weight: var(--token-font-weight-regular, 400);
|
|
440
440
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
441
|
-
line-height:
|
|
441
|
+
line-height: 1.714286;
|
|
442
442
|
color: var(--token-text-subtlest, var(--token-primitives-neutral-800, #6c727a));
|
|
443
443
|
}
|
|
444
444
|
|
|
@@ -461,7 +461,7 @@ ion-checkbox.select-option-has-rich-content::part(label),
|
|
|
461
461
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
462
462
|
font-weight: var(--token-font-weight-regular, 400);
|
|
463
463
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
464
|
-
line-height:
|
|
464
|
+
line-height: 1.714286;
|
|
465
465
|
position: relative;
|
|
466
466
|
min-height: 52px;
|
|
467
467
|
text-align: start;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
79
79
|
font-weight: var(--token-font-weight-regular, 400);
|
|
80
80
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
81
|
-
line-height:
|
|
81
|
+
line-height: 1.714286;
|
|
82
82
|
-webkit-padding-start: var(--token-space-0, var(--token-scale-0, 0px));
|
|
83
83
|
padding-inline-start: var(--token-space-0, var(--token-scale-0, 0px));
|
|
84
84
|
-webkit-padding-end: var(--token-space-0, var(--token-scale-0, 0px));
|
|
@@ -453,7 +453,7 @@ textarea.alert-input {
|
|
|
453
453
|
|
|
454
454
|
.alert-wrapper {
|
|
455
455
|
border-radius: var(--token-border-radius-200, var(--token-scale-200, 8px));
|
|
456
|
-
box-shadow: var(--token-elevation-4, var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-15, 15px) var(--token-shadow-blur-48, 48px) var(--token-shadow-spread-0, 0px) var(--token-shadow-7, rgba(0, 0, 0, 0.
|
|
456
|
+
box-shadow: var(--token-elevation-4, var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-15, 15px) var(--token-shadow-blur-48, 48px) var(--token-shadow-spread-0, 0px) var(--token-shadow-7, rgba(0, 0, 0, 0.18)), var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-3, 3px) var(--token-shadow-blur-12, 12px) var(--token-shadow-spread-0, 0px) var(--token-shadow-5, rgba(0, 0, 0, 0.12)));
|
|
457
457
|
z-index: 10;
|
|
458
458
|
}
|
|
459
459
|
|
|
@@ -492,7 +492,7 @@ textarea.alert-input {
|
|
|
492
492
|
font-size: var(--token-font-size-450, 1.125rem);
|
|
493
493
|
font-weight: var(--token-font-weight-medium, 500);
|
|
494
494
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
495
|
-
line-height:
|
|
495
|
+
line-height: 1.555556;
|
|
496
496
|
color: var(--token-text-default, var(--token-primitives-neutral-1200, #242528));
|
|
497
497
|
}
|
|
498
498
|
|
|
@@ -501,7 +501,7 @@ textarea.alert-input {
|
|
|
501
501
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
502
502
|
font-weight: var(--token-font-weight-regular, 400);
|
|
503
503
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
504
|
-
line-height:
|
|
504
|
+
line-height: 1.714286;
|
|
505
505
|
color: var(--token-text-subtlest, var(--token-primitives-neutral-800, #6c727a));
|
|
506
506
|
}
|
|
507
507
|
|
|
@@ -511,7 +511,7 @@ textarea.alert-input {
|
|
|
511
511
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
512
512
|
font-weight: var(--token-font-weight-regular, 400);
|
|
513
513
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
514
|
-
line-height:
|
|
514
|
+
line-height: 1.714286;
|
|
515
515
|
-webkit-padding-start: var(--token-space-400, var(--token-scale-400, 16px));
|
|
516
516
|
padding-inline-start: var(--token-space-400, var(--token-scale-400, 16px));
|
|
517
517
|
-webkit-padding-end: var(--token-space-400, var(--token-scale-400, 16px));
|
|
@@ -595,7 +595,7 @@ textarea.alert-input {
|
|
|
595
595
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
596
596
|
font-weight: var(--token-font-weight-regular, 400);
|
|
597
597
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
598
|
-
line-height:
|
|
598
|
+
line-height: 1.714286;
|
|
599
599
|
padding-top: var(--token-space-200, var(--token-scale-200, 8px));
|
|
600
600
|
padding-bottom: var(--token-space-200, var(--token-scale-200, 8px));
|
|
601
601
|
max-width: calc(100% - var(--token-space-400, var(--token-scale-400, 16px)));
|
|
@@ -669,7 +669,7 @@ textarea.alert-input {
|
|
|
669
669
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
670
670
|
font-weight: var(--token-font-weight-regular, 400);
|
|
671
671
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
672
|
-
line-height:
|
|
672
|
+
line-height: 1.714286;
|
|
673
673
|
-webkit-padding-start: var(--token-space-800, var(--token-scale-800, 32px));
|
|
674
674
|
padding-inline-start: var(--token-space-800, var(--token-scale-800, 32px));
|
|
675
675
|
-webkit-padding-end: var(--token-space-400, var(--token-scale-400, 16px));
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
font-size: var(--token-font-size-450, 1.125rem);
|
|
107
107
|
font-weight: var(--token-font-weight-medium, 500);
|
|
108
108
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
109
|
-
line-height:
|
|
109
|
+
line-height: 1.555556;
|
|
110
110
|
display: flex;
|
|
111
111
|
align-items: center;
|
|
112
112
|
justify-content: center;
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
132
132
|
font-weight: var(--token-font-weight-medium, 500);
|
|
133
133
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
134
|
-
line-height:
|
|
134
|
+
line-height: 1.666667;
|
|
135
135
|
width: var(--token-scale-400, 16px);
|
|
136
136
|
height: var(--token-scale-400, 16px);
|
|
137
137
|
}
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
145
145
|
font-weight: var(--token-font-weight-medium, 500);
|
|
146
146
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
147
|
-
line-height:
|
|
147
|
+
line-height: 1.666667;
|
|
148
148
|
width: var(--token-scale-600, 24px);
|
|
149
149
|
height: var(--token-scale-600, 24px);
|
|
150
150
|
}
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
font-size: var(--token-font-size-400, 1rem);
|
|
158
158
|
font-weight: var(--token-font-weight-medium, 500);
|
|
159
159
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
160
|
-
line-height:
|
|
160
|
+
line-height: 1.5;
|
|
161
161
|
width: var(--token-scale-800, 32px);
|
|
162
162
|
height: var(--token-scale-800, 32px);
|
|
163
163
|
}
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
font-size: var(--token-font-size-500, 1.25rem);
|
|
179
179
|
font-weight: var(--token-font-weight-medium, 500);
|
|
180
180
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
181
|
-
line-height:
|
|
181
|
+
line-height: 1.4;
|
|
182
182
|
width: var(--token-scale-1200, 48px);
|
|
183
183
|
height: var(--token-scale-1200, 48px);
|
|
184
184
|
}
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
font-size: var(--token-font-size-550, 1.375rem);
|
|
192
192
|
font-weight: var(--token-font-weight-medium, 500);
|
|
193
193
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
194
|
-
line-height:
|
|
194
|
+
line-height: 1.272727;
|
|
195
195
|
width: var(--token-scale-1400, 56px);
|
|
196
196
|
height: var(--token-scale-1400, 56px);
|
|
197
197
|
}
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
133
133
|
font-weight: var(--token-font-weight-medium, 500);
|
|
134
134
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
135
|
-
line-height:
|
|
135
|
+
line-height: 1.666667;
|
|
136
136
|
display: inline-flex;
|
|
137
137
|
align-items: center;
|
|
138
138
|
justify-content: center;
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
201
201
|
font-weight: var(--token-font-weight-medium, 500);
|
|
202
202
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
203
|
-
line-height:
|
|
203
|
+
line-height: 1.714286;
|
|
204
204
|
min-width: var(--token-scale-600, 24px);
|
|
205
205
|
height: var(--token-scale-600, 24px);
|
|
206
206
|
}
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
261
261
|
font-weight: var(--token-font-weight-medium, 500);
|
|
262
262
|
letter-spacing: var(--token-font-letter-spacing-100, 0.01em);
|
|
263
|
-
line-height:
|
|
263
|
+
line-height: 1.666667;
|
|
264
264
|
min-width: var(--token-scale-400, 16px);
|
|
265
265
|
height: var(--token-scale-400, 16px);
|
|
266
266
|
}
|
|
@@ -423,7 +423,7 @@ ion-ripple-effect {
|
|
|
423
423
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
424
424
|
font-weight: var(--token-font-weight-medium, 500);
|
|
425
425
|
letter-spacing: var(--token-font-letter-spacing-100, 0.01em);
|
|
426
|
-
line-height:
|
|
426
|
+
line-height: 1.428571;
|
|
427
427
|
min-width: var(--token-scale-1600, 64px);
|
|
428
428
|
min-height: var(--token-scale-1000, 40px);
|
|
429
429
|
}
|
|
@@ -435,7 +435,7 @@ ion-ripple-effect {
|
|
|
435
435
|
font-size: var(--token-font-size-400, 1rem);
|
|
436
436
|
font-weight: var(--token-font-weight-medium, 500);
|
|
437
437
|
letter-spacing: var(--token-font-letter-spacing-100, 0.01em);
|
|
438
|
-
line-height:
|
|
438
|
+
line-height: 1.5;
|
|
439
439
|
min-width: var(--token-scale-1800, 72px);
|
|
440
440
|
min-height: var(--token-scale-1200, 48px);
|
|
441
441
|
}
|
|
@@ -447,7 +447,7 @@ ion-ripple-effect {
|
|
|
447
447
|
font-size: var(--token-font-size-500, 1.25rem);
|
|
448
448
|
font-weight: var(--token-font-weight-medium, 500);
|
|
449
449
|
letter-spacing: var(--token-font-letter-spacing-100, 0.01em);
|
|
450
|
-
line-height:
|
|
450
|
+
line-height: 1.2;
|
|
451
451
|
min-width: var(--token-scale-2000, 80px);
|
|
452
452
|
min-height: var(--token-scale-1400, 56px);
|
|
453
453
|
}
|
|
@@ -635,6 +635,6 @@ ion-ripple-effect {
|
|
|
635
635
|
font-size: var(--token-font-size-400, 1rem);
|
|
636
636
|
font-weight: var(--token-font-weight-medium, 500);
|
|
637
637
|
letter-spacing: var(--token-font-letter-spacing-100, 0.01em);
|
|
638
|
-
line-height:
|
|
638
|
+
line-height: 1.5;
|
|
639
639
|
min-height: var(--token-space-1200, var(--token-scale-1200, 48px));
|
|
640
640
|
}
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
75
75
|
font-weight: var(--token-font-weight-regular, 400);
|
|
76
76
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
77
|
-
line-height:
|
|
77
|
+
line-height: 1.714286;
|
|
78
78
|
display: flex;
|
|
79
79
|
flex-direction: column;
|
|
80
80
|
gap: var(--token-space-400, var(--token-scale-400, 16px));
|
|
@@ -386,7 +386,7 @@ input {
|
|
|
386
386
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
387
387
|
font-weight: var(--token-font-weight-medium, 500);
|
|
388
388
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
389
|
-
line-height:
|
|
389
|
+
line-height: 1.666667;
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
.checkbox-bottom .error-text {
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
125
125
|
font-weight: var(--token-font-weight-medium, 500);
|
|
126
126
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
127
|
-
line-height:
|
|
127
|
+
line-height: 1.666667;
|
|
128
128
|
gap: var(--token-space-100, var(--token-scale-100, 4px));
|
|
129
129
|
line-height: 100%;
|
|
130
130
|
cursor: auto;
|
|
@@ -499,7 +499,7 @@
|
|
|
499
499
|
font-size: var(--token-font-size-450, 1.125rem);
|
|
500
500
|
font-weight: var(--token-font-weight-medium, 500);
|
|
501
501
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
502
|
-
line-height:
|
|
502
|
+
line-height: 1.555556;
|
|
503
503
|
color: var(--token-primitives-neutral-800, #6c727a);
|
|
504
504
|
}
|
|
505
505
|
|
|
@@ -508,7 +508,7 @@
|
|
|
508
508
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
509
509
|
font-weight: var(--token-font-weight-regular, 400);
|
|
510
510
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
511
|
-
line-height:
|
|
511
|
+
line-height: 1.714286;
|
|
512
512
|
color: var(--token-primitives-neutral-1000, #383e45);
|
|
513
513
|
}
|
|
514
514
|
|
|
@@ -530,7 +530,7 @@
|
|
|
530
530
|
font-size: var(--token-font-size-400, 1rem);
|
|
531
531
|
font-weight: var(--token-font-weight-medium, 500);
|
|
532
532
|
letter-spacing: var(--token-font-letter-spacing-100, 0.01em);
|
|
533
|
-
line-height:
|
|
533
|
+
line-height: 1.5;
|
|
534
534
|
-webkit-padding-start: var(--token-space-400, var(--token-scale-400, 16px));
|
|
535
535
|
padding-inline-start: var(--token-space-400, var(--token-scale-400, 16px));
|
|
536
536
|
-webkit-padding-end: var(--token-space-400, var(--token-scale-400, 16px));
|
|
@@ -574,7 +574,7 @@
|
|
|
574
574
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
575
575
|
font-weight: var(--token-font-weight-medium, 500);
|
|
576
576
|
letter-spacing: var(--token-font-letter-spacing-150, 0.015em);
|
|
577
|
-
line-height:
|
|
577
|
+
line-height: 1.666667;
|
|
578
578
|
text-transform: uppercase;
|
|
579
579
|
align-content: center;
|
|
580
580
|
height: var(--token-scale-1200, 48px);
|
|
@@ -593,7 +593,7 @@
|
|
|
593
593
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
594
594
|
font-weight: var(--token-font-weight-medium, 500);
|
|
595
595
|
letter-spacing: var(--token-font-letter-spacing-100, 0.01em);
|
|
596
|
-
line-height:
|
|
596
|
+
line-height: 1.428571;
|
|
597
597
|
width: var(--token-scale-1200, 48px);
|
|
598
598
|
min-width: var(--token-scale-1200, 48px);
|
|
599
599
|
height: var(--token-scale-1200, 48px);
|
|
@@ -649,7 +649,7 @@
|
|
|
649
649
|
font-size: var(--token-font-size-400, 1rem);
|
|
650
650
|
font-weight: var(--token-font-weight-medium, 500);
|
|
651
651
|
letter-spacing: var(--token-font-letter-spacing-100, 0.01em);
|
|
652
|
-
line-height:
|
|
652
|
+
line-height: 1.5;
|
|
653
653
|
color: var(--token-primitives-neutral-800, #6c727a);
|
|
654
654
|
}
|
|
655
655
|
|
|
@@ -664,7 +664,7 @@
|
|
|
664
664
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
665
665
|
font-weight: var(--token-font-weight-medium, 500);
|
|
666
666
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
667
|
-
line-height:
|
|
667
|
+
line-height: 1.714286;
|
|
668
668
|
border-radius: var(--token-border-radius-full, 999px);
|
|
669
669
|
display: flex;
|
|
670
670
|
align-items: center;
|
|
@@ -578,7 +578,7 @@
|
|
|
578
578
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
579
579
|
font-weight: var(--token-font-weight-regular, 400);
|
|
580
580
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
581
|
-
line-height:
|
|
581
|
+
line-height: 1.714286;
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
.input-outline {
|
|
@@ -800,7 +800,7 @@
|
|
|
800
800
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
801
801
|
font-weight: var(--token-font-weight-medium, 500);
|
|
802
802
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
803
|
-
line-height:
|
|
803
|
+
line-height: 1.666667;
|
|
804
804
|
color: var(--token-primitives-neutral-1000, #383e45);
|
|
805
805
|
}
|
|
806
806
|
|
|
@@ -817,7 +817,7 @@
|
|
|
817
817
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
818
818
|
font-weight: var(--token-font-weight-medium, 500);
|
|
819
819
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
820
|
-
line-height:
|
|
820
|
+
line-height: 1.666667;
|
|
821
821
|
}
|
|
822
822
|
|
|
823
823
|
.input-bottom .error-text {
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
258
258
|
font-weight: var(--token-font-weight-regular, 400);
|
|
259
259
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
260
|
-
line-height:
|
|
260
|
+
line-height: 1.714286;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
:host(.has-focus) .native-input:focus {
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
font-size: var(--token-font-size-300, 0.75rem);
|
|
270
270
|
font-weight: var(--token-font-weight-medium, 500);
|
|
271
271
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
272
|
-
line-height:
|
|
272
|
+
line-height: 1.666667;
|
|
273
273
|
color: var(--token-text-subtlest, var(--token-primitives-neutral-800, #6c727a));
|
|
274
274
|
}
|
|
275
275
|
|
|
@@ -426,7 +426,7 @@ ion-ripple-effect {
|
|
|
426
426
|
font-size: var(--token-font-size-400, 1rem);
|
|
427
427
|
font-weight: var(--token-font-weight-medium, 500);
|
|
428
428
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
429
|
-
line-height:
|
|
429
|
+
line-height: 1.5;
|
|
430
430
|
}
|
|
431
431
|
|
|
432
432
|
.item-inner {
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
163
163
|
font-weight: var(--token-font-weight-medium, 500);
|
|
164
164
|
letter-spacing: var(--token-font-letter-spacing-100, 0.01em);
|
|
165
|
-
line-height:
|
|
165
|
+
line-height: 1.428571;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
.button-native {
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
font-size: var(--token-font-size-350, 0.875rem);
|
|
155
155
|
font-weight: var(--token-font-weight-medium, 500);
|
|
156
156
|
letter-spacing: var(--token-font-letter-spacing-0, 0);
|
|
157
|
-
line-height:
|
|
157
|
+
line-height: 1.714286;
|
|
158
158
|
min-height: calc(var(--token-scale-1400, 56px) + var(--token-scale-050, 2px));
|
|
159
159
|
/**
|
|
160
160
|
* The focus rings from components like buttons and links
|
|
@@ -7,6 +7,22 @@ import { clamp, getElementRoot, raf } from "../../../utils/helpers";
|
|
|
7
7
|
import { FOCUS_TRAP_DISABLE_CLASS } from "../../../utils/overlays";
|
|
8
8
|
import { getBackdropValueForSheet } from "../utils";
|
|
9
9
|
import { calculateSpringStep, canSwipeOnContent, handleCanDismiss } from "./utils";
|
|
10
|
+
/** Gesture velocity arrives in pixels per millisecond; the thresholds below are per second. */
|
|
11
|
+
const MILLISECONDS_PER_SECOND = 1000;
|
|
12
|
+
/**
|
|
13
|
+
* Flick speeds for the ionic theme's physics-based gesture, in pixels per
|
|
14
|
+
* second. Both are magnitudes. Y grows downwards, so the upward threshold is
|
|
15
|
+
* negated where it is compared.
|
|
16
|
+
*/
|
|
17
|
+
const FLICK_DOWN_VELOCITY = 500;
|
|
18
|
+
const FLICK_UP_VELOCITY = 400;
|
|
19
|
+
/**
|
|
20
|
+
* How far below its starting breakpoint a slow drag has to end to dismiss the
|
|
21
|
+
* sheet. 0.4 means the user dragged 40% of the way down from where they started.
|
|
22
|
+
*/
|
|
23
|
+
const DISMISS_PROGRESS_RATIO = 0.4;
|
|
24
|
+
/** How far ahead, in milliseconds, a drag's velocity is projected when snapping. */
|
|
25
|
+
const FLICK_PROJECTION_MS = 350;
|
|
10
26
|
export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, usePhysicsBasedGesture, onDragStart, onDragMove, onDragEnd) => {
|
|
11
27
|
var _a;
|
|
12
28
|
// Defaults for the sheet swipe animation
|
|
@@ -33,6 +49,11 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
33
49
|
const contentEl = baseEl.querySelector('ion-content');
|
|
34
50
|
// Cache the initial value so the gesture restores it instead of forcing scrolling on.
|
|
35
51
|
const initialContentScrollY = (_a = contentEl === null || contentEl === void 0 ? void 0 : contentEl.scrollY) !== null && _a !== void 0 ? _a : true;
|
|
52
|
+
/**
|
|
53
|
+
* The height of the sheet the user actually sees. This comes from the wrapper
|
|
54
|
+
* rather than the host element, which is stretched to the full viewport no
|
|
55
|
+
* matter how tall the sheet itself is.
|
|
56
|
+
*/
|
|
36
57
|
const height = wrapperEl.clientHeight;
|
|
37
58
|
let currentBreakpoint = initialBreakpoint;
|
|
38
59
|
let offset = 0;
|
|
@@ -331,27 +352,23 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
331
352
|
: step;
|
|
332
353
|
offset = clamp(0.0001, processedStep, maxStep);
|
|
333
354
|
animation.progressStep(offset);
|
|
334
|
-
const snapBreakpoint =
|
|
335
|
-
? calculateVelocitySnapBreakpoint(detail.deltaY, detail.velocityY, detail.currentY)
|
|
336
|
-
: calculatePositionSnapBreakpoint(detail.deltaY);
|
|
355
|
+
const snapBreakpoint = calculateSnapBreakpoint(detail.deltaY, detail.velocityY);
|
|
337
356
|
const eventDetail = {
|
|
338
357
|
currentY: detail.currentY,
|
|
339
358
|
deltaY: detail.deltaY,
|
|
340
359
|
velocityY: detail.velocityY,
|
|
341
|
-
progress:
|
|
360
|
+
progress: calculateEventProgress(detail.deltaY),
|
|
342
361
|
snapBreakpoint: snapBreakpoint,
|
|
343
362
|
};
|
|
344
363
|
onDragMove(eventDetail);
|
|
345
364
|
};
|
|
346
365
|
const onEnd = (detail) => {
|
|
347
|
-
const snapBreakpoint =
|
|
348
|
-
? calculateVelocitySnapBreakpoint(detail.deltaY, detail.velocityY, detail.currentY)
|
|
349
|
-
: calculatePositionSnapBreakpoint(detail.deltaY);
|
|
366
|
+
const snapBreakpoint = calculateSnapBreakpoint(detail.deltaY, detail.velocityY);
|
|
350
367
|
const eventDetail = {
|
|
351
368
|
currentY: detail.currentY,
|
|
352
369
|
deltaY: detail.deltaY,
|
|
353
370
|
velocityY: detail.velocityY,
|
|
354
|
-
progress:
|
|
371
|
+
progress: calculateEventProgress(detail.deltaY),
|
|
355
372
|
snapBreakpoint,
|
|
356
373
|
};
|
|
357
374
|
/**
|
|
@@ -539,6 +556,20 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
539
556
|
.progressEnd(1, 0, animated ? duration : 0);
|
|
540
557
|
});
|
|
541
558
|
};
|
|
559
|
+
/**
|
|
560
|
+
* Decides which breakpoint the sheet should settle on for the current drag.
|
|
561
|
+
*
|
|
562
|
+
* @param deltaY The change in Y position since the gesture started
|
|
563
|
+
* @param velocityY The velocity in pixels per millisecond
|
|
564
|
+
* @returns The snap breakpoint value
|
|
565
|
+
*/
|
|
566
|
+
const calculateSnapBreakpoint = (deltaY, velocityY) => {
|
|
567
|
+
if (usePhysicsBasedGesture) {
|
|
568
|
+
return calculateVelocitySnapBreakpoint(deltaY, velocityY);
|
|
569
|
+
}
|
|
570
|
+
// Project the drag forward so a quick flick counts.
|
|
571
|
+
return calculatePositionSnapBreakpoint(deltaY + velocityY * FLICK_PROJECTION_MS);
|
|
572
|
+
};
|
|
542
573
|
/**
|
|
543
574
|
* Calculates the breakpoint based on the current deltaY.
|
|
544
575
|
* This determines where the sheet should snap to when the user releases the
|
|
@@ -548,16 +579,7 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
548
579
|
* @returns The snap breakpoint value.
|
|
549
580
|
*/
|
|
550
581
|
const calculatePositionSnapBreakpoint = (deltaY) => {
|
|
551
|
-
|
|
552
|
-
* Calculates the real-time vertical position of the modal.
|
|
553
|
-
* We combine the wrapper's current bounding box position with the
|
|
554
|
-
* gesture's deltaY to account for the physical movement during the drag.
|
|
555
|
-
*/
|
|
556
|
-
const currentY = wrapperEl.getBoundingClientRect().top + deltaY;
|
|
557
|
-
/**
|
|
558
|
-
* Convert that pixel position back into a 0 to 1 progress value.
|
|
559
|
-
*/
|
|
560
|
-
const currentProgress = calculateProgress(currentY);
|
|
582
|
+
const currentProgress = calculateProgress(deltaY);
|
|
561
583
|
/**
|
|
562
584
|
* Find and return the defined breakpoint that is closest to the
|
|
563
585
|
* current progress.
|
|
@@ -579,20 +601,19 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
579
601
|
*
|
|
580
602
|
* @param deltaY The change in Y position since gesture started
|
|
581
603
|
* @param velocityY The velocity in pixels per millisecond
|
|
582
|
-
* @param currentY The current Y position of the gesture
|
|
583
604
|
* @returns The snap breakpoint value
|
|
584
605
|
*/
|
|
585
|
-
const calculateVelocitySnapBreakpoint = (deltaY, velocityY
|
|
606
|
+
const calculateVelocitySnapBreakpoint = (deltaY, velocityY) => {
|
|
586
607
|
// Convert velocity from px/ms to px/s for easier threshold comparison
|
|
587
|
-
const velocityYPerSecond = velocityY *
|
|
608
|
+
const velocityYPerSecond = velocityY * MILLISECONDS_PER_SECOND;
|
|
588
609
|
// Calculate current progress (0 = fully closed, 1 = fully expanded)
|
|
589
|
-
const currentProgress = calculateProgress(
|
|
610
|
+
const currentProgress = calculateProgress(deltaY);
|
|
590
611
|
// Rule 1: Fast downward flick always dismisses
|
|
591
|
-
if (velocityYPerSecond >
|
|
612
|
+
if (velocityYPerSecond > FLICK_DOWN_VELOCITY) {
|
|
592
613
|
return minBreakpoint;
|
|
593
614
|
}
|
|
594
615
|
// Rule 2: Fast upward flick moves to next breakpoint above
|
|
595
|
-
if (velocityYPerSecond < -
|
|
616
|
+
if (velocityYPerSecond < -FLICK_UP_VELOCITY) {
|
|
596
617
|
// Find next breakpoint above current position
|
|
597
618
|
const nextBreakpoint = breakpoints.find((bp) => bp > currentProgress);
|
|
598
619
|
// If no breakpoint above, stay at max breakpoint
|
|
@@ -603,8 +624,7 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
603
624
|
// Calculate how far we've moved below the current snap point
|
|
604
625
|
const distanceBelowSnap = currentBreakpoint - currentProgress;
|
|
605
626
|
const percentageBelowSnap = distanceBelowSnap / currentBreakpoint;
|
|
606
|
-
|
|
607
|
-
if (percentageBelowSnap > 0.4 && velocityYPerSecond <= 400) {
|
|
627
|
+
if (percentageBelowSnap > DISMISS_PROGRESS_RATIO) {
|
|
608
628
|
return 0;
|
|
609
629
|
}
|
|
610
630
|
}
|
|
@@ -612,74 +632,26 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
612
632
|
return calculatePositionSnapBreakpoint(deltaY);
|
|
613
633
|
};
|
|
614
634
|
/**
|
|
615
|
-
* Calculates the
|
|
635
|
+
* Calculates how open the sheet is part way through a gesture, on the same
|
|
636
|
+
* 0 to 1 scale as the breakpoints: 1 is fully open and 0 is fully closed.
|
|
616
637
|
*
|
|
617
|
-
*
|
|
618
|
-
* the swipe has progressed towards closing the modal.
|
|
619
|
-
*
|
|
620
|
-
* A value closer to 1 means the modal is closer to being opened,
|
|
621
|
-
* while a value closer to 0 means the modal is closer to being closed.
|
|
622
|
-
*
|
|
623
|
-
* @param currentY The current Y position of the gesture
|
|
638
|
+
* @param deltaY The change in Y position since the gesture started
|
|
624
639
|
* @returns The progress of the sheet gesture
|
|
625
640
|
*/
|
|
626
|
-
const calculateProgress = (
|
|
627
|
-
|
|
628
|
-
const
|
|
629
|
-
/**
|
|
630
|
-
* The lowest point the sheet can be dragged to aka the point at which
|
|
631
|
-
* the sheet is fully closed.
|
|
632
|
-
*/
|
|
633
|
-
const maxY = convertBreakpointToY(minBreakpoint);
|
|
634
|
-
/**
|
|
635
|
-
* The highest point the sheet can be dragged to aka the point at which
|
|
636
|
-
* the sheet is fully open.
|
|
637
|
-
*/
|
|
638
|
-
const minY = convertBreakpointToY(maxBreakpoint);
|
|
639
|
-
// The total distance between the fully open and fully closed positions.
|
|
640
|
-
const totalDistance = maxY - minY;
|
|
641
|
-
// The distance from the current position to the fully closed position.
|
|
642
|
-
const distanceFromBottom = maxY - currentY;
|
|
643
|
-
/**
|
|
644
|
-
* The progress represents how far the sheet is from the bottom relative
|
|
645
|
-
* to the total distance. When the user starts swiping up, the progress
|
|
646
|
-
* should be close to 1, and when the user has swiped all the way down,
|
|
647
|
-
* the progress should be close to 0.
|
|
648
|
-
*/
|
|
649
|
-
const progress = distanceFromBottom / totalDistance;
|
|
641
|
+
const calculateProgress = (deltaY) => {
|
|
642
|
+
// Mirrors the animation step in onMove, so the snap matches where the sheet is drawn.
|
|
643
|
+
const progress = currentBreakpoint - deltaY / height;
|
|
650
644
|
// Round to the nearest thousandth to avoid returning very small decimal
|
|
651
645
|
const roundedProgress = Math.round(progress * 1000) / 1000;
|
|
652
|
-
return
|
|
646
|
+
return clamp(0, roundedProgress, 1);
|
|
653
647
|
};
|
|
654
648
|
/**
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
* @param breakpoint The breakpoint value (e.g., 0.5 for half-open)
|
|
659
|
-
* @returns The pixel Y coordinate on the screen
|
|
649
|
+
* Scales the progress from the lowest to the highest breakpoint, so the
|
|
650
|
+
* drag events report 0 at the lowest breakpoint and 1 at the highest.
|
|
660
651
|
*/
|
|
661
|
-
const
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
// The bottom of the screen.
|
|
665
|
-
const viewportBottom = window.innerHeight;
|
|
666
|
-
/**
|
|
667
|
-
* The active height is how much of the modal is actually showing
|
|
668
|
-
* on the screen for this specific breakpoint.
|
|
669
|
-
*/
|
|
670
|
-
const activeHeight = modalHeight * breakpoint;
|
|
671
|
-
/**
|
|
672
|
-
* To find the Y coordinate, start at the bottom of the screen
|
|
673
|
-
* and move up by the active height of the modal.
|
|
674
|
-
*
|
|
675
|
-
* A breakpoint of 1.0 means the active height is the full modal height
|
|
676
|
-
* (fully open). A breakpoint of 0.0 means the active height is 0
|
|
677
|
-
* (fully closed).
|
|
678
|
-
*
|
|
679
|
-
* Since screen Y coordinates get smaller as you go up, we subtract the
|
|
680
|
-
* active height from the viewport bottom.
|
|
681
|
-
*/
|
|
682
|
-
return viewportBottom - activeHeight;
|
|
652
|
+
const calculateEventProgress = (deltaY) => {
|
|
653
|
+
const progress = (calculateProgress(deltaY) - minBreakpoint) / (maxBreakpoint - minBreakpoint);
|
|
654
|
+
return clamp(0, progress, 1);
|
|
683
655
|
};
|
|
684
656
|
const gesture = createGesture({
|
|
685
657
|
el: wrapperEl,
|
|
@@ -198,7 +198,7 @@ ion-backdrop {
|
|
|
198
198
|
|
|
199
199
|
:host {
|
|
200
200
|
--background: var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff));
|
|
201
|
-
--box-shadow: var(--token-elevation-3, var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-6, 6px) var(--token-shadow-blur-32, 32px) var(--token-shadow-spread-0, 0px) var(--token-shadow-6, rgba(0, 0, 0, 0.
|
|
201
|
+
--box-shadow: var(--token-elevation-3, var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-6, 6px) var(--token-shadow-blur-32, 32px) var(--token-shadow-spread-0, 0px) var(--token-shadow-6, rgba(0, 0, 0, 0.16)), var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-2, 2px) var(--token-shadow-blur-7, 7px) var(--token-shadow-spread-0, 0px) var(--token-shadow-2, rgba(0, 0, 0, 0.05)));
|
|
202
202
|
--backdrop-opacity: 0.7;
|
|
203
203
|
color: var(--token-text-default, var(--token-primitives-neutral-1200, #242528));
|
|
204
204
|
}
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
:host {
|
|
264
264
|
--width: 250px;
|
|
265
265
|
--max-height: 90%;
|
|
266
|
-
--box-shadow: var(--token-elevation-4, var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-15, 15px) var(--token-shadow-blur-48, 48px) var(--token-shadow-spread-0, 0px) var(--token-shadow-7, rgba(0, 0, 0, 0.
|
|
266
|
+
--box-shadow: var(--token-elevation-4, var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-15, 15px) var(--token-shadow-blur-48, 48px) var(--token-shadow-spread-0, 0px) var(--token-shadow-7, rgba(0, 0, 0, 0.18)), var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-3, 3px) var(--token-shadow-blur-12, 12px) var(--token-shadow-spread-0, 0px) var(--token-shadow-5, rgba(0, 0, 0, 0.12)));
|
|
267
267
|
--backdrop-opacity: 0.3;
|
|
268
268
|
}
|
|
269
269
|
|