@westpac/ui 0.31.0 → 0.32.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 (268) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/component-type.json +1 -1
  3. package/dist/components/accordion/components/accordion-item/accordion-item.styles.js +1 -1
  4. package/dist/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.styles.js +4 -4
  5. package/dist/components/circle/circle.styles.d.ts +2 -2
  6. package/dist/components/circle/circle.styles.js +1 -1
  7. package/dist/components/flexi-cell/components/flexi-cell-circle/flexi-cell-circle.styles.js +1 -1
  8. package/dist/components/header/header.styles.js +1 -1
  9. package/dist/components/icon/icon.styles.js +5 -5
  10. package/dist/components/list/components/list-item/list-item.styles.js +3 -3
  11. package/dist/components/pictogram/components/decorative/wbc-bank-card-pictogram.js +1 -1
  12. package/dist/components/pictogram/components/informative/accessibility-pictogram.js +1 -1
  13. package/dist/components/pictogram/components/informative/accounts-pictogram.js +1 -1
  14. package/dist/components/pictogram/components/informative/aeroplane-pictogram.js +1 -1
  15. package/dist/components/pictogram/components/informative/arrow-down-pictogram.js +1 -1
  16. package/dist/components/pictogram/components/informative/arrow-left-pictogram.js +1 -1
  17. package/dist/components/pictogram/components/informative/arrow-right-pictogram.js +1 -1
  18. package/dist/components/pictogram/components/informative/arrow-up-pictogram.js +1 -1
  19. package/dist/components/pictogram/components/informative/arrows-passing-pictogram.js +1 -1
  20. package/dist/components/pictogram/components/informative/atm-pictogram.js +1 -1
  21. package/dist/components/pictogram/components/informative/australia-pictogram.js +1 -1
  22. package/dist/components/pictogram/components/informative/bank-card-locked-pictogram.js +1 -1
  23. package/dist/components/pictogram/components/informative/bank-card-pictogram.js +1 -1
  24. package/dist/components/pictogram/components/informative/bank-pictogram.js +1 -1
  25. package/dist/components/pictogram/components/informative/birth-certificate-pictogram.js +1 -1
  26. package/dist/components/pictogram/components/informative/building-pictogram.js +1 -1
  27. package/dist/components/pictogram/components/informative/buoy-pictogram.js +1 -1
  28. package/dist/components/pictogram/components/informative/bus-pictogram.js +1 -1
  29. package/dist/components/pictogram/components/informative/business-person-pictogram.js +1 -1
  30. package/dist/components/pictogram/components/informative/calculator-pictogram.js +1 -1
  31. package/dist/components/pictogram/components/informative/calendar-pictogram.js +1 -1
  32. package/dist/components/pictogram/components/informative/car-pictogram.js +1 -1
  33. package/dist/components/pictogram/components/informative/cash-pictogram.js +1 -1
  34. package/dist/components/pictogram/components/informative/celebration-pictogram.js +1 -1
  35. package/dist/components/pictogram/components/informative/chat-pictogram.js +1 -1
  36. package/dist/components/pictogram/components/informative/clock-pictogram.js +1 -1
  37. package/dist/components/pictogram/components/informative/coffee-pictogram.js +1 -1
  38. package/dist/components/pictogram/components/informative/coins-pictogram.js +1 -1
  39. package/dist/components/pictogram/components/informative/compass-pictogram.js +1 -1
  40. package/dist/components/pictogram/components/informative/customer-profile-pictogram.js +1 -1
  41. package/dist/components/pictogram/components/informative/desktop-computer-pictogram.js +1 -1
  42. package/dist/components/pictogram/components/informative/document-and-pen-pictogram.js +1 -1
  43. package/dist/components/pictogram/components/informative/dollar-sign-pictogram.js +1 -1
  44. package/dist/components/pictogram/components/informative/drivers-licence-pictogram.js +1 -1
  45. package/dist/components/pictogram/components/informative/education-pictogram.js +1 -1
  46. package/dist/components/pictogram/components/informative/eftpos-pictogram.js +1 -1
  47. package/dist/components/pictogram/components/informative/envelope-email-pictogram.js +1 -1
  48. package/dist/components/pictogram/components/informative/envelope-printed-pictogram.js +1 -1
  49. package/dist/components/pictogram/components/informative/face-happy-pictogram.js +1 -1
  50. package/dist/components/pictogram/components/informative/face-unhappy-pictogram.js +1 -1
  51. package/dist/components/pictogram/components/informative/face-unsure-pictogram.js +1 -1
  52. package/dist/components/pictogram/components/informative/finger-motion-pictogram.js +1 -1
  53. package/dist/components/pictogram/components/informative/fingerprint-pictogram.js +1 -1
  54. package/dist/components/pictogram/components/informative/football-pictogram.js +1 -1
  55. package/dist/components/pictogram/components/informative/fork-knife-pictogram.js +1 -1
  56. package/dist/components/pictogram/components/informative/generic-document-pictogram.js +1 -1
  57. package/dist/components/pictogram/components/informative/gift-pictogram.js +1 -1
  58. package/dist/components/pictogram/components/informative/globe-australia-pictogram.js +1 -1
  59. package/dist/components/pictogram/components/informative/globe-pictogram.js +1 -1
  60. package/dist/components/pictogram/components/informative/graph-decreasing-pictogram.js +1 -1
  61. package/dist/components/pictogram/components/informative/graph-increasing-pictogram.js +1 -1
  62. package/dist/components/pictogram/components/informative/gym-pictogram.js +1 -1
  63. package/dist/components/pictogram/components/informative/headset-pictogram.js +1 -1
  64. package/dist/components/pictogram/components/informative/heart-pictogram.js +1 -1
  65. package/dist/components/pictogram/components/informative/house-pictogram.js +1 -1
  66. package/dist/components/pictogram/components/informative/light-bulb-pictogram.js +1 -1
  67. package/dist/components/pictogram/components/informative/loop-pictogram.js +1 -1
  68. package/dist/components/pictogram/components/informative/medicare-card-pictogram.js +1 -1
  69. package/dist/components/pictogram/components/informative/mobile-device-pictogram.js +1 -1
  70. package/dist/components/pictogram/components/informative/money-in-pictogram.js +1 -1
  71. package/dist/components/pictogram/components/informative/money-out-pictogram.js +1 -1
  72. package/dist/components/pictogram/components/informative/movie-tickets-pictogram.js +1 -1
  73. package/dist/components/pictogram/components/informative/nest-egg-pictogram.js +1 -1
  74. package/dist/components/pictogram/components/informative/noodles-pictogram.js +1 -1
  75. package/dist/components/pictogram/components/informative/number-1-pictogram.js +1 -1
  76. package/dist/components/pictogram/components/informative/number-2-pictogram.js +1 -1
  77. package/dist/components/pictogram/components/informative/number-3-pictogram.js +1 -1
  78. package/dist/components/pictogram/components/informative/number-4-pictogram.js +1 -1
  79. package/dist/components/pictogram/components/informative/number-5-pictogram.js +1 -1
  80. package/dist/components/pictogram/components/informative/padlock-locked-pictogram.js +1 -1
  81. package/dist/components/pictogram/components/informative/padlock-unlocked-pictogram.js +1 -1
  82. package/dist/components/pictogram/components/informative/passport-pictogram.js +1 -1
  83. package/dist/components/pictogram/components/informative/percent-sign-pictogram.js +1 -1
  84. package/dist/components/pictogram/components/informative/person-pictogram.js +1 -1
  85. package/dist/components/pictogram/components/informative/piggy-bank-pictogram.js +1 -1
  86. package/dist/components/pictogram/components/informative/pizza-pictogram.js +1 -1
  87. package/dist/components/pictogram/components/informative/plant-pictogram.js +1 -1
  88. package/dist/components/pictogram/components/informative/search-pictogram.js +1 -1
  89. package/dist/components/pictogram/components/informative/secure-pictogram.js +1 -1
  90. package/dist/components/pictogram/components/informative/shop-pictogram.js +1 -1
  91. package/dist/components/pictogram/components/informative/shopping-pictogram.js +1 -1
  92. package/dist/components/pictogram/components/informative/sparkle-pictogram.js +1 -1
  93. package/dist/components/pictogram/components/informative/star-pictogram.js +1 -1
  94. package/dist/components/pictogram/components/informative/stopwatch-pictogram.js +1 -1
  95. package/dist/components/pictogram/components/informative/target-pictogram.js +1 -1
  96. package/dist/components/pictogram/components/informative/tax-document-pictogram.js +1 -1
  97. package/dist/components/pictogram/components/informative/telephone-call-pictogram.js +1 -1
  98. package/dist/components/pictogram/components/informative/thumbs-up-pictogram.js +1 -1
  99. package/dist/components/pictogram/components/informative/tick-pictogram.js +1 -1
  100. package/dist/components/pictogram/components/informative/tools-pictogram.js +1 -1
  101. package/dist/components/pictogram/components/informative/tractor-pictogram.js +1 -1
  102. package/dist/components/pictogram/components/informative/truck-pictogram.js +1 -1
  103. package/dist/components/pictogram/components/informative/umbrella-pictogram.js +1 -1
  104. package/dist/components/pictogram/components/informative/unsecure-pictogram.js +1 -1
  105. package/dist/components/pictogram/components/informative/wallet-pictogram.js +1 -1
  106. package/dist/components/pictogram/components/informative/wearables-pictogram.js +1 -1
  107. package/dist/components/popover/components/panel/panel.component.d.ts +2 -1
  108. package/dist/components/popover/components/panel/panel.component.js +42 -40
  109. package/dist/components/popover/components/panel/panel.hook.d.ts +39 -0
  110. package/dist/components/popover/components/panel/panel.hook.js +83 -0
  111. package/dist/components/popover/components/panel/panel.styles.js +9 -6
  112. package/dist/components/popover/components/panel/panel.types.d.ts +4 -0
  113. package/dist/components/popover/popover.component.d.ts +1 -1
  114. package/dist/components/popover/popover.component.js +4 -3
  115. package/dist/components/popover/popover.types.d.ts +7 -0
  116. package/dist/components/progress-indicator/progress-indicator.styles.js +5 -5
  117. package/dist/components/progress-rope/components/progress-rope-group-step/progress-rope-group-step.styles.js +1 -1
  118. package/dist/components/progress-rope/components/progress-rope-step/progress-rope-step.styles.js +2 -2
  119. package/dist/components/radio-group/components/radio-group-radio/radio-group-radio.styles.js +4 -4
  120. package/dist/components/switch/switch.styles.js +4 -4
  121. package/dist/components/symbol/components/logos/red-avatar-circle-logo.js +1 -1
  122. package/dist/components/symbol/components/logos/red-avatar-circle-reversed-logo.js +1 -1
  123. package/dist/components/symbol/components/symbols/facebook-symbol.js +1 -1
  124. package/dist/components/symbol/components/symbols/google-plus-symbol.js +1 -1
  125. package/dist/components/symbol/components/symbols/instagram-symbol.js +1 -1
  126. package/dist/components/symbol/components/symbols/linked-in-symbol.js +1 -1
  127. package/dist/components/symbol/components/symbols/slack-symbol.js +1 -1
  128. package/dist/components/symbol/components/symbols/twitter-symbol.js +1 -1
  129. package/dist/components/symbol/components/symbols/x-mark-inverse-symbol.js +1 -1
  130. package/dist/components/symbol/components/symbols/x-mark-symbol.js +1 -1
  131. package/dist/components/symbol/components/symbols/x-symbol.js +1 -1
  132. package/dist/components/symbol/components/symbols/yammer-symbol.js +1 -1
  133. package/dist/components/symbol/components/symbols/youtube-symbol.js +1 -1
  134. package/dist/components/textarea/textarea.styles.js +4 -4
  135. package/dist/css/westpac-ui.css +519 -515
  136. package/dist/css/westpac-ui.min.css +519 -515
  137. package/package.json +3 -3
  138. package/src/components/accordion/components/accordion-item/accordion-item.styles.ts +1 -1
  139. package/src/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.styles.ts +4 -4
  140. package/src/components/circle/circle.styles.ts +1 -1
  141. package/src/components/flexi-cell/components/flexi-cell-circle/flexi-cell-circle.styles.ts +1 -1
  142. package/src/components/header/header.styles.ts +1 -1
  143. package/src/components/icon/icon.styles.ts +5 -5
  144. package/src/components/list/components/list-item/list-item.styles.ts +3 -3
  145. package/src/components/pictogram/components/decorative/wbc-bank-card-pictogram.tsx +1 -1
  146. package/src/components/pictogram/components/informative/accessibility-pictogram.tsx +1 -1
  147. package/src/components/pictogram/components/informative/accounts-pictogram.tsx +1 -1
  148. package/src/components/pictogram/components/informative/aeroplane-pictogram.tsx +1 -1
  149. package/src/components/pictogram/components/informative/arrow-down-pictogram.tsx +1 -1
  150. package/src/components/pictogram/components/informative/arrow-left-pictogram.tsx +1 -1
  151. package/src/components/pictogram/components/informative/arrow-right-pictogram.tsx +1 -1
  152. package/src/components/pictogram/components/informative/arrow-up-pictogram.tsx +1 -1
  153. package/src/components/pictogram/components/informative/arrows-passing-pictogram.tsx +1 -1
  154. package/src/components/pictogram/components/informative/atm-pictogram.tsx +1 -1
  155. package/src/components/pictogram/components/informative/australia-pictogram.tsx +1 -1
  156. package/src/components/pictogram/components/informative/bank-card-locked-pictogram.tsx +1 -1
  157. package/src/components/pictogram/components/informative/bank-card-pictogram.tsx +1 -1
  158. package/src/components/pictogram/components/informative/bank-pictogram.tsx +1 -1
  159. package/src/components/pictogram/components/informative/birth-certificate-pictogram.tsx +1 -1
  160. package/src/components/pictogram/components/informative/building-pictogram.tsx +1 -1
  161. package/src/components/pictogram/components/informative/buoy-pictogram.tsx +1 -1
  162. package/src/components/pictogram/components/informative/bus-pictogram.tsx +1 -1
  163. package/src/components/pictogram/components/informative/business-person-pictogram.tsx +1 -1
  164. package/src/components/pictogram/components/informative/calculator-pictogram.tsx +1 -1
  165. package/src/components/pictogram/components/informative/calendar-pictogram.tsx +1 -1
  166. package/src/components/pictogram/components/informative/car-pictogram.tsx +1 -1
  167. package/src/components/pictogram/components/informative/cash-pictogram.tsx +1 -1
  168. package/src/components/pictogram/components/informative/celebration-pictogram.tsx +1 -1
  169. package/src/components/pictogram/components/informative/chat-pictogram.tsx +1 -1
  170. package/src/components/pictogram/components/informative/clock-pictogram.tsx +1 -1
  171. package/src/components/pictogram/components/informative/coffee-pictogram.tsx +1 -1
  172. package/src/components/pictogram/components/informative/coins-pictogram.tsx +1 -1
  173. package/src/components/pictogram/components/informative/compass-pictogram.tsx +1 -1
  174. package/src/components/pictogram/components/informative/customer-profile-pictogram.tsx +1 -1
  175. package/src/components/pictogram/components/informative/desktop-computer-pictogram.tsx +1 -1
  176. package/src/components/pictogram/components/informative/document-and-pen-pictogram.tsx +1 -1
  177. package/src/components/pictogram/components/informative/dollar-sign-pictogram.tsx +1 -1
  178. package/src/components/pictogram/components/informative/drivers-licence-pictogram.tsx +1 -1
  179. package/src/components/pictogram/components/informative/education-pictogram.tsx +1 -1
  180. package/src/components/pictogram/components/informative/eftpos-pictogram.tsx +1 -1
  181. package/src/components/pictogram/components/informative/envelope-email-pictogram.tsx +1 -1
  182. package/src/components/pictogram/components/informative/envelope-printed-pictogram.tsx +1 -1
  183. package/src/components/pictogram/components/informative/face-happy-pictogram.tsx +1 -1
  184. package/src/components/pictogram/components/informative/face-unhappy-pictogram.tsx +1 -1
  185. package/src/components/pictogram/components/informative/face-unsure-pictogram.tsx +1 -1
  186. package/src/components/pictogram/components/informative/finger-motion-pictogram.tsx +1 -1
  187. package/src/components/pictogram/components/informative/fingerprint-pictogram.tsx +1 -1
  188. package/src/components/pictogram/components/informative/football-pictogram.tsx +1 -1
  189. package/src/components/pictogram/components/informative/fork-knife-pictogram.tsx +1 -1
  190. package/src/components/pictogram/components/informative/generic-document-pictogram.tsx +1 -1
  191. package/src/components/pictogram/components/informative/gift-pictogram.tsx +1 -1
  192. package/src/components/pictogram/components/informative/globe-australia-pictogram.tsx +1 -1
  193. package/src/components/pictogram/components/informative/globe-pictogram.tsx +1 -1
  194. package/src/components/pictogram/components/informative/graph-decreasing-pictogram.tsx +1 -1
  195. package/src/components/pictogram/components/informative/graph-increasing-pictogram.tsx +1 -1
  196. package/src/components/pictogram/components/informative/gym-pictogram.tsx +1 -1
  197. package/src/components/pictogram/components/informative/headset-pictogram.tsx +1 -1
  198. package/src/components/pictogram/components/informative/heart-pictogram.tsx +1 -1
  199. package/src/components/pictogram/components/informative/house-pictogram.tsx +1 -1
  200. package/src/components/pictogram/components/informative/light-bulb-pictogram.tsx +1 -1
  201. package/src/components/pictogram/components/informative/loop-pictogram.tsx +1 -1
  202. package/src/components/pictogram/components/informative/medicare-card-pictogram.tsx +1 -1
  203. package/src/components/pictogram/components/informative/mobile-device-pictogram.tsx +1 -1
  204. package/src/components/pictogram/components/informative/money-in-pictogram.tsx +1 -1
  205. package/src/components/pictogram/components/informative/money-out-pictogram.tsx +1 -1
  206. package/src/components/pictogram/components/informative/movie-tickets-pictogram.tsx +1 -1
  207. package/src/components/pictogram/components/informative/nest-egg-pictogram.tsx +1 -1
  208. package/src/components/pictogram/components/informative/noodles-pictogram.tsx +1 -1
  209. package/src/components/pictogram/components/informative/number-1-pictogram.tsx +1 -1
  210. package/src/components/pictogram/components/informative/number-2-pictogram.tsx +1 -1
  211. package/src/components/pictogram/components/informative/number-3-pictogram.tsx +1 -1
  212. package/src/components/pictogram/components/informative/number-4-pictogram.tsx +1 -1
  213. package/src/components/pictogram/components/informative/number-5-pictogram.tsx +1 -1
  214. package/src/components/pictogram/components/informative/padlock-locked-pictogram.tsx +1 -1
  215. package/src/components/pictogram/components/informative/padlock-unlocked-pictogram.tsx +1 -1
  216. package/src/components/pictogram/components/informative/passport-pictogram.tsx +1 -1
  217. package/src/components/pictogram/components/informative/percent-sign-pictogram.tsx +1 -1
  218. package/src/components/pictogram/components/informative/person-pictogram.tsx +1 -1
  219. package/src/components/pictogram/components/informative/piggy-bank-pictogram.tsx +1 -1
  220. package/src/components/pictogram/components/informative/pizza-pictogram.tsx +1 -1
  221. package/src/components/pictogram/components/informative/plant-pictogram.tsx +1 -1
  222. package/src/components/pictogram/components/informative/search-pictogram.tsx +1 -1
  223. package/src/components/pictogram/components/informative/secure-pictogram.tsx +1 -1
  224. package/src/components/pictogram/components/informative/shop-pictogram.tsx +1 -1
  225. package/src/components/pictogram/components/informative/shopping-pictogram.tsx +1 -1
  226. package/src/components/pictogram/components/informative/sparkle-pictogram.tsx +1 -1
  227. package/src/components/pictogram/components/informative/star-pictogram.tsx +1 -1
  228. package/src/components/pictogram/components/informative/stopwatch-pictogram.tsx +1 -1
  229. package/src/components/pictogram/components/informative/target-pictogram.tsx +1 -1
  230. package/src/components/pictogram/components/informative/tax-document-pictogram.tsx +1 -1
  231. package/src/components/pictogram/components/informative/telephone-call-pictogram.tsx +1 -1
  232. package/src/components/pictogram/components/informative/thumbs-up-pictogram.tsx +1 -1
  233. package/src/components/pictogram/components/informative/tick-pictogram.tsx +1 -1
  234. package/src/components/pictogram/components/informative/tools-pictogram.tsx +1 -1
  235. package/src/components/pictogram/components/informative/tractor-pictogram.tsx +1 -1
  236. package/src/components/pictogram/components/informative/truck-pictogram.tsx +1 -1
  237. package/src/components/pictogram/components/informative/umbrella-pictogram.tsx +1 -1
  238. package/src/components/pictogram/components/informative/unsecure-pictogram.tsx +1 -1
  239. package/src/components/pictogram/components/informative/wallet-pictogram.tsx +1 -1
  240. package/src/components/pictogram/components/informative/wearables-pictogram.tsx +1 -1
  241. package/src/components/popover/components/panel/panel.component.tsx +34 -45
  242. package/src/components/popover/components/panel/panel.hook.tsx +113 -0
  243. package/src/components/popover/components/panel/panel.styles.ts +9 -7
  244. package/src/components/popover/components/panel/panel.types.ts +4 -0
  245. package/src/components/popover/popover.component.tsx +10 -4
  246. package/src/components/popover/popover.types.ts +8 -0
  247. package/src/components/progress-indicator/progress-indicator.styles.ts +5 -5
  248. package/src/components/progress-rope/components/progress-rope-group-step/progress-rope-group-step.styles.ts +1 -1
  249. package/src/components/progress-rope/components/progress-rope-step/progress-rope-step.styles.ts +2 -2
  250. package/src/components/radio-group/components/radio-group-radio/radio-group-radio.styles.ts +4 -4
  251. package/src/components/switch/switch.styles.ts +4 -4
  252. package/src/components/symbol/components/logos/red-avatar-circle-logo.tsx +1 -1
  253. package/src/components/symbol/components/logos/red-avatar-circle-reversed-logo.tsx +1 -1
  254. package/src/components/symbol/components/symbols/facebook-symbol.tsx +1 -1
  255. package/src/components/symbol/components/symbols/google-plus-symbol.tsx +1 -1
  256. package/src/components/symbol/components/symbols/instagram-symbol.tsx +1 -1
  257. package/src/components/symbol/components/symbols/linked-in-symbol.tsx +1 -1
  258. package/src/components/symbol/components/symbols/slack-symbol.tsx +1 -1
  259. package/src/components/symbol/components/symbols/twitter-symbol.tsx +1 -1
  260. package/src/components/symbol/components/symbols/x-mark-inverse-symbol.tsx +1 -1
  261. package/src/components/symbol/components/symbols/x-mark-symbol.tsx +1 -1
  262. package/src/components/symbol/components/symbols/x-symbol.tsx +1 -1
  263. package/src/components/symbol/components/symbols/yammer-symbol.tsx +1 -1
  264. package/src/components/symbol/components/symbols/youtube-symbol.tsx +1 -1
  265. package/src/components/textarea/textarea.styles.ts +4 -4
  266. package/dist/components/popover/popover.utils.d.ts +0 -3
  267. package/dist/components/popover/popover.utils.js +0 -37
  268. package/src/components/popover/popover.utils.tsx +0 -59
