@oaknational/oak-components 0.7.0 → 0.8.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/cjs/index.js +14 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +14 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types.d.ts +53 -2
- package/package.json +5 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as styled_components from 'styled-components';
|
|
2
2
|
import { CSSProperties as CSSProperties$1 } from 'styled-components';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { CSSProperties, MouseEventHandler, ElementType, ComponentPropsWithoutRef, FC, ReactNode, ComponentPropsWithRef, FocusEvent, DetailedHTMLProps, InputHTMLAttributes, ChangeEventHandler, ReactElement, ComponentProps } from 'react';
|
|
4
|
+
import React__default, { CSSProperties, MouseEventHandler, ElementType, ComponentPropsWithoutRef, FC, ReactNode, ComponentPropsWithRef, FocusEvent, DetailedHTMLProps, InputHTMLAttributes, ChangeEventHandler, ReactElement, ComponentProps, HTMLAttributes } from 'react';
|
|
5
5
|
import * as csstype from 'csstype';
|
|
6
6
|
import * as Image from 'next/image';
|
|
7
7
|
import Image__default, { ImageProps as ImageProps$1 } from 'next/image';
|
|
@@ -2046,6 +2046,57 @@ type OakAccordionProps = {
|
|
|
2046
2046
|
*/
|
|
2047
2047
|
declare const OakAccordion: ({ header, headerAfterSlot, children, initialOpen, id, }: OakAccordionProps) => React__default.JSX.Element;
|
|
2048
2048
|
|
|
2049
|
+
type OakModalProps = {
|
|
2050
|
+
/**
|
|
2051
|
+
* The content of the modal.
|
|
2052
|
+
* Use with `<OakModalBody>` for best results.
|
|
2053
|
+
*/
|
|
2054
|
+
children: ReactNode;
|
|
2055
|
+
/**
|
|
2056
|
+
* Slot for the footer of the modal.
|
|
2057
|
+
* Use with `<OakModalFooter>` for best results.
|
|
2058
|
+
*/
|
|
2059
|
+
footerSlot?: ReactNode;
|
|
2060
|
+
/**
|
|
2061
|
+
* Indicates whether the modal is open or closed
|
|
2062
|
+
*/
|
|
2063
|
+
isOpen: boolean;
|
|
2064
|
+
/**
|
|
2065
|
+
* Called when the modal is closed
|
|
2066
|
+
*/
|
|
2067
|
+
onClose: () => void;
|
|
2068
|
+
/**
|
|
2069
|
+
* The DOM container to render the modal portal into.
|
|
2070
|
+
*
|
|
2071
|
+
* @default document.body
|
|
2072
|
+
*/
|
|
2073
|
+
domContainer?: Element;
|
|
2074
|
+
} & Pick<HTMLAttributes<Element>, "aria-label" | "aria-description" | "aria-labelledby" | "aria-describedby">;
|
|
2075
|
+
/**
|
|
2076
|
+
* Modal dialog with trapped focus and a close button.
|
|
2077
|
+
*/
|
|
2078
|
+
declare const OakModal: ({ children, footerSlot, domContainer, isOpen, onClose, ...rest }: OakModalProps) => React__default.ReactPortal;
|
|
2079
|
+
|
|
2080
|
+
type OakModalBodyProps = {
|
|
2081
|
+
children: ReactNode;
|
|
2082
|
+
};
|
|
2083
|
+
/**
|
|
2084
|
+
* Intended to be used in the `children` slot of `OakModal`
|
|
2085
|
+
* it applies some padding and margin to ensure that the contents
|
|
2086
|
+
* line up with the modal's header and footer
|
|
2087
|
+
*/
|
|
2088
|
+
declare const OakModalBody: (props: OakModalBodyProps) => React__default.JSX.Element;
|
|
2089
|
+
|
|
2090
|
+
type OakModalFooterProps = {
|
|
2091
|
+
children: ReactNode;
|
|
2092
|
+
};
|
|
2093
|
+
/**
|
|
2094
|
+
* Intended to be used in the `footer` slot of `OakModal`
|
|
2095
|
+
* it is ideal as a container for one or more buttons.
|
|
2096
|
+
* It switches from a horizontal to vertical layout on smaller screens
|
|
2097
|
+
*/
|
|
2098
|
+
declare const OakModalFooter: (props: OakModalFooterProps) => React__default.JSX.Element;
|
|
2099
|
+
|
|
2049
2100
|
type OakQuizCheckBoxProps = Omit<BaseCheckBoxProps, "defaultChecked"> & {
|
|
2050
2101
|
feedback?: "correct" | "incorrect" | null;
|
|
2051
2102
|
image?: React__default.JSX.Element;
|
|
@@ -2385,4 +2436,4 @@ type OakPrimaryNavProps = {
|
|
|
2385
2436
|
*/
|
|
2386
2437
|
declare const OakPrimaryNav: ({ ariaLabel, navItems }: OakPrimaryNavProps) => React__default.JSX.Element;
|
|
2387
2438
|
|
|
2388
|
-
export { HeadingTagComponent, OakAccordion, type OakAccordionProps, type OakAllSpacingToken, OakBackLink, type OakBackLinkProps, type OakBorderRadiusToken, type OakBorderWidthToken, OakBox, type OakBoxProps, OakBulletList, type OakBulletListProps, OakCardHeader, type OakCardHeaderprops, OakCheckBox, type OakCheckBoxProps, OakCloudinaryConfigProvider, OakCloudinaryImage, type OakCloudinaryImageProps, OakCollapsibleContent, type OakCollapsibleContentProps, type OakColorToken, type OakCombinedColorToken, type OakCombinedSpacingToken, OakDragAndDropInstructions, OakDraggable, OakDraggableFeedback, type OakDropShadowToken, OakDroppable, type OakDroppableProps, OakFieldError, type OakFieldErrorProps, OakFlex, type OakFlexProps, type OakFontSizeToken, type OakFontToken, OakForm, type OakFormProps, OakGlobalStyle, OakGrid, OakGridArea, type OakGridAreaProps, type OakGridProps, type OakHandDrawnBoxWithIconProps, OakHandDrawnCard, type OakHandDrawnCardProps, OakHandDrawnCardWithIcon, OakHeading, type OakHeadingProps, type OakHeadingTag, OakHintButton, type OakHintButtonProps, OakIcon, type OakIconName, type OakIconProps, OakImage, type OakImageProps, type OakInfoCardProps, type OakInnerPaddingToken, OakKbd, type OakKbdProps, OakLI, type OakLIProps, OakLabel, type OakLabelProps, OakLessonBottomNav, type OakLessonBottomNavProps, OakLessonInfoCard, OakLessonLayout, type OakLessonLayoutProps, OakLessonNavItem, type OakLessonNavItemProps, OakLessonReviewItem, type OakLessonReviewItemProps, OakLessonTopNav, type OakLessonTopNavProps, OakLessonVideoTranscript, OakLink, type OakLinkProps, OakLoadingSpinner, type OakLoadingSpinnerProps, OakMaxWidth, OakOL, type OakOLProps, type OakOpacityToken, OakP, type OakPProps, OakPrimaryButton, type OakPrimaryButtonProps, OakPrimaryInvertedButton, type OakPrimaryInvertedButtonProps, OakPrimaryNav, OakPrimaryNavItem, type OakPrimaryNavItemProps, type OakPrimaryNavProps, OakPromoTag, OakQuizCheckBox, type OakQuizCheckBoxProps, OakQuizCounter, type OakQuizCounterProps, OakQuizFeedback, type OakQuizFeedbackProps, OakQuizHint, type OakQuizHintProps, OakQuizMatch, type OakQuizMatchProps, OakQuizOrder, type OakQuizOrderProps, OakQuizRadioButton, type OakQuizRadioButtonProps, OakQuizTextInput, OakRadioButton, OakRadioGroup, OakRoundIcon, type OakRoundIconProps, OakSecondaryButton, type OakSecondaryButtonProps, type OakSpaceBetweenToken, OakSpan, type OakSpanProps, OakStaticMessageCard, OakSubjectIcon, type OakSubjectIconProps, OakTertiaryButton, OakTextInput, type OakTextInputProps, type OakTheme, OakThemeProvider, type OakThemeProviderProps, OakTooltip, type OakTooltipProps, type OakTransitionToken, OakTypography, type OakTypographyProps, OakUL, type OakULProps, type OakUiRoleToken, isValidIconName, oakAllSpacingTokens, oakBorderRadiusTokens, oakBorderWidthTokens, oakBoxCss, oakColorTokens, oakDefaultTheme, oakDropShadowTokens, oakFontSizeTokens, oakFontTokens, oakHeadingTags, oakIconNames, oakInnerPaddingTokens, oakOpacityTokens, oakSpaceBetweenTokens, oakTransitionTokens, oakUiRoleTokens };
|
|
2439
|
+
export { HeadingTagComponent, OakAccordion, type OakAccordionProps, type OakAllSpacingToken, OakBackLink, type OakBackLinkProps, type OakBorderRadiusToken, type OakBorderWidthToken, OakBox, type OakBoxProps, OakBulletList, type OakBulletListProps, OakCardHeader, type OakCardHeaderprops, OakCheckBox, type OakCheckBoxProps, OakCloudinaryConfigProvider, OakCloudinaryImage, type OakCloudinaryImageProps, OakCollapsibleContent, type OakCollapsibleContentProps, type OakColorToken, type OakCombinedColorToken, type OakCombinedSpacingToken, OakDragAndDropInstructions, OakDraggable, OakDraggableFeedback, type OakDropShadowToken, OakDroppable, type OakDroppableProps, OakFieldError, type OakFieldErrorProps, OakFlex, type OakFlexProps, type OakFontSizeToken, type OakFontToken, OakForm, type OakFormProps, OakGlobalStyle, OakGrid, OakGridArea, type OakGridAreaProps, type OakGridProps, type OakHandDrawnBoxWithIconProps, OakHandDrawnCard, type OakHandDrawnCardProps, OakHandDrawnCardWithIcon, OakHeading, type OakHeadingProps, type OakHeadingTag, OakHintButton, type OakHintButtonProps, OakIcon, type OakIconName, type OakIconProps, OakImage, type OakImageProps, type OakInfoCardProps, type OakInnerPaddingToken, OakKbd, type OakKbdProps, OakLI, type OakLIProps, OakLabel, type OakLabelProps, OakLessonBottomNav, type OakLessonBottomNavProps, OakLessonInfoCard, OakLessonLayout, type OakLessonLayoutProps, OakLessonNavItem, type OakLessonNavItemProps, OakLessonReviewItem, type OakLessonReviewItemProps, OakLessonTopNav, type OakLessonTopNavProps, OakLessonVideoTranscript, OakLink, type OakLinkProps, OakLoadingSpinner, type OakLoadingSpinnerProps, OakMaxWidth, OakModal, OakModalBody, type OakModalBodyProps, OakModalFooter, type OakModalFooterProps, type OakModalProps, OakOL, type OakOLProps, type OakOpacityToken, OakP, type OakPProps, OakPrimaryButton, type OakPrimaryButtonProps, OakPrimaryInvertedButton, type OakPrimaryInvertedButtonProps, OakPrimaryNav, OakPrimaryNavItem, type OakPrimaryNavItemProps, type OakPrimaryNavProps, OakPromoTag, OakQuizCheckBox, type OakQuizCheckBoxProps, OakQuizCounter, type OakQuizCounterProps, OakQuizFeedback, type OakQuizFeedbackProps, OakQuizHint, type OakQuizHintProps, OakQuizMatch, type OakQuizMatchProps, OakQuizOrder, type OakQuizOrderProps, OakQuizRadioButton, type OakQuizRadioButtonProps, OakQuizTextInput, OakRadioButton, OakRadioGroup, OakRoundIcon, type OakRoundIconProps, OakSecondaryButton, type OakSecondaryButtonProps, type OakSpaceBetweenToken, OakSpan, type OakSpanProps, OakStaticMessageCard, OakSubjectIcon, type OakSubjectIconProps, OakTertiaryButton, OakTextInput, type OakTextInputProps, type OakTheme, OakThemeProvider, type OakThemeProviderProps, OakTooltip, type OakTooltipProps, type OakTransitionToken, OakTypography, type OakTypographyProps, OakUL, type OakULProps, type OakUiRoleToken, isValidIconName, oakAllSpacingTokens, oakBorderRadiusTokens, oakBorderWidthTokens, oakBoxCss, oakColorTokens, oakDefaultTheme, oakDropShadowTokens, oakFontSizeTokens, oakFontTokens, oakHeadingTags, oakIconNames, oakInnerPaddingTokens, oakOpacityTokens, oakSpaceBetweenTokens, oakTransitionTokens, oakUiRoleTokens };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oaknational/oak-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"licence": "MIT",
|
|
5
5
|
"description": "Shared components for Oak applications",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@storybook/addon-onboarding": "^1.0.10",
|
|
54
54
|
"@storybook/blocks": "^7.6.7",
|
|
55
55
|
"@storybook/nextjs": "^7.6.7",
|
|
56
|
+
"@storybook/preview-api": "^8.0.4",
|
|
56
57
|
"@storybook/react": "^7.6.7",
|
|
57
58
|
"@storybook/testing-library": "^0.2.2",
|
|
58
59
|
"@testing-library/jest-dom": "^6.2.0",
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
"@types/jest": "^29.5.11",
|
|
62
63
|
"@types/react": "^18.2.47",
|
|
63
64
|
"@types/react-test-renderer": "^18.0.7",
|
|
65
|
+
"@types/react-transition-group": "^4.4.10",
|
|
64
66
|
"@types/styled-components": "^5.1.34",
|
|
65
67
|
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
66
68
|
"@typescript-eslint/parser": "^6.18.1",
|
|
@@ -80,7 +82,9 @@
|
|
|
80
82
|
"prettier": "^3.1.1",
|
|
81
83
|
"react": "^18.2.0",
|
|
82
84
|
"react-dom": "^18.2.0",
|
|
85
|
+
"react-focus-on": "^3.9.2",
|
|
83
86
|
"react-test-renderer": "^18.2.0",
|
|
87
|
+
"react-transition-group": "^4.4.5",
|
|
84
88
|
"rollup": "^4.9.4",
|
|
85
89
|
"rollup-plugin-dts": "^6.1.0",
|
|
86
90
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|