@wordpress/components 29.1.0 → 29.2.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 (220) hide show
  1. package/CHANGELOG.md +19 -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/circular-option-picker/circular-option-picker-option.js +9 -7
  7. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  8. package/build/circular-option-picker/circular-option-picker.js +0 -1
  9. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  10. package/build/color-palette/index.js +1 -6
  11. package/build/color-palette/index.js.map +1 -1
  12. package/build/font-size-picker/index.native.js +1 -1
  13. package/build/font-size-picker/index.native.js.map +1 -1
  14. package/build/higher-order/with-focus-return/index.js +1 -1
  15. package/build/higher-order/with-focus-return/index.js.map +1 -1
  16. package/build/input-control/styles/input-control-styles.js +22 -22
  17. package/build/input-control/styles/input-control-styles.js.map +1 -1
  18. package/build/menu/checkbox-item.js +6 -6
  19. package/build/menu/checkbox-item.js.map +1 -1
  20. package/build/menu/context.js +2 -2
  21. package/build/menu/context.js.map +1 -1
  22. package/build/menu/group-label.js +4 -4
  23. package/build/menu/group-label.js.map +1 -1
  24. package/build/menu/group.js +4 -4
  25. package/build/menu/group.js.map +1 -1
  26. package/build/menu/index.js +87 -14
  27. package/build/menu/index.js.map +1 -1
  28. package/build/menu/item-help-text.js +4 -4
  29. package/build/menu/item-help-text.js.map +1 -1
  30. package/build/menu/item-label.js +4 -4
  31. package/build/menu/item-label.js.map +1 -1
  32. package/build/menu/item.js +6 -6
  33. package/build/menu/item.js.map +1 -1
  34. package/build/menu/popover.js +5 -5
  35. package/build/menu/popover.js.map +1 -1
  36. package/build/menu/radio-item.js +6 -6
  37. package/build/menu/radio-item.js.map +1 -1
  38. package/build/menu/separator.js +4 -4
  39. package/build/menu/separator.js.map +1 -1
  40. package/build/menu/styles.js +41 -41
  41. package/build/menu/styles.js.map +1 -1
  42. package/build/menu/submenu-trigger-item.js +5 -5
  43. package/build/menu/submenu-trigger-item.js.map +1 -1
  44. package/build/menu/trigger-button.js +3 -3
  45. package/build/menu/trigger-button.js.map +1 -1
  46. package/build/menu/types.js.map +1 -1
  47. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
  48. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  49. package/build/mobile/utils/get-px-from-css-unit.native.js +3 -3
  50. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  51. package/build/notice/types.js.map +1 -1
  52. package/build/search-control/index.js +1 -1
  53. package/build/search-control/index.js.map +1 -1
  54. package/build/text/hook.js +8 -6
  55. package/build/text/hook.js.map +1 -1
  56. package/build/text/utils.js +1 -1
  57. package/build/text/utils.js.map +1 -1
  58. package/build-module/badge/index.js +28 -22
  59. package/build-module/badge/index.js.map +1 -1
  60. package/build-module/circular-option-picker/circular-option-picker-option.js +9 -7
  61. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  62. package/build-module/circular-option-picker/circular-option-picker.js +0 -1
  63. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  64. package/build-module/color-palette/index.js +1 -6
  65. package/build-module/color-palette/index.js.map +1 -1
  66. package/build-module/font-size-picker/index.native.js +1 -1
  67. package/build-module/font-size-picker/index.native.js.map +1 -1
  68. package/build-module/higher-order/with-focus-return/index.js +1 -1
  69. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  70. package/build-module/input-control/styles/input-control-styles.js +22 -22
  71. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  72. package/build-module/menu/checkbox-item.js +6 -6
  73. package/build-module/menu/checkbox-item.js.map +1 -1
  74. package/build-module/menu/context.js +1 -1
  75. package/build-module/menu/context.js.map +1 -1
  76. package/build-module/menu/group-label.js +4 -4
  77. package/build-module/menu/group-label.js.map +1 -1
  78. package/build-module/menu/group.js +4 -4
  79. package/build-module/menu/group.js.map +1 -1
  80. package/build-module/menu/index.js +99 -26
  81. package/build-module/menu/index.js.map +1 -1
  82. package/build-module/menu/item-help-text.js +4 -4
  83. package/build-module/menu/item-help-text.js.map +1 -1
  84. package/build-module/menu/item-label.js +4 -4
  85. package/build-module/menu/item-label.js.map +1 -1
  86. package/build-module/menu/item.js +6 -6
  87. package/build-module/menu/item.js.map +1 -1
  88. package/build-module/menu/popover.js +5 -5
  89. package/build-module/menu/popover.js.map +1 -1
  90. package/build-module/menu/radio-item.js +6 -6
  91. package/build-module/menu/radio-item.js.map +1 -1
  92. package/build-module/menu/separator.js +4 -4
  93. package/build-module/menu/separator.js.map +1 -1
  94. package/build-module/menu/styles.js +40 -40
  95. package/build-module/menu/styles.js.map +1 -1
  96. package/build-module/menu/submenu-trigger-item.js +6 -6
  97. package/build-module/menu/submenu-trigger-item.js.map +1 -1
  98. package/build-module/menu/trigger-button.js +3 -3
  99. package/build-module/menu/trigger-button.js.map +1 -1
  100. package/build-module/menu/types.js.map +1 -1
  101. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
  102. package/build-module/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  103. package/build-module/mobile/utils/get-px-from-css-unit.native.js +3 -3
  104. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  105. package/build-module/notice/types.js.map +1 -1
  106. package/build-module/search-control/index.js +1 -1
  107. package/build-module/search-control/index.js.map +1 -1
  108. package/build-module/text/hook.js +8 -6
  109. package/build-module/text/hook.js.map +1 -1
  110. package/build-module/text/utils.js +1 -1
  111. package/build-module/text/utils.js.map +1 -1
  112. package/build-style/style-rtl.css +89 -170
  113. package/build-style/style.css +89 -170
  114. package/build-types/badge/index.d.ts.map +1 -1
  115. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  116. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  117. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  118. package/build-types/color-palette/index.d.ts.map +1 -1
  119. package/build-types/higher-order/with-focus-return/index.d.ts +1 -1
  120. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  121. package/build-types/menu/checkbox-item.d.ts +2 -2
  122. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  123. package/build-types/menu/context.d.ts +2 -2
  124. package/build-types/menu/context.d.ts.map +1 -1
  125. package/build-types/menu/group-label.d.ts +2 -2
  126. package/build-types/menu/group-label.d.ts.map +1 -1
  127. package/build-types/menu/group.d.ts +2 -2
  128. package/build-types/menu/group.d.ts.map +1 -1
  129. package/build-types/menu/index.d.ts +84 -12
  130. package/build-types/menu/index.d.ts.map +1 -1
  131. package/build-types/menu/item-help-text.d.ts +1 -1
  132. package/build-types/menu/item-help-text.d.ts.map +1 -1
  133. package/build-types/menu/item-label.d.ts +1 -1
  134. package/build-types/menu/item-label.d.ts.map +1 -1
  135. package/build-types/menu/item.d.ts +2 -2
  136. package/build-types/menu/item.d.ts.map +1 -1
  137. package/build-types/menu/popover.d.ts +2 -2
  138. package/build-types/menu/popover.d.ts.map +1 -1
  139. package/build-types/menu/radio-item.d.ts +2 -2
  140. package/build-types/menu/radio-item.d.ts.map +1 -1
  141. package/build-types/menu/separator.d.ts +2 -2
  142. package/build-types/menu/separator.d.ts.map +1 -1
  143. package/build-types/menu/styles.d.ts +15 -15
  144. package/build-types/menu/styles.d.ts.map +1 -1
  145. package/build-types/menu/submenu-trigger-item.d.ts +2 -2
  146. package/build-types/menu/submenu-trigger-item.d.ts.map +1 -1
  147. package/build-types/menu/trigger-button.d.ts +2 -2
  148. package/build-types/menu/trigger-button.d.ts.map +1 -1
  149. package/build-types/menu/types.d.ts +10 -10
  150. package/build-types/menu/types.d.ts.map +1 -1
  151. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  152. package/build-types/notice/types.d.ts +1 -1
  153. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  154. package/build-types/tabs/stories/index.story.d.ts +0 -3
  155. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  156. package/build-types/text/hook.d.ts.map +1 -1
  157. package/build-types/text/utils.d.ts +1 -1
  158. package/package.json +19 -19
  159. package/src/animate/style.scss +16 -12
  160. package/src/badge/index.tsx +28 -27
  161. package/src/border-control/test/index.js +12 -4
  162. package/src/button/style.scss +15 -12
  163. package/src/checkbox-control/style.scss +4 -2
  164. package/src/circular-option-picker/README.md +1 -2
  165. package/src/circular-option-picker/circular-option-picker-option.tsx +17 -10
  166. package/src/circular-option-picker/circular-option-picker.tsx +0 -1
  167. package/src/circular-option-picker/stories/index.story.tsx +0 -1
  168. package/src/circular-option-picker/style.scss +10 -5
  169. package/src/color-palette/index.tsx +0 -7
  170. package/src/color-palette/test/index.tsx +2 -8
  171. package/src/combobox-control/test/index.tsx +1 -1
  172. package/src/drop-zone/style.scss +6 -9
  173. package/src/font-size-picker/index.native.js +1 -1
  174. package/src/form-toggle/style.scss +17 -10
  175. package/src/form-token-field/style.scss +9 -4
  176. package/src/higher-order/navigate-regions/style.scss +2 -2
  177. package/src/higher-order/with-focus-return/index.tsx +1 -1
  178. package/src/input-control/styles/input-control-styles.tsx +6 -0
  179. package/src/menu/README.md +421 -174
  180. package/src/menu/checkbox-item.tsx +12 -12
  181. package/src/menu/context.tsx +2 -4
  182. package/src/menu/docs-manifest.json +62 -0
  183. package/src/menu/group-label.tsx +7 -7
  184. package/src/menu/group.tsx +7 -11
  185. package/src/menu/index.tsx +101 -31
  186. package/src/menu/item-help-text.tsx +5 -7
  187. package/src/menu/item-label.tsx +5 -7
  188. package/src/menu/item.tsx +12 -12
  189. package/src/menu/popover.tsx +9 -9
  190. package/src/menu/radio-item.tsx +12 -12
  191. package/src/menu/separator.tsx +7 -7
  192. package/src/menu/stories/best-practices.mdx +38 -0
  193. package/src/menu/stories/index.story.tsx +8 -8
  194. package/src/menu/styles.ts +24 -24
  195. package/src/menu/submenu-trigger-item.tsx +9 -9
  196. package/src/menu/trigger-button.tsx +6 -6
  197. package/src/menu/types.ts +10 -10
  198. package/src/menu-group/stories/index.story.tsx +2 -2
  199. package/src/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -1
  200. package/src/mobile/utils/get-px-from-css-unit.native.js +3 -3
  201. package/src/modal/style.scss +4 -2
  202. package/src/modal/test/index.tsx +5 -4
  203. package/src/notice/README.md +3 -3
  204. package/src/notice/types.ts +1 -1
  205. package/src/palette-edit/test/index.tsx +1 -1
  206. package/src/panel/style.scss +14 -6
  207. package/src/placeholder/style.scss +5 -3
  208. package/src/progress-bar/stories/index.story.tsx +1 -1
  209. package/src/resizable-box/style.scss +14 -9
  210. package/src/search-control/index.tsx +1 -1
  211. package/src/tab-panel/style.scss +6 -4
  212. package/src/tabs/stories/index.story.tsx +0 -131
  213. package/src/text/README.md +1 -1
  214. package/src/text/hook.ts +3 -2
  215. package/src/text/stories/index.story.tsx +2 -2
  216. package/src/text/test/index.tsx +1 -1
  217. package/src/text/utils.ts +1 -1
  218. package/src/text-highlight/test/index.tsx +3 -3
  219. package/src/toolbar/toolbar/style.scss +4 -3
  220. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","css","COLORS","font","rtl","CONFIG","space","Icon","Truncate","ANIMATION_PARAMS","SCALE_AMOUNT_OUTER","SCALE_AMOUNT_CONTENT","DURATION","IN","OUT","EASING","CONTENT_WRAPPER_PADDING","ITEM_PADDING_BLOCK","ITEM_PADDING_INLINE","DEFAULT_BORDER_COLOR","theme","gray","DIVIDER_COLOR","LIGHTER_TEXT_COLOR","LIGHT_BACKGROUND_COLOR","TOOLBAR_VARIANT_BORDER_COLOR","foreground","DEFAULT_BOX_SHADOW","borderWidth","elevationMedium","TOOLBAR_VARIANT_BOX_SHADOW","GRID_TEMPLATE_COLS","MenuPopoverOuterWrapper","_styled","process","env","NODE_ENV","target","label","ui","background","radiusMedium","props","variant","MenuPopoverInnerWrapper","baseItem","radiusSmall","textDisabled","accent","accentInverted","MenuItem","MenuCheckboxItem","MenuItemCheckbox","MenuRadioItem","MenuItemRadio","ItemPrefixWrapper","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper","MenuGroup","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","MenuGroupLabel","MenuSeparator","SubmenuChevronIcon","transform","MenuItemLabel","MenuItemHelpText"],"sources":["@wordpress/components/src/menu/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, font, rtl, CONFIG } from '../utils';\nimport { space } from '../utils/space';\nimport Icon from '../icon';\nimport { Truncate } from '../truncate';\nimport type { MenuContext } from './types';\n\nconst ANIMATION_PARAMS = {\n\tSCALE_AMOUNT_OUTER: 0.82,\n\tSCALE_AMOUNT_CONTENT: 0.9,\n\tDURATION: {\n\t\tIN: '400ms',\n\t\tOUT: '200ms',\n\t},\n\tEASING: 'cubic-bezier(0.33, 0, 0, 1)',\n};\n\nconst CONTENT_WRAPPER_PADDING = space( 1 );\nconst ITEM_PADDING_BLOCK = space( 2 );\nconst ITEM_PADDING_INLINE = space( 3 );\n\n// TODO:\n// - border color and divider color are different from COLORS.theme variables\n// - lighter text color is not defined in COLORS.theme, should it be?\n// - lighter background color is not defined in COLORS.theme, should it be?\nconst DEFAULT_BORDER_COLOR = COLORS.theme.gray[ 300 ];\nconst DIVIDER_COLOR = COLORS.theme.gray[ 200 ];\nconst LIGHTER_TEXT_COLOR = COLORS.theme.gray[ 700 ];\nconst LIGHT_BACKGROUND_COLOR = COLORS.theme.gray[ 100 ];\nconst TOOLBAR_VARIANT_BORDER_COLOR = COLORS.theme.foreground;\nconst DEFAULT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ DEFAULT_BORDER_COLOR }, ${ CONFIG.elevationMedium }`;\nconst TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ TOOLBAR_VARIANT_BORDER_COLOR }`;\n\nconst GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr';\n\nexport const MenuPopoverOuterWrapper = styled.div<\n\tPick< MenuContext, 'variant' >\n>`\n\tposition: relative;\n\n\tbackground-color: ${ COLORS.ui.background };\n\tborder-radius: ${ CONFIG.radiusMedium };\n\t${ ( props ) => css`\n\t\tbox-shadow: ${ props.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BOX_SHADOW\n\t\t\t: DEFAULT_BOX_SHADOW };\n\t` }\n\n\toverflow: hidden;\n\n\t/* Open/close animation (outer wrapper) */\n\t@media not ( prefers-reduced-motion ) {\n\t\ttransition-property: transform, opacity;\n\t\ttransition-timing-function: ${ ANIMATION_PARAMS.EASING };\n\t\ttransition-duration: ${ ANIMATION_PARAMS.DURATION.IN };\n\t\twill-change: transform, opacity;\n\n\t\t/* Regardless of the side, fade in and out. */\n\t\topacity: 0;\n\t\t&:has( [data-enter] ) {\n\t\t\topacity: 1;\n\t\t}\n\n\t\t&:has( [data-leave] ) {\n\t\t\ttransition-duration: ${ ANIMATION_PARAMS.DURATION.OUT };\n\t\t}\n\n\t\t/* For menus opening on top and bottom side, animate the scale Y too. */\n\t\t&:has( [data-side='bottom'] ),\n\t\t&:has( [data-side='top'] ) {\n\t\t\ttransform: scaleY( ${ ANIMATION_PARAMS.SCALE_AMOUNT_OUTER } );\n\t\t}\n\t\t&:has( [data-side='bottom'] ) {\n\t\t\ttransform-origin: top;\n\t\t}\n\t\t&:has( [data-side='top'] ) {\n\t\t\ttransform-origin: bottom;\n\t\t}\n\t\t&:has( [data-enter][data-side='bottom'] ),\n\t\t&:has( [data-enter][data-side='top'] ),\n\t\t/* Do not animate the scaleY when closing the menu */\n\t\t&:has( [data-leave][data-side='bottom'] ),\n\t\t&:has( [data-leave][data-side='top'] ) {\n\t\t\ttransform: scaleY( 1 );\n\t\t}\n\t}\n`;\n\nexport const MenuPopoverInnerWrapper = styled.div`\n\tposition: relative;\n\t/* Same as popover component */\n\t/* TODO: is there a way to read the sass variable? */\n\tz-index: 1000000;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\tgrid-template-rows: auto;\n\n\tbox-sizing: border-box;\n\tmin-width: 160px;\n\tmax-width: 320px;\n\tmax-height: var( --popover-available-height );\n\n\tpadding: ${ CONTENT_WRAPPER_PADDING };\n\n\toverscroll-behavior: contain;\n\toverflow: auto;\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent !important;\n\n\t/* Open/close animation (inner content wrapper) */\n\t@media not ( prefers-reduced-motion ) {\n\t\ttransition: inherit;\n\t\ttransform-origin: inherit;\n\n\t\t/*\n\t\t * For menus opening on top and bottom side, animate the scale Y too.\n\t\t * The content scales at a different rate than the outer container:\n\t\t * - first, counter the outer scale factor by doing \"1 / scaleAmountOuter\"\n\t\t * - then, apply the content scale factor.\n\t\t */\n\t\t&[data-side='bottom'],\n\t\t&[data-side='top'] {\n\t\t\ttransform: scaleY(\n\t\t\t\tcalc(\n\t\t\t\t\t1 / ${ ANIMATION_PARAMS.SCALE_AMOUNT_OUTER } *\n\t\t\t\t\t\t${ ANIMATION_PARAMS.SCALE_AMOUNT_CONTENT }\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t&[data-enter][data-side='bottom'],\n\t\t&[data-enter][data-side='top'],\n\t\t/* Do not animate the scaleY when closing the menu */\n\t\t&[data-leave][data-side='bottom'],\n\t\t&[data-leave][data-side='top'] {\n\t\t\ttransform: scaleY( 1 );\n\t\t}\n\t}\n`;\n\nconst baseItem = css`\n\tall: unset;\n\n\tposition: relative;\n\tmin-height: ${ space( 10 ) };\n\tbox-sizing: border-box;\n\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\talign-items: center;\n\n\t@supports ( grid-template-columns: subgrid ) {\n\t\t/*\n\t\t * Define a grid layout which inherits the same columns configuration\n\t\t * from the parent layout (ie. subgrid). This allows the menu\n\t\t * to synchronize the indentation of all its items.\n\t\t */\n\t\tgrid-template-columns: subgrid;\n\t}\n\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tfont-family: inherit;\n\tfont-weight: normal;\n\tline-height: 20px;\n\n\tcolor: ${ COLORS.theme.foreground };\n\tborder-radius: ${ CONFIG.radiusSmall };\n\n\tpadding-block: ${ ITEM_PADDING_BLOCK };\n\tpadding-inline: ${ ITEM_PADDING_INLINE };\n\n\t/*\n\t * Make sure that, when an item is scrolled into view (eg. while using the\n\t * keyboard to move focus), the whole item comes into view\n\t */\n\tscroll-margin: ${ CONTENT_WRAPPER_PADDING };\n\n\tuser-select: none;\n\toutline: none;\n\n\t&[aria-disabled='true'] {\n\t\tcolor: ${ COLORS.ui.textDisabled };\n\t\tcursor: not-allowed;\n\t}\n\n\t/* Active item (including hover) */\n\t&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t) {\n\t\tbackground-color: ${ COLORS.theme.accent };\n\t\tcolor: ${ COLORS.theme.accentInverted };\n\t}\n\n\t/* Keyboard focus (focus-visible) */\n\t&[data-focus-visible] {\n\t\tbox-shadow: 0 0 0 1.5px ${ COLORS.theme.accent };\n\n\t\t/* Only visible in Windows High Contrast mode */\n\t\toutline: 2px solid transparent;\n\t}\n\n\t/* Active (ie. pressed, mouse down) */\n\t&:active,\n\t&[data-active] {\n\t\t/* TODO: should there be a visual active state? */\n\t}\n\n\t/* When the item is the trigger of an open submenu */\n\t${ MenuPopoverInnerWrapper }:not(:focus) &:not(:focus)[aria-expanded=\"true\"] {\n\t\tbackground-color: ${ LIGHT_BACKGROUND_COLOR };\n\t\tcolor: ${ COLORS.theme.foreground };\n\t}\n\n\tsvg {\n\t\tfill: currentColor;\n\t}\n`;\n\nexport const MenuItem = styled( Ariakit.MenuItem )`\n\t${ baseItem };\n`;\n\nexport const MenuCheckboxItem = styled( Ariakit.MenuItemCheckbox )`\n\t${ baseItem };\n`;\n\nexport const MenuRadioItem = styled( Ariakit.MenuItemRadio )`\n\t${ baseItem };\n`;\n\nexport const ItemPrefixWrapper = styled.span`\n\t/* Always occupy the first column, even when auto-collapsing */\n\tgrid-column: 1;\n\n\t/*\n\t * Even when the item is not checked, occupy the same screen space to avoid\n\t * the space collapside when no items are checked.\n\t */\n\t${ MenuCheckboxItem } > &,\n\t${ MenuRadioItem } > & {\n\t\t/* Same width as the check icons */\n\t\tmin-width: ${ space( 6 ) };\n\t}\n\n\t${ MenuCheckboxItem } > &,\n\t${ MenuRadioItem } > &,\n\t&:not( :empty ) {\n\t\tmargin-inline-end: ${ space( 2 ) };\n\t}\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\n\tcolor: ${ LIGHTER_TEXT_COLOR };\n\n\t/*\n\t* When the parent menu item is active, except when it's a non-focused/hovered\n\t* submenu trigger (in that case, color should not be inherited)\n\t*/\n\t[data-active-item]:not( [data-focus-visible] ) > &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] > & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const MenuItemContentWrapper = styled.div`\n\t/*\n\t * Always occupy the second column, since the first column\n\t * is taken by the prefix wrapper (when displayed).\n\t */\n\tgrid-column: 2;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: ${ space( 3 ) };\n\n\tpointer-events: none;\n`;\n\nexport const MenuItemChildrenWrapper = styled.div`\n\tflex: 1;\n\n\tdisplay: inline-flex;\n\tflex-direction: column;\n\tgap: ${ space( 1 ) };\n`;\n\nexport const ItemSuffixWrapper = styled.span`\n\tflex: 0 1 fit-content;\n\tmin-width: 0;\n\twidth: fit-content;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: ${ space( 3 ) };\n\n\tcolor: ${ LIGHTER_TEXT_COLOR };\n\n\t/*\n\t * When the parent menu item is active, except when it's a non-focused/hovered\n\t * submenu trigger (in that case, color should not be inherited)\n\t */\n\t[data-active-item]:not( [data-focus-visible] ) *:not(${ MenuPopoverInnerWrapper }) &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] *:not(${ MenuPopoverInnerWrapper }) & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const MenuGroup = styled( Ariakit.MenuGroup )`\n\t/* Ignore this element when calculating the layout. Useful for subgrid */\n\tdisplay: contents;\n`;\n\nexport const MenuGroupLabel = styled( Ariakit.MenuGroupLabel )`\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tpadding-block-start: ${ space( 3 ) };\n\tpadding-block-end: ${ space( 2 ) };\n\tpadding-inline: ${ ITEM_PADDING_INLINE };\n`;\n\nexport const MenuSeparator = styled( Ariakit.MenuSeparator )<\n\tPick< MenuContext, 'variant' >\n>`\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tborder: none;\n\theight: ${ CONFIG.borderWidth };\n\tbackground-color: ${ ( props ) =>\n\t\tprops.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BORDER_COLOR\n\t\t\t: DIVIDER_COLOR };\n\t/* Align with menu items' content */\n\tmargin-block: ${ space( 2 ) };\n\tmargin-inline: ${ ITEM_PADDING_INLINE };\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent;\n`;\n\nexport const SubmenuChevronIcon = styled( Icon )`\n\twidth: ${ space( 1.5 ) };\n\t${ rtl(\n\t\t{\n\t\t\ttransform: `scaleX(1)`,\n\t\t},\n\t\t{\n\t\t\ttransform: `scaleX(-1)`,\n\t\t}\n\t) };\n`;\n\nexport const MenuItemLabel = styled( Truncate )`\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tline-height: 20px;\n\tcolor: inherit;\n`;\n\nexport const MenuItemHelpText = styled( Truncate )`\n\tfont-size: ${ font( 'helpText.fontSize' ) };\n\tline-height: 16px;\n\tcolor: ${ LIGHTER_TEXT_COLOR };\n\toverflow-wrap: anywhere;\n\n\t[data-active-item]:not( [data-focus-visible] )\n\t\t*:not( ${ MenuPopoverInnerWrapper } )\n\t\t&,\n\t[aria-disabled='true'] *:not( ${ MenuPopoverInnerWrapper } ) & {\n\t\tcolor: inherit;\n\t}\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,GAAG,QAAQ,gBAAgB;AAGpC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,MAAM,QAAQ,UAAU;AACpD,SAASC,KAAK,QAAQ,gBAAgB;AACtC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,QAAQ,QAAQ,aAAa;AAGtC,MAAMC,gBAAgB,GAAG;EACxBC,kBAAkB,EAAE,IAAI;EACxBC,oBAAoB,EAAE,GAAG;EACzBC,QAAQ,EAAE;IACTC,EAAE,EAAE,OAAO;IACXC,GAAG,EAAE;EACN,CAAC;EACDC,MAAM,EAAE;AACT,CAAC;AAED,MAAMC,uBAAuB,GAAGV,KAAK,CAAE,CAAE,CAAC;AAC1C,MAAMW,kBAAkB,GAAGX,KAAK,CAAE,CAAE,CAAC;AACrC,MAAMY,mBAAmB,GAAGZ,KAAK,CAAE,CAAE,CAAC;;AAEtC;AACA;AACA;AACA;AACA,MAAMa,oBAAoB,GAAGjB,MAAM,CAACkB,KAAK,CAACC,IAAI,CAAE,GAAG,CAAE;AACrD,MAAMC,aAAa,GAAGpB,MAAM,CAACkB,KAAK,CAACC,IAAI,CAAE,GAAG,CAAE;AAC9C,MAAME,kBAAkB,GAAGrB,MAAM,CAACkB,KAAK,CAACC,IAAI,CAAE,GAAG,CAAE;AACnD,MAAMG,sBAAsB,GAAGtB,MAAM,CAACkB,KAAK,CAACC,IAAI,CAAE,GAAG,CAAE;AACvD,MAAMI,4BAA4B,GAAGvB,MAAM,CAACkB,KAAK,CAACM,UAAU;AA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AC,CAAC,eAChCnC,IAAI,CAAE,kBAAmB,CAAC,wCAAA+B,OAAA,CAAAC,GAAA,CAAAC,QAAA,okdAGxC;AAED,OAAO,MAAMkC,gBAAgB,gBAAGrC,OAAA,CAAQzB,QAAQ,EAAA0B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,eACnCnC,IAAI,CAAE,mBAAoB,CAAC,8BAE/BoB,kBAAkB,oFAIjBqB,uBAAuB,yCAEDA,uBAAuB,4BAAAV,OAAA,CAAAC,GAAA,CAAAC,QAAA,okdAGxD","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","css","COLORS","font","rtl","CONFIG","space","Icon","Truncate","ANIMATION_PARAMS","SCALE_AMOUNT_OUTER","SCALE_AMOUNT_CONTENT","DURATION","IN","OUT","EASING","CONTENT_WRAPPER_PADDING","ITEM_PADDING_BLOCK","ITEM_PADDING_INLINE","DEFAULT_BORDER_COLOR","theme","gray","DIVIDER_COLOR","LIGHTER_TEXT_COLOR","LIGHT_BACKGROUND_COLOR","TOOLBAR_VARIANT_BORDER_COLOR","foreground","DEFAULT_BOX_SHADOW","borderWidth","elevationMedium","TOOLBAR_VARIANT_BOX_SHADOW","GRID_TEMPLATE_COLS","PopoverOuterWrapper","_styled","process","env","NODE_ENV","target","label","ui","background","radiusMedium","props","variant","PopoverInnerWrapper","baseItem","radiusSmall","textDisabled","accent","accentInverted","Item","MenuItem","CheckboxItem","MenuItemCheckbox","RadioItem","MenuItemRadio","ItemPrefixWrapper","ItemContentWrapper","ItemChildrenWrapper","ItemSuffixWrapper","Group","MenuGroup","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","GroupLabel","MenuGroupLabel","Separator","MenuSeparator","SubmenuChevronIcon","transform","ItemLabel","ItemHelpText"],"sources":["@wordpress/components/src/menu/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, font, rtl, CONFIG } from '../utils';\nimport { space } from '../utils/space';\nimport Icon from '../icon';\nimport { Truncate } from '../truncate';\nimport type { ContextProps } from './types';\n\nconst ANIMATION_PARAMS = {\n\tSCALE_AMOUNT_OUTER: 0.82,\n\tSCALE_AMOUNT_CONTENT: 0.9,\n\tDURATION: {\n\t\tIN: '400ms',\n\t\tOUT: '200ms',\n\t},\n\tEASING: 'cubic-bezier(0.33, 0, 0, 1)',\n};\n\nconst CONTENT_WRAPPER_PADDING = space( 1 );\nconst ITEM_PADDING_BLOCK = space( 2 );\nconst ITEM_PADDING_INLINE = space( 3 );\n\n// TODO:\n// - border color and divider color are different from COLORS.theme variables\n// - lighter text color is not defined in COLORS.theme, should it be?\n// - lighter background color is not defined in COLORS.theme, should it be?\nconst DEFAULT_BORDER_COLOR = COLORS.theme.gray[ 300 ];\nconst DIVIDER_COLOR = COLORS.theme.gray[ 200 ];\nconst LIGHTER_TEXT_COLOR = COLORS.theme.gray[ 700 ];\nconst LIGHT_BACKGROUND_COLOR = COLORS.theme.gray[ 100 ];\nconst TOOLBAR_VARIANT_BORDER_COLOR = COLORS.theme.foreground;\nconst DEFAULT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ DEFAULT_BORDER_COLOR }, ${ CONFIG.elevationMedium }`;\nconst TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ TOOLBAR_VARIANT_BORDER_COLOR }`;\n\nconst GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr';\n\nexport const PopoverOuterWrapper = styled.div<\n\tPick< ContextProps, 'variant' >\n>`\n\tposition: relative;\n\n\tbackground-color: ${ COLORS.ui.background };\n\tborder-radius: ${ CONFIG.radiusMedium };\n\t${ ( props ) => css`\n\t\tbox-shadow: ${ props.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BOX_SHADOW\n\t\t\t: DEFAULT_BOX_SHADOW };\n\t` }\n\n\toverflow: hidden;\n\n\t/* Open/close animation (outer wrapper) */\n\t@media not ( prefers-reduced-motion ) {\n\t\ttransition-property: transform, opacity;\n\t\ttransition-timing-function: ${ ANIMATION_PARAMS.EASING };\n\t\ttransition-duration: ${ ANIMATION_PARAMS.DURATION.IN };\n\t\twill-change: transform, opacity;\n\n\t\t/* Regardless of the side, fade in and out. */\n\t\topacity: 0;\n\t\t&:has( [data-enter] ) {\n\t\t\topacity: 1;\n\t\t}\n\n\t\t&:has( [data-leave] ) {\n\t\t\ttransition-duration: ${ ANIMATION_PARAMS.DURATION.OUT };\n\t\t}\n\n\t\t/* For menus opening on top and bottom side, animate the scale Y too. */\n\t\t&:has( [data-side='bottom'] ),\n\t\t&:has( [data-side='top'] ) {\n\t\t\ttransform: scaleY( ${ ANIMATION_PARAMS.SCALE_AMOUNT_OUTER } );\n\t\t}\n\t\t&:has( [data-side='bottom'] ) {\n\t\t\ttransform-origin: top;\n\t\t}\n\t\t&:has( [data-side='top'] ) {\n\t\t\ttransform-origin: bottom;\n\t\t}\n\t\t&:has( [data-enter][data-side='bottom'] ),\n\t\t&:has( [data-enter][data-side='top'] ),\n\t\t/* Do not animate the scaleY when closing the menu */\n\t\t&:has( [data-leave][data-side='bottom'] ),\n\t\t&:has( [data-leave][data-side='top'] ) {\n\t\t\ttransform: scaleY( 1 );\n\t\t}\n\t}\n`;\n\nexport const PopoverInnerWrapper = styled.div`\n\tposition: relative;\n\t/* Same as popover component */\n\t/* TODO: is there a way to read the sass variable? */\n\tz-index: 1000000;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\tgrid-template-rows: auto;\n\n\tbox-sizing: border-box;\n\tmin-width: 160px;\n\tmax-width: 320px;\n\tmax-height: var( --popover-available-height );\n\n\tpadding: ${ CONTENT_WRAPPER_PADDING };\n\n\toverscroll-behavior: contain;\n\toverflow: auto;\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent !important;\n\n\t/* Open/close animation (inner content wrapper) */\n\t@media not ( prefers-reduced-motion ) {\n\t\ttransition: inherit;\n\t\ttransform-origin: inherit;\n\n\t\t/*\n\t\t * For menus opening on top and bottom side, animate the scale Y too.\n\t\t * The content scales at a different rate than the outer container:\n\t\t * - first, counter the outer scale factor by doing \"1 / scaleAmountOuter\"\n\t\t * - then, apply the content scale factor.\n\t\t */\n\t\t&[data-side='bottom'],\n\t\t&[data-side='top'] {\n\t\t\ttransform: scaleY(\n\t\t\t\tcalc(\n\t\t\t\t\t1 / ${ ANIMATION_PARAMS.SCALE_AMOUNT_OUTER } *\n\t\t\t\t\t\t${ ANIMATION_PARAMS.SCALE_AMOUNT_CONTENT }\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t&[data-enter][data-side='bottom'],\n\t\t&[data-enter][data-side='top'],\n\t\t/* Do not animate the scaleY when closing the menu */\n\t\t&[data-leave][data-side='bottom'],\n\t\t&[data-leave][data-side='top'] {\n\t\t\ttransform: scaleY( 1 );\n\t\t}\n\t}\n`;\n\nconst baseItem = css`\n\tall: unset;\n\n\tposition: relative;\n\tmin-height: ${ space( 10 ) };\n\tbox-sizing: border-box;\n\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\talign-items: center;\n\n\t@supports ( grid-template-columns: subgrid ) {\n\t\t/*\n\t\t * Define a grid layout which inherits the same columns configuration\n\t\t * from the parent layout (ie. subgrid). This allows the menu\n\t\t * to synchronize the indentation of all its items.\n\t\t */\n\t\tgrid-template-columns: subgrid;\n\t}\n\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tfont-family: inherit;\n\tfont-weight: normal;\n\tline-height: 20px;\n\n\tcolor: ${ COLORS.theme.foreground };\n\tborder-radius: ${ CONFIG.radiusSmall };\n\n\tpadding-block: ${ ITEM_PADDING_BLOCK };\n\tpadding-inline: ${ ITEM_PADDING_INLINE };\n\n\t/*\n\t * Make sure that, when an item is scrolled into view (eg. while using the\n\t * keyboard to move focus), the whole item comes into view\n\t */\n\tscroll-margin: ${ CONTENT_WRAPPER_PADDING };\n\n\tuser-select: none;\n\toutline: none;\n\n\t&[aria-disabled='true'] {\n\t\tcolor: ${ COLORS.ui.textDisabled };\n\t\tcursor: not-allowed;\n\t}\n\n\t/* Active item (including hover) */\n\t&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t) {\n\t\tbackground-color: ${ COLORS.theme.accent };\n\t\tcolor: ${ COLORS.theme.accentInverted };\n\t}\n\n\t/* Keyboard focus (focus-visible) */\n\t&[data-focus-visible] {\n\t\tbox-shadow: 0 0 0 1.5px ${ COLORS.theme.accent };\n\n\t\t/* Only visible in Windows High Contrast mode */\n\t\toutline: 2px solid transparent;\n\t}\n\n\t/* Active (ie. pressed, mouse down) */\n\t&:active,\n\t&[data-active] {\n\t\t/* TODO: should there be a visual active state? */\n\t}\n\n\t/* When the item is the trigger of an open submenu */\n\t${ PopoverInnerWrapper }:not(:focus) &:not(:focus)[aria-expanded=\"true\"] {\n\t\tbackground-color: ${ LIGHT_BACKGROUND_COLOR };\n\t\tcolor: ${ COLORS.theme.foreground };\n\t}\n\n\tsvg {\n\t\tfill: currentColor;\n\t}\n`;\n\nexport const Item = styled( Ariakit.MenuItem )`\n\t${ baseItem };\n`;\n\nexport const CheckboxItem = styled( Ariakit.MenuItemCheckbox )`\n\t${ baseItem };\n`;\n\nexport const RadioItem = styled( Ariakit.MenuItemRadio )`\n\t${ baseItem };\n`;\n\nexport const ItemPrefixWrapper = styled.span`\n\t/* Always occupy the first column, even when auto-collapsing */\n\tgrid-column: 1;\n\n\t/*\n\t * Even when the item is not checked, occupy the same screen space to avoid\n\t * the space collapside when no items are checked.\n\t */\n\t${ CheckboxItem } > &,\n\t${ RadioItem } > & {\n\t\t/* Same width as the check icons */\n\t\tmin-width: ${ space( 6 ) };\n\t}\n\n\t${ CheckboxItem } > &,\n\t${ RadioItem } > &,\n\t&:not( :empty ) {\n\t\tmargin-inline-end: ${ space( 2 ) };\n\t}\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\n\tcolor: ${ LIGHTER_TEXT_COLOR };\n\n\t/*\n\t* When the parent menu item is active, except when it's a non-focused/hovered\n\t* submenu trigger (in that case, color should not be inherited)\n\t*/\n\t[data-active-item]:not( [data-focus-visible] ) > &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] > & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const ItemContentWrapper = styled.div`\n\t/*\n\t * Always occupy the second column, since the first column\n\t * is taken by the prefix wrapper (when displayed).\n\t */\n\tgrid-column: 2;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: ${ space( 3 ) };\n\n\tpointer-events: none;\n`;\n\nexport const ItemChildrenWrapper = styled.div`\n\tflex: 1;\n\n\tdisplay: inline-flex;\n\tflex-direction: column;\n\tgap: ${ space( 1 ) };\n`;\n\nexport const ItemSuffixWrapper = styled.span`\n\tflex: 0 1 fit-content;\n\tmin-width: 0;\n\twidth: fit-content;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: ${ space( 3 ) };\n\n\tcolor: ${ LIGHTER_TEXT_COLOR };\n\n\t/*\n\t * When the parent menu item is active, except when it's a non-focused/hovered\n\t * submenu trigger (in that case, color should not be inherited)\n\t */\n\t[data-active-item]:not( [data-focus-visible] ) *:not(${ PopoverInnerWrapper }) &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] *:not(${ PopoverInnerWrapper }) & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const Group = styled( Ariakit.MenuGroup )`\n\t/* Ignore this element when calculating the layout. Useful for subgrid */\n\tdisplay: contents;\n`;\n\nexport const GroupLabel = styled( Ariakit.MenuGroupLabel )`\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tpadding-block-start: ${ space( 3 ) };\n\tpadding-block-end: ${ space( 2 ) };\n\tpadding-inline: ${ ITEM_PADDING_INLINE };\n`;\n\nexport const Separator = styled( Ariakit.MenuSeparator )<\n\tPick< ContextProps, 'variant' >\n>`\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tborder: none;\n\theight: ${ CONFIG.borderWidth };\n\tbackground-color: ${ ( props ) =>\n\t\tprops.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BORDER_COLOR\n\t\t\t: DIVIDER_COLOR };\n\t/* Align with menu items' content */\n\tmargin-block: ${ space( 2 ) };\n\tmargin-inline: ${ ITEM_PADDING_INLINE };\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent;\n`;\n\nexport const SubmenuChevronIcon = styled( Icon )`\n\twidth: ${ space( 1.5 ) };\n\t${ rtl(\n\t\t{\n\t\t\ttransform: `scaleX(1)`,\n\t\t},\n\t\t{\n\t\t\ttransform: `scaleX(-1)`,\n\t\t}\n\t) };\n`;\n\nexport const ItemLabel = styled( Truncate )`\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tline-height: 20px;\n\tcolor: inherit;\n`;\n\nexport const ItemHelpText = styled( Truncate )`\n\tfont-size: ${ font( 'helpText.fontSize' ) };\n\tline-height: 16px;\n\tcolor: ${ LIGHTER_TEXT_COLOR };\n\toverflow-wrap: anywhere;\n\n\t[data-active-item]:not( [data-focus-visible] )\n\t\t*:not( ${ PopoverInnerWrapper } )\n\t\t&,\n\t[aria-disabled='true'] *:not( ${ PopoverInnerWrapper } ) & {\n\t\tcolor: inherit;\n\t}\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,GAAG,QAAQ,gBAAgB;AAGpC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,MAAM,QAA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A,CAAAC,QAAA,w9cAGpD","ignoreList":[]}
