@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.
Files changed (246) hide show
  1. package/CHANGELOG.md +29 -6
  2. package/CONTRIBUTING.md +4 -4
  3. package/README.md +1 -1
  4. package/build/badge/index.js +26 -22
  5. package/build/badge/index.js.map +1 -1
  6. package/build/border-box-control/border-box-control-linked-button/component.js +8 -15
  7. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  8. package/build/box-control/index.js +6 -0
  9. package/build/box-control/index.js.map +1 -1
  10. package/build/box-control/linked-button.js +7 -11
  11. package/build/box-control/linked-button.js.map +1 -1
  12. package/build/box-control/types.js.map +1 -1
  13. package/build/circular-option-picker/circular-option-picker-option.js +9 -7
  14. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  15. package/build/circular-option-picker/circular-option-picker.js +0 -1
  16. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  17. package/build/color-palette/index.js +1 -6
  18. package/build/color-palette/index.js.map +1 -1
  19. package/build/font-size-picker/index.native.js +1 -1
  20. package/build/font-size-picker/index.native.js.map +1 -1
  21. package/build/higher-order/with-focus-return/index.js +1 -1
  22. package/build/higher-order/with-focus-return/index.js.map +1 -1
  23. package/build/input-control/styles/input-control-styles.js +22 -22
  24. package/build/input-control/styles/input-control-styles.js.map +1 -1
  25. package/build/menu/checkbox-item.js +6 -6
  26. package/build/menu/checkbox-item.js.map +1 -1
  27. package/build/menu/context.js +2 -2
  28. package/build/menu/context.js.map +1 -1
  29. package/build/menu/group-label.js +4 -4
  30. package/build/menu/group-label.js.map +1 -1
  31. package/build/menu/group.js +4 -4
  32. package/build/menu/group.js.map +1 -1
  33. package/build/menu/index.js +87 -14
  34. package/build/menu/index.js.map +1 -1
  35. package/build/menu/item-help-text.js +4 -4
  36. package/build/menu/item-help-text.js.map +1 -1
  37. package/build/menu/item-label.js +4 -4
  38. package/build/menu/item-label.js.map +1 -1
  39. package/build/menu/item.js +6 -6
  40. package/build/menu/item.js.map +1 -1
  41. package/build/menu/popover.js +5 -5
  42. package/build/menu/popover.js.map +1 -1
  43. package/build/menu/radio-item.js +6 -6
  44. package/build/menu/radio-item.js.map +1 -1
  45. package/build/menu/separator.js +4 -4
  46. package/build/menu/separator.js.map +1 -1
  47. package/build/menu/styles.js +41 -41
  48. package/build/menu/styles.js.map +1 -1
  49. package/build/menu/submenu-trigger-item.js +5 -5
  50. package/build/menu/submenu-trigger-item.js.map +1 -1
  51. package/build/menu/trigger-button.js +3 -3
  52. package/build/menu/trigger-button.js.map +1 -1
  53. package/build/menu/types.js.map +1 -1
  54. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
  55. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  56. package/build/mobile/utils/get-px-from-css-unit.native.js +3 -3
  57. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  58. package/build/notice/types.js.map +1 -1
  59. package/build/search-control/index.js +1 -1
  60. package/build/search-control/index.js.map +1 -1
  61. package/build/text/hook.js +8 -6
  62. package/build/text/hook.js.map +1 -1
  63. package/build/text/utils.js +1 -1
  64. package/build/text/utils.js.map +1 -1
  65. package/build-module/badge/index.js +28 -22
  66. package/build-module/badge/index.js.map +1 -1
  67. package/build-module/border-box-control/border-box-control-linked-button/component.js +8 -15
  68. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  69. package/build-module/box-control/index.js +6 -0
  70. package/build-module/box-control/index.js.map +1 -1
  71. package/build-module/box-control/linked-button.js +7 -11
  72. package/build-module/box-control/linked-button.js.map +1 -1
  73. package/build-module/box-control/types.js.map +1 -1
  74. package/build-module/circular-option-picker/circular-option-picker-option.js +9 -7
  75. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  76. package/build-module/circular-option-picker/circular-option-picker.js +0 -1
  77. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  78. package/build-module/color-palette/index.js +1 -6
  79. package/build-module/color-palette/index.js.map +1 -1
  80. package/build-module/font-size-picker/index.native.js +1 -1
  81. package/build-module/font-size-picker/index.native.js.map +1 -1
  82. package/build-module/higher-order/with-focus-return/index.js +1 -1
  83. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  84. package/build-module/input-control/styles/input-control-styles.js +22 -22
  85. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  86. package/build-module/menu/checkbox-item.js +6 -6
  87. package/build-module/menu/checkbox-item.js.map +1 -1
  88. package/build-module/menu/context.js +1 -1
  89. package/build-module/menu/context.js.map +1 -1
  90. package/build-module/menu/group-label.js +4 -4
  91. package/build-module/menu/group-label.js.map +1 -1
  92. package/build-module/menu/group.js +4 -4
  93. package/build-module/menu/group.js.map +1 -1
  94. package/build-module/menu/index.js +99 -26
  95. package/build-module/menu/index.js.map +1 -1
  96. package/build-module/menu/item-help-text.js +4 -4
  97. package/build-module/menu/item-help-text.js.map +1 -1
  98. package/build-module/menu/item-label.js +4 -4
  99. package/build-module/menu/item-label.js.map +1 -1
  100. package/build-module/menu/item.js +6 -6
  101. package/build-module/menu/item.js.map +1 -1
  102. package/build-module/menu/popover.js +5 -5
  103. package/build-module/menu/popover.js.map +1 -1
  104. package/build-module/menu/radio-item.js +6 -6
  105. package/build-module/menu/radio-item.js.map +1 -1
  106. package/build-module/menu/separator.js +4 -4
  107. package/build-module/menu/separator.js.map +1 -1
  108. package/build-module/menu/styles.js +40 -40
  109. package/build-module/menu/styles.js.map +1 -1
  110. package/build-module/menu/submenu-trigger-item.js +6 -6
  111. package/build-module/menu/submenu-trigger-item.js.map +1 -1
  112. package/build-module/menu/trigger-button.js +3 -3
  113. package/build-module/menu/trigger-button.js.map +1 -1
  114. package/build-module/menu/types.js.map +1 -1
  115. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
  116. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  117. package/build-module/mobile/utils/get-px-from-css-unit.native.js +3 -3
  118. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  119. package/build-module/notice/types.js.map +1 -1
  120. package/build-module/search-control/index.js +1 -1
  121. package/build-module/search-control/index.js.map +1 -1
  122. package/build-module/text/hook.js +8 -6
  123. package/build-module/text/hook.js.map +1 -1
  124. package/build-module/text/utils.js +1 -1
  125. package/build-module/text/utils.js.map +1 -1
  126. package/build-style/style-rtl.css +89 -170
  127. package/build-style/style.css +89 -170
  128. package/build-types/badge/index.d.ts.map +1 -1
  129. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  130. package/build-types/box-control/index.d.ts.map +1 -1
  131. package/build-types/box-control/linked-button.d.ts.map +1 -1
  132. package/build-types/box-control/stories/index.story.d.ts +7 -2331
  133. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  134. package/build-types/box-control/types.d.ts +15 -3
  135. package/build-types/box-control/types.d.ts.map +1 -1
  136. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  137. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  138. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  139. package/build-types/color-palette/index.d.ts.map +1 -1
  140. package/build-types/higher-order/with-focus-return/index.d.ts +1 -1
  141. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  142. package/build-types/menu/checkbox-item.d.ts +2 -2
  143. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  144. package/build-types/menu/context.d.ts +2 -2
  145. package/build-types/menu/context.d.ts.map +1 -1
  146. package/build-types/menu/group-label.d.ts +2 -2
  147. package/build-types/menu/group-label.d.ts.map +1 -1
  148. package/build-types/menu/group.d.ts +2 -2
  149. package/build-types/menu/group.d.ts.map +1 -1
  150. package/build-types/menu/index.d.ts +84 -12
  151. package/build-types/menu/index.d.ts.map +1 -1
  152. package/build-types/menu/item-help-text.d.ts +1 -1
  153. package/build-types/menu/item-help-text.d.ts.map +1 -1
  154. package/build-types/menu/item-label.d.ts +1 -1
  155. package/build-types/menu/item-label.d.ts.map +1 -1
  156. package/build-types/menu/item.d.ts +2 -2
  157. package/build-types/menu/item.d.ts.map +1 -1
  158. package/build-types/menu/popover.d.ts +2 -2
  159. package/build-types/menu/popover.d.ts.map +1 -1
  160. package/build-types/menu/radio-item.d.ts +2 -2
  161. package/build-types/menu/radio-item.d.ts.map +1 -1
  162. package/build-types/menu/separator.d.ts +2 -2
  163. package/build-types/menu/separator.d.ts.map +1 -1
  164. package/build-types/menu/styles.d.ts +15 -15
  165. package/build-types/menu/styles.d.ts.map +1 -1
  166. package/build-types/menu/submenu-trigger-item.d.ts +2 -2
  167. package/build-types/menu/submenu-trigger-item.d.ts.map +1 -1
  168. package/build-types/menu/trigger-button.d.ts +2 -2
  169. package/build-types/menu/trigger-button.d.ts.map +1 -1
  170. package/build-types/menu/types.d.ts +10 -10
  171. package/build-types/menu/types.d.ts.map +1 -1
  172. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  173. package/build-types/notice/types.d.ts +1 -1
  174. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  175. package/build-types/tabs/stories/index.story.d.ts +0 -3
  176. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  177. package/build-types/text/hook.d.ts.map +1 -1
  178. package/build-types/text/utils.d.ts +1 -1
  179. package/package.json +19 -19
  180. package/src/animate/style.scss +16 -12
  181. package/src/badge/index.tsx +28 -27
  182. package/src/border-box-control/border-box-control-linked-button/component.tsx +9 -14
  183. package/src/border-control/test/index.js +12 -4
  184. package/src/box-control/index.tsx +9 -0
  185. package/src/box-control/linked-button.tsx +8 -11
  186. package/src/box-control/test/index.tsx +9 -2
  187. package/src/box-control/types.ts +26 -11
  188. package/src/button/style.scss +15 -12
  189. package/src/checkbox-control/style.scss +4 -2
  190. package/src/circular-option-picker/README.md +1 -2
  191. package/src/circular-option-picker/circular-option-picker-option.tsx +17 -10
  192. package/src/circular-option-picker/circular-option-picker.tsx +0 -1
  193. package/src/circular-option-picker/stories/index.story.tsx +0 -1
  194. package/src/circular-option-picker/style.scss +10 -5
  195. package/src/color-palette/index.tsx +0 -7
  196. package/src/color-palette/test/index.tsx +2 -8
  197. package/src/combobox-control/test/index.tsx +1 -1
  198. package/src/drop-zone/style.scss +6 -9
  199. package/src/font-size-picker/index.native.js +1 -1
  200. package/src/form-toggle/style.scss +17 -10
  201. package/src/form-token-field/style.scss +9 -4
  202. package/src/higher-order/navigate-regions/style.scss +2 -2
  203. package/src/higher-order/with-focus-return/index.tsx +1 -1
  204. package/src/input-control/styles/input-control-styles.tsx +6 -0
  205. package/src/menu/README.md +421 -174
  206. package/src/menu/checkbox-item.tsx +12 -12
  207. package/src/menu/context.tsx +2 -4
  208. package/src/menu/docs-manifest.json +62 -0
  209. package/src/menu/group-label.tsx +7 -7
  210. package/src/menu/group.tsx +7 -11
  211. package/src/menu/index.tsx +101 -31
  212. package/src/menu/item-help-text.tsx +5 -7
  213. package/src/menu/item-label.tsx +5 -7
  214. package/src/menu/item.tsx +12 -12
  215. package/src/menu/popover.tsx +9 -9
  216. package/src/menu/radio-item.tsx +12 -12
  217. package/src/menu/separator.tsx +7 -7
  218. package/src/menu/stories/best-practices.mdx +38 -0
  219. package/src/menu/stories/index.story.tsx +8 -8
  220. package/src/menu/styles.ts +24 -24
  221. package/src/menu/submenu-trigger-item.tsx +9 -9
  222. package/src/menu/trigger-button.tsx +6 -6
  223. package/src/menu/types.ts +10 -10
  224. package/src/menu-group/stories/index.story.tsx +2 -2
  225. package/src/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
  226. package/src/mobile/utils/get-px-from-css-unit.native.js +3 -3
  227. package/src/modal/style.scss +4 -2
  228. package/src/modal/test/index.tsx +5 -4
  229. package/src/notice/README.md +3 -3
  230. package/src/notice/types.ts +1 -1
  231. package/src/palette-edit/test/index.tsx +1 -1
  232. package/src/panel/style.scss +14 -6
  233. package/src/placeholder/style.scss +5 -3
  234. package/src/progress-bar/stories/index.story.tsx +1 -1
  235. package/src/resizable-box/style.scss +14 -9
  236. package/src/search-control/index.tsx +1 -1
  237. package/src/tab-panel/style.scss +6 -4
  238. package/src/tabs/stories/index.story.tsx +0 -131
  239. package/src/text/README.md +1 -1
  240. package/src/text/hook.ts +3 -2
  241. package/src/text/stories/index.story.tsx +2 -2
  242. package/src/text/test/index.tsx +1 -1
  243. package/src/text/utils.ts +1 -1
  244. package/src/text-highlight/test/index.tsx +3 -3
  245. package/src/toolbar/toolbar/style.scss +4 -3
  246. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","useContext","useMemo","forwardRef","useCallback","Styled","MenuContext","jsx","_jsx","MenuPopover","gutter","children","shift","modal","otherProps","ref","menuContext","appliedPlacementSide","useStoreState","store","split","hideOnEscape","event","preventDefault","computedDirection","wrapperProps","dir","style","direction","Error","Menu","parent","hideOnHoverOutside","unmountOnHide","render","renderProps","MenuPopoverOuterWrapper","variant","MenuPopoverInnerWrapper"],"sources":["@wordpress/components/src/menu/popover.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseContext,\n\tuseMemo,\n\tforwardRef,\n\tuseCallback,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuPopoverProps } from './types';\nimport * as Styled from './styles';\nimport { MenuContext } from './context';\n\nexport const MenuPopover = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuPopoverProps, 'div', false >\n>( function MenuPopover(\n\t{ gutter, children, shift, modal = true, ...otherProps },\n\tref\n) {\n\tconst menuContext = useContext( MenuContext );\n\n\t// Extract the side from the applied placement — useful for animations.\n\t// Using `currentPlacement` instead of `placement` to make sure that we\n\t// use the final computed placement (including \"flips\" etc).\n\tconst appliedPlacementSide = Ariakit.useStoreState(\n\t\tmenuContext?.store,\n\t\t'currentPlacement'\n\t)?.split( '-' )[ 0 ];\n\n\tconst hideOnEscape = useCallback(\n\t\t( event: React.KeyboardEvent< Element > ) => {\n\t\t\t// Pressing Escape can cause unexpected consequences (ie. exiting\n\t\t\t// full screen mode on MacOs, close parent modals...).\n\t\t\tevent.preventDefault();\n\t\t\t// Returning `true` causes the menu to hide.\n\t\t\treturn true;\n\t\t},\n\t\t[]\n\t);\n\n\tconst computedDirection = Ariakit.useStoreState( menuContext?.store, 'rtl' )\n\t\t? 'rtl'\n\t\t: 'ltr';\n\n\tconst wrapperProps = useMemo(\n\t\t() => ( {\n\t\t\tdir: computedDirection,\n\t\t\tstyle: {\n\t\t\t\tdirection:\n\t\t\t\t\tcomputedDirection as React.CSSProperties[ 'direction' ],\n\t\t\t},\n\t\t} ),\n\t\t[ computedDirection ]\n\t);\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.Popover can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Ariakit.Menu\n\t\t\t{ ...otherProps }\n\t\t\tref={ ref }\n\t\t\tmodal={ modal }\n\t\t\tstore={ menuContext.store }\n\t\t\t// Root menu has an 8px distance from its trigger,\n\t\t\t// otherwise 0 (which causes the submenu to slightly overlap)\n\t\t\tgutter={ gutter ?? ( menuContext.store.parent ? 0 : 8 ) }\n\t\t\t// Align nested menu by the same (but opposite) amount\n\t\t\t// as the menu container's padding.\n\t\t\tshift={ shift ?? ( menuContext.store.parent ? -4 : 0 ) }\n\t\t\thideOnHoverOutside={ false }\n\t\t\tdata-side={ appliedPlacementSide }\n\t\t\twrapperProps={ wrapperProps }\n\t\t\thideOnEscape={ hideOnEscape }\n\t\t\tunmountOnHide\n\t\t\trender={ ( renderProps ) => (\n\t\t\t\t// Two wrappers are needed for the entry animation, where the menu\n\t\t\t\t// container scales with a different factor than its contents.\n\t\t\t\t// The {...renderProps} are passed to the inner wrapper, so that the\n\t\t\t\t// menu element is the direct parent of the menu item elements.\n\t\t\t\t<Styled.MenuPopoverOuterWrapper variant={ menuContext.variant }>\n\t\t\t\t\t<Styled.MenuPopoverInnerWrapper { ...renderProps } />\n\t\t\t\t</Styled.MenuPopoverOuterWrapper>\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</Ariakit.Menu>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SACCC,UAAU,EACVC,OAAO,EACPC,UAAU,EACVC,WAAW,QACL,oBAAoB;;AAE3B;AACA;AACA;;AAGA,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,SAASC,WAAW,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExC,OAAO,MAAMC,WAAW,GAAGN,UAAU,CAGlC,SAASM,WAAWA,CACtB;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,KAAK;EAAEC,KAAK,GAAG,IAAI;EAAE,GAAGC;AAAW,CAAC,EACxDC,GAAG,EACF;EACD,MAAMC,WAAW,GAAGf,UAAU,CAAEK,WAAY,CAAC;;EAE7C;EACA;EACA;EACA,MAAMW,oBAAoB,GAAGjB,OAAO,CAACkB,aAAa,CACjDF,WAAW,EAAEG,KAAK,EAClB,kBACD,CAAC,EAAEC,KAAK,CAAE,GAAI,CAAC,CAAE,CAAC,CAAE;EAEpB,MAAMC,YAAY,GAAGjB,WAAW,CAC7BkB,KAAqC,IAAM;IAC5C;IACA;IACAA,KAAK,CAACC,cAAc,CAAC,CAAC;IACtB;IACA,OAAO,IAAI;EACZ,CAAC,EACD,EACD,CAAC;EAED,MAAMC,iBAAiB,GAAGxB,OAAO,CAACkB,aAAa,CAAEF,WAAW,EAAEG,KAAK,EAAE,KAAM,CAAC,GACzE,KAAK,GACL,KAAK;EAER,MAAMM,YAAY,GAAGvB,OAAO,CAC3B,OAAQ;IACPwB,GAAG,EAAEF,iBAAiB;IACtBG,KAAK,EAAE;MACNC,SAAS,EACRJ;IACF;EACD,CAAC,CAAE,EACH,CAAEA,iBAAiB,CACpB,CAAC;EAED,IAAK,CAAER,WAAW,EAAEG,KAAK,EAAG;IAC3B,MAAM,IAAIU,KAAK,CACd,2DACD,CAAC;EACF;EAEA,oBACCrB,IAAA,CAACR,OAAO,CAAC8B,IAAI;IAAA,GACPhB,UAAU;IACfC,GAAG,EAAGA,GAAK;IACXF,KAAK,EAAGA,KAAO;IACfM,KAAK,EAAGH,WAAW,CAACG;IACpB;IACA;IAAA;IACAT,MAAM,EAAGA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAMM,WAAW,CAACG,KAAK,CAACY,MAAM,GAAG,CAAC,GAAG;IACpD;IACA;IAAA;IACAnB,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAMI,WAAW,CAACG,KAAK,CAACY,MAAM,GAAG,CAAC,CAAC,GAAG,CAAK;IACxDC,kBAAkB,EAAG,KAAO;IAC5B,aAAYf,oBAAsB;IAClCQ,YAAY,EAAGA,YAAc;IAC7BJ,YAAY,EAAGA,YAAc;IAC7BY,aAAa;IACbC,MAAM,EAAKC,WAAW;IAAA;IACrB;IACA;IACA;IACA;IACA3B,IAAA,CAACH,MAAM,CAAC+B,uBAAuB;MAACC,OAAO,EAAGrB,WAAW,CAACqB,OAAS;MAAA1B,QAAA,eAC9DH,IAAA,CAACH,MAAM,CAACiC,uBAAuB;QAAA,GAAMH;MAAW,CAAI;IAAC,CACtB,CAC9B;IAAAxB,QAAA,EAEDA;EAAQ,CACG,CAAC;AAEjB,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","useContext","useMemo","forwardRef","useCallback","Styled","Context","jsx","_jsx","Popover","gutter","children","shift","modal","otherProps","ref","menuContext","appliedPlacementSide","useStoreState","store","split","hideOnEscape","event","preventDefault","computedDirection","wrapperProps","dir","style","direction","Error","Menu","parent","hideOnHoverOutside","unmountOnHide","render","renderProps","PopoverOuterWrapper","variant","PopoverInnerWrapper"],"sources":["@wordpress/components/src/menu/popover.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseContext,\n\tuseMemo,\n\tforwardRef,\n\tuseCallback,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { PopoverProps } from './types';\nimport * as Styled from './styles';\nimport { Context } from './context';\n\nexport const Popover = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< PopoverProps, 'div', false >\n>( function Popover(\n\t{ gutter, children, shift, modal = true, ...otherProps },\n\tref\n) {\n\tconst menuContext = useContext( Context );\n\n\t// Extract the side from the applied placement — useful for animations.\n\t// Using `currentPlacement` instead of `placement` to make sure that we\n\t// use the final computed placement (including \"flips\" etc).\n\tconst appliedPlacementSide = Ariakit.useStoreState(\n\t\tmenuContext?.store,\n\t\t'currentPlacement'\n\t)?.split( '-' )[ 0 ];\n\n\tconst hideOnEscape = useCallback(\n\t\t( event: React.KeyboardEvent< Element > ) => {\n\t\t\t// Pressing Escape can cause unexpected consequences (ie. exiting\n\t\t\t// full screen mode on MacOs, close parent modals...).\n\t\t\tevent.preventDefault();\n\t\t\t// Returning `true` causes the menu to hide.\n\t\t\treturn true;\n\t\t},\n\t\t[]\n\t);\n\n\tconst computedDirection = Ariakit.useStoreState( menuContext?.store, 'rtl' )\n\t\t? 'rtl'\n\t\t: 'ltr';\n\n\tconst wrapperProps = useMemo(\n\t\t() => ( {\n\t\t\tdir: computedDirection,\n\t\t\tstyle: {\n\t\t\t\tdirection:\n\t\t\t\t\tcomputedDirection as React.CSSProperties[ 'direction' ],\n\t\t\t},\n\t\t} ),\n\t\t[ computedDirection ]\n\t);\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.Popover can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Ariakit.Menu\n\t\t\t{ ...otherProps }\n\t\t\tref={ ref }\n\t\t\tmodal={ modal }\n\t\t\tstore={ menuContext.store }\n\t\t\t// Root menu has an 8px distance from its trigger,\n\t\t\t// otherwise 0 (which causes the submenu to slightly overlap)\n\t\t\tgutter={ gutter ?? ( menuContext.store.parent ? 0 : 8 ) }\n\t\t\t// Align nested menu by the same (but opposite) amount\n\t\t\t// as the menu container's padding.\n\t\t\tshift={ shift ?? ( menuContext.store.parent ? -4 : 0 ) }\n\t\t\thideOnHoverOutside={ false }\n\t\t\tdata-side={ appliedPlacementSide }\n\t\t\twrapperProps={ wrapperProps }\n\t\t\thideOnEscape={ hideOnEscape }\n\t\t\tunmountOnHide\n\t\t\trender={ ( renderProps ) => (\n\t\t\t\t// Two wrappers are needed for the entry animation, where the menu\n\t\t\t\t// container scales with a different factor than its contents.\n\t\t\t\t// The {...renderProps} are passed to the inner wrapper, so that the\n\t\t\t\t// menu element is the direct parent of the menu item elements.\n\t\t\t\t<Styled.PopoverOuterWrapper variant={ menuContext.variant }>\n\t\t\t\t\t<Styled.PopoverInnerWrapper { ...renderProps } />\n\t\t\t\t</Styled.PopoverOuterWrapper>\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</Ariakit.Menu>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SACCC,UAAU,EACVC,OAAO,EACPC,UAAU,EACVC,WAAW,QACL,oBAAoB;;AAE3B;AACA;AACA;;AAGA,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,SAASC,OAAO,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpC,OAAO,MAAMC,OAAO,GAAGN,UAAU,CAG9B,SAASM,OAAOA,CAClB;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,KAAK;EAAEC,KAAK,GAAG,IAAI;EAAE,GAAGC;AAAW,CAAC,EACxDC,GAAG,EACF;EACD,MAAMC,WAAW,GAAGf,UAAU,CAAEK,OAAQ,CAAC;;EAEzC;EACA;EACA;EACA,MAAMW,oBAAoB,GAAGjB,OAAO,CAACkB,aAAa,CACjDF,WAAW,EAAEG,KAAK,EAClB,kBACD,CAAC,EAAEC,KAAK,CAAE,GAAI,CAAC,CAAE,CAAC,CAAE;EAEpB,MAAMC,YAAY,GAAGjB,WAAW,CAC7BkB,KAAqC,IAAM;IAC5C;IACA;IACAA,KAAK,CAACC,cAAc,CAAC,CAAC;IACtB;IACA,OAAO,IAAI;EACZ,CAAC,EACD,EACD,CAAC;EAED,MAAMC,iBAAiB,GAAGxB,OAAO,CAACkB,aAAa,CAAEF,WAAW,EAAEG,KAAK,EAAE,KAAM,CAAC,GACzE,KAAK,GACL,KAAK;EAER,MAAMM,YAAY,GAAGvB,OAAO,CAC3B,OAAQ;IACPwB,GAAG,EAAEF,iBAAiB;IACtBG,KAAK,EAAE;MACNC,SAAS,EACRJ;IACF;EACD,CAAC,CAAE,EACH,CAAEA,iBAAiB,CACpB,CAAC;EAED,IAAK,CAAER,WAAW,EAAEG,KAAK,EAAG;IAC3B,MAAM,IAAIU,KAAK,CACd,2DACD,CAAC;EACF;EAEA,oBACCrB,IAAA,CAACR,OAAO,CAAC8B,IAAI;IAAA,GACPhB,UAAU;IACfC,GAAG,EAAGA,GAAK;IACXF,KAAK,EAAGA,KAAO;IACfM,KAAK,EAAGH,WAAW,CAACG;IACpB;IACA;IAAA;IACAT,MAAM,EAAGA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAMM,WAAW,CAACG,KAAK,CAACY,MAAM,GAAG,CAAC,GAAG;IACpD;IACA;IAAA;IACAnB,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAMI,WAAW,CAACG,KAAK,CAACY,MAAM,GAAG,CAAC,CAAC,GAAG,CAAK;IACxDC,kBAAkB,EAAG,KAAO;IAC5B,aAAYf,oBAAsB;IAClCQ,YAAY,EAAGA,YAAc;IAC7BJ,YAAY,EAAGA,YAAc;IAC7BY,aAAa;IACbC,MAAM,EAAKC,WAAW;IAAA;IACrB;IACA;IACA;IACA;IACA3B,IAAA,CAACH,MAAM,CAAC+B,mBAAmB;MAACC,OAAO,EAAGrB,WAAW,CAACqB,OAAS;MAAA1B,QAAA,eAC1DH,IAAA,CAACH,MAAM,CAACiC,mBAAmB;QAAA,GAAMH;MAAW,CAAI;IAAC,CACtB,CAC1B;IAAAxB,QAAA,EAEDA;EAAQ,CACG,CAAC;AAEjB,CAAE,CAAC","ignoreList":[]}
@@ -13,7 +13,7 @@ import { Icon } from '@wordpress/icons';
13
13
  * Internal dependencies
14
14
  */
15
15
 
16
- import { MenuContext } from './context';
16
+ import { Context } from './context';
17
17
  import * as Styled from './styles';
18
18
  import { SVG, Circle } from '@wordpress/primitives';
19
19
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -26,18 +26,18 @@ const radioCheck = /*#__PURE__*/_jsx(SVG, {
26
26
  r: 3
27
27
  })
28
28
  });
