@oaknational/oak-components 3.29.2 → 3.30.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/npm/cjs/index.js +401 -140
- package/dist/npm/cjs/types.d.ts +314 -3
- package/dist/npm/es/components/buttons/OakCloseButton/OakCloseButton.js +7 -2
- package/dist/npm/es/components/internal-components/InternalModalBase/InternalModalBase.js +139 -0
- package/dist/npm/es/components/internal-components/InternalModalFooter/InternalModalFooter.js +17 -0
- package/dist/npm/es/components/messaging-and-feedback/OakDialog/OakDialog.js +22 -0
- package/dist/npm/es/components/messaging-and-feedback/OakDialogFooter/OakDialogFooter.js +22 -0
- package/dist/npm/es/components/messaging-and-feedback/OakInformativeModal/OakInformativeModal.js +11 -0
- package/dist/npm/es/components/messaging-and-feedback/OakInformativeModal/OakInformativeModalBody.js +4 -0
- package/dist/npm/es/components/messaging-and-feedback/OakInformativeModal/OakInformativeModalFooter.js +4 -0
- package/dist/npm/es/components/messaging-and-feedback/OakModal/OakModal.js +36 -0
- package/dist/npm/es/components/messaging-and-feedback/OakModalCenter/OakModalCenter.js +6 -0
- package/dist/npm/es/components/messaging-and-feedback/OakModalCenter/OakModalCenterBody.js +4 -0
- package/dist/npm/es/components/messaging-and-feedback/OakModalFooter/OakModalFooter.js +22 -0
- package/dist/npm/es/components/navigation/OakLink/OakLink.js +1 -0
- package/dist/npm/es/components/navigation/OakTabs/OakTabs.js +1 -0
- package/dist/npm/es/index.js +4 -0
- package/dist/npm/es/types.d.ts +314 -3
- package/package.json +1 -1
package/dist/npm/cjs/types.d.ts
CHANGED
|
@@ -1449,6 +1449,18 @@ declare const useDropdownContext: () => {
|
|
|
1449
1449
|
|
|
1450
1450
|
type OakCloseButtonProps = {
|
|
1451
1451
|
onClose: () => void;
|
|
1452
|
+
/**
|
|
1453
|
+
* Size of the button and its icon
|
|
1454
|
+
*
|
|
1455
|
+
* @default spacing-24
|
|
1456
|
+
*/
|
|
1457
|
+
size?: OakAllSpacingToken;
|
|
1458
|
+
/**
|
|
1459
|
+
* Use `inverted` on dark backgrounds, e.g. a black modal header
|
|
1460
|
+
*
|
|
1461
|
+
* @default default
|
|
1462
|
+
*/
|
|
1463
|
+
variant?: "default" | "inverted";
|
|
1452
1464
|
};
|
|
1453
1465
|
/**
|
|
1454
1466
|
*
|
|
@@ -1458,7 +1470,7 @@ type OakCloseButtonProps = {
|
|
|
1458
1470
|
*
|
|
1459
1471
|
*
|
|
1460
1472
|
*/
|
|
1461
|
-
declare function OakCloseButton({ onClose, ...rest }: Readonly<OakCloseButtonProps>): React__default.JSX.Element;
|
|
1473
|
+
declare function OakCloseButton({ onClose, size, variant, ...rest }: Readonly<OakCloseButtonProps>): React__default.JSX.Element;
|
|
1462
1474
|
|
|
1463
1475
|
type OakPrimaryButtonProps = Omit<InternalShadowRectButtonProps, "defaultBorderColor" | "defaultBackground" | "defaultTextColor" | "hoverBackground" | "hoverBorderColor" | "hoverTextColor" | "disabledBackground" | "disabledBorderColor" | "disabledTextColor">;
|
|
1464
1476
|
/**
|
|
@@ -1910,8 +1922,23 @@ declare function useCookieConsent(): {
|
|
|
1910
1922
|
*/
|
|
1911
1923
|
declare const OakCookieConsentProvider: ({ children, policyConsents, onConsentChange, }: OakCookieConsentProviderProps) => React__default.JSX.Element;
|
|
1912
1924
|
|
|
1925
|
+
/**
|
|
1926
|
+
* ⚠️ To be deprecated
|
|
1927
|
+
* Use `<OakModal />` instead (it has no border colour context)
|
|
1928
|
+
* @deprecated Use `<OakModal />` instead (it has no border colour context)
|
|
1929
|
+
*/
|
|
1913
1930
|
declare const OakInformativeModalBorderColor: React__default.Context<("transparent" | "text-primary" | "text-subdued" | "text-error" | "text-disabled" | "text-link-active" | "text-link-hover" | "text-link-visited" | "text-link-pressed" | "text-inverted" | "text-success" | "text-promo" | "bg-primary" | "bg-inverted" | "bg-inverted-semi-transparent" | "bg-neutral" | "bg-neutral-stronger" | "bg-btn-primary" | "bg-btn-primary-hover" | "bg-btn-primary-disabled" | "bg-btn-secondary" | "bg-btn-secondary-hover" | "bg-btn-secondary-disabled" | "bg-decorative1-main" | "bg-decorative1-subdued" | "bg-decorative1-very-subdued" | "bg-decorative2-main" | "bg-decorative2-subdued" | "bg-decorative2-very-subdued" | "bg-decorative3-main" | "bg-decorative3-subdued" | "bg-decorative3-very-subdued" | "bg-decorative4-main" | "bg-decorative4-subdued" | "bg-decorative4-very-subdued" | "bg-decorative5-main" | "bg-decorative5-subdued" | "bg-decorative5-very-subdued" | "bg-decorative6-main" | "bg-decorative6-subdued" | "bg-decorative6-very-subdued" | "bg-interactive-element1" | "bg-interactive-element2" | "bg-correct" | "bg-incorrect" | "bg-success" | "bg-error" | "icon-inverted" | "icon-disabled" | "icon-brand" | "icon-success" | "icon-error" | "icon-warning" | "icon-primary" | "icon-subdued" | "icon-link-active" | "icon-link-hover" | "icon-link-pressed" | "icon-link-visited" | "icon-decorative1" | "icon-decorative2" | "icon-decorative3" | "icon-decorative4" | "icon-decorative5" | "icon-decorative6" | "icon-promo" | "border-primary" | "border-inverted" | "border-neutral" | "border-neutral-lighter" | "border-neutral-stronger" | "border-brand" | "border-success" | "border-error" | "border-warning" | "border-decorative1" | "border-decorative1-stronger" | "border-decorative2" | "border-decorative2-stronger" | "border-decorative3" | "border-decorative3-stronger" | "border-decorative4" | "border-decorative4-stronger" | "border-decorative5" | "border-decorative5-stronger" | "border-decorative6" | "border-decorative6-stronger" | "border-text-link-pressed" | "code-blue" | "code-green" | "code-grey" | "code-pink" | ("transparent" | "text-primary" | "text-subdued" | "text-error" | "text-disabled" | "text-link-active" | "text-link-hover" | "text-link-visited" | "text-link-pressed" | "text-inverted" | "text-success" | "text-promo" | "bg-primary" | "bg-inverted" | "bg-inverted-semi-transparent" | "bg-neutral" | "bg-neutral-stronger" | "bg-btn-primary" | "bg-btn-primary-hover" | "bg-btn-primary-disabled" | "bg-btn-secondary" | "bg-btn-secondary-hover" | "bg-btn-secondary-disabled" | "bg-decorative1-main" | "bg-decorative1-subdued" | "bg-decorative1-very-subdued" | "bg-decorative2-main" | "bg-decorative2-subdued" | "bg-decorative2-very-subdued" | "bg-decorative3-main" | "bg-decorative3-subdued" | "bg-decorative3-very-subdued" | "bg-decorative4-main" | "bg-decorative4-subdued" | "bg-decorative4-very-subdued" | "bg-decorative5-main" | "bg-decorative5-subdued" | "bg-decorative5-very-subdued" | "bg-decorative6-main" | "bg-decorative6-subdued" | "bg-decorative6-very-subdued" | "bg-interactive-element1" | "bg-interactive-element2" | "bg-correct" | "bg-incorrect" | "bg-success" | "bg-error" | "icon-inverted" | "icon-disabled" | "icon-brand" | "icon-success" | "icon-error" | "icon-warning" | "icon-primary" | "icon-subdued" | "icon-link-active" | "icon-link-hover" | "icon-link-pressed" | "icon-link-visited" | "icon-decorative1" | "icon-decorative2" | "icon-decorative3" | "icon-decorative4" | "icon-decorative5" | "icon-decorative6" | "icon-promo" | "border-primary" | "border-inverted" | "border-neutral" | "border-neutral-lighter" | "border-neutral-stronger" | "border-brand" | "border-success" | "border-error" | "border-warning" | "border-decorative1" | "border-decorative1-stronger" | "border-decorative2" | "border-decorative2-stronger" | "border-decorative3" | "border-decorative3-stronger" | "border-decorative4" | "border-decorative4-stronger" | "border-decorative5" | "border-decorative5-stronger" | "border-decorative6" | "border-decorative6-stronger" | "border-text-link-pressed" | "code-blue" | "code-green" | "code-grey" | "code-pink" | null)[] | null) | undefined>;
|
|
1931
|
+
/**
|
|
1932
|
+
* ⚠️ To be deprecated
|
|
1933
|
+
* Use `OakModalCloseAction` instead
|
|
1934
|
+
* @deprecated Use `OakModalCloseAction` instead
|
|
1935
|
+
*/
|
|
1914
1936
|
type OakInformativeModalCloseAction = "close_button" | undefined;
|
|
1937
|
+
/**
|
|
1938
|
+
* ⚠️ To be deprecated
|
|
1939
|
+
* Use `OakModalProps` instead
|
|
1940
|
+
* @deprecated Use `OakModalProps` instead
|
|
1941
|
+
*/
|
|
1915
1942
|
type OakInformativeModalProps = {
|
|
1916
1943
|
/**
|
|
1917
1944
|
* The content of the modal.
|
|
@@ -1963,9 +1990,20 @@ type OakInformativeModalProps = {
|
|
|
1963
1990
|
} & Pick<HTMLAttributes<Element>, "aria-label" | "aria-description" | "aria-labelledby" | "aria-describedby">;
|
|
1964
1991
|
/**
|
|
1965
1992
|
* Modal dialog with trapped focus and a close button. See the [design specification](https://www.figma.com/design/YcWQMMhHPVVmc47cHHEEAl/Oak-Design-Kit?node-id=15135-2063)
|
|
1993
|
+
*
|
|
1994
|
+
* ⚠️ To be deprecated
|
|
1995
|
+
* Use `<OakModal position="right" />` (or `position="left"`) instead
|
|
1996
|
+
* `zIndex` and `domContainer` carry over unchanged.
|
|
1997
|
+
* Figma: <https://www.figma.com/design/YcWQMMhHPVVmc47cHHEEAl/Oak-Design-Kit?node-id=25437-6465>
|
|
1998
|
+
* @deprecated Use `<OakModal position="right" />` (or `position="left"`) instead
|
|
1966
1999
|
*/
|
|
1967
2000
|
declare const OakInformativeModal: ({ children, footerSlot, domContainer, isOpen, onClose, zIndex, isLeftHandSide, closeOnBackgroundClick, largeScreenMaxWidth, ...rest }: OakInformativeModalProps) => React__default.ReactPortal | null;
|
|
1968
2001
|
|
|
2002
|
+
/**
|
|
2003
|
+
* ⚠️ To be deprecated
|
|
2004
|
+
* Use `<OakModal />` instead (its content area already has padding)
|
|
2005
|
+
* @deprecated Use `<OakModal />` instead (its content area already has padding)
|
|
2006
|
+
*/
|
|
1969
2007
|
type OakInformativeModalBodyProps = {
|
|
1970
2008
|
children: ReactNode;
|
|
1971
2009
|
};
|
|
@@ -1973,9 +2011,18 @@ type OakInformativeModalBodyProps = {
|
|
|
1973
2011
|
* Intended to be used in the `children` slot of `OakInformativeModal`
|
|
1974
2012
|
* it applies some padding and margin to ensure that the contents
|
|
1975
2013
|
* line up with the modal's header and footer
|
|
2014
|
+
*
|
|
2015
|
+
* ⚠️ To be deprecated
|
|
2016
|
+
* Use `<OakModal />` instead (its content area already has padding)
|
|
2017
|
+
* @deprecated Use `<OakModal />` instead (its content area already has padding)
|
|
1976
2018
|
*/
|
|
1977
2019
|
declare const OakInformativeModalBody: (props: OakInformativeModalBodyProps) => React__default.JSX.Element;
|
|
1978
2020
|
|
|
2021
|
+
/**
|
|
2022
|
+
* ⚠️ To be deprecated
|
|
2023
|
+
* Use `<OakModalFooter />` in the `footerSlot` of `<OakModal />` instead
|
|
2024
|
+
* @deprecated Use `<OakModalFooter />` in the `footerSlot` of `<OakModal />` instead
|
|
2025
|
+
*/
|
|
1979
2026
|
type OakInformativeModalFooterProps = {
|
|
1980
2027
|
children: ReactNode;
|
|
1981
2028
|
};
|
|
@@ -1983,6 +2030,10 @@ type OakInformativeModalFooterProps = {
|
|
|
1983
2030
|
* Intended to be used in the `footer` slot of `OakInformativeModal`
|
|
1984
2031
|
* it is ideal as a container for one or more buttons.
|
|
1985
2032
|
* It switches from a horizontal to vertical layout on smaller screens
|
|
2033
|
+
*
|
|
2034
|
+
* ⚠️ To be deprecated
|
|
2035
|
+
* Use `<OakModalFooter />` in the `footerSlot` of `<OakModal />` instead
|
|
2036
|
+
* @deprecated Use `<OakModalFooter />` in the `footerSlot` of `<OakModal />` instead
|
|
1986
2037
|
*/
|
|
1987
2038
|
declare const OakInformativeModalFooter: (props: OakInformativeModalFooterProps) => React__default.JSX.Element;
|
|
1988
2039
|
|
|
@@ -3241,6 +3292,11 @@ declare const bannerVariants: OakInlineBannerVariantProps;
|
|
|
3241
3292
|
*/
|
|
3242
3293
|
declare const OakInlineBanner: ({ isOpen, title, message, type, icon, iconColorFilter, isLoading, cta, canDismiss, onDismiss, closeButtonOverrideProps, variant, titleTag, ...props }: OakInlineBannerProps) => React__default.JSX.Element;
|
|
3243
3294
|
|
|
3295
|
+
/**
|
|
3296
|
+
* ⚠️ To be deprecated
|
|
3297
|
+
* Use `OakDialogProps` or `OakModalProps` instead
|
|
3298
|
+
* @deprecated Use `OakDialogProps` or `OakModalProps` instead
|
|
3299
|
+
*/
|
|
3244
3300
|
type OakModalCenterProps = {
|
|
3245
3301
|
/**
|
|
3246
3302
|
* The content of the modal. Use with `<OakModalCenterBody>` for best results.
|
|
@@ -3312,9 +3368,20 @@ type OakModalCenterProps = {
|
|
|
3312
3368
|
* - **modalInnerFlexProps?** \- Override HTMLAttributes & OakFlex props for the inner modal container
|
|
3313
3369
|
* - **backdropFlexProps?** \- Override HTMLAttributes & OakFlex props for the backdrop container
|
|
3314
3370
|
* - **footerSlot?** \- Fixed area at the bottom of the modal, this will remain fixed in view if the content is scrollable
|
|
3371
|
+
*
|
|
3372
|
+
* ⚠️ To be deprecated
|
|
3373
|
+
* Use `<OakDialog />` (not dismissible) or `<OakModal />` (dismissible) instead
|
|
3374
|
+
* `OakDialog` is for blocking choices, e.g. content guidance.
|
|
3375
|
+
* Figma: <https://www.figma.com/design/YcWQMMhHPVVmc47cHHEEAl/Oak-Design-Kit?node-id=25437-6387>
|
|
3376
|
+
* @deprecated Use `<OakDialog />` (not dismissible) or `<OakModal />` (dismissible) instead
|
|
3315
3377
|
*/
|
|
3316
3378
|
declare const OakModalCenter: ({ children, domContainer, isOpen, onClose, disableBackdropClick, disableEscapeKey, hideCloseButton, modalFlexProps, modalOuterFlexProps, modalInnerFlexProps, backdropFlexProps, footerSlot, returnFocus, }: OakModalCenterProps) => React__default.JSX.Element;
|
|
3317
3379
|
|
|
3380
|
+
/**
|
|
3381
|
+
* ⚠️ To be deprecated
|
|
3382
|
+
* Use `<OakDialog />` with `OakHeading` and `OakP` in its content instead
|
|
3383
|
+
* @deprecated Use `<OakDialog />` with `OakHeading` and `OakP` in its content instead
|
|
3384
|
+
*/
|
|
3318
3385
|
type OakModalCenterBodyProps = {
|
|
3319
3386
|
/**
|
|
3320
3387
|
* The name of the icon to display. Accepts an icon name token
|
|
@@ -3354,9 +3421,253 @@ type OakModalCenterBodyProps = {
|
|
|
3354
3421
|
* - **children** \- The content of the modal body
|
|
3355
3422
|
* - **headingOverride** \- Override HTMLAttributes & OakHEading props for the heading
|
|
3356
3423
|
* - **iconOverride** \- Override HTMLAttributes & OakIcon props for the icon
|
|
3424
|
+
*
|
|
3425
|
+
* ⚠️ To be deprecated
|
|
3426
|
+
* Use `<OakDialog />` with `OakHeading` and `OakP` in its content instead
|
|
3427
|
+
* @deprecated Use `<OakDialog />` with `OakHeading` and `OakP` in its content instead
|
|
3357
3428
|
*/
|
|
3358
3429
|
declare const OakModalCenterBody: ({ children, iconName, title, headingOverride, iconOverride, hideIcon, }: OakModalCenterBodyProps) => React__default.JSX.Element;
|
|
3359
3430
|
|
|
3431
|
+
/**
|
|
3432
|
+
* A modal must have an accessible name. Exactly one of `aria-label` or
|
|
3433
|
+
* `aria-labelledby` is required: passing neither, or both, is a type error.
|
|
3434
|
+
* For the public modal components' props.
|
|
3435
|
+
*/
|
|
3436
|
+
type InternalModalAccessibleName = {
|
|
3437
|
+
"aria-label": string;
|
|
3438
|
+
"aria-labelledby"?: never;
|
|
3439
|
+
} | {
|
|
3440
|
+
"aria-labelledby": string;
|
|
3441
|
+
"aria-label"?: never;
|
|
3442
|
+
};
|
|
3443
|
+
|
|
3444
|
+
type OakDialogProps = {
|
|
3445
|
+
/**
|
|
3446
|
+
* Whether the dialog is open. It can't be dismissed, so close it from your own buttons.
|
|
3447
|
+
*/
|
|
3448
|
+
isOpen: boolean;
|
|
3449
|
+
/**
|
|
3450
|
+
* The content of the dialog, including a title.
|
|
3451
|
+
*/
|
|
3452
|
+
children: ReactNode;
|
|
3453
|
+
/**
|
|
3454
|
+
* Fixed footer for the choice buttons, e.g. `OakDialogFooter`.
|
|
3455
|
+
*/
|
|
3456
|
+
footerSlot?: ReactNode;
|
|
3457
|
+
/**
|
|
3458
|
+
* Focus the top of the content on open. Set to `false` and add
|
|
3459
|
+
* `data-autofocus` to a button to focus that button instead.
|
|
3460
|
+
*
|
|
3461
|
+
* @default true
|
|
3462
|
+
*/
|
|
3463
|
+
focusContentOnOpen?: boolean;
|
|
3464
|
+
/**
|
|
3465
|
+
* @default spacing-960
|
|
3466
|
+
*/
|
|
3467
|
+
width?: OakAllSpacingToken;
|
|
3468
|
+
/**
|
|
3469
|
+
* @default spacing-640
|
|
3470
|
+
*/
|
|
3471
|
+
maxHeight?: OakAllSpacingToken;
|
|
3472
|
+
/**
|
|
3473
|
+
* Id of an element that describes the dialog. Only use for short messages.
|
|
3474
|
+
*/
|
|
3475
|
+
"aria-describedby"?: string;
|
|
3476
|
+
/**
|
|
3477
|
+
* @default document.body
|
|
3478
|
+
*/
|
|
3479
|
+
domContainer?: Element;
|
|
3480
|
+
/**
|
|
3481
|
+
* Overrides the `modal-dialog` z-index token. Only for consumers not using Oak z-index tokens.
|
|
3482
|
+
*/
|
|
3483
|
+
zIndex?: number;
|
|
3484
|
+
/**
|
|
3485
|
+
* Override for the `returnFocus` behaviour of `FocusOn`.
|
|
3486
|
+
*
|
|
3487
|
+
* By default focus returns to the element that was focused before the dialog opened.
|
|
3488
|
+
*/
|
|
3489
|
+
returnFocus?: (returnTo: Element) => boolean | FocusOptions;
|
|
3490
|
+
} & InternalModalAccessibleName;
|
|
3491
|
+
/**
|
|
3492
|
+
* A centred dialog that requires an explicit choice, e.g. acknowledging a
|
|
3493
|
+
* content guidance warning.
|
|
3494
|
+
*
|
|
3495
|
+
* - **Can't be dismissed**: no close button, Escape or backdrop click. Close it
|
|
3496
|
+
* by setting `isOpen` to `false`.
|
|
3497
|
+
* - **Focus**: goes to the content on open. To focus a button instead, use
|
|
3498
|
+
* `focusContentOnOpen={false}` and `data-autofocus` on the least destructive
|
|
3499
|
+
* (or most used) button.
|
|
3500
|
+
* - **Name**: `aria-label` or `aria-labelledby` is required.
|
|
3501
|
+
*
|
|
3502
|
+
* Design system: <https://www.figma.com/design/YcWQMMhHPVVmc47cHHEEAl/Oak-Design-Kit?node-id=25437-6387>
|
|
3503
|
+
*/
|
|
3504
|
+
declare const OakDialog: ({ isOpen, children, footerSlot, focusContentOnOpen, width, maxHeight, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, domContainer, zIndex, returnFocus, }: OakDialogProps) => React__default.JSX.Element;
|
|
3505
|
+
|
|
3506
|
+
type InternalModalFooterLayout = "horizontal" | "vertical" | "left" | "right";
|
|
3507
|
+
type InternalModalFooterProps = {
|
|
3508
|
+
/**
|
|
3509
|
+
* How the buttons are arranged.
|
|
3510
|
+
*
|
|
3511
|
+
* - `horizontal`: buttons side by side
|
|
3512
|
+
* - `vertical`: buttons stacked
|
|
3513
|
+
* - `left` / `right`: buttons aligned to that side
|
|
3514
|
+
*
|
|
3515
|
+
* For `horizontal` and `vertical`, give each button `width="100%"` so they
|
|
3516
|
+
* fill the footer (sharing it equally when horizontal), as in Figma.
|
|
3517
|
+
*/
|
|
3518
|
+
layout: InternalModalFooterLayout;
|
|
3519
|
+
/**
|
|
3520
|
+
* The footer actions, usually `OakSecondaryButton` then `OakPrimaryButton`
|
|
3521
|
+
*/
|
|
3522
|
+
children: ReactNode;
|
|
3523
|
+
};
|
|
3524
|
+
|
|
3525
|
+
type OakDialogFooterLayout = InternalModalFooterLayout;
|
|
3526
|
+
type OakDialogFooterProps = InternalModalFooterProps;
|
|
3527
|
+
/**
|
|
3528
|
+
* A footer for the `footerSlot` of `OakDialog`, in one of the four Figma
|
|
3529
|
+
* footer layouts. You can pass your own content to `footerSlot` instead.
|
|
3530
|
+
*
|
|
3531
|
+
* - `horizontal`: buttons side by side
|
|
3532
|
+
* - `vertical`: buttons stacked
|
|
3533
|
+
* - `left` / `right`: buttons aligned to that side
|
|
3534
|
+
*
|
|
3535
|
+
* For `horizontal` and `vertical`, give each button `width="100%"` so they
|
|
3536
|
+
* fill the footer (sharing it equally when horizontal), as in Figma.
|
|
3537
|
+
*
|
|
3538
|
+
* Design system: <https://www.figma.com/design/YcWQMMhHPVVmc47cHHEEAl/Oak-Design-Kit?node-id=25437-6560>
|
|
3539
|
+
*/
|
|
3540
|
+
declare const OakDialogFooter: ({ layout, children }: OakDialogFooterProps) => React__default.JSX.Element;
|
|
3541
|
+
|
|
3542
|
+
type OakModalPosition = "fullscreen" | "left" | "right" | "top" | "bottom";
|
|
3543
|
+
/**
|
|
3544
|
+
* `close_button` when the close button was used, otherwise `undefined`
|
|
3545
|
+
* (Escape key or backdrop click)
|
|
3546
|
+
*/
|
|
3547
|
+
type OakModalCloseAction = "close_button" | undefined;
|
|
3548
|
+
type OakModalProps = {
|
|
3549
|
+
/**
|
|
3550
|
+
* Whether the modal is open
|
|
3551
|
+
*/
|
|
3552
|
+
isOpen: boolean;
|
|
3553
|
+
/**
|
|
3554
|
+
* Called when the user closes the modal with the close button,
|
|
3555
|
+
* the Escape key or a backdrop click.
|
|
3556
|
+
*
|
|
3557
|
+
* Receives `"close_button"` when the close button was used, e.g. for tracking.
|
|
3558
|
+
*/
|
|
3559
|
+
onClose: (action?: OakModalCloseAction) => void;
|
|
3560
|
+
/**
|
|
3561
|
+
* Where the modal is placed.
|
|
3562
|
+
*
|
|
3563
|
+
* - `fullscreen` covers the whole page
|
|
3564
|
+
* - `left` / `right` are full-height drawers on that edge
|
|
3565
|
+
* - `top` / `bottom` are full-width drawers on that edge
|
|
3566
|
+
*
|
|
3567
|
+
* Drawers fill the screen on small (mobile) screens.
|
|
3568
|
+
*/
|
|
3569
|
+
position: OakModalPosition;
|
|
3570
|
+
/**
|
|
3571
|
+
* Width of `left` / `right` drawers, or height of `top` / `bottom` drawers.
|
|
3572
|
+
* Capped at the screen size. Ignored for `fullscreen` and on small screens.
|
|
3573
|
+
*
|
|
3574
|
+
* @default spacing-640
|
|
3575
|
+
*/
|
|
3576
|
+
size?: OakAllSpacingToken;
|
|
3577
|
+
/**
|
|
3578
|
+
* The content of the modal. It scrolls when it overflows.
|
|
3579
|
+
* Titles should use `heading-5` or larger.
|
|
3580
|
+
*/
|
|
3581
|
+
children: ReactNode;
|
|
3582
|
+
/**
|
|
3583
|
+
* Content on the left of the header, e.g. a title, logo or action link.
|
|
3584
|
+
* It stays in view when the content scrolls.
|
|
3585
|
+
*/
|
|
3586
|
+
headerSlot?: ReactNode;
|
|
3587
|
+
/**
|
|
3588
|
+
* `inverted` gives a black header with white text and a white close button,
|
|
3589
|
+
* e.g. for a logo and title
|
|
3590
|
+
*
|
|
3591
|
+
* @default default
|
|
3592
|
+
*/
|
|
3593
|
+
headerVariant?: "default" | "inverted";
|
|
3594
|
+
/**
|
|
3595
|
+
* Fixed area at the bottom of the modal. It stays in view when the content scrolls.
|
|
3596
|
+
*
|
|
3597
|
+
* Use `OakModalFooter` for the Figma footer layouts, or pass your own content.
|
|
3598
|
+
*/
|
|
3599
|
+
footerSlot?: ReactNode;
|
|
3600
|
+
/**
|
|
3601
|
+
* Whether to focus the close button on open.
|
|
3602
|
+
* Set to `false` and add `data-autofocus` to another element to focus that instead.
|
|
3603
|
+
*
|
|
3604
|
+
* @default true
|
|
3605
|
+
*/
|
|
3606
|
+
focusCloseButtonOnOpen?: boolean;
|
|
3607
|
+
/**
|
|
3608
|
+
* Id of an element that describes the modal
|
|
3609
|
+
*/
|
|
3610
|
+
"aria-describedby"?: string;
|
|
3611
|
+
/**
|
|
3612
|
+
* The DOM container to render the modal portal into.
|
|
3613
|
+
*
|
|
3614
|
+
* @default document.body
|
|
3615
|
+
*/
|
|
3616
|
+
domContainer?: Element;
|
|
3617
|
+
/**
|
|
3618
|
+
* Optional z-index override.
|
|
3619
|
+
*
|
|
3620
|
+
* Defaults to token: `modal-dialog`
|
|
3621
|
+
*
|
|
3622
|
+
* 🚨 This prop is intended for use by consumers that do not use
|
|
3623
|
+
* the internal system of z-index tokens.
|
|
3624
|
+
*
|
|
3625
|
+
* NB *The modal is rendered inside a portal so it will not respect the stacking context of its parent component*.
|
|
3626
|
+
*/
|
|
3627
|
+
zIndex?: number;
|
|
3628
|
+
/**
|
|
3629
|
+
* Override for the `returnFocus` behaviour of `FocusOn`.
|
|
3630
|
+
*
|
|
3631
|
+
* By default focus returns to the element that was focused before the modal opened.
|
|
3632
|
+
*/
|
|
3633
|
+
returnFocus?: (returnTo: Element) => boolean | FocusOptions;
|
|
3634
|
+
} & InternalModalAccessibleName;
|
|
3635
|
+
/**
|
|
3636
|
+
* A modal for actions or notifications that give critical information related
|
|
3637
|
+
* to a task. Don't use it for marketing or advertising.
|
|
3638
|
+
*
|
|
3639
|
+
* It can be closed with the close button, the Escape key, or by clicking the
|
|
3640
|
+
* backdrop. By default, the close button gets focus when the modal opens.
|
|
3641
|
+
*
|
|
3642
|
+
* To focus a different element instead, set `focusCloseButtonOnOpen={false}` and
|
|
3643
|
+
* add `data-autofocus` to the element you want focused (e.g. an action link).
|
|
3644
|
+
*
|
|
3645
|
+
* An accessible name is required: pass either `aria-label` or `aria-labelledby`.
|
|
3646
|
+
*
|
|
3647
|
+
* Use `OakDialog` instead when the user must make an explicit choice before
|
|
3648
|
+
* returning to the page.
|
|
3649
|
+
*
|
|
3650
|
+
* Design system: <https://www.figma.com/design/YcWQMMhHPVVmc47cHHEEAl/Oak-Design-Kit?node-id=25437-6465>
|
|
3651
|
+
*/
|
|
3652
|
+
declare const OakModal: ({ isOpen, onClose, position, size, children, headerSlot, headerVariant, footerSlot, focusCloseButtonOnOpen, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, domContainer, zIndex, returnFocus, }: OakModalProps) => React__default.JSX.Element;
|
|
3653
|
+
|
|
3654
|
+
type OakModalFooterLayout = InternalModalFooterLayout;
|
|
3655
|
+
type OakModalFooterProps = InternalModalFooterProps;
|
|
3656
|
+
/**
|
|
3657
|
+
* A footer for the `footerSlot` of `OakModal`, in one of the four Figma
|
|
3658
|
+
* footer layouts. You can pass your own content to `footerSlot` instead.
|
|
3659
|
+
*
|
|
3660
|
+
* - `horizontal`: buttons side by side
|
|
3661
|
+
* - `vertical`: buttons stacked
|
|
3662
|
+
* - `left` / `right`: buttons aligned to that side
|
|
3663
|
+
*
|
|
3664
|
+
* For `horizontal` and `vertical`, give each button `width="100%"` so they
|
|
3665
|
+
* fill the footer (sharing it equally when horizontal), as in Figma.
|
|
3666
|
+
*
|
|
3667
|
+
* Design system: <https://www.figma.com/design/YcWQMMhHPVVmc47cHHEEAl/Oak-Design-Kit?node-id=25437-6560>
|
|
3668
|
+
*/
|
|
3669
|
+
declare const OakModalFooter: ({ layout, children }: OakModalFooterProps) => React__default.JSX.Element;
|
|
3670
|
+
|
|
3360
3671
|
type OakTagFunctionalProps = {
|
|
3361
3672
|
label: string;
|
|
3362
3673
|
iconName?: OakIconName;
|
|
@@ -5567,5 +5878,5 @@ declare const useIsScrolled: () => {
|
|
|
5567
5878
|
|
|
5568
5879
|
declare const useBreakpoint: () => Device;
|
|
5569
5880
|
|
|
5570
|
-
export { DropdownContext, HeadingTagComponent, IconDown, IconUp, OakAccordion, OakAnchorTarget, OakBackLink, OakBasicAccordion, OakBox, OakBreadcrumbs, OakBulletList, OakButtonAsRadioGroup, OakButtonWithDropdown, OakButtonWithDropdownProvider, OakCard, OakCardHeader, OakCardWithHandDrawnBorder, OakCarousel, OakCheckBox, OakCloseButton, OakCloudinaryConfigProvider, OakCloudinaryImage, OakCodeRenderer, OakCollapsibleContent, OakCookieBanner, OakCookieConsent, OakCookieConsentContext, OakCookieConsentProvider, OakCookieSettingsModal, OakCopyLinkButton, OakDownloadsJourneyChildSubjectTierSelector, OakDragAndDropInstructions, OakDraggable, OakDraggableFeedback, OakDroppable, OakErrorBoundary, OakErrorBoundaryBorderColor, OakFieldError, OakFieldset, OakFlex, OakFocusIndicator, OakForm, OakFormInput, OakFormInputWithLabels, OakGlobalStyle, OakGrid, OakGridArea, OakHandDrawnCard, OakHandDrawnCardWithIcon, OakHandDrawnFocusUnderline, OakHandDrawnHR, OakHeaderHero, OakHeading, OakHintButton, OakHomepageTabButton, OakHoverLink, OakIcon, OakIconButton, OakImage, OakInfo, OakInfoButton, OakInformativeModal, OakInformativeModalBody, OakInformativeModalBorderColor, OakInformativeModalFooter, OakInlineBanner, OakInlineRegistrationBanner, OakJauntyAngleLabel, OakKbd, OakLI, OakLabel, OakLeftAlignedButton, OakLessonBottomNav, OakLessonInfoCard, OakLessonLayout, OakLessonNavItem, OakLessonReviewIntroVideo, OakLessonReviewItem, OakLessonReviewQuiz, OakLessonTopNav, OakLessonVideoTranscript, OakLink, OakLinkCard, OakListItem, OakLoadingSpinner, OakMaxWidth, OakMediaClip, OakMediaClipList, OakMediaClipListAccordion, OakMediaClipStackListItem, OakModalCenter, OakModalCenterBody, OakMultilineText, OakOL, OakOptGroup, OakOption, OakOutlineAccordion, OakP, OakPagination, OakPrimaryButton, OakPrimaryInvertedButton, OakPrimaryNav, OakPrimaryNavItem, OakPromoTag, OakPupilJourneyContentGuidance, OakPupilJourneyHeader, OakPupilJourneyLayout, OakPupilJourneyList, OakPupilJourneyListCounter, OakPupilJourneyListItem, OakPupilJourneyListItemSubheading, OakPupilJourneyOptionalityButton, OakPupilJourneyOptionalityItem, OakPupilJourneyProgrammeOptions, OakPupilJourneyUnitsFilter, OakPupilJourneyYearButton, OakQuizCheckBox, OakQuizCounter, OakQuizFeedback, OakQuizHint, OakQuizMatch, OakQuizMatchItemId, OakQuizOrder, OakQuizOrderitemId, OakQuizPrintableHeader, OakQuizPrintableSubHeader, OakQuizRadioButton, OakQuizResultItem, OakQuizTextInput, OakQuote, OakRadioAsButton, OakRadioButton, OakRadioGroup, OakResourceCard, OakResourcesAccordion, OakRoundIcon, OakSaveCount, OakScaleImageButton, OakScreenReader, OakSearchFilterCheckBox, OakSecondaryButton, OakSecondaryButtonAsRadio, OakSecondaryButtonWithDropdown, OakSecondaryLink, OakSelect, OakSideMenuNav, OakSideMenuNavLink, OakSignLanguageButton, OakSmallPrimaryButton, OakSmallPrimaryInvertedButton, OakSmallSecondaryButton, OakSmallSecondaryButtonWithDropdown, OakSmallSecondaryToggleButton, OakSmallTertiaryInvertedButton, OakSpan, OakStaticMessageCard, OakSubjectIcon, OakSubjectIconButton, OakSvg, OakTabs, OakTagFunctional, OakTeacherNotesInline, OakTeacherNotesModal, OakTertiaryButton, OakTertiaryInvertedButton, OakTertiaryOLNav, OakTextArea, OakTextInput, OakThemeProvider, OakTimer, OakToast, OakTooltip, OakTypography, OakUL, OakUnitListItem, OakUnitListOptionalityItem, OakVideo, OakVideoTranscript, RadioContext, ReviewItemContainer, ReviewItemTitleSection, StyledMediaClipImage, UnstyledChevronAccordion, announcements, bannerTypes, bannerVariants, colorSchemes, formatTimeCode, generateOakIconURL, getBackgroundUrlForSection, getBreakpoint, getDefaultContextState, getMediaQuery, installMockIntersectionObserver, installMockResizeObserver, isValidIconName, lessonSectionNames, oakAllSpacingTokens, oakBorderRadiusTokens, oakBorderWidthTokens, oakBoxCss, oakColorTokens, oakDarkTheme, oakDefaultTheme, oakDropShadowTokens, oakFlexCss, oakFontSizeTokens, oakFontTokens, oakHeadingTags, oakIconNames, oakLIDefaults, oakOpacityTokens, oakPlaceholder, oakSpaceBetweenTokens, oakTransitionTokens, oakUiRoleTokens, oakZIndexTokens, parseBorder, parseBorderRadius, parseBorderWidth, parseColor, parseColorFilter, parseDropShadow, parseFontSize, parseFontWeight, parseLetterSpacing, parseLineHeight, parseOpacity, parseSpacing, parseTransitions, parseZIndex, placeholderStyles, removedGuidanceDuplicates, responsiveStyle, rgbToHex, useBreakpoint, useCookieConsent, useDevice, useDropdownContext, useIsScrolled, useMediaQuery, useMounted };
|
|
5571
|
-
export type { BannerTypes, BreakpointName, Consent, Device, InternalQuizResultItemProps, LessonSectionName$1 as LessonSectionName, MenuItemProps, OakAccordionProps, OakAllSpacingToken, OakAnchorTargetProps, OakBackLinkProps, OakBasicAccordionProps, OakBorderRadiusToken, OakBorderWidthToken, OakBoxProps, OakBreadcrumb, OakBreadcrumbWithoutHref, OakBreadcrumbsProps, OakBulletListProps, OakButtonWithDropdownProps, OakCardHeaderprops, OakCardProps, OakCardWithHandDrawnBorderProps, OakCarouselProps, OakCheckBoxProps, OakCloseButtonProps, OakCloudinaryImageProps, OakCodeRendererProps, OakCollapsibleContentProps, OakColorFilterToken, OakColorToken, OakCombinedSpacingToken, OakCookieBannerProps, OakCookieConsentProps, OakCookieSettingsModalProps, OakDownloadsJourneyChildSubjectTierSelectorProps, OakDropShadowToken, OakDroppableProps, OakErrorBoundaryCloseAction, OakErrorBoundaryProps, OakFieldErrorProps, OakFieldsetProps, OakFlexProps, OakFocusIndicatorProps, OakFontSizeToken, OakFontToken, OakFormInputProps, OakFormInputWithLabelsProps, OakFormProps, OakGridAreaProps, OakGridProps, OakHandDrawnBoxWithIconProps, OakHandDrawnCardProps, OakHandDrawnFocusUnderlineProps, OakHandDrawnHRProps, OakHeaderHeroProps, OakHeadingProps, OakHeadingTag, OakHintButtonProps, OakHomepageTabButtonProps, OakHoverLinkProps, OakIconButtonProps, OakIconName, OakIconProps, OakImageProps, OakInfoButtonProps, OakInfoCardProps, OakInfoProps, OakInformativeModalBodyProps, OakInformativeModalCloseAction, OakInformativeModalFooterProps, OakInformativeModalProps, OakInlineBannerProps, OakInlineBannerTypes, OakInlineBannerVariantProps, OakInlineBannerVariants, OakInlineRegistrationBannerProps, OakJauntyAngleLabelProps, OakKbdProps, OakLIProps, OakLabelProps, OakLeftAlignedButtonProps, OakLessonBottomNavProps, OakLessonLayoutProps, OakLessonNavItemProps, OakLessonReviewIntroVideoProps, OakLessonReviewItemProps, OakLessonTopNavProps, OakLinkCardProps, OakLinkProps, OakListItemProps, OakLoadingSpinnerProps, OakMediaClipListProps, OakMediaClipProps, OakMediaClipStackListItemProps, OakModalCenterBodyProps, OakModalCenterProps, OakMultilineTextProps, OakOLProps, OakOpacityToken, OakOptGroupProps, OakOptionProps, OakOutlineAccordionProps, OakPProps, OakPaginationProps, OakPrimaryButtonProps, OakPrimaryInvertedButtonProps, OakPrimaryNavItemProps, OakPrimaryNavProps, OakPromoTagProps, OakPupilContentGuidance, OakPupilJourneyContentGuidanceProps, OakPupilJourneyHeaderProps, OakPupilJourneyLayoutProps, OakPupilJourneyListItemSubheadingProps, OakPupilJourneyListProps, OakPupilJourneyOptionalityItemProps, OakPupilJourneyProgrammeOptionsProps, OakPupilJourneyUnitsFilterProps, OakPupilJourneyYearButtonProps, OakQuizCheckBoxProps, OakQuizCounterProps, OakQuizFeedbackProps, OakQuizHintProps, OakQuizMatchProps, OakQuizOrderProps, OakQuizPrintableHeaderProps, OakQuizPrintableSubHeaderProps, OakQuizRadioButtonProps, OakQuoteProps, OakRadioAsButtonProps, OakRadioGroupProps, OakResourceCardProps, OakResourcesAccordionProps, OakRoundIconProps, OakSaveCountProps, OakScaleImageButtonProps, OakSearchFilterCheckBoxProps, OakSecondaryButtonAsRadioProps, OakSecondaryButtonProps, OakSecondaryButtonWithDropdownProps, OakSecondaryLinkProps, OakSelectProps, OakSideMenuNavLinkProps, OakSideMenuNavProps, OakSmallPrimaryButtonProps, OakSmallPrimaryInvertedButtonProps, OakSmallSecondaryButtonProps, OakSmallSecondaryButtonWithDropdownProps, OakSmallSecondaryToggleButtonProps, OakSmallTertiaryInvertedButtonProps, OakSolidBorderAccordionProps, OakSpaceBetweenToken, OakSpanProps, OakSubjectIconButtonProps, OakSubjectIconProps, OakSvgNames, OakSvgProps, OakTabsProps, OakTagFunctionalProps, OakTeacherNotesInlineProps, OakTeacherNotesModalProps, OakTertiaryOLNavProps, OakTextAreaProps, OakTextInputProps, OakTheme, OakThemeProviderProps, OakTimerProps, OakToastProps, OakTooltipProps, OakTransitionToken, OakTypographyProps, OakULProps, OakUiRoleToken, OakUnitListItemProps, OakUnitListOptionalityItemProps, OakVideoProps, OakZIndexToken, Phase$1 as Phase, PolicyConsent, PupilJourneySectionName, StyledImageProps, Subject, Tier, UnstyledChevronAccordionProps };
|
|
5881
|
+
export { DropdownContext, HeadingTagComponent, IconDown, IconUp, OakAccordion, OakAnchorTarget, OakBackLink, OakBasicAccordion, OakBox, OakBreadcrumbs, OakBulletList, OakButtonAsRadioGroup, OakButtonWithDropdown, OakButtonWithDropdownProvider, OakCard, OakCardHeader, OakCardWithHandDrawnBorder, OakCarousel, OakCheckBox, OakCloseButton, OakCloudinaryConfigProvider, OakCloudinaryImage, OakCodeRenderer, OakCollapsibleContent, OakCookieBanner, OakCookieConsent, OakCookieConsentContext, OakCookieConsentProvider, OakCookieSettingsModal, OakCopyLinkButton, OakDialog, OakDialogFooter, OakDownloadsJourneyChildSubjectTierSelector, OakDragAndDropInstructions, OakDraggable, OakDraggableFeedback, OakDroppable, OakErrorBoundary, OakErrorBoundaryBorderColor, OakFieldError, OakFieldset, OakFlex, OakFocusIndicator, OakForm, OakFormInput, OakFormInputWithLabels, OakGlobalStyle, OakGrid, OakGridArea, OakHandDrawnCard, OakHandDrawnCardWithIcon, OakHandDrawnFocusUnderline, OakHandDrawnHR, OakHeaderHero, OakHeading, OakHintButton, OakHomepageTabButton, OakHoverLink, OakIcon, OakIconButton, OakImage, OakInfo, OakInfoButton, OakInformativeModal, OakInformativeModalBody, OakInformativeModalBorderColor, OakInformativeModalFooter, OakInlineBanner, OakInlineRegistrationBanner, OakJauntyAngleLabel, OakKbd, OakLI, OakLabel, OakLeftAlignedButton, OakLessonBottomNav, OakLessonInfoCard, OakLessonLayout, OakLessonNavItem, OakLessonReviewIntroVideo, OakLessonReviewItem, OakLessonReviewQuiz, OakLessonTopNav, OakLessonVideoTranscript, OakLink, OakLinkCard, OakListItem, OakLoadingSpinner, OakMaxWidth, OakMediaClip, OakMediaClipList, OakMediaClipListAccordion, OakMediaClipStackListItem, OakModal, OakModalCenter, OakModalCenterBody, OakModalFooter, OakMultilineText, OakOL, OakOptGroup, OakOption, OakOutlineAccordion, OakP, OakPagination, OakPrimaryButton, OakPrimaryInvertedButton, OakPrimaryNav, OakPrimaryNavItem, OakPromoTag, OakPupilJourneyContentGuidance, OakPupilJourneyHeader, OakPupilJourneyLayout, OakPupilJourneyList, OakPupilJourneyListCounter, OakPupilJourneyListItem, OakPupilJourneyListItemSubheading, OakPupilJourneyOptionalityButton, OakPupilJourneyOptionalityItem, OakPupilJourneyProgrammeOptions, OakPupilJourneyUnitsFilter, OakPupilJourneyYearButton, OakQuizCheckBox, OakQuizCounter, OakQuizFeedback, OakQuizHint, OakQuizMatch, OakQuizMatchItemId, OakQuizOrder, OakQuizOrderitemId, OakQuizPrintableHeader, OakQuizPrintableSubHeader, OakQuizRadioButton, OakQuizResultItem, OakQuizTextInput, OakQuote, OakRadioAsButton, OakRadioButton, OakRadioGroup, OakResourceCard, OakResourcesAccordion, OakRoundIcon, OakSaveCount, OakScaleImageButton, OakScreenReader, OakSearchFilterCheckBox, OakSecondaryButton, OakSecondaryButtonAsRadio, OakSecondaryButtonWithDropdown, OakSecondaryLink, OakSelect, OakSideMenuNav, OakSideMenuNavLink, OakSignLanguageButton, OakSmallPrimaryButton, OakSmallPrimaryInvertedButton, OakSmallSecondaryButton, OakSmallSecondaryButtonWithDropdown, OakSmallSecondaryToggleButton, OakSmallTertiaryInvertedButton, OakSpan, OakStaticMessageCard, OakSubjectIcon, OakSubjectIconButton, OakSvg, OakTabs, OakTagFunctional, OakTeacherNotesInline, OakTeacherNotesModal, OakTertiaryButton, OakTertiaryInvertedButton, OakTertiaryOLNav, OakTextArea, OakTextInput, OakThemeProvider, OakTimer, OakToast, OakTooltip, OakTypography, OakUL, OakUnitListItem, OakUnitListOptionalityItem, OakVideo, OakVideoTranscript, RadioContext, ReviewItemContainer, ReviewItemTitleSection, StyledMediaClipImage, UnstyledChevronAccordion, announcements, bannerTypes, bannerVariants, colorSchemes, formatTimeCode, generateOakIconURL, getBackgroundUrlForSection, getBreakpoint, getDefaultContextState, getMediaQuery, installMockIntersectionObserver, installMockResizeObserver, isValidIconName, lessonSectionNames, oakAllSpacingTokens, oakBorderRadiusTokens, oakBorderWidthTokens, oakBoxCss, oakColorTokens, oakDarkTheme, oakDefaultTheme, oakDropShadowTokens, oakFlexCss, oakFontSizeTokens, oakFontTokens, oakHeadingTags, oakIconNames, oakLIDefaults, oakOpacityTokens, oakPlaceholder, oakSpaceBetweenTokens, oakTransitionTokens, oakUiRoleTokens, oakZIndexTokens, parseBorder, parseBorderRadius, parseBorderWidth, parseColor, parseColorFilter, parseDropShadow, parseFontSize, parseFontWeight, parseLetterSpacing, parseLineHeight, parseOpacity, parseSpacing, parseTransitions, parseZIndex, placeholderStyles, removedGuidanceDuplicates, responsiveStyle, rgbToHex, useBreakpoint, useCookieConsent, useDevice, useDropdownContext, useIsScrolled, useMediaQuery, useMounted };
|
|
5882
|
+
export type { BannerTypes, BreakpointName, Consent, Device, InternalQuizResultItemProps, LessonSectionName$1 as LessonSectionName, MenuItemProps, OakAccordionProps, OakAllSpacingToken, OakAnchorTargetProps, OakBackLinkProps, OakBasicAccordionProps, OakBorderRadiusToken, OakBorderWidthToken, OakBoxProps, OakBreadcrumb, OakBreadcrumbWithoutHref, OakBreadcrumbsProps, OakBulletListProps, OakButtonWithDropdownProps, OakCardHeaderprops, OakCardProps, OakCardWithHandDrawnBorderProps, OakCarouselProps, OakCheckBoxProps, OakCloseButtonProps, OakCloudinaryImageProps, OakCodeRendererProps, OakCollapsibleContentProps, OakColorFilterToken, OakColorToken, OakCombinedSpacingToken, OakCookieBannerProps, OakCookieConsentProps, OakCookieSettingsModalProps, OakDialogFooterLayout, OakDialogFooterProps, OakDialogProps, OakDownloadsJourneyChildSubjectTierSelectorProps, OakDropShadowToken, OakDroppableProps, OakErrorBoundaryCloseAction, OakErrorBoundaryProps, OakFieldErrorProps, OakFieldsetProps, OakFlexProps, OakFocusIndicatorProps, OakFontSizeToken, OakFontToken, OakFormInputProps, OakFormInputWithLabelsProps, OakFormProps, OakGridAreaProps, OakGridProps, OakHandDrawnBoxWithIconProps, OakHandDrawnCardProps, OakHandDrawnFocusUnderlineProps, OakHandDrawnHRProps, OakHeaderHeroProps, OakHeadingProps, OakHeadingTag, OakHintButtonProps, OakHomepageTabButtonProps, OakHoverLinkProps, OakIconButtonProps, OakIconName, OakIconProps, OakImageProps, OakInfoButtonProps, OakInfoCardProps, OakInfoProps, OakInformativeModalBodyProps, OakInformativeModalCloseAction, OakInformativeModalFooterProps, OakInformativeModalProps, OakInlineBannerProps, OakInlineBannerTypes, OakInlineBannerVariantProps, OakInlineBannerVariants, OakInlineRegistrationBannerProps, OakJauntyAngleLabelProps, OakKbdProps, OakLIProps, OakLabelProps, OakLeftAlignedButtonProps, OakLessonBottomNavProps, OakLessonLayoutProps, OakLessonNavItemProps, OakLessonReviewIntroVideoProps, OakLessonReviewItemProps, OakLessonTopNavProps, OakLinkCardProps, OakLinkProps, OakListItemProps, OakLoadingSpinnerProps, OakMediaClipListProps, OakMediaClipProps, OakMediaClipStackListItemProps, OakModalCenterBodyProps, OakModalCenterProps, OakModalCloseAction, OakModalFooterLayout, OakModalFooterProps, OakModalPosition, OakModalProps, OakMultilineTextProps, OakOLProps, OakOpacityToken, OakOptGroupProps, OakOptionProps, OakOutlineAccordionProps, OakPProps, OakPaginationProps, OakPrimaryButtonProps, OakPrimaryInvertedButtonProps, OakPrimaryNavItemProps, OakPrimaryNavProps, OakPromoTagProps, OakPupilContentGuidance, OakPupilJourneyContentGuidanceProps, OakPupilJourneyHeaderProps, OakPupilJourneyLayoutProps, OakPupilJourneyListItemSubheadingProps, OakPupilJourneyListProps, OakPupilJourneyOptionalityItemProps, OakPupilJourneyProgrammeOptionsProps, OakPupilJourneyUnitsFilterProps, OakPupilJourneyYearButtonProps, OakQuizCheckBoxProps, OakQuizCounterProps, OakQuizFeedbackProps, OakQuizHintProps, OakQuizMatchProps, OakQuizOrderProps, OakQuizPrintableHeaderProps, OakQuizPrintableSubHeaderProps, OakQuizRadioButtonProps, OakQuoteProps, OakRadioAsButtonProps, OakRadioGroupProps, OakResourceCardProps, OakResourcesAccordionProps, OakRoundIconProps, OakSaveCountProps, OakScaleImageButtonProps, OakSearchFilterCheckBoxProps, OakSecondaryButtonAsRadioProps, OakSecondaryButtonProps, OakSecondaryButtonWithDropdownProps, OakSecondaryLinkProps, OakSelectProps, OakSideMenuNavLinkProps, OakSideMenuNavProps, OakSmallPrimaryButtonProps, OakSmallPrimaryInvertedButtonProps, OakSmallSecondaryButtonProps, OakSmallSecondaryButtonWithDropdownProps, OakSmallSecondaryToggleButtonProps, OakSmallTertiaryInvertedButtonProps, OakSolidBorderAccordionProps, OakSpaceBetweenToken, OakSpanProps, OakSubjectIconButtonProps, OakSubjectIconProps, OakSvgNames, OakSvgProps, OakTabsProps, OakTagFunctionalProps, OakTeacherNotesInlineProps, OakTeacherNotesModalProps, OakTertiaryOLNavProps, OakTextAreaProps, OakTextInputProps, OakTheme, OakThemeProviderProps, OakTimerProps, OakToastProps, OakTooltipProps, OakTransitionToken, OakTypographyProps, OakULProps, OakUiRoleToken, OakUnitListItemProps, OakUnitListOptionalityItemProps, OakVideoProps, OakZIndexToken, Phase$1 as Phase, PolicyConsent, PupilJourneySectionName, StyledImageProps, Subject, Tier, UnstyledChevronAccordionProps };
|
|
@@ -2,6 +2,10 @@ import { __rest, __assign } from 'tslib';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { InternalShadowRoundButton } from '../../internal-components/InternalShadowRoundButton/InternalShadowRoundButton.js';
|
|
4
4
|
|
|
5
|
+
var variantColours = {
|
|
6
|
+
default: { icon: "icon-primary", hoverBackground: "bg-neutral" },
|
|
7
|
+
inverted: { icon: "icon-inverted", hoverBackground: "bg-btn-primary-hover" },
|
|
8
|
+
};
|
|
5
9
|
/**
|
|
6
10
|
*
|
|
7
11
|
* An icon button that can be used for closing items such as in navigation menus and modals.
|
|
@@ -11,8 +15,9 @@ import { InternalShadowRoundButton } from '../../internal-components/InternalSha
|
|
|
11
15
|
*
|
|
12
16
|
*/
|
|
13
17
|
function OakCloseButton(_a) {
|
|
14
|
-
var onClose = _a.onClose, rest = __rest(_a, ["onClose"]);
|
|
15
|
-
|
|
18
|
+
var onClose = _a.onClose, _b = _a.size, size = _b === void 0 ? "spacing-24" : _b, _c = _a.variant, variant = _c === void 0 ? "default" : _c, rest = __rest(_a, ["onClose", "size", "variant"]);
|
|
19
|
+
var colours = variantColours[variant];
|
|
20
|
+
return (React.createElement(InternalShadowRoundButton, __assign({ onClick: onClose, "aria-label": "Close", defaultIconBackground: "transparent", defaultIconColor: colours.icon, defaultTextColor: "transparent", hoverTextColor: "transparent", disabledTextColor: "transparent", hoverIconBackground: colours.hoverBackground, hoverIconColor: colours.icon, disabledIconBackground: "transparent", iconBackgroundSize: size, iconSize: size, iconName: "cross", hoverDropShadow: null }, rest)));
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
export { OakCloseButton };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { __makeTemplateObject, __read } from 'tslib';
|
|
2
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { FocusOn } from 'react-focus-on';
|
|
5
|
+
import { Transition } from 'react-transition-group';
|
|
6
|
+
import styled, { css } from 'styled-components';
|
|
7
|
+
import { OakBox } from '../../layout-and-structure/OakBox/OakBox.js';
|
|
8
|
+
import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
|
|
9
|
+
import { useMounted } from '../../../hooks/useMounted.js';
|
|
10
|
+
import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
|
|
11
|
+
import { getMediaQuery } from '../../../styles/utils/responsiveStyle.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* How long the fade in and out takes. Matches the `standard-ease` transition token.
|
|
15
|
+
*/
|
|
16
|
+
var FADE_DURATION = 300;
|
|
17
|
+
/**
|
|
18
|
+
* Space kept around a `centre` panel when the screen is smaller than the panel
|
|
19
|
+
*/
|
|
20
|
+
var CENTRE_GAP = "spacing-20";
|
|
21
|
+
/**
|
|
22
|
+
* Offset for pinning the panel to the screen edges
|
|
23
|
+
*/
|
|
24
|
+
var EDGE = parseSpacing("spacing-0");
|
|
25
|
+
var isDrawer = function (placement) {
|
|
26
|
+
return placement !== "fullscreen" && placement !== "centre";
|
|
27
|
+
};
|
|
28
|
+
var placementCss = function (_a) {
|
|
29
|
+
var $placement = _a.$placement, $panelWidth = _a.$panelWidth, $panelHeight = _a.$panelHeight;
|
|
30
|
+
var gap = parseSpacing(CENTRE_GAP);
|
|
31
|
+
var screenMinusGaps = "calc(100% - ".concat(gap, " - ").concat(gap, ")");
|
|
32
|
+
switch ($placement) {
|
|
33
|
+
case "fullscreen":
|
|
34
|
+
// `inset` rather than `100vh` so mobile browser chrome doesn't crop the panel
|
|
35
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n inset: ", ";\n "], ["\n inset: ", ";\n "])), EDGE);
|
|
36
|
+
case "centre":
|
|
37
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n inset: ", ";\n margin: auto;\n width: ", ";\n height: fit-content;\n max-width: ", ";\n max-height: ", ";\n "], ["\n inset: ", ";\n margin: auto;\n width: ", ";\n height: fit-content;\n max-width: ", ";\n max-height: ", ";\n "])), EDGE, parseSpacing($panelWidth), screenMinusGaps, "min(".concat(parseSpacing($panelHeight), ", ").concat(screenMinusGaps, ")"));
|
|
38
|
+
case "left":
|
|
39
|
+
case "right":
|
|
40
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n top: ", ";\n bottom: ", ";\n ", ": ", ";\n width: ", ";\n max-width: 100%;\n "], ["\n top: ", ";\n bottom: ", ";\n ", ": ", ";\n width: ", ";\n max-width: 100%;\n "])), EDGE, EDGE, $placement, EDGE, parseSpacing($panelWidth));
|
|
41
|
+
case "top":
|
|
42
|
+
case "bottom":
|
|
43
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n left: ", ";\n right: ", ";\n ", ": ", ";\n height: ", ";\n max-height: 100%;\n "], ["\n left: ", ";\n right: ", ";\n ", ": ", ";\n height: ", ";\n max-height: 100%;\n "])), EDGE, EDGE, $placement, EDGE, parseSpacing($panelHeight));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
// Drawers are too cramped on small screens so they fill the screen instead
|
|
47
|
+
var smallScreenCss = function (_a) {
|
|
48
|
+
var $placement = _a.$placement;
|
|
49
|
+
return isDrawer($placement) && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n @media ", " {\n inset: ", ";\n width: auto;\n height: auto;\n max-width: none;\n max-height: none;\n }\n "], ["\n @media ", " {\n inset: ", ";\n width: auto;\n height: auto;\n max-width: none;\n max-height: none;\n }\n "])), getMediaQuery("mobile"), EDGE);
|
|
50
|
+
};
|
|
51
|
+
var Panel = styled(OakFlex)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: fixed;\n overflow: clip;\n ", "\n ", "\n"], ["\n position: fixed;\n overflow: clip;\n ", "\n ", "\n"])), placementCss, smallScreenCss);
|
|
52
|
+
// Fades the backdrop and panel in and out together
|
|
53
|
+
var Fade = styled(OakBox)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n opacity: ", ";\n"], ["\n opacity: ", ";\n"])), function (_a) {
|
|
54
|
+
var $state = _a.$state;
|
|
55
|
+
return $state === "entering" || $state === "entered" ? 1 : 0;
|
|
56
|
+
});
|
|
57
|
+
var Backdrop = styled(OakBox)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
58
|
+
var $hideOnSmallScreen = _a.$hideOnSmallScreen;
|
|
59
|
+
return $hideOnSmallScreen && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n @media ", " {\n display: none;\n }\n "], ["\n @media ", " {\n display: none;\n }\n "])), getMediaQuery("mobile"));
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Shared behaviour for `OakModal` and `OakDialog`.
|
|
63
|
+
*
|
|
64
|
+
* - Portals into `document.body` (or `domContainer`) once mounted on the client
|
|
65
|
+
* - Traps focus, locks body scroll and returns focus to the trigger on close
|
|
66
|
+
* - Fades in and out with the `standard-ease` transition
|
|
67
|
+
* - Shows a backdrop behind every placement except `fullscreen`
|
|
68
|
+
* - Caps the panel at the screen size, and shows drawers fullscreen on small screens
|
|
69
|
+
* - Makes the content focusable when it scrolls so keyboard users can scroll it
|
|
70
|
+
*/
|
|
71
|
+
var InternalModalBase = function (_a) {
|
|
72
|
+
var isOpen = _a.isOpen, placement = _a.placement, onDismiss = _a.onDismiss, _b = _a.width, width = _b === void 0 ? "spacing-640" : _b, _c = _a.height, height = _c === void 0 ? "spacing-640" : _c, _d = _a.role, role = _d === void 0 ? "dialog" : _d, borderRadius = _a.borderRadius, header = _a.header, children = _a.children, footerSlot = _a.footerSlot, _e = _a.autoFocusContent, autoFocusContent = _e === void 0 ? false : _e, ariaLabel = _a["aria-label"], ariaLabelledBy = _a["aria-labelledby"], ariaDescribedBy = _a["aria-describedby"], domContainer = _a.domContainer, zIndex = _a.zIndex, returnFocus = _a.returnFocus;
|
|
73
|
+
// `createPortal` is not supported in SSR so we only render once mounted on the client
|
|
74
|
+
var isMounted = useMounted();
|
|
75
|
+
var fadeRef = useRef(null);
|
|
76
|
+
var contentRef = useRef(null);
|
|
77
|
+
var contentInnerRef = useRef(null);
|
|
78
|
+
var _f = __read(useState(false), 2), isScrollable = _f[0], setIsScrollable = _f[1];
|
|
79
|
+
// Shows a line at the top of the content once it is scrolled,
|
|
80
|
+
var _g = __read(useState(false), 2), isScrolled = _g[0], setIsScrolled = _g[1];
|
|
81
|
+
useEffect(function () {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
// Let keyboard users scroll the content when it overflows
|
|
84
|
+
var checkIsScrollable = function () {
|
|
85
|
+
var content = contentRef.current;
|
|
86
|
+
setIsScrollable(!!content && content.scrollHeight > content.clientHeight);
|
|
87
|
+
};
|
|
88
|
+
checkIsScrollable();
|
|
89
|
+
// Reset the line when the modal reopens, as its content starts at the top
|
|
90
|
+
setIsScrolled(((_b = (_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.scrollTop) !== null && _b !== void 0 ? _b : 0) > 0);
|
|
91
|
+
// Re-check whenever the scroll area or its content changes size, e.g. the
|
|
92
|
+
// window resizes, images load, an accordion opens or a child adds content
|
|
93
|
+
var content = contentRef.current;
|
|
94
|
+
var contentInner = contentInnerRef.current;
|
|
95
|
+
if (!content || !contentInner || typeof ResizeObserver === "undefined") {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
var resizeObserver = new ResizeObserver(checkIsScrollable);
|
|
99
|
+
resizeObserver.observe(content);
|
|
100
|
+
resizeObserver.observe(contentInner);
|
|
101
|
+
return function () { return resizeObserver.disconnect(); };
|
|
102
|
+
}, [isOpen, isMounted]);
|
|
103
|
+
if (!isMounted) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
var finalZIndex = zIndex !== null && zIndex !== void 0 ? zIndex : "modal-dialog";
|
|
107
|
+
// Rounded corners would clip a scrollbar at the panel's edge, so the centred
|
|
108
|
+
// panel's scrolling area is moved 8px in from the edges, as in Figma. Its
|
|
109
|
+
// padding is 8px smaller to match, so the content stays 56px / 64px from the edges.
|
|
110
|
+
var isCentre = placement === "centre";
|
|
111
|
+
var contentTabIndex;
|
|
112
|
+
if (isScrollable) {
|
|
113
|
+
contentTabIndex = 0; // users can Tab to it to scroll
|
|
114
|
+
}
|
|
115
|
+
else if (autoFocusContent) {
|
|
116
|
+
contentTabIndex = -1; // the Dialog can focus it on open, but Tab skips it
|
|
117
|
+
}
|
|
118
|
+
return createPortal(React.createElement(Transition, { in: isOpen, nodeRef: fadeRef, timeout: FADE_DURATION, appear: true, mountOnEnter: true, unmountOnExit: true }, function (state) { return (React.createElement(Fade, { ref: fadeRef, "$state": state, "$position": "relative", "$zIndex": finalZIndex, "$transition": "standard-ease", "data-testid": "modal-root" },
|
|
119
|
+
placement !== "fullscreen" && (React.createElement(Backdrop, { "$hideOnSmallScreen": isDrawer(placement), "$position": "fixed", "$inset": "spacing-0", "$background": "bg-inverted-semi-transparent", "data-testid": "modal-backdrop" })),
|
|
120
|
+
React.createElement(FocusOn
|
|
121
|
+
// Only while open, so a closing modal can't be dismissed twice
|
|
122
|
+
, {
|
|
123
|
+
// Only while open, so a closing modal can't be dismissed twice
|
|
124
|
+
onEscapeKey: isOpen ? onDismiss : undefined, onClickOutside: isOpen ? onDismiss : undefined, returnFocus: returnFocus !== null && returnFocus !== void 0 ? returnFocus : true, autoFocus: true, preventScrollOnFocus: true },
|
|
125
|
+
React.createElement(Panel, { "$placement": placement, "$panelWidth": width, "$panelHeight": height, "$flexDirection": "column", "$background": "bg-primary", "$color": "text-primary", "$dropShadow": "drop-shadow-centred-standard", "$borderRadius": borderRadius, role: role, "aria-modal": true, "aria-label": ariaLabelledBy ? undefined : ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy },
|
|
126
|
+
header && React.createElement(OakFlex, { "$flexShrink": 0 }, header),
|
|
127
|
+
React.createElement(OakFlex, { ref: contentRef, "$flexDirection": "column", "$flexGrow": 1, "$minHeight": "spacing-0", "$overflow": "auto", "$ma": isCentre ? "spacing-8" : undefined, "$bt": "border-solid-s", "$borderColor": isScrolled ? "border-neutral-lighter" : "transparent", onScroll: function (e) {
|
|
128
|
+
return setIsScrolled(e.currentTarget.scrollTop > 0);
|
|
129
|
+
},
|
|
130
|
+
// Stops the content shifting sideways when a scrollbar appears
|
|
131
|
+
style: { scrollbarGutter: "stable" }, tabIndex: contentTabIndex, "data-autofocus": autoFocusContent || undefined, "data-testid": "modal-content" },
|
|
132
|
+
React.createElement(OakFlex, { ref: contentInnerRef, "$flexDirection": "column", "$pv": isCentre ? "spacing-48" : "spacing-56", "$ph": isCentre
|
|
133
|
+
? ["spacing-16", "spacing-56", "spacing-56"]
|
|
134
|
+
: ["spacing-24", "spacing-64", "spacing-64"], "data-testid": "modal-content-inner" }, children)),
|
|
135
|
+
footerSlot && (React.createElement(OakFlex, { "$flexShrink": 0, "$flexDirection": "column" }, footerSlot)))))); }), domContainer !== null && domContainer !== void 0 ? domContainer : document.body);
|
|
136
|
+
};
|
|
137
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
138
|
+
|
|
139
|
+
export { InternalModalBase };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The Figma footer layouts shared by `OakModalFooter` and `OakDialogFooter`.
|
|
6
|
+
*
|
|
7
|
+
* Renders a `div`, not a `<footer>`: inside a dialog a `<footer>` would
|
|
8
|
+
* become an extra `contentinfo` landmark.
|
|
9
|
+
*
|
|
10
|
+
* Design system: <https://www.figma.com/design/YcWQMMhHPVVmc47cHHEEAl/Oak-Design-Kit?node-id=25437-6560>
|
|
11
|
+
*/
|
|
12
|
+
var InternalModalFooter = function (_a) {
|
|
13
|
+
var layout = _a.layout, children = _a.children;
|
|
14
|
+
return (React.createElement(OakFlex, { "$flexDirection": layout === "vertical" ? "column" : "row", "$justifyContent": layout === "right" ? "flex-end" : "flex-start", "$gap": "spacing-24", "$pa": "spacing-16", "$bt": "border-solid-s", "$borderColor": "border-neutral-lighter" }, children));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { InternalModalFooter };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InternalModalBase } from '../../internal-components/InternalModalBase/InternalModalBase.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A centred dialog that requires an explicit choice, e.g. acknowledging a
|
|
6
|
+
* content guidance warning.
|
|
7
|
+
*
|
|
8
|
+
* - **Can't be dismissed**: no close button, Escape or backdrop click. Close it
|
|
9
|
+
* by setting `isOpen` to `false`.
|
|
10
|
+
* - **Focus**: goes to the content on open. To focus a button instead, use
|
|
11
|
+
* `focusContentOnOpen={false}` and `data-autofocus` on the least destructive
|
|
12
|
+
* (or most used) button.
|
|
13
|
+
* - **Name**: `aria-label` or `aria-labelledby` is required.
|
|
14
|
+
*
|
|
15
|
+
* Design system: <https://www.figma.com/design/YcWQMMhHPVVmc47cHHEEAl/Oak-Design-Kit?node-id=25437-6387>
|
|
16
|
+
*/
|
|
17
|
+
var OakDialog = function (_a) {
|
|
18
|
+
var isOpen = _a.isOpen, children = _a.children, footerSlot = _a.footerSlot, _b = _a.focusContentOnOpen, focusContentOnOpen = _b === void 0 ? true : _b, _c = _a.width, width = _c === void 0 ? "spacing-960" : _c, _d = _a.maxHeight, maxHeight = _d === void 0 ? "spacing-640" : _d, ariaLabel = _a["aria-label"], ariaLabelledBy = _a["aria-labelledby"], ariaDescribedBy = _a["aria-describedby"], domContainer = _a.domContainer, zIndex = _a.zIndex, returnFocus = _a.returnFocus;
|
|
19
|
+
return (React.createElement(InternalModalBase, { isOpen: isOpen, placement: "centre", role: "alertdialog", width: width, height: maxHeight, borderRadius: "border-radius-xl", footerSlot: footerSlot, autoFocusContent: focusContentOnOpen, "aria-describedby": ariaDescribedBy, domContainer: domContainer, zIndex: zIndex, returnFocus: returnFocus, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }, children));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { OakDialog };
|