@wordpress/components 27.0.0 → 27.1.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 (208) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/build/base-control/index.native.js.map +1 -1
  3. package/build/border-box-control/border-box-control/component.js.map +1 -1
  4. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  5. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  6. package/build/button/index.js +2 -2
  7. package/build/button/index.js.map +1 -1
  8. package/build/button/index.native.js.map +1 -1
  9. package/build/confirm-dialog/component.js.map +1 -1
  10. package/build/custom-select-control-v2/default-component/index.js.map +1 -1
  11. package/build/custom-select-control-v2/index.js +2 -2
  12. package/build/custom-select-control-v2/index.js.map +1 -1
  13. package/build/custom-select-control-v2/types.js.map +1 -1
  14. package/build/draggable/index.native.js +2 -2
  15. package/build/draggable/index.native.js.map +1 -1
  16. package/build/dropdown-menu/index.native.js.map +1 -1
  17. package/build/flex/flex/hook.js +1 -1
  18. package/build/flex/flex/hook.js.map +1 -1
  19. package/build/font-size-picker/index.native.js.map +1 -1
  20. package/build/form-token-field/index.js.map +1 -1
  21. package/build/h-stack/hook.js +6 -1
  22. package/build/h-stack/hook.js.map +1 -1
  23. package/build/mobile/bottom-sheet/button.native.js.map +1 -1
  24. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  25. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  26. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  27. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  28. package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  29. package/build/mobile/gradient/index.native.js.map +1 -1
  30. package/build/mobile/image/index.native.js +4 -13
  31. package/build/mobile/image/index.native.js.map +1 -1
  32. package/build/mobile/media-edit/index.native.js.map +1 -1
  33. package/build/palette-edit/index.js.map +1 -1
  34. package/build/query-controls/index.native.js.map +1 -1
  35. package/build/range-control/index.js.map +1 -1
  36. package/build/search-control/index.native.js.map +1 -1
  37. package/build/snackbar/index.js +3 -2
  38. package/build/snackbar/index.js.map +1 -1
  39. package/build/snackbar/list.js +2 -1
  40. package/build/snackbar/list.js.map +1 -1
  41. package/build/snackbar/types.js.map +1 -1
  42. package/build/tabs/index.js +7 -7
  43. package/build/tabs/index.js.map +1 -1
  44. package/build/tabs/types.js.map +1 -1
  45. package/build/utils/hooks/index.js +0 -7
  46. package/build/utils/hooks/index.js.map +1 -1
  47. package/build-module/base-control/index.native.js.map +1 -1
  48. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  49. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  50. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  51. package/build-module/button/index.js +2 -2
  52. package/build-module/button/index.js.map +1 -1
  53. package/build-module/button/index.native.js.map +1 -1
  54. package/build-module/confirm-dialog/component.js.map +1 -1
  55. package/build-module/custom-select-control-v2/default-component/index.js.map +1 -1
  56. package/build-module/custom-select-control-v2/index.js +1 -1
  57. package/build-module/custom-select-control-v2/index.js.map +1 -1
  58. package/build-module/custom-select-control-v2/types.js.map +1 -1
  59. package/build-module/draggable/index.native.js +2 -2
  60. package/build-module/draggable/index.native.js.map +1 -1
  61. package/build-module/dropdown-menu/index.native.js.map +1 -1
  62. package/build-module/flex/flex/hook.js +1 -1
  63. package/build-module/flex/flex/hook.js.map +1 -1
  64. package/build-module/font-size-picker/index.native.js.map +1 -1
  65. package/build-module/form-token-field/index.js.map +1 -1
  66. package/build-module/h-stack/hook.js +6 -1
  67. package/build-module/h-stack/hook.js.map +1 -1
  68. package/build-module/mobile/bottom-sheet/button.native.js.map +1 -1
  69. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  70. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  71. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  72. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  73. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  74. package/build-module/mobile/gradient/index.native.js.map +1 -1
  75. package/build-module/mobile/image/index.native.js +6 -15
  76. package/build-module/mobile/image/index.native.js.map +1 -1
  77. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  78. package/build-module/palette-edit/index.js.map +1 -1
  79. package/build-module/query-controls/index.native.js.map +1 -1
  80. package/build-module/range-control/index.js.map +1 -1
  81. package/build-module/search-control/index.native.js.map +1 -1
  82. package/build-module/snackbar/index.js +3 -2
  83. package/build-module/snackbar/index.js.map +1 -1
  84. package/build-module/snackbar/list.js +2 -1
  85. package/build-module/snackbar/list.js.map +1 -1
  86. package/build-module/snackbar/types.js.map +1 -1
  87. package/build-module/tabs/index.js +7 -7
  88. package/build-module/tabs/index.js.map +1 -1
  89. package/build-module/tabs/types.js.map +1 -1
  90. package/build-module/utils/hooks/index.js +0 -1
  91. package/build-module/utils/hooks/index.js.map +1 -1
  92. package/build-style/style-rtl.css +8 -1
  93. package/build-style/style.css +8 -1
  94. package/build-types/custom-select-control-v2/default-component/index.d.ts +2 -1
  95. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  96. package/build-types/custom-select-control-v2/index.d.ts +1 -1
  97. package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
  98. package/build-types/custom-select-control-v2/legacy-component/test/index.d.ts +2 -0
  99. package/build-types/custom-select-control-v2/legacy-component/test/index.d.ts.map +1 -0
  100. package/build-types/custom-select-control-v2/stories/default.story.d.ts +4 -3
  101. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  102. package/build-types/custom-select-control-v2/stories/legacy.story.d.ts +2 -2
  103. package/build-types/custom-select-control-v2/stories/legacy.story.d.ts.map +1 -1
  104. package/build-types/custom-select-control-v2/types.d.ts +0 -1
  105. package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
  106. package/build-types/flex/flex/hook.d.ts +2 -3
  107. package/build-types/flex/flex/hook.d.ts.map +1 -1
  108. package/build-types/h-stack/hook.d.ts +2 -4
  109. package/build-types/h-stack/hook.d.ts.map +1 -1
  110. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
  111. package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
  112. package/build-types/snackbar/index.d.ts +5 -2
  113. package/build-types/snackbar/index.d.ts.map +1 -1
  114. package/build-types/snackbar/list.d.ts.map +1 -1
  115. package/build-types/snackbar/test/index.d.ts +2 -0
  116. package/build-types/snackbar/test/index.d.ts.map +1 -0
  117. package/build-types/snackbar/test/list.d.ts +2 -0
  118. package/build-types/snackbar/test/list.d.ts.map +1 -0
  119. package/build-types/snackbar/types.d.ts +18 -2
  120. package/build-types/snackbar/types.d.ts.map +1 -1
  121. package/build-types/tabs/index.d.ts +1 -1
  122. package/build-types/tabs/types.d.ts +1 -1
  123. package/build-types/utils/hooks/index.d.ts +0 -1
  124. package/build-types/v-stack/hook.d.ts +2 -4
  125. package/build-types/v-stack/hook.d.ts.map +1 -1
  126. package/package.json +19 -19
  127. package/src/base-control/index.native.js +1 -1
  128. package/src/base-control/test/index.tsx +1 -1
  129. package/src/border-box-control/border-box-control/component.tsx +1 -1
  130. package/src/border-box-control/border-box-control-split-controls/component.tsx +4 -4
  131. package/src/border-control/border-control-dropdown/component.tsx +1 -1
  132. package/src/button/index.native.js +1 -1
  133. package/src/button/index.tsx +1 -1
  134. package/src/button/style.scss +1 -3
  135. package/src/circular-option-picker/test/index.tsx +2 -4
  136. package/src/combobox-control/test/index.tsx +1 -1
  137. package/src/confirm-dialog/component.tsx +1 -1
  138. package/src/confirm-dialog/test/index.tsx +5 -21
  139. package/src/custom-select-control-v2/default-component/index.tsx +4 -1
  140. package/src/custom-select-control-v2/index.tsx +1 -1
  141. package/src/custom-select-control-v2/legacy-component/test/index.tsx +457 -0
  142. package/src/custom-select-control-v2/stories/legacy.story.tsx +5 -6
  143. package/src/custom-select-control-v2/test/index.tsx +279 -749
  144. package/src/custom-select-control-v2/types.ts +0 -1
  145. package/src/disabled/test/index.tsx +1 -1
  146. package/src/draggable/index.native.js +2 -2
  147. package/src/draggable/test/index.native.js +6 -2
  148. package/src/dropdown-menu/index.native.js +2 -2
  149. package/src/flex/flex/hook.ts +1 -1
  150. package/src/font-size-picker/index.native.js +2 -2
  151. package/src/form-token-field/index.tsx +1 -1
  152. package/src/h-stack/hook.tsx +2 -1
  153. package/src/h-stack/test/index.tsx +10 -0
  154. package/src/item-group/test/index.js +2 -2
  155. package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +10 -15
  156. package/src/mobile/bottom-sheet/button.native.js +1 -5
  157. package/src/mobile/bottom-sheet/index.native.js +2 -2
  158. package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
  159. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +2 -2
  160. package/src/mobile/bottom-sheet-select-control/index.native.js +1 -1
  161. package/src/mobile/bottom-sheet-text-control/index.native.js +1 -1
  162. package/src/mobile/gradient/index.native.js +1 -1
  163. package/src/mobile/image/index.native.js +8 -23
  164. package/src/mobile/media-edit/index.native.js +1 -1
  165. package/src/modal/test/index.tsx +1 -1
  166. package/src/navigation/stories/utils/hide-if-empty.tsx +2 -6
  167. package/src/palette-edit/index.tsx +2 -2
  168. package/src/popover/test/index.tsx +1 -4
  169. package/src/query-controls/index.native.js +2 -2
  170. package/src/radio-group/stories/index.story.tsx +1 -0
  171. package/src/range-control/index.tsx +3 -3
  172. package/src/range-control/test/index.tsx +2 -2
  173. package/src/search-control/index.native.js +1 -1
  174. package/src/snackbar/index.tsx +5 -2
  175. package/src/snackbar/list.tsx +6 -1
  176. package/src/snackbar/stories/list.story.tsx +0 -3
  177. package/src/snackbar/test/index.tsx +267 -0
  178. package/src/snackbar/test/list.tsx +46 -0
  179. package/src/snackbar/types.ts +31 -3
  180. package/src/tabs/README.md +18 -18
  181. package/src/tabs/index.tsx +7 -7
  182. package/src/tabs/stories/index.story.tsx +1 -1
  183. package/src/tabs/test/index.tsx +30 -30
  184. package/src/tabs/types.ts +1 -1
  185. package/src/toggle-group-control/test/index.tsx +1 -1
  186. package/src/tools-panel/stories/index.story.tsx +8 -8
  187. package/src/tools-panel/test/index.tsx +10 -28
  188. package/src/tooltip/style.scss +2 -1
  189. package/src/tooltip/test/index.native.js +3 -3
  190. package/src/tree-grid/test/index.tsx +1 -1
  191. package/src/utils/hooks/index.js +0 -1
  192. package/src/v-stack/test/index.tsx +10 -0
  193. package/tsconfig.tsbuildinfo +1 -1
  194. package/build/custom-select-control-v2/legacy-adapter.js +0 -29
  195. package/build/custom-select-control-v2/legacy-adapter.js.map +0 -1
  196. package/build/utils/hooks/use-latest-ref.js +0 -33
  197. package/build/utils/hooks/use-latest-ref.js.map +0 -1
  198. package/build-module/custom-select-control-v2/legacy-adapter.js +0 -21
  199. package/build-module/custom-select-control-v2/legacy-adapter.js.map +0 -1
  200. package/build-module/utils/hooks/use-latest-ref.js +0 -27
  201. package/build-module/utils/hooks/use-latest-ref.js.map +0 -1
  202. package/build-types/custom-select-control-v2/legacy-adapter.d.ts +0 -6
  203. package/build-types/custom-select-control-v2/legacy-adapter.d.ts.map +0 -1
  204. package/build-types/utils/hooks/use-latest-ref.d.ts +0 -15
  205. package/build-types/utils/hooks/use-latest-ref.d.ts.map +0 -1
  206. package/src/custom-select-control-v2/legacy-adapter.tsx +0 -25
  207. package/src/utils/hooks/test/use-latest-ref.js +0 -119
  208. package/src/utils/hooks/use-latest-ref.ts +0 -29