@@ -13,15 +13,15 @@ import { chevronRightSmall } from '@wordpress/icons';
13
13
  * Internal dependencies
14
14
  */
15
15
 
16
- import { MenuContext } from './context';
17
- import { MenuItem } from './item';
16
+ import { Context } from './context';
17
+ import { Item } from './item';
18
18
  import * as Styled from './styles';
19
19
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
20
- export const MenuSubmenuTriggerItem = forwardRef(function MenuSubmenuTriggerItem({
20
+ export const SubmenuTriggerItem = forwardRef(function SubmenuTriggerItem({
21
21
  suffix,
22
22
  ...otherProps
23
23
  }, ref) {
24
- const menuContext = useContext(MenuContext);
24
+ const menuContext = useContext(Context);
25
25
  if (!menuContext?.store.parent) {
26
26
  throw new Error('Menu.SubmenuTriggerItem can only be rendered inside a nested Menu component');
27
27
  }
@@ -29,10 +29,10 @@ export const MenuSubmenuTriggerItem = forwardRef(function MenuSubmenuTriggerItem
29
29
  ref: ref,
30
30
  accessibleWhenDisabled: true,
31
31
  store: menuContext.store,
32
- render: /*#__PURE__*/_jsx(MenuItem, {
32
+ render: /*#__PURE__*/_jsx(Item, {
33
33
  ...otherProps,
34
34
  // The menu item needs to register and be part of the parent menu.
35
- // Without specifying the store explicitly, the `MenuItem` component
35
+ // Without specifying the store explicitly, the `Item` component
36
36
  // would otherwise read the store via context and pick up the one from
37
37
  // the sub-menu `Menu` component.
38
38
  store: menuContext.store.parent,
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","forwardRef","useContext","chevronRightSmall","MenuContext","MenuItem","Styled","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","MenuSubmenuTriggerItem","suffix","otherProps","ref","menuContext","store","parent","Error","MenuButton","accessibleWhenDisabled","render","children","SubmenuChevronIcon","icon","size","preserveAspectRatio"],"sources":["@wordpress/components/src/menu/submenu-trigger-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 { chevronRightSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuItemProps } from './types';\nimport { MenuContext } from './context';\nimport { MenuItem } from './item';\nimport * as Styled from './styles';\n\nexport const MenuSubmenuTriggerItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuItemProps, 'div', false >\n>( function MenuSubmenuTriggerItem( { suffix, ...otherProps }, ref ) {\n\tconst menuContext = useContext( MenuContext );\n\n\tif ( ! menuContext?.store.parent ) {\n\t\tthrow new Error(\n\t\t\t'Menu.SubmenuTriggerItem can only be rendered inside a nested Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Ariakit.MenuButton\n\t\t\tref={ ref }\n\t\t\taccessibleWhenDisabled\n\t\t\tstore={ menuContext.store }\n\t\t\trender={\n\t\t\t\t<MenuItem\n\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\t// The menu item needs to register and be part of the parent menu.\n\t\t\t\t\t// Without specifying the store explicitly, the `MenuItem` component\n\t\t\t\t\t// would otherwise read the store via context and pick up the one from\n\t\t\t\t\t// the sub-menu `Menu` component.\n\t\t\t\t\tstore={ menuContext.store.parent }\n\t\t\t\t\tsuffix={\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t\t<Styled.SubmenuChevronIcon\n\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\tpreserveAspectRatio=\"xMidYMid slice\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t}\n\t\t/>\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,iBAAiB,QAAQ,kBAAkB;;AAEpD;AACA;AACA;;AAGA,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,QAAQ,QAAQ,QAAQ;AACjC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,OAAO,MAAMC,sBAAsB,GAAGZ,UAAU,CAG7C,SAASY,sBAAsBA,CAAE;EAAEC,MAAM;EAAE,GAAGC;AAAW,CAAC,EAAEC,GAAG,EAAG;EACpE,MAAMC,WAAW,GAAGf,UAAU,CAAEE,WAAY,CAAC;EAE7C,IAAK,CAAEa,WAAW,EAAEC,KAAK,CAACC,MAAM,EAAG;IAClC,MAAM,IAAIC,KAAK,CACd,6EACD,CAAC;EACF;EAEA,oBACCZ,IAAA,CAACR,OAAO,CAACqB,UAAU;IAClBL,GAAG,EAAGA,GAAK;IACXM,sBAAsB;IACtBJ,KAAK,EAAGD,WAAW,CAACC,KAAO;IAC3BK,MAAM,eACLf,IAAA,CAACH,QAAQ;MAAA,GACHU,UAAU;MACf;MACA;MACA;MACA;MACAG,KAAK,EAAGD,WAAW,CAACC,KAAK,CAACC,MAAQ;MAClCL,MAAM,eACLF,KAAA,CAAAF,SAAA;QAAAc,QAAA,GACGV,MAAM,eACRN,IAAA,CAACF,MAAM,CAACmB,kBAAkB;UACzB,eAAY,MAAM;UAClBC,IAAI,EAAGvB,iBAAmB;UAC1BwB,IAAI,EAAG,EAAI;UACXC,mBAAmB,EAAC;QAAgB,CACpC,CAAC;MAAA,CACD;IACF,CACD;EACD,CACD,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","forwardRef","useContext","chevronRightSmall","Context","Item","Styled","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SubmenuTriggerItem","suffix","otherProps","ref","menuContext","store","parent","Error","MenuButton","accessibleWhenDisabled","render","children","SubmenuChevronIcon","icon","size","preserveAspectRatio"],"sources":["@wordpress/components/src/menu/submenu-trigger-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 { chevronRightSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { ItemProps } from './types';\nimport { Context } from './context';\nimport { Item } from './item';\nimport * as Styled from './styles';\n\nexport const SubmenuTriggerItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< ItemProps, 'div', false >\n>( function SubmenuTriggerItem( { suffix, ...otherProps }, ref ) {\n\tconst menuContext = useContext( Context );\n\n\tif ( ! menuContext?.store.parent ) {\n\t\tthrow new Error(\n\t\t\t'Menu.SubmenuTriggerItem can only be rendered inside a nested Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Ariakit.MenuButton\n\t\t\tref={ ref }\n\t\t\taccessibleWhenDisabled\n\t\t\tstore={ menuContext.store }\n\t\t\trender={\n\t\t\t\t<Item\n\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\t// The menu item needs to register and be part of the parent menu.\n\t\t\t\t\t// Without specifying the store explicitly, the `Item` component\n\t\t\t\t\t// would otherwise read the store via context and pick up the one from\n\t\t\t\t\t// the sub-menu `Menu` component.\n\t\t\t\t\tstore={ menuContext.store.parent }\n\t\t\t\t\tsuffix={\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t\t<Styled.SubmenuChevronIcon\n\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\tpreserveAspectRatio=\"xMidYMid slice\"\n\t\t\t\t\t\t\t/>\n\t\t\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ACD,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
@@ -12,14 +12,14 @@ import { forwardRef, useContext } from '@wordpress/element';
12
12
  * Internal dependencies
13
13
  */
14
14
 
15
- import { MenuContext } from './context';
15
+ import { Context } from './context';
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
- export const MenuTriggerButton = forwardRef(function MenuTriggerButton({
17
+ export const TriggerButton = forwardRef(function TriggerButton({
18
18
  children,
19
19
  disabled = false,
20
20
  ...props
21
21
  }, ref) {
22
- const menuContext = useContext(MenuContext);
22
+ const menuContext = useContext(Context);
23
23
  if (!menuContext?.store) {
24
24
  throw new Error('Menu.TriggerButton can only be rendered inside a Menu component');
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","forwardRef","useContext","MenuContext","jsx","_jsx","MenuTriggerButton","children","disabled","props","ref","menuContext","store","Error","parent","MenuButton"],"sources":["@wordpress/components/src/menu/trigger-button.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuTriggerButtonProps } from './types';\nimport { MenuContext } from './context';\n\nexport const MenuTriggerButton = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuTriggerButtonProps, 'button', false >\n>( function MenuTriggerButton( { children, disabled = false, ...props }, ref ) {\n\tconst menuContext = useContext( MenuContext );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.TriggerButton can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\tif ( menuContext.store.parent ) {\n\t\tthrow new Error(\n\t\t\t'Menu.TriggerButton should not be rendered inside a nested Menu component. Use Menu.SubmenuTriggerItem instead.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Ariakit.MenuButton\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tdisabled={ disabled }\n\t\t\tstore={ menuContext.store }\n\t\t>\n\t\t\t{ children }\n\t\t</Ariakit.MenuButton>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAGA,SAASC,WAAW,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExC,OAAO,MAAMC,iBAAiB,GAAGL,UAAU,CAGxC,SAASK,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC,QAAQ,GAAG,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,EAAG;EAC9E,MAAMC,WAAW,GAAGT,UAAU,CAAEC,WAAY,CAAC;EAE7C,IAAK,CAAEQ,WAAW,EAAEC,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,iEACD,CAAC;EACF;EAEA,IAAKF,WAAW,CAACC,KAAK,CAACE,MAAM,EAAG;IAC/B,MAAM,IAAID,KAAK,CACd,gHACD,CAAC;EACF;EAEA,oBACCR,IAAA,CAACL,OAAO,CAACe,UAAU;IAClBL,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVD,QAAQ,EAAGA,QAAU;IACrBI,KAAK,EAAGD,WAAW,CAACC,KAAO;IAAAL,QAAA,EAEzBA;EAAQ,CACS,CAAC;AAEvB,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","forwardRef","useContext","Context","jsx","_jsx","TriggerButton","children","disabled","props","ref","menuContext","store","Error","parent","MenuButton"],"sources":["@wordpress/components/src/menu/trigger-button.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { TriggerButtonProps } from './types';\nimport { Context } from './context';\n\nexport const TriggerButton = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< TriggerButtonProps, 'button', false >\n>( function TriggerButton( { children, disabled = false, ...props }, ref ) {\n\tconst menuContext = useContext( Context );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.TriggerButton can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\tif ( menuContext.store.parent ) {\n\t\tthrow new Error(\n\t\t\t'Menu.TriggerButton should not be rendered inside a nested Menu component. Use Menu.SubmenuTriggerItem instead.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Ariakit.MenuButton\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tdisabled={ disabled }\n\t\t\tstore={ menuContext.store }\n\t\t>\n\t\t\t{ children }\n\t\t</Ariakit.MenuButton>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAGA,SAASC,OAAO,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpC,OAAO,MAAMC,aAAa,GAAGL,UAAU,CAGpC,SAASK,aAAaA,CAAE;EAAEC,QAAQ;EAAEC,QAAQ,GAAG,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,EAAG;EAC1E,MAAMC,WAAW,GAAGT,UAAU,CAAEC,OAAQ,CAAC;EAEzC,IAAK,CAAEQ,WAAW,EAAEC,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,iEACD,CAAC;EACF;EAEA,IAAKF,WAAW,CAACC,KAAK,CAACE,MAAM,EAAG;IAC/B,MAAM,IAAID,KAAK,CACd,gHACD,CAAC;EACF;EAEA,oBACCR,IAAA,CAACL,OAAO,CAACe,UAAU;IAClBL,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVD,QAAQ,EAAGA,QAAU;IACrBI,KAAK,EAAGD,WAAW,CAACC,KAAO;IAAAL,QAAA,EAEzBA;EAAQ,CACS,CAAC;AAEvB,CAAE,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/menu/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type * as Ariakit from '@ariakit/react';\n\nexport interface MenuContext {\n\t/**\n\t * The ariakit store shared across all Menu subcomponents.\n\t */\n\tstore: Ariakit.MenuStore;\n\t/**\n\t * The variant used by the underlying menu popover.\n\t */\n\tvariant?: 'toolbar';\n}\n\nexport interface MenuProps {\n\t/**\n\t * The elements, which should include one instance of the `Menu.TriggerButton`\n\t * component and one instance of the `Menu.Popover` component.\n\t */\n\tchildren?: Ariakit.MenuProviderProps[ 'children' ];\n\t/**\n\t * Whether the menu popover and its contents should be visible by default.\n\t *\n\t * Note: this prop will be overridden by the `open` prop if it is\n\t * provided (meaning the component will be used in \"controlled\" mode).\n\t *\n\t * @default false\n\t */\n\tdefaultOpen?: Ariakit.MenuProviderProps[ 'defaultOpen' ];\n\t/**\n\t * Whether the menu popover and its contents should be visible.\n\t * Should be used in conjunction with `onOpenChange` in order to control\n\t * the open state of the menu popover.\n\t *\n\t * Note: this prop will set the component in \"controlled\" mode, and it will\n\t * override the `defaultOpen` prop.\n\t */\n\topen?: Ariakit.MenuProviderProps[ 'open' ];\n\t/**\n\t * A callback that gets called when the `open` state changes.\n\t */\n\tonOpenChange?: Ariakit.MenuProviderProps[ 'setOpen' ];\n\t/**\n\t * The placement of the menu popover.\n\t *\n\t * @default 'bottom-start' for root-level menus, 'right-start' for submenus\n\t */\n\tplacement?: Ariakit.MenuProviderProps[ 'placement' ];\n}\n\nexport interface MenuPopoverProps {\n\t/**\n\t * The contents of the menu popover, which should include instances of the\n\t * `Menu.Item`, `Menu.CheckboxItem`, `Menu.RadioItem`, `Menu.Group`, and\n\t * `Menu.Separator` components.\n\t */\n\tchildren?: Ariakit.MenuProps[ 'children' ];\n\t/**\n\t * The modality of the menu popover. When set to true, interaction with\n\t * outside elements will be disabled and only menu content will be visible to\n\t * screen readers.\n\t *\n\t * Determines whether the menu popover is modal. Modal dialogs have distinct\n\t * states and behaviors:\n\t * - The `portal` and `preventBodyScroll` props are set to `true`. They can\n\t * still be manually set to `false`.\n\t * - When the dialog is open, element tree outside it will be inert.\n\t *\n\t * @default true\n\t */\n\tmodal?: Ariakit.MenuProps[ 'modal' ];\n\t/**\n\t * The distance between the popover and the anchor element.\n\t *\n\t * @default 8 for root-level menus, 16 for nested menus\n\t */\n\tgutter?: Ariakit.MenuProps[ 'gutter' ];\n\t/**\n\t * The skidding of the popover along the anchor element. Can be set to\n\t * negative values to make the popover shift to the opposite side.\n\t *\n\t * @default 0 for root-level menus, -8 for nested menus\n\t */\n\tshift?: Ariakit.MenuProps[ 'shift' ];\n\t/**\n\t * Determines if the menu popover will hide when the user presses the\n\t * Escape key.\n\t *\n\t * This prop can be either a boolean or a function that accepts an event as an\n\t * argument and returns a boolean. The event object represents the keydown\n\t * event that initiated the hide action, which could be either a native\n\t * keyboard event or a React synthetic event.\n\t *\n\t * @default `( event ) => { event.preventDefault(); return true; }`\n\t */\n\thideOnEscape?: Ariakit.MenuProps[ 'hideOnEscape' ];\n}\n\nexport interface MenuTriggerButtonProps {\n\t/**\n\t * The contents of the menu trigger button.\n\t */\n\tchildren?: Ariakit.MenuButtonProps[ 'children' ];\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.MenuButtonProps[ 'render' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * This feature can be combined with the `accessibleWhenDisabled` prop to\n\t * make disabled elements still accessible via keyboard.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.MenuButtonProps[ 'disabled' ];\n\t/**\n\t * Indicates whether the element should be focusable even when it is\n\t * `disabled`.\n\t *\n\t * This is important when discoverability is a concern. For example:\n\t *\n\t * > A toolbar in an editor contains a set of special smart paste functions\n\t * that are disabled when the clipboard is empty or when the function is not\n\t * applicable to the current content of the clipboard. It could be helpful to\n\t * keep the disabled buttons focusable if the ability to discover their\n\t * functionality is primarily via their presence on the toolbar.\n\t *\n\t * Learn more on [Focusability of disabled\n\t * controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols).\n\t */\n\taccessibleWhenDisabled?: Ariakit.MenuButtonProps[ 'accessibleWhenDisabled' ];\n}\n\nexport interface MenuGroupProps {\n\t/**\n\t * The contents of the menu group, which should include one instance of the\n\t * `Menu.GroupLabel` component and one or more instances of `Menu.Item`,\n\t * `Menu.CheckboxItem`, and `Menu.RadioItem`.\n\t */\n\tchildren: Ariakit.MenuGroupProps[ 'children' ];\n}\n\nexport interface MenuGroupLabelProps {\n\t/**\n\t * The contents of the menu group label, which should provide an accessible\n\t * label for the menu group.\n\t */\n\tchildren: Ariakit.MenuGroupLabelProps[ 'children' ];\n}\n\nexport interface MenuItemProps {\n\t/**\n\t * The contents of the menu item, which could include one instance of the\n\t * `Menu.ItemLabel` component and/or one instance of the `Menu.ItemHelpText`\n\t * component.\n\t */\n\tchildren: Ariakit.MenuItemProps[ 'children' ];\n\t/**\n\t * The contents of the menu item's prefix, such as an icon.\n\t */\n\tprefix?: React.ReactNode;\n\t/**\n\t * The contents of the menu item's suffix, such as a keyboard shortcut.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Determines if the menu should hide when this item is clicked.\n\t *\n\t * **Note**: This behavior isn't triggered if this menu item is rendered as a\n\t * link and modifier keys are used to either open the link in a new tab or\n\t * download it.\n\t *\n\t * @default true\n\t */\n\thideOnClick?: Ariakit.MenuItemProps[ 'hideOnClick' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.MenuItemProps[ 'disabled' ];\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.MenuItemProps[ 'render' ];\n\t/**\n\t * The ariakit menu store. This prop is only meant for internal use.\n\t * @ignore\n\t */\n\tstore?: Ariakit.MenuItemProps[ 'store' ];\n}\n\nexport interface MenuCheckboxItemProps {\n\t/**\n\t * The contents of the menu item, which could include one instance of the\n\t * `Menu.ItemLabel` component and/or one instance of the `Menu.ItemHelpText`\n\t * component.\n\t */\n\tchildren: Ariakit.MenuItemCheckboxProps[ 'children' ];\n\t/**\n\t * The contents of the menu item's suffix, such as a keyboard shortcut.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Determines if the menu should hide when this item is clicked.\n\t *\n\t * **Note**: This behavior isn't triggered if this menu item is rendered as a\n\t * link and modifier keys are used to either open the link in a new tab or\n\t * download it.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: Ariakit.MenuItemCheckboxProps[ 'hideOnClick' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.MenuItemCheckboxProps[ 'disabled' ];\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.MenuItemCheckboxProps[ 'render' ];\n\t/**\n\t * The checkbox menu item's name.\n\t */\n\tname: Ariakit.MenuItemCheckboxProps[ 'name' ];\n\t/**\n\t * The checkbox item's value, useful when using multiple checkbox menu items\n\t * associated to the same `name`.\n\t */\n\tvalue?: Ariakit.MenuItemCheckboxProps[ 'value' ];\n\t/**\n\t * The controlled checked state of the checkbox menu item.\n\t *\n\t * Note: this prop will override the `defaultChecked` prop.\n\t */\n\tchecked?: Ariakit.MenuItemCheckboxProps[ 'checked' ];\n\t/**\n\t * The checked state of the checkbox menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t *\n\t * Note: this prop will be overriden by the `checked` prop, if it is defined.\n\t */\n\tdefaultChecked?: Ariakit.MenuItemCheckboxProps[ 'defaultChecked' ];\n\t/**\n\t * A function that is called when the checkbox's checked state changes.\n\t */\n\tonChange?: Ariakit.MenuItemCheckboxProps[ 'onChange' ];\n}\n\nexport interface MenuRadioItemProps {\n\t/**\n\t * The contents of the menu item, which could include one instance of the\n\t * `Menu.ItemLabel` component and/or one instance of the `Menu.ItemHelpText`\n\t * component.\n\t */\n\tchildren: Ariakit.MenuItemRadioProps[ 'children' ];\n\t/**\n\t * The contents of the menu item's suffix, such as a keyboard shortcut.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Determines if the menu should hide when this item is clicked.\n\t *\n\t * **Note**: This behavior isn't triggered if this menu item is rendered as a\n\t * link and modifier keys are used to either open the link in a new tab or\n\t * download it.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: Ariakit.MenuItemRadioProps[ 'hideOnClick' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.MenuItemRadioProps[ 'disabled' ];\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.MenuItemRadioProps[ 'render' ];\n\t/**\n\t * The radio item's name.\n\t */\n\tname: Ariakit.MenuItemRadioProps[ 'name' ];\n\t/**\n\t * The radio item's value.\n\t */\n\tvalue: Ariakit.MenuItemRadioProps[ 'value' ];\n\t/**\n\t * The controlled checked state of the radio menu item.\n\t *\n\t * Note: this prop will override the `defaultChecked` prop.\n\t */\n\tchecked?: Ariakit.MenuItemRadioProps[ 'checked' ];\n\t/**\n\t * The checked state of the radio menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t *\n\t * Note: this prop will be overriden by the `checked` prop, if it is defined.\n\t */\n\tdefaultChecked?: Ariakit.MenuItemRadioProps[ 'defaultChecked' ];\n\t/**\n\t * A function that is called when the checkbox's checked state changes.\n\t */\n\tonChange?: Ariakit.MenuItemRadioProps[ 'onChange' ];\n}\n\nexport interface MenuSeparatorProps {}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/menu/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type * as Ariakit from '@ariakit/react';\n\nexport interface ContextProps {\n\t/**\n\t * The ariakit store shared across all Menu subcomponents.\n\t */\n\tstore: Ariakit.MenuStore;\n\t/**\n\t * The variant used by the underlying menu popover.\n\t */\n\tvariant?: 'toolbar';\n}\n\nexport interface Props {\n\t/**\n\t * The elements, which should include one instance of the `Menu.TriggerButton`\n\t * component and one instance of the `Menu.Popover` component.\n\t */\n\tchildren?: Ariakit.MenuProviderProps[ 'children' ];\n\t/**\n\t * Whether the menu popover and its contents should be visible by default.\n\t *\n\t * Note: this prop will be overridden by the `open` prop if it is\n\t * provided (meaning the component will be used in \"controlled\" mode).\n\t *\n\t * @default false\n\t */\n\tdefaultOpen?: Ariakit.MenuProviderProps[ 'defaultOpen' ];\n\t/**\n\t * Whether the menu popover and its contents should be visible.\n\t * Should be used in conjunction with `onOpenChange` in order to control\n\t * the open state of the menu popover.\n\t *\n\t * Note: this prop will set the component in \"controlled\" mode, and it will\n\t * override the `defaultOpen` prop.\n\t */\n\topen?: Ariakit.MenuProviderProps[ 'open' ];\n\t/**\n\t * A callback that gets called when the `open` state changes.\n\t */\n\tonOpenChange?: Ariakit.MenuProviderProps[ 'setOpen' ];\n\t/**\n\t * The placement of the menu popover.\n\t *\n\t * @default 'bottom-start' for root-level menus, 'right-start' for submenus\n\t */\n\tplacement?: Ariakit.MenuProviderProps[ 'placement' ];\n}\n\nexport interface PopoverProps {\n\t/**\n\t * The contents of the menu popover, which should include instances of the\n\t * `Menu.Item`, `Menu.CheckboxItem`, `Menu.RadioItem`, `Menu.Group`, and\n\t * `Menu.Separator` components.\n\t */\n\tchildren?: Ariakit.MenuProps[ 'children' ];\n\t/**\n\t * The modality of the menu popover. When set to true, interaction with\n\t * outside elements will be disabled and only menu content will be visible to\n\t * screen readers.\n\t *\n\t * Determines whether the menu popover is modal. Modal dialogs have distinct\n\t * states and behaviors:\n\t * - The `portal` and `preventBodyScroll` props are set to `true`. They can\n\t * still be manually set to `false`.\n\t * - When the dialog is open, element tree outside it will be inert.\n\t *\n\t * @default true\n\t */\n\tmodal?: Ariakit.MenuProps[ 'modal' ];\n\t/**\n\t * The distance between the popover and the anchor element.\n\t *\n\t * @default 8 for root-level menus, 16 for nested menus\n\t */\n\tgutter?: Ariakit.MenuProps[ 'gutter' ];\n\t/**\n\t * The skidding of the popover along the anchor element. Can be set to\n\t * negative values to make the popover shift to the opposite side.\n\t *\n\t * @default 0 for root-level menus, -8 for nested menus\n\t */\n\tshift?: Ariakit.MenuProps[ 'shift' ];\n\t/**\n\t * Determines if the menu popover will hide when the user presses the\n\t * Escape key.\n\t *\n\t * This prop can be either a boolean or a function that accepts an event as an\n\t * argument and returns a boolean. The event object represents the keydown\n\t * event that initiated the hide action, which could be either a native\n\t * keyboard event or a React synthetic event.\n\t *\n\t * @default `( event ) => { event.preventDefault(); return true; }`\n\t */\n\thideOnEscape?: Ariakit.MenuProps[ 'hideOnEscape' ];\n}\n\nexport interface TriggerButtonProps {\n\t/**\n\t * The contents of the menu trigger button.\n\t */\n\tchildren?: Ariakit.MenuButtonProps[ 'children' ];\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.MenuButtonProps[ 'render' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * This feature can be combined with the `accessibleWhenDisabled` prop to\n\t * make disabled elements still accessible via keyboard.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.MenuButtonProps[ 'disabled' ];\n\t/**\n\t * Indicates whether the element should be focusable even when it is\n\t * `disabled`.\n\t *\n\t * This is important when discoverability is a concern. For example:\n\t *\n\t * > A toolbar in an editor contains a set of special smart paste functions\n\t * that are disabled when the clipboard is empty or when the function is not\n\t * applicable to the current content of the clipboard. It could be helpful to\n\t * keep the disabled buttons focusable if the ability to discover their\n\t * functionality is primarily via their presence on the toolbar.\n\t *\n\t * Learn more on [Focusability of disabled\n\t * controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols).\n\t */\n\taccessibleWhenDisabled?: Ariakit.MenuButtonProps[ 'accessibleWhenDisabled' ];\n}\n\nexport interface GroupProps {\n\t/**\n\t * The contents of the menu group, which should include one instance of the\n\t * `Menu.GroupLabel` component and one or more instances of `Menu.Item`,\n\t * `Menu.CheckboxItem`, and `Menu.RadioItem`.\n\t */\n\tchildren: Ariakit.MenuGroupProps[ 'children' ];\n}\n\nexport interface GroupLabelProps {\n\t/**\n\t * The contents of the menu group label, which should provide an accessible\n\t * label for the menu group.\n\t */\n\tchildren: Ariakit.MenuGroupLabelProps[ 'children' ];\n}\n\nexport interface ItemProps {\n\t/**\n\t * The contents of the menu item, which could include one instance of the\n\t * `Menu.ItemLabel` component and/or one instance of the `Menu.ItemHelpText`\n\t * component.\n\t */\n\tchildren: Ariakit.MenuItemProps[ 'children' ];\n\t/**\n\t * The contents of the menu item's prefix, such as an icon.\n\t */\n\tprefix?: React.ReactNode;\n\t/**\n\t * The contents of the menu item's suffix, such as a keyboard shortcut.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Determines if the menu should hide when this item is clicked.\n\t *\n\t * **Note**: This behavior isn't triggered if this menu item is rendered as a\n\t * link and modifier keys are used to either open the link in a new tab or\n\t * download it.\n\t *\n\t * @default true\n\t */\n\thideOnClick?: Ariakit.MenuItemProps[ 'hideOnClick' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.MenuItemProps[ 'disabled' ];\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.MenuItemProps[ 'render' ];\n\t/**\n\t * The ariakit menu store. This prop is only meant for internal use.\n\t * @ignore\n\t */\n\tstore?: Ariakit.MenuItemProps[ 'store' ];\n}\n\nexport interface CheckboxItemProps {\n\t/**\n\t * The contents of the menu item, which could include one instance of the\n\t * `Menu.ItemLabel` component and/or one instance of the `Menu.ItemHelpText`\n\t * component.\n\t */\n\tchildren: Ariakit.MenuItemCheckboxProps[ 'children' ];\n\t/**\n\t * The contents of the menu item's suffix, such as a keyboard shortcut.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Determines if the menu should hide when this item is clicked.\n\t *\n\t * **Note**: This behavior isn't triggered if this menu item is rendered as a\n\t * link and modifier keys are used to either open the link in a new tab or\n\t * download it.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: Ariakit.MenuItemCheckboxProps[ 'hideOnClick' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.MenuItemCheckboxProps[ 'disabled' ];\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.MenuItemCheckboxProps[ 'render' ];\n\t/**\n\t * The checkbox menu item's name.\n\t */\n\tname: Ariakit.MenuItemCheckboxProps[ 'name' ];\n\t/**\n\t * The checkbox item's value, useful when using multiple checkbox menu items\n\t * associated to the same `name`.\n\t */\n\tvalue?: Ariakit.MenuItemCheckboxProps[ 'value' ];\n\t/**\n\t * The controlled checked state of the checkbox menu item.\n\t *\n\t * Note: this prop will override the `defaultChecked` prop.\n\t */\n\tchecked?: Ariakit.MenuItemCheckboxProps[ 'checked' ];\n\t/**\n\t * The checked state of the checkbox menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t *\n\t * Note: this prop will be overriden by the `checked` prop, if it is defined.\n\t */\n\tdefaultChecked?: Ariakit.MenuItemCheckboxProps[ 'defaultChecked' ];\n\t/**\n\t * A function that is called when the checkbox's checked state changes.\n\t */\n\tonChange?: Ariakit.MenuItemCheckboxProps[ 'onChange' ];\n}\n\nexport interface RadioItemProps {\n\t/**\n\t * The contents of the menu item, which could include one instance of the\n\t * `Menu.ItemLabel` component and/or one instance of the `Menu.ItemHelpText`\n\t * component.\n\t */\n\tchildren: Ariakit.MenuItemRadioProps[ 'children' ];\n\t/**\n\t * The contents of the menu item's suffix, such as a keyboard shortcut.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Determines if the menu should hide when this item is clicked.\n\t *\n\t * **Note**: This behavior isn't triggered if this menu item is rendered as a\n\t * link and modifier keys are used to either open the link in a new tab or\n\t * download it.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: Ariakit.MenuItemRadioProps[ 'hideOnClick' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.MenuItemRadioProps[ 'disabled' ];\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.MenuItemRadioProps[ 'render' ];\n\t/**\n\t * The radio item's name.\n\t */\n\tname: Ariakit.MenuItemRadioProps[ 'name' ];\n\t/**\n\t * The radio item's value.\n\t */\n\tvalue: Ariakit.MenuItemRadioProps[ 'value' ];\n\t/**\n\t * The controlled checked state of the radio menu item.\n\t *\n\t * Note: this prop will override the `defaultChecked` prop.\n\t */\n\tchecked?: Ariakit.MenuItemRadioProps[ 'checked' ];\n\t/**\n\t * The checked state of the radio menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t *\n\t * Note: this prop will be overriden by the `checked` prop, if it is defined.\n\t */\n\tdefaultChecked?: Ariakit.MenuItemRadioProps[ 'defaultChecked' ];\n\t/**\n\t * A function that is called when the checkbox's checked state changes.\n\t */\n\tonChange?: Ariakit.MenuItemRadioProps[ 'onChange' ];\n}\n\nexport interface SeparatorProps {}\n"],"mappings":"","ignoreList":[]}
@@ -8,7 +8,7 @@ import { View, TouchableWithoutFeedback } from 'react-native';
8
8
  */
9
9
  import styles from './styles.scss';
10
10
 
11
- // Action button component is used by both Back and Apply Button componenets.
11
+ // Action button component is used by both Back and Apply Button components.
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  function ActionButton({
14
14
  onPress,
@@ -1 +1 @@
1
- {"version":3,"names":["View","TouchableWithoutFeedback","styles","jsx","_jsx","ActionButton","onPress","accessibilityLabel","accessibilityHint","children","accessibilityRole","style"],"sources":["@wordpress/components/src/mobile/bottom-sheet/nav-bar/action-button.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, TouchableWithoutFeedback } from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\n// Action button component is used by both Back and Apply Button componenets.\nfunction ActionButton( {\n\tonPress,\n\taccessibilityLabel,\n\taccessibilityHint,\n\tchildren,\n} ) {\n\treturn (\n\t\t<TouchableWithoutFeedback\n\t\t\tonPress={ onPress }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\taccessibilityHint={ accessibilityHint }\n\t\t>\n\t\t\t<View style={ styles[ 'action-button' ] }>{ children }</View>\n\t\t</TouchableWithoutFeedback>\n\t);\n}\n\nexport default ActionButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,wBAAwB,QAAQ,cAAc;;AAE7D;AACA;AACA;AACA,OAAOC,MAAM,MAAM,eAAe;;AAElC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AACA,SAASC,YAAYA,CAAE;EACtBC,OAAO;EACPC,kBAAkB;EAClBC,iBAAiB;EACjBC;AACD,CAAC,EAAG;EACH,oBACCL,IAAA,CAACH,wBAAwB;IACxBK,OAAO,EAAGA,OAAS;IACnBI,iBAAiB,EAAC,QAAQ;IAC1BH,kBAAkB,EAAGA,kBAAoB;IACzCC,iBAAiB,EAAGA,iBAAmB;IAAAC,QAAA,eAEvCL,IAAA,CAACJ,IAAI;MAACW,KAAK,EAAGT,MAAM,CAAE,eAAe,CAAI;MAAAO,QAAA,EAAGA;IAAQ,CAAQ;EAAC,CACpC,CAAC;AAE7B;AAEA,eAAeJ,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["View","TouchableWithoutFeedback","styles","jsx","_jsx","ActionButton","onPress","accessibilityLabel","accessibilityHint","children","accessibilityRole","style"],"sources":["@wordpress/components/src/mobile/bottom-sheet/nav-bar/action-button.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, TouchableWithoutFeedback } from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\n// Action button component is used by both Back and Apply Button components.\nfunction ActionButton( {\n\tonPress,\n\taccessibilityLabel,\n\taccessibilityHint,\n\tchildren,\n} ) {\n\treturn (\n\t\t<TouchableWithoutFeedback\n\t\t\tonPress={ onPress }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\taccessibilityHint={ accessibilityHint }\n\t\t>\n\t\t\t<View style={ styles[ 'action-button' ] }>{ children }</View>\n\t\t</TouchableWithoutFeedback>\n\t);\n}\n\nexport default ActionButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,wBAAwB,QAAQ,cAAc;;AAE7D;AACA;AACA;AACA,OAAOC,MAAM,MAAM,eAAe;;AAElC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AACA,SAASC,YAAYA,CAAE;EACtBC,OAAO;EACPC,kBAAkB;EAClBC,iBAAiB;EACjBC;AACD,CAAC,EAAG;EACH,oBACCL,IAAA,CAACH,wBAAwB;IACxBK,OAAO,EAAGA,OAAS;IACnBI,iBAAiB,EAAC,QAAQ;IAC1BH,kBAAkB,EAAGA,kBAAoB;IACzCC,iBAAiB,EAAGA,iBAAmB;IAAAC,QAAA,eAEvCL,IAAA,CAACJ,IAAI;MAACW,KAAK,EAAGT,MAAM,CAAE,eAAe,CAAI;MAAAO,QAAA,EAAGA;IAAQ,CAAQ;EAAC,CACpC,CAAC;AAE7B;AAEA,eAAeJ,YAAY","ignoreList":[]}
@@ -70,7 +70,7 @@ function getFunctionUnitValue(functionUnitValue, options) {
70
70
  * Take a css function such as min, max, calc, clamp and returns parsedUnit
71
71
  *
72
72
  * How this works for the nested function is that it first replaces the inner function call.
73
- * Then it tackles the outer onces.
73
+ * Then it tackles the outer ones.
74
74
  * So for example: min( max(25px, 35px), 40px )
75
75
  * in the first pass we would replace max(25px, 35px) with 35px.
76
76
  * then we would try to evaluate min( 35px, 40px )
@@ -99,7 +99,7 @@ function parseUnitFunction(cssUnit) {
99
99
  /**
100
100
  * Return true if we think this is a math expression.
101
101
  *
102
- * @param {string} cssUnit the cssUnit value being evaluted.
102
+ * @param {string} cssUnit the cssUnit value being evaluated.
103
103
  * @return {boolean} Whether the cssUnit is a math expression.
104
104
  */
105
105
  function isMathExpression(cssUnit) {
@@ -113,7 +113,7 @@ function isMathExpression(cssUnit) {
113
113
  /**
114
114
  * Evaluates the math expression and return a px value.
115
115
  *
116
- * @param {string} cssUnit the cssUnit value being evaluted.
116
+ * @param {string} cssUnit the cssUnit value being evaluated.
117
117
  * @return {string} return a converfted value to px.
118
118
  */
119
119
  function evalMathExpression(cssUnit) {
@@ -1 +1 @@
1
- {"version":3,"names":["parseUnit","cssUnit","match","trim","isNaN","parseFloat","value","unit","undefined","calculate","expression","Function","err","getFunctionUnitValue","functionUnitValue","options","functionUnit","split","filter","Boolean","units","slice","map","getPxFromCssUnit","Math","min","max","length","parseUnitFunction","currentCssUnit","regExp","matches","exec","replace","isMathExpression","i","includes","evalMathExpression","errorFound","cssUnitsBits","parsedUnit","expressionsMatches","values","currentValue","rawCurrentValue","calculatedExpression","calculatedValue","toFixed","parsedValue","calculatedResult","convertParsedUnitToPx","PIXELS_PER_INCH","ONE_PERCENT","defaultProperties","fontSize","lineHeight","width","height","type","setOptions","Object","assign","relativeUnits","em","rem","vh","vw","vmin","vmax","ch","ex","lh","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","svmin","lvmin","dvmin","svmax","lvmax","dvmax","absoluteUnits","in","cm","mm","pt","pc","px","Q","Number","isFinite","cache","memoizedGetPxFromCssUnit","hash","hashOptions","hasOwnProperty"],"sources":["@wordpress/components/src/mobile/utils/get-px-from-css-unit.native.js"],"sourcesContent":["/**\n * Converts string to object { value, unit }.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit\n */\nfunction parseUnit( cssUnit ) {\n\tconst match = cssUnit\n\t\t?.trim()\n\t\t.match(\n\t\t\t/^(0?[-.]?\\d*\\.?\\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/\n\t\t);\n\tif ( ! isNaN( cssUnit ) && ! isNaN( parseFloat( cssUnit ) ) ) {\n\t\treturn { value: parseFloat( cssUnit ), unit: 'px' };\n\t}\n\treturn match\n\t\t? { value: parseFloat( match[ 1 ] ) || match[ 1 ], unit: match[ 2 ] }\n\t\t: { value: cssUnit, unit: undefined };\n}\n/**\n * Evaluate a math expression.\n *\n * @param {string} expression\n * @return {number} evaluated expression.\n */\nfunction calculate( expression ) {\n\ttry {\n\t\treturn Function( `'use strict'; return (${ expression })` )();\n\t} catch ( err ) {\n\t\treturn null;\n\t}\n}\n\n/**\n * Calculates the css function value for the supported css functions such as max, min, clamp and calc.\n *\n * @param {string} functionUnitValue string should be in a particular format (for example min(12px,12px) ) no nested loops.\n * @param {Object} options\n * @return {string} unit containing the unit in PX.\n */\nfunction getFunctionUnitValue( functionUnitValue, options ) {\n\tconst functionUnit = functionUnitValue.split( /[(),]/g ).filter( Boolean );\n\n\tconst units = functionUnit\n\t\t.slice( 1 )\n\t\t.map( ( unit ) => parseUnit( getPxFromCssUnit( unit, options ) ).value )\n\t\t.filter( Boolean );\n\n\tswitch ( functionUnit[ 0 ] ) {\n\t\tcase 'min':\n\t\t\treturn Math.min( ...units ) + 'px';\n\t\tcase 'max':\n\t\t\treturn Math.max( ...units ) + 'px';\n\t\tcase 'clamp':\n\t\t\tif ( units.length !== 3 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif ( units[ 1 ] < units[ 0 ] ) {\n\t\t\t\treturn units[ 0 ] + 'px';\n\t\t\t}\n\t\t\tif ( units[ 1 ] > units[ 2 ] ) {\n\t\t\t\treturn units[ 2 ] + 'px';\n\t\t\t}\n\t\t\treturn units[ 1 ] + 'px';\n\t\tcase 'calc':\n\t\t\treturn units[ 0 ] + 'px';\n\t}\n}\n\n/**\n * Take a css function such as min, max, calc, clamp and returns parsedUnit\n *\n * How this works for the nested function is that it first replaces the inner function call.\n * Then it tackles the outer onces.\n * So for example: min( max(25px, 35px), 40px )\n * in the first pass we would replace max(25px, 35px) with 35px.\n * then we would try to evaluate min( 35px, 40px )\n * and then finally return 35px.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit object.\n */\nfunction parseUnitFunction( cssUnit ) {\n\twhile ( true ) {\n\t\tconst currentCssUnit = cssUnit;\n\t\tconst regExp = /(max|min|calc|clamp)\\(([^()]*)\\)/g;\n\t\tconst matches = regExp.exec( cssUnit ) || [];\n\t\tif ( matches[ 0 ] ) {\n\t\t\tconst functionUnitValue = getFunctionUnitValue( matches[ 0 ] );\n\t\t\tcssUnit = cssUnit.replace( matches[ 0 ], functionUnitValue );\n\t\t}\n\n\t\t// If the unit hasn't been modified or we have a single value break free.\n\t\tif ( cssUnit === currentCssUnit || parseFloat( cssUnit ) ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn parseUnit( cssUnit );\n}\n/**\n * Return true if we think this is a math expression.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {boolean} Whether the cssUnit is a math expression.\n */\nfunction isMathExpression( cssUnit ) {\n\tfor ( let i = 0; i < cssUnit.length; i++ ) {\n\t\tif ( [ '+', '-', '/', '*' ].includes( cssUnit[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n/**\n * Evaluates the math expression and return a px value.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {string} return a converfted value to px.\n */\nfunction evalMathExpression( cssUnit ) {\n\tlet errorFound = false;\n\t// Convert every part of the expression to px values.\n\t// The following regex matches numbers that have a following unit\n\t// E.g. 5.25rem, 1vw\n\tconst cssUnitsBits = cssUnit.match( /\\d+\\.?\\d*[a-zA-Z]+|\\.\\d+[a-zA-Z]+/g );\n\tif ( cssUnitsBits ) {\n\t\tfor ( const unit of cssUnitsBits ) {\n\t\t\t// Standardize the unit to px and extract the value.\n\t\t\tconst parsedUnit = parseUnit( getPxFromCssUnit( unit ) );\n\t\t\tif ( ! parseFloat( parsedUnit.value ) ) {\n\t\t\t\terrorFound = true;\n\t\t\t\t// End early since we are dealing with a null value.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcssUnit = cssUnit.replace( unit, parsedUnit.value );\n\t\t}\n\t} else {\n\t\terrorFound = true;\n\t}\n\n\t// For mixed math expressions wrapped within CSS expressions\n\tconst expressionsMatches = cssUnit.match( /(max|min|clamp)/g );\n\tif ( ! errorFound && expressionsMatches ) {\n\t\tconst values = cssUnit.split( ',' );\n\t\tfor ( const currentValue of values ) {\n\t\t\t// Check for nested calc() and remove them to calculate the value.\n\t\t\tconst rawCurrentValue = currentValue.replace( /\\s|calc/g, '' );\n\n\t\t\tif ( isMathExpression( rawCurrentValue ) ) {\n\t\t\t\tconst calculatedExpression = calculate( rawCurrentValue );\n\n\t\t\t\tif ( calculatedExpression ) {\n\t\t\t\t\tconst calculatedValue =\n\t\t\t\t\t\tcalculatedExpression.toFixed( 0 ) + 'px';\n\t\t\t\t\tcssUnit = cssUnit.replace( currentValue, calculatedValue );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst parsedValue = parseUnitFunction( cssUnit );\n\t\treturn ! parsedValue ? null : parsedValue.value + parsedValue.unit;\n\t}\n\n\tif ( errorFound ) {\n\t\treturn null;\n\t}\n\n\tconst calculatedResult = calculate( cssUnit );\n\treturn calculatedResult ? calculatedResult.toFixed( 0 ) + 'px' : null;\n}\n\n/**\n * Convert a parsedUnit object to px value.\n *\n * @param {Object} parsedUnit\n * @param {Object} options\n * @return {string} or {null} returns the converted with in a px value format.\n */\nfunction convertParsedUnitToPx( parsedUnit, options ) {\n\tconst PIXELS_PER_INCH = 96;\n\tconst ONE_PERCENT = 0.01;\n\n\tconst defaultProperties = {\n\t\tfontSize: 16,\n\t\tlineHeight: 16,\n\t\twidth: 375,\n\t\theight: 812,\n\t\ttype: 'font',\n\t};\n\n\tconst setOptions = Object.assign( {}, defaultProperties, options );\n\n\tconst relativeUnits = {\n\t\tem: setOptions.fontSize,\n\t\trem: setOptions.fontSize,\n\t\tvh: setOptions.height * ONE_PERCENT,\n\t\tvw: setOptions.width * ONE_PERCENT,\n\t\tvmin:\n\t\t\t( setOptions.width < setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\tvmax:\n\t\t\t( setOptions.width > setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\t'%':\n\t\t\t( setOptions.type === 'font'\n\t\t\t\t? setOptions.fontSize\n\t\t\t\t: setOptions.width ) * ONE_PERCENT,\n\t\tch: 8, // The advance measure (width) of the glyph \"0\" of the element's font. Approximate\n\t\tex: 7.15625, // X-height of the element's font. Approximate.\n\t\tlh: setOptions.lineHeight,\n\t};\n\trelativeUnits.svw = relativeUnits.vmin;\n\trelativeUnits.lvw = relativeUnits.vmax;\n\trelativeUnits.dvw = relativeUnits.vw;\n\trelativeUnits.svh = relativeUnits.vmin;\n\trelativeUnits.lvh = relativeUnits.vmax;\n\trelativeUnits.dvh = relativeUnits.vh;\n\trelativeUnits.vi = relativeUnits.vh;\n\trelativeUnits.svi = relativeUnits.vmin;\n\trelativeUnits.lvi = relativeUnits.vmax;\n\trelativeUnits.dvi = relativeUnits.vw;\n\trelativeUnits.vb = relativeUnits.vh;\n\trelativeUnits.svb = relativeUnits.vmin;\n\trelativeUnits.lvb = relativeUnits.vmax;\n\trelativeUnits.dvb = relativeUnits.vh;\n\trelativeUnits.svmin = relativeUnits.vmin;\n\trelativeUnits.lvmin = relativeUnits.vmin;\n\trelativeUnits.dvmin = relativeUnits.vmin;\n\trelativeUnits.svmax = relativeUnits.vmax;\n\trelativeUnits.lvmax = relativeUnits.vmax;\n\trelativeUnits.dvmax = relativeUnits.vmax;\n\n\tconst absoluteUnits = {\n\t\tin: PIXELS_PER_INCH,\n\t\tcm: PIXELS_PER_INCH / 2.54,\n\t\tmm: PIXELS_PER_INCH / 25.4,\n\t\tpt: PIXELS_PER_INCH / 72,\n\t\tpc: PIXELS_PER_INCH / 6,\n\t\tpx: 1,\n\t\tQ: PIXELS_PER_INCH / 2.54 / 40,\n\t};\n\n\tif ( relativeUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( relativeUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\tif ( absoluteUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( absoluteUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\treturn null;\n}\n\n/**\n * Returns the px value of a cssUnit.\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nexport function getPxFromCssUnit( cssUnit, options = {} ) {\n\tif ( Number.isFinite( cssUnit ) ) {\n\t\treturn cssUnit.toFixed( 0 ) + 'px';\n\t}\n\tif ( cssUnit === undefined ) {\n\t\treturn null;\n\t}\n\tlet parsedUnit = parseUnit( cssUnit );\n\n\tif ( ! parsedUnit.unit ) {\n\t\tparsedUnit = parseUnitFunction( cssUnit );\n\t}\n\n\tif ( isMathExpression( cssUnit ) && ! parsedUnit.unit ) {\n\t\treturn evalMathExpression( cssUnit );\n\t}\n\n\treturn convertParsedUnitToPx( parsedUnit, options );\n}\n\n// Use simple cache.\nconst cache = {};\n/**\n * Returns the px value of a cssUnit. The memoized version of getPxFromCssUnit;\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nfunction memoizedGetPxFromCssUnit( cssUnit, options = {} ) {\n\tconst hash = cssUnit + hashOptions( options );\n\n\tif ( ! cache[ hash ] ) {\n\t\tcache[ hash ] = getPxFromCssUnit( cssUnit, options );\n\t}\n\treturn cache[ hash ];\n}\n\nfunction hashOptions( options ) {\n\tlet hash = '';\n\tif ( options.hasOwnProperty( 'fontSize' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'lineHeight' ) ) {\n\t\thash = ':' + options.lineHeight;\n\t}\n\tif ( options.hasOwnProperty( 'width' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'height' ) ) {\n\t\thash = ':' + options.height;\n\t}\n\tif ( options.hasOwnProperty( 'type' ) ) {\n\t\thash = ':' + options.type;\n\t}\n\treturn hash;\n}\n\nexport default memoizedGetPxFromCssUnit;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAASA,CAAEC,OAAO,EAAG;EAC7B,MAAMC,KAAK,GAAGD,OAAO,EAClBE,IAAI,CAAC,CAAC,CACPD,KAAK,CACL,6EACD,CAAC;EACF,IAAK,CAAEE,KAAK,CAAEH,OAAQ,CAAC,IAAI,CAAEG,KAAK,CAAEC,UAAU,CAAEJ,OAAQ,CAAE,CAAC,EAAG;IAC7D,OAAO;MAAEK,KAAK,EAAED,UAAU,CAAEJ,OAAQ,CAAC;MAAEM,IAAI,EAAE;IAAK,CAAC;EACpD;EACA,OAAOL,KAAK,GACT;IAAEI,KAAK,EAAED,UAAU,CAAEH,KAAK,CAAE,CAAC,CAAG,CAAC,IAAIA,KAAK,CAAE,CAAC,CAAE;IAAEK,IAAI,EAAEL,KAAK,CAAE,CAAC;EAAG,CAAC,GACnE;IAAEI,KAAK,EAAEL,OAAO;IAAEM,IAAI,EAAEC;EAAU,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAASA,CAAEC,UAAU,EAAG;EAChC,IAAI;IACH,OAAOC,QAAQ,CAAE,yBAA0BD,UAAU,GAAK,CAAC,CAAC,CAAC;EAC9D,CAAC,CAAC,OAAQE,GAAG,EAAG;IACf,OAAO,IAAI;EACZ;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,oBAAoBA,CAAEC,iBAAiB,EAAEC,OAAO,EAAG;EAC3D,MAAMC,YAAY,GAAGF,iBAAiB,CAACG,KAAK,CAAE,QAAS,CAAC,CAACC,MAAM,CAAEC,OAAQ,CAAC;EAE1E,MAAMC,KAAK,GAAGJ,YAAY,CACxBK,KAAK,CAAE,CAAE,CAAC,CACVC,GAAG,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AO,EAAG;EAC/B,IAAIyF,IAAI,GAAG,EAAE;EACb,IAAKzF,OAAO,CAAC2F,cAAc,CAAE,UAAW,CAAC,EAAG;IAC3CF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAACyC,KAAK;EAC3B;EACA,IAAKzC,OAAO,CAAC2F,cAAc,CAAE,YAAa,CAAC,EAAG;IAC7CF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAACwC,UAAU;EAChC;EACA,IAAKxC,OAAO,CAAC2F,cAAc,CAAE,OAAQ,CAAC,EAAG;IACxCF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAACyC,KAAK;EAC3B;EACA,IAAKzC,OAAO,CAAC2F,cAAc,CAAE,QAAS,CAAC,EAAG;IACzCF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAAC0C,MAAM;EAC5B;EACA,IAAK1C,OAAO,CAAC2F,cAAc,CAAE,MAAO,CAAC,EAAG;IACvCF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAAC2C,IAAI;EAC1B;EACA,OAAO8C,IAAI;AACZ;AAEA,eAAeD,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["parseUnit","cssUnit","match","trim","isNaN","parseFloat","value","unit","undefined","calculate","expression","Function","err","getFunctionUnitValue","functionUnitValue","options","functionUnit","split","filter","Boolean","units","slice","map","getPxFromCssUnit","Math","min","max","length","parseUnitFunction","currentCssUnit","regExp","matches","exec","replace","isMathExpression","i","includes","evalMathExpression","errorFound","cssUnitsBits","parsedUnit","expressionsMatches","values","currentValue","rawCurrentValue","calculatedExpression","calculatedValue","toFixed","parsedValue","calculatedResult","convertParsedUnitToPx","PIXELS_PER_INCH","ONE_PERCENT","defaultProperties","fontSize","lineHeight","width","height","type","setOptions","Object","assign","relativeUnits","em","rem","vh","vw","vmin","vmax","ch","ex","lh","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","svmin","lvmin","dvmin","svmax","lvmax","dvmax","absoluteUnits","in","cm","mm","pt","pc","px","Q","Number","isFinite","cache","memoizedGetPxFromCssUnit","hash","hashOptions","hasOwnProperty"],"sources":["@wordpress/components/src/mobile/utils/get-px-from-css-unit.native.js"],"sourcesContent":["/**\n * Converts string to object { value, unit }.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit\n */\nfunction parseUnit( cssUnit ) {\n\tconst match = cssUnit\n\t\t?.trim()\n\t\t.match(\n\t\t\t/^(0?[-.]?\\d*\\.?\\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/\n\t\t);\n\tif ( ! isNaN( cssUnit ) && ! isNaN( parseFloat( cssUnit ) ) ) {\n\t\treturn { value: parseFloat( cssUnit ), unit: 'px' };\n\t}\n\treturn match\n\t\t? { value: parseFloat( match[ 1 ] ) || match[ 1 ], unit: match[ 2 ] }\n\t\t: { value: cssUnit, unit: undefined };\n}\n/**\n * Evaluate a math expression.\n *\n * @param {string} expression\n * @return {number} evaluated expression.\n */\nfunction calculate( expression ) {\n\ttry {\n\t\treturn Function( `'use strict'; return (${ expression })` )();\n\t} catch ( err ) {\n\t\treturn null;\n\t}\n}\n\n/**\n * Calculates the css function value for the supported css functions such as max, min, clamp and calc.\n *\n * @param {string} functionUnitValue string should be in a particular format (for example min(12px,12px) ) no nested loops.\n * @param {Object} options\n * @return {string} unit containing the unit in PX.\n */\nfunction getFunctionUnitValue( functionUnitValue, options ) {\n\tconst functionUnit = functionUnitValue.split( /[(),]/g ).filter( Boolean );\n\n\tconst units = functionUnit\n\t\t.slice( 1 )\n\t\t.map( ( unit ) => parseUnit( getPxFromCssUnit( unit, options ) ).value )\n\t\t.filter( Boolean );\n\n\tswitch ( functionUnit[ 0 ] ) {\n\t\tcase 'min':\n\t\t\treturn Math.min( ...units ) + 'px';\n\t\tcase 'max':\n\t\t\treturn Math.max( ...units ) + 'px';\n\t\tcase 'clamp':\n\t\t\tif ( units.length !== 3 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif ( units[ 1 ] < units[ 0 ] ) {\n\t\t\t\treturn units[ 0 ] + 'px';\n\t\t\t}\n\t\t\tif ( units[ 1 ] > units[ 2 ] ) {\n\t\t\t\treturn units[ 2 ] + 'px';\n\t\t\t}\n\t\t\treturn units[ 1 ] + 'px';\n\t\tcase 'calc':\n\t\t\treturn units[ 0 ] + 'px';\n\t}\n}\n\n/**\n * Take a css function such as min, max, calc, clamp and returns parsedUnit\n *\n * How this works for the nested function is that it first replaces the inner function call.\n * Then it tackles the outer ones.\n * So for example: min( max(25px, 35px), 40px )\n * in the first pass we would replace max(25px, 35px) with 35px.\n * then we would try to evaluate min( 35px, 40px )\n * and then finally return 35px.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit object.\n */\nfunction parseUnitFunction( cssUnit ) {\n\twhile ( true ) {\n\t\tconst currentCssUnit = cssUnit;\n\t\tconst regExp = /(max|min|calc|clamp)\\(([^()]*)\\)/g;\n\t\tconst matches = regExp.exec( cssUnit ) || [];\n\t\tif ( matches[ 0 ] ) {\n\t\t\tconst functionUnitValue = getFunctionUnitValue( matches[ 0 ] );\n\t\t\tcssUnit = cssUnit.replace( matches[ 0 ], functionUnitValue );\n\t\t}\n\n\t\t// If the unit hasn't been modified or we have a single value break free.\n\t\tif ( cssUnit === currentCssUnit || parseFloat( cssUnit ) ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn parseUnit( cssUnit );\n}\n/**\n * Return true if we think this is a math expression.\n *\n * @param {string} cssUnit the cssUnit value being evaluated.\n * @return {boolean} Whether the cssUnit is a math expression.\n */\nfunction isMathExpression( cssUnit ) {\n\tfor ( let i = 0; i < cssUnit.length; i++ ) {\n\t\tif ( [ '+', '-', '/', '*' ].includes( cssUnit[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n/**\n * Evaluates the math expression and return a px value.\n *\n * @param {string} cssUnit the cssUnit value being evaluated.\n * @return {string} return a converfted value to px.\n */\nfunction evalMathExpression( cssUnit ) {\n\tlet errorFound = false;\n\t// Convert every part of the expression to px values.\n\t// The following regex matches numbers that have a following unit\n\t// E.g. 5.25rem, 1vw\n\tconst cssUnitsBits = cssUnit.match( /\\d+\\.?\\d*[a-zA-Z]+|\\.\\d+[a-zA-Z]+/g );\n\tif ( cssUnitsBits ) {\n\t\tfor ( const unit of cssUnitsBits ) {\n\t\t\t// Standardize the unit to px and extract the value.\n\t\t\tconst parsedUnit = parseUnit( getPxFromCssUnit( unit ) );\n\t\t\tif ( ! parseFloat( parsedUnit.value ) ) {\n\t\t\t\terrorFound = true;\n\t\t\t\t// End early since we are dealing with a null value.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcssUnit = cssUnit.replace( unit, parsedUnit.value );\n\t\t}\n\t} else {\n\t\terrorFound = true;\n\t}\n\n\t// For mixed math expressions wrapped within CSS expressions\n\tconst expressionsMatches = cssUnit.match( /(max|min|clamp)/g );\n\tif ( ! errorFound && expressionsMatches ) {\n\t\tconst values = cssUnit.split( ',' );\n\t\tfor ( const currentValue of values ) {\n\t\t\t// Check for nested calc() and remove them to calculate the value.\n\t\t\tconst rawCurrentValue = currentValue.replace( /\\s|calc/g, '' );\n\n\t\t\tif ( isMathExpression( rawCurrentValue ) ) {\n\t\t\t\tconst calculatedExpression = calculate( rawCurrentValue );\n\n\t\t\t\tif ( calculatedExpression ) {\n\t\t\t\t\tconst calculatedValue =\n\t\t\t\t\t\tcalculatedExpression.toFixed( 0 ) + 'px';\n\t\t\t\t\tcssUnit = cssUnit.replace( currentValue, calculatedValue );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst parsedValue = parseUnitFunction( cssUnit );\n\t\treturn ! parsedValue ? null : parsedValue.value + parsedValue.unit;\n\t}\n\n\tif ( errorFound ) {\n\t\treturn null;\n\t}\n\n\tconst calculatedResult = calculate( cssUnit );\n\treturn calculatedResult ? calculatedResult.toFixed( 0 ) + 'px' : null;\n}\n\n/**\n * Convert a parsedUnit object to px value.\n *\n * @param {Object} parsedUnit\n * @param {Object} options\n * @return {string} or {null} returns the converted with in a px value format.\n */\nfunction convertParsedUnitToPx( parsedUnit, options ) {\n\tconst PIXELS_PER_INCH = 96;\n\tconst ONE_PERCENT = 0.01;\n\n\tconst defaultProperties = {\n\t\tfontSize: 16,\n\t\tlineHeight: 16,\n\t\twidth: 375,\n\t\theight: 812,\n\t\ttype: 'font',\n\t};\n\n\tconst setOptions = Object.assign( {}, defaultProperties, options );\n\n\tconst relativeUnits = {\n\t\tem: setOptions.fontSize,\n\t\trem: setOptions.fontSize,\n\t\tvh: setOptions.height * ONE_PERCENT,\n\t\tvw: setOptions.width * ONE_PERCENT,\n\t\tvmin:\n\t\t\t( setOptions.width < setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\tvmax:\n\t\t\t( setOptions.width > setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\t'%':\n\t\t\t( setOptions.type === 'font'\n\t\t\t\t? setOptions.fontSize\n\t\t\t\t: setOptions.width ) * ONE_PERCENT,\n\t\tch: 8, // The advance measure (width) of the glyph \"0\" of the element's font. Approximate\n\t\tex: 7.15625, // X-height of the element's font. Approximate.\n\t\tlh: setOptions.lineHeight,\n\t};\n\trelativeUnits.svw = relativeUnits.vmin;\n\trelativeUnits.lvw = relativeUnits.vmax;\n\trelativeUnits.dvw = relativeUnits.vw;\n\trelativeUnits.svh = relativeUnits.vmin;\n\trelativeUnits.lvh = relativeUnits.vmax;\n\trelativeUnits.dvh = relativeUnits.vh;\n\trelativeUnits.vi = relativeUnits.vh;\n\trelativeUnits.svi = relativeUnits.vmin;\n\trelativeUnits.lvi = relativeUnits.vmax;\n\trelativeUnits.dvi = relativeUnits.vw;\n\trelativeUnits.vb = relativeUnits.vh;\n\trelativeUnits.svb = relativeUnits.vmin;\n\trelativeUnits.lvb = relativeUnits.vmax;\n\trelativeUnits.dvb = relativeUnits.vh;\n\trelativeUnits.svmin = relativeUnits.vmin;\n\trelativeUnits.lvmin = relativeUnits.vmin;\n\trelativeUnits.dvmin = relativeUnits.vmin;\n\trelativeUnits.svmax = relativeUnits.vmax;\n\trelativeUnits.lvmax = relativeUnits.vmax;\n\trelativeUnits.dvmax = relativeUnits.vmax;\n\n\tconst absoluteUnits = {\n\t\tin: PIXELS_PER_INCH,\n\t\tcm: PIXELS_PER_INCH / 2.54,\n\t\tmm: PIXELS_PER_INCH / 25.4,\n\t\tpt: PIXELS_PER_INCH / 72,\n\t\tpc: PIXELS_PER_INCH / 6,\n\t\tpx: 1,\n\t\tQ: PIXELS_PER_INCH / 2.54 / 40,\n\t};\n\n\tif ( relativeUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( relativeUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\tif ( absoluteUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( absoluteUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\treturn null;\n}\n\n/**\n * Returns the px value of a cssUnit.\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nexport function getPxFromCssUnit( cssUnit, options = {} ) {\n\tif ( Number.isFinite( cssUnit ) ) {\n\t\treturn cssUnit.toFixed( 0 ) + 'px';\n\t}\n\tif ( cssUnit === undefined ) {\n\t\treturn null;\n\t}\n\tlet parsedUnit = parseUnit( cssUnit );\n\n\tif ( ! parsedUnit.unit ) {\n\t\tparsedUnit = parseUnitFunction( cssUnit );\n\t}\n\n\tif ( isMathExpression( cssUnit ) && ! parsedUnit.unit ) {\n\t\treturn evalMathExpression( cssUnit );\n\t}\n\n\treturn convertParsedUnitToPx( parsedUnit, options );\n}\n\n// Use simple cache.\nconst cache = {};\n/**\n * Returns the px value of a cssUnit. The memoized version of getPxFromCssUnit;\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nfunction memoizedGetPxFromCssUnit( cssUnit, options = {} ) {\n\tconst hash = cssUnit + hashOptions( options );\n\n\tif ( ! cache[ hash ] ) {\n\t\tcache[ hash ] = getPxFromCssUnit( cssUnit, options );\n\t}\n\treturn cache[ hash ];\n}\n\nfunction hashOptions( options ) {\n\tlet hash = '';\n\tif ( options.hasOwnProperty( 'fontSize' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'lineHeight' ) ) {\n\t\thash = ':' + options.lineHeight;\n\t}\n\tif ( options.hasOwnProperty( 'width' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'height' ) ) {\n\t\thash = ':' + options.height;\n\t}\n\tif ( options.hasOwnProperty( 'type' ) ) {\n\t\thash = ':' + options.type;\n\t}\n\treturn hash;\n}\n\nexport default memoizedGetPxFromCssUnit;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAASA,CAAEC,OAAO,EAAG;EAC7B,MAAMC,KAAK,GAAGD,OAAO,EAClBE,IAAI,CAAC,CAAC,CACPD,KAAK,CACL,6EACD,CAAC;EACF,IAAK,CAAEE,KAAK,CAAEH,OAAQ,CAAC,IAAI,CAAEG,KAAK,CAAEC,UAAU,CAAEJ,OAAQ,CAAE,CAAC,EAAG;IAC7D,OAAO;MAAEK,KAAK,EAAED,UAAU,CAAEJ,OAAQ,CAAC;MAAEM,IAAI,EAAE;IAAK,CAAC;EACpD;EACA,OAAOL,KAAK,GACT;IAAEI,KAAK,EAAED,UAAU,CAAEH,KAAK,CAAE,CAAC,CAAG,CAAC,IAAIA,KAAK,CAAE,CAAC,CAAE;IAAEK,IAAI,EAAEL,KAAK,CAAE,CAAC;EAAG,CAAC,GACnE;IAAEI,KAAK,EAAEL,OAAO;IAAEM,IAAI,EAAEC;EAAU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/src/notice/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { MouseEventHandler, ReactNode } from 'react';\n\ntype CommonNoticeActionProps = {\n\tlabel: string;\n\tclassName?: string;\n\tnoDefaultClasses?: boolean;\n\tvariant?: 'primary' | 'secondary' | 'link';\n};\n// `url` and `onClick` can both be provided, but `url` takes precedence. If\n// `url` is provided, the action's button will be rendered as an anchor and\n// `onClick` will be ignored.\ntype NoticeActionWithURL = CommonNoticeActionProps & {\n\turl: string;\n\tonClick?: never;\n};\ntype NoticeActionWithOnClick = CommonNoticeActionProps & {\n\turl?: never;\n\tonClick: MouseEventHandler< HTMLButtonElement >;\n};\n\nexport type NoticeAction = NoticeActionWithURL | NoticeActionWithOnClick;\n\nexport type NoticeChildren = string | JSX.Element;\n\nexport type NoticeProps = {\n\t/**\n\t * A CSS `class` to give to the wrapper element.\n\t */\n\tclassName?: string;\n\t/**\n\t * The displayed message of a notice. Also used as the spoken message for\n\t * assistive technology, unless `spokenMessage` is provided as an alternative message.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Used to provide a custom spoken message in place of the `children` default.\n\t *\n\t * @default `children`\n\t */\n\tspokenMessage?: ReactNode;\n\t/**\n\t * Determines the color of the notice: `warning` (yellow),\n\t * `success` (green), `error` (red), or `'info'`.\n\t * By default `'info'` will be blue, but if there is a parent Theme component\n\t * with an accent color prop, the notice will take on that color instead.\n\t *\n\t * @default 'info'\n\t */\n\tstatus?: 'warning' | 'success' | 'error' | 'info';\n\t/**\n\t * Function called when dismissing the notice\n\t *\n\t * @default noop\n\t */\n\tonRemove?: () => void;\n\t/**\n\t * A politeness level for the notice's spoken message. Should be provided as\n\t * one of the valid options for an `aria-live` attribute value.\n\t *\n\t * A value of `'assertive'` is to be used for important, and usually\n\t * time-sensitive, information. It will interrupt anything else the screen\n\t * reader is announcing in that moment.\n\t * A value of `'polite'` is to be used for advisory information. It should\n\t * not interrupt what the screen reader is announcing in that moment\n\t * (the \"speech queue\") or interrupt the current task.\n\t *\n\t * Note that this value should be considered a suggestion; assistive\n\t * technologies may override it based on internal heuristics.\n\t *\n\t * @see https://www.w3.org/TR/wai-aria-1.1/#aria-live\n\t *\n\t * @default 'assertive' for 'error' status, 'polite' for all other statuses\n\t */\n\tpoliteness?: 'polite' | 'assertive';\n\t/**\n\t * Whether the notice should be dismissible or not\n\t *\n\t * @default true\n\t */\n\tisDismissible?: boolean;\n\t/**\n\t * A deprecated alternative to `onRemove`. This prop is kept for\n\t * compatibilty reasons but should be avoided.\n\t *\n\t * @default noop\n\t */\n\tonDismiss?: () => void;\n\t/**\n\t * An array of action objects. Each member object should contain:\n\t *\n\t * - `label`: `string` containing the text of the button/link\n\t * - `url`: `string` OR `onClick`: `( event: SyntheticEvent ) => void` to specify\n\t * what the action does.\n\t * - `className`: `string` (optional) to add custom classes to the button styles.\n\t * - `noDefaultClasses`: `boolean` (optional) A value of `true` will remove all\n\t * default styling.\n\t * - `variant`: `'primary' | 'secondary' | 'link'` (optional) You can denote a\n\t * primary button action for a notice by passing a value of `primary`.\n\t *\n\t * The default appearance of an action button is inferred based on whether\n\t * `url` or `onClick` are provided, rendering the button as a link if\n\t * appropriate. If both props are provided, `url` takes precedence, and the\n\t * action button will render as an anchor tag.\n\t *\n\t * @default []\n\t */\n\tactions?: Array< NoticeAction >;\n\t/**\n\t * Determines whether or not the message should be parsed as custom HTML\n\t * instead of a string.\n\t */\n\t__unstableHTML?: boolean;\n};\n\nexport type NoticeListProps = {\n\t/**\n\t * Array of notices to render.\n\t */\n\tnotices: Array<\n\t\tOmit< NoticeProps, 'children' > & {\n\t\t\tid: string;\n\t\t\tcontent: string;\n\t\t}\n\t>;\n\t/**\n\t * Function called when a notice should be removed / dismissed.\n\t */\n\tonRemove?: ( id: string ) => void;\n\t/**\n\t * Children to be rendered inside the notice list.\n\t */\n\tchildren?: ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/notice/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { MouseEventHandler, ReactNode } from 'react';\n\ntype CommonNoticeActionProps = {\n\tlabel: string;\n\tclassName?: string;\n\tnoDefaultClasses?: boolean;\n\tvariant?: 'primary' | 'secondary' | 'link';\n};\n// `url` and `onClick` can both be provided, but `url` takes precedence. If\n// `url` is provided, the action's button will be rendered as an anchor and\n// `onClick` will be ignored.\ntype NoticeActionWithURL = CommonNoticeActionProps & {\n\turl: string;\n\tonClick?: never;\n};\ntype NoticeActionWithOnClick = CommonNoticeActionProps & {\n\turl?: never;\n\tonClick: MouseEventHandler< HTMLButtonElement >;\n};\n\nexport type NoticeAction = NoticeActionWithURL | NoticeActionWithOnClick;\n\nexport type NoticeChildren = string | JSX.Element;\n\nexport type NoticeProps = {\n\t/**\n\t * A CSS `class` to give to the wrapper element.\n\t */\n\tclassName?: string;\n\t/**\n\t * The displayed message of a notice. Also used as the spoken message for\n\t * assistive technology, unless `spokenMessage` is provided as an alternative message.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Used to provide a custom spoken message in place of the `children` default.\n\t *\n\t * @default `children`\n\t */\n\tspokenMessage?: ReactNode;\n\t/**\n\t * Determines the color of the notice: `warning` (yellow),\n\t * `success` (green), `error` (red), or `'info'`.\n\t * By default `'info'` will be blue, but if there is a parent Theme component\n\t * with an accent color prop, the notice will take on that color instead.\n\t *\n\t * @default 'info'\n\t */\n\tstatus?: 'warning' | 'success' | 'error' | 'info';\n\t/**\n\t * Function called when dismissing the notice\n\t *\n\t * @default noop\n\t */\n\tonRemove?: () => void;\n\t/**\n\t * A politeness level for the notice's spoken message. Should be provided as\n\t * one of the valid options for an `aria-live` attribute value.\n\t *\n\t * A value of `'assertive'` is to be used for important, and usually\n\t * time-sensitive, information. It will interrupt anything else the screen\n\t * reader is announcing in that moment.\n\t * A value of `'polite'` is to be used for advisory information. It should\n\t * not interrupt what the screen reader is announcing in that moment\n\t * (the \"speech queue\") or interrupt the current task.\n\t *\n\t * Note that this value should be considered a suggestion; assistive\n\t * technologies may override it based on internal heuristics.\n\t *\n\t * @see https://www.w3.org/TR/wai-aria-1.1/#aria-live\n\t *\n\t * @default 'assertive' for 'error' status, 'polite' for all other statuses\n\t */\n\tpoliteness?: 'polite' | 'assertive';\n\t/**\n\t * Whether the notice should be dismissible or not\n\t *\n\t * @default true\n\t */\n\tisDismissible?: boolean;\n\t/**\n\t * A deprecated alternative to `onRemove`. This prop is kept for\n\t * compatibility reasons but should be avoided.\n\t *\n\t * @default noop\n\t */\n\tonDismiss?: () => void;\n\t/**\n\t * An array of action objects. Each member object should contain:\n\t *\n\t * - `label`: `string` containing the text of the button/link\n\t * - `url`: `string` OR `onClick`: `( event: SyntheticEvent ) => void` to specify\n\t * what the action does.\n\t * - `className`: `string` (optional) to add custom classes to the button styles.\n\t * - `noDefaultClasses`: `boolean` (optional) A value of `true` will remove all\n\t * default styling.\n\t * - `variant`: `'primary' | 'secondary' | 'link'` (optional) You can denote a\n\t * primary button action for a notice by passing a value of `primary`.\n\t *\n\t * The default appearance of an action button is inferred based on whether\n\t * `url` or `onClick` are provided, rendering the button as a link if\n\t * appropriate. If both props are provided, `url` takes precedence, and the\n\t * action button will render as an anchor tag.\n\t *\n\t * @default []\n\t */\n\tactions?: Array< NoticeAction >;\n\t/**\n\t * Determines whether or not the message should be parsed as custom HTML\n\t * instead of a string.\n\t */\n\t__unstableHTML?: boolean;\n};\n\nexport type NoticeListProps = {\n\t/**\n\t * Array of notices to render.\n\t */\n\tnotices: Array<\n\t\tOmit< NoticeProps, 'children' > & {\n\t\t\tid: string;\n\t\t\tcontent: string;\n\t\t}\n\t>;\n\t/**\n\t * Function called when a notice should be removed / dismissed.\n\t */\n\tonRemove?: ( id: string ) => void;\n\t/**\n\t * Children to be rendered inside the notice list.\n\t */\n\tchildren?: ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
@@ -69,7 +69,7 @@ function UnforwardedSearchControl({
69
69
  const contextValue = useMemo(() => ({
70
70
  BaseControl: {
71
71
  // Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system
72
- // to provide backwards compatibile margin for SearchControl.
72
+ // to provide backwards compatible margin for SearchControl.
73
73
  // (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)
74
74
  _overrides: {
75
75
  __nextHasNoMarginBottom
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useInstanceId","useMergeRefs","__","Icon","search","closeSmall","forwardRef","useMemo","useRef","deprecated","Button","ContextSystemProvider","StyledInputControl","SuffixItemWrapper","jsx","_jsx","SuffixItem","searchRef","value","onChange","onClose","icon","since","onReset","current","focus","size","label","onClick","UnforwardedSearchControl","__nextHasNoMarginBottom","className","placeholder","hideLabelFromVision","restProps","forwardedRef","disabled","filteredRestProps","instanceId","SearchControl","contextValue","BaseControl","_overrides","__associatedWPComponentName","InputBase","isBorderless","children","__next40pxDefaultSize","id","ref","type","nextValue","autoComplete","suffix"],"sources":["@wordpress/components/src/search-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { SearchControlProps, SuffixItemProps } from './types';\nimport type { ForwardedRef } from 'react';\nimport { ContextSystemProvider } from '../context';\nimport { StyledInputControl, SuffixItemWrapper } from './styles';\n\nfunction SuffixItem( {\n\tsearchRef,\n\tvalue,\n\tonChange,\n\tonClose,\n}: SuffixItemProps ) {\n\tif ( ! onClose && ! value ) {\n\t\treturn <Icon icon={ search } />;\n\t}\n\n\tif ( onClose ) {\n\t\tdeprecated( '`onClose` prop in wp.components.SearchControl', {\n\t\t\tsince: '6.8',\n\t\t} );\n\t}\n\n\tconst onReset = () => {\n\t\tonChange( '' );\n\t\tsearchRef.current?.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"small\"\n\t\t\ticon={ closeSmall }\n\t\t\tlabel={ onClose ? __( 'Close search' ) : __( 'Reset search' ) }\n\t\t\tonClick={ onClose ?? onReset }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom = false,\n\t\tclassName,\n\t\tonChange,\n\t\tvalue,\n\t\tlabel = __( 'Search' ),\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\tonClose,\n\t\tsize = 'default',\n\t\t...restProps\n\t}: Omit<\n\t\tWordPressComponentProps< SearchControlProps, 'input', false >,\n\t\t// TODO: Background styling currently doesn't support a disabled state. Needs design work.\n\t\t'disabled'\n\t>,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\t// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.\n\t// Work with the design team (@WordPress/gutenberg-design) if you need this feature.\n\tconst { disabled, ...filteredRestProps } = restProps;\n\n\tconst searchRef = useRef< HTMLInputElement >( null );\n\tconst instanceId = useInstanceId(\n\t\tSearchControl,\n\t\t'components-search-control'\n\t);\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tBaseControl: {\n\t\t\t\t// Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system\n\t\t\t\t// to provide backwards compatibile margin for SearchControl.\n\t\t\t\t// (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)\n\t\t\t\t_overrides: { __nextHasNoMarginBottom },\n\t\t\t\t__associatedWPComponentName: 'SearchControl',\n\t\t\t},\n\t\t\t// `isBorderless` is still experimental and not a public prop for InputControl yet.\n\t\t\tInputBase: { isBorderless: true },\n\t\t} ),\n\t\t[ __nextHasNoMarginBottom ]\n\t);\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextValue }>\n\t\t\t<StyledInputControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tid={ instanceId }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tlabel={ label }\n\t\t\t\tref={ useMergeRefs( [ searchRef, forwardedRef ] ) }\n\t\t\t\ttype=\"search\"\n\t\t\t\tsize={ size }\n\t\t\t\tclassName={ clsx( 'components-search-control', className ) }\n\t\t\t\tonChange={ ( nextValue?: string ) =>\n\t\t\t\t\tonChange( nextValue ?? '' )\n\t\t\t\t}\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tvalue={ value ?? '' }\n\t\t\t\tsuffix={\n\t\t\t\t\t<SuffixItemWrapper size={ size }>\n\t\t\t\t\t\t<SuffixItem\n\t\t\t\t\t\t\tsearchRef={ searchRef }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SuffixItemWrapper>\n\t\t\t\t}\n\t\t\t\t{ ...filteredRestProps }\n\t\t\t/>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * SearchControl components let users display a search control.\n *\n * ```jsx\n * import { SearchControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function MySearchControl( { className, setState } ) {\n * const [ searchInput, setSearchInput ] = useState( '' );\n *\n * return (\n * <SearchControl\n * __nextHasNoMarginBottom\n * value={ searchInput }\n * onChange={ setSearchInput }\n * />\n * );\n * }\n * ```\n */\nexport const SearchControl = forwardRef( UnforwardedSearchControl );\n\nexport default SearchControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;AAChE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,MAAM,EAAEC,UAAU,QAAQ,kBAAkB;AAC3D,SAASC,UAAU,EA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AAW;UACvBC,KAAK,EAAGA,KAAO;UACfC,QAAQ,EAAGA,QAAU;UACrBC,OAAO,EAAGA;QAAS,CACnB;MAAC,CACgB,CACnB;MAAA,GACIiB;IAAiB,CACtB;EAAC,CACoB,CAAC;AAE1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,aAAa,GAAGjC,UAAU,CAAEuB,wBAAyB,CAAC;AAEnE,eAAeU,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useInstanceId","useMergeRefs","__","Icon","search","closeSmall","forwardRef","useMemo","useRef","deprecated","Button","ContextSystemProvider","StyledInputControl","SuffixItemWrapper","jsx","_jsx","SuffixItem","searchRef","value","onChange","onClose","icon","since","onReset","current","focus","size","label","onClick","UnforwardedSearchControl","__nextHasNoMarginBottom","className","placeholder","hideLabelFromVision","restProps","forwardedRef","disabled","filteredRestProps","instanceId","SearchControl","contextValue","BaseControl","_overrides","__associatedWPComponentName","InputBase","isBorderless","children","__next40pxDefaultSize","id","ref","type","nextValue","autoComplete","suffix"],"sources":["@wordpress/components/src/search-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { SearchControlProps, SuffixItemProps } from './types';\nimport type { ForwardedRef } from 'react';\nimport { ContextSystemProvider } from '../context';\nimport { StyledInputControl, SuffixItemWrapper } from './styles';\n\nfunction SuffixItem( {\n\tsearchRef,\n\tvalue,\n\tonChange,\n\tonClose,\n}: SuffixItemProps ) {\n\tif ( ! onClose && ! value ) {\n\t\treturn <Icon icon={ search } />;\n\t}\n\n\tif ( onClose ) {\n\t\tdeprecated( '`onClose` prop in wp.components.SearchControl', {\n\t\t\tsince: '6.8',\n\t\t} );\n\t}\n\n\tconst onReset = () => {\n\t\tonChange( '' );\n\t\tsearchRef.current?.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"small\"\n\t\t\ticon={ closeSmall }\n\t\t\tlabel={ onClose ? __( 'Close search' ) : __( 'Reset search' ) }\n\t\t\tonClick={ onClose ?? onReset }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom = false,\n\t\tclassName,\n\t\tonChange,\n\t\tvalue,\n\t\tlabel = __( 'Search' ),\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\tonClose,\n\t\tsize = 'default',\n\t\t...restProps\n\t}: Omit<\n\t\tWordPressComponentProps< SearchControlProps, 'input', false >,\n\t\t// TODO: Background styling currently doesn't support a disabled state. Needs design work.\n\t\t'disabled'\n\t>,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\t// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.\n\t// Work with the design team (@WordPress/gutenberg-design) if you need this feature.\n\tconst { disabled, ...filteredRestProps } = restProps;\n\n\tconst searchRef = useRef< HTMLInputElement >( null );\n\tconst instanceId = useInstanceId(\n\t\tSearchControl,\n\t\t'components-search-control'\n\t);\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tBaseControl: {\n\t\t\t\t// Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system\n\t\t\t\t// to provide backwards compatible margin for SearchControl.\n\t\t\t\t// (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)\n\t\t\t\t_overrides: { __nextHasNoMarginBottom },\n\t\t\t\t__associatedWPComponentName: 'SearchControl',\n\t\t\t},\n\t\t\t// `isBorderless` is still experimental and not a public prop for InputControl yet.\n\t\t\tInputBase: { isBorderless: true },\n\t\t} ),\n\t\t[ __nextHasNoMarginBottom ]\n\t);\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextValue }>\n\t\t\t<StyledInputControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tid={ instanceId }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tlabel={ label }\n\t\t\t\tref={ useMergeRefs( [ searchRef, forwardedRef ] ) }\n\t\t\t\ttype=\"search\"\n\t\t\t\tsize={ size }\n\t\t\t\tclassName={ clsx( 'components-search-control', className ) }\n\t\t\t\tonChange={ ( nextValue?: string ) =>\n\t\t\t\t\tonChange( nextValue ?? '' )\n\t\t\t\t}\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tvalue={ value ?? '' }\n\t\t\t\tsuffix={\n\t\t\t\t\t<SuffixItemWrapper size={ size }>\n\t\t\t\t\t\t<SuffixItem\n\t\t\t\t\t\t\tsearchRef={ searchRef }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SuffixItemWrapper>\n\t\t\t\t}\n\t\t\t\t{ ...filteredRestProps }\n\t\t\t/>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * SearchControl components let users display a search control.\n *\n * ```jsx\n * import { SearchControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function MySearchControl( { className, setState } ) {\n * const [ searchInput, setSearchInput ] = useState( '' );\n *\n * return (\n * <SearchControl\n * __nextHasNoMarginBottom\n * value={ searchInput }\n * onChange={ setSearchInput }\n * />\n * );\n * }\n * ```\n */\nexport const SearchControl = forwardRef( UnforwardedSearchControl );\n\nexport default SearchControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,S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