@wordpress/components 21.0.2 → 21.1.2-next.4d3b314fd5.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 (255) hide show
  1. package/CHANGELOG.md +31 -4
  2. package/build/autocomplete/get-default-use-items.js +3 -3
  3. package/build/autocomplete/get-default-use-items.js.map +1 -1
  4. package/build/box-control/unit-control.js +0 -1
  5. package/build/box-control/unit-control.js.map +1 -1
  6. package/build/button/index.js +5 -1
  7. package/build/button/index.js.map +1 -1
  8. package/build/draggable/index.js +3 -6
  9. package/build/draggable/index.js.map +1 -1
  10. package/build/drop-zone/index.js +7 -1
  11. package/build/drop-zone/index.js.map +1 -1
  12. package/build/higher-order/with-filters/index.js +1 -1
  13. package/build/higher-order/with-filters/index.js.map +1 -1
  14. package/build/index.js +6 -0
  15. package/build/index.js.map +1 -1
  16. package/build/menu-item/index.js +4 -3
  17. package/build/menu-item/index.js.map +1 -1
  18. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +10 -3
  19. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  20. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +15 -6
  21. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  22. package/build/mobile/bottom-sheet/sub-sheet/index.native.js +4 -1
  23. package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  24. package/build/mobile/color-settings/index.native.js +3 -1
  25. package/build/mobile/color-settings/index.native.js.map +1 -1
  26. package/build/mobile/color-settings/picker-screen.native.js +3 -1
  27. package/build/mobile/color-settings/picker-screen.native.js.map +1 -1
  28. package/build/mobile/image/index.native.js +3 -1
  29. package/build/mobile/image/index.native.js.map +1 -1
  30. package/build/mobile/keyboard-avoiding-view/index.ios.js +3 -1
  31. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  32. package/build/mobile/link-picker/index.native.js +3 -1
  33. package/build/mobile/link-picker/index.native.js.map +1 -1
  34. package/build/mobile/link-picker/link-picker-results.native.js +6 -4
  35. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  36. package/build/mobile/link-picker/link-picker-screen.native.js +3 -1
  37. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  38. package/build/mobile/link-settings/index.native.js +24 -6
  39. package/build/mobile/link-settings/index.native.js.map +1 -1
  40. package/build/mobile/link-settings/link-settings-screen.native.js +3 -1
  41. package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  42. package/build/mobile/segmented-control/index.native.js +6 -2
  43. package/build/mobile/segmented-control/index.native.js.map +1 -1
  44. package/build/mobile/utils/use-unit-converter-to-mobile.native.js +6 -2
  45. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  46. package/build/notice/index.native.js +15 -19
  47. package/build/notice/index.native.js.map +1 -1
  48. package/build/notice/list.native.js +2 -3
  49. package/build/notice/list.native.js.map +1 -1
  50. package/build/palette-edit/index.js +1 -1
  51. package/build/palette-edit/index.js.map +1 -1
  52. package/build/popover/index.js +29 -32
  53. package/build/popover/index.js.map +1 -1
  54. package/build/popover/limit-shift.js +145 -0
  55. package/build/popover/limit-shift.js.map +1 -0
  56. package/build/popover/utils.js +55 -15
  57. package/build/popover/utils.js.map +1 -1
  58. package/build/range-control/input-range.js +1 -15
  59. package/build/range-control/input-range.js.map +1 -1
  60. package/build/range-control/tooltip.js +1 -1
  61. package/build/range-control/tooltip.js.map +1 -1
  62. package/build/range-control/utils.js +2 -58
  63. package/build/range-control/utils.js.map +1 -1
  64. package/build/tools-panel/styles.js +27 -12
  65. package/build/tools-panel/styles.js.map +1 -1
  66. package/build/tools-panel/tools-panel-header/component.js +19 -6
  67. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  68. package/build/tools-panel/tools-panel-header/hook.js +4 -0
  69. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  70. package/build/tree-grid/index.js +13 -8
  71. package/build/tree-grid/index.js.map +1 -1
  72. package/build/unit-control/index.js +2 -2
  73. package/build/unit-control/index.js.map +1 -1
  74. package/build/unit-control/index.native.js +10 -2
  75. package/build/unit-control/index.native.js.map +1 -1
  76. package/build/unit-control/styles/unit-control-styles.js +21 -32
  77. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  78. package/build/utils/hooks/use-controlled-state.js +2 -3
  79. package/build/utils/hooks/use-controlled-state.js.map +1 -1
  80. package/build-module/autocomplete/get-default-use-items.js +1 -1
  81. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  82. package/build-module/box-control/unit-control.js +0 -1
  83. package/build-module/box-control/unit-control.js.map +1 -1
  84. package/build-module/button/index.js +5 -1
  85. package/build-module/button/index.js.map +1 -1
  86. package/build-module/draggable/index.js +2 -5
  87. package/build-module/draggable/index.js.map +1 -1
  88. package/build-module/drop-zone/index.js +7 -1
  89. package/build-module/drop-zone/index.js.map +1 -1
  90. package/build-module/higher-order/with-filters/index.js +2 -2
  91. package/build-module/higher-order/with-filters/index.js.map +1 -1
  92. package/build-module/index.js +1 -1
  93. package/build-module/index.js.map +1 -1
  94. package/build-module/menu-item/index.js +4 -3
  95. package/build-module/menu-item/index.js.map +1 -1
  96. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +10 -3
  97. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  98. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +13 -4
  99. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  100. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +4 -1
  101. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  102. package/build-module/mobile/color-settings/index.native.js +3 -1
  103. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  104. package/build-module/mobile/color-settings/picker-screen.native.js +3 -1
  105. package/build-module/mobile/color-settings/picker-screen.native.js.map +1 -1
  106. package/build-module/mobile/image/index.native.js +3 -1
  107. package/build-module/mobile/image/index.native.js.map +1 -1
  108. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +3 -1
  109. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  110. package/build-module/mobile/link-picker/index.native.js +3 -1
  111. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  112. package/build-module/mobile/link-picker/link-picker-results.native.js +4 -2
  113. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  114. package/build-module/mobile/link-picker/link-picker-screen.native.js +3 -1
  115. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  116. package/build-module/mobile/link-settings/index.native.js +24 -6
  117. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  118. package/build-module/mobile/link-settings/link-settings-screen.native.js +3 -1
  119. package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  120. package/build-module/mobile/segmented-control/index.native.js +6 -2
  121. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  122. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +6 -2
  123. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  124. package/build-module/notice/index.native.js +16 -21
  125. package/build-module/notice/index.native.js.map +1 -1
  126. package/build-module/notice/list.native.js +3 -3
  127. package/build-module/notice/list.native.js.map +1 -1
  128. package/build-module/palette-edit/index.js +1 -1
  129. package/build-module/palette-edit/index.js.map +1 -1
  130. package/build-module/popover/index.js +31 -35
  131. package/build-module/popover/index.js.map +1 -1
  132. package/build-module/popover/limit-shift.js +136 -0
  133. package/build-module/popover/limit-shift.js.map +1 -0
  134. package/build-module/popover/utils.js +55 -15
  135. package/build-module/popover/utils.js.map +1 -1
  136. package/build-module/range-control/input-range.js +1 -14
  137. package/build-module/range-control/input-range.js.map +1 -1
  138. package/build-module/range-control/tooltip.js +1 -1
  139. package/build-module/range-control/tooltip.js.map +1 -1
  140. package/build-module/range-control/utils.js +2 -57
  141. package/build-module/range-control/utils.js.map +1 -1
  142. package/build-module/tools-panel/styles.js +23 -12
  143. package/build-module/tools-panel/styles.js.map +1 -1
  144. package/build-module/tools-panel/tools-panel-header/component.js +19 -7
  145. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  146. package/build-module/tools-panel/tools-panel-header/hook.js +4 -0
  147. package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
  148. package/build-module/tree-grid/index.js +13 -8
  149. package/build-module/tree-grid/index.js.map +1 -1
  150. package/build-module/unit-control/index.js +2 -2
  151. package/build-module/unit-control/index.js.map +1 -1
  152. package/build-module/unit-control/index.native.js +10 -2
  153. package/build-module/unit-control/index.native.js.map +1 -1
  154. package/build-module/unit-control/styles/unit-control-styles.js +20 -31
  155. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  156. package/build-module/utils/hooks/use-controlled-state.js +3 -4
  157. package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
  158. package/build-style/style-rtl.css +13 -2
  159. package/build-style/style.css +13 -2
  160. package/build-types/button/index.d.ts.map +1 -1
  161. package/build-types/draggable/index.d.ts.map +1 -1
  162. package/build-types/drop-zone/index.d.ts.map +1 -1
  163. package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
  164. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +3 -3
  165. package/build-types/menu-item/index.d.ts.map +1 -1
  166. package/build-types/popover/index.d.ts.map +1 -1
  167. package/build-types/popover/limit-shift.d.ts +87 -0
  168. package/build-types/popover/limit-shift.d.ts.map +1 -0
  169. package/build-types/popover/stories/e2e/index.d.ts +8 -0
  170. package/build-types/popover/stories/e2e/index.d.ts.map +1 -0
  171. package/build-types/popover/test/index.d.ts +2 -0
  172. package/build-types/popover/test/index.d.ts.map +1 -0
  173. package/build-types/popover/types.d.ts +1 -1
  174. package/build-types/popover/types.d.ts.map +1 -1
  175. package/build-types/popover/utils.d.ts.map +1 -1
  176. package/build-types/range-control/input-range.d.ts.map +1 -1
  177. package/build-types/range-control/stories/index.d.ts.map +1 -1
  178. package/build-types/range-control/types.d.ts +0 -34
  179. package/build-types/range-control/types.d.ts.map +1 -1
  180. package/build-types/range-control/utils.d.ts +1 -12
  181. package/build-types/range-control/utils.d.ts.map +1 -1
  182. package/build-types/spinner/index.d.ts +1 -1
  183. package/build-types/tools-panel/styles.d.ts +6 -0
  184. package/build-types/tools-panel/styles.d.ts.map +1 -1
  185. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  186. package/build-types/tools-panel/tools-panel-header/hook.d.ts +1 -0
  187. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  188. package/build-types/tools-panel/types.d.ts +1 -0
  189. package/build-types/tools-panel/types.d.ts.map +1 -1
  190. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -4
  191. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  192. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  193. package/package.json +17 -17
  194. package/src/autocomplete/get-default-use-items.js +1 -1
  195. package/src/box-control/unit-control.js +0 -1
  196. package/src/button/index.js +7 -1
  197. package/src/button/test/index.js +36 -0
  198. package/src/color-palette/test/__snapshots__/index.js.snap +169 -1106
  199. package/src/color-palette/test/index.js +107 -61
  200. package/src/draggable/index.js +2 -5
  201. package/src/drop-zone/index.tsx +4 -1
  202. package/src/font-size-picker/stories/e2e/index.js +47 -0
  203. package/src/higher-order/with-filters/index.js +2 -2
  204. package/src/index.js +1 -1
  205. package/src/menu-item/README.md +7 -0
  206. package/src/menu-item/index.js +11 -5
  207. package/src/menu-item/style.scss +1 -0
  208. package/src/menu-item/test/index.js +36 -0
  209. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +9 -0
  210. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +12 -2
  211. package/src/mobile/bottom-sheet/sub-sheet/index.native.js +3 -0
  212. package/src/mobile/color-settings/index.native.js +3 -0
  213. package/src/mobile/color-settings/picker-screen.native.js +3 -0
  214. package/src/mobile/image/index.native.js +3 -0
  215. package/src/mobile/keyboard-avoiding-view/index.ios.js +3 -0
  216. package/src/mobile/link-picker/index.native.js +3 -0
  217. package/src/mobile/link-picker/link-picker-results.native.js +4 -1
  218. package/src/mobile/link-picker/link-picker-screen.native.js +3 -0
  219. package/src/mobile/link-settings/index.native.js +18 -0
  220. package/src/mobile/link-settings/link-settings-screen.native.js +3 -0
  221. package/src/mobile/segmented-control/index.native.js +6 -0
  222. package/src/mobile/utils/use-unit-converter-to-mobile.native.js +6 -0
  223. package/src/notice/index.native.js +17 -20
  224. package/src/notice/list.native.js +7 -3
  225. package/src/palette-edit/index.js +1 -1
  226. package/src/placeholder/style.scss +1 -1
  227. package/src/popover/index.tsx +26 -42
  228. package/src/popover/limit-shift.ts +205 -0
  229. package/src/popover/stories/e2e/index.tsx +25 -0
  230. package/src/popover/test/index.tsx +230 -0
  231. package/src/popover/types.ts +1 -0
  232. package/src/popover/utils.ts +58 -16
  233. package/src/range-control/README.md +6 -7
  234. package/src/range-control/input-range.tsx +1 -21
  235. package/src/range-control/stories/index.tsx +2 -1
  236. package/src/range-control/tooltip.tsx +1 -1
  237. package/src/range-control/types.ts +0 -35
  238. package/src/range-control/utils.ts +3 -75
  239. package/src/tools-panel/stories/index.js +27 -0
  240. package/src/tools-panel/styles.ts +28 -1
  241. package/src/tools-panel/tools-panel-header/component.tsx +12 -5
  242. package/src/tools-panel/tools-panel-header/hook.ts +5 -0
  243. package/src/tools-panel/types.ts +1 -0
  244. package/src/tree-grid/index.js +23 -14
  245. package/src/tree-grid/test/__snapshots__/cell.js.snap +21 -17
  246. package/src/tree-grid/test/__snapshots__/index.js.snap +1 -1
  247. package/src/unit-control/index.native.js +8 -0
  248. package/src/unit-control/index.tsx +2 -2
  249. package/src/unit-control/styles/unit-control-styles.ts +0 -20
  250. package/src/unit-control/test/index.tsx +6 -3
  251. package/src/utils/hooks/use-controlled-state.js +9 -6
  252. package/tsconfig.tsbuildinfo +1 -1
  253. package/src/popover/test/__snapshots__/index.js.snap +0 -34
  254. package/src/popover/test/index.js +0 -164
  255. package/src/unit-control/test/__snapshots__/index.tsx.snap +0 -31