@@ -598,7 +598,7 @@ describe( 'Tabs', () => {
598
598
  } );
599
599
  } );
600
600
  describe( 'Uncontrolled mode', () => {
601
- describe( 'Without `initialTabId` prop', () => {
601
+ describe( 'Without `defaultTabId` prop', () => {
602
602
  it( 'should render first tab', async () => {
603
603
  render( <UncontrolledTabs tabs={ TABS } /> );
604
604
 
@@ -655,20 +655,20 @@ describe( 'Tabs', () => {
655
655
  } );
656
656
  } );
657
657
 
658
- describe( 'With `initialTabId`', () => {
659
- it( 'should render the tab set by `initialTabId` prop', async () => {
658
+ describe( 'With `defaultTabId`', () => {
659
+ it( 'should render the tab set by `defaultTabId` prop', async () => {
660
660
  render(
661
- <UncontrolledTabs tabs={ TABS } initialTabId="beta" />
661
+ <UncontrolledTabs tabs={ TABS } defaultTabId="beta" />
662
662
  );
663
663
 
664
664
  expect( await getSelectedTab() ).toHaveTextContent( 'Beta' );
665
665
  } );
666
666
 
667
- it( 'should not select a tab when `initialTabId` does not match any known tab', () => {
667
+ it( 'should not select a tab when `defaultTabId` does not match any known tab', () => {
668
668
  render(
669
669
  <UncontrolledTabs
670
670
  tabs={ TABS }
671
- initialTabId="does-not-exist"
671
+ defaultTabId="does-not-exist"
672
672
  />
673
673
  );
674
674
 
@@ -682,25 +682,25 @@ describe( 'Tabs', () => {
682
682
  screen.queryByRole( 'tabpanel' )
683
683
  ).not.toBeInTheDocument();
684
684
  } );
685
- it( 'should not change tabs when initialTabId is changed', async () => {
685
+ it( 'should not change tabs when defaultTabId is changed', async () => {
686
686
  const { rerender } = render(
687
- <UncontrolledTabs tabs={ TABS } initialTabId="beta" />
687
+ <UncontrolledTabs tabs={ TABS } defaultTabId="beta" />
688
688
  );
689
689
 
690
690
  rerender(
691
- <UncontrolledTabs tabs={ TABS } initialTabId="alpha" />
691
+ <UncontrolledTabs tabs={ TABS } defaultTabId="alpha" />
692
692
  );
693
693
 
694
694
  expect( await getSelectedTab() ).toHaveTextContent( 'Beta' );
695
695
  } );
696
696
 
697
- it( 'should fall back to the tab associated to `initialTabId` if the currently active tab is removed', async () => {
697
+ it( 'should fall back to the tab associated to `defaultTabId` if the currently active tab is removed', async () => {
698
698
  const mockOnSelect = jest.fn();
699
699
 
700
700
  const { rerender } = render(
701
701
  <UncontrolledTabs
702
702
  tabs={ TABS }
703
- initialTabId="gamma"
703
+ defaultTabId="gamma"
704
704
  onSelect={ mockOnSelect }
705
705
  />
706
706
  );
@@ -714,7 +714,7 @@ describe( 'Tabs', () => {
714
714
  rerender(
715
715
  <UncontrolledTabs
716
716
  tabs={ TABS.slice( 1 ) }
717
- initialTabId="gamma"
717
+ defaultTabId="gamma"
718
718
  onSelect={ mockOnSelect }
719
719
  />
720
720
  );
@@ -722,13 +722,13 @@ describe( 'Tabs', () => {
722
722
  expect( await getSelectedTab() ).toHaveTextContent( 'Gamma' );
723
723
  } );
724
724
 
725
- it( 'should fall back to the tab associated to `initialTabId` if the currently active tab becomes disabled', async () => {
725
+ it( 'should fall back to the tab associated to `defaultTabId` if the currently active tab becomes disabled', async () => {
726
726
  const mockOnSelect = jest.fn();
727
727
 
728
728
  const { rerender } = render(
729
729
  <UncontrolledTabs
730
730
  tabs={ TABS }
731
- initialTabId="gamma"
731
+ defaultTabId="gamma"
732
732
  onSelect={ mockOnSelect }
733
733
  />
734
734
  );
@@ -754,7 +754,7 @@ describe( 'Tabs', () => {
754
754
  rerender(
755
755
  <UncontrolledTabs
756
756
  tabs={ TABS_WITH_ALPHA_DISABLED }
757
- initialTabId="gamma"
757
+ defaultTabId="gamma"
758
758
  onSelect={ mockOnSelect }
759
759
  />
760
760
  );
@@ -762,9 +762,9 @@ describe( 'Tabs', () => {
762
762
  expect( await getSelectedTab() ).toHaveTextContent( 'Gamma' );
763
763
  } );
764
764
 
765
- it( 'should have no active tabs when the tab associated to `initialTabId` is removed while being the active tab', async () => {
765
+ it( 'should have no active tabs when the tab associated to `defaultTabId` is removed while being the active tab', async () => {
766
766
  const { rerender } = render(
767
- <UncontrolledTabs tabs={ TABS } initialTabId="gamma" />
767
+ <UncontrolledTabs tabs={ TABS } defaultTabId="gamma" />
768
768
  );
769
769
 
770
770
  expect( await getSelectedTab() ).toHaveTextContent( 'Gamma' );
@@ -773,7 +773,7 @@ describe( 'Tabs', () => {
773
773
  rerender(
774
774
  <UncontrolledTabs
775
775
  tabs={ TABS.slice( 0, 2 ) }
776
- initialTabId="gamma"
776
+ defaultTabId="gamma"
777
777
  />
778
778
  );
779
779
 
@@ -788,9 +788,9 @@ describe( 'Tabs', () => {
788
788
  ).not.toBeInTheDocument();
789
789
  } );
790
790
 
791
- it( 'waits for the tab with the `initialTabId` to be present in the `tabs` array before selecting it', async () => {
791
+ it( 'waits for the tab with the `defaultTabId` to be present in the `tabs` array before selecting it', async () => {
792
792
  const { rerender } = render(
793
- <UncontrolledTabs tabs={ TABS } initialTabId="delta" />
793
+ <UncontrolledTabs tabs={ TABS } defaultTabId="delta" />
794
794
  );
795
795
 
796
796
  // There should be no selected tab yet.
@@ -801,7 +801,7 @@ describe( 'Tabs', () => {
801
801
  rerender(
802
802
  <UncontrolledTabs
803
803
  tabs={ TABS_WITH_DELTA }
804
- initialTabId="delta"
804
+ defaultTabId="delta"
805
805
  />
806
806
  );
807
807
 
@@ -891,7 +891,7 @@ describe( 'Tabs', () => {
891
891
  expect( await getSelectedTab() ).toHaveTextContent( 'Beta' );
892
892
  } );
893
893
 
894
- it( 'should select first enabled tab when the tab associated to `initialTabId` is disabled', async () => {
894
+ it( 'should select first enabled tab when the tab associated to `defaultTabId` is disabled', async () => {
895
895
  const TABS_ONLY_GAMMA_ENABLED = TABS.map( ( tabObj ) =>
896
896
  tabObj.tabId !== 'gamma'
897
897
  ? {
@@ -906,7 +906,7 @@ describe( 'Tabs', () => {
906
906
  const { rerender } = render(
907
907
  <UncontrolledTabs
908
908
  tabs={ TABS_ONLY_GAMMA_ENABLED }
909
- initialTabId="beta"
909
+ defaultTabId="beta"
910
910
  />
911
911
  );
912
912
 
@@ -916,7 +916,7 @@ describe( 'Tabs', () => {
916
916
 
917
917
  // Re-enable all tabs
918
918
  rerender(
919
- <UncontrolledTabs tabs={ TABS } initialTabId="beta" />
919
+ <UncontrolledTabs tabs={ TABS } defaultTabId="beta" />
920
920
  );
921
921
 
922
922
  // Even if the initial tab becomes enabled again, the selected tab doesn't
@@ -968,14 +968,14 @@ describe( 'Tabs', () => {
968
968
  expect( mockOnSelect ).toHaveBeenLastCalledWith( 'beta' );
969
969
  } );
970
970
 
971
- it( 'should select the first enabled tab when the tab associated to `initialTabId` becomes disabled while being the active tab', async () => {
971
+ it( 'should select the first enabled tab when the tab associated to `defaultTabId` becomes disabled while being the active tab', async () => {
972
972
  const mockOnSelect = jest.fn();
973
973
 
974
974
  const { rerender } = render(
975
975
  <UncontrolledTabs
976
976
  tabs={ TABS }
977
977
  onSelect={ mockOnSelect }
978
- initialTabId="gamma"
978
+ defaultTabId="gamma"
979
979
  />
980
980
  );
981
981
 
@@ -998,7 +998,7 @@ describe( 'Tabs', () => {
998
998
  <UncontrolledTabs
999
999
  tabs={ TABS_WITH_GAMMA_DISABLED }
1000
1000
  onSelect={ mockOnSelect }
1001
- initialTabId="gamma"
1001
+ defaultTabId="gamma"
1002
1002
  />
1003
1003
  );
1004
1004
 
@@ -1011,7 +1011,7 @@ describe( 'Tabs', () => {
1011
1011
  <UncontrolledTabs
1012
1012
  tabs={ TABS }
1013
1013
  onSelect={ mockOnSelect }
1014
- initialTabId="gamma"
1014
+ defaultTabId="gamma"
1015
1015
  />
1016
1016
  );
1017
1017
 
@@ -1032,12 +1032,12 @@ describe( 'Tabs', () => {
1032
1032
  await screen.findByRole( 'tabpanel', { name: 'Beta' } )
1033
1033
  ).toBeInTheDocument();
1034
1034
  } );
1035
- it( 'should render the specified `selectedTabId`, and ignore the `initialTabId` prop', async () => {
1035
+ it( 'should render the specified `selectedTabId`, and ignore the `defaultTabId` prop', async () => {
1036
1036
  render(
1037
1037
  <ControlledTabs
1038
1038
  tabs={ TABS }
1039
1039
  selectedTabId="gamma"
1040
- initialTabId="beta"
1040
+ defaultTabId="beta"
1041
1041
  />
1042
1042
  );
1043
1043
 
package/src/tabs/types.ts CHANGED
@@ -43,7 +43,7 @@ export type TabsProps = {
43
43
  * Note: this prop will be overridden by the `selectedTabId` prop if it is
44
44
  * provided. (Controlled Mode)
45
45
  */
46
- initialTabId?: string;
46
+ defaultTabId?: string;
47
47
  /**
48
48
  * The function called when a tab has been selected.
49
49
  * It is passed the id of the newly selected tab as an argument.
@@ -71,7 +71,7 @@ const optionsWithTooltip = (
71
71
  value="gnocchi"
72
72
  label="Delicious Gnocchi"
73
73
  aria-label="Click for Delicious Gnocchi"
74
- showTooltip={ true }
74
+ showTooltip
75
75
  />
76
76
  <ToggleGroupControlOption
77
77
  value="caponata"
@@ -71,7 +71,7 @@ export const Default: StoryFn< typeof ToolsPanel > = ( {
71
71
  hasValue={ () => !! width }
72
72
  label="Width"
73
73
  onDeselect={ () => setWidth( undefined ) }
74
- isShownByDefault={ true }
74
+ isShownByDefault
75
75
  >
76
76
  <UnitControl
77
77
  label="Width"
@@ -83,7 +83,7 @@ export const Default: StoryFn< typeof ToolsPanel > = ( {
83
83
  hasValue={ () => !! height }
84
84
  label="Height"
85
85
  onDeselect={ () => setHeight( undefined ) }
86
- isShownByDefault={ true }
86
+ isShownByDefault
87
87
  >
88
88
  <UnitControl
89
89
  label="Height"
@@ -95,7 +95,7 @@ export const Default: StoryFn< typeof ToolsPanel > = ( {
95
95
  hasValue={ () => !! minHeight }
96
96
  label="Minimum height"
97
97
  onDeselect={ () => setMinHeight( undefined ) }
98
- isShownByDefault={ true }
98
+ isShownByDefault
99
99
  >
100
100
  <UnitControl
101
101
  label="Minimum height"
@@ -163,7 +163,7 @@ export const WithNonToolsPanelItems: StoryFn< typeof ToolsPanel > = ( {
163
163
  hasValue={ () => !! width }
164
164
  label="Width"
165
165
  onDeselect={ () => setWidth( undefined ) }
166
- isShownByDefault={ true }
166
+ isShownByDefault
167
167
  >
168
168
  <UnitControl
169
169
  label="Width"
@@ -175,7 +175,7 @@ export const WithNonToolsPanelItems: StoryFn< typeof ToolsPanel > = ( {
175
175
  hasValue={ () => !! height }
176
176
  label="Height"
177
177
  onDeselect={ () => setHeight( undefined ) }
178
- isShownByDefault={ true }
178
+ isShownByDefault
179
179
  >
180
180
  <UnitControl
181
181
  label="Height"
@@ -437,7 +437,7 @@ export const WithConditionalDefaultControl: StoryFn< typeof ToolsPanel > = ( {
437
437
  onDeselect={ () => updateAttribute( 'height', undefined ) }
438
438
  resetAllFilter={ () => ( { height: undefined } ) }
439
439
  panelId={ panelId }
440
- isShownByDefault={ true }
440
+ isShownByDefault
441
441
  >
442
442
  <UnitControl
443
443
  label="Injected Height"
@@ -536,7 +536,7 @@ export const WithConditionallyRenderedControl: StoryFn<
536
536
  } }
537
537
  resetAllFilter={ () => ( { height: undefined } ) }
538
538
  panelId={ panelId }
539
- isShownByDefault={ true }
539
+ isShownByDefault
540
540
  >
541
541
  <UnitControl
542
542
  label="Injected Height"
@@ -555,7 +555,7 @@ export const WithConditionallyRenderedControl: StoryFn<
555
555
  }
556
556
  resetAllFilter={ () => ( { scale: undefined } ) }
557
557
  panelId={ panelId }
558
- isShownByDefault={ true }
558
+ isShownByDefault
559
559
  >
560
560
  <ToggleGroupControl
561
561
  __nextHasNoMarginBottom
@@ -222,10 +222,7 @@ describe( 'ToolsPanel', () => {
222
222
  <ToolsPanelItem { ...controlProps }>
223
223
  <div>Example control</div>
224
224
  </ToolsPanelItem>
225
- <ToolsPanelItem
226
- { ...altControlProps }
227
- isShownByDefault={ true }
228
- >
225
+ <ToolsPanelItem { ...altControlProps } isShownByDefault>
229
226
  <div>Alt control</div>
230
227
  </ToolsPanelItem>
231
228
  </ToolsPanel>
@@ -413,10 +410,7 @@ describe( 'ToolsPanel', () => {
413
410
  it( 'should continue to render shown by default item after it is toggled off via menu item', async () => {
414
411
  render(
415
412
  <ToolsPanel { ...defaultProps }>
416
- <ToolsPanelItem
417
- { ...controlProps }
418
- isShownByDefault={ true }
419
- >
413
+ <ToolsPanelItem { ...controlProps } isShownByDefault>
420
414
  <div>Default control</div>
421
415
  </ToolsPanelItem>
422
416
  </ToolsPanel>
@@ -440,10 +434,7 @@ describe( 'ToolsPanel', () => {
440
434
  it( 'should render appropriate menu groups', async () => {
441
435
  render(
442
436
  <ToolsPanel { ...defaultProps }>
443
- <ToolsPanelItem
444
- { ...controlProps }
445
- isShownByDefault={ true }
446
- >
437
+ <ToolsPanelItem { ...controlProps } isShownByDefault>
447
438
  <div>Default control</div>
448
439
  </ToolsPanelItem>
449
440
  <ToolsPanelItem { ...altControlProps }>
@@ -461,10 +452,7 @@ describe( 'ToolsPanel', () => {
461
452
 
462
453
  it( 'should not render contents of items when in placeholder state', () => {
463
454
  render(
464
- <ToolsPanel
465
- { ...defaultProps }
466
- shouldRenderPlaceholderItems={ true }
467
- >
455
+ <ToolsPanel { ...defaultProps } shouldRenderPlaceholderItems>
468
456
  <ToolsPanelItem { ...altControlProps }>
469
457
  <div>Optional control</div>
470
458
  </ToolsPanelItem>
@@ -493,10 +481,7 @@ describe( 'ToolsPanel', () => {
493
481
 
494
482
  const TestPanel = () => (
495
483
  <ToolsPanel { ...defaultProps }>
496
- <ToolsPanelItem
497
- { ...altControlProps }
498
- isShownByDefault={ true }
499
- >
484
+ <ToolsPanelItem { ...altControlProps } isShownByDefault>
500
485
  <div>Default control</div>
501
486
  </ToolsPanelItem>
502
487
  <ToolsPanelItem
@@ -568,16 +553,13 @@ describe( 'ToolsPanel', () => {
568
553
 
569
554
  const TestPanel = () => (
570
555
  <ToolsPanel { ...defaultProps }>
571
- <ToolsPanelItem
572
- { ...altControlProps }
573
- isShownByDefault={ true }
574
- >
556
+ <ToolsPanelItem { ...altControlProps } isShownByDefault>
575
557
  <div>Default control</div>
576
558
  </ToolsPanelItem>
577
559
  { !! altControlValue && (
578
560
  <ToolsPanelItem
579
561
  { ...conditionalControlProps }
580
- isShownByDefault={ true }
562
+ isShownByDefault
581
563
  >
582
564
  <div>Conditional control</div>
583
565
  </ToolsPanelItem>
@@ -1340,7 +1322,7 @@ describe( 'ToolsPanel', () => {
1340
1322
  { ...altControlProps }
1341
1323
  label="Item 3"
1342
1324
  data-testid="item-3"
1343
- isShownByDefault={ true }
1325
+ isShownByDefault
1344
1326
  >
1345
1327
  <div>Item 3</div>
1346
1328
  </ToolsPanelItem>
@@ -1352,8 +1334,8 @@ describe( 'ToolsPanel', () => {
1352
1334
  </ToolsPanelItems>
1353
1335
  <ToolsPanel
1354
1336
  { ...defaultProps }
1355
- hasInnerWrapper={ true }
1356
- shouldRenderPlaceholderItems={ true }
1337
+ hasInnerWrapper
1338
+ shouldRenderPlaceholderItems
1357
1339
  __experimentalFirstVisibleItemClass="first"
1358
1340
  __experimentalLastVisibleItemClass="last"
1359
1341
  >
@@ -1,5 +1,6 @@
1
1
  .components-tooltip {
2
- background: $black; // TODO: Discuss with designers.
2
+ background: $black;
3
+ font-family: $default-font;
3
4
  border-radius: $radius-block-ui;
4
5
  color: $gray-100;
5
6
  text-align: center;
@@ -44,7 +44,7 @@ afterAll( () => {
44
44
  it( 'displays the message', () => {
45
45
  const screen = render(
46
46
  <TooltipSlot>
47
- <Tooltip visible={ true } text="A helpful message">
47
+ <Tooltip visible text="A helpful message">
48
48
  <Text>I need help</Text>
49
49
  </Tooltip>
50
50
  </TooltipSlot>
@@ -56,7 +56,7 @@ it( 'displays the message', () => {
56
56
  it( 'dismisses when the screen is tapped', () => {
57
57
  const screen = render(
58
58
  <TooltipSlot>
59
- <Tooltip visible={ true } text="A helpful message">
59
+ <Tooltip visible text="A helpful message">
60
60
  <Text>I need help</Text>
61
61
  </Tooltip>
62
62
  </TooltipSlot>
@@ -72,7 +72,7 @@ it( 'dismisses when the screen is tapped', () => {
72
72
  it( 'dismisses when the keyboard closes', () => {
73
73
  const screen = render(
74
74
  <TooltipSlot>
75
- <Tooltip visible={ true } text="A helpful message">
75
+ <Tooltip visible text="A helpful message">
76
76
  <Text>I need help</Text>
77
77
  </Tooltip>
78
78
  </TooltipSlot>
@@ -123,7 +123,7 @@ describe( 'TreeGrid', () => {
123
123
  level={ 1 }
124
124
  positionInSet={ 1 }
125
125
  setSize={ 3 }
126
- isExpanded={ true }
126
+ isExpanded
127
127
  >
128
128
  <TreeGridCell withoutGridItem>
129
129
  <TestButton aria-expanded="true">Row 1</TestButton>
@@ -2,4 +2,3 @@ export { default as useControlledState } from './use-controlled-state';
2
2
  export { default as useUpdateEffect } from './use-update-effect';
3
3
  export { useControlledValue } from './use-controlled-value';
4
4
  export { useCx } from './use-cx';
5
- export { useLatestRef } from './use-latest-ref';
@@ -39,4 +39,14 @@ describe( 'props', () => {
39
39
  );
40
40
  expect( container ).toMatchSnapshot();
41
41
  } );
42
+
43
+ test( 'should not pass through invalid props to the `as` component', () => {
44
+ const AsComponent = ( props: JSX.IntrinsicElements[ 'div' ] ) => {
45
+ return <div { ...props } />;
46
+ };
47
+
48
+ render( <VStack as={ AsComponent }>foobar</VStack> );
49
+
50
+ expect( console ).not.toHaveErrored();
51
+ } );
42
52
  } );