@oaknational/oak-components 3.19.0 → 3.20.1
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 +350 -447
- package/dist/npm/cjs/types.d.ts +2 -96
- package/dist/npm/es/components/messaging-and-feedback/OakErrorBoundary/OakErrorBoundary.js +0 -1
- package/dist/npm/es/components/navigation/OakBreadcrumbs/OakBreadcrumbs.js +0 -1
- package/dist/npm/es/components/owa/pupil/OakUnitListItem/OakUnitListItem.js +0 -1
- package/dist/npm/es/index.js +0 -3
- package/dist/npm/es/types.d.ts +2 -96
- package/package.json +1 -1
- package/dist/npm/es/components/images-and-icons/OakAspectRatio/OakAspectRatio.js +0 -39
- package/dist/npm/es/components/owa/OakFilterDrawer/OakFilterDrawer.js +0 -43
- package/dist/npm/es/components/owa/OakRadioTile/OakRadioTile.js +0 -40
package/dist/npm/cjs/types.d.ts
CHANGED
|
@@ -1490,31 +1490,6 @@ type OakSmallSecondaryButtonProps = Omit<InternalShadowRectButtonProps, "default
|
|
|
1490
1490
|
*/
|
|
1491
1491
|
declare const OakSmallSecondaryButton: <C extends ElementType = "button">({ element, ...rest }: OakSmallSecondaryButtonProps & PolymorphicPropsWithoutRef<C>) => React$1.JSX.Element;
|
|
1492
1492
|
|
|
1493
|
-
declare const oakAllApectRatiosConst: readonly ["7:8", "2:3", "1:1", "3:2", "16:9"];
|
|
1494
|
-
type OakAllApectRatios = (typeof oakAllApectRatiosConst)[number];
|
|
1495
|
-
type OakAspectRatioValues = ResponsiveValues<OakAllApectRatios>;
|
|
1496
|
-
type OakAspectRatioOuterProps = {
|
|
1497
|
-
ratio: OakAspectRatioValues;
|
|
1498
|
-
};
|
|
1499
|
-
type OakAspectRatioProps = {
|
|
1500
|
-
children?: React$1.ReactNode;
|
|
1501
|
-
} & OakAspectRatioOuterProps;
|
|
1502
|
-
/**
|
|
1503
|
-
*
|
|
1504
|
-
* AspectRatio provides a container of fixed aspect ratio
|
|
1505
|
-
*
|
|
1506
|
-
* ⚠️ To be deprecated
|
|
1507
|
-
* @deprecated
|
|
1508
|
-
*
|
|
1509
|
-
* ## Usage
|
|
1510
|
-
* Use this component when you want to ensure a box has a certain aspect ratio.
|
|
1511
|
-
* Wrap with component with <code>position: relative</code> and a width or min-width
|
|
1512
|
-
* The 'ratio' prop is responsive, so you can pass an array e.g. <code>["3:2", "16:9"]</code>
|
|
1513
|
-
* which will result in different aspect ratios on different screen widths.
|
|
1514
|
-
* For an example usage, see the <code>CardImage</code> component.
|
|
1515
|
-
*/
|
|
1516
|
-
declare const OakAspectRatio: FC<OakAspectRatioProps>;
|
|
1517
|
-
|
|
1518
1493
|
/**
|
|
1519
1494
|
* Map of the svg names to the actual svg components
|
|
1520
1495
|
* Only components that are used in the OakSvg component should be added here
|
|
@@ -4538,62 +4513,6 @@ type OakDroppableProps = {
|
|
|
4538
4513
|
*/
|
|
4539
4514
|
declare const OakDroppable: FC<OakDroppableProps & ComponentPropsWithRef<typeof OakFlex>>;
|
|
4540
4515
|
|
|
4541
|
-
type OakFilterDrawerProps = {
|
|
4542
|
-
/**
|
|
4543
|
-
* Called when the clear button is clicked
|
|
4544
|
-
*/
|
|
4545
|
-
clearAllInputs: () => void;
|
|
4546
|
-
/**
|
|
4547
|
-
* The content of the modal.
|
|
4548
|
-
* Use with `<OakModalBody>` for best results.
|
|
4549
|
-
*/
|
|
4550
|
-
children: ReactNode;
|
|
4551
|
-
/**
|
|
4552
|
-
* Slot for the footer of the modal.
|
|
4553
|
-
* Use with `<OakModalFooter>` for best results.
|
|
4554
|
-
*/
|
|
4555
|
-
footerSlot?: ReactNode;
|
|
4556
|
-
/**
|
|
4557
|
-
* Indicates whether the modal is open or closed
|
|
4558
|
-
*/
|
|
4559
|
-
isOpen: boolean;
|
|
4560
|
-
/**
|
|
4561
|
-
* Called when the modal is closed
|
|
4562
|
-
*/
|
|
4563
|
-
onClose: () => void;
|
|
4564
|
-
/**
|
|
4565
|
-
* The DOM container to render the modal portal into.
|
|
4566
|
-
*
|
|
4567
|
-
* @default document.body
|
|
4568
|
-
*/
|
|
4569
|
-
domContainer?: Element;
|
|
4570
|
-
/**
|
|
4571
|
-
* Optional z-index override.
|
|
4572
|
-
*
|
|
4573
|
-
* Defaults to token: `modal-dialog`
|
|
4574
|
-
*
|
|
4575
|
-
* 🚨 This prop is intended for use by consumers that do not use
|
|
4576
|
-
* the internal system of z-index tokens.
|
|
4577
|
-
*
|
|
4578
|
-
* NB *The modal is rendered inside a portal so it will not respect the stacking context of its parent component*.
|
|
4579
|
-
*/
|
|
4580
|
-
zIndex?: number;
|
|
4581
|
-
/**
|
|
4582
|
-
* Whether the modal should be anchored to the left side of the screen.
|
|
4583
|
-
*/
|
|
4584
|
-
isLeftHandSide?: boolean;
|
|
4585
|
-
} & Pick<HTMLAttributes<Element>, "aria-label" | "aria-description" | "aria-labelledby" | "aria-describedby">;
|
|
4586
|
-
/**
|
|
4587
|
-
*
|
|
4588
|
-
* Based on the OakModal component, this component is a filter drawer that slides in from the right side of the screen.
|
|
4589
|
-
* Designed for mobile and tablet devices
|
|
4590
|
-
*
|
|
4591
|
-
* ### Callbacks
|
|
4592
|
-
* clearAllInputs: used to clear filter options
|
|
4593
|
-
*
|
|
4594
|
-
*/
|
|
4595
|
-
declare const OakFilterDrawer: ({ isOpen, domContainer, onClose, zIndex, children, clearAllInputs, footerSlot, ...rest }: OakFilterDrawerProps) => React$1.ReactPortal | null;
|
|
4596
|
-
|
|
4597
4516
|
interface OakFormInputWithLabelsProps {
|
|
4598
4517
|
/**
|
|
4599
4518
|
* The label for the input field.
|
|
@@ -4805,19 +4724,6 @@ type OakOutlineAccordionProps = {
|
|
|
4805
4724
|
*/
|
|
4806
4725
|
declare const OakOutlineAccordion: ({ header, children, id, initialOpen, ...styleProps }: OakOutlineAccordionProps) => React$1.JSX.Element;
|
|
4807
4726
|
|
|
4808
|
-
type TileItem = {
|
|
4809
|
-
id: string;
|
|
4810
|
-
label: string;
|
|
4811
|
-
};
|
|
4812
|
-
declare const isTileItem: (u: unknown) => u is TileItem;
|
|
4813
|
-
type OakRadioTileProps = {
|
|
4814
|
-
tileItem: TileItem;
|
|
4815
|
-
isChecked: boolean;
|
|
4816
|
-
id: string;
|
|
4817
|
-
onChange: (tileItem: TileItem) => void;
|
|
4818
|
-
};
|
|
4819
|
-
declare const OakRadioTile: any;
|
|
4820
|
-
|
|
4821
4727
|
type OakSaveCountProps = {
|
|
4822
4728
|
/**
|
|
4823
4729
|
* The number of saved items.
|
|
@@ -5348,5 +5254,5 @@ declare const useIsScrolled: () => {
|
|
|
5348
5254
|
|
|
5349
5255
|
declare const useBreakpoint: () => Device;
|
|
5350
5256
|
|
|
5351
|
-
export { DropdownContext, HeadingTagComponent, IconDown, IconUp, OakAccordion, OakAnchorTarget,
|
|
5352
|
-
export type { BannerTypes, BreakpointName, Consent, Device, InternalQuizResultItemProps, LessonSectionName$1 as LessonSectionName, MenuItemProps, OakAccordionProps, OakAllSpacingToken, OakAnchorTargetProps,
|
|
5257
|
+
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, 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 };
|
|
5258
|
+
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, 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, Subject, Tier, UnstyledChevronAccordionProps };
|
|
@@ -8,7 +8,6 @@ import '../../layout-and-structure/OakMaxWidth/OakMaxWidth.js';
|
|
|
8
8
|
import '../../layout-and-structure/OakAccordion/OakAccordion.js';
|
|
9
9
|
import '../../internal-components/InternalChevronAccordion/InternalChevronAccordion.js';
|
|
10
10
|
import '../../layout-and-structure/OakCollapsibleContent/OakCollapsibleContent.js';
|
|
11
|
-
import '../../images-and-icons/OakAspectRatio/OakAspectRatio.js';
|
|
12
11
|
import { OakIcon } from '../../images-and-icons/OakIcon/OakIcon.js';
|
|
13
12
|
import '../../images-and-icons/OakImage/OakImage.js';
|
|
14
13
|
import '../../images-and-icons/OakSvg/OakSvg.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __makeTemplateObject, __assign } from 'tslib';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import '../../images-and-icons/OakAspectRatio/OakAspectRatio.js';
|
|
5
4
|
import { OakIcon } from '../../images-and-icons/OakIcon/OakIcon.js';
|
|
6
5
|
import '../../images-and-icons/OakImage/OakImage.js';
|
|
7
6
|
import '../../images-and-icons/OakSvg/OakSvg.js';
|
|
@@ -9,7 +9,6 @@ import { OakBox } from '../../../layout-and-structure/OakBox/OakBox.js';
|
|
|
9
9
|
import { OakSpan } from '../../../typography/OakSpan/OakSpan.js';
|
|
10
10
|
import { parseColor } from '../../../../styles/helpers/parseColor.js';
|
|
11
11
|
import { parseDropShadow } from '../../../../styles/helpers/parseDropShadow.js';
|
|
12
|
-
import '../../../images-and-icons/OakAspectRatio/OakAspectRatio.js';
|
|
13
12
|
import { OakIcon } from '../../../images-and-icons/OakIcon/OakIcon.js';
|
|
14
13
|
import '../../../images-and-icons/OakImage/OakImage.js';
|
|
15
14
|
import '../../../images-and-icons/OakSvg/OakSvg.js';
|
package/dist/npm/es/index.js
CHANGED
|
@@ -38,7 +38,6 @@ export { OakOptGroup } from './components/form-elements/OakSelect/OakOptGroup.js
|
|
|
38
38
|
export { OakTextInput } from './components/form-elements/OakTextInput/OakTextInput.js';
|
|
39
39
|
export { OakRadioAsButton, colorSchemes } from './components/form-elements/OakRadioAsButton/OakRadioAsButton.js';
|
|
40
40
|
export { OakSearchFilterCheckBox } from './components/form-elements/OakSearchFilterCheckBox/OakSearchFilterCheckBox.js';
|
|
41
|
-
export { OakAspectRatio } from './components/images-and-icons/OakAspectRatio/OakAspectRatio.js';
|
|
42
41
|
export { OakIcon } from './components/images-and-icons/OakIcon/OakIcon.js';
|
|
43
42
|
export { OakImage, oakPlaceholder, placeholderStyles } from './components/images-and-icons/OakImage/OakImage.js';
|
|
44
43
|
export { OakSvg } from './components/images-and-icons/OakSvg/OakSvg.js';
|
|
@@ -126,7 +125,6 @@ export { OakDragAndDropInstructions } from './components/owa/OakDragAndDropInstr
|
|
|
126
125
|
export { OakDraggable } from './components/owa/OakDraggable/OakDraggable.js';
|
|
127
126
|
export { OakDraggableFeedback } from './components/owa/OakDraggableFeedback/OakDraggableFeedback.js';
|
|
128
127
|
export { OakDroppable } from './components/owa/OakDroppable/OakDroppable.js';
|
|
129
|
-
export { OakFilterDrawer } from './components/owa/OakFilterDrawer/OakFilterDrawer.js';
|
|
130
128
|
export { OakFormInputWithLabels } from './components/owa/OakFormInputWithLabels/OakFormInputWithLabels.js';
|
|
131
129
|
export { OakHandDrawnCard } from './components/owa/OakHandDrawnCard/OakHandDrawnCard.js';
|
|
132
130
|
export { OakHandDrawnCardWithIcon } from './components/owa/OakHandDrawnCardWithIcon/OakHandDrawnCardWithIcon.js';
|
|
@@ -135,7 +133,6 @@ export { OakCardHeader, OakLessonInfoCard, OakStaticMessageCard } from './compon
|
|
|
135
133
|
export { OakLinkCard } from './components/owa/OakLinkCard/OakLinkCard.js';
|
|
136
134
|
export { OakMediaClipListAccordion } from './components/owa/OakMediaClipListAccordion/OakMediaClipListAccordion.js';
|
|
137
135
|
export { OakOutlineAccordion } from './components/owa/OakOutlineAccordion/OakOutlineAccordion.js';
|
|
138
|
-
export { OakRadioTile, isTileItem } from './components/owa/OakRadioTile/OakRadioTile.js';
|
|
139
136
|
export { OakSaveCount } from './components/owa/OakSaveCount/OakSaveCount.js';
|
|
140
137
|
export { OakScaleImageButton } from './components/owa/OakScaleImageButton/OakScaleImageButton.js';
|
|
141
138
|
export { OakSignLanguageButton } from './components/owa/OakSignLanguageButton/OakSignLanguageButton.js';
|
package/dist/npm/es/types.d.ts
CHANGED
|
@@ -1490,31 +1490,6 @@ type OakSmallSecondaryButtonProps = Omit<InternalShadowRectButtonProps, "default
|
|
|
1490
1490
|
*/
|
|
1491
1491
|
declare const OakSmallSecondaryButton: <C extends ElementType = "button">({ element, ...rest }: OakSmallSecondaryButtonProps & PolymorphicPropsWithoutRef<C>) => React$1.JSX.Element;
|
|
1492
1492
|
|
|
1493
|
-
declare const oakAllApectRatiosConst: readonly ["7:8", "2:3", "1:1", "3:2", "16:9"];
|
|
1494
|
-
type OakAllApectRatios = (typeof oakAllApectRatiosConst)[number];
|
|
1495
|
-
type OakAspectRatioValues = ResponsiveValues<OakAllApectRatios>;
|
|
1496
|
-
type OakAspectRatioOuterProps = {
|
|
1497
|
-
ratio: OakAspectRatioValues;
|
|
1498
|
-
};
|
|
1499
|
-
type OakAspectRatioProps = {
|
|
1500
|
-
children?: React$1.ReactNode;
|
|
1501
|
-
} & OakAspectRatioOuterProps;
|
|
1502
|
-
/**
|
|
1503
|
-
*
|
|
1504
|
-
* AspectRatio provides a container of fixed aspect ratio
|
|
1505
|
-
*
|
|
1506
|
-
* ⚠️ To be deprecated
|
|
1507
|
-
* @deprecated
|
|
1508
|
-
*
|
|
1509
|
-
* ## Usage
|
|
1510
|
-
* Use this component when you want to ensure a box has a certain aspect ratio.
|
|
1511
|
-
* Wrap with component with <code>position: relative</code> and a width or min-width
|
|
1512
|
-
* The 'ratio' prop is responsive, so you can pass an array e.g. <code>["3:2", "16:9"]</code>
|
|
1513
|
-
* which will result in different aspect ratios on different screen widths.
|
|
1514
|
-
* For an example usage, see the <code>CardImage</code> component.
|
|
1515
|
-
*/
|
|
1516
|
-
declare const OakAspectRatio: FC<OakAspectRatioProps>;
|
|
1517
|
-
|
|
1518
1493
|
/**
|
|
1519
1494
|
* Map of the svg names to the actual svg components
|
|
1520
1495
|
* Only components that are used in the OakSvg component should be added here
|
|
@@ -4538,62 +4513,6 @@ type OakDroppableProps = {
|
|
|
4538
4513
|
*/
|
|
4539
4514
|
declare const OakDroppable: FC<OakDroppableProps & ComponentPropsWithRef<typeof OakFlex>>;
|
|
4540
4515
|
|
|
4541
|
-
type OakFilterDrawerProps = {
|
|
4542
|
-
/**
|
|
4543
|
-
* Called when the clear button is clicked
|
|
4544
|
-
*/
|
|
4545
|
-
clearAllInputs: () => void;
|
|
4546
|
-
/**
|
|
4547
|
-
* The content of the modal.
|
|
4548
|
-
* Use with `<OakModalBody>` for best results.
|
|
4549
|
-
*/
|
|
4550
|
-
children: ReactNode;
|
|
4551
|
-
/**
|
|
4552
|
-
* Slot for the footer of the modal.
|
|
4553
|
-
* Use with `<OakModalFooter>` for best results.
|
|
4554
|
-
*/
|
|
4555
|
-
footerSlot?: ReactNode;
|
|
4556
|
-
/**
|
|
4557
|
-
* Indicates whether the modal is open or closed
|
|
4558
|
-
*/
|
|
4559
|
-
isOpen: boolean;
|
|
4560
|
-
/**
|
|
4561
|
-
* Called when the modal is closed
|
|
4562
|
-
*/
|
|
4563
|
-
onClose: () => void;
|
|
4564
|
-
/**
|
|
4565
|
-
* The DOM container to render the modal portal into.
|
|
4566
|
-
*
|
|
4567
|
-
* @default document.body
|
|
4568
|
-
*/
|
|
4569
|
-
domContainer?: Element;
|
|
4570
|
-
/**
|
|
4571
|
-
* Optional z-index override.
|
|
4572
|
-
*
|
|
4573
|
-
* Defaults to token: `modal-dialog`
|
|
4574
|
-
*
|
|
4575
|
-
* 🚨 This prop is intended for use by consumers that do not use
|
|
4576
|
-
* the internal system of z-index tokens.
|
|
4577
|
-
*
|
|
4578
|
-
* NB *The modal is rendered inside a portal so it will not respect the stacking context of its parent component*.
|
|
4579
|
-
*/
|
|
4580
|
-
zIndex?: number;
|
|
4581
|
-
/**
|
|
4582
|
-
* Whether the modal should be anchored to the left side of the screen.
|
|
4583
|
-
*/
|
|
4584
|
-
isLeftHandSide?: boolean;
|
|
4585
|
-
} & Pick<HTMLAttributes<Element>, "aria-label" | "aria-description" | "aria-labelledby" | "aria-describedby">;
|
|
4586
|
-
/**
|
|
4587
|
-
*
|
|
4588
|
-
* Based on the OakModal component, this component is a filter drawer that slides in from the right side of the screen.
|
|
4589
|
-
* Designed for mobile and tablet devices
|
|
4590
|
-
*
|
|
4591
|
-
* ### Callbacks
|
|
4592
|
-
* clearAllInputs: used to clear filter options
|
|
4593
|
-
*
|
|
4594
|
-
*/
|
|
4595
|
-
declare const OakFilterDrawer: ({ isOpen, domContainer, onClose, zIndex, children, clearAllInputs, footerSlot, ...rest }: OakFilterDrawerProps) => React$1.ReactPortal | null;
|
|
4596
|
-
|
|
4597
4516
|
interface OakFormInputWithLabelsProps {
|
|
4598
4517
|
/**
|
|
4599
4518
|
* The label for the input field.
|
|
@@ -4805,19 +4724,6 @@ type OakOutlineAccordionProps = {
|
|
|
4805
4724
|
*/
|
|
4806
4725
|
declare const OakOutlineAccordion: ({ header, children, id, initialOpen, ...styleProps }: OakOutlineAccordionProps) => React$1.JSX.Element;
|
|
4807
4726
|
|
|
4808
|
-
type TileItem = {
|
|
4809
|
-
id: string;
|
|
4810
|
-
label: string;
|
|
4811
|
-
};
|
|
4812
|
-
declare const isTileItem: (u: unknown) => u is TileItem;
|
|
4813
|
-
type OakRadioTileProps = {
|
|
4814
|
-
tileItem: TileItem;
|
|
4815
|
-
isChecked: boolean;
|
|
4816
|
-
id: string;
|
|
4817
|
-
onChange: (tileItem: TileItem) => void;
|
|
4818
|
-
};
|
|
4819
|
-
declare const OakRadioTile: any;
|
|
4820
|
-
|
|
4821
4727
|
type OakSaveCountProps = {
|
|
4822
4728
|
/**
|
|
4823
4729
|
* The number of saved items.
|
|
@@ -5348,5 +5254,5 @@ declare const useIsScrolled: () => {
|
|
|
5348
5254
|
|
|
5349
5255
|
declare const useBreakpoint: () => Device;
|
|
5350
5256
|
|
|
5351
|
-
export { DropdownContext, HeadingTagComponent, IconDown, IconUp, OakAccordion, OakAnchorTarget,
|
|
5352
|
-
export type { BannerTypes, BreakpointName, Consent, Device, InternalQuizResultItemProps, LessonSectionName$1 as LessonSectionName, MenuItemProps, OakAccordionProps, OakAllSpacingToken, OakAnchorTargetProps,
|
|
5257
|
+
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, 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 };
|
|
5258
|
+
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, 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, Subject, Tier, UnstyledChevronAccordionProps };
|
package/package.json
CHANGED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject, __rest, __assign } from 'tslib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { responsiveStyle } from '../../../styles/utils/responsiveStyle.js';
|
|
5
|
-
|
|
6
|
-
var oakAspectRatioPercentage = {
|
|
7
|
-
"16:9": 56.25,
|
|
8
|
-
"3:2": 66.66,
|
|
9
|
-
"1:1": 100,
|
|
10
|
-
"2:3": 150,
|
|
11
|
-
"7:8": 114,
|
|
12
|
-
};
|
|
13
|
-
var parseRatioToPercentage = function (ratio) {
|
|
14
|
-
return ratio ? "".concat(oakAspectRatioPercentage[ratio], "%") : undefined;
|
|
15
|
-
};
|
|
16
|
-
var OakAspectRatioOuter = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n height: 0;\n position: relative;\n ", "\n"], ["\n width: 100%;\n height: 0;\n position: relative;\n ", "\n"])), responsiveStyle("padding-top", function (props) { return props.ratio; }, parseRatioToPercentage));
|
|
17
|
-
var OakAspectRatioInner = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n top: 0;\n"], ["\n display: flex;\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n top: 0;\n"])));
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* AspectRatio provides a container of fixed aspect ratio
|
|
21
|
-
*
|
|
22
|
-
* ⚠️ To be deprecated
|
|
23
|
-
* @deprecated
|
|
24
|
-
*
|
|
25
|
-
* ## Usage
|
|
26
|
-
* Use this component when you want to ensure a box has a certain aspect ratio.
|
|
27
|
-
* Wrap with component with <code>position: relative</code> and a width or min-width
|
|
28
|
-
* The 'ratio' prop is responsive, so you can pass an array e.g. <code>["3:2", "16:9"]</code>
|
|
29
|
-
* which will result in different aspect ratios on different screen widths.
|
|
30
|
-
* For an example usage, see the <code>CardImage</code> component.
|
|
31
|
-
*/
|
|
32
|
-
var OakAspectRatio = function (props) {
|
|
33
|
-
var children = props.children, ratio = props.ratio, htmlAttrs = __rest(props, ["children", "ratio"]);
|
|
34
|
-
return (React.createElement(OakAspectRatioOuter, __assign({ ratio: ratio }, htmlAttrs),
|
|
35
|
-
React.createElement(OakAspectRatioInner, null, children)));
|
|
36
|
-
};
|
|
37
|
-
var templateObject_1, templateObject_2;
|
|
38
|
-
|
|
39
|
-
export { OakAspectRatio };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
2
|
-
import React, { useRef } from 'react';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
import { InternalShadowRoundButton } from '../../internal-components/InternalShadowRoundButton/InternalShadowRoundButton.js';
|
|
5
|
-
import { OakBox } from '../../layout-and-structure/OakBox/OakBox.js';
|
|
6
|
-
import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
|
|
7
|
-
import { OakHeading } from '../../typography/OakHeading/OakHeading.js';
|
|
8
|
-
import { useIsScrolled } from '../../../hooks/useIsScrolled.js';
|
|
9
|
-
import { useMounted } from '../../../hooks/useMounted.js';
|
|
10
|
-
import InternalModalTransition from '../../internal-components/InternalModalTransition/InternalModalTransition.js';
|
|
11
|
-
import { OakLink } from '../../navigation/OakLink/OakLink.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* Based on the OakModal component, this component is a filter drawer that slides in from the right side of the screen.
|
|
16
|
-
* Designed for mobile and tablet devices
|
|
17
|
-
*
|
|
18
|
-
* ### Callbacks
|
|
19
|
-
* clearAllInputs: used to clear filter options
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
var OakFilterDrawer = function (_a) {
|
|
23
|
-
var isOpen = _a.isOpen, domContainer = _a.domContainer, onClose = _a.onClose, zIndex = _a.zIndex, children = _a.children, clearAllInputs = _a.clearAllInputs, footerSlot = _a.footerSlot, rest = __rest(_a, ["isOpen", "domContainer", "onClose", "zIndex", "children", "clearAllInputs", "footerSlot"]);
|
|
24
|
-
var _b = useIsScrolled(), isScrolled = _b.isScrolled, ObserveScroll = _b.ObserveScroll;
|
|
25
|
-
var transitionRef = useRef(null);
|
|
26
|
-
var isMounted = useMounted();
|
|
27
|
-
if (!isMounted) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
var finalZIndex = typeof zIndex === "number" ? zIndex : "modal-dialog";
|
|
31
|
-
return createPortal(React.createElement(InternalModalTransition, __assign({ isOpen: isOpen, transitionRef: transitionRef, onClose: onClose, finalZIndex: finalZIndex, isLeftHandSide: false }, rest),
|
|
32
|
-
React.createElement(OakFlex, { "$ma": "spacing-24", "$justifyContent": "space-between", "$alignItems": "center" },
|
|
33
|
-
React.createElement(OakLink, { variant: "secondary", onClick: clearAllInputs, "aria-label": "Clear", element: "button" }, "Clear"),
|
|
34
|
-
React.createElement(OakHeading, { "$font": "heading-6", tag: "h3" }, "Filters"),
|
|
35
|
-
React.createElement(InternalShadowRoundButton, { onClick: onClose, "aria-label": "Close", defaultIconBackground: "transparent", defaultIconColor: "icon-primary", defaultTextColor: "transparent", hoverTextColor: "transparent", disabledTextColor: "transparent", hoverIconBackground: "icon-primary", hoverIconColor: "icon-inverted", disabledIconBackground: "transparent", iconBackgroundSize: "spacing-24", iconSize: "spacing-24", iconName: "cross" })),
|
|
36
|
-
React.createElement(OakFlex, { "$flexGrow": 1, "$flexDirection": "column", "$overflow": "auto", "$bt": "border-solid-s", "$borderColor": isScrolled ? "border-neutral-lighter" : "transparent" },
|
|
37
|
-
React.createElement(ObserveScroll, null,
|
|
38
|
-
React.createElement("div", { "data-autofocus-inside": true, tabIndex: -2 },
|
|
39
|
-
React.createElement(OakBox, { "$mh": "spacing-24" }, children)))),
|
|
40
|
-
React.createElement(OakFlex, { "$flexDirection": ["column", "row"], "$bt": "border-solid-s", "$borderColor": "border-neutral-lighter", "$pa": "spacing-12", "$gap": ["spacing-16", "spacing-24"], "$width": "100%" }, footerSlot)), domContainer !== null && domContainer !== void 0 ? domContainer : document.body);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export { OakFilterDrawer };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject, __read } from 'tslib';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
|
|
5
|
-
import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
|
|
6
|
-
import { OakBox } from '../../layout-and-structure/OakBox/OakBox.js';
|
|
7
|
-
import { OakLabel } from '../../form-elements/OakLabel/OakLabel.js';
|
|
8
|
-
import { parseColor } from '../../../styles/helpers/parseColor.js';
|
|
9
|
-
|
|
10
|
-
var isTileItem = function (u) {
|
|
11
|
-
return (typeof u === "object" &&
|
|
12
|
-
u !== null &&
|
|
13
|
-
typeof u.id === "string" &&
|
|
14
|
-
typeof u.label === "string");
|
|
15
|
-
};
|
|
16
|
-
var RadioTileLabel = styled(OakLabel)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: pointer;\n display: flex;\n gap: ", ";\n"], ["\n cursor: pointer;\n display: flex;\n gap: ", ";\n"])), parseSpacing("spacing-16"));
|
|
17
|
-
var HiddenRadioButtonInput = styled.input.attrs({
|
|
18
|
-
type: "radio",
|
|
19
|
-
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n opacity: 0;\n cursor: pointer;\n"], ["\n position: absolute;\n opacity: 0;\n cursor: pointer;\n"])));
|
|
20
|
-
var RadioTileFocus = styled(OakBox)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n box-shadow: ", ";\n width: calc(100% + 12px);\n height: calc(100% + 12px);\n top: -6px;\n left: -6px;\n"], ["\n box-shadow: ", ";\n width: calc(100% + 12px);\n height: calc(100% + 12px);\n top: -6px;\n left: -6px;\n"])), "inset 0 0 0 0.15rem ".concat(parseColor("icon-promo")));
|
|
21
|
-
var OakRadioTileCss = css(templateObject_4 || (templateObject_4 = __makeTemplateObject([""], [""])));
|
|
22
|
-
var UnstyledComponent = function (props) {
|
|
23
|
-
var tileItem = props.tileItem, isChecked = props.isChecked, id = props.id, onChange = props.onChange;
|
|
24
|
-
var _a = __read(useState(false), 2), isFocussed = _a[0], setIsFocussed = _a[1];
|
|
25
|
-
return (React.createElement(OakBox, { "$borderColor": "border-neutral", "$ba": "border-solid-m", "$borderRadius": "border-radius-s", "$pa": "spacing-12", "$position": "relative", "$background": isFocussed || isChecked ? "bg-inverted" : "transparent", "$color": isFocussed || isChecked ? "text-inverted" : "text-primary" },
|
|
26
|
-
isFocussed && (React.createElement(RadioTileFocus, { "$background": "transparent", "$position": "absolute", "$ba": "border-solid-l", "$borderColor": "border-neutral-stronger", "$borderRadius": "border-radius-s", "data-testid": "radio-tile-focus" })),
|
|
27
|
-
React.createElement(RadioTileLabel, { htmlFor: id },
|
|
28
|
-
React.createElement(HiddenRadioButtonInput, { value: tileItem.id, id: id, checked: isChecked, onChange: function () { return onChange(tileItem); }, tabIndex: 0, onFocus: function () { return setIsFocussed(true); }, onBlur: function () { return setIsFocussed(false); }, onClick: function (e) {
|
|
29
|
-
// remove focus on mouse click events
|
|
30
|
-
if (e.clientX || e.clientY) {
|
|
31
|
-
setIsFocussed(false);
|
|
32
|
-
}
|
|
33
|
-
} }),
|
|
34
|
-
React.createElement(OakFlex, { "$height": "spacing-24", "$width": "spacing-24", "$borderColor": "border-neutral", "$flexGrow": 0, "$flexShrink": 0, "$alignItems": "center", "$justifyContent": "center", "$background": "bg-primary", "$ba": "border-solid-m", "$borderRadius": "border-radius-circle" }, isChecked && (React.createElement(OakBox, { "$height": "spacing-16", "$width": "spacing-16", "$background": "bg-inverted", "$position": "absolute", "$borderRadius": "border-radius-circle", "data-testid": "radio-tile-checked" }))),
|
|
35
|
-
tileItem.label)));
|
|
36
|
-
};
|
|
37
|
-
var OakRadioTile = styled(UnstyledComponent)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), OakRadioTileCss);
|
|
38
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
39
|
-
|
|
40
|
-
export { OakRadioTile, isTileItem };
|