29
- export const MenuRadioItem = forwardRef(function MenuRadioItem({
29
+ export const RadioItem = forwardRef(function RadioItem({
30
30
  suffix,
31
31
  children,
32
32
  disabled = false,
33
33
  hideOnClick = false,
34
34
  ...props
35
35
  }, ref) {
36
- const menuContext = useContext(MenuContext);
36
+ const menuContext = useContext(Context);
37
37
  if (!menuContext?.store) {
38
38
  throw new Error('Menu.RadioItem can only be rendered inside a Menu component');
39
39
  }
40
- return /*#__PURE__*/_jsxs(Styled.MenuRadioItem, {
40
+ return /*#__PURE__*/_jsxs(Styled.RadioItem, {
41
41
  ref: ref,
42
42
  ...props,
43
43
  accessibleWhenDisabled: true,
@@ -57,8 +57,8 @@ export const MenuRadioItem = forwardRef(function MenuRadioItem({
57
57
  icon: radioCheck,
58
58
  size: 24
59
59
  })
60
- }), /*#__PURE__*/_jsxs(Styled.MenuItemContentWrapper, {
61
- children: [/*#__PURE__*/_jsx(Styled.MenuItemChildrenWrapper, {
60
+ }), /*#__PURE__*/_jsxs(Styled.ItemContentWrapper, {
61
+ children: [/*#__PURE__*/_jsx(Styled.ItemChildrenWrapper, {
62
62
  children: children
63
63
  }), suffix && /*#__PURE__*/_jsx(Styled.ItemSuffixWrapper, {
64
64
  children: suffix
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","forwardRef","useContext","Icon","MenuContext","Styled","SVG","Circle","jsx","_jsx","jsxs","_jsxs","radioCheck","xmlns","viewBox","children","cx","cy","r","MenuRadioItem","suffix","disabled","hideOnClick","props","ref","menuContext","store","Error","accessibleWhenDisabled","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","icon","size","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/radio-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 } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuRadioItemProps } from './types';\nimport * as Styled from './styles';\nimport { SVG, Circle } from '@wordpress/primitives';\n\nconst radioCheck = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Circle cx={ 12 } cy={ 12 } r={ 3 }></Circle>\n\t</SVG>\n);\n\nexport const MenuRadioItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuRadioItemProps, 'div', false >\n>( function MenuRadioItem(\n\t{ suffix, children, disabled = false, hideOnClick = false, ...props },\n\tref\n) {\n\tconst menuContext = useContext( MenuContext );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.RadioItem can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.MenuRadioItem\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={ radioCheck } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.MenuItemContentWrapper>\n\t\t\t\t<Styled.MenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.MenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.MenuItemContentWrapper>\n\t\t</Styled.MenuRadioItem>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,IAAI,QAAQ,kBAAkB;;AAEvC;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AAEvC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,SAASC,GAAG,EAAEC,MAAM,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpD,MAAMC,UAAU,gBACfH,IAAA,CAACH,GAAG;EAACO,KAAK,EAAC,4BAA4B;EAACC,OAAO,EAAC,WAAW;EAAAC,QAAA,eAC1DN,IAAA,CAACF,MAAM;IAACS,EAAE,EAAG,EAAI;IAACC,EAAE,EAAG,EAAI;IAACC,CAAC,EAAG;EAAG,CAAS;AAAC,CACzC,CACL;AAED,OAAO,MAAMC,aAAa,GAAGlB,UAAU,CAGpC,SAASkB,aAAaA,CACxB;EAAEC,MAAM;EAAEL,QAAQ;EAAEM,QAAQ,GAAG,KAAK;EAAEC,WAAW,GAAG,KAAK;EAAE,GAAGC;AAAM,CAAC,EACrEC,GAAG,EACF;EACD,MAAMC,WAAW,GAAGvB,UAAU,CAAEE,WAAY,CAAC;EAE7C,IAAK,CAAEqB,WAAW,EAAEC,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,6DACD,CAAC;EACF;EAEA,oBACChB,KAAA,CAACN,MAAM,CAACc,aAAa;IACpBK,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVK,sBAAsB;IACtBP,QAAQ,EAAGA,QAAU;IACrBC,WAAW,EAAGA,WAAa;IAC3BI,KAAK,EAAGD,WAAW,CAACC,KAAO;IAAAX,QAAA,gBAE3BN,IAAA,CAACT,OAAO,CAAC6B,aAAa;MACrBH,KAAK,EAAGD,WAAW,CAACC,KAAO;MAC3BI,MAAM,eAAGrB,IAAA,CAACJ,MAAM,CAAC0B,iBAAiB,IAAE;MACpC;MAAA;MACAC,KAAK,EAAG;QAAEC,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAG;MAAAnB,QAAA,eAE3CN,IAAA,CAACN,IAAI;QAACgC,IAAI,EAAGvB,UAAY;QAACwB,IAAI,EAAG;MAAI,CAAE;IAAC,CAClB,CAAC,eAExBzB,KAAA,CAACN,MAAM,CAACgC,sBAAsB;MAAAtB,QAAA,gBAC7BN,IAAA,CAACJ,MAAM,CAACiC,uBAAuB;QAAAvB,QAAA,EAC5BA;MAAQ,CACqB,CAAC,EAE/BK,MAAM,iBACPX,IAAA,CAACJ,MAAM,CAACkC,iBAAiB;QAAAxB,QAAA,EACtBK;MAAM,CACiB,CAC1B;IAAA,CAC6B,CAAC;EAAA,CACX,CAAC;AAEzB,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","forwardRef","useContext","Icon","Context","Styled","SVG","Circle","jsx","_jsx","jsxs","_jsxs","radioCheck","xmlns","viewBox","children","cx","cy","r","RadioItem","suffix","disabled","hideOnClick","props","ref","menuContext","store","Error","accessibleWhenDisabled","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","icon","size","ItemContentWrapper","ItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/radio-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 } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { Context } from './context';\nimport type { RadioItemProps } from './types';\nimport * as Styled from './styles';\nimport { SVG, Circle } from '@wordpress/primitives';\n\nconst radioCheck = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Circle cx={ 12 } cy={ 12 } r={ 3 }></Circle>\n\t</SVG>\n);\n\nexport const RadioItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< RadioItemProps, 'div', false >\n>( function RadioItem(\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.RadioItem can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.RadioItem\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={ radioCheck } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.ItemContentWrapper>\n\t\t\t\t<Styled.ItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.ItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.ItemContentWrapper>\n\t\t</Styled.RadioItem>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,IAAI,QAAQ,kBAAkB;;AAEvC;AACA;AACA;;AAEA,SAASC,OAAO,QAAQ,WAAW;AAEnC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,SAASC,GAAG,EAAEC,MAAM,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpD,MAAMC,UAAU,gBACfH,IAAA,CAACH,GAAG;EAACO,KAAK,EAAC,4BAA4B;EAACC,OAAO,EAAC,WAAW;EAAAC,QAAA,eAC1DN,IAAA,CAACF,MAAM;IAACS,EAAE,EAAG,EAAI;IAACC,EAAE,EAAG,EAAI;IAACC,CAAC,EAAG;EAAG,CAAS;AAAC,CACzC,CACL;AAED,OAAO,MAAMC,SAAS,GAAGlB,UAAU,CAGhC,SAASkB,SAASA,CACpB;EAAEC,MAAM;EAAEL,QAAQ;EAAEM,QAAQ,GAAG,KAAK;EAAEC,WAAW,GAAG,KAAK;EAAE,GAAGC;AAAM,CAAC,EACrEC,GAAG,EACF;EACD,MAAMC,WAAW,GAAGvB,UAAU,CAAEE,OAAQ,CAAC;EAEzC,IAAK,CAAEqB,WAAW,EAAEC,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,6DACD,CAAC;EACF;EAEA,oBACChB,KAAA,CAACN,MAAM,CAACc,SAAS;IAChBK,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVK,sBAAsB;IACtBP,QAAQ,EAAGA,QAAU;IACrBC,WAAW,EAAGA,WAAa;IAC3BI,KAAK,EAAGD,WAAW,CAACC,KAAO;IAAAX,QAAA,gBAE3BN,IAAA,CAACT,OAAO,CAAC6B,aAAa;MACrBH,KAAK,EAAGD,WAAW,CAACC,KAAO;MAC3BI,MAAM,eAAGrB,IAAA,CAACJ,MAAM,CAAC0B,iBAAiB,IAAE;MACpC;MAAA;MACAC,KAAK,EAAG;QAAEC,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAG;MAAAnB,QAAA,eAE3CN,IAAA,CAACN,IAAI;QAACgC,IAAI,EAAGvB,UAAY;QAACwB,IAAI,EAAG;MAAI,CAAE;IAAC,CAClB,CAAC,eAExBzB,KAAA,CAACN,MAAM,CAACgC,kBAAkB;MAAAtB,QAAA,gBACzBN,IAAA,CAACJ,MAAM,CAACiC,mBAAmB;QAAAvB,QAAA,EACxBA;MAAQ,CACiB,CAAC,EAE3BK,MAAM,iBACPX,IAAA,CAACJ,MAAM,CAACkC,iBAAiB;QAAAxB,QAAA,EACtBK;MAAM,CACiB,CAC1B;IAAA,CACyB,CAAC;EAAA,CACX,CAAC;AAErB,CAAE,CAAC","ignoreList":[]}
@@ -7,15 +7,15 @@ import { forwardRef, useContext } from '@wordpress/element';
7
7
  * Internal dependencies
8
8
  */
9
9
 
10
- import { MenuContext } from './context';
10
+ import { Context } from './context';
11
11
  import * as Styled from './styles';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- export const MenuSeparator = forwardRef(function MenuSeparator(props, ref) {
14
- const menuContext = useContext(MenuContext);
13
+ export const Separator = forwardRef(function Separator(props, ref) {
14
+ const menuContext = useContext(Context);
15
15
  if (!menuContext?.store) {
16
16
  throw new Error('Menu.Separator can only be rendered inside a Menu component');
17
17
  }
18
- return /*#__PURE__*/_jsx(Styled.MenuSeparator, {
18
+ return /*#__PURE__*/_jsx(Styled.Separator, {
19
19
  ref: ref,
20
20
  ...props,
21
21
  store: menuContext.store,
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","useContext","MenuContext","Styled","jsx","_jsx","MenuSeparator","props","ref","menuContext","store","Error","variant"],"sources":["@wordpress/components/src/menu/separator.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuSeparatorProps } from './types';\nimport * as Styled from './styles';\n\nexport const MenuSeparator = forwardRef<\n\tHTMLHRElement,\n\tWordPressComponentProps< MenuSeparatorProps, 'hr', false >\n>( function MenuSeparator( props, ref ) {\n\tconst menuContext = useContext( MenuContext );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.Separator can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.MenuSeparator\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ menuContext.store }\n\t\t\tvariant={ menuContext.variant }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AAEvC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,OAAO,MAAMC,aAAa,GAAGN,UAAU,CAGpC,SAASM,aAAaA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACvC,MAAMC,WAAW,GAAGR,UAAU,CAAEC,WAAY,CAAC;EAE7C,IAAK,CAAEO,WAAW,EAAEC,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,6DACD,CAAC;EACF;EAEA,oBACCN,IAAA,CAACF,MAAM,CAACG,aAAa;IACpBE,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVG,KAAK,EAAGD,WAAW,CAACC,KAAO;IAC3BE,OAAO,EAAGH,WAAW,CAACG;EAAS,CAC/B,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","useContext","Context","Styled","jsx","_jsx","Separator","props","ref","menuContext","store","Error","variant"],"sources":["@wordpress/components/src/menu/separator.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 { SeparatorProps } from './types';\nimport * as Styled from './styles';\n\nexport const Separator = forwardRef<\n\tHTMLHRElement,\n\tWordPressComponentProps< SeparatorProps, 'hr', false >\n>( function Separator( props, ref ) {\n\tconst menuContext = useContext( Context );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.Separator can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.Separator\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ menuContext.store }\n\t\t\tvariant={ menuContext.variant }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAEA,SAASC,OAAO,QAAQ,WAAW;AAEnC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,OAAO,MAAMC,SAAS,GAAGN,UAAU,CAGhC,SAASM,SAASA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACnC,MAAMC,WAAW,GAAGR,UAAU,CAAEC,OAAQ,CAAC;EAEzC,IAAK,CAAEO,WAAW,EAAEC,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,6DACD,CAAC;EACF;EAEA,oBACCN,IAAA,CAACF,MAAM,CAACG,SAAS;IAChBE,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVG,KAAK,EAAGD,WAAW,CAACC,KAAO;IAC3BE,OAAO,EAAGH,WAAW,CAACG;EAAS,CAC/B,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}