@box/blueprint-web 12.96.0 → 12.97.0
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/dist/lib-esm/index.css +118 -62
- package/dist/lib-esm/modal/constants.d.ts +1 -0
- package/dist/lib-esm/modal/constants.js +3 -0
- package/dist/lib-esm/modal/index.d.ts +1 -1
- package/dist/lib-esm/modal/modal-loading.d.ts +2 -0
- package/dist/lib-esm/modal/modal-loading.js +63 -0
- package/dist/lib-esm/modal/modal.d.ts +1 -0
- package/dist/lib-esm/modal/modal.js +2 -0
- package/dist/lib-esm/modal/modal.module.js +1 -1
- package/dist/lib-esm/modal/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/lib-esm/index.css
CHANGED
|
@@ -6983,7 +6983,7 @@ table.bp_inline_table_module_inlineTable--17192[data-modern=true] td:last-child,
|
|
|
6983
6983
|
display:inline;
|
|
6984
6984
|
}
|
|
6985
6985
|
|
|
6986
|
-
.bp_modal_module_overlay--
|
|
6986
|
+
.bp_modal_module_overlay--1e234[data-modern=false]{
|
|
6987
6987
|
--modal-body-text-color:var(--text-text-on-light);
|
|
6988
6988
|
--modal-overlay-background:var(--overlay-modal-overlay);
|
|
6989
6989
|
--modal-content-background:var(--gray-white);
|
|
@@ -6993,6 +6993,9 @@ table.bp_inline_table_module_inlineTable--17192[data-modern=true] td:last-child,
|
|
|
6993
6993
|
--modal-max-width-medium:540px;
|
|
6994
6994
|
--modal-max-width-large:620px;
|
|
6995
6995
|
--modal-max-width-xlarge:768px;
|
|
6996
|
+
--modal-max-width-loading:var(--modal-min-width-non-fullscreen);
|
|
6997
|
+
--modal-max-height-loading:min(300px, var(--modal-max-height-non-fullscreen));
|
|
6998
|
+
--modal-loading-height:148px;
|
|
6996
6999
|
--modal-margin:0 var(--space-8);
|
|
6997
7000
|
--modal-border-radius:var(--radius-4);
|
|
6998
7001
|
--modal-close-button-color:var(--gray-65);
|
|
@@ -7018,9 +7021,10 @@ table.bp_inline_table_module_inlineTable--17192[data-modern=true] td:last-child,
|
|
|
7018
7021
|
--modal-footer-padding:var(--space-4);
|
|
7019
7022
|
--modal-footer-padding-non-fullscreen:var(--space-6);
|
|
7020
7023
|
--modal-footer-button-margin-inline-start:var(--space-3);
|
|
7024
|
+
--modal-loading-animation:var(--animation-duration-2) cubic-bezier(.25, .46, .45, .94);
|
|
7021
7025
|
}
|
|
7022
7026
|
|
|
7023
|
-
.bp_modal_module_overlay--
|
|
7027
|
+
.bp_modal_module_overlay--1e234[data-modern=true]{
|
|
7024
7028
|
--modal-overlay-background:var(--bp-overlay-modal-overlay);
|
|
7025
7029
|
--modal-content-background:var(--bp-surface-modal-surface);
|
|
7026
7030
|
--modal-min-width-non-fullscreen:calc(460px - var(--bp-space-080)*2);
|
|
@@ -7055,9 +7059,10 @@ table.bp_inline_table_module_inlineTable--17192[data-modern=true] td:last-child,
|
|
|
7055
7059
|
--modal-footer-padding:var(--bp-space-040);
|
|
7056
7060
|
--modal-footer-padding-non-fullscreen:var(--bp-space-060);
|
|
7057
7061
|
--modal-footer-button-margin-inline-start:var(--bp-space-030);
|
|
7062
|
+
--modal-loading-animation:var(--animation-duration-2) cubic-bezier(.25, .46, .45, .94);
|
|
7058
7063
|
}
|
|
7059
7064
|
|
|
7060
|
-
.bp_modal_module_overlay--
|
|
7065
|
+
.bp_modal_module_overlay--1e234{
|
|
7061
7066
|
background-color:var(--modal-overlay-background);
|
|
7062
7067
|
bottom:0;
|
|
7063
7068
|
display:grid;
|
|
@@ -7069,13 +7074,49 @@ table.bp_inline_table_module_inlineTable--17192[data-modern=true] td:last-child,
|
|
|
7069
7074
|
z-index:370;
|
|
7070
7075
|
}
|
|
7071
7076
|
@media (width > 459px){
|
|
7072
|
-
.bp_modal_module_overlay--
|
|
7077
|
+
.bp_modal_module_overlay--1e234{
|
|
7073
7078
|
place-items:center;
|
|
7074
7079
|
}
|
|
7075
7080
|
}
|
|
7076
7081
|
|
|
7077
|
-
.
|
|
7078
|
-
|
|
7082
|
+
.bp_modal_module_headerDividerLine--1e234{
|
|
7083
|
+
position:relative;
|
|
7084
|
+
}
|
|
7085
|
+
.bp_modal_module_headerDividerLine--1e234::after{
|
|
7086
|
+
border-bottom:var(--modal-divider-line-border);
|
|
7087
|
+
bottom:0;
|
|
7088
|
+
content:"";
|
|
7089
|
+
left:var(--modal-divider-line-offset-left);
|
|
7090
|
+
position:absolute;
|
|
7091
|
+
right:var(--modal-divider-line-offset-right);
|
|
7092
|
+
}
|
|
7093
|
+
@media (width > 459px){
|
|
7094
|
+
.bp_modal_module_headerDividerLine--1e234::after{
|
|
7095
|
+
left:var(--modal-divider-line-offset-left-non-fullscreen);
|
|
7096
|
+
right:var(--modal-divider-line-offset-right-non-fullscreen);
|
|
7097
|
+
}
|
|
7098
|
+
}
|
|
7099
|
+
|
|
7100
|
+
.bp_modal_module_footerDividerLine--1e234{
|
|
7101
|
+
position:relative;
|
|
7102
|
+
}
|
|
7103
|
+
.bp_modal_module_footerDividerLine--1e234::before{
|
|
7104
|
+
border-bottom:var(--modal-divider-line-border);
|
|
7105
|
+
content:"";
|
|
7106
|
+
left:var(--modal-divider-line-offset-left);
|
|
7107
|
+
position:absolute;
|
|
7108
|
+
right:var(--modal-divider-line-offset-right);
|
|
7109
|
+
top:0;
|
|
7110
|
+
}
|
|
7111
|
+
@media (width > 459px){
|
|
7112
|
+
.bp_modal_module_footerDividerLine--1e234::before{
|
|
7113
|
+
left:var(--modal-divider-line-offset-left-non-fullscreen);
|
|
7114
|
+
right:var(--modal-divider-line-offset-right-non-fullscreen);
|
|
7115
|
+
}
|
|
7116
|
+
}
|
|
7117
|
+
|
|
7118
|
+
.bp_modal_module_content--1e234{
|
|
7119
|
+
animation:bp_modal_module_popup_bounce_in--1e234 var(--animation-duration-3);
|
|
7079
7120
|
background-color:var(--modal-content-background);
|
|
7080
7121
|
display:flex;
|
|
7081
7122
|
flex-direction:column;
|
|
@@ -7084,80 +7125,90 @@ table.bp_inline_table_module_inlineTable--17192[data-modern=true] td:last-child,
|
|
|
7084
7125
|
position:relative;
|
|
7085
7126
|
}
|
|
7086
7127
|
@media (width > 374px){
|
|
7087
|
-
.bp_modal_module_content--
|
|
7128
|
+
.bp_modal_module_content--1e234{
|
|
7088
7129
|
overflow:hidden;
|
|
7089
7130
|
}
|
|
7090
7131
|
}
|
|
7091
7132
|
@media (width > 459px){
|
|
7092
|
-
.bp_modal_module_content--
|
|
7133
|
+
.bp_modal_module_content--1e234{
|
|
7093
7134
|
border-radius:var(--modal-border-radius);
|
|
7094
7135
|
height:auto;
|
|
7095
7136
|
margin:var(--modal-margin);
|
|
7096
7137
|
max-height:var(--modal-max-height-non-fullscreen);
|
|
7097
7138
|
min-width:var(--modal-min-width-non-fullscreen);
|
|
7139
|
+
transition:max-width var(--modal-loading-animation), max-height var(--modal-loading-animation);
|
|
7098
7140
|
}
|
|
7099
|
-
.bp_modal_module_content--
|
|
7141
|
+
.bp_modal_module_content--1e234.bp_modal_module_smallSizeModal--1e234{
|
|
7100
7142
|
max-width:var(--modal-max-width-small);
|
|
7101
7143
|
}
|
|
7102
|
-
.bp_modal_module_content--
|
|
7144
|
+
.bp_modal_module_content--1e234.bp_modal_module_mediumSizeModal--1e234{
|
|
7103
7145
|
max-width:var(--modal-max-width-medium);
|
|
7104
7146
|
}
|
|
7105
|
-
.bp_modal_module_content--
|
|
7147
|
+
.bp_modal_module_content--1e234.bp_modal_module_largeSizeModal--1e234{
|
|
7106
7148
|
max-width:var(--modal-max-width-large);
|
|
7107
7149
|
}
|
|
7108
|
-
.bp_modal_module_content--
|
|
7150
|
+
.bp_modal_module_content--1e234.bp_modal_module_xlargeSizeModal--1e234{
|
|
7109
7151
|
max-width:var(--modal-max-width-xlarge);
|
|
7110
7152
|
}
|
|
7111
7153
|
}
|
|
7154
|
+
.bp_modal_module_content--1e234:has(.bp_modal_module_loadingContainerActive--1e234) .bp_modal_module_footerDividerLine--1e234::before,.bp_modal_module_content--1e234:has(.bp_modal_module_loadingContainerActive--1e234) .bp_modal_module_headerDividerLine--1e234::after{
|
|
7155
|
+
display:none;
|
|
7156
|
+
}
|
|
7157
|
+
@media (width > 459px){
|
|
7158
|
+
.bp_modal_module_content--1e234:has(.bp_modal_module_loadingContainerActive--1e234){
|
|
7159
|
+
max-height:var(--modal-max-height-loading);
|
|
7160
|
+
max-width:var(--modal-max-width-loading);
|
|
7161
|
+
}
|
|
7162
|
+
}
|
|
7112
7163
|
|
|
7113
|
-
.bp_modal_module_scrollableContainer--
|
|
7164
|
+
.bp_modal_module_scrollableContainer--1e234{
|
|
7114
7165
|
flex-grow:1;
|
|
7115
7166
|
}
|
|
7116
7167
|
@media (width > 374px){
|
|
7117
|
-
.bp_modal_module_scrollableContainer--
|
|
7168
|
+
.bp_modal_module_scrollableContainer--1e234{
|
|
7118
7169
|
overflow-y:auto;
|
|
7119
7170
|
}
|
|
7120
7171
|
}
|
|
7121
7172
|
|
|
7122
|
-
.bp_modal_module_content--
|
|
7173
|
+
.bp_modal_module_content--1e234 .bp_modal_module_close--1e234{
|
|
7123
7174
|
color:var(--modal-close-button-color);
|
|
7124
7175
|
position:fixed;
|
|
7125
7176
|
right:var(--modal-close-button-offset-right);
|
|
7126
7177
|
top:var(--modal-close-button-offset-top);
|
|
7127
7178
|
}
|
|
7128
7179
|
@media (width > 374px){
|
|
7129
|
-
.bp_modal_module_content--
|
|
7180
|
+
.bp_modal_module_content--1e234 .bp_modal_module_close--1e234{
|
|
7130
7181
|
position:absolute;
|
|
7131
7182
|
}
|
|
7132
7183
|
}
|
|
7133
7184
|
|
|
7134
|
-
.bp_modal_module_close--
|
|
7185
|
+
.bp_modal_module_close--1e234.bp_modal_module_onColor--1e234{
|
|
7135
7186
|
background-color:var(--modal-close-button-on-color-background);
|
|
7136
7187
|
}
|
|
7137
|
-
.bp_modal_module_close--
|
|
7188
|
+
.bp_modal_module_close--1e234.bp_modal_module_onColor--1e234:hover{
|
|
7138
7189
|
background-color:var(--modal-close-button-on-color-background-hover);
|
|
7139
7190
|
}
|
|
7140
|
-
.bp_modal_module_close--
|
|
7191
|
+
.bp_modal_module_close--1e234.bp_modal_module_onColor--1e234:active{
|
|
7141
7192
|
background-color:var(--modal-close-button-on-color-background-pressed);
|
|
7142
7193
|
}
|
|
7143
7194
|
|
|
7144
|
-
.bp_modal_module_content--
|
|
7195
|
+
.bp_modal_module_content--1e234 .bp_modal_module_backButton--1e234{
|
|
7145
7196
|
color:var(--modal-back-button-color);
|
|
7146
7197
|
margin-block-start:var(--modal-back-button-margin-top-start);
|
|
7147
7198
|
margin-inline-start:var(--modal-back-button-margin-inline-start);
|
|
7148
7199
|
}
|
|
7149
7200
|
@media (width > 459px){
|
|
7150
|
-
.bp_modal_module_content--
|
|
7201
|
+
.bp_modal_module_content--1e234 .bp_modal_module_backButton--1e234{
|
|
7151
7202
|
height:var(--modal-back-button-size-non-fullscreen);
|
|
7152
7203
|
width:var(--modal-back-button-size-non-fullscreen);
|
|
7153
7204
|
}
|
|
7154
7205
|
}
|
|
7155
7206
|
|
|
7156
|
-
.bp_modal_module_modalHeader--
|
|
7207
|
+
.bp_modal_module_modalHeader--1e234{
|
|
7157
7208
|
display:flex;
|
|
7158
7209
|
}
|
|
7159
7210
|
|
|
7160
|
-
.bp_modal_module_modalTitle--
|
|
7211
|
+
.bp_modal_module_modalTitle--1e234{
|
|
7161
7212
|
display:flex;
|
|
7162
7213
|
flex-direction:column;
|
|
7163
7214
|
gap:var(--modal-title-gap);
|
|
@@ -7165,73 +7216,78 @@ table.bp_inline_table_module_inlineTable--17192[data-modern=true] td:last-child,
|
|
|
7165
7216
|
padding:var(--modal-title-padding);
|
|
7166
7217
|
}
|
|
7167
7218
|
@media (width > 459px){
|
|
7168
|
-
.bp_modal_module_modalTitle--
|
|
7219
|
+
.bp_modal_module_modalTitle--1e234{
|
|
7169
7220
|
padding:var(--modal-title-padding-non-fullscreen);
|
|
7170
7221
|
}
|
|
7171
7222
|
}
|
|
7172
7223
|
|
|
7173
|
-
.bp_modal_module_body--
|
|
7224
|
+
.bp_modal_module_body--1e234{
|
|
7174
7225
|
color:var(--modal-body-text-color);
|
|
7175
7226
|
padding:var(--modal-body-padding-fullscreen);
|
|
7176
7227
|
}
|
|
7177
7228
|
@media (width > 459px){
|
|
7178
|
-
.bp_modal_module_body--
|
|
7229
|
+
.bp_modal_module_body--1e234{
|
|
7179
7230
|
padding:var(--modal-body-padding-non-fullscreen);
|
|
7180
7231
|
}
|
|
7181
7232
|
}
|
|
7182
7233
|
|
|
7183
|
-
.
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
border-bottom:var(--modal-divider-line-border);
|
|
7188
|
-
bottom:0;
|
|
7189
|
-
content:"";
|
|
7190
|
-
left:var(--modal-divider-line-offset-left);
|
|
7191
|
-
position:absolute;
|
|
7192
|
-
right:var(--modal-divider-line-offset-right);
|
|
7234
|
+
.bp_modal_module_footer--1e234{
|
|
7235
|
+
display:flex;
|
|
7236
|
+
justify-content:flex-end;
|
|
7237
|
+
padding:var(--modal-footer-padding);
|
|
7193
7238
|
}
|
|
7194
7239
|
@media (width > 459px){
|
|
7195
|
-
.
|
|
7196
|
-
|
|
7197
|
-
right:var(--modal-divider-line-offset-right-non-fullscreen);
|
|
7240
|
+
.bp_modal_module_footer--1e234{
|
|
7241
|
+
padding:var(--modal-footer-padding-non-fullscreen);
|
|
7198
7242
|
}
|
|
7199
7243
|
}
|
|
7200
7244
|
|
|
7201
|
-
.
|
|
7245
|
+
.bp_modal_module_footerButton--1e234 + .bp_modal_module_footerButton--1e234{
|
|
7246
|
+
margin-inline-start:var(--modal-footer-button-margin-inline-start);
|
|
7247
|
+
}
|
|
7248
|
+
|
|
7249
|
+
.bp_modal_module_loadingContainer--1e234{
|
|
7250
|
+
display:flex;
|
|
7251
|
+
min-height:0;
|
|
7202
7252
|
position:relative;
|
|
7253
|
+
transition:height var(--modal-loading-animation);
|
|
7203
7254
|
}
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7255
|
+
|
|
7256
|
+
.bp_modal_module_loadingContainerActive--1e234{
|
|
7257
|
+
height:var(--modal-loading-height);
|
|
7258
|
+
overflow:hidden;
|
|
7259
|
+
}
|
|
7260
|
+
|
|
7261
|
+
.bp_modal_module_loading--1e234{
|
|
7262
|
+
align-items:center;
|
|
7263
|
+
display:flex;
|
|
7264
|
+
}
|
|
7265
|
+
|
|
7266
|
+
.bp_modal_module_loadingContainerActive--1e234 .bp_modal_module_loading--1e234{
|
|
7267
|
+
height:var(--modal-loading-height);
|
|
7268
|
+
}
|
|
7269
|
+
|
|
7270
|
+
.bp_modal_module_loadingOverlay--1e234{
|
|
7271
|
+
background-color:var(--modal-content-background);
|
|
7272
|
+
bottom:0;
|
|
7273
|
+
left:0;
|
|
7274
|
+
min-height:var(--modal-loading-height);
|
|
7208
7275
|
position:absolute;
|
|
7209
|
-
right:
|
|
7276
|
+
right:0;
|
|
7210
7277
|
top:0;
|
|
7211
|
-
|
|
7212
|
-
@media (width > 459px){
|
|
7213
|
-
.bp_modal_module_footerDividerLine--5478d::before{
|
|
7214
|
-
left:var(--modal-divider-line-offset-left-non-fullscreen);
|
|
7215
|
-
right:var(--modal-divider-line-offset-right-non-fullscreen);
|
|
7216
|
-
}
|
|
7278
|
+
z-index:1;
|
|
7217
7279
|
}
|
|
7218
7280
|
|
|
7219
|
-
.
|
|
7281
|
+
.bp_modal_module_loadingContent--1e234{
|
|
7220
7282
|
display:flex;
|
|
7221
|
-
|
|
7222
|
-
padding:var(--modal-footer-padding);
|
|
7223
|
-
}
|
|
7224
|
-
@media (width > 459px){
|
|
7225
|
-
.bp_modal_module_footer--5478d{
|
|
7226
|
-
padding:var(--modal-footer-padding-non-fullscreen);
|
|
7227
|
-
}
|
|
7283
|
+
visibility:hidden;
|
|
7228
7284
|
}
|
|
7229
7285
|
|
|
7230
|
-
.
|
|
7231
|
-
|
|
7286
|
+
.bp_modal_module_loadingContentVisible--1e234{
|
|
7287
|
+
visibility:visible;
|
|
7232
7288
|
}
|
|
7233
7289
|
|
|
7234
|
-
@keyframes bp_modal_module_popup_bounce_in--
|
|
7290
|
+
@keyframes bp_modal_module_popup_bounce_in--1e234{
|
|
7235
7291
|
0%{
|
|
7236
7292
|
transform:scale3d(.1, .1, 1);
|
|
7237
7293
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MODAL_LOADING_ANIMATION_DURATION = 200;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Modal } from './modal';
|
|
2
|
-
export {
|
|
2
|
+
export type { ModalCloseProps, ModalContentProps, ModalLoadingProps, ModalProps, ModalTriggerProps } from './types';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useState, useEffect } from 'react';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { LoadingIndicator } from '../loading-indicator/loading-indicator.js';
|
|
5
|
+
import { MODAL_LOADING_ANIMATION_DURATION } from './constants.js';
|
|
6
|
+
import styles from './modal.module.js';
|
|
7
|
+
|
|
8
|
+
var LoadingState;
|
|
9
|
+
(function (LoadingState) {
|
|
10
|
+
LoadingState["Loading"] = "loading";
|
|
11
|
+
LoadingState["Animating"] = "animating";
|
|
12
|
+
LoadingState["ShowingContent"] = "showing_content";
|
|
13
|
+
})(LoadingState || (LoadingState = {}));
|
|
14
|
+
const ModalLoading = /*#__PURE__*/forwardRef(({
|
|
15
|
+
className,
|
|
16
|
+
loadingIndicatorAriaLabel,
|
|
17
|
+
isLoading,
|
|
18
|
+
children,
|
|
19
|
+
...rest
|
|
20
|
+
}, forwardedRef) => {
|
|
21
|
+
const [loadingState, setLoadingState] = useState(isLoading ? LoadingState.Loading : LoadingState.ShowingContent);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (isLoading) {
|
|
24
|
+
// Hide content when loading
|
|
25
|
+
setLoadingState(LoadingState.Loading);
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
// Start animating when loading completes
|
|
29
|
+
setLoadingState(LoadingState.Animating);
|
|
30
|
+
// Show content after modal resize completes
|
|
31
|
+
const showTimer = setTimeout(() => {
|
|
32
|
+
setLoadingState(LoadingState.ShowingContent);
|
|
33
|
+
}, MODAL_LOADING_ANIMATION_DURATION); // Duration of modal resize animation
|
|
34
|
+
return () => {
|
|
35
|
+
clearTimeout(showTimer);
|
|
36
|
+
};
|
|
37
|
+
}, [isLoading]);
|
|
38
|
+
const shouldShowLoading = loadingState === LoadingState.Loading;
|
|
39
|
+
const shouldShowContent = loadingState === LoadingState.ShowingContent;
|
|
40
|
+
return jsxs("div", {
|
|
41
|
+
className: clsx(styles.loadingContainer, {
|
|
42
|
+
[styles.loadingContainerActive]: shouldShowLoading
|
|
43
|
+
}),
|
|
44
|
+
children: [jsx("div", {
|
|
45
|
+
"aria-hidden": !shouldShowContent,
|
|
46
|
+
className: clsx(styles.loadingContent, {
|
|
47
|
+
[styles.loadingContentVisible]: shouldShowContent
|
|
48
|
+
}),
|
|
49
|
+
children: children
|
|
50
|
+
}), shouldShowLoading && jsx("div", {
|
|
51
|
+
...rest,
|
|
52
|
+
ref: forwardedRef,
|
|
53
|
+
className: clsx(className, styles.loading, styles.loadingOverlay),
|
|
54
|
+
children: jsx(LoadingIndicator, {
|
|
55
|
+
"aria-label": loadingIndicatorAriaLabel,
|
|
56
|
+
size: "large"
|
|
57
|
+
})
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
ModalLoading.displayName = 'ModalLoading';
|
|
62
|
+
|
|
63
|
+
export { ModalLoading };
|
|
@@ -47,6 +47,7 @@ export declare const Modal: (({ children, modal, ...props }: ModalProps) => impo
|
|
|
47
47
|
}, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
|
|
48
48
|
};
|
|
49
49
|
Header: import("react").ForwardRefExoticComponent<import("./types").ModalHeaderProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
50
|
+
Loading: import("react").ForwardRefExoticComponent<import("./types").ModalLoadingProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
50
51
|
ScrollableContainer: import("react").ForwardRefExoticComponent<import("./types").ModalScrollableContainerProps & {
|
|
51
52
|
'data-testid'?: string;
|
|
52
53
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -6,6 +6,7 @@ import { ModalClose } from './modal-close.js';
|
|
|
6
6
|
import { ModalContent } from './modal-content.js';
|
|
7
7
|
import { ModalFooter } from './modal-footer.js';
|
|
8
8
|
import { ModalHeader } from './modal-header.js';
|
|
9
|
+
import { ModalLoading } from './modal-loading.js';
|
|
9
10
|
import { ModalScrollableContainer } from './modal-scrollable-container.js';
|
|
10
11
|
import { ModalTitle } from './modal-title.js';
|
|
11
12
|
import { ModalTrigger } from './modal-trigger.js';
|
|
@@ -50,6 +51,7 @@ const Modal = Object.assign(Root, {
|
|
|
50
51
|
Content: ModalContent,
|
|
51
52
|
Footer: ModalFooter,
|
|
52
53
|
Header: ModalHeader,
|
|
54
|
+
Loading: ModalLoading,
|
|
53
55
|
ScrollableContainer: ModalScrollableContainer,
|
|
54
56
|
Trigger: ModalTrigger,
|
|
55
57
|
Title: ModalTitle
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"overlay":"bp_modal_module_overlay--
|
|
2
|
+
var styles = {"overlay":"bp_modal_module_overlay--1e234","headerDividerLine":"bp_modal_module_headerDividerLine--1e234","footerDividerLine":"bp_modal_module_footerDividerLine--1e234","content":"bp_modal_module_content--1e234","popup_bounce_in":"bp_modal_module_popup_bounce_in--1e234","smallSizeModal":"bp_modal_module_smallSizeModal--1e234","mediumSizeModal":"bp_modal_module_mediumSizeModal--1e234","largeSizeModal":"bp_modal_module_largeSizeModal--1e234","xlargeSizeModal":"bp_modal_module_xlargeSizeModal--1e234","loadingContainerActive":"bp_modal_module_loadingContainerActive--1e234","scrollableContainer":"bp_modal_module_scrollableContainer--1e234","close":"bp_modal_module_close--1e234","onColor":"bp_modal_module_onColor--1e234","backButton":"bp_modal_module_backButton--1e234","modalHeader":"bp_modal_module_modalHeader--1e234","modalTitle":"bp_modal_module_modalTitle--1e234","body":"bp_modal_module_body--1e234","footer":"bp_modal_module_footer--1e234","footerButton":"bp_modal_module_footerButton--1e234","loadingContainer":"bp_modal_module_loadingContainer--1e234","loading":"bp_modal_module_loading--1e234","loadingOverlay":"bp_modal_module_loadingOverlay--1e234","loadingContent":"bp_modal_module_loadingContent--1e234","loadingContentVisible":"bp_modal_module_loadingContentVisible--1e234"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type DialogContentProps, type DialogPortalProps, type DialogProps, type DialogTitleProps } from '@radix-ui/react-dialog';
|
|
2
2
|
import { type FunctionComponent, type HTMLAttributes, type PropsWithChildren, type ReactElement, type ReactNode, type SVGProps } from 'react';
|
|
3
|
+
import { type LoadingIndicatorProps } from '../loading-indicator/loading-indicator';
|
|
3
4
|
import { type IconButtonProps } from '../primitives/icon-button';
|
|
4
5
|
export type ModalProps = DialogProps;
|
|
5
6
|
/** The size of the modal content.
|
|
@@ -56,3 +57,10 @@ export interface ModalHeaderProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
|
56
57
|
/** Content of the Subttitle element */
|
|
57
58
|
subtitle?: ReactNode;
|
|
58
59
|
}
|
|
60
|
+
export interface ModalLoadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
61
|
+
loadingIndicatorAriaLabel: LoadingIndicatorProps['aria-label'];
|
|
62
|
+
/** When false, fades out loading indicator and reveals children. Defaults to true. */
|
|
63
|
+
isLoading: boolean;
|
|
64
|
+
/** Content to render underneath the loading indicator. The modal will size to this content. */
|
|
65
|
+
children: ReactNode;
|
|
66
|
+
}
|