@@ -18,7 +18,7 @@ export function GraphDecreasingPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function GraphIncreasingPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function GymPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function HeadsetPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function HeartPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function HousePictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function LightBulbPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function LoopPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function MedicareCardPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function MobileDevicePictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function MoneyInPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function MoneyOutPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function MovieTicketsPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function NestEggPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function NoodlesPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function Number1Pictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function Number2Pictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function Number3Pictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function Number4Pictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function Number5Pictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function PadlockLockedPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function PadlockUnlockedPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function PassportPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function PercentSignPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function PersonPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function PiggyBankPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function PizzaPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function PlantPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function SearchPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function SecurePictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function ShopPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function ShoppingPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function SparklePictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function StarPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function StopwatchPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function TargetPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function TaxDocumentPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function TelephoneCallPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function ThumbsUpPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function TickPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function ToolsPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function TractorPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function TruckPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function UmbrellaPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function UnsecurePictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function WalletPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -18,7 +18,7 @@ export function WearablesPictogram({
18
18
  }: PictogramProps) {
19
19
  return (
20
20
  <Pictogram
21
- className={clsx('h-13 w-13', className)}
21
+ className={clsx('size-13', className)}
22
22
  viewBoxWidth={viewBoxWidth}
23
23
  viewBoxHeight={viewBoxHeight}
24
24
  aria-label={ariaLabel}
@@ -1,58 +1,36 @@
1
- import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
1
+ import { useRef } from 'react';
2
2
  import { FocusScope } from 'react-aria';
3
+ import { createPortal } from 'react-dom';
3
4
 
4
5
  import { Button } from '../../../button/index.js';
5
6
  import { CloseIcon } from '../../../icon/index.js';
6
- import { getPopoverPosition } from '../../popover.utils.js';
7
7
 
8
+ import { usePanel } from './panel.hook.js';
8
9
  import { styles as panelStyles } from './panel.styles.js';
9
- import { type PanelProps, Position } from './panel.types.js';
10
-
11
- /**
12
- * @private
13
- */
14
- export function Panel({ state, heading, headingTag: Tag = 'h1', content, placement, id, triggerRef }: PanelProps) {
10
+ import { type PanelProps } from './panel.types.js';
11
+
12
+ export function BasePanel({
13
+ state,
14
+ heading,
15
+ headingTag: Tag = 'h1',
16
+ content,
17
+ placement = 'bottom',
18
+ id,
19
+ triggerRef,
20
+ portal,
21
+ }: PanelProps) {
15
22
  const popoverRef = useRef<HTMLDivElement>(null);
16
23
  const arrowRef = useRef<HTMLDivElement>(null);
17
- const remSize = useMemo(() => {
18
- if (typeof window !== 'undefined') {
19
- return parseInt(window.getComputedStyle(document.getElementsByTagName('html')[0]).fontSize);
20
- }
21
- return 1;
22
- }, []);
23
-
24
- const [position, setPosition] = useState<Position>({
25
- placement: 'top',
26
- offset: 'left',
27
- panelPosition: triggerRef.current ? triggerRef.current.offsetWidth / 2 / remSize : 0,
28
- arrowPosition: popoverRef.current ? popoverRef.current.getBoundingClientRect().width / 2 / remSize : 0,
29
- });
30
-
31
- useLayoutEffect(() => {
32
- setPosition(getPopoverPosition(triggerRef, popoverRef, arrowRef, placement));
33
- }, [placement, remSize, state.isOpen, triggerRef]);
34
-
35
- const getPopoverClass = useCallback(() => {
36
- return {
37
- [position.offset as string]:
38
- position.offset === 'left' ? `${position.panelPosition}rem` : `-${position.panelPosition}rem`,
39
- transform: position.offset === 'left' ? 'translateX(-50%)' : 'none',
40
- };
41
- }, [position]);
42
-
43
- const getArrowClass = useCallback(() => {
44
- return {
45
- [!position.offset || position.offset === 'left' ? 'left' : 'right']: `${position.arrowPosition}rem`,
46
- };
47
- }, [position]);
48
-
49
- const styles = panelStyles({ placement: position.placement });
24
+ const { popoverPosition, arrowPosition } = usePanel({ state, placement, triggerRef, portal });
50
25
 
26
+ const styles = panelStyles({ placement });
51
27
  return (
52
- <FocusScope restoreFocus>
53
- <div className={styles.popover()} style={getPopoverClass()} id={id} ref={popoverRef}>
28
+ <FocusScope contain autoFocus restoreFocus>
29
+ <div style={popoverPosition} className={styles.popover()} test-id="popover" id={id} ref={popoverRef}>
54
30
  <div className={styles.content()}>
55
- <Tag className={styles.heading()}>{heading}</Tag>
31
+ <Tag tabIndex={0} className={styles.heading()}>
32
+ {heading}
33
+ </Tag>
56
34
  <div className={styles.body()}>{content}</div>
57
35
  <Button
58
36
  look="link"
@@ -62,9 +40,20 @@ export function Panel({ state, heading, headingTag: Tag = 'h1', content, placeme
62
40
  aria-label="Close popover"
63
41
  />
64
42
  </div>
65
- <div aria-hidden className={styles.arrow()} style={getArrowClass()} ref={arrowRef} />
43
+ <div aria-hidden className={styles.arrow()} style={arrowPosition} test-id="arrow" ref={arrowRef} />
66
44
  </div>
67
45
  </FocusScope>
68
46
  );
69
47
  }
48
+
49
+ /**
50
+ * @private
51
+ */
52
+ export function Panel({ portal = false, ...props }: PanelProps) {
53
+ if (portal) {
54
+ const portalValue = typeof portal === 'boolean' ? document.body : portal;
55
+ return createPortal(<BasePanel {...props} portal={portalValue} />, portalValue);
56
+ }
57
+ return <BasePanel portal={portal} {...props} />;
58
+ }
70
59
  Panel.displayName = 'Popover.Panel';