@khanacademy/wonder-blocks-modal 8.10.2 → 8.10.4
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/.turbo/turbo-build$colon$css.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/es/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @khanacademy/wonder-blocks-modal@8.10.
|
|
2
|
+
> @khanacademy/wonder-blocks-modal@8.10.4 build:css /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-modal
|
|
3
3
|
> pnpm exec wonder-blocks-tokens .
|
|
4
4
|
|
|
5
5
|
CSS variables generated successfully in: /home/runner/work/wonder-blocks/wonder-blocks/packages/wonder-blocks-modal/dist/css
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-modal
|
|
2
2
|
|
|
3
|
+
## 8.10.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f95f310: FlexibleDialog: Stop injecting a hardcoded `testId` (`"title-heading-wrapper"`) into the `title` element. This prevents React warnings when `title` is a native DOM element (e.g. `<h1>`). The hardcoded test id isn't needed internally; if you need a test id on the title, pass it directly to the component you provide for the `title` prop (e.g. `title={<Heading testId="my-title">...</Heading>}`).
|
|
8
|
+
|
|
9
|
+
## 8.10.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [53fee3b]
|
|
14
|
+
- @khanacademy/wonder-blocks-config@0.7.1
|
|
15
|
+
- @khanacademy/wonder-blocks-breadcrumbs@3.3.6
|
|
16
|
+
|
|
3
17
|
## 8.10.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -48,7 +48,7 @@ const renderHeader=(props,uniqueId)=>{const{title,breadcrumbs=undefined,subtitle
|
|
|
48
48
|
|
|
49
49
|
function FlexiblePanel({closeButtonVisible=true,content,title,onClose,styles,testId}){const panelRef=React.useRef(null);const renderMainContent=React.useCallback(()=>{const contentNode=typeof content==="function"?content({title}):jsxs(Fragment,{children:[title,content]});const mainContent=ModalContent.isComponentOf(contentNode)?contentNode:jsx(ModalContent,{style:styles?.content,applySmallHeightStyles:false,children:contentNode});if(!mainContent){return mainContent}return React.cloneElement(mainContent,{applySmallHeightStyles:false,style:[mainContent.props.style]})},[title,content,styles?.content]);const mainContent=renderMainContent();const defaultBackgroundStyle={backgroundColor:semanticColor.core.background.base.default};const combinedBackgroundStyles={...defaultBackgroundStyle,...styles?.panel};return jsxs(View,{style:[componentStyles$2.wrapper,combinedBackgroundStyles],testId:testId&&`${testId}-panel`,ref:panelRef,children:[closeButtonVisible&&jsx(CloseButton,{onClick:onClose,style:[componentStyles$2.closeButton,styles?.closeButton],testId:testId&&`${testId}-close`}),mainContent]})}FlexiblePanel.defaultProps={closeButtonVisible:true};const componentStyles$2=StyleSheet.create({wrapper:{flex:"1 1 auto",flexDirection:"column",boxSizing:"border-box",overflow:"hidden",height:"100%",width:"100%"},closeButton:{position:"absolute",insetInlineEnd:theme.closeButton.layout.gapRight,insetBlockStart:theme.closeButton.layout.gapTop,zIndex:1,":focus":focusStyles.focus[":focus-visible"]}});
|
|
50
50
|
|
|
51
|
-
const FlexibleDialog=React.forwardRef(function FlexibleDialog(props,ref){const{onClose,title,content,styles,closeButtonVisible=true,testId,titleId,role="dialog",...accessibilityProps}=props;const uniqueId=React.useId();const headingId=titleId??uniqueId;const{ariaModalRef}=useModalAnnouncer(ref);const renderedTitle=title==null?null:typeof title==="string"?jsx(Heading,{id:headingId,children:title}):React.cloneElement(title,{id:headingId
|
|
51
|
+
const FlexibleDialog=React.forwardRef(function FlexibleDialog(props,ref){const{onClose,title,content,styles,closeButtonVisible=true,testId,titleId,role="dialog",...accessibilityProps}=props;const uniqueId=React.useId();const headingId=titleId??uniqueId;const{ariaModalRef}=useModalAnnouncer(ref);const renderedTitle=title==null?null:typeof title==="string"?jsx(Heading,{id:headingId,children:title}):React.cloneElement(title,{id:headingId});return jsx(View,{style:[componentStyles$1.root,styles?.root],children:jsx(View,{role:role,"aria-modal":"true","aria-label":accessibilityProps["aria-label"],"aria-labelledby":headingId,"aria-describedby":accessibilityProps["aria-describedby"],ref:ariaModalRef,testId:testId,style:[componentStyles$1.dialog,styles?.dialog],children:jsx(FlexiblePanel,{styles:{panel:styles?.panel,content:styles?.content,closeButton:styles?.closeButton},onClose:onClose,title:renderedTitle,content:content,closeButtonVisible:closeButtonVisible,testId:testId})})})});const componentStyles$1=StyleSheet.create({root:{boxShadow:theme.dialog.shadow.default,color:semanticColor.core.foreground.neutral.strong,overflow:"auto",position:"relative",willChange:"transform, opacity",height:"auto",maxBlockSize:"100vh",maxInlineSize:576,width:"93.75%"}});
|
|
52
52
|
|
|
53
53
|
const DRAWER_ENTER_DURATION_MS=300;const DRAWER_EXIT_DURATION_MS=150;const DRAWER_ENTER_EASING="cubic-bezier(0.05, 0.7, 0.1, 1)";const DRAWER_EXIT_EASING="cubic-bezier(0.3, 0, 0.8, 0.15)";const DRAWER_SLIDE_OFFSET="42%";
|
|
54
54
|
|
package/dist/index.js
CHANGED
|
@@ -77,7 +77,7 @@ const renderHeader=(props,uniqueId)=>{const{title,breadcrumbs=undefined,subtitle
|
|
|
77
77
|
|
|
78
78
|
function FlexiblePanel({closeButtonVisible=true,content,title,onClose,styles,testId}){const panelRef=React__namespace.useRef(null);const renderMainContent=React__namespace.useCallback(()=>{const contentNode=typeof content==="function"?content({title}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[title,content]});const mainContent=ModalContent.isComponentOf(contentNode)?contentNode:jsxRuntime.jsx(ModalContent,{style:styles?.content,applySmallHeightStyles:false,children:contentNode});if(!mainContent){return mainContent}return React__namespace.cloneElement(mainContent,{applySmallHeightStyles:false,style:[mainContent.props.style]})},[title,content,styles?.content]);const mainContent=renderMainContent();const defaultBackgroundStyle={backgroundColor:wonderBlocksTokens.semanticColor.core.background.base.default};const combinedBackgroundStyles={...defaultBackgroundStyle,...styles?.panel};return jsxRuntime.jsxs(wonderBlocksCore.View,{style:[componentStyles$2.wrapper,combinedBackgroundStyles],testId:testId&&`${testId}-panel`,ref:panelRef,children:[closeButtonVisible&&jsxRuntime.jsx(CloseButton,{onClick:onClose,style:[componentStyles$2.closeButton,styles?.closeButton],testId:testId&&`${testId}-close`}),mainContent]})}FlexiblePanel.defaultProps={closeButtonVisible:true};const componentStyles$2=aphrodite.StyleSheet.create({wrapper:{flex:"1 1 auto",flexDirection:"column",boxSizing:"border-box",overflow:"hidden",height:"100%",width:"100%"},closeButton:{position:"absolute",insetInlineEnd:theme.closeButton.layout.gapRight,insetBlockStart:theme.closeButton.layout.gapTop,zIndex:1,":focus":wonderBlocksStyles.focusStyles.focus[":focus-visible"]}});
|
|
79
79
|
|
|
80
|
-
const FlexibleDialog=React__namespace.forwardRef(function FlexibleDialog(props,ref){const{onClose,title,content,styles,closeButtonVisible=true,testId,titleId,role="dialog",...accessibilityProps}=props;const uniqueId=React__namespace.useId();const headingId=titleId??uniqueId;const{ariaModalRef}=useModalAnnouncer(ref);const renderedTitle=title==null?null:typeof title==="string"?jsxRuntime.jsx(wonderBlocksTypography.Heading,{id:headingId,children:title}):React__namespace.cloneElement(title,{id:headingId
|
|
80
|
+
const FlexibleDialog=React__namespace.forwardRef(function FlexibleDialog(props,ref){const{onClose,title,content,styles,closeButtonVisible=true,testId,titleId,role="dialog",...accessibilityProps}=props;const uniqueId=React__namespace.useId();const headingId=titleId??uniqueId;const{ariaModalRef}=useModalAnnouncer(ref);const renderedTitle=title==null?null:typeof title==="string"?jsxRuntime.jsx(wonderBlocksTypography.Heading,{id:headingId,children:title}):React__namespace.cloneElement(title,{id:headingId});return jsxRuntime.jsx(wonderBlocksCore.View,{style:[componentStyles$1.root,styles?.root],children:jsxRuntime.jsx(wonderBlocksCore.View,{role:role,"aria-modal":"true","aria-label":accessibilityProps["aria-label"],"aria-labelledby":headingId,"aria-describedby":accessibilityProps["aria-describedby"],ref:ariaModalRef,testId:testId,style:[componentStyles$1.dialog,styles?.dialog],children:jsxRuntime.jsx(FlexiblePanel,{styles:{panel:styles?.panel,content:styles?.content,closeButton:styles?.closeButton},onClose:onClose,title:renderedTitle,content:content,closeButtonVisible:closeButtonVisible,testId:testId})})})});const componentStyles$1=aphrodite.StyleSheet.create({root:{boxShadow:theme.dialog.shadow.default,color:wonderBlocksTokens.semanticColor.core.foreground.neutral.strong,overflow:"auto",position:"relative",willChange:"transform, opacity",height:"auto",maxBlockSize:"100vh",maxInlineSize:576,width:"93.75%"}});
|
|
81
81
|
|
|
82
82
|
const DRAWER_ENTER_DURATION_MS=300;const DRAWER_EXIT_DURATION_MS=150;const DRAWER_ENTER_EASING="cubic-bezier(0.05, 0.7, 0.1, 1)";const DRAWER_EXIT_EASING="cubic-bezier(0.3, 0, 0.8, 0.15)";const DRAWER_SLIDE_OFFSET="42%";
|
|
83
83
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "8.10.
|
|
6
|
+
"version": "8.10.4",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@khanacademy/wonder-blocks-announcer": "1.1.2",
|
|
32
|
-
"@khanacademy/wonder-blocks-breadcrumbs": "3.3.
|
|
32
|
+
"@khanacademy/wonder-blocks-breadcrumbs": "3.3.6",
|
|
33
|
+
"@khanacademy/wonder-blocks-config": "0.7.1",
|
|
33
34
|
"@khanacademy/wonder-blocks-core": "12.5.0",
|
|
34
35
|
"@khanacademy/wonder-blocks-icon-button": "12.0.2",
|
|
35
|
-
"@khanacademy/wonder-blocks-
|
|
36
|
+
"@khanacademy/wonder-blocks-layout": "3.2.1",
|
|
36
37
|
"@khanacademy/wonder-blocks-styles": "0.4.1",
|
|
37
38
|
"@khanacademy/wonder-blocks-timing": "7.1.0",
|
|
38
39
|
"@khanacademy/wonder-blocks-tokens": "18.1.0",
|
|
39
|
-
"@khanacademy/wonder-blocks-layout": "3.2.1",
|
|
40
40
|
"@khanacademy/wonder-blocks-typography": "5.0.6"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|