@oaknational/oak-components 3.18.0 → 3.20.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 +361 -576
- package/dist/npm/cjs/types.d.ts +2 -146
- 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 -5
- package/dist/npm/es/types.d.ts +2 -146
- package/package.json +1 -1
- package/dist/npm/es/components/house-cat/OakCaptionCard/OakCaptionCard.js +0 -81
- package/dist/npm/es/components/house-cat/OakCaptionSearch/OakCaptionSearch.js +0 -24
- package/dist/npm/es/components/house-cat/utils.js +0 -33
- 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
|
|
@@ -2703,56 +2678,6 @@ type OakSearchFilterCheckBoxProps = Omit<BaseCheckBoxProps, "defaultChecked"> &
|
|
|
2703
2678
|
*/
|
|
2704
2679
|
declare const OakSearchFilterCheckBox: (props: OakSearchFilterCheckBoxProps) => React$1.JSX.Element;
|
|
2705
2680
|
|
|
2706
|
-
interface OakCaptionCardProps {
|
|
2707
|
-
captionId: string;
|
|
2708
|
-
videoTitle: string;
|
|
2709
|
-
lessonUid: string;
|
|
2710
|
-
videoType: "lesson";
|
|
2711
|
-
lastUpdated: string;
|
|
2712
|
-
lastEdited?: string;
|
|
2713
|
-
checked?: boolean;
|
|
2714
|
-
highlighted?: boolean;
|
|
2715
|
-
disabled?: boolean;
|
|
2716
|
-
onCheckChanged?: (event: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
2717
|
-
onClick?: (event: React$1.MouseEvent<HTMLDivElement>) => void;
|
|
2718
|
-
editHref: string;
|
|
2719
|
-
lessonHref: string;
|
|
2720
|
-
"data-testid"?: string;
|
|
2721
|
-
}
|
|
2722
|
-
/**
|
|
2723
|
-
* A caption card with links to the associated lesson and rev edit page.
|
|
2724
|
-
*
|
|
2725
|
-
* ## Events
|
|
2726
|
-
* The following callbacks are available for tracking checkbox events:
|
|
2727
|
-
*
|
|
2728
|
-
* ### onCheckChanged
|
|
2729
|
-
* onCheckChanged?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
2730
|
-
*
|
|
2731
|
-
*/
|
|
2732
|
-
declare const OakCaptionCard: (props: OakCaptionCardProps) => React$1.JSX.Element;
|
|
2733
|
-
|
|
2734
|
-
interface OakCaptionSearchProps {
|
|
2735
|
-
defaultValue?: string;
|
|
2736
|
-
/**
|
|
2737
|
-
* Callback function that is called when the search is submitted.
|
|
2738
|
-
* It receives the caption ID string as an argument.
|
|
2739
|
-
*/
|
|
2740
|
-
onSearch?: (captionIdString: string) => void;
|
|
2741
|
-
/**
|
|
2742
|
-
* Indicates if there is an error in the search input.
|
|
2743
|
-
*/
|
|
2744
|
-
hasError?: boolean;
|
|
2745
|
-
/**
|
|
2746
|
-
* Text to display when there is an error in the search input.
|
|
2747
|
-
*/
|
|
2748
|
-
errorText?: string;
|
|
2749
|
-
/**
|
|
2750
|
-
* Indicates if the search is currently loading. will disable the input and button.
|
|
2751
|
-
*/
|
|
2752
|
-
isLoading?: boolean;
|
|
2753
|
-
}
|
|
2754
|
-
declare const OakCaptionSearch: ({ onSearch, hasError, errorText, isLoading, defaultValue, }: OakCaptionSearchProps) => React$1.JSX.Element;
|
|
2755
|
-
|
|
2756
2681
|
type OakFlexProps = FlexStyleProps & OakBoxProps;
|
|
2757
2682
|
declare const oakFlexCss: styled_components.FlattenInterpolation<styled_components.ThemedStyledProps<FlexStyleProps, styled_components.DefaultTheme>>;
|
|
2758
2683
|
/**
|
|
@@ -4588,62 +4513,6 @@ type OakDroppableProps = {
|
|
|
4588
4513
|
*/
|
|
4589
4514
|
declare const OakDroppable: FC<OakDroppableProps & ComponentPropsWithRef<typeof OakFlex>>;
|
|
4590
4515
|
|
|
4591
|
-
type OakFilterDrawerProps = {
|
|
4592
|
-
/**
|
|
4593
|
-
* Called when the clear button is clicked
|
|
4594
|
-
*/
|
|
4595
|
-
clearAllInputs: () => void;
|
|
4596
|
-
/**
|
|
4597
|
-
* The content of the modal.
|
|
4598
|
-
* Use with `<OakModalBody>` for best results.
|
|
4599
|
-
*/
|
|
4600
|
-
children: ReactNode;
|
|
4601
|
-
/**
|
|
4602
|
-
* Slot for the footer of the modal.
|
|
4603
|
-
* Use with `<OakModalFooter>` for best results.
|
|
4604
|
-
*/
|
|
4605
|
-
footerSlot?: ReactNode;
|
|
4606
|
-
/**
|
|
4607
|
-
* Indicates whether the modal is open or closed
|
|
4608
|
-
*/
|
|
4609
|
-
isOpen: boolean;
|
|
4610
|
-
/**
|
|
4611
|
-
* Called when the modal is closed
|
|
4612
|
-
*/
|
|
4613
|
-
onClose: () => void;
|
|
4614
|
-
/**
|
|
4615
|
-
* The DOM container to render the modal portal into.
|
|
4616
|
-
*
|
|
4617
|
-
* @default document.body
|
|
4618
|
-
*/
|
|
4619
|
-
domContainer?: Element;
|
|
4620
|
-
/**
|
|
4621
|
-
* Optional z-index override.
|
|
4622
|
-
*
|
|
4623
|
-
* Defaults to token: `modal-dialog`
|
|
4624
|
-
*
|
|
4625
|
-
* 🚨 This prop is intended for use by consumers that do not use
|
|
4626
|
-
* the internal system of z-index tokens.
|
|
4627
|
-
*
|
|
4628
|
-
* NB *The modal is rendered inside a portal so it will not respect the stacking context of its parent component*.
|
|
4629
|
-
*/
|
|
4630
|
-
zIndex?: number;
|
|
4631
|
-
/**
|
|
4632
|
-
* Whether the modal should be anchored to the left side of the screen.
|
|
4633
|
-
*/
|
|
4634
|
-
isLeftHandSide?: boolean;
|
|
4635
|
-
} & Pick<HTMLAttributes<Element>, "aria-label" | "aria-description" | "aria-labelledby" | "aria-describedby">;
|
|
4636
|
-
/**
|
|
4637
|
-
*
|
|
4638
|
-
* Based on the OakModal component, this component is a filter drawer that slides in from the right side of the screen.
|
|
4639
|
-
* Designed for mobile and tablet devices
|
|
4640
|
-
*
|
|
4641
|
-
* ### Callbacks
|
|
4642
|
-
* clearAllInputs: used to clear filter options
|
|
4643
|
-
*
|
|
4644
|
-
*/
|
|
4645
|
-
declare const OakFilterDrawer: ({ isOpen, domContainer, onClose, zIndex, children, clearAllInputs, footerSlot, ...rest }: OakFilterDrawerProps) => React$1.ReactPortal | null;
|
|
4646
|
-
|
|
4647
4516
|
interface OakFormInputWithLabelsProps {
|
|
4648
4517
|
/**
|
|
4649
4518
|
* The label for the input field.
|
|
@@ -4855,19 +4724,6 @@ type OakOutlineAccordionProps = {
|
|
|
4855
4724
|
*/
|
|
4856
4725
|
declare const OakOutlineAccordion: ({ header, children, id, initialOpen, ...styleProps }: OakOutlineAccordionProps) => React$1.JSX.Element;
|
|
4857
4726
|
|
|
4858
|
-
type TileItem = {
|
|
4859
|
-
id: string;
|
|
4860
|
-
label: string;
|
|
4861
|
-
};
|
|
4862
|
-
declare const isTileItem: (u: unknown) => u is TileItem;
|
|
4863
|
-
type OakRadioTileProps = {
|
|
4864
|
-
tileItem: TileItem;
|
|
4865
|
-
isChecked: boolean;
|
|
4866
|
-
id: string;
|
|
4867
|
-
onChange: (tileItem: TileItem) => void;
|
|
4868
|
-
};
|
|
4869
|
-
declare const OakRadioTile: any;
|
|
4870
|
-
|
|
4871
4727
|
type OakSaveCountProps = {
|
|
4872
4728
|
/**
|
|
4873
4729
|
* The number of saved items.
|
|
@@ -5398,5 +5254,5 @@ declare const useIsScrolled: () => {
|
|
|
5398
5254
|
|
|
5399
5255
|
declare const useBreakpoint: () => Device;
|
|
5400
5256
|
|
|
5401
|
-
export { DropdownContext, HeadingTagComponent, IconDown, IconUp, OakAccordion, OakAnchorTarget,
|
|
5402
|
-
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,9 +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 { OakCaptionCard } from './components/house-cat/OakCaptionCard/OakCaptionCard.js';
|
|
42
|
-
export { OakCaptionSearch } from './components/house-cat/OakCaptionSearch/OakCaptionSearch.js';
|
|
43
|
-
export { OakAspectRatio } from './components/images-and-icons/OakAspectRatio/OakAspectRatio.js';
|
|
44
41
|
export { OakIcon } from './components/images-and-icons/OakIcon/OakIcon.js';
|
|
45
42
|
export { OakImage, oakPlaceholder, placeholderStyles } from './components/images-and-icons/OakImage/OakImage.js';
|
|
46
43
|
export { OakSvg } from './components/images-and-icons/OakSvg/OakSvg.js';
|
|
@@ -128,7 +125,6 @@ export { OakDragAndDropInstructions } from './components/owa/OakDragAndDropInstr
|
|
|
128
125
|
export { OakDraggable } from './components/owa/OakDraggable/OakDraggable.js';
|
|
129
126
|
export { OakDraggableFeedback } from './components/owa/OakDraggableFeedback/OakDraggableFeedback.js';
|
|
130
127
|
export { OakDroppable } from './components/owa/OakDroppable/OakDroppable.js';
|
|
131
|
-
export { OakFilterDrawer } from './components/owa/OakFilterDrawer/OakFilterDrawer.js';
|
|
132
128
|
export { OakFormInputWithLabels } from './components/owa/OakFormInputWithLabels/OakFormInputWithLabels.js';
|
|
133
129
|
export { OakHandDrawnCard } from './components/owa/OakHandDrawnCard/OakHandDrawnCard.js';
|
|
134
130
|
export { OakHandDrawnCardWithIcon } from './components/owa/OakHandDrawnCardWithIcon/OakHandDrawnCardWithIcon.js';
|
|
@@ -137,7 +133,6 @@ export { OakCardHeader, OakLessonInfoCard, OakStaticMessageCard } from './compon
|
|
|
137
133
|
export { OakLinkCard } from './components/owa/OakLinkCard/OakLinkCard.js';
|
|
138
134
|
export { OakMediaClipListAccordion } from './components/owa/OakMediaClipListAccordion/OakMediaClipListAccordion.js';
|
|
139
135
|
export { OakOutlineAccordion } from './components/owa/OakOutlineAccordion/OakOutlineAccordion.js';
|
|
140
|
-
export { OakRadioTile, isTileItem } from './components/owa/OakRadioTile/OakRadioTile.js';
|
|
141
136
|
export { OakSaveCount } from './components/owa/OakSaveCount/OakSaveCount.js';
|
|
142
137
|
export { OakScaleImageButton } from './components/owa/OakScaleImageButton/OakScaleImageButton.js';
|
|
143
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
|
|
@@ -2703,56 +2678,6 @@ type OakSearchFilterCheckBoxProps = Omit<BaseCheckBoxProps, "defaultChecked"> &
|
|
|
2703
2678
|
*/
|
|
2704
2679
|
declare const OakSearchFilterCheckBox: (props: OakSearchFilterCheckBoxProps) => React$1.JSX.Element;
|
|
2705
2680
|
|
|
2706
|
-
interface OakCaptionCardProps {
|
|
2707
|
-
captionId: string;
|
|
2708
|
-
videoTitle: string;
|
|
2709
|
-
lessonUid: string;
|
|
2710
|
-
videoType: "lesson";
|
|
2711
|
-
lastUpdated: string;
|
|
2712
|
-
lastEdited?: string;
|
|
2713
|
-
checked?: boolean;
|
|
2714
|
-
highlighted?: boolean;
|
|
2715
|
-
disabled?: boolean;
|
|
2716
|
-
onCheckChanged?: (event: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
2717
|
-
onClick?: (event: React$1.MouseEvent<HTMLDivElement>) => void;
|
|
2718
|
-
editHref: string;
|
|
2719
|
-
lessonHref: string;
|
|
2720
|
-
"data-testid"?: string;
|
|
2721
|
-
}
|
|
2722
|
-
/**
|
|
2723
|
-
* A caption card with links to the associated lesson and rev edit page.
|
|
2724
|
-
*
|
|
2725
|
-
* ## Events
|
|
2726
|
-
* The following callbacks are available for tracking checkbox events:
|
|
2727
|
-
*
|
|
2728
|
-
* ### onCheckChanged
|
|
2729
|
-
* onCheckChanged?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
2730
|
-
*
|
|
2731
|
-
*/
|
|
2732
|
-
declare const OakCaptionCard: (props: OakCaptionCardProps) => React$1.JSX.Element;
|
|
2733
|
-
|
|
2734
|
-
interface OakCaptionSearchProps {
|
|
2735
|
-
defaultValue?: string;
|
|
2736
|
-
/**
|
|
2737
|
-
* Callback function that is called when the search is submitted.
|
|
2738
|
-
* It receives the caption ID string as an argument.
|
|
2739
|
-
*/
|
|
2740
|
-
onSearch?: (captionIdString: string) => void;
|
|
2741
|
-
/**
|
|
2742
|
-
* Indicates if there is an error in the search input.
|
|
2743
|
-
*/
|
|
2744
|
-
hasError?: boolean;
|
|
2745
|
-
/**
|
|
2746
|
-
* Text to display when there is an error in the search input.
|
|
2747
|
-
*/
|
|
2748
|
-
errorText?: string;
|
|
2749
|
-
/**
|
|
2750
|
-
* Indicates if the search is currently loading. will disable the input and button.
|
|
2751
|
-
*/
|
|
2752
|
-
isLoading?: boolean;
|
|
2753
|
-
}
|
|
2754
|
-
declare const OakCaptionSearch: ({ onSearch, hasError, errorText, isLoading, defaultValue, }: OakCaptionSearchProps) => React$1.JSX.Element;
|
|
2755
|
-
|
|
2756
2681
|
type OakFlexProps = FlexStyleProps & OakBoxProps;
|
|
2757
2682
|
declare const oakFlexCss: styled_components.FlattenInterpolation<styled_components.ThemedStyledProps<FlexStyleProps, styled_components.DefaultTheme>>;
|
|
2758
2683
|
/**
|
|
@@ -4588,62 +4513,6 @@ type OakDroppableProps = {
|
|
|
4588
4513
|
*/
|
|
4589
4514
|
declare const OakDroppable: FC<OakDroppableProps & ComponentPropsWithRef<typeof OakFlex>>;
|
|
4590
4515
|
|
|
4591
|
-
type OakFilterDrawerProps = {
|
|
4592
|
-
/**
|
|
4593
|
-
* Called when the clear button is clicked
|
|
4594
|
-
*/
|
|
4595
|
-
clearAllInputs: () => void;
|
|
4596
|
-
/**
|
|
4597
|
-
* The content of the modal.
|
|
4598
|
-
* Use with `<OakModalBody>` for best results.
|
|
4599
|
-
*/
|
|
4600
|
-
children: ReactNode;
|
|
4601
|
-
/**
|
|
4602
|
-
* Slot for the footer of the modal.
|
|
4603
|
-
* Use with `<OakModalFooter>` for best results.
|
|
4604
|
-
*/
|
|
4605
|
-
footerSlot?: ReactNode;
|
|
4606
|
-
/**
|
|
4607
|
-
* Indicates whether the modal is open or closed
|
|
4608
|
-
*/
|
|
4609
|
-
isOpen: boolean;
|
|
4610
|
-
/**
|
|
4611
|
-
* Called when the modal is closed
|
|
4612
|
-
*/
|
|
4613
|
-
onClose: () => void;
|
|
4614
|
-
/**
|
|
4615
|
-
* The DOM container to render the modal portal into.
|
|
4616
|
-
*
|
|
4617
|
-
* @default document.body
|
|
4618
|
-
*/
|
|
4619
|
-
domContainer?: Element;
|
|
4620
|
-
/**
|
|
4621
|
-
* Optional z-index override.
|
|
4622
|
-
*
|
|
4623
|
-
* Defaults to token: `modal-dialog`
|
|
4624
|
-
*
|
|
4625
|
-
* 🚨 This prop is intended for use by consumers that do not use
|
|
4626
|
-
* the internal system of z-index tokens.
|
|
4627
|
-
*
|
|
4628
|
-
* NB *The modal is rendered inside a portal so it will not respect the stacking context of its parent component*.
|
|
4629
|
-
*/
|
|
4630
|
-
zIndex?: number;
|
|
4631
|
-
/**
|
|
4632
|
-
* Whether the modal should be anchored to the left side of the screen.
|
|
4633
|
-
*/
|
|
4634
|
-
isLeftHandSide?: boolean;
|
|
4635
|
-
} & Pick<HTMLAttributes<Element>, "aria-label" | "aria-description" | "aria-labelledby" | "aria-describedby">;
|
|
4636
|
-
/**
|
|
4637
|
-
*
|
|
4638
|
-
* Based on the OakModal component, this component is a filter drawer that slides in from the right side of the screen.
|
|
4639
|
-
* Designed for mobile and tablet devices
|
|
4640
|
-
*
|
|
4641
|
-
* ### Callbacks
|
|
4642
|
-
* clearAllInputs: used to clear filter options
|
|
4643
|
-
*
|
|
4644
|
-
*/
|
|
4645
|
-
declare const OakFilterDrawer: ({ isOpen, domContainer, onClose, zIndex, children, clearAllInputs, footerSlot, ...rest }: OakFilterDrawerProps) => React$1.ReactPortal | null;
|
|
4646
|
-
|
|
4647
4516
|
interface OakFormInputWithLabelsProps {
|
|
4648
4517
|
/**
|
|
4649
4518
|
* The label for the input field.
|
|
@@ -4855,19 +4724,6 @@ type OakOutlineAccordionProps = {
|
|
|
4855
4724
|
*/
|
|
4856
4725
|
declare const OakOutlineAccordion: ({ header, children, id, initialOpen, ...styleProps }: OakOutlineAccordionProps) => React$1.JSX.Element;
|
|
4857
4726
|
|
|
4858
|
-
type TileItem = {
|
|
4859
|
-
id: string;
|
|
4860
|
-
label: string;
|
|
4861
|
-
};
|
|
4862
|
-
declare const isTileItem: (u: unknown) => u is TileItem;
|
|
4863
|
-
type OakRadioTileProps = {
|
|
4864
|
-
tileItem: TileItem;
|
|
4865
|
-
isChecked: boolean;
|
|
4866
|
-
id: string;
|
|
4867
|
-
onChange: (tileItem: TileItem) => void;
|
|
4868
|
-
};
|
|
4869
|
-
declare const OakRadioTile: any;
|
|
4870
|
-
|
|
4871
4727
|
type OakSaveCountProps = {
|
|
4872
4728
|
/**
|
|
4873
4729
|
* The number of saved items.
|
|
@@ -5398,5 +5254,5 @@ declare const useIsScrolled: () => {
|
|
|
5398
5254
|
|
|
5399
5255
|
declare const useBreakpoint: () => Device;
|
|
5400
5256
|
|
|
5401
|
-
export { DropdownContext, HeadingTagComponent, IconDown, IconUp, OakAccordion, OakAnchorTarget,
|
|
5402
|
-
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,81 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from 'tslib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { getTimeText } from '../utils.js';
|
|
5
|
-
import { OakBox } from '../../layout-and-structure/OakBox/OakBox.js';
|
|
6
|
-
import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
|
|
7
|
-
import { OakIcon } from '../../images-and-icons/OakIcon/OakIcon.js';
|
|
8
|
-
import { OakSpan } from '../../typography/OakSpan/OakSpan.js';
|
|
9
|
-
import { InternalCheckBoxLabelHoverDecor } from '../../internal-components/InternalCheckBoxLabel/InternalCheckBoxLabel.js';
|
|
10
|
-
import { parseColor } from '../../../styles/helpers/parseColor.js';
|
|
11
|
-
import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
|
|
12
|
-
import { OakCheckBox } from '../../form-elements/OakCheckBox/OakCheckBox.js';
|
|
13
|
-
import { OakLink } from '../../navigation/OakLink/OakLink.js';
|
|
14
|
-
|
|
15
|
-
var StyledFlexBox = styled(OakFlex)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &:hover:has(input:not(:disabled)) ", " {\n text-decoration: underline;\n }\n\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n ", "\n\n ", "\n ", "\n"], ["\n &:hover:has(input:not(:disabled)) ", " {\n text-decoration: underline;\n }\n\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n ", "\n\n ", "\n ", "\n"])), InternalCheckBoxLabelHoverDecor, parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), function (props) {
|
|
16
|
-
return props.$disabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: not-allowed;\n background-color: ", ";\n color: ", ";\n "], ["\n cursor: not-allowed;\n background-color: ", ";\n color: ", ";\n "])), parseColor("bg-neutral-stronger"), parseColor("text-disabled"));
|
|
17
|
-
}, function (props) {
|
|
18
|
-
return !props.$disabled &&
|
|
19
|
-
props.$highlighted && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n border-color: ", ";\n &:hover {\n background-color: ", ";\n }\n "], ["\n background-color: ", ";\n border-color: ", ";\n &:hover {\n background-color: ", ";\n }\n "])), parseColor("bg-decorative3-very-subdued"), parseColor("bg-decorative3-main"), parseColor("bg-decorative3-subdued"));
|
|
20
|
-
}, function (props) {
|
|
21
|
-
return !props.$disabled &&
|
|
22
|
-
!props.$highlighted && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &:hover {\n background-color: ", ";\n }\n "], ["\n &:hover {\n background-color: ", ";\n }\n "])), parseColor("bg-decorative3-subdued"));
|
|
23
|
-
});
|
|
24
|
-
/**
|
|
25
|
-
* A caption card with links to the associated lesson and rev edit page.
|
|
26
|
-
*
|
|
27
|
-
* ## Events
|
|
28
|
-
* The following callbacks are available for tracking checkbox events:
|
|
29
|
-
*
|
|
30
|
-
* ### onCheckChanged
|
|
31
|
-
* onCheckChanged?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
var OakCaptionCard = function (props) {
|
|
35
|
-
var checked = props.checked, onCheckChanged = props.onCheckChanged, onClick = props.onClick, captionId = props.captionId, videoTitle = props.videoTitle, lessonUid = props.lessonUid, videoType = props.videoType, lastUpdated = props.lastUpdated, lastEdited = props.lastEdited, _a = props.highlighted, highlighted = _a === void 0 ? false : _a, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props["data-testid"], dataTestId = _c === void 0 ? "caption-card" : _c, editHref = props.editHref, lessonHref = props.lessonHref;
|
|
36
|
-
var filterColor = disabled ? "icon-disabled" : null;
|
|
37
|
-
return (React.createElement(StyledFlexBox, { "data-testid": dataTestId, "$minHeight": "spacing-40", "$position": "relative", "$background": "bg-primary", "$borderRadius": "border-radius-s", "$pa": "spacing-16", "$gap": "spacing-12", "$flexDirection": "column", "$width": "100%", "$highlighted": !!highlighted, "$disabled": !!disabled, onClick: onClick },
|
|
38
|
-
React.createElement(OakFlex, { "$justifyContent": "flex-start", "$alignItems": "center", "$width": "100%", "$gap": "spacing-12", "$font": "heading-7" },
|
|
39
|
-
React.createElement(OakCheckBox, { checked: checked, value: "Caption ID: ".concat(captionId), displayValue: "", disabled: disabled, onChange: onCheckChanged, "aria-labelledby": captionId, "aria-label": "check caption ".concat(captionId), "data-testid": "checkbox", id: captionId }),
|
|
40
|
-
React.createElement(OakFlex, { "$font": "heading-7", "$justifyContent": "flex-start", "$gap": "spacing-8", "$flexWrap": "wrap" },
|
|
41
|
-
React.createElement(OakSpan, { "$font": "heading-7" },
|
|
42
|
-
"Caption ID: ",
|
|
43
|
-
captionId),
|
|
44
|
-
React.createElement(OakSpan, null, " \u2022 "),
|
|
45
|
-
React.createElement(OakBox, null,
|
|
46
|
-
"Video Title: ",
|
|
47
|
-
videoTitle)),
|
|
48
|
-
React.createElement(OakFlex, { "$flexGrow": 10, "$justifyContent": "flex-end" },
|
|
49
|
-
React.createElement(OakLink, { variant: "secondary", href: editHref, iconName: "external", isTrailingIcon: true, "aria-label": "edit caption ".concat(captionId, " in a new tab in rev"), target: "_blank", onClick: function (e) {
|
|
50
|
-
e.stopPropagation();
|
|
51
|
-
} }, "Edit"))),
|
|
52
|
-
React.createElement(OakFlex, { "$justifyContent": "flex-start", "$alignItems": "center", "$width": "100%", "$gap": "spacing-32", "$font": "body-2" },
|
|
53
|
-
React.createElement(OakLink, { variant: "secondary", href: lessonHref, "aria-label": "view lesson ".concat(lessonUid, " in a new tab"), "data-testid": "lesson_uid", iconName: "external", isTrailingIcon: true, target: "_blank", onClick: function (e) {
|
|
54
|
-
e.stopPropagation();
|
|
55
|
-
} }, lessonUid),
|
|
56
|
-
React.createElement(OakFlex, { "$alignItems": "center", "$gap": "spacing-4" },
|
|
57
|
-
" ",
|
|
58
|
-
React.createElement(OakIcon, { alt: "", iconName: "video", iconWidth: "spacing-24", iconHeight: "spacing-24", "$colorFilter": filterColor }),
|
|
59
|
-
getVideoTypeText(videoType)),
|
|
60
|
-
lastEdited ? (React.createElement(OakFlex, { "$alignItems": "center" },
|
|
61
|
-
React.createElement(OakIcon, { alt: "", iconName: "equipment-required", iconWidth: "spacing-24", iconHeight: "spacing-24", "$colorFilter": filterColor }),
|
|
62
|
-
"Edited ",
|
|
63
|
-
getTimeText(lastEdited))) : null,
|
|
64
|
-
React.createElement(OakFlex, { "$alignItems": "center" },
|
|
65
|
-
React.createElement(OakIcon, { alt: "", iconName: "success", iconWidth: "spacing-24", iconHeight: "spacing-24", "$colorFilter": filterColor }),
|
|
66
|
-
"Updated ",
|
|
67
|
-
getTimeText(lastUpdated)))));
|
|
68
|
-
};
|
|
69
|
-
function getVideoTypeText(videoType) {
|
|
70
|
-
switch (videoType) {
|
|
71
|
-
case "lesson":
|
|
72
|
-
return "Lesson video";
|
|
73
|
-
case "media clip":
|
|
74
|
-
return "Media clip";
|
|
75
|
-
default:
|
|
76
|
-
return "Unknown";
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
80
|
-
|
|
81
|
-
export { OakCaptionCard };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
|
|
3
|
-
import { OakPrimaryButton } from '../../buttons/OakPrimaryButton/OakPrimaryButton.js';
|
|
4
|
-
import { OakFormInputWithLabels } from '../../owa/OakFormInputWithLabels/OakFormInputWithLabels.js';
|
|
5
|
-
|
|
6
|
-
var OakCaptionSearch = function (_a) {
|
|
7
|
-
var onSearch = _a.onSearch, hasError = _a.hasError, errorText = _a.errorText, _b = _a.isLoading, isLoading = _b === void 0 ? false : _b, defaultValue = _a.defaultValue;
|
|
8
|
-
var handleFormSubmit = function (event) {
|
|
9
|
-
// NB. we don't handle caption ID validation here to remain decoupled from the application logic
|
|
10
|
-
event.preventDefault();
|
|
11
|
-
// get the input value from the form
|
|
12
|
-
var form = event.target;
|
|
13
|
-
var input = form.querySelector('input[name="caption-id"]');
|
|
14
|
-
var captionIdString = input.value.trim();
|
|
15
|
-
if (onSearch) {
|
|
16
|
-
onSearch(captionIdString);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
return (React.createElement(OakFlex, { as: "form", "$flexDirection": "column", "$color": "text-primary", "$background": "bg-primary", "$pa": "spacing-24", "$gap": "spacing-24", "$borderRadius": "border-radius-s", onSubmit: handleFormSubmit },
|
|
20
|
-
React.createElement(OakFormInputWithLabels, { label: "Caption ID", inputName: "caption-id", helperText: "Enter on or more IDs (separated by commas).", invalid: hasError, invalidText: errorText, disabled: isLoading, defaultValue: defaultValue, required: true }),
|
|
21
|
-
React.createElement(OakPrimaryButton, { type: "submit", iconName: "search", isTrailingIcon: true, isLoading: isLoading }, "Search")));
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { OakCaptionSearch };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
function getTimeText(timestamp) {
|
|
2
|
-
var date = new Date(timestamp);
|
|
3
|
-
if (isNaN(date.getTime())) {
|
|
4
|
-
return "at an unknown time";
|
|
5
|
-
}
|
|
6
|
-
var now = Date.now();
|
|
7
|
-
var diff = now - date.getTime();
|
|
8
|
-
var seconds = Math.floor(diff / 1000);
|
|
9
|
-
if (seconds < 1) {
|
|
10
|
-
return "just now";
|
|
11
|
-
}
|
|
12
|
-
if (seconds < 60) {
|
|
13
|
-
return "".concat(seconds, " secs ago");
|
|
14
|
-
}
|
|
15
|
-
if (seconds < 3600) {
|
|
16
|
-
return "".concat(Math.floor(seconds / 60), " mins ago");
|
|
17
|
-
}
|
|
18
|
-
if (seconds < 86400) {
|
|
19
|
-
return "".concat(Math.floor(seconds / 3600), " hrs ago");
|
|
20
|
-
}
|
|
21
|
-
if (seconds < 604800) {
|
|
22
|
-
return "".concat(Math.floor(seconds / 86400), " days ago");
|
|
23
|
-
}
|
|
24
|
-
if (seconds < 2592000) {
|
|
25
|
-
return "".concat(Math.floor(seconds / 604800), " weeks ago");
|
|
26
|
-
}
|
|
27
|
-
if (seconds < 31536000) {
|
|
28
|
-
return "".concat(Math.floor(seconds / 2592000), " months ago");
|
|
29
|
-
}
|
|
30
|
-
return "".concat(Math.floor(seconds / 31536000), " years ago");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { getTimeText };
|