@wordpress/components 29.1.1 → 29.3.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/CHANGELOG.md +29 -6
- package/CONTRIBUTING.md +4 -4
- package/README.md +1 -1
- package/build/badge/index.js +26 -22
- package/build/badge/index.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js +8 -15
- package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build/box-control/index.js +6 -0
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/linked-button.js +7 -11
- package/build/box-control/linked-button.js.map +1 -1
- package/build/box-control/types.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +9 -7
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker.js +0 -1
- package/build/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build/color-palette/index.js +1 -6
- package/build/color-palette/index.js.map +1 -1
- package/build/font-size-picker/index.native.js +1 -1
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/higher-order/with-focus-return/index.js +1 -1
- package/build/higher-order/with-focus-return/index.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +22 -22
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/menu/checkbox-item.js +6 -6
- package/build/menu/checkbox-item.js.map +1 -1
- package/build/menu/context.js +2 -2
- package/build/menu/context.js.map +1 -1
- package/build/menu/group-label.js +4 -4
- package/build/menu/group-label.js.map +1 -1
- package/build/menu/group.js +4 -4
- package/build/menu/group.js.map +1 -1
- package/build/menu/index.js +87 -14
- package/build/menu/index.js.map +1 -1
- package/build/menu/item-help-text.js +4 -4
- package/build/menu/item-help-text.js.map +1 -1
- package/build/menu/item-label.js +4 -4
- package/build/menu/item-label.js.map +1 -1
- package/build/menu/item.js +6 -6
- package/build/menu/item.js.map +1 -1
- package/build/menu/popover.js +5 -5
- package/build/menu/popover.js.map +1 -1
- package/build/menu/radio-item.js +6 -6
- package/build/menu/radio-item.js.map +1 -1
- package/build/menu/separator.js +4 -4
- package/build/menu/separator.js.map +1 -1
- package/build/menu/styles.js +41 -41
- package/build/menu/styles.js.map +1 -1
- package/build/menu/submenu-trigger-item.js +5 -5
- package/build/menu/submenu-trigger-item.js.map +1 -1
- package/build/menu/trigger-button.js +3 -3
- package/build/menu/trigger-button.js.map +1 -1
- package/build/menu/types.js.map +1 -1
- package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
- package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
- package/build/mobile/utils/get-px-from-css-unit.native.js +3 -3
- package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build/notice/types.js.map +1 -1
- package/build/search-control/index.js +1 -1
- package/build/search-control/index.js.map +1 -1
- package/build/text/hook.js +8 -6
- package/build/text/hook.js.map +1 -1
- package/build/text/utils.js +1 -1
- package/build/text/utils.js.map +1 -1
- package/build-module/badge/index.js +28 -22
- package/build-module/badge/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js +8 -15
- package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build-module/box-control/index.js +6 -0
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/linked-button.js +7 -11
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/box-control/types.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +9 -7
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +0 -1
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/color-palette/index.js +1 -6
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +1 -1
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/higher-order/with-focus-return/index.js +1 -1
- package/build-module/higher-order/with-focus-return/index.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +22 -22
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/menu/checkbox-item.js +6 -6
- package/build-module/menu/checkbox-item.js.map +1 -1
- package/build-module/menu/context.js +1 -1
- package/build-module/menu/context.js.map +1 -1
- package/build-module/menu/group-label.js +4 -4
- package/build-module/menu/group-label.js.map +1 -1
- package/build-module/menu/group.js +4 -4
- package/build-module/menu/group.js.map +1 -1
- package/build-module/menu/index.js +99 -26
- package/build-module/menu/index.js.map +1 -1
- package/build-module/menu/item-help-text.js +4 -4
- package/build-module/menu/item-help-text.js.map +1 -1
- package/build-module/menu/item-label.js +4 -4
- package/build-module/menu/item-label.js.map +1 -1
- package/build-module/menu/item.js +6 -6
- package/build-module/menu/item.js.map +1 -1
- package/build-module/menu/popover.js +5 -5
- package/build-module/menu/popover.js.map +1 -1
- package/build-module/menu/radio-item.js +6 -6
- package/build-module/menu/radio-item.js.map +1 -1
- package/build-module/menu/separator.js +4 -4
- package/build-module/menu/separator.js.map +1 -1
- package/build-module/menu/styles.js +40 -40
- package/build-module/menu/styles.js.map +1 -1
- package/build-module/menu/submenu-trigger-item.js +6 -6
- package/build-module/menu/submenu-trigger-item.js.map +1 -1
- package/build-module/menu/trigger-button.js +3 -3
- package/build-module/menu/trigger-button.js.map +1 -1
- package/build-module/menu/types.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
- package/build-module/mobile/utils/get-px-from-css-unit.native.js +3 -3
- package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build-module/notice/types.js.map +1 -1
- package/build-module/search-control/index.js +1 -1
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/text/hook.js +8 -6
- package/build-module/text/hook.js.map +1 -1
- package/build-module/text/utils.js +1 -1
- package/build-module/text/utils.js.map +1 -1
- package/build-style/style-rtl.css +89 -170
- package/build-style/style.css +89 -170
- package/build-types/badge/index.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/linked-button.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +7 -2331
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +15 -3
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/higher-order/with-focus-return/index.d.ts +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/menu/checkbox-item.d.ts +2 -2
- package/build-types/menu/checkbox-item.d.ts.map +1 -1
- package/build-types/menu/context.d.ts +2 -2
- package/build-types/menu/context.d.ts.map +1 -1
- package/build-types/menu/group-label.d.ts +2 -2
- package/build-types/menu/group-label.d.ts.map +1 -1
- package/build-types/menu/group.d.ts +2 -2
- package/build-types/menu/group.d.ts.map +1 -1
- package/build-types/menu/index.d.ts +84 -12
- package/build-types/menu/index.d.ts.map +1 -1
- package/build-types/menu/item-help-text.d.ts +1 -1
- package/build-types/menu/item-help-text.d.ts.map +1 -1
- package/build-types/menu/item-label.d.ts +1 -1
- package/build-types/menu/item-label.d.ts.map +1 -1
- package/build-types/menu/item.d.ts +2 -2
- package/build-types/menu/item.d.ts.map +1 -1
- package/build-types/menu/popover.d.ts +2 -2
- package/build-types/menu/popover.d.ts.map +1 -1
- package/build-types/menu/radio-item.d.ts +2 -2
- package/build-types/menu/radio-item.d.ts.map +1 -1
- package/build-types/menu/separator.d.ts +2 -2
- package/build-types/menu/separator.d.ts.map +1 -1
- package/build-types/menu/styles.d.ts +15 -15
- package/build-types/menu/styles.d.ts.map +1 -1
- package/build-types/menu/submenu-trigger-item.d.ts +2 -2
- package/build-types/menu/submenu-trigger-item.d.ts.map +1 -1
- package/build-types/menu/trigger-button.d.ts +2 -2
- package/build-types/menu/trigger-button.d.ts.map +1 -1
- package/build-types/menu/types.d.ts +10 -10
- package/build-types/menu/types.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +1 -1
- package/build-types/notice/types.d.ts +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts +1 -1
- package/build-types/tabs/stories/index.story.d.ts +0 -3
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/utils.d.ts +1 -1
- package/package.json +19 -19
- package/src/animate/style.scss +16 -12
- package/src/badge/index.tsx +28 -27
- package/src/border-box-control/border-box-control-linked-button/component.tsx +9 -14
- package/src/border-control/test/index.js +12 -4
- package/src/box-control/index.tsx +9 -0
- package/src/box-control/linked-button.tsx +8 -11
- package/src/box-control/test/index.tsx +9 -2
- package/src/box-control/types.ts +26 -11
- package/src/button/style.scss +15 -12
- package/src/checkbox-control/style.scss +4 -2
- package/src/circular-option-picker/README.md +1 -2
- package/src/circular-option-picker/circular-option-picker-option.tsx +17 -10
- package/src/circular-option-picker/circular-option-picker.tsx +0 -1
- package/src/circular-option-picker/stories/index.story.tsx +0 -1
- package/src/circular-option-picker/style.scss +10 -5
- package/src/color-palette/index.tsx +0 -7
- package/src/color-palette/test/index.tsx +2 -8
- package/src/combobox-control/test/index.tsx +1 -1
- package/src/drop-zone/style.scss +6 -9
- package/src/font-size-picker/index.native.js +1 -1
- package/src/form-toggle/style.scss +17 -10
- package/src/form-token-field/style.scss +9 -4
- package/src/higher-order/navigate-regions/style.scss +2 -2
- package/src/higher-order/with-focus-return/index.tsx +1 -1
- package/src/input-control/styles/input-control-styles.tsx +6 -0
- package/src/menu/README.md +421 -174
- package/src/menu/checkbox-item.tsx +12 -12
- package/src/menu/context.tsx +2 -4
- package/src/menu/docs-manifest.json +62 -0
- package/src/menu/group-label.tsx +7 -7
- package/src/menu/group.tsx +7 -11
- package/src/menu/index.tsx +101 -31
- package/src/menu/item-help-text.tsx +5 -7
- package/src/menu/item-label.tsx +5 -7
- package/src/menu/item.tsx +12 -12
- package/src/menu/popover.tsx +9 -9
- package/src/menu/radio-item.tsx +12 -12
- package/src/menu/separator.tsx +7 -7
- package/src/menu/stories/best-practices.mdx +38 -0
- package/src/menu/stories/index.story.tsx +8 -8
- package/src/menu/styles.ts +24 -24
- package/src/menu/submenu-trigger-item.tsx +9 -9
- package/src/menu/trigger-button.tsx +6 -6
- package/src/menu/types.ts +10 -10
- package/src/menu-group/stories/index.story.tsx +2 -2
- package/src/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
- package/src/mobile/utils/get-px-from-css-unit.native.js +3 -3
- package/src/modal/style.scss +4 -2
- package/src/modal/test/index.tsx +5 -4
- package/src/notice/README.md +3 -3
- package/src/notice/types.ts +1 -1
- package/src/palette-edit/test/index.tsx +1 -1
- package/src/panel/style.scss +14 -6
- package/src/placeholder/style.scss +5 -3
- package/src/progress-bar/stories/index.story.tsx +1 -1
- package/src/resizable-box/style.scss +14 -9
- package/src/search-control/index.tsx +1 -1
- package/src/tab-panel/style.scss +6 -4
- package/src/tabs/stories/index.story.tsx +0 -131
- package/src/text/README.md +1 -1
- package/src/text/hook.ts +3 -2
- package/src/text/stories/index.story.tsx +2 -2
- package/src/text/test/index.tsx +1 -1
- package/src/text/utils.ts +1 -1
- package/src/text-highlight/test/index.tsx +3 -3
- package/src/toolbar/toolbar/style.scss +4 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_flex","_text","_utils","_jsxRuntime","_EMOTION_STRINGIFIED_CSS_ERROR__","Prefix","exports","_base","default","process","env","NODE_ENV","target","label","name","styles","map","toString","Suffix","backdropBorderColor","disabled","isBorderless","COLORS","ui","borderDisabled","border","BackdropUI","rtl","paddingLeft","Root","Flex","CONFIG","radiusSmall","borderFocus","controlBoxShadowFocus","containerDisabledStyles","backgroundColor","backgroundDisabled","background","css","_ref","containerWidthStyles","__unstableInputWidth","labelPosition","flex","width","Container","disabledStyles","color","textDisabled","fontSizeStyles","inputSize","size","sizes","small","compact","fontSize","fontSizeMobile","getSizeConfig","__next40pxDefaultSize","height","lineHeight","minHeight","controlPaddingX","paddingRight","controlPaddingXSmall","sizeStyles","props","customPaddings","paddingInlineStart","paddingInlineEnd","dragStyles","isDragging","dragCursor","defaultArrowStyles","activeDragCursorStyles","Input","theme","foreground","BaseLabel","Text","baseLabelTypography","Label","jsx","as","LabelWrapper","FlexItem","prefixSuffixWrapperStyles","variant","isPrefix","padding","paddingProperty","display","PrefixSuffixWrapper"],"sources":["@wordpress/components/src/input-control/styles/input-control-styles.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { SerializedStyles } from '@emotion/react';\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport type { CSSProperties, ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { Flex, FlexItem } from '../../flex';\nimport { Text } from '../../text';\nimport { baseLabelTypography, COLORS, CONFIG, rtl } from '../../utils';\nimport type { LabelPosition, Size, PrefixSuffixWrapperProps } from '../types';\n\ntype ContainerProps = {\n\tdisabled?: boolean;\n\thideLabel?: boolean;\n\t__unstableInputWidth?: CSSProperties[ 'width' ];\n\tlabelPosition?: LabelPosition;\n};\n\nexport const Prefix = styled.span`\n\tbox-sizing: border-box;\n\tdisplay: block;\n`;\n\nexport const Suffix = styled.span`\n\talign-items: center;\n\talign-self: stretch;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n`;\n\ntype BackdropProps = {\n\tdisabled?: boolean;\n\tisBorderless?: boolean;\n};\n\nconst backdropBorderColor = ( {\n\tdisabled,\n\tisBorderless,\n}: BackdropProps ): CSSProperties[ 'borderColor' ] => {\n\tif ( isBorderless ) {\n\t\treturn 'transparent';\n\t}\n\n\tif ( disabled ) {\n\t\treturn COLORS.ui.borderDisabled;\n\t}\n\n\treturn COLORS.ui.border;\n};\n\nexport const BackdropUI = styled.div< BackdropProps >`\n\t&&& {\n\t\tbox-sizing: border-box;\n\t\tborder-color: ${ backdropBorderColor };\n\t\tborder-radius: inherit;\n\t\tborder-style: solid;\n\t\tborder-width: 1px;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tpointer-events: none;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\n\t\t${ rtl( { paddingLeft: 2 } ) }\n\t}\n`;\n\nexport const Root = styled( Flex )`\n\tbox-sizing: border-box;\n\tposition: relative;\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tpadding-top: 0;\n\n\t// Focus within, excluding cases where auxiliary controls in prefix or suffix have focus.\n\t&:focus-within:not( :has( :is( ${ Prefix }, ${ Suffix } ):focus-within ) ) {\n\t\t${ BackdropUI } {\n\t\t\tborder-color: ${ COLORS.ui.borderFocus };\n\t\t\tbox-shadow: ${ CONFIG.controlBoxShadowFocus };\n\t\t\t// Windows High Contrast mode will show this outline, but not the box-shadow.\n\t\t\toutline: 2px solid transparent;\n\t\t\toutline-offset: -2px;\n\t\t}\n\t}\n`;\n\nconst containerDisabledStyles = ( { disabled }: ContainerProps ) => {\n\tconst backgroundColor = disabled\n\t\t? COLORS.ui.backgroundDisabled\n\t\t: COLORS.ui.background;\n\n\treturn css( { backgroundColor } );\n};\n\nconst containerWidthStyles = ( {\n\t__unstableInputWidth,\n\tlabelPosition,\n}: ContainerProps ) => {\n\tif ( ! __unstableInputWidth ) {\n\t\treturn css( { width: '100%' } );\n\t}\n\n\tif ( labelPosition === 'side' ) {\n\t\treturn '';\n\t}\n\n\tif ( labelPosition === 'edge' ) {\n\t\treturn css( {\n\t\t\tflex: `0 0 ${ __unstableInputWidth }`,\n\t\t} );\n\t}\n\n\treturn css( { width: __unstableInputWidth } );\n};\n\nexport const Container = styled.div< ContainerProps >`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tborder-radius: inherit;\n\tdisplay: flex;\n\tflex: 1;\n\tposition: relative;\n\n\t${ containerDisabledStyles }\n\t${ containerWidthStyles }\n`;\n\ntype InputProps = {\n\t__next40pxDefaultSize?: boolean;\n\tdisabled?: boolean;\n\tinputSize?: Size;\n\tisDragging?: boolean;\n\tdragCursor?: CSSProperties[ 'cursor' ];\n\tpaddingInlineStart?: CSSProperties[ 'paddingInlineStart' ];\n\tpaddingInlineEnd?: CSSProperties[ 'paddingInlineEnd' ];\n};\n\nconst disabledStyles = ( { disabled }: InputProps ) => {\n\tif ( ! disabled ) {\n\t\treturn '';\n\t}\n\n\treturn css( {\n\t\tcolor: COLORS.ui.textDisabled,\n\t} );\n};\n\nexport const fontSizeStyles = ( { inputSize: size }: InputProps ) => {\n\tconst sizes = {\n\t\tdefault: '13px',\n\t\tsmall: '11px',\n\t\tcompact: '13px',\n\t\t'__unstable-large': '13px',\n\t};\n\n\tconst fontSize = sizes[ size as Size ] || sizes.default;\n\tconst fontSizeMobile = '16px';\n\n\tif ( ! fontSize ) {\n\t\treturn '';\n\t}\n\n\treturn css`\n\t\tfont-size: ${ fontSizeMobile };\n\n\t\t@media ( min-width: 600px ) {\n\t\t\tfont-size: ${ fontSize };\n\t\t}\n\t`;\n};\n\nexport const getSizeConfig = ( {\n\tinputSize: size,\n\t__next40pxDefaultSize,\n}: InputProps ) => {\n\t// Paddings may be overridden by the custom paddings props.\n\tconst sizes = {\n\t\tdefault: {\n\t\t\theight: 40,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 40,\n\t\t\tpaddingLeft: CONFIG.controlPaddingX,\n\t\t\tpaddingRight: CONFIG.controlPaddingX,\n\t\t},\n\t\tsmall: {\n\t\t\theight: 24,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 24,\n\t\t\tpaddingLeft: CONFIG.controlPaddingXSmall,\n\t\t\tpaddingRight: CONFIG.controlPaddingXSmall,\n\t\t},\n\t\tcompact: {\n\t\t\theight: 32,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 32,\n\t\t\tpaddingLeft: CONFIG.controlPaddingXSmall,\n\t\t\tpaddingRight: CONFIG.controlPaddingXSmall,\n\t\t},\n\t\t'__unstable-large': {\n\t\t\theight: 40,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 40,\n\t\t\tpaddingLeft: CONFIG.controlPaddingX,\n\t\t\tpaddingRight: CONFIG.controlPaddingX,\n\t\t},\n\t};\n\n\tif ( ! __next40pxDefaultSize ) {\n\t\tsizes.default = sizes.compact;\n\t}\n\n\treturn sizes[ size as Size ] || sizes.default;\n};\n\nconst sizeStyles = ( props: InputProps ) => {\n\treturn css( getSizeConfig( props ) );\n};\n\nconst customPaddings = ( {\n\tpaddingInlineStart,\n\tpaddingInlineEnd,\n}: InputProps ) => {\n\treturn css( { paddingInlineStart, paddingInlineEnd } );\n};\n\nconst dragStyles = ( { isDragging, dragCursor }: InputProps ) => {\n\tlet defaultArrowStyles: SerializedStyles | undefined;\n\tlet activeDragCursorStyles: SerializedStyles | undefined;\n\n\tif ( isDragging ) {\n\t\tdefaultArrowStyles = css`\n\t\t\tcursor: ${ dragCursor };\n\t\t\tuser-select: none;\n\n\t\t\t&::-webkit-outer-spin-button,\n\t\t\t&::-webkit-inner-spin-button {\n\t\t\t\t-webkit-appearance: none !important;\n\t\t\t\tmargin: 0 !important;\n\t\t\t}\n\t\t`;\n\t}\n\n\tif ( isDragging && dragCursor ) {\n\t\tactiveDragCursorStyles = css`\n\t\t\t&:active {\n\t\t\t\tcursor: ${ dragCursor };\n\t\t\t}\n\t\t`;\n\t}\n\n\treturn css`\n\t\t${ defaultArrowStyles }\n\t\t${ activeDragCursorStyles }\n\t`;\n};\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const Input = styled.input< InputProps >`\n\t&&& {\n\t\tbackground-color: transparent;\n\t\tbox-sizing: border-box;\n\t\tborder: none;\n\t\tbox-shadow: none !important;\n\t\tcolor: ${ COLORS.theme.foreground };\n\t\tdisplay: block;\n\t\tfont-family: inherit;\n\t\tmargin: 0;\n\t\toutline: none;\n\t\twidth: 100%;\n\n\t\t${ dragStyles }\n\t\t${ disabledStyles }\n\t\t${ fontSizeStyles }\n\t\t${ sizeStyles }\n\t\t${ customPaddings }\n\n\t\t&::-webkit-input-placeholder {\n\t\t\tline-height: normal;\n\t\t}\n\t}\n`;\n\nconst BaseLabel = styled( Text )< { labelPosition?: LabelPosition } >`\n\t&&& {\n\t\t${ baseLabelTypography };\n\n\t\tbox-sizing: border-box;\n\t\tdisplay: block;\n\t\tpadding-top: 0;\n\t\tpadding-bottom: 0;\n\t\tmax-width: 100%;\n\t\tz-index: 1;\n\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n`;\n\nexport const Label = (\n\tprops: WordPressComponentProps<\n\t\t{ labelPosition?: LabelPosition; children: ReactNode },\n\t\t'label',\n\t\tfalse\n\t>\n) => <BaseLabel { ...props } as=\"label\" />;\n\nexport const LabelWrapper = styled( FlexItem )`\n\tmax-width: calc( 100% - 10px );\n`;\n\nconst prefixSuffixWrapperStyles = ( {\n\tvariant = 'default',\n\tsize,\n\t__next40pxDefaultSize,\n\tisPrefix,\n}: PrefixSuffixWrapperProps & { isPrefix?: boolean } ) => {\n\tconst { paddingLeft: padding } = getSizeConfig( {\n\t\tinputSize: size,\n\t\t__next40pxDefaultSize,\n\t} );\n\n\tconst paddingProperty = isPrefix\n\t\t? 'paddingInlineStart'\n\t\t: 'paddingInlineEnd';\n\n\tif ( variant === 'default' ) {\n\t\treturn css( {\n\t\t\t[ paddingProperty ]: padding,\n\t\t} );\n\t}\n\n\t// If variant is 'icon' or 'control'\n\treturn css( {\n\t\tdisplay: 'flex',\n\t\t[ paddingProperty ]: padding - 4,\n\t} );\n};\n\nexport const PrefixSuffixWrapper = styled.div`\n\t${ prefixSuffixWrapperStyles }\n`;\n"],"mappings":";;;;;;;;AAIA,IAAAA,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AAQ,CAAC,GAAGhC,aAAa,CAAE;IAC/CP,SAAS,EAAEC,IAAI;IACfO;EACD,CAAE,CAAC;EAEH,MAAMgC,eAAe,GAAGF,QAAQ,GAC7B,oBAAoB,GACpB,kBAAkB;EAErB,IAAKD,OAAO,KAAK,SAAS,EAAG;IAC5B,oBAAO,IAAAjD,UAAG,EAAE;MACX,CAAEoD,eAAe,GAAID;IACtB,CAAC,EAAAjF,OAAA,CAAAC,GAAA,CAAAC,QAAA,8DAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,kjWAAC,CAAC;EACJ;;EAEA;EACA,oBAAO,IAAA4B,UAAG,EAAE;IACXqD,OAAO,EAAE,MAAM;IACf,CAAED,eAAe,GAAID,OAAO,GAAG;EAChC,CAAC,EAAAjF,OAAA,CAAAC,GAAA,CAAAC,QAAA,8DAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,kjWAAC,CAAC;AACJ,CAAC;AAEM,MAAMkF,mBAAmB,GAAAvF,OAAA,CAAAuF,mBAAA,oBAAAtF,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAC5B0E,yBAAyB,SAAA9E,OAAA,CAAAC,GAAA,CAAAC,QAAA,ojWAC5B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","require","_flex","_text","_utils","_jsxRuntime","_EMOTION_STRINGIFIED_CSS_ERROR__","Prefix","exports","_base","default","process","env","NODE_ENV","target","label","name","styles","map","toString","Suffix","backdropBorderColor","disabled","isBorderless","COLORS","ui","borderDisabled","border","BackdropUI","rtl","paddingLeft","Root","Flex","CONFIG","radiusSmall","borderFocus","controlBoxShadowFocus","containerDisabledStyles","backgroundColor","backgroundDisabled","background","css","_ref","containerWidthStyles","__unstableInputWidth","labelPosition","flex","width","Container","disabledStyles","color","textDisabled","fontSizeStyles","inputSize","size","sizes","small","compact","fontSize","fontSizeMobile","getSizeConfig","__next40pxDefaultSize","height","lineHeight","minHeight","controlPaddingX","paddingRight","controlPaddingXSmall","sizeStyles","props","customPaddings","paddingInlineStart","paddingInlineEnd","dragStyles","isDragging","dragCursor","defaultArrowStyles","activeDragCursorStyles","Input","theme","foreground","BaseLabel","Text","baseLabelTypography","Label","jsx","as","LabelWrapper","FlexItem","prefixSuffixWrapperStyles","variant","isPrefix","padding","paddingProperty","display","PrefixSuffixWrapper"],"sources":["@wordpress/components/src/input-control/styles/input-control-styles.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { SerializedStyles } from '@emotion/react';\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport type { CSSProperties, ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { Flex, FlexItem } from '../../flex';\nimport { Text } from '../../text';\nimport { baseLabelTypography, COLORS, CONFIG, rtl } from '../../utils';\nimport type { LabelPosition, Size, PrefixSuffixWrapperProps } from '../types';\n\ntype ContainerProps = {\n\tdisabled?: boolean;\n\thideLabel?: boolean;\n\t__unstableInputWidth?: CSSProperties[ 'width' ];\n\tlabelPosition?: LabelPosition;\n};\n\nexport const Prefix = styled.span`\n\tbox-sizing: border-box;\n\tdisplay: block;\n`;\n\nexport const Suffix = styled.span`\n\talign-items: center;\n\talign-self: stretch;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n`;\n\ntype BackdropProps = {\n\tdisabled?: boolean;\n\tisBorderless?: boolean;\n};\n\nconst backdropBorderColor = ( {\n\tdisabled,\n\tisBorderless,\n}: BackdropProps ): CSSProperties[ 'borderColor' ] => {\n\tif ( isBorderless ) {\n\t\treturn 'transparent';\n\t}\n\n\tif ( disabled ) {\n\t\treturn COLORS.ui.borderDisabled;\n\t}\n\n\treturn COLORS.ui.border;\n};\n\nexport const BackdropUI = styled.div< BackdropProps >`\n\t&&& {\n\t\tbox-sizing: border-box;\n\t\tborder-color: ${ backdropBorderColor };\n\t\tborder-radius: inherit;\n\t\tborder-style: solid;\n\t\tborder-width: 1px;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tpointer-events: none;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\n\t\t${ rtl( { paddingLeft: 2 } ) }\n\t}\n`;\n\nexport const Root = styled( Flex )`\n\tbox-sizing: border-box;\n\tposition: relative;\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tpadding-top: 0;\n\n\t// Focus within, excluding cases where auxiliary controls in prefix or suffix have focus.\n\t&:focus-within:not( :has( :is( ${ Prefix }, ${ Suffix } ):focus-within ) ) {\n\t\t${ BackdropUI } {\n\t\t\tborder-color: ${ COLORS.ui.borderFocus };\n\t\t\tbox-shadow: ${ CONFIG.controlBoxShadowFocus };\n\t\t\t// Windows High Contrast mode will show this outline, but not the box-shadow.\n\t\t\toutline: 2px solid transparent;\n\t\t\toutline-offset: -2px;\n\t\t}\n\t}\n`;\n\nconst containerDisabledStyles = ( { disabled }: ContainerProps ) => {\n\tconst backgroundColor = disabled\n\t\t? COLORS.ui.backgroundDisabled\n\t\t: COLORS.ui.background;\n\n\treturn css( { backgroundColor } );\n};\n\nconst containerWidthStyles = ( {\n\t__unstableInputWidth,\n\tlabelPosition,\n}: ContainerProps ) => {\n\tif ( ! __unstableInputWidth ) {\n\t\treturn css( { width: '100%' } );\n\t}\n\n\tif ( labelPosition === 'side' ) {\n\t\treturn '';\n\t}\n\n\tif ( labelPosition === 'edge' ) {\n\t\treturn css( {\n\t\t\tflex: `0 0 ${ __unstableInputWidth }`,\n\t\t} );\n\t}\n\n\treturn css( { width: __unstableInputWidth } );\n};\n\nexport const Container = styled.div< ContainerProps >`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tborder-radius: inherit;\n\tdisplay: flex;\n\tflex: 1;\n\tposition: relative;\n\n\t${ containerDisabledStyles }\n\t${ containerWidthStyles }\n`;\n\ntype InputProps = {\n\t__next40pxDefaultSize?: boolean;\n\tdisabled?: boolean;\n\tinputSize?: Size;\n\tisDragging?: boolean;\n\tdragCursor?: CSSProperties[ 'cursor' ];\n\tpaddingInlineStart?: CSSProperties[ 'paddingInlineStart' ];\n\tpaddingInlineEnd?: CSSProperties[ 'paddingInlineEnd' ];\n};\n\nconst disabledStyles = ( { disabled }: InputProps ) => {\n\tif ( ! disabled ) {\n\t\treturn '';\n\t}\n\n\treturn css( {\n\t\tcolor: COLORS.ui.textDisabled,\n\t} );\n};\n\nexport const fontSizeStyles = ( { inputSize: size }: InputProps ) => {\n\tconst sizes = {\n\t\tdefault: '13px',\n\t\tsmall: '11px',\n\t\tcompact: '13px',\n\t\t'__unstable-large': '13px',\n\t};\n\n\tconst fontSize = sizes[ size as Size ] || sizes.default;\n\tconst fontSizeMobile = '16px';\n\n\tif ( ! fontSize ) {\n\t\treturn '';\n\t}\n\n\treturn css`\n\t\tfont-size: ${ fontSizeMobile };\n\n\t\t@media ( min-width: 600px ) {\n\t\t\tfont-size: ${ fontSize };\n\t\t}\n\t`;\n};\n\nexport const getSizeConfig = ( {\n\tinputSize: size,\n\t__next40pxDefaultSize,\n}: InputProps ) => {\n\t// Paddings may be overridden by the custom paddings props.\n\tconst sizes = {\n\t\tdefault: {\n\t\t\theight: 40,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 40,\n\t\t\tpaddingLeft: CONFIG.controlPaddingX,\n\t\t\tpaddingRight: CONFIG.controlPaddingX,\n\t\t},\n\t\tsmall: {\n\t\t\theight: 24,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 24,\n\t\t\tpaddingLeft: CONFIG.controlPaddingXSmall,\n\t\t\tpaddingRight: CONFIG.controlPaddingXSmall,\n\t\t},\n\t\tcompact: {\n\t\t\theight: 32,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 32,\n\t\t\tpaddingLeft: CONFIG.controlPaddingXSmall,\n\t\t\tpaddingRight: CONFIG.controlPaddingXSmall,\n\t\t},\n\t\t'__unstable-large': {\n\t\t\theight: 40,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 40,\n\t\t\tpaddingLeft: CONFIG.controlPaddingX,\n\t\t\tpaddingRight: CONFIG.controlPaddingX,\n\t\t},\n\t};\n\n\tif ( ! __next40pxDefaultSize ) {\n\t\tsizes.default = sizes.compact;\n\t}\n\n\treturn sizes[ size as Size ] || sizes.default;\n};\n\nconst sizeStyles = ( props: InputProps ) => {\n\treturn css( getSizeConfig( props ) );\n};\n\nconst customPaddings = ( {\n\tpaddingInlineStart,\n\tpaddingInlineEnd,\n}: InputProps ) => {\n\treturn css( { paddingInlineStart, paddingInlineEnd } );\n};\n\nconst dragStyles = ( { isDragging, dragCursor }: InputProps ) => {\n\tlet defaultArrowStyles: SerializedStyles | undefined;\n\tlet activeDragCursorStyles: SerializedStyles | undefined;\n\n\tif ( isDragging ) {\n\t\tdefaultArrowStyles = css`\n\t\t\tcursor: ${ dragCursor };\n\t\t\tuser-select: none;\n\n\t\t\t&::-webkit-outer-spin-button,\n\t\t\t&::-webkit-inner-spin-button {\n\t\t\t\t-webkit-appearance: none !important;\n\t\t\t\tmargin: 0 !important;\n\t\t\t}\n\t\t`;\n\t}\n\n\tif ( isDragging && dragCursor ) {\n\t\tactiveDragCursorStyles = css`\n\t\t\t&:active {\n\t\t\t\tcursor: ${ dragCursor };\n\t\t\t}\n\t\t`;\n\t}\n\n\treturn css`\n\t\t${ defaultArrowStyles }\n\t\t${ activeDragCursorStyles }\n\t`;\n};\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const Input = styled.input< InputProps >`\n\t&&& {\n\t\tbackground-color: transparent;\n\t\tbox-sizing: border-box;\n\t\tborder: none;\n\t\tbox-shadow: none !important;\n\t\tcolor: ${ COLORS.theme.foreground };\n\t\tdisplay: block;\n\t\tfont-family: inherit;\n\t\tmargin: 0;\n\t\toutline: none;\n\t\twidth: 100%;\n\n\t\t${ dragStyles }\n\t\t${ disabledStyles }\n\t\t${ fontSizeStyles }\n\t\t${ sizeStyles }\n\t\t${ customPaddings }\n\n\t\t&::-webkit-input-placeholder {\n\t\t\tline-height: normal;\n\t\t}\n\n\t\t&[type='email'],\n\t\t&[type='url'] {\n\t\t\t/* rtl:ignore */\n\t\t\tdirection: ltr;\n\t\t}\n\t}\n`;\n\nconst BaseLabel = styled( Text )< { labelPosition?: LabelPosition } >`\n\t&&& {\n\t\t${ baseLabelTypography };\n\n\t\tbox-sizing: border-box;\n\t\tdisplay: block;\n\t\tpadding-top: 0;\n\t\tpadding-bottom: 0;\n\t\tmax-width: 100%;\n\t\tz-index: 1;\n\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n`;\n\nexport const Label = (\n\tprops: WordPressComponentProps<\n\t\t{ labelPosition?: LabelPosition; children: ReactNode },\n\t\t'label',\n\t\tfalse\n\t>\n) => <BaseLabel { ...props } as=\"label\" />;\n\nexport const LabelWrapper = styled( FlexItem )`\n\tmax-width: calc( 100% - 10px );\n`;\n\nconst prefixSuffixWrapperStyles = ( {\n\tvariant = 'default',\n\tsize,\n\t__next40pxDefaultSize,\n\tisPrefix,\n}: PrefixSuffixWrapperProps & { isPrefix?: boolean } ) => {\n\tconst { paddingLeft: padding } = getSizeConfig( {\n\t\tinputSize: size,\n\t\t__next40pxDefaultSize,\n\t} );\n\n\tconst paddingProperty = isPrefix\n\t\t? 'paddingInlineStart'\n\t\t: 'paddingInlineEnd';\n\n\tif ( variant === 'default' ) {\n\t\treturn css( {\n\t\t\t[ paddingProperty ]: padding,\n\t\t} );\n\t}\n\n\t// If variant is 'icon' or 'control'\n\treturn css( {\n\t\tdisplay: 'flex',\n\t\t[ paddingProperty ]: padding - 4,\n\t} );\n};\n\nexport const PrefixSuffixWrapper = styled.div`\n\t${ prefixSuffixWrapperStyles }\n`;\n"],"mappings":";;;;;;;;AAIA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,KAAA,GAAAD,OAAA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IACfO;EACD,CAAE,CAAC;EAEH,MAAMgC,eAAe,GAAGF,QAAQ,GAC7B,oBAAoB,GACpB,kBAAkB;EAErB,IAAKD,OAAO,KAAK,SAAS,EAAG;IAC5B,oBAAO,IAAAjD,UAAG,EAAE;MACX,CAAEoD,eAAe,GAAID;IACtB,CAAC,EAAAjF,OAAA,CAAAC,GAAA,CAAAC,QAAA,8DAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,srWAAC,CAAC;EACJ;;EAEA;EACA,oBAAO,IAAA4B,UAAG,EAAE;IACXqD,OAAO,EAAE,MAAM;IACf,CAAED,eAAe,GAAID,OAAO,GAAG;EAChC,CAAC,EAAAjF,OAAA,CAAAC,GAAA,CAAAC,QAAA,8DAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,srWAAC,CAAC;AACJ,CAAC;AAEM,MAAMkF,mBAAmB,GAAAvF,OAAA,CAAAuF,mBAAA,oBAAAtF,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAC5B0E,yBAAyB,SAAA9E,OAAA,CAAAC,GAAA,CAAAC,QAAA,wrWAC5B","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.CheckboxItem = void 0;
|
|
7
7
|
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
9
|
var _icons = require("@wordpress/icons");
|
|
@@ -24,18 +24,18 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
24
24
|
* Internal dependencies
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
const
|
|
27
|
+
const CheckboxItem = exports.CheckboxItem = (0, _element.forwardRef)(function CheckboxItem({
|
|
28
28
|
suffix,
|
|
29
29
|
children,
|
|
30
30
|
disabled = false,
|
|
31
31
|
hideOnClick = false,
|
|
32
32
|
...props
|
|
33
33
|
}, ref) {
|
|
34
|
-
const menuContext = (0, _element.useContext)(_context.
|
|
34
|
+
const menuContext = (0, _element.useContext)(_context.Context);
|
|
35
35
|
if (!menuContext?.store) {
|
|
36
36
|
throw new Error('Menu.CheckboxItem can only be rendered inside a Menu component');
|
|
37
37
|
}
|
|
38
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.CheckboxItem, {
|
|
39
39
|
ref: ref,
|
|
40
40
|
...props,
|
|
41
41
|
accessibleWhenDisabled: true,
|
|
@@ -55,8 +55,8 @@ const MenuCheckboxItem = exports.MenuCheckboxItem = (0, _element.forwardRef)(fun
|
|
|
55
55
|
icon: _icons.check,
|
|
56
56
|
size: 24
|
|
57
57
|
})
|
|
58
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.
|
|
59
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.
|
|
58
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.ItemContentWrapper, {
|
|
59
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemChildrenWrapper, {
|
|
60
60
|
children: children
|
|
61
61
|
}), suffix && /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemSuffixWrapper, {
|
|
62
62
|
children: suffix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_icons","_context","Styled","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_icons","_context","Styled","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CheckboxItem","exports","forwardRef","suffix","children","disabled","hideOnClick","props","ref","menuContext","useContext","Context","store","Error","jsxs","accessibleWhenDisabled","jsx","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","Icon","icon","check","size","ItemContentWrapper","ItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/checkbox-item.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { Context } from './context';\nimport type { CheckboxItemProps } from './types';\nimport * as Styled from './styles';\n\nexport const CheckboxItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CheckboxItemProps, 'div', false >\n>( function CheckboxItem(\n\t{ suffix, children, disabled = false, hideOnClick = false, ...props },\n\tref\n) {\n\tconst menuContext = useContext( Context );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.CheckboxItem can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.CheckboxItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ disabled }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ menuContext.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ menuContext.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t\t// Override some ariakit inline styles\n\t\t\t\tstyle={ { width: 'auto', height: 'auto' } }\n\t\t\t>\n\t\t\t\t<Icon icon={ check } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.ItemContentWrapper>\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AAG;QAAEC,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAG;MAAAlB,QAAA,eAE3C,IAAAzB,WAAA,CAAAqC,GAAA,EAACxC,MAAA,CAAA+C,IAAI;QAACC,IAAI,EAAGC,YAAO;QAACC,IAAI,EAAG;MAAI,CAAE;IAAC,CACb,CAAC,eAExB,IAAA/C,WAAA,CAAAmC,IAAA,EAACpC,MAAM,CAACiD,kBAAkB;MAAAvB,QAAA,gBACzB,IAAAzB,WAAA,CAAAqC,GAAA,EAACtC,MAAM,CAACkD,mBAAmB;QAAAxB,QAAA,EACxBA;MAAQ,CACiB,CAAC,EAE3BD,MAAM,iBACP,IAAAxB,WAAA,CAAAqC,GAAA,EAACtC,MAAM,CAACmD,iBAAiB;QAAAzB,QAAA,EACtBD;MAAM,CACiB,CAC1B;IAAA,CACyB,CAAC;EAAA,CACR,CAAC;AAExB,CAAE,CAAC","ignoreList":[]}
|
package/build/menu/context.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Context = void 0;
|
|
7
7
|
var _element = require("@wordpress/element");
|
|
8
8
|
/**
|
|
9
9
|
* WordPress dependencies
|
|
@@ -13,5 +13,5 @@ var _element = require("@wordpress/element");
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const Context = exports.Context = (0, _element.createContext)(undefined);
|
|
17
17
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","
|
|
1
|
+
{"version":3,"names":["_element","require","Context","exports","createContext","undefined"],"sources":["@wordpress/components/src/menu/context.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ContextProps } from './types';\n\nexport const Context = createContext< ContextProps | undefined >( undefined );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,IAAAE,sBAAa,EAA8BC,SAAU,CAAC","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.GroupLabel = void 0;
|
|
7
7
|
var _element = require("@wordpress/element");
|
|
8
8
|
var _context = require("./context");
|
|
9
9
|
var _text = require("../text");
|
|
@@ -19,12 +19,12 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
const
|
|
23
|
-
const menuContext = (0, _element.useContext)(_context.
|
|
22
|
+
const GroupLabel = exports.GroupLabel = (0, _element.forwardRef)(function Group(props, ref) {
|
|
23
|
+
const menuContext = (0, _element.useContext)(_context.Context);
|
|
24
24
|
if (!menuContext?.store) {
|
|
25
25
|
throw new Error('Menu.GroupLabel can only be rendered inside a Menu component');
|
|
26
26
|
}
|
|
27
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.GroupLabel, {
|
|
28
28
|
ref: ref,
|
|
29
29
|
render:
|
|
30
30
|
/*#__PURE__*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_context","_text","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","
|
|
1
|
+
{"version":3,"names":["_element","require","_context","_text","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","GroupLabel","exports","forwardRef","Group","props","ref","menuContext","useContext","Context","store","Error","jsx","render","Text","upperCase","variant","size","weight","lineHeight"],"sources":["@wordpress/components/src/menu/group-label.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { Context } from './context';\nimport { Text } from '../text';\nimport type { GroupLabelProps } from './types';\nimport * as Styled from './styles';\n\nexport const GroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< GroupLabelProps, 'div', false >\n>( function Group( props, ref ) {\n\tconst menuContext = useContext( Context );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.GroupLabel can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.GroupLabel\n\t\t\tref={ ref }\n\t\t\trender={\n\t\t\t\t// @ts-expect-error The `children` prop is passed\n\t\t\t\t<Text\n\t\t\t\t\tupperCase\n\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\tsize=\"11px\"\n\t\t\t\t\tweight={ 500 }\n\t\t\t\t\tlineHeight=\"16px\"\n\t\t\t\t/>\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\tstore={ menuContext.store }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAAmC,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,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KAAK,CACd,8DACD,CAAC;EACF;EAEA,oBACC,IAAA/B,WAAA,CAAAgC,GAAA,EAAClC,MAAM,CAACuB,UAAU;IACjBK,GAAG,EAAGA,GAAK;IACXO,MAAM;IAAA;IACL;IACA,IAAAjC,WAAA,CAAAgC,GAAA,EAACnC,KAAA,CAAAqC,IAAI;MACJC,SAAS;MACTC,OAAO,EAAC,OAAO;MACfC,IAAI,EAAC,MAAM;MACXC,MAAM,EAAG,GAAK;MACdC,UAAU,EAAC;IAAM,CACjB,CACD;IAAA,GACId,KAAK;IACVK,KAAK,EAAGH,WAAW,CAACG;EAAO,CAC3B,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
|
package/build/menu/group.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Group = void 0;
|
|
7
7
|
var _element = require("@wordpress/element");
|
|
8
8
|
var _context = require("./context");
|
|
9
9
|
var Styled = _interopRequireWildcard(require("./styles"));
|
|
@@ -18,12 +18,12 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
const menuContext = (0, _element.useContext)(_context.
|
|
21
|
+
const Group = exports.Group = (0, _element.forwardRef)(function Group(props, ref) {
|
|
22
|
+
const menuContext = (0, _element.useContext)(_context.Context);
|
|
23
23
|
if (!menuContext?.store) {
|
|
24
24
|
throw new Error('Menu.Group can only be rendered inside a Menu component');
|
|
25
25
|
}
|
|
26
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.Group, {
|
|
27
27
|
ref: ref,
|
|
28
28
|
...props,
|
|
29
29
|
store: menuContext.store
|
package/build/menu/group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_context","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","
|
|
1
|
+
{"version":3,"names":["_element","require","_context","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Group","exports","forwardRef","props","ref","menuContext","useContext","Context","store","Error","jsx"],"sources":["@wordpress/components/src/menu/group.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { Context } from './context';\nimport type { GroupProps } from './types';\nimport * as Styled from './styles';\n\nexport const Group = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< GroupProps, 'div', false >\n>( function Group( props, ref ) {\n\tconst menuContext = useContext( Context );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.Group can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.Group ref={ ref } { ...props } store={ menuContext.store } />\n\t);\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAmC,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CA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AGA,GAAK;IAAA,GAAMD,KAAK;IAAGK,KAAK,EAAGH,WAAW,CAACG;EAAO,CAAE,CAAC;AAEvE,CAAE,CAAC","ignoreList":[]}
|
package/build/menu/index.js
CHANGED
|
@@ -45,7 +45,7 @@ const UnconnectedMenu = props => {
|
|
|
45
45
|
// From internal components context
|
|
46
46
|
variant
|
|
47
47
|
} = (0, _context.useContextSystem)(props, 'Menu');
|
|
48
|
-
const parentContext = (0, _element.useContext)(_context2.
|
|
48
|
+
const parentContext = (0, _element.useContext)(_context2.Context);
|
|
49
49
|
const rtl = (0, _i18n.isRTL)();
|
|
50
50
|
|
|
51
51
|
// If an explicit value for the `placement` prop is not passed,
|
|
@@ -75,46 +75,119 @@ const UnconnectedMenu = props => {
|
|
|
75
75
|
store: menuStore,
|
|
76
76
|
variant
|
|
77
77
|
}), [menuStore, variant]);
|
|
78
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context2.
|
|
78
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context2.Context.Provider, {
|
|
79
79
|
value: contextValue,
|
|
80
80
|
children: children
|
|
81
81
|
});
|
|
82
82
|
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Menu is a collection of React components that combine to render
|
|
86
|
+
* ARIA-compliant [menu](https://www.w3.org/WAI/ARIA/apg/patterns/menu/) and
|
|
87
|
+
* [menu button](https://www.w3.org/WAI/ARIA/apg/patterns/menubutton/) patterns.
|
|
88
|
+
*
|
|
89
|
+
* `Menu` itself is a wrapper component and context provider.
|
|
90
|
+
* It is responsible for managing the state of the menu and its items, and for
|
|
91
|
+
* rendering the `Menu.TriggerButton` (or the `Menu.SubmenuTriggerItem`)
|
|
92
|
+
* component, and the `Menu.Popover` component.
|
|
93
|
+
*/
|
|
83
94
|
const Menu = exports.Menu = Object.assign((0, _context.contextConnectWithoutRef)(UnconnectedMenu, 'Menu'), {
|
|
84
|
-
Context: Object.assign(_context2.
|
|
95
|
+
Context: Object.assign(_context2.Context, {
|
|
85
96
|
displayName: 'Menu.Context'
|
|
86
97
|
}),
|
|
87
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Renders a menu item inside the `Menu.Popover` or `Menu.Group` components.
|
|
100
|
+
*
|
|
101
|
+
* It can optionally contain one instance of the `Menu.ItemLabel` component
|
|
102
|
+
* and one instance of the `Menu.ItemHelpText` component.
|
|
103
|
+
*/
|
|
104
|
+
Item: Object.assign(_item.Item, {
|
|
88
105
|
displayName: 'Menu.Item'
|
|
89
106
|
}),
|
|
90
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Renders a radio menu item inside the `Menu.Popover` or `Menu.Group`
|
|
109
|
+
* components.
|
|
110
|
+
*
|
|
111
|
+
* It can optionally contain one instance of the `Menu.ItemLabel` component
|
|
112
|
+
* and one instance of the `Menu.ItemHelpText` component.
|
|
113
|
+
*/
|
|
114
|
+
RadioItem: Object.assign(_radioItem.RadioItem, {
|
|
91
115
|
displayName: 'Menu.RadioItem'
|
|
92
116
|
}),
|
|
93
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Renders a checkbox menu item inside the `Menu.Popover` or `Menu.Group`
|
|
119
|
+
* components.
|
|
120
|
+
*
|
|
121
|
+
* It can optionally contain one instance of the `Menu.ItemLabel` component
|
|
122
|
+
* and one instance of the `Menu.ItemHelpText` component.
|
|
123
|
+
*/
|
|
124
|
+
CheckboxItem: Object.assign(_checkboxItem.CheckboxItem, {
|
|
94
125
|
displayName: 'Menu.CheckboxItem'
|
|
95
126
|
}),
|
|
96
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Renders a group for menu items.
|
|
129
|
+
*
|
|
130
|
+
* It should contain one instance of `Menu.GroupLabel` and one or more
|
|
131
|
+
* instances of `Menu.Item`, `Menu.RadioItem`, or `Menu.CheckboxItem`.
|
|
132
|
+
*/
|
|
133
|
+
Group: Object.assign(_group.Group, {
|
|
97
134
|
displayName: 'Menu.Group'
|
|
98
135
|
}),
|
|
99
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Renders a label in a menu group.
|
|
138
|
+
*
|
|
139
|
+
* This component should be wrapped with `Menu.Group` so the
|
|
140
|
+
* `aria-labelledby` is correctly set on the group element.
|
|
141
|
+
*/
|
|
142
|
+
GroupLabel: Object.assign(_groupLabel.GroupLabel, {
|
|
100
143
|
displayName: 'Menu.GroupLabel'
|
|
101
144
|
}),
|
|
102
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Renders a divider between menu items or menu groups.
|
|
147
|
+
*/
|
|
148
|
+
Separator: Object.assign(_separator.Separator, {
|
|
103
149
|
displayName: 'Menu.Separator'
|
|
104
150
|
}),
|
|
105
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Renders a menu item's label text. It should be wrapped with `Menu.Item`,
|
|
153
|
+
* `Menu.RadioItem`, or `Menu.CheckboxItem`.
|
|
154
|
+
*/
|
|
155
|
+
ItemLabel: Object.assign(_itemLabel.ItemLabel, {
|
|
106
156
|
displayName: 'Menu.ItemLabel'
|
|
107
157
|
}),
|
|
108
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Renders a menu item's help text. It should be wrapped with `Menu.Item`,
|
|
160
|
+
* `Menu.RadioItem`, or `Menu.CheckboxItem`.
|
|
161
|
+
*/
|
|
162
|
+
ItemHelpText: Object.assign(_itemHelpText.ItemHelpText, {
|
|
109
163
|
displayName: 'Menu.ItemHelpText'
|
|
110
164
|
}),
|
|
111
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Renders a dropdown menu element that's controlled by a sibling
|
|
167
|
+
* `Menu.TriggerButton` component. It renders a popover and automatically
|
|
168
|
+
* focuses on items when the menu is shown.
|
|
169
|
+
*
|
|
170
|
+
* The only valid children of `Menu.Popover` are `Menu.Item`,
|
|
171
|
+
* `Menu.RadioItem`, `Menu.CheckboxItem`, `Menu.Group`, `Menu.Separator`,
|
|
172
|
+
* and `Menu` (for nested dropdown menus).
|
|
173
|
+
*/
|
|
174
|
+
Popover: Object.assign(_popover.Popover, {
|
|
112
175
|
displayName: 'Menu.Popover'
|
|
113
176
|
}),
|
|
114
|
-
|
|
177
|
+
/**
|
|
178
|
+
* Renders a menu button that toggles the visibility of a sibling
|
|
179
|
+
* `Menu.Popover` component when clicked or when using arrow keys.
|
|
180
|
+
*/
|
|
181
|
+
TriggerButton: Object.assign(_triggerButton.TriggerButton, {
|
|
115
182
|
displayName: 'Menu.TriggerButton'
|
|
116
183
|
}),
|
|
117
|
-
|
|
184
|
+
/**
|
|
185
|
+
* Renders a menu item that toggles the visibility of a sibling
|
|
186
|
+
* `Menu.Popover` component when clicked or when using arrow keys.
|
|
187
|
+
*
|
|
188
|
+
* This component is used to create a nested dropdown menu.
|
|
189
|
+
*/
|
|
190
|
+
SubmenuTriggerItem: Object.assign(_submenuTriggerItem.SubmenuTriggerItem, {
|
|
118
191
|
displayName: 'Menu.SubmenuTriggerItem'
|
|
119
192
|
})
|
|
120
193
|
});
|
package/build/menu/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_i18n","_context","_context2","_item","_checkboxItem","_radioItem","_group","_groupLabel","_separator","_itemLabel","_itemHelpText","_triggerButton","_submenuTriggerItem","_popover","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedMenu","props","children","defaultOpen","open","onOpenChange","placement","variant","useContextSystem","parentContext","useContext","MenuContext","rtl","isRTLFn","computedPlacement","store","test","replace","menuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","contextValue","useMemo","jsx","Provider","value","Menu","exports","assign","contextConnectWithoutRef","Context","displayName","Item","MenuItem","RadioItem","MenuRadioItem","CheckboxItem","MenuCheckboxItem","Group","MenuGroup","GroupLabel","MenuGroupLabel","Separator","MenuSeparator","ItemLabel","MenuItemLabel","ItemHelpText","MenuItemHelpText","Popover","MenuPopover","TriggerButton","MenuTriggerButton","SubmenuTriggerItem","MenuSubmenuTriggerItem","_default"],"sources":["@wordpress/components/src/menu/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo } from '@wordpress/element';\nimport { isRTL as isRTLFn } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnectWithoutRef } from '../context';\nimport type { MenuContext as MenuContextType, MenuProps } from './types';\nimport { MenuContext } from './context';\nimport { MenuItem } from './item';\nimport { MenuCheckboxItem } from './checkbox-item';\nimport { MenuRadioItem } from './radio-item';\nimport { MenuGroup } from './group';\nimport { MenuGroupLabel } from './group-label';\nimport { MenuSeparator } from './separator';\nimport { MenuItemLabel } from './item-label';\nimport { MenuItemHelpText } from './item-help-text';\nimport { MenuTriggerButton } from './trigger-button';\nimport { MenuSubmenuTriggerItem } from './submenu-trigger-item';\nimport { MenuPopover } from './popover';\n\nconst UnconnectedMenu = ( props: MenuProps ) => {\n\tconst {\n\t\tchildren,\n\t\tdefaultOpen = false,\n\t\topen,\n\t\tonOpenChange,\n\t\tplacement,\n\n\t\t// From internal components context\n\t\tvariant,\n\t} = useContextSystem<\n\t\t// @ts-expect-error TODO: missing 'className' in MenuProps\n\t\ttypeof props & Pick< MenuContextType, 'variant' >\n\t>( props, 'Menu' );\n\n\tconst parentContext = useContext( MenuContext );\n\n\tconst rtl = isRTLFn();\n\n\t// If an explicit value for the `placement` prop is not passed,\n\t// apply a default placement of `bottom-start` for the root menu popover,\n\t// and of `right-start` for nested menu popovers.\n\tlet computedPlacement =\n\t\tplacement ?? ( parentContext?.store ? 'right-start' : 'bottom-start' );\n\t// Swap left/right in case of RTL direction\n\tif ( rtl ) {\n\t\tif ( /right/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'right',\n\t\t\t\t'left'\n\t\t\t) as typeof computedPlacement;\n\t\t} else if ( /left/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'left',\n\t\t\t\t'right'\n\t\t\t) as typeof computedPlacement;\n\t\t}\n\t}\n\n\tconst menuStore = Ariakit.useMenuStore( {\n\t\tparent: parentContext?.store,\n\t\topen,\n\t\tdefaultOpen,\n\t\tplacement: computedPlacement,\n\t\tfocusLoop: true,\n\t\tsetOpen( willBeOpen ) {\n\t\t\tonOpenChange?.( willBeOpen );\n\t\t},\n\t\trtl,\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { store: menuStore, variant } ),\n\t\t[ menuStore, variant ]\n\t);\n\n\treturn (\n\t\t<MenuContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</MenuContext.Provider>\n\t);\n};\n\nexport const Menu = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedMenu, 'Menu' ),\n\t{\n\t\tContext: Object.assign( MenuContext, {\n\t\t\tdisplayName: 'Menu.Context',\n\t\t} ),\n\t\tItem: Object.assign( MenuItem, {\n\t\t\tdisplayName: 'Menu.Item',\n\t\t} ),\n\t\tRadioItem: Object.assign( MenuRadioItem, {\n\t\t\tdisplayName: 'Menu.RadioItem',\n\t\t} ),\n\t\tCheckboxItem: Object.assign( MenuCheckboxItem, {\n\t\t\tdisplayName: 'Menu.CheckboxItem',\n\t\t} ),\n\t\tGroup: Object.assign( MenuGroup, {\n\t\t\tdisplayName: 'Menu.Group',\n\t\t} ),\n\t\tGroupLabel: Object.assign( MenuGroupLabel, {\n\t\t\tdisplayName: 'Menu.GroupLabel',\n\t\t} ),\n\t\tSeparator: Object.assign( MenuSeparator, {\n\t\t\tdisplayName: 'Menu.Separator',\n\t\t} ),\n\t\tItemLabel: Object.assign( MenuItemLabel, {\n\t\t\tdisplayName: 'Menu.ItemLabel',\n\t\t} ),\n\t\tItemHelpText: Object.assign( MenuItemHelpText, {\n\t\t\tdisplayName: 'Menu.ItemHelpText',\n\t\t} ),\n\t\tPopover: Object.assign( MenuPopover, {\n\t\t\tdisplayName: 'Menu.Popover',\n\t\t} ),\n\t\tTriggerButton: Object.assign( MenuTriggerButton, {\n\t\t\tdisplayName: 'Menu.TriggerButton',\n\t\t} ),\n\t\tSubmenuTriggerItem: Object.assign( MenuSubmenuTriggerItem, {\n\t\t\tdisplayName: 'Menu.SubmenuTriggerItem',\n\t\t} ),\n\t}\n);\n\nexport default Menu;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,cAAA,GAAAb,OAAA;AACA,IAAAc,mBAAA,GAAAd,OAAA;AACA,IAAAe,QAAA,GAAAf,OAAA;AAAwC,IAAAgB,WAAA,GAAAhB,OAAA;AAAA,SAAAiB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAnB,wBAAAmB,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,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,EAAE;EACd,CAAE,CAAC;EACHK,YAAY,EAAE/C,MAAM,CAACuC,MAAM,CAAES,8BAAgB,EAAE;IAC9CN,WAAW,EAAE;EACd,CAAE,CAAC;EACHO,KAAK,EAAEjD,MAAM,CAACuC,MAAM,CAAEW,gBAAS,EAAE;IAChCR,WAAW,EAAE;EACd,CAAE,CAAC;EACHS,UAAU,EAAEnD,MAAM,CAACuC,MAAM,CAAEa,0BAAc,EAAE;IAC1CV,WAAW,EAAE;EACd,CAAE,CAAC;EACHW,SAAS,EAAErD,MAAM,CAACuC,MAAM,CAAEe,wBAAa,EAAE;IACxCZ,WAAW,EAAE;EACd,CAAE,CAAC;EACHa,SAAS,EAAEvD,MAAM,CAACuC,MAAM,CAAEiB,wBAAa,EAAE;IACxCd,WAAW,EAAE;EACd,CAAE,CAAC;EACHe,YAAY,EAAEzD,MAAM,CAACuC,MAAM,CAAEmB,8BAAgB,EAAE;IAC9ChB,WAAW,EAAE;EACd,CAAE,CAAC;EACHiB,OAAO,EAAE3D,MAAM,CAACuC,MAAM,CAAEqB,oBAAW,EAAE;IACpClB,WAAW,EAAE;EACd,CAAE,CAAC;EACHmB,aAAa,EAAE7D,MAAM,CAACuC,MAAM,CAAEuB,gCAAiB,EAAE;IAChDpB,WAAW,EAAE;EACd,CAAE,CAAC;EACHqB,kBAAkB,EAAE/D,MAAM,CAACuC,MAAM,CAAEyB,0CAAsB,EAAE;IAC1DtB,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC;AAAC,IAAAuB,QAAA,GAAA3B,OAAA,CAAA5C,OAAA,GAEa2C,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_i18n","_context","_context2","_item","_checkboxItem","_radioItem","_group","_groupLabel","_separator","_itemLabel","_itemHelpText","_triggerButton","_submenuTriggerItem","_popover","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedMenu","props","children","defaultOpen","open","onOpenChange","placement","variant","useContextSystem","parentContext","useContext","Context","rtl","isRTLFn","computedPlacement","store","test","replace","menuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","contextValue","useMemo","jsx","Provider","value","Menu","exports","assign","contextConnectWithoutRef","displayName","Item","RadioItem","CheckboxItem","Group","GroupLabel","Separator","ItemLabel","ItemHelpText","Popover","TriggerButton","SubmenuTriggerItem","_default"],"sources":["@wordpress/components/src/menu/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo } from '@wordpress/element';\nimport { isRTL as isRTLFn } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnectWithoutRef } from '../context';\nimport type { ContextProps, Props } from './types';\nimport { Context } from './context';\nimport { Item } from './item';\nimport { CheckboxItem } from './checkbox-item';\nimport { RadioItem } from './radio-item';\nimport { Group } from './group';\nimport { GroupLabel } from './group-label';\nimport { Separator } from './separator';\nimport { ItemLabel } from './item-label';\nimport { ItemHelpText } from './item-help-text';\nimport { TriggerButton } from './trigger-button';\nimport { SubmenuTriggerItem } from './submenu-trigger-item';\nimport { Popover } from './popover';\n\nconst UnconnectedMenu = ( props: Props ) => {\n\tconst {\n\t\tchildren,\n\t\tdefaultOpen = false,\n\t\topen,\n\t\tonOpenChange,\n\t\tplacement,\n\n\t\t// From internal components context\n\t\tvariant,\n\t} = useContextSystem<\n\t\t// @ts-expect-error TODO: missing 'className' in MenuProps\n\t\ttypeof props & Pick< ContextProps, 'variant' >\n\t>( props, 'Menu' );\n\n\tconst parentContext = useContext( Context );\n\n\tconst rtl = isRTLFn();\n\n\t// If an explicit value for the `placement` prop is not passed,\n\t// apply a default placement of `bottom-start` for the root menu popover,\n\t// and of `right-start` for nested menu popovers.\n\tlet computedPlacement =\n\t\tplacement ?? ( parentContext?.store ? 'right-start' : 'bottom-start' );\n\t// Swap left/right in case of RTL direction\n\tif ( rtl ) {\n\t\tif ( /right/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'right',\n\t\t\t\t'left'\n\t\t\t) as typeof computedPlacement;\n\t\t} else if ( /left/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'left',\n\t\t\t\t'right'\n\t\t\t) as typeof computedPlacement;\n\t\t}\n\t}\n\n\tconst menuStore = Ariakit.useMenuStore( {\n\t\tparent: parentContext?.store,\n\t\topen,\n\t\tdefaultOpen,\n\t\tplacement: computedPlacement,\n\t\tfocusLoop: true,\n\t\tsetOpen( willBeOpen ) {\n\t\t\tonOpenChange?.( willBeOpen );\n\t\t},\n\t\trtl,\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { store: menuStore, variant } ),\n\t\t[ menuStore, variant ]\n\t);\n\n\treturn (\n\t\t<Context.Provider value={ contextValue }>{ children }</Context.Provider>\n\t);\n};\n\n/**\n * Menu is a collection of React components that combine to render\n * ARIA-compliant [menu](https://www.w3.org/WAI/ARIA/apg/patterns/menu/) and\n * [menu button](https://www.w3.org/WAI/ARIA/apg/patterns/menubutton/) patterns.\n *\n * `Menu` itself is a wrapper component and context provider.\n * It is responsible for managing the state of the menu and its items, and for\n * rendering the `Menu.TriggerButton` (or the `Menu.SubmenuTriggerItem`)\n * component, and the `Menu.Popover` component.\n */\nexport const Menu = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedMenu, 'Menu' ),\n\t{\n\t\tContext: Object.assign( Context, {\n\t\t\tdisplayName: 'Menu.Context',\n\t\t} ),\n\t\t/**\n\t\t * Renders a menu item inside the `Menu.Popover` or `Menu.Group` components.\n\t\t *\n\t\t * It can optionally contain one instance of the `Menu.ItemLabel` component\n\t\t * and one instance of the `Menu.ItemHelpText` component.\n\t\t */\n\t\tItem: Object.assign( Item, {\n\t\t\tdisplayName: 'Menu.Item',\n\t\t} ),\n\t\t/**\n\t\t * Renders a radio menu item inside the `Menu.Popover` or `Menu.Group`\n\t\t * components.\n\t\t *\n\t\t * It can optionally contain one instance of the `Menu.ItemLabel` component\n\t\t * and one instance of the `Menu.ItemHelpText` component.\n\t\t */\n\t\tRadioItem: Object.assign( RadioItem, {\n\t\t\tdisplayName: 'Menu.RadioItem',\n\t\t} ),\n\t\t/**\n\t\t * Renders a checkbox menu item inside the `Menu.Popover` or `Menu.Group`\n\t\t * components.\n\t\t *\n\t\t * It can optionally contain one instance of the `Menu.ItemLabel` component\n\t\t * and one instance of the `Menu.ItemHelpText` component.\n\t\t */\n\t\tCheckboxItem: Object.assign( CheckboxItem, {\n\t\t\tdisplayName: 'Menu.CheckboxItem',\n\t\t} ),\n\t\t/**\n\t\t * Renders a group for menu items.\n\t\t *\n\t\t * It should contain one instance of `Menu.GroupLabel` and one or more\n\t\t * instances of `Menu.Item`, `Menu.RadioItem`, or `Menu.CheckboxItem`.\n\t\t */\n\t\tGroup: Object.assign( Group, {\n\t\t\tdisplayName: 'Menu.Group',\n\t\t} ),\n\t\t/**\n\t\t * Renders a label in a menu group.\n\t\t *\n\t\t * This component should be wrapped with `Menu.Group` so the\n\t\t * `aria-labelledby` is correctly set on the group element.\n\t\t */\n\t\tGroupLabel: Object.assign( GroupLabel, {\n\t\t\tdisplayName: 'Menu.GroupLabel',\n\t\t} ),\n\t\t/**\n\t\t * Renders a divider between menu items or menu groups.\n\t\t */\n\t\tSeparator: Object.assign( Separator, {\n\t\t\tdisplayName: 'Menu.Separator',\n\t\t} ),\n\t\t/**\n\t\t * Renders a menu item's label text. It should be wrapped with `Menu.Item`,\n\t\t * `Menu.RadioItem`, or `Menu.CheckboxItem`.\n\t\t */\n\t\tItemLabel: Object.assign( ItemLabel, {\n\t\t\tdisplayName: 'Menu.ItemLabel',\n\t\t} ),\n\t\t/**\n\t\t * Renders a menu item's help text. It should be wrapped with `Menu.Item`,\n\t\t * `Menu.RadioItem`, or `Menu.CheckboxItem`.\n\t\t */\n\t\tItemHelpText: Object.assign( ItemHelpText, {\n\t\t\tdisplayName: 'Menu.ItemHelpText',\n\t\t} ),\n\t\t/**\n\t\t * Renders a dropdown menu element that's controlled by a sibling\n\t\t * `Menu.TriggerButton` component. It renders a popover and automatically\n\t\t * focuses on items when the menu is shown.\n\t\t *\n\t\t * The only valid children of `Menu.Popover` are `Menu.Item`,\n\t\t * `Menu.RadioItem`, `Menu.CheckboxItem`, `Menu.Group`, `Menu.Separator`,\n\t\t * and `Menu` (for nested dropdown menus).\n\t\t */\n\t\tPopover: Object.assign( Popover, {\n\t\t\tdisplayName: 'Menu.Popover',\n\t\t} ),\n\t\t/**\n\t\t * Renders a menu button that toggles the visibility of a sibling\n\t\t * `Menu.Popover` component when clicked or when using arrow keys.\n\t\t */\n\t\tTriggerButton: Object.assign( TriggerButton, {\n\t\t\tdisplayName: 'Menu.TriggerButton',\n\t\t} ),\n\t\t/**\n\t\t * Renders a menu item that toggles the visibility of a sibling\n\t\t * `Menu.Popover` component when clicked or when using arrow keys.\n\t\t *\n\t\t * This component is used to create a nested dropdown menu.\n\t\t */\n\t\tSubmenuTriggerItem: Object.assign( SubmenuTriggerItem, {\n\t\t\tdisplayName: 'Menu.SubmenuTriggerItem',\n\t\t} ),\n\t}\n);\n\nexport default Menu;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;A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AACA;EACEO,SAAS,EAAEhD,MAAM,CAACuC,MAAM,CAAES,oBAAS,EAAE;IACpCP,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;EACEQ,YAAY,EAAEjD,MAAM,CAACuC,MAAM,CAAEU,0BAAY,EAAE;IAC1CR,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACES,OAAO,EAAElD,MAAM,CAACuC,MAAM,CAAEW,gBAAO,EAAE;IAChCT,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;EACEU,aAAa,EAAEnD,MAAM,CAACuC,MAAM,CAAEY,4BAAa,EAAE;IAC5CV,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;EACEW,kBAAkB,EAAEpD,MAAM,CAACuC,MAAM,CAAEa,sCAAkB,EAAE;IACtDX,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC;AAAC,IAAAY,QAAA,GAAAf,OAAA,CAAA5C,OAAA,GAEa2C,IAAI","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ItemHelpText = void 0;
|
|
7
7
|
var _element = require("@wordpress/element");
|
|
8
8
|
var _context = require("./context");
|
|
9
9
|
var Styled = _interopRequireWildcard(require("./styles"));
|
|
@@ -18,12 +18,12 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
const menuContext = (0, _element.useContext)(_context.
|
|
21
|
+
const ItemHelpText = exports.ItemHelpText = (0, _element.forwardRef)(function ItemHelpText(props, ref) {
|
|
22
|
+
const menuContext = (0, _element.useContext)(_context.Context);
|
|
23
23
|
if (!menuContext?.store) {
|
|
24
24
|
throw new Error('Menu.ItemHelpText can only be rendered inside a Menu component');
|
|
25
25
|
}
|
|
26
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemHelpText, {
|
|
27
27
|
numberOfLines: 2,
|
|
28
28
|
ref: ref,
|
|
29
29
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_context","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","
|
|
1
|
+
{"version":3,"names":["_element","require","_context","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ItemHelpText","exports","forwardRef","props","ref","menuContext","useContext","Context","store","Error","jsx","numberOfLines"],"sources":["@wordpress/components/src/menu/item-help-text.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { Context } from './context';\nimport * as Styled from './styles';\n\nexport const ItemHelpText = forwardRef<\n\tHTMLSpanElement,\n\tWordPressComponentProps< { children: React.ReactNode }, 'span', true >\n>( function ItemHelpText( props, ref ) {\n\tconst menuContext = useContext( Context );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.ItemHelpText can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn <Styled.ItemHelpText numberOfLines={ 2 } ref={ ref } { ...props } />;\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,O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YA,CAAEG,KAAK,EAAEC,GAAG,EAAG;EACtC,MAAMC,WAAW,GAAG,IAAAC,mBAAU,EAAEC,gBAAQ,CAAC;EAEzC,IAAK,CAAEF,WAAW,EAAEG,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,gEACD,CAAC;EACF;EAEA,oBAAO,IAAA9B,WAAA,CAAA+B,GAAA,EAACjC,MAAM,CAACuB,YAAY;IAACW,aAAa,EAAG,CAAG;IAACP,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AAC5E,CAAE,CAAC","ignoreList":[]}
|
package/build/menu/item-label.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ItemLabel = void 0;
|
|
7
7
|
var _element = require("@wordpress/element");
|
|
8
8
|
var _context = require("./context");
|
|
9
9
|
var Styled = _interopRequireWildcard(require("./styles"));
|
|
@@ -18,12 +18,12 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
const menuContext = (0, _element.useContext)(_context.
|
|
21
|
+
const ItemLabel = exports.ItemLabel = (0, _element.forwardRef)(function ItemLabel(props, ref) {
|
|
22
|
+
const menuContext = (0, _element.useContext)(_context.Context);
|
|
23
23
|
if (!menuContext?.store) {
|
|
24
24
|
throw new Error('Menu.ItemLabel can only be rendered inside a Menu component');
|
|
25
25
|
}
|
|
26
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemLabel, {
|
|
27
27
|
numberOfLines: 1,
|
|
28
28
|
ref: ref,
|
|
29
29
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_context","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","
|
|
1
|
+
{"version":3,"names":["_element","require","_context","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ItemLabel","exports","forwardRef","props","ref","menuContext","useContext","Context","store","Error","jsx","numberOfLines"],"sources":["@wordpress/components/src/menu/item-label.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { Context } from './context';\nimport * as Styled from './styles';\n\nexport const ItemLabel = forwardRef<\n\tHTMLSpanElement,\n\tWordPressComponentProps< { children: React.ReactNode }, 'span', true >\n>( function ItemLabel( props, ref ) {\n\tconst menuContext = useContext( Context );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.ItemLabel can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn <Styled.ItemLabel numberOfLines={ 1 } ref={ ref } { ...props } />;\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAmC,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,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AK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACzE,CAAE,CAAC","ignoreList":[]}
|
package/build/menu/item.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Item = void 0;
|
|
7
7
|
var _element = require("@wordpress/element");
|
|
8
8
|
var Styled = _interopRequireWildcard(require("./styles"));
|
|
9
9
|
var _context = require("./context");
|
|
@@ -18,7 +18,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const Item = exports.Item = (0, _element.forwardRef)(function Item({
|
|
22
22
|
prefix,
|
|
23
23
|
suffix,
|
|
24
24
|
children,
|
|
@@ -27,7 +27,7 @@ const MenuItem = exports.MenuItem = (0, _element.forwardRef)(function MenuItem({
|
|
|
27
27
|
store,
|
|
28
28
|
...props
|
|
29
29
|
}, ref) {
|
|
30
|
-
const menuContext = (0, _element.useContext)(_context.
|
|
30
|
+
const menuContext = (0, _element.useContext)(_context.Context);
|
|
31
31
|
if (!menuContext?.store) {
|
|
32
32
|
throw new Error('Menu.Item can only be rendered inside a Menu component');
|
|
33
33
|
}
|
|
@@ -37,7 +37,7 @@ const MenuItem = exports.MenuItem = (0, _element.forwardRef)(function MenuItem({
|
|
|
37
37
|
// `Menu.SubmenuTriggerItem`), the context store wouldn't be correct. This is
|
|
38
38
|
// why the component accepts a `store` prop to override the context store.
|
|
39
39
|
const computedStore = store !== null && store !== void 0 ? store : menuContext.store;
|
|
40
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.Item, {
|
|
41
41
|
ref: ref,
|
|
42
42
|
...props,
|
|
43
43
|
accessibleWhenDisabled: true,
|
|
@@ -46,8 +46,8 @@ const MenuItem = exports.MenuItem = (0, _element.forwardRef)(function MenuItem({
|
|
|
46
46
|
store: computedStore,
|
|
47
47
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemPrefixWrapper, {
|
|
48
48
|
children: prefix
|
|
49
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.
|
|
50
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.
|
|
49
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.ItemContentWrapper, {
|
|
50
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemChildrenWrapper, {
|
|
51
51
|
children: children
|
|
52
52
|
}), suffix && /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemSuffixWrapper, {
|
|
53
53
|
children: suffix
|