@@ -3,9 +3,6 @@ import type { SelectSize } from '../types';
3
3
  declare type SelectProps = {
4
4
  selectSize: SelectSize;
5
5
  };
6
- declare type InputProps = {
7
- disableUnits?: boolean;
8
- };
9
6
  export declare const Root: import("@emotion/styled").StyledComponent<{
10
7
  theme?: import("@emotion/react").Theme | undefined;
11
8
  as?: import("react").ElementType<any> | undefined;
@@ -23,7 +20,7 @@ export declare const ValueInput: import("@emotion/styled").StyledComponent<Omit<
23
20
  value?: string | number | undefined;
24
21
  } & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "type" | "children" | "value" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "as" | "name" | "hidden" | "color" | "height" | "translate" | "width" | "size" | "multiple" | "disabled" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "hideLabelFromVision" | "step" | "max" | "min" | "crossOrigin" | "__next36pxDefaultSize" | "suffix" | "__unstableInputWidth" | "labelPosition" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "readOnly" | "required" | "src" | "dragDirection" | "dragThreshold" | "isDragEnabled" | "isPressEnterToChange" | "onValidate" | "__unstableStateReducer" | "hideHTMLArrows" | "isShiftStepEnabled" | "shiftStep"> & import("react").RefAttributes<any> & {
25
22
  theme?: import("@emotion/react").Theme | undefined;
26
- } & InputProps, {}, {}>;
23
+ }, {}, {}>;
27
24
  export declare const UnitLabel: import("@emotion/styled").StyledComponent<{
28
25
  theme?: import("@emotion/react").Theme | undefined;
29
26
  as?: import("react").ElementType<any> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"unit-control-styles.d.ts","sourceRoot":"","sources":["../../../src/unit-control/styles/unit-control-styles.ts"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK3C,aAAK,WAAW,GAAG;IAClB,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,aAAK,UAAU,GAAG;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,IAAI;;;yGAQhB,CAAC;AAiBF,eAAO,MAAM,UAAU;;;;;;;;;;;;;uBAWtB,CAAC;AAmCF,eAAO,MAAM,SAAS;;;uHAQrB,CAAC;AA+CF,eAAO,MAAM,UAAU;;;mIAqBtB,CAAC"}
1
+ {"version":3,"file":"unit-control-styles.d.ts","sourceRoot":"","sources":["../../../src/unit-control/styles/unit-control-styles.ts"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK3C,aAAK,WAAW,GAAG;IAClB,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,IAAI;;;yGAQhB,CAAC;AAKF,eAAO,MAAM,UAAU;;;;;;;;;;;;;UAOtB,CAAC;AAmCF,eAAO,MAAM,SAAS;;;uHAQrB,CAAC;AA+CF,eAAO,MAAM,UAAU;;;mIAqBtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-controlled-state.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/use-controlled-state.js"],"names":[],"mappings":";;;;;aAac,CAAC,GAAG,SAAS;;;;cACb,CAAC,GAAG,EAAE;;AAapB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,kIAFuC,IAAI,EAgC1C"}
1
+ {"version":3,"file":"use-controlled-state.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/use-controlled-state.js"],"names":[],"mappings":";;;;;aAac,CAAC,GAAG,SAAS;;;;cACb,CAAC,GAAG,EAAE;;AAapB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,kIAFuC,IAAI,EAmC1C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "21.0.2",
3
+ "version": "21.1.2-next.4d3b314fd5.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -38,21 +38,21 @@
38
38
  "@emotion/utils": "^1.0.0",
39
39
  "@floating-ui/react-dom": "^1.0.0",
40
40
  "@use-gesture/react": "^10.2.6",
41
- "@wordpress/a11y": "^3.17.1",
42
- "@wordpress/compose": "^5.15.2",
43
- "@wordpress/date": "^4.17.1",
44
- "@wordpress/deprecated": "^3.17.1",
45
- "@wordpress/dom": "^3.17.2",
46
- "@wordpress/element": "^4.15.1",
47
- "@wordpress/escape-html": "^2.17.1",
48
- "@wordpress/hooks": "^3.17.1",
49
- "@wordpress/i18n": "^4.17.1",
50
- "@wordpress/icons": "^9.8.1",
51
- "@wordpress/is-shallow-equal": "^4.17.1",
52
- "@wordpress/keycodes": "^3.17.1",
53
- "@wordpress/primitives": "^3.15.1",
54
- "@wordpress/rich-text": "^5.15.2",
55
- "@wordpress/warning": "^2.17.1",
41
+ "@wordpress/a11y": "^3.18.1-next.4d3b314fd5.0",
42
+ "@wordpress/compose": "^5.16.1-next.4d3b314fd5.0",
43
+ "@wordpress/date": "^4.18.1-next.4d3b314fd5.0",
44
+ "@wordpress/deprecated": "^3.18.1-next.4d3b314fd5.0",
45
+ "@wordpress/dom": "^3.18.1-next.4d3b314fd5.0",
46
+ "@wordpress/element": "^4.16.1-next.4d3b314fd5.0",
47
+ "@wordpress/escape-html": "^2.18.1-next.4d3b314fd5.0",
48
+ "@wordpress/hooks": "^3.18.1-next.4d3b314fd5.0",
49
+ "@wordpress/i18n": "^4.18.1-next.4d3b314fd5.0",
50
+ "@wordpress/icons": "^9.9.1-next.4d3b314fd5.0",
51
+ "@wordpress/is-shallow-equal": "^4.18.1-next.4d3b314fd5.0",
52
+ "@wordpress/keycodes": "^3.18.1-next.4d3b314fd5.0",
53
+ "@wordpress/primitives": "^3.16.1-next.4d3b314fd5.0",
54
+ "@wordpress/rich-text": "^5.16.1-next.4d3b314fd5.0",
55
+ "@wordpress/warning": "^2.18.1-next.4d3b314fd5.0",
56
56
  "change-case": "^4.1.2",
57
57
  "classnames": "^2.3.1",
58
58
  "colord": "^2.7.0",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "f6021282457317c7e12dcc3a3f02c9ac28e16a30"
81
+ "gitHead": "25054766423cb49d959eb656c2533530073ff5c2"
82
82
  }
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { debounce } from 'lodash';
5
4
  import removeAccents from 'remove-accents';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
9
8
  */
9
+ import { debounce } from '@wordpress/compose';
10
10
  import { useLayoutEffect, useState } from '@wordpress/element';
11
11
 
12
12
  /**
@@ -35,7 +35,6 @@ export default function BoxUnitControl( {
35
35
  <UnitControl
36
36
  aria-label={ label }
37
37
  className="component-box-control__unit-control"
38
- hideHTMLArrows
39
38
  isFirst={ isFirst }
40
39
  isLast={ isLast }
41
40
  isOnly={ isOnly }
@@ -92,6 +92,12 @@ export function Button( props, ref ) {
92
92
  'components-button__description'
93
93
  );
94
94
 
95
+ const hasChildren =
96
+ children?.[ 0 ] &&
97
+ children[ 0 ] !== null &&
98
+ // Tooltip should not considered as a child
99
+ children?.[ 0 ]?.props?.className !== 'components-tooltip';
100
+
95
101
  const classes = classnames( 'components-button', className, {
96
102
  'is-secondary': variant === 'secondary',
97
103
  'is-primary': variant === 'primary',
@@ -101,7 +107,7 @@ export function Button( props, ref ) {
101
107
  'is-busy': isBusy,
102
108
  'is-link': variant === 'link',
103
109
  'is-destructive': isDestructive,
104
- 'has-text': !! icon && !! children,
110
+ 'has-text': !! icon && hasChildren,
105
111
  'has-icon': !! icon,
106
112
  } );
107
113
 
@@ -13,6 +13,7 @@ import { plusCircle } from '@wordpress/icons';
13
13
  * Internal dependencies
14
14
  */
15
15
  import Button from '../';
16
+ import { Tooltip } from '../../';
16
17
 
17
18
  jest.mock( '../../icon', () => () => <div data-testid="test-icon" /> );
18
19
 
@@ -75,6 +76,41 @@ describe( 'Button', () => {
75
76
  expect( screen.getByRole( 'button' ) ).toHaveClass( 'is-pressed' );
76
77
  } );
77
78
 
79
+ it( 'should render a button element with has-text when children are passed', async () => {
80
+ render( <Button icon={ plusCircle }>Children</Button> );
81
+ await screen.getByRole( 'button' ).focus();
82
+ expect( screen.getByRole( 'button' ) ).toHaveClass( 'has-text' );
83
+ } );
84
+
85
+ it( 'should render a button element without has-text when children are not passed', async () => {
86
+ render( <Button icon={ plusCircle }></Button> );
87
+ expect( screen.getByRole( 'button' ) ).not.toHaveClass(
88
+ 'has-text'
89
+ );
90
+ } );
91
+
92
+ it( 'should render a button element without has-text when children are empty fragment', async () => {
93
+ render(
94
+ <Button icon={ plusCircle }>
95
+ <></>
96
+ </Button>
97
+ );
98
+ expect( screen.getByRole( 'button' ) ).not.toHaveClass(
99
+ 'has-text'
100
+ );
101
+ } );
102
+
103
+ it( 'should render a button element without has-text when a button wrapped in Tooltip', async () => {
104
+ render(
105
+ <Tooltip text="Help text">
106
+ <Button icon={ plusCircle } />
107
+ </Tooltip>
108
+ );
109
+ expect( screen.getByRole( 'button' ) ).not.toHaveClass(
110
+ 'has-text'
111
+ );
112
+ } );
113
+
78
114
  it( 'should add a disabled prop to the button', () => {
79
115
  render( <Button disabled /> );
80
116