@wordpress/components 25.6.1 → 26.0.1-next.5a1d1283.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 (526) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +3 -8
  4. package/build/color-picker/hsv-color-picker.native.js +92 -0
  5. package/build/color-picker/hsv-color-picker.native.js.map +1 -0
  6. package/build/color-picker/hue-picker.native.js +195 -0
  7. package/build/color-picker/hue-picker.native.js.map +1 -0
  8. package/build/color-picker/index.native.js +3 -2
  9. package/build/color-picker/index.native.js.map +1 -1
  10. package/build/color-picker/saturation-picker.native.js +178 -0
  11. package/build/color-picker/saturation-picker.native.js.map +1 -0
  12. package/build/item-group/item/component.js +0 -1
  13. package/build/item-group/item/component.js.map +1 -1
  14. package/build/item-group/item-group/component.js +0 -1
  15. package/build/item-group/item-group/component.js.map +1 -1
  16. package/build/menu-item/index.js +6 -4
  17. package/build/menu-item/index.js.map +1 -1
  18. package/build/menu-item/types.js.map +1 -1
  19. package/build/mobile/link-settings/link-settings-navigation.native.js +1 -1
  20. package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  21. package/build/navigation/index.js +0 -1
  22. package/build/navigation/index.js.map +1 -1
  23. package/build/navigator/navigator-provider/component.js +1 -2
  24. package/build/navigator/navigator-provider/component.js.map +1 -1
  25. package/build/palette-edit/styles.js +10 -10
  26. package/build/palette-edit/styles.js.map +1 -1
  27. package/build/popover/index.js +38 -75
  28. package/build/popover/index.js.map +1 -1
  29. package/build/popover/overlay-middlewares.js.map +1 -1
  30. package/build/popover/types.js.map +1 -1
  31. package/build/popover/utils.js +5 -50
  32. package/build/popover/utils.js.map +1 -1
  33. package/build/progress-bar/styles.js +6 -5
  34. package/build/progress-bar/styles.js.map +1 -1
  35. package/build/search-control/index.native.js +27 -24
  36. package/build/search-control/index.native.js.map +1 -1
  37. package/build/shortcut/index.js +13 -0
  38. package/build/shortcut/index.js.map +1 -1
  39. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
  40. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  41. package/build/slot-fill/bubbles-virtually/slot.js +14 -8
  42. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  43. package/build/slot-fill/index.js +5 -0
  44. package/build/slot-fill/index.js.map +1 -1
  45. package/build/spinner/index.js +0 -1
  46. package/build/spinner/index.js.map +1 -1
  47. package/build/theme/index.js +0 -1
  48. package/build/theme/index.js.map +1 -1
  49. package/build/tools-panel/tools-panel/component.js +0 -1
  50. package/build/tools-panel/tools-panel/component.js.map +1 -1
  51. package/build/tools-panel/tools-panel-header/component.js +5 -1
  52. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  53. package/build/tree-select/index.js +0 -1
  54. package/build/tree-select/index.js.map +1 -1
  55. package/build/unit-control/index.js +0 -1
  56. package/build/unit-control/index.js.map +1 -1
  57. package/build/utils/hooks/use-cx.js +2 -1
  58. package/build/utils/hooks/use-cx.js.map +1 -1
  59. package/build/view/component.js +1 -2
  60. package/build/view/component.js.map +1 -1
  61. package/build-module/color-picker/hsv-color-picker.native.js +84 -0
  62. package/build-module/color-picker/hsv-color-picker.native.js.map +1 -0
  63. package/build-module/color-picker/hue-picker.native.js +185 -0
  64. package/build-module/color-picker/hue-picker.native.js.map +1 -0
  65. package/build-module/color-picker/index.native.js +2 -1
  66. package/build-module/color-picker/index.native.js.map +1 -1
  67. package/build-module/color-picker/saturation-picker.native.js +168 -0
  68. package/build-module/color-picker/saturation-picker.native.js.map +1 -0
  69. package/build-module/item-group/item/component.js +0 -1
  70. package/build-module/item-group/item/component.js.map +1 -1
  71. package/build-module/item-group/item-group/component.js +0 -1
  72. package/build-module/item-group/item-group/component.js.map +1 -1
  73. package/build-module/menu-item/index.js +4 -2
  74. package/build-module/menu-item/index.js.map +1 -1
  75. package/build-module/menu-item/types.js.map +1 -1
  76. package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -1
  77. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  78. package/build-module/navigation/index.js +0 -1
  79. package/build-module/navigation/index.js.map +1 -1
  80. package/build-module/navigator/navigator-provider/component.js +1 -2
  81. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  82. package/build-module/palette-edit/styles.js +10 -10
  83. package/build-module/palette-edit/styles.js.map +1 -1
  84. package/build-module/popover/index.js +42 -79
  85. package/build-module/popover/index.js.map +1 -1
  86. package/build-module/popover/overlay-middlewares.js.map +1 -1
  87. package/build-module/popover/types.js.map +1 -1
  88. package/build-module/popover/utils.js +4 -47
  89. package/build-module/popover/utils.js.map +1 -1
  90. package/build-module/progress-bar/styles.js +6 -5
  91. package/build-module/progress-bar/styles.js.map +1 -1
  92. package/build-module/search-control/index.native.js +28 -25
  93. package/build-module/search-control/index.native.js.map +1 -1
  94. package/build-module/shortcut/index.js +13 -0
  95. package/build-module/shortcut/index.js.map +1 -1
  96. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
  97. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  98. package/build-module/slot-fill/bubbles-virtually/slot.js +14 -8
  99. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  100. package/build-module/slot-fill/index.js +6 -1
  101. package/build-module/slot-fill/index.js.map +1 -1
  102. package/build-module/spinner/index.js +0 -1
  103. package/build-module/spinner/index.js.map +1 -1
  104. package/build-module/theme/index.js +0 -1
  105. package/build-module/theme/index.js.map +1 -1
  106. package/build-module/tools-panel/tools-panel/component.js +0 -1
  107. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  108. package/build-module/tools-panel/tools-panel-header/component.js +5 -1
  109. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  110. package/build-module/tree-select/index.js +0 -1
  111. package/build-module/tree-select/index.js.map +1 -1
  112. package/build-module/unit-control/index.js +0 -1
  113. package/build-module/unit-control/index.js.map +1 -1
  114. package/build-module/utils/hooks/use-cx.js +2 -1
  115. package/build-module/utils/hooks/use-cx.js.map +1 -1
  116. package/build-module/view/component.js +1 -2
  117. package/build-module/view/component.js.map +1 -1
  118. package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
  119. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  120. package/build-types/angle-picker-control/stories/index.story.d.ts +2 -2
  121. package/build-types/angle-picker-control/stories/index.story.d.ts.map +1 -1
  122. package/build-types/animate/stories/index.story.d.ts +9 -9
  123. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  124. package/build-types/base-control/stories/index.story.d.ts +4 -4
  125. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  126. package/build-types/border-box-control/stories/index.story.d.ts +2 -2
  127. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  128. package/build-types/border-control/stories/index.story.d.ts +2 -2
  129. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  130. package/build-types/button/stories/e2e/index.story.d.ts +3 -3
  131. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  132. package/build-types/button/stories/index.story.d.ts +10 -9
  133. package/build-types/button/stories/index.story.d.ts.map +1 -1
  134. package/build-types/button-group/stories/index.story.d.ts +3 -3
  135. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  136. package/build-types/card/stories/index.story.d.ts +2 -2
  137. package/build-types/card/stories/index.story.d.ts.map +1 -1
  138. package/build-types/checkbox-control/stories/index.story.d.ts +4 -4
  139. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  140. package/build-types/circular-option-picker/stories/index.story.d.ts +2 -2
  141. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  142. package/build-types/color-indicator/stories/index.story.d.ts +3 -3
  143. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  144. package/build-types/color-palette/stories/index.story.d.ts +3 -3
  145. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  146. package/build-types/color-palette/styles.d.ts +1 -1
  147. package/build-types/color-picker/stories/index.story.d.ts +2 -2
  148. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  149. package/build-types/combobox-control/stories/index.story.d.ts +2 -2
  150. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  151. package/build-types/custom-gradient-picker/stories/index.story.d.ts +2 -2
  152. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  153. package/build-types/date-time/date/styles.d.ts +1 -1
  154. package/build-types/date-time/stories/date-time.story.d.ts +5 -5
  155. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  156. package/build-types/date-time/stories/date.story.d.ts +5 -5
  157. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  158. package/build-types/date-time/stories/time.story.d.ts +3 -3
  159. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  160. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  161. package/build-types/disabled/stories/index.story.d.ts +4 -4
  162. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  163. package/build-types/divider/stories/index.story.d.ts +5 -5
  164. package/build-types/divider/stories/index.story.d.ts.map +1 -1
  165. package/build-types/draggable/stories/index.story.d.ts +4 -4
  166. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  167. package/build-types/drop-zone/stories/index.story.d.ts +2 -2
  168. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  169. package/build-types/dropdown/stories/index.story.d.ts +6 -5
  170. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  171. package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
  172. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  173. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +2 -2
  174. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  175. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +2 -2
  176. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  177. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +2 -2
  178. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  179. package/build-types/elevation/stories/index.story.d.ts +5 -5
  180. package/build-types/elevation/stories/index.story.d.ts.map +1 -1
  181. package/build-types/external-link/stories/index.story.d.ts +3 -3
  182. package/build-types/external-link/stories/index.story.d.ts.map +1 -1
  183. package/build-types/flex/stories/index.story.d.ts +4 -4
  184. package/build-types/flex/stories/index.story.d.ts.map +1 -1
  185. package/build-types/focal-point-picker/stories/index.story.d.ts +2 -2
  186. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  187. package/build-types/font-size-picker/stories/e2e/index.story.d.ts +2 -2
  188. package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
  189. package/build-types/font-size-picker/stories/index.story.d.ts +8 -8
  190. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  191. package/build-types/form-file-upload/stories/index.story.d.ts +2 -2
  192. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  193. package/build-types/form-toggle/stories/index.story.d.ts +3 -3
  194. package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
  195. package/build-types/form-token-field/stories/index.story.d.ts +7 -7
  196. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  197. package/build-types/gradient-picker/stories/index.story.d.ts +2 -2
  198. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  199. package/build-types/grid/stories/index.story.d.ts +3 -3
  200. package/build-types/grid/stories/index.story.d.ts.map +1 -1
  201. package/build-types/guide/stories/index.story.d.ts +2 -2
  202. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  203. package/build-types/h-stack/stories/e2e/index.story.d.ts +3 -3
  204. package/build-types/h-stack/stories/e2e/index.story.d.ts.map +1 -1
  205. package/build-types/h-stack/stories/index.story.d.ts +3 -3
  206. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  207. package/build-types/heading/stories/index.story.d.ts +3 -3
  208. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  209. package/build-types/icon/stories/index.story.d.ts +4 -4
  210. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  211. package/build-types/input-control/stories/index.story.d.ts +2 -2
  212. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  213. package/build-types/item-group/item/component.d.ts +0 -1
  214. package/build-types/item-group/item/component.d.ts.map +1 -1
  215. package/build-types/item-group/item-group/component.d.ts +0 -1
  216. package/build-types/item-group/item-group/component.d.ts.map +1 -1
  217. package/build-types/item-group/stories/index.story.d.ts +6 -6
  218. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  219. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +2 -2
  220. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  221. package/build-types/menu-group/stories/index.story.d.ts +3 -3
  222. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  223. package/build-types/menu-item/index.d.ts +5 -58
  224. package/build-types/menu-item/index.d.ts.map +1 -1
  225. package/build-types/menu-item/stories/index.story.d.ts +74 -0
  226. package/build-types/menu-item/stories/index.story.d.ts.map +1 -0
  227. package/build-types/menu-item/types.d.ts +3 -2
  228. package/build-types/menu-item/types.d.ts.map +1 -1
  229. package/build-types/menu-items-choice/stories/index.story.d.ts +3 -3
  230. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  231. package/build-types/modal/stories/index.story.d.ts +4 -4
  232. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  233. package/build-types/navigable-container/stories/navigable-menu.story.d.ts +3 -3
  234. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
  235. package/build-types/navigable-container/stories/tabbable-container.story.d.ts +3 -3
  236. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
  237. package/build-types/navigation/index.d.ts +0 -1
  238. package/build-types/navigation/index.d.ts.map +1 -1
  239. package/build-types/navigation/stories/index.story.d.ts +2 -2
  240. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  241. package/build-types/navigation/stories/utils/controlled-state.d.ts +2 -2
  242. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -1
  243. package/build-types/navigation/stories/utils/default.d.ts +2 -2
  244. package/build-types/navigation/stories/utils/default.d.ts.map +1 -1
  245. package/build-types/navigation/stories/utils/group.d.ts +2 -2
  246. package/build-types/navigation/stories/utils/group.d.ts.map +1 -1
  247. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +2 -2
  248. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
  249. package/build-types/navigation/stories/utils/more-examples.d.ts +2 -2
  250. package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -1
  251. package/build-types/navigation/stories/utils/search.d.ts +2 -2
  252. package/build-types/navigation/stories/utils/search.d.ts.map +1 -1
  253. package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
  254. package/build-types/navigator/navigator-provider/component.d.ts +0 -1
  255. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  256. package/build-types/navigator/stories/index.story.d.ts +5 -5
  257. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  258. package/build-types/notice/stories/index.story.d.ts +3 -3
  259. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  260. package/build-types/number-control/stories/index.story.d.ts +2 -2
  261. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  262. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  263. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  264. package/build-types/palette-edit/styles.d.ts +1 -1
  265. package/build-types/palette-edit/styles.d.ts.map +1 -1
  266. package/build-types/panel/stories/index.story.d.ts +6 -6
  267. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  268. package/build-types/placeholder/stories/index.story.d.ts +3 -3
  269. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  270. package/build-types/popover/index.d.ts.map +1 -1
  271. package/build-types/popover/overlay-middlewares.d.ts +2 -2
  272. package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
  273. package/build-types/popover/stories/index.story.d.ts +7 -7
  274. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  275. package/build-types/popover/types.d.ts +6 -0
  276. package/build-types/popover/types.d.ts.map +1 -1
  277. package/build-types/popover/utils.d.ts +1 -21
  278. package/build-types/popover/utils.d.ts.map +1 -1
  279. package/build-types/progress-bar/stories/index.story.d.ts +3 -3
  280. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  281. package/build-types/progress-bar/styles.d.ts.map +1 -1
  282. package/build-types/query-controls/stories/index.story.d.ts +4 -4
  283. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  284. package/build-types/radio-control/stories/index.story.d.ts +3 -3
  285. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  286. package/build-types/range-control/stories/index.story.d.ts +9 -9
  287. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  288. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  289. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  290. package/build-types/responsive-wrapper/stories/index.story.d.ts +3 -3
  291. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  292. package/build-types/sandbox/stories/index.story.d.ts +2 -2
  293. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  294. package/build-types/scroll-lock/stories/index.story.d.ts +3 -3
  295. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  296. package/build-types/scrollable/stories/index.story.d.ts +3 -3
  297. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  298. package/build-types/search-control/stories/index.story.d.ts +2 -2
  299. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  300. package/build-types/select-control/stories/index.story.d.ts +2 -2
  301. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  302. package/build-types/shortcut/index.d.ts +13 -0
  303. package/build-types/shortcut/index.d.ts.map +1 -1
  304. package/build-types/shortcut/stories/index.story.d.ts +13 -0
  305. package/build-types/shortcut/stories/index.story.d.ts.map +1 -0
  306. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts +1 -0
  307. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
  308. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -6
  309. package/build-types/slot-fill/index.d.ts +1 -1
  310. package/build-types/slot-fill/index.d.ts.map +1 -1
  311. package/build-types/snackbar/stories/index.story.d.ts +7 -7
  312. package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
  313. package/build-types/snackbar/stories/list.story.d.ts +3 -3
  314. package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
  315. package/build-types/spacer/stories/index.story.d.ts +3 -3
  316. package/build-types/spacer/stories/index.story.d.ts.map +1 -1
  317. package/build-types/spinner/index.d.ts +0 -1
  318. package/build-types/spinner/index.d.ts.map +1 -1
  319. package/build-types/spinner/stories/index.story.d.ts +4 -4
  320. package/build-types/spinner/stories/index.story.d.ts.map +1 -1
  321. package/build-types/surface/stories/index.story.d.ts +3 -3
  322. package/build-types/surface/stories/index.story.d.ts.map +1 -1
  323. package/build-types/tab-panel/stories/index.story.d.ts +2 -2
  324. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  325. package/build-types/text-control/stories/index.story.d.ts +4 -4
  326. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  327. package/build-types/text-highlight/stories/index.story.d.ts +3 -3
  328. package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
  329. package/build-types/textarea-control/stories/index.story.d.ts +3 -3
  330. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  331. package/build-types/theme/index.d.ts +0 -1
  332. package/build-types/theme/index.d.ts.map +1 -1
  333. package/build-types/theme/stories/index.story.d.ts +4 -4
  334. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  335. package/build-types/tip/stories/index.story.d.ts +3 -3
  336. package/build-types/tip/stories/index.story.d.ts.map +1 -1
  337. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  338. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  339. package/build-types/toggle-group-control/stories/index.story.d.ts +6 -6
  340. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  341. package/build-types/toolbar/stories/index.story.d.ts +2 -2
  342. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  343. package/build-types/tools-panel/stories/index.story.d.ts +8 -8
  344. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  345. package/build-types/tools-panel/tools-panel/component.d.ts +0 -1
  346. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  347. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  348. package/build-types/tree-grid/stories/index.story.d.ts +2 -2
  349. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  350. package/build-types/tree-select/index.d.ts +0 -1
  351. package/build-types/tree-select/index.d.ts.map +1 -1
  352. package/build-types/tree-select/stories/index.story.d.ts +2 -2
  353. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  354. package/build-types/truncate/stories/index.story.d.ts +4 -4
  355. package/build-types/truncate/stories/index.story.d.ts.map +1 -1
  356. package/build-types/unit-control/index.d.ts +0 -1
  357. package/build-types/unit-control/index.d.ts.map +1 -1
  358. package/build-types/unit-control/stories/index.story.d.ts +7 -7
  359. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  360. package/build-types/utils/hooks/use-cx.d.ts +2 -1
  361. package/build-types/utils/hooks/use-cx.d.ts.map +1 -1
  362. package/build-types/v-stack/stories/e2e/index.story.d.ts +3 -3
  363. package/build-types/v-stack/stories/e2e/index.story.d.ts.map +1 -1
  364. package/build-types/v-stack/stories/index.story.d.ts +2 -2
  365. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  366. package/build-types/view/component.d.ts +0 -1
  367. package/build-types/view/component.d.ts.map +1 -1
  368. package/build-types/view/stories/index.story.d.ts +3 -3
  369. package/build-types/view/stories/index.story.d.ts.map +1 -1
  370. package/build-types/visually-hidden/stories/index.story.d.ts +5 -5
  371. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  372. package/build-types/z-stack/stories/index.story.d.ts +3 -3
  373. package/build-types/z-stack/stories/index.story.d.ts.map +1 -1
  374. package/package.json +20 -20
  375. package/src/alignment-matrix-control/stories/index.story.tsx +7 -3
  376. package/src/angle-picker-control/stories/index.story.tsx +3 -3
  377. package/src/animate/stories/index.story.tsx +12 -10
  378. package/src/base-control/stories/index.story.tsx +5 -9
  379. package/src/border-box-control/stories/index.story.tsx +5 -9
  380. package/src/border-control/stories/index.story.tsx +8 -14
  381. package/src/button/stories/e2e/index.story.tsx +3 -3
  382. package/src/button/stories/index.story.tsx +10 -10
  383. package/src/button-group/stories/index.story.tsx +4 -6
  384. package/src/card/stories/index.story.tsx +5 -5
  385. package/src/checkbox-control/stories/index.story.tsx +7 -6
  386. package/src/circular-option-picker/stories/index.story.tsx +16 -4
  387. package/src/color-indicator/stories/index.story.tsx +4 -6
  388. package/src/color-palette/stories/index.story.tsx +12 -21
  389. package/src/color-picker/hsv-color-picker.native.js +88 -0
  390. package/src/color-picker/hue-picker.native.js +194 -0
  391. package/src/color-picker/index.native.js +2 -1
  392. package/src/color-picker/saturation-picker.native.js +163 -0
  393. package/src/color-picker/stories/index.story.tsx +3 -3
  394. package/src/color-picker/style.native.scss +23 -0
  395. package/src/combobox-control/stories/index.story.tsx +3 -3
  396. package/src/custom-gradient-picker/stories/index.story.tsx +3 -3
  397. package/src/date-time/stories/date-time.story.tsx +8 -10
  398. package/src/date-time/stories/date.story.tsx +8 -9
  399. package/src/date-time/stories/time.story.tsx +4 -4
  400. package/src/dimension-control/stories/index.story.tsx +3 -3
  401. package/src/disabled/stories/index.story.tsx +4 -4
  402. package/src/divider/stories/index.story.tsx +6 -6
  403. package/src/draggable/stories/index.story.tsx +5 -7
  404. package/src/drop-zone/stories/index.story.tsx +3 -3
  405. package/src/dropdown/stories/index.story.tsx +8 -6
  406. package/src/dropdown-menu/stories/index.story.tsx +3 -3
  407. package/src/dropdown-menu-v2/stories/index.story.tsx +24 -10
  408. package/src/duotone-picker/stories/duotone-picker.story.tsx +3 -6
  409. package/src/duotone-picker/stories/duotone-swatch.story.tsx +3 -3
  410. package/src/elevation/stories/index.story.tsx +7 -7
  411. package/src/external-link/stories/index.story.tsx +4 -6
  412. package/src/flex/stories/index.story.tsx +6 -6
  413. package/src/focal-point-picker/stories/index.story.tsx +3 -3
  414. package/src/font-size-picker/stories/e2e/index.story.tsx +3 -3
  415. package/src/font-size-picker/stories/index.story.tsx +10 -10
  416. package/src/form-file-upload/stories/index.story.tsx +3 -3
  417. package/src/form-toggle/stories/index.story.tsx +4 -7
  418. package/src/form-token-field/stories/index.story.tsx +10 -11
  419. package/src/gradient-picker/stories/index.story.tsx +3 -3
  420. package/src/grid/stories/index.story.tsx +4 -4
  421. package/src/guide/stories/index.story.tsx +3 -3
  422. package/src/h-stack/stories/e2e/index.story.tsx +4 -4
  423. package/src/h-stack/stories/index.story.tsx +4 -4
  424. package/src/heading/stories/index.story.tsx +3 -3
  425. package/src/icon/stories/index.story.tsx +5 -5
  426. package/src/input-control/stories/index.story.tsx +5 -3
  427. package/src/item-group/item/component.tsx +0 -1
  428. package/src/item-group/item-group/component.tsx +0 -1
  429. package/src/item-group/stories/index.story.tsx +11 -12
  430. package/src/keyboard-shortcuts/stories/index.story.tsx +3 -3
  431. package/src/menu-group/stories/index.story.tsx +5 -5
  432. package/src/menu-item/README.md +1 -1
  433. package/src/menu-item/index.tsx +5 -2
  434. package/src/menu-item/stories/index.story.tsx +80 -0
  435. package/src/menu-item/types.ts +3 -2
  436. package/src/menu-items-choice/stories/index.story.tsx +4 -6
  437. package/src/mobile/link-settings/link-settings-navigation.native.js +1 -1
  438. package/src/modal/stories/index.story.tsx +5 -10
  439. package/src/navigable-container/stories/navigable-menu.story.tsx +3 -3
  440. package/src/navigable-container/stories/tabbable-container.story.tsx +3 -3
  441. package/src/navigation/index.tsx +0 -1
  442. package/src/navigation/stories/index.story.tsx +16 -2
  443. package/src/navigation/stories/utils/controlled-state.tsx +2 -2
  444. package/src/navigation/stories/utils/default.tsx +2 -2
  445. package/src/navigation/stories/utils/group.tsx +2 -2
  446. package/src/navigation/stories/utils/hide-if-empty.tsx +2 -2
  447. package/src/navigation/stories/utils/more-examples.tsx +2 -2
  448. package/src/navigation/stories/utils/search.tsx +2 -2
  449. package/src/navigator/navigator-provider/component.tsx +0 -1
  450. package/src/navigator/stories/index.story.tsx +9 -10
  451. package/src/notice/stories/index.story.tsx +6 -6
  452. package/src/number-control/stories/index.story.tsx +3 -3
  453. package/src/palette-edit/stories/index.story.tsx +3 -3
  454. package/src/palette-edit/styles.js +0 -1
  455. package/src/panel/stories/index.story.tsx +9 -11
  456. package/src/placeholder/stories/index.story.tsx +4 -6
  457. package/src/popover/README.md +2 -2
  458. package/src/popover/index.tsx +69 -103
  459. package/src/popover/overlay-middlewares.tsx +2 -2
  460. package/src/popover/stories/index.story.tsx +8 -10
  461. package/src/popover/test/index.tsx +15 -1
  462. package/src/popover/types.ts +6 -0
  463. package/src/popover/utils.ts +5 -56
  464. package/src/progress-bar/stories/index.story.tsx +4 -6
  465. package/src/progress-bar/styles.ts +4 -1
  466. package/src/query-controls/stories/index.story.tsx +5 -6
  467. package/src/radio-control/stories/index.story.tsx +4 -6
  468. package/src/radio-group/stories/index.story.js +1 -0
  469. package/src/range-control/stories/index.story.tsx +12 -18
  470. package/src/resizable-box/stories/index.story.tsx +3 -3
  471. package/src/responsive-wrapper/stories/index.story.tsx +4 -5
  472. package/src/sandbox/stories/index.story.tsx +3 -5
  473. package/src/scroll-lock/stories/index.story.tsx +3 -3
  474. package/src/scrollable/stories/index.story.tsx +4 -4
  475. package/src/search-control/index.native.js +39 -27
  476. package/src/search-control/stories/index.story.tsx +3 -3
  477. package/src/select-control/stories/index.story.tsx +3 -3
  478. package/src/shortcut/index.tsx +13 -0
  479. package/src/shortcut/stories/index.story.tsx +33 -0
  480. package/src/slot-fill/README.md +5 -5
  481. package/src/slot-fill/bubbles-virtually/slot-fill-context.js +3 -0
  482. package/src/slot-fill/bubbles-virtually/slot.js +17 -5
  483. package/src/slot-fill/index.js +6 -1
  484. package/src/slot-fill/stories/index.story.js +2 -0
  485. package/src/slot-fill/test/__snapshots__/slot.js.snap +12 -4
  486. package/src/snackbar/stories/index.story.tsx +10 -13
  487. package/src/snackbar/stories/list.story.tsx +3 -3
  488. package/src/spacer/stories/index.story.tsx +4 -4
  489. package/src/spinner/index.tsx +0 -1
  490. package/src/spinner/stories/index.story.tsx +5 -5
  491. package/src/surface/stories/index.story.tsx +4 -4
  492. package/src/tab-panel/stories/index.story.tsx +5 -13
  493. package/src/tab-panel/test/index.tsx +9 -25
  494. package/src/text-control/stories/index.story.tsx +7 -6
  495. package/src/text-highlight/stories/index.story.tsx +4 -6
  496. package/src/textarea-control/stories/index.story.tsx +4 -6
  497. package/src/theme/index.tsx +0 -1
  498. package/src/theme/stories/index.story.tsx +5 -5
  499. package/src/tip/stories/index.story.tsx +4 -4
  500. package/src/toggle-control/stories/index.story.tsx +3 -3
  501. package/src/toggle-group-control/stories/index.story.tsx +17 -11
  502. package/src/toolbar/stories/index.story.tsx +13 -3
  503. package/src/tools-panel/stories/index.story.tsx +17 -12
  504. package/src/tools-panel/tools-panel/component.tsx +0 -1
  505. package/src/tools-panel/tools-panel-header/component.tsx +3 -0
  506. package/src/tree-grid/stories/index.story.tsx +5 -3
  507. package/src/tree-select/index.tsx +0 -1
  508. package/src/tree-select/stories/index.story.tsx +3 -3
  509. package/src/truncate/stories/index.story.tsx +5 -7
  510. package/src/unit-control/index.tsx +0 -1
  511. package/src/unit-control/stories/index.story.tsx +10 -9
  512. package/src/utils/hooks/use-cx.ts +2 -1
  513. package/src/v-stack/stories/e2e/index.story.tsx +4 -4
  514. package/src/v-stack/stories/index.story.tsx +3 -3
  515. package/src/view/component.tsx +0 -1
  516. package/src/view/stories/index.story.tsx +4 -4
  517. package/src/visually-hidden/stories/index.story.tsx +7 -7
  518. package/src/z-stack/stories/index.story.tsx +4 -4
  519. package/tsconfig.tsbuildinfo +1 -1
  520. package/build/popover/limit-shift.js +0 -129
  521. package/build/popover/limit-shift.js.map +0 -1
  522. package/build-module/popover/limit-shift.js +0 -122
  523. package/build-module/popover/limit-shift.js.map +0 -1
  524. package/build-types/popover/limit-shift.d.ts +0 -87
  525. package/build-types/popover/limit-shift.d.ts.map +0 -1
  526. package/src/popover/limit-shift.ts +0 -205
@@ -14,7 +14,6 @@ var _base = _interopRequireDefault(require("@emotion/styled/base"));
14
14
  * `View` is a core component that renders everything in the library.
15
15
  * It is the principle component in the entire library.
16
16
  *
17
- * @example
18
17
  * ```jsx
19
18
  * import { View } from `@wordpress/components`;
20
19
  *
@@ -32,7 +31,7 @@ const View = (0, _base.default)("div", process.env.NODE_ENV === "production" ? {
32
31
  } : {
33
32
  target: "e19lxcc00",
34
33
  label: "View"
35
- })(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdmlldy9jb21wb25lbnQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlDYyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3ZpZXcvY29tcG9uZW50LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB0eXBlIHsgUmVmQXR0cmlidXRlcyB9IGZyb20gJ3JlYWN0JztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHR5cGUgeyBXb3JkUHJlc3NDb21wb25lbnQgfSBmcm9tICcuLi91aS9jb250ZXh0L3dvcmRwcmVzcy1jb21wb25lbnQnO1xuaW1wb3J0IHR5cGUgeyBWaWV3UHJvcHMgfSBmcm9tICcuL3R5cGVzJztcblxuLyoqXG4gKiBgVmlld2AgaXMgYSBjb3JlIGNvbXBvbmVudCB0aGF0IHJlbmRlcnMgZXZlcnl0aGluZyBpbiB0aGUgbGlicmFyeS5cbiAqIEl0IGlzIHRoZSBwcmluY2lwbGUgY29tcG9uZW50IGluIHRoZSBlbnRpcmUgbGlicmFyeS5cbiAqXG4gKiBAZXhhbXBsZVxuICogYGBganN4XG4gKiBpbXBvcnQgeyBWaWV3IH0gZnJvbSBgQHdvcmRwcmVzcy9jb21wb25lbnRzYDtcbiAqXG4gKiBmdW5jdGlvbiBFeGFtcGxlKCkge1xuICogXHRyZXR1cm4gKFxuICogXHRcdDxWaWV3PlxuICogXHRcdFx0IENvZGUgaXMgUG9ldHJ5XG4gKiBcdFx0PC9WaWV3PlxuICogXHQpO1xuICogfVxuICogYGBgXG4gKi9cbmV4cG9ydCBjb25zdCBWaWV3OiBXb3JkUHJlc3NDb21wb25lbnQ8XG5cdCdkaXYnLFxuXHRWaWV3UHJvcHMgJiBSZWZBdHRyaWJ1dGVzPCBhbnkgPixcblx0dHJ1ZVxuPiA9IHN0eWxlZC5kaXZgYDtcblxuVmlldy5zZWxlY3RvciA9ICcuY29tcG9uZW50cy12aWV3JztcblZpZXcuZGlzcGxheU5hbWUgPSAnVmlldyc7XG5cbmV4cG9ydCBkZWZhdWx0IFZpZXc7XG4iXX0= */");
34
+ })(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdmlldy9jb21wb25lbnQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdDYyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3ZpZXcvY29tcG9uZW50LnRzeCIsInNvdXJjZXNDb250ZW50IjpbI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IGRlZmF1bHQgVmlldztcbiJdfQ== */");
36
35
  exports.View = View;
37
36
  View.selector = '.components-view';
38
37
  View.displayName = 'View';
@@ -1 +1 @@
1
- {"version":3,"names":["View","_base","default","process","env","NODE_ENV","target","label","exports","selector","displayName","_default"],"sources":["@wordpress/components/src/view/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport type { RefAttributes } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponent } from '../ui/context/wordpress-component';\nimport type { ViewProps } from './types';\n\n/**\n * `View` is a core component that renders everything in the library.\n * It is the principle component in the entire library.\n *\n * @example\n * ```jsx\n * import { View } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<View>\n * \t\t\t Code is Poetry\n * \t\t</View>\n * \t);\n * }\n * ```\n */\nexport const View: WordPressComponent<\n\t'div',\n\tViewProps & RefAttributes< any >,\n\ttrue\n> = styled.div``;\n\nView.selector = '.components-view';\nView.displayName = 'View';\n\nexport default View;\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,IAIZ,OAAAC,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,25CAAe;AAACG,OAAA,CAAAR,IAAA,GAAAA,IAAA;AAEjBA,IAAI,CAACS,QAAQ,GAAG,kBAAkB;AAClCT,IAAI,CAACU,WAAW,GAAG,MAAM;AAAC,IAAAC,QAAA,GAEXX,IAAI;AAAAQ,OAAA,CAAAN,OAAA,GAAAS,QAAA"}
1
+ {"version":3,"names":["View","_base","default","process","env","NODE_ENV","target","label","exports","selector","displayName","_default"],"sources":["@wordpress/components/src/view/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport type { RefAttributes } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponent } from '../ui/context/wordpress-component';\nimport type { ViewProps } from './types';\n\n/**\n * `View` is a core component that renders everything in the library.\n * It is the principle component in the entire library.\n *\n * ```jsx\n * import { View } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<View>\n * \t\t\t Code is Poetry\n * \t\t</View>\n * \t);\n * }\n * ```\n */\nexport const View: WordPressComponent<\n\t'div',\n\tViewProps & RefAttributes< any >,\n\ttrue\n> = styled.div``;\n\nView.selector = '.components-view';\nView.displayName = 'View';\n\nexport default View;\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,IAIZ,OAAAC,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,24CAAe;AAACG,OAAA,CAAAR,IAAA,GAAAA,IAAA;AAEjBA,IAAI,CAACS,QAAQ,GAAG,kBAAkB;AAClCT,IAAI,CAACU,WAAW,GAAG,MAAM;AAAC,IAAAC,QAAA,GAEXX,IAAI;AAAAQ,OAAA,CAAAN,OAAA,GAAAS,QAAA"}
@@ -0,0 +1,84 @@
1
+ import { createElement } from "@wordpress/element";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import { View, Dimensions } from 'react-native';
6
+
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+ import { useRef } from '@wordpress/element';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import HuePicker from './hue-picker';
16
+ import SaturationValuePicker from './saturation-picker';
17
+ import styles from './style.native.scss';
18
+ const HsvColorPicker = props => {
19
+ const maxWidth = Dimensions.get('window').width - 32;
20
+ const satValPickerRef = useRef(null);
21
+ const {
22
+ containerStyle = {},
23
+ currentColor,
24
+ huePickerContainerStyle = {},
25
+ huePickerBorderRadius = 0,
26
+ huePickerHue = 0,
27
+ huePickerBarWidth = maxWidth,
28
+ huePickerBarHeight = 12,
29
+ huePickerSliderSize = 24,
30
+ onHuePickerDragStart,
31
+ onHuePickerDragMove,
32
+ onHuePickerDragEnd,
33
+ onHuePickerDragTerminate,
34
+ onHuePickerPress,
35
+ satValPickerContainerStyle = {},
36
+ satValPickerBorderRadius = 0,
37
+ satValPickerSize = {
38
+ width: maxWidth,
39
+ height: 200
40
+ },
41
+ satValPickerSliderSize = 24,
42
+ satValPickerHue = 0,
43
+ satValPickerSaturation = 1,
44
+ satValPickerValue = 1,
45
+ onSatValPickerDragStart,
46
+ onSatValPickerDragMove,
47
+ onSatValPickerDragEnd,
48
+ onSatValPickerDragTerminate,
49
+ onSatValPickerPress
50
+ } = props;
51
+ return createElement(View, {
52
+ style: [styles['hsv-container'], containerStyle],
53
+ testID: "hsv-color-picker"
54
+ }, createElement(SaturationValuePicker, {
55
+ containerStyle: satValPickerContainerStyle,
56
+ currentColor: currentColor,
57
+ borderRadius: satValPickerBorderRadius,
58
+ size: satValPickerSize,
59
+ sliderSize: satValPickerSliderSize,
60
+ hue: satValPickerHue,
61
+ saturation: satValPickerSaturation,
62
+ value: satValPickerValue,
63
+ onDragStart: onSatValPickerDragStart,
64
+ onDragMove: onSatValPickerDragMove,
65
+ onDragEnd: onSatValPickerDragEnd,
66
+ onDragTerminate: onSatValPickerDragTerminate,
67
+ onPress: onSatValPickerPress,
68
+ ref: satValPickerRef
69
+ }), createElement(HuePicker, {
70
+ containerStyle: huePickerContainerStyle,
71
+ borderRadius: huePickerBorderRadius,
72
+ hue: huePickerHue,
73
+ barWidth: huePickerBarWidth,
74
+ barHeight: huePickerBarHeight,
75
+ sliderSize: huePickerSliderSize,
76
+ onDragStart: onHuePickerDragStart,
77
+ onDragMove: onHuePickerDragMove,
78
+ onDragEnd: onHuePickerDragEnd,
79
+ onDragTerminate: onHuePickerDragTerminate,
80
+ onPress: onHuePickerPress
81
+ }));
82
+ };
83
+ export default HsvColorPicker;
84
+ //# sourceMappingURL=hsv-color-picker.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["View","Dimensions","useRef","HuePicker","SaturationValuePicker","styles","HsvColorPicker","props","maxWidth","get","width","satValPickerRef","containerStyle","currentColor","huePickerContainerStyle","huePickerBorderRadius","huePickerHue","huePickerBarWidth","huePickerBarHeight","huePickerSliderSize","onHuePickerDragStart","onHuePickerDragMove","onHuePickerDragEnd","onHuePickerDragTerminate","onHuePickerPress","satValPickerContainerStyle","satValPickerBorderRadius","satValPickerSize","height","satValPickerSliderSize","satValPickerHue","satValPickerSaturation","satValPickerValue","onSatValPickerDragStart","onSatValPickerDragMove","onSatValPickerDragEnd","onSatValPickerDragTerminate","onSatValPickerPress","createElement","style","testID","borderRadius","size","sliderSize","hue","saturation","value","onDragStart","onDragMove","onDragEnd","onDragTerminate","onPress","ref","barWidth","barHeight"],"sources":["@wordpress/components/src/color-picker/hsv-color-picker.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Dimensions } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport HuePicker from './hue-picker';\nimport SaturationValuePicker from './saturation-picker';\nimport styles from './style.native.scss';\n\nconst HsvColorPicker = ( props ) => {\n\tconst maxWidth = Dimensions.get( 'window' ).width - 32;\n\tconst satValPickerRef = useRef( null );\n\n\tconst {\n\t\tcontainerStyle = {},\n\t\tcurrentColor,\n\t\thuePickerContainerStyle = {},\n\t\thuePickerBorderRadius = 0,\n\t\thuePickerHue = 0,\n\t\thuePickerBarWidth = maxWidth,\n\t\thuePickerBarHeight = 12,\n\t\thuePickerSliderSize = 24,\n\t\tonHuePickerDragStart,\n\t\tonHuePickerDragMove,\n\t\tonHuePickerDragEnd,\n\t\tonHuePickerDragTerminate,\n\t\tonHuePickerPress,\n\t\tsatValPickerContainerStyle = {},\n\t\tsatValPickerBorderRadius = 0,\n\t\tsatValPickerSize = { width: maxWidth, height: 200 },\n\t\tsatValPickerSliderSize = 24,\n\t\tsatValPickerHue = 0,\n\t\tsatValPickerSaturation = 1,\n\t\tsatValPickerValue = 1,\n\t\tonSatValPickerDragStart,\n\t\tonSatValPickerDragMove,\n\t\tonSatValPickerDragEnd,\n\t\tonSatValPickerDragTerminate,\n\t\tonSatValPickerPress,\n\t} = props;\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ [ styles[ 'hsv-container' ], containerStyle ] }\n\t\t\ttestID=\"hsv-color-picker\"\n\t\t>\n\t\t\t<SaturationValuePicker\n\t\t\t\tcontainerStyle={ satValPickerContainerStyle }\n\t\t\t\tcurrentColor={ currentColor }\n\t\t\t\tborderRadius={ satValPickerBorderRadius }\n\t\t\t\tsize={ satValPickerSize }\n\t\t\t\tsliderSize={ satValPickerSliderSize }\n\t\t\t\thue={ satValPickerHue }\n\t\t\t\tsaturation={ satValPickerSaturation }\n\t\t\t\tvalue={ satValPickerValue }\n\t\t\t\tonDragStart={ onSatValPickerDragStart }\n\t\t\t\tonDragMove={ onSatValPickerDragMove }\n\t\t\t\tonDragEnd={ onSatValPickerDragEnd }\n\t\t\t\tonDragTerminate={ onSatValPickerDragTerminate }\n\t\t\t\tonPress={ onSatValPickerPress }\n\t\t\t\tref={ satValPickerRef }\n\t\t\t/>\n\t\t\t<HuePicker\n\t\t\t\tcontainerStyle={ huePickerContainerStyle }\n\t\t\t\tborderRadius={ huePickerBorderRadius }\n\t\t\t\thue={ huePickerHue }\n\t\t\t\tbarWidth={ huePickerBarWidth }\n\t\t\t\tbarHeight={ huePickerBarHeight }\n\t\t\t\tsliderSize={ huePickerSliderSize }\n\t\t\t\tonDragStart={ onHuePickerDragStart }\n\t\t\t\tonDragMove={ onHuePickerDragMove }\n\t\t\t\tonDragEnd={ onHuePickerDragEnd }\n\t\t\t\tonDragTerminate={ onHuePickerDragTerminate }\n\t\t\t\tonPress={ onHuePickerPress }\n\t\t\t/>\n\t\t</View>\n\t);\n};\n\nexport default HsvColorPicker;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,UAAU,QAAQ,cAAc;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,qBAAqB,MAAM,qBAAqB;AACvD,OAAOC,MAAM,MAAM,qBAAqB;AAExC,MAAMC,cAAc,GAAKC,KAAK,IAAM;EACnC,MAAMC,QAAQ,GAAGP,UAAU,CAACQ,GAAG,CAAE,QAAS,CAAC,CAACC,KAAK,GAAG,EAAE;EACtD,MAAMC,eAAe,GAAGT,MAAM,CAAE,IAAK,CAAC;EAEtC,MAAM;IACLU,cAAc,GAAG,CAAC,CAAC;IACnBC,YAAY;IACZC,uBAAuB,GAAG,CAAC,CAAC;IAC5BC,qBAAqB,GAAG,CAAC;IACzBC,YAAY,GAAG,CAAC;IAChBC,iBAAiB,GAAGT,QAAQ;IAC5BU,kBAAkB,GAAG,EAAE;IACvBC,mBAAmB,GAAG,EAAE;IACxBC,oBAAoB;IACpBC,mBAAmB;IACnBC,kBAAkB;IAClBC,wBAAwB;IACxBC,gBAAgB;IAChBC,0BAA0B,GAAG,CAAC,CAAC;IAC/BC,wBAAwB,GAAG,CAAC;IAC5BC,gBAAgB,GAAG;MAAEjB,KAAK,EAAEF,QAAQ;MAAEoB,MAAM,EAAE;IAAI,CAAC;IACnDC,sBAAsB,GAAG,EAAE;IAC3BC,eAAe,GAAG,CAAC;IACnBC,sBAAsB,GAAG,CAAC;IAC1BC,iBAAiB,GAAG,CAAC;IACrBC,uBAAuB;IACvBC,sBAAsB;IACtBC,qBAAqB;IACrBC,2BAA2B;IAC3BC;EACD,CAAC,GAAG9B,KAAK;EAET,OACC+B,aAAA,CAACtC,IAAI;IACJuC,KAAK,EAAG,CAAElC,MAAM,CAAE,eAAe,CAAE,EAAEO,cAAc,CAAI;IACvD4B,MAAM,EAAC;EAAkB,GAEzBF,aAAA,CAAClC,qBAAqB;IACrBQ,cAAc,EAAGa,0BAA4B;IAC7CZ,YAAY,EAAGA,YAAc;IAC7B4B,YAAY,EAAGf,wBAA0B;IACzCgB,IAAI,EAAGf,gBAAkB;IACzBgB,UAAU,EAAGd,sBAAwB;IACrCe,GAAG,EAAGd,eAAiB;IACvBe,UAAU,EAAGd,sBAAwB;IACrCe,KAAK,EAAGd,iBAAmB;IAC3Be,WAAW,EAAGd,uBAAyB;IACvCe,UAAU,EAAGd,sBAAwB;IACrCe,SAAS,EAAGd,qBAAuB;IACnCe,eAAe,EAAGd,2BAA6B;IAC/Ce,OAAO,EAAGd,mBAAqB;IAC/Be,GAAG,EAAGzC;EAAiB,CACvB,CAAC,EACF2B,aAAA,CAACnC,SAAS;IACTS,cAAc,EAAGE,uBAAyB;IAC1C2B,YAAY,EAAG1B,qBAAuB;IACtC6B,GAAG,EAAG5B,YAAc;IACpBqC,QAAQ,EAAGpC,iBAAmB;IAC9BqC,SAAS,EAAGpC,kBAAoB;IAChCyB,UAAU,EAAGxB,mBAAqB;IAClC4B,WAAW,EAAG3B,oBAAsB;IACpC4B,UAAU,EAAG3B,mBAAqB;IAClC4B,SAAS,EAAG3B,kBAAoB;IAChC4B,eAAe,EAAG3B,wBAA0B;IAC5C4B,OAAO,EAAG3B;EAAkB,CAC5B,CACI,CAAC;AAET,CAAC;AAED,eAAelB,cAAc"}
@@ -0,0 +1,185 @@
1
+ import { createElement } from "@wordpress/element";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import { Animated, View, PanResponder } from 'react-native';
6
+ import LinearGradient from 'react-native-linear-gradient';
7
+
8
+ /**
9
+ * WordPress dependencies
10
+ */
11
+ import React, { Component } from '@wordpress/element';
12
+
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+ import styles from './style.scss';
17
+ export default class HuePicker extends Component {
18
+ constructor(props) {
19
+ super(props);
20
+ this.hueColors = ['#ff0000', '#ffff00', '#00ff00', '#00ffff', '#0000ff', '#ff00ff', '#ff0000'];
21
+ this.sliderX = new Animated.Value(props.barHeight * props.hue / 360);
22
+ this.panResponder = PanResponder.create({
23
+ onStartShouldSetPanResponder: () => true,
24
+ onStartShouldSetPanResponderCapture: () => true,
25
+ onMoveShouldSetPanResponder: () => true,
26
+ onMoveShouldSetPanResponderCapture: () => true,
27
+ onPanResponderGrant: (evt, gestureState) => {
28
+ const {
29
+ onPress
30
+ } = this.props;
31
+ this.dragStartValue = this.computeHueValuePress(evt);
32
+ if (onPress) {
33
+ onPress({
34
+ hue: this.computeHueValuePress(evt),
35
+ nativeEvent: evt.nativeEvent
36
+ });
37
+ }
38
+ this.fireDragEvent('onDragStart', gestureState);
39
+ },
40
+ onPanResponderMove: (evt, gestureState) => {
41
+ this.fireDragEvent('onDragMove', gestureState);
42
+ },
43
+ onPanResponderTerminationRequest: () => true,
44
+ onPanResponderRelease: (evt, gestureState) => {
45
+ this.fireDragEvent('onDragEnd', gestureState);
46
+ },
47
+ onPanResponderTerminate: (evt, gestureState) => {
48
+ this.fireDragEvent('onDragTerminate', gestureState);
49
+ },
50
+ onShouldBlockNativeResponder: () => true
51
+ });
52
+ }
53
+ componentDidUpdate(prevProps) {
54
+ const {
55
+ hue = 0,
56
+ barWidth = 200,
57
+ sliderSize = 24
58
+ } = this.props;
59
+ const borderWidth = sliderSize / 10;
60
+ if (prevProps.hue !== hue || prevProps.barWidth !== barWidth) {
61
+ this.sliderX.setValue((barWidth - sliderSize + borderWidth) * hue / 360);
62
+ }
63
+ }
64
+ normalizeValue(value) {
65
+ if (value < 0) return 0;
66
+ if (value > 1) return 1;
67
+ return value;
68
+ }
69
+ getContainerStyle() {
70
+ const {
71
+ sliderSize = 24,
72
+ barHeight = 12,
73
+ containerStyle = {}
74
+ } = this.props;
75
+ const paddingLeft = sliderSize / 2;
76
+ const paddingTop = sliderSize - barHeight > 0 ? (sliderSize - barHeight) / 2 : 0;
77
+ return [styles['hsv-container'], containerStyle, {
78
+ paddingTop,
79
+ paddingBottom: paddingTop,
80
+ paddingLeft,
81
+ paddingRight: paddingLeft
82
+ }];
83
+ }
84
+ computeHueValueDrag(gestureState) {
85
+ const {
86
+ dx
87
+ } = gestureState;
88
+ const {
89
+ barWidth = 200
90
+ } = this.props;
91
+ const {
92
+ dragStartValue
93
+ } = this;
94
+ const diff = dx / barWidth;
95
+ const updatedHue = this.normalizeValue(dragStartValue / 360 + diff) * 360;
96
+ return updatedHue;
97
+ }
98
+ computeHueValuePress(event) {
99
+ const {
100
+ nativeEvent
101
+ } = event;
102
+ const {
103
+ locationX
104
+ } = nativeEvent;
105
+ const {
106
+ barWidth = 200
107
+ } = this.props;
108
+ const updatedHue = this.normalizeValue(locationX / barWidth) * 360;
109
+ return updatedHue;
110
+ }
111
+ fireDragEvent(eventName, gestureState) {
112
+ const {
113
+ [eventName]: event
114
+ } = this.props;
115
+ if (event) {
116
+ event({
117
+ hue: this.computeHueValueDrag(gestureState),
118
+ gestureState
119
+ });
120
+ }
121
+ }
122
+ firePressEvent(event) {
123
+ const {
124
+ onPress
125
+ } = this.props;
126
+ if (onPress) {
127
+ onPress({
128
+ hue: this.computeHueValuePress(event),
129
+ nativeEvent: event.nativeEvent
130
+ });
131
+ }
132
+ }
133
+ render() {
134
+ const {
135
+ hueColors
136
+ } = this;
137
+ const {
138
+ sliderSize = 24,
139
+ barWidth = 200,
140
+ barHeight = 12,
141
+ borderRadius = 0
142
+ } = this.props;
143
+ const borderWidth = sliderSize / 10;
144
+ return createElement(View, {
145
+ style: this.getContainerStyle(),
146
+ ...this.panResponder.panHandlers,
147
+ hitSlop: {
148
+ top: 10,
149
+ bottom: 10,
150
+ left: 0,
151
+ right: 0
152
+ }
153
+ }, createElement(LinearGradient, {
154
+ colors: hueColors,
155
+ style: {
156
+ borderRadius
157
+ },
158
+ start: {
159
+ x: 0,
160
+ y: 0
161
+ },
162
+ end: {
163
+ x: 1,
164
+ y: 0
165
+ }
166
+ }, createElement(View, {
167
+ style: {
168
+ width: barWidth,
169
+ height: barHeight
170
+ }
171
+ })), createElement(Animated.View, {
172
+ pointerEvents: "none",
173
+ style: [styles['hue-slider'], {
174
+ width: sliderSize,
175
+ height: sliderSize,
176
+ left: (sliderSize - borderWidth) / 2,
177
+ borderRadius: sliderSize / 2,
178
+ transform: [{
179
+ translateX: this.sliderX
180
+ }]
181
+ }]
182
+ }));
183
+ }
184
+ }
185
+ //# sourceMappingURL=hue-picker.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Animated","View","PanResponder","LinearGradient","React","Component","styles","HuePicker","constructor","props","hueColors","sliderX","Value","barHeight","hue","panResponder","create","onStartShouldSetPanResponder","onStartShouldSetPanResponderCapture","onMoveShouldSetPanResponder","onMoveShouldSetPanResponderCapture","onPanResponderGrant","evt","gestureState","onPress","dragStartValue","computeHueValuePress","nativeEvent","fireDragEvent","onPanResponderMove","onPanResponderTerminationRequest","onPanResponderRelease","onPanResponderTerminate","onShouldBlockNativeResponder","componentDidUpdate","prevProps","barWidth","sliderSize","borderWidth","setValue","normalizeValue","value","getContainerStyle","containerStyle","paddingLeft","paddingTop","paddingBottom","paddingRight","computeHueValueDrag","dx","diff","updatedHue","event","locationX","eventName","firePressEvent","render","borderRadius","createElement","style","panHandlers","hitSlop","top","bottom","left","right","colors","start","x","y","end","width","height","pointerEvents","transform","translateX"],"sources":["@wordpress/components/src/color-picker/hue-picker.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Animated, View, PanResponder } from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\n\n/**\n * WordPress dependencies\n */\nimport React, { Component } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport default class HuePicker extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.hueColors = [\n\t\t\t'#ff0000',\n\t\t\t'#ffff00',\n\t\t\t'#00ff00',\n\t\t\t'#00ffff',\n\t\t\t'#0000ff',\n\t\t\t'#ff00ff',\n\t\t\t'#ff0000',\n\t\t];\n\t\tthis.sliderX = new Animated.Value(\n\t\t\t( props.barHeight * props.hue ) / 360\n\t\t);\n\t\tthis.panResponder = PanResponder.create( {\n\t\t\tonStartShouldSetPanResponder: () => true,\n\t\t\tonStartShouldSetPanResponderCapture: () => true,\n\t\t\tonMoveShouldSetPanResponder: () => true,\n\t\t\tonMoveShouldSetPanResponderCapture: () => true,\n\t\t\tonPanResponderGrant: ( evt, gestureState ) => {\n\t\t\t\tconst { onPress } = this.props;\n\t\t\t\tthis.dragStartValue = this.computeHueValuePress( evt );\n\n\t\t\t\tif ( onPress ) {\n\t\t\t\t\tonPress( {\n\t\t\t\t\t\thue: this.computeHueValuePress( evt ),\n\t\t\t\t\t\tnativeEvent: evt.nativeEvent,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tthis.fireDragEvent( 'onDragStart', gestureState );\n\t\t\t},\n\t\t\tonPanResponderMove: ( evt, gestureState ) => {\n\t\t\t\tthis.fireDragEvent( 'onDragMove', gestureState );\n\t\t\t},\n\t\t\tonPanResponderTerminationRequest: () => true,\n\t\t\tonPanResponderRelease: ( evt, gestureState ) => {\n\t\t\t\tthis.fireDragEvent( 'onDragEnd', gestureState );\n\t\t\t},\n\t\t\tonPanResponderTerminate: ( evt, gestureState ) => {\n\t\t\t\tthis.fireDragEvent( 'onDragTerminate', gestureState );\n\t\t\t},\n\t\t\tonShouldBlockNativeResponder: () => true,\n\t\t} );\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { hue = 0, barWidth = 200, sliderSize = 24 } = this.props;\n\t\tconst borderWidth = sliderSize / 10;\n\t\tif ( prevProps.hue !== hue || prevProps.barWidth !== barWidth ) {\n\t\t\tthis.sliderX.setValue(\n\t\t\t\t( ( barWidth - sliderSize + borderWidth ) * hue ) / 360\n\t\t\t);\n\t\t}\n\t}\n\n\tnormalizeValue( value ) {\n\t\tif ( value < 0 ) return 0;\n\t\tif ( value > 1 ) return 1;\n\t\treturn value;\n\t}\n\n\tgetContainerStyle() {\n\t\tconst {\n\t\t\tsliderSize = 24,\n\t\t\tbarHeight = 12,\n\t\t\tcontainerStyle = {},\n\t\t} = this.props;\n\t\tconst paddingLeft = sliderSize / 2;\n\t\tconst paddingTop =\n\t\t\tsliderSize - barHeight > 0 ? ( sliderSize - barHeight ) / 2 : 0;\n\t\treturn [\n\t\t\tstyles[ 'hsv-container' ],\n\t\t\tcontainerStyle,\n\t\t\t{\n\t\t\t\tpaddingTop,\n\t\t\t\tpaddingBottom: paddingTop,\n\t\t\t\tpaddingLeft,\n\t\t\t\tpaddingRight: paddingLeft,\n\t\t\t},\n\t\t];\n\t}\n\n\tcomputeHueValueDrag( gestureState ) {\n\t\tconst { dx } = gestureState;\n\t\tconst { barWidth = 200 } = this.props;\n\t\tconst { dragStartValue } = this;\n\t\tconst diff = dx / barWidth;\n\t\tconst updatedHue =\n\t\t\tthis.normalizeValue( dragStartValue / 360 + diff ) * 360;\n\t\treturn updatedHue;\n\t}\n\n\tcomputeHueValuePress( event ) {\n\t\tconst { nativeEvent } = event;\n\t\tconst { locationX } = nativeEvent;\n\t\tconst { barWidth = 200 } = this.props;\n\t\tconst updatedHue = this.normalizeValue( locationX / barWidth ) * 360;\n\t\treturn updatedHue;\n\t}\n\n\tfireDragEvent( eventName, gestureState ) {\n\t\tconst { [ eventName ]: event } = this.props;\n\t\tif ( event ) {\n\t\t\tevent( {\n\t\t\t\thue: this.computeHueValueDrag( gestureState ),\n\t\t\t\tgestureState,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfirePressEvent( event ) {\n\t\tconst { onPress } = this.props;\n\t\tif ( onPress ) {\n\t\t\tonPress( {\n\t\t\t\thue: this.computeHueValuePress( event ),\n\t\t\t\tnativeEvent: event.nativeEvent,\n\t\t\t} );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst { hueColors } = this;\n\t\tconst {\n\t\t\tsliderSize = 24,\n\t\t\tbarWidth = 200,\n\t\t\tbarHeight = 12,\n\t\t\tborderRadius = 0,\n\t\t} = this.props;\n\t\tconst borderWidth = sliderSize / 10;\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={ this.getContainerStyle() }\n\t\t\t\t{ ...this.panResponder.panHandlers }\n\t\t\t\thitSlop={ {\n\t\t\t\t\ttop: 10,\n\t\t\t\t\tbottom: 10,\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<LinearGradient\n\t\t\t\t\tcolors={ hueColors }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t} }\n\t\t\t\t\tstart={ { x: 0, y: 0 } }\n\t\t\t\t\tend={ { x: 1, y: 0 } }\n\t\t\t\t>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\twidth: barWidth,\n\t\t\t\t\t\t\theight: barHeight,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</LinearGradient>\n\t\t\t\t<Animated.View\n\t\t\t\t\tpointerEvents=\"none\"\n\t\t\t\t\tstyle={ [\n\t\t\t\t\t\tstyles[ 'hue-slider' ],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twidth: sliderSize,\n\t\t\t\t\t\t\theight: sliderSize,\n\t\t\t\t\t\t\tleft: ( sliderSize - borderWidth ) / 2,\n\t\t\t\t\t\t\tborderRadius: sliderSize / 2,\n\t\t\t\t\t\t\ttransform: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttranslateX: this.sliderX,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,IAAI,EAAEC,YAAY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jBmC,MAAM,EAAEnC,UAAU;QAClB2B,IAAI,EAAE,CAAE3B,UAAU,GAAGC,WAAW,IAAK,CAAC;QACtCmB,YAAY,EAAEpB,UAAU,GAAG,CAAC;QAC5BqC,SAAS,EAAE,CACV;UACCC,UAAU,EAAE,IAAI,CAAChE;QAClB,CAAC;MAEH,CAAC;IACC,CACH,CACI,CAAC;EAET;AACD"}
@@ -3,7 +3,6 @@ import { createElement, Fragment } from "@wordpress/element";
3
3
  * External dependencies
4
4
  */
5
5
  import { View, Text, TouchableWithoutFeedback, Platform } from 'react-native';
6
- import HsvColorPicker from 'react-native-hsv-color-picker';
7
6
  import { colord, extend } from 'colord';
8
7
  import namesPlugin from 'colord/plugins/names';
9
8
  /**
@@ -18,6 +17,7 @@ import { Icon, check, close } from '@wordpress/icons';
18
17
  * Internal dependencies
19
18
  */
20
19
  import styles from './style.scss';
20
+ import HsvColorPicker from './hsv-color-picker.native.js';
21
21
  extend([namesPlugin]);
22
22
  function ColorPicker({
23
23
  shouldEnableBottomSheetScroll,
@@ -112,6 +112,7 @@ function ColorPicker({
112
112
  }
113
113
  return createElement(Fragment, null, createElement(HsvColorPicker, {
114
114
  huePickerHue: hue,
115
+ currentColor: currentColor,
115
116
  onHuePickerDragMove: updateColor,
116
117
  onHuePickerPress: !isBottomSheetContentScrolling && updateColor,
117
118
  satValPickerHue: hue,
@@ -1 +1 @@
1
- {"version":3,"names":["View","Text","TouchableWithoutFeedback","Platform","HsvColorPicker","colord","extend","namesPlugin","useState","useEffect","__","BottomSheet","usePreferredColorSchemeStyle","Icon","check","close","styles","ColorPicker","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","isBottomSheetContentScrolling","setColor","activeColor","isGradientColor","onNavigationBack","onHandleClosingBottomSheet","onBottomSheetClosed","onHandleHardwareButtonPress","bottomLabelText","isIOS","OS","hitSlop","top","bottom","left","right","h","initH","s","initS","v","initV","toHsv","hue","setHue","sat","setSaturation","val","setValue","savedColor","paddingLeft","spacing","height","pickerHeight","borderRadius","picker","pickerPointerSize","pickerPointer","pickerWidth","getWidth","applyButtonStyle","applyButton","applyButtonDark","cancelButtonStyle","cancelButton","cancelButtonDark","colorTextStyle","colorText","colorTextDark","selectColorTextStyle","selectColorText","selectColorTextDark","footerStyle","footer","footerDark","combineToHex","toHex","currentColor","updateColor","saturation","value","undefined","onButtonPress","action","createElement","Fragment","huePickerHue","onHuePickerDragMove","onHuePickerPress","satValPickerHue","satValPickerSaturation","satValPickerValue","onSatValPickerDragMove","onSatValPickerPress","onSatValPickerDragStart","onSatValPickerDragEnd","onHuePickerDragStart","onHuePickerDragEnd","huePickerBarWidth","huePickerBarHeight","satValPickerSize","width","satValPickerSliderSize","satValPickerBorderRadius","huePickerBorderRadius","style","onPress","icon","size","selectable","toUpperCase"],"sources":["@wordpress/components/src/color-picker/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback, Platform } from 'react-native';\nimport HsvColorPicker from 'react-native-hsv-color-picker';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { BottomSheet } from '@wordpress/components';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { Icon, check, close } from '@wordpress/icons';\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nextend( [ namesPlugin ] );\n\nfunction ColorPicker( {\n\tshouldEnableBottomSheetScroll,\n\tshouldEnableBottomSheetMaxHeight,\n\tisBottomSheetContentScrolling,\n\tsetColor,\n\tactiveColor,\n\tisGradientColor,\n\tonNavigationBack,\n\tonHandleClosingBottomSheet,\n\tonBottomSheetClosed,\n\tonHandleHardwareButtonPress,\n\tbottomLabelText,\n} ) {\n\tconst isIOS = Platform.OS === 'ios';\n\tconst hitSlop = { top: 22, bottom: 22, left: 22, right: 22 };\n\tconst {\n\t\th: initH,\n\t\ts: initS,\n\t\tv: initV,\n\t} = ! isGradientColor && activeColor\n\t\t? colord( activeColor ).toHsv()\n\t\t: { h: 0, s: 50, v: 50 };\n\tconst [ hue, setHue ] = useState( initH );\n\tconst [ sat, setSaturation ] = useState( initS / 100 );\n\tconst [ val, setValue ] = useState( initV / 100 );\n\tconst [ savedColor ] = useState( activeColor );\n\n\tconst {\n\t\tpaddingLeft: spacing,\n\t\theight: pickerHeight,\n\t\tborderRadius,\n\t} = styles.picker;\n\tconst { height: pickerPointerSize } = styles.pickerPointer;\n\tconst pickerWidth = BottomSheet.getWidth() - 2 * spacing;\n\n\tconst applyButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.applyButton,\n\t\tstyles.applyButtonDark\n\t);\n\tconst cancelButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.cancelButton,\n\t\tstyles.cancelButtonDark\n\t);\n\tconst colorTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.colorText,\n\t\tstyles.colorTextDark\n\t);\n\tconst selectColorTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.selectColorText,\n\t\tstyles.selectColorTextDark\n\t);\n\tconst footerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.footer,\n\t\tstyles.footerDark\n\t);\n\n\tconst combineToHex = ( h = hue, s = sat, v = val ) =>\n\t\tcolord( { h, s: s * 100, v: v * 100 } ).toHex();\n\n\tconst currentColor = combineToHex();\n\n\tconst updateColor = ( { hue: h, saturation: s, value: v } ) => {\n\t\tif ( h !== undefined ) setHue( h );\n\t\tif ( s !== undefined ) setSaturation( s );\n\t\tif ( v !== undefined ) setValue( v );\n\t\tsetColor( combineToHex( h, s, v ) );\n\t};\n\n\tuseEffect( () => {\n\t\tshouldEnableBottomSheetMaxHeight( false );\n\t\tonHandleClosingBottomSheet( () => {\n\t\t\tif ( savedColor ) {\n\t\t\t\tsetColor( savedColor );\n\t\t\t}\n\t\t\tif ( onBottomSheetClosed ) {\n\t\t\t\tonBottomSheetClosed();\n\t\t\t}\n\t\t} );\n\t\tif ( onHandleHardwareButtonPress ) {\n\t\t\tonHandleHardwareButtonPress( onButtonPress );\n\t\t}\n\t\t// TODO: Revisit this to discover if there's a good reason for omitting\n\t\t// the hook’s dependencies and running it a single time. Ideally there\n\t\t// may be a way to refactor and obviate the disabled lint rule. If not,\n\t\t// this comment should be replaced by one that explains the reasoning.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tfunction onButtonPress( action ) {\n\t\tonNavigationBack();\n\t\tonHandleClosingBottomSheet( null );\n\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\tsetColor( action === 'apply' ? currentColor : savedColor );\n\t\tif ( onBottomSheetClosed ) {\n\t\t\tonBottomSheetClosed();\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<HsvColorPicker\n\t\t\t\thuePickerHue={ hue }\n\t\t\t\tonHuePickerDragMove={ updateColor }\n\t\t\t\tonHuePickerPress={\n\t\t\t\t\t! isBottomSheetContentScrolling && updateColor\n\t\t\t\t}\n\t\t\t\tsatValPickerHue={ hue }\n\t\t\t\tsatValPickerSaturation={ sat }\n\t\t\t\tsatValPickerValue={ val }\n\t\t\t\tonSatValPickerDragMove={ updateColor }\n\t\t\t\tonSatValPickerPress={\n\t\t\t\t\t! isBottomSheetContentScrolling && updateColor\n\t\t\t\t}\n\t\t\t\tonSatValPickerDragStart={ () => {\n\t\t\t\t\tshouldEnableBottomSheetScroll( false );\n\t\t\t\t} }\n\t\t\t\tonSatValPickerDragEnd={ () =>\n\t\t\t\t\tshouldEnableBottomSheetScroll( true )\n\t\t\t\t}\n\t\t\t\tonHuePickerDragStart={ () =>\n\t\t\t\t\tshouldEnableBottomSheetScroll( false )\n\t\t\t\t}\n\t\t\t\tonHuePickerDragEnd={ () =>\n\t\t\t\t\tshouldEnableBottomSheetScroll( true )\n\t\t\t\t}\n\t\t\t\thuePickerBarWidth={ pickerWidth }\n\t\t\t\thuePickerBarHeight={ pickerPointerSize / 2 }\n\t\t\t\tsatValPickerSize={ {\n\t\t\t\t\twidth: pickerWidth,\n\t\t\t\t\theight: pickerHeight,\n\t\t\t\t} }\n\t\t\t\tsatValPickerSliderSize={ pickerPointerSize * 2 }\n\t\t\t\tsatValPickerBorderRadius={ borderRadius }\n\t\t\t\thuePickerBorderRadius={ borderRadius }\n\t\t\t/>\n\t\t\t<View style={ footerStyle }>\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={ () => onButtonPress( 'cancel' ) }\n\t\t\t\t\thitSlop={ hitSlop }\n\t\t\t\t>\n\t\t\t\t\t<View>\n\t\t\t\t\t\t{ isIOS ? (\n\t\t\t\t\t\t\t<Text style={ cancelButtonStyle }>\n\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\tstyle={ cancelButtonStyle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t{ bottomLabelText ? (\n\t\t\t\t\t<Text style={ selectColorTextStyle }>\n\t\t\t\t\t\t{ bottomLabelText }\n\t\t\t\t\t</Text>\n\t\t\t\t) : (\n\t\t\t\t\t<Text style={ colorTextStyle } selectable>\n\t\t\t\t\t\t{ currentColor.toUpperCase() }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={ () => onButtonPress( 'apply' ) }\n\t\t\t\t\thitSlop={ hitSlop }\n\t\t\t\t>\n\t\t\t\t\t<View>\n\t\t\t\t\t\t{ isIOS ? (\n\t\t\t\t\t\t\t<Text style={ applyButtonStyle }>\n\t\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)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A,KAAMxB,aAAa,CAAE,QAAS,CAAG;IAC3CnD,OAAO,EAAGA;EAAS,GAEnBqD,aAAA,CAACpF,IAAI,QACF6B,KAAK,GACNuD,aAAA,CAACnF,IAAI;IAACwG,KAAK,EAAG1C;EAAmB,GAC9BrD,EAAE,CAAE,QAAS,CACV,CAAC,GAEP0E,aAAA,CAACvE,IAAI;IACJ8F,IAAI,EAAG5F,KAAO;IACd6F,IAAI,EAAG,EAAI;IACXH,KAAK,EAAG1C;EAAmB,CAC3B,CAEG,CACmB,CAAC,EACzBnC,eAAe,GAChBwD,aAAA,CAACnF,IAAI;IAACwG,KAAK,EAAGpC;EAAsB,GACjCzC,eACG,CAAC,GAEPwD,aAAA,CAACnF,IAAI;IAACwG,KAAK,EAAGvC,cAAgB;IAAC2C,UAAU;EAAA,GACtChC,YAAY,CAACiC,WAAW,CAAC,CACtB,CACN,EACD1B,aAAA,CAAClF,wBAAwB;IACxBwG,OAAO,EAAGA,CAAA,KAAMxB,aAAa,CAAE,OAAQ,CAAG;IAC1CnD,OAAO,EAAGA;EAAS,GAEnBqD,aAAA,CAACpF,IAAI,QACF6B,KAAK,GACNuD,aAAA,CAACnF,IAAI;IAACwG,KAAK,EAAG7C;EAAkB,GAC7BlD,EAAE,CAAE,OAAQ,CACT,CAAC,GAEP0E,aAAA,CAACvE,IAAI;IACJ8F,IAAI,EAAG7F,KAAO;IACd8F,IAAI,EAAG,EAAI;IACXH,KAAK,EAAG7C;EAAkB,CAC1B,CAEG,CACmB,CACrB,CACL,CAAC;AAEL;AAEA,SAAS3C,WAAW"}
1
+ {"version":3,"names":["View","Text","TouchableWithoutFeedback","Platform","colord","extend","namesPlugin","useState","useEffect","__","BottomSheet","usePreferredColorSchemeStyle","Icon","check","close","styles","HsvColorPicker","ColorPicker","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","isBottomSheetContentScrolling","setColor","activeColor","isGradientColor","onNavigationBack","onHandleClosingBottomSheet","onBottomSheetClosed","onHandleHardwareButtonPress","bottomLabelText","isIOS","OS","hitSlop","top","bottom","left","right","h","initH","s","initS","v","initV","toHsv","hue","setHue","sat","setSaturation","val","setValue","savedColor","paddingLeft","spacing","height","pickerHeight","borderRadius","picker","pickerPointerSize","pickerPointer","pickerWidth","getWidth","applyButtonStyle","applyButton","applyButtonDark","cancelButtonStyle","cancelButton","cancelButtonDark","colorTextStyle","colorText","colorTextDark","selectColorTextStyle","selectColorText","selectColorTextDark","footerStyle","footer","footerDark","combineToHex","toHex","currentColor","updateColor","saturation","value","undefined","onButtonPress","action","createElement","Fragment","huePickerHue","onHuePickerDragMove","onHuePickerPress","satValPickerHue","satValPickerSaturation","satValPickerValue","onSatValPickerDragMove","onSatValPickerPress","onSatValPickerDragStart","onSatValPickerDragEnd","onHuePickerDragStart","onHuePickerDragEnd","huePickerBarWidth","huePickerBarHeight","satValPickerSize","width","satValPickerSliderSize","satValPickerBorderRadius","huePickerBorderRadius","style","onPress","icon","size","selectable","toUpperCase"],"sources":["@wordpress/components/src/color-picker/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback, Platform } from 'react-native';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { BottomSheet } from '@wordpress/components';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { Icon, check, close } from '@wordpress/icons';\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport HsvColorPicker from './hsv-color-picker.native.js';\n\nextend( [ namesPlugin ] );\n\nfunction ColorPicker( {\n\tshouldEnableBottomSheetScroll,\n\tshouldEnableBottomSheetMaxHeight,\n\tisBottomSheetContentScrolling,\n\tsetColor,\n\tactiveColor,\n\tisGradientColor,\n\tonNavigationBack,\n\tonHandleClosingBottomSheet,\n\tonBottomSheetClosed,\n\tonHandleHardwareButtonPress,\n\tbottomLabelText,\n} ) {\n\tconst isIOS = Platform.OS === 'ios';\n\tconst hitSlop = { top: 22, bottom: 22, left: 22, right: 22 };\n\tconst {\n\t\th: initH,\n\t\ts: initS,\n\t\tv: initV,\n\t} = ! isGradientColor && activeColor\n\t\t? colord( activeColor ).toHsv()\n\t\t: { h: 0, s: 50, v: 50 };\n\tconst [ hue, setHue ] = useState( initH );\n\tconst [ sat, setSaturation ] = useState( initS / 100 );\n\tconst [ val, setValue ] = useState( initV / 100 );\n\tconst [ savedColor ] = useState( activeColor );\n\n\tconst {\n\t\tpaddingLeft: spacing,\n\t\theight: pickerHeight,\n\t\tborderRadius,\n\t} = styles.picker;\n\tconst { height: pickerPointerSize } = styles.pickerPointer;\n\tconst pickerWidth = BottomSheet.getWidth() - 2 * spacing;\n\n\tconst applyButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.applyButton,\n\t\tstyles.applyButtonDark\n\t);\n\tconst cancelButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.cancelButton,\n\t\tstyles.cancelButtonDark\n\t);\n\tconst colorTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.colorText,\n\t\tstyles.colorTextDark\n\t);\n\tconst selectColorTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.selectColorText,\n\t\tstyles.selectColorTextDark\n\t);\n\tconst footerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.footer,\n\t\tstyles.footerDark\n\t);\n\n\tconst combineToHex = ( h = hue, s = sat, v = val ) =>\n\t\tcolord( { h, s: s * 100, v: v * 100 } ).toHex();\n\n\tconst currentColor = combineToHex();\n\n\tconst updateColor = ( { hue: h, saturation: s, value: v } ) => {\n\t\tif ( h !== undefined ) setHue( h );\n\t\tif ( s !== undefined ) setSaturation( s );\n\t\tif ( v !== undefined ) setValue( v );\n\t\tsetColor( combineToHex( h, s, v ) );\n\t};\n\n\tuseEffect( () => {\n\t\tshouldEnableBottomSheetMaxHeight( false );\n\t\tonHandleClosingBottomSheet( () => {\n\t\t\tif ( savedColor ) {\n\t\t\t\tsetColor( savedColor );\n\t\t\t}\n\t\t\tif ( onBottomSheetClosed ) {\n\t\t\t\tonBottomSheetClosed();\n\t\t\t}\n\t\t} );\n\t\tif ( onHandleHardwareButtonPress ) {\n\t\t\tonHandleHardwareButtonPress( onButtonPress );\n\t\t}\n\t\t// TODO: Revisit this to discover if there's a good reason for omitting\n\t\t// the hook’s dependencies and running it a single time. Ideally there\n\t\t// may be a way to refactor and obviate the disabled lint rule. If not,\n\t\t// this comment should be replaced by one that explains the reasoning.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tfunction onButtonPress( action ) {\n\t\tonNavigationBack();\n\t\tonHandleClosingBottomSheet( null );\n\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\tsetColor( action === 'apply' ? currentColor : savedColor );\n\t\tif ( onBottomSheetClosed ) {\n\t\t\tonBottomSheetClosed();\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<HsvColorPicker\n\t\t\t\thuePickerHue={ hue }\n\t\t\t\tcurrentColor={ currentColor }\n\t\t\t\tonHuePickerDragMove={ updateColor }\n\t\t\t\tonHuePickerPress={\n\t\t\t\t\t! isBottomSheetContentScrolling && updateColor\n\t\t\t\t}\n\t\t\t\tsatValPickerHue={ hue }\n\t\t\t\tsatValPickerSaturation={ sat }\n\t\t\t\tsatValPickerValue={ val }\n\t\t\t\tonSatValPickerDragMove={ updateColor }\n\t\t\t\tonSatValPickerPress={\n\t\t\t\t\t! isBottomSheetContentScrolling && updateColor\n\t\t\t\t}\n\t\t\t\tonSatValPickerDragStart={ () => {\n\t\t\t\t\tshouldEnableBottomSheetScroll( false );\n\t\t\t\t} }\n\t\t\t\tonSatValPickerDragEnd={ () =>\n\t\t\t\t\tshouldEnableBottomSheetScroll( true )\n\t\t\t\t}\n\t\t\t\tonHuePickerDragStart={ () =>\n\t\t\t\t\tshouldEnableBottomSheetScroll( false )\n\t\t\t\t}\n\t\t\t\tonHuePickerDragEnd={ () =>\n\t\t\t\t\tshouldEnableBottomSheetScroll( true )\n\t\t\t\t}\n\t\t\t\thuePickerBarWidth={ pickerWidth }\n\t\t\t\thuePickerBarHeight={ pickerPointerSize / 2 }\n\t\t\t\tsatValPickerSize={ {\n\t\t\t\t\twidth: pickerWidth,\n\t\t\t\t\theight: pickerHeight,\n\t\t\t\t} }\n\t\t\t\tsatValPickerSliderSize={ pickerPointerSize * 2 }\n\t\t\t\tsatValPickerBorderRadius={ borderRadius }\n\t\t\t\thuePickerBorderRadius={ borderRadius }\n\t\t\t/>\n\t\t\t<View style={ footerStyle }>\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={ () => onButtonPress( 'cancel' ) }\n\t\t\t\t\thitSlop={ hitSlop }\n\t\t\t\t>\n\t\t\t\t\t<View>\n\t\t\t\t\t\t{ isIOS ? (\n\t\t\t\t\t\t\t<Text style={ cancelButtonStyle }>\n\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\tstyle={ cancelButtonStyle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t{ bottomLabelText ? (\n\t\t\t\t\t<Text style={ selectColorTextStyle }>\n\t\t\t\t\t\t{ bottomLabelText }\n\t\t\t\t\t</Text>\n\t\t\t\t) : (\n\t\t\t\t\t<Text style={ colorTextStyle } selectable>\n\t\t\t\t\t\t{ currentColor.toUpperCase() }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={ () => onButtonPress( 'apply' ) }\n\t\t\t\t\thitSlop={ hitSlop }\n\t\t\t\t>\n\t\t\t\t\t<View>\n\t\t\t\t\t\t{ isIOS ? (\n\t\t\t\t\t\t\t<Text style={ applyButtonStyle }>\n\t\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\tstyle={ applyButtonStyle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t</View>\n\t\t</>\n\t);\n}\n\nexport { ColorPicker };\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,IAAI,EAAEC,wBAAwB,EAAEC,QAAQ,QAAQ,cAAc;AAC7E,SAASC,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,4BAA4B,QAAQ,oBAAoB;AACjE,SAASC,IAAI,EAAEC,KAAK,EAAEC,KAAK,QAAQ,kBAAkB;AACrD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,cAAc,MAAM,8BAA8B;AAEzDX,MAAM,CAAE,CAAEC,WAAW,CAAG,CAAC;AAEzB,SAASW,WAAWA,CAAE;EACrBC,6BAA6B;EAC7BC,gCAAgC;EAChCC,6BAA6B;EAC7BC,QAAQ;EACRC,WAAW;EACXC,eAAe;EACfC,gBAAgB;EAChBC,0BAA0B;EAC1BC,mBAAmB;EACnBC,2BAA2B;EAC3BC;AACD,CAAC,EAAG;EACH,MAAMC,KAAK,GAAG1B,QAAQ,CAAC2B,EAAE,KAAK,KAAK;EACnC,MAAMC,OAAO,GAAG;IAAE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AwB,EAAGjD,YAAc;IACzCkD,qBAAqB,EAAGlD;EAAc,CACtC,CAAC,EACF8B,aAAA,CAACpF,IAAI;IAACyG,KAAK,EAAGjC;EAAa,GAC1BY,aAAA,CAAClF,wBAAwB;IACxBwG,OAAO,EAAGA,CAAA,KAAMxB,aAAa,CAAE,QAAS,CAAG;IAC3CnD,OAAO,EAAGA;EAAS,GAEnBqD,aAAA,CAACpF,IAAI,QACF6B,KAAK,GACNuD,aAAA,CAACnF,IAAI;IAACwG,KAAK,EAAG1C;EAAmB,GAC9BtD,EAAE,CAAE,QAAS,CACV,CAAC,GAEP2E,aAAA,CAACxE,IAAI;IACJ+F,IAAI,EAAG7F,KAAO;IACd8F,IAAI,EAAG,EAAI;IACXH,KAAK,EAAG1C;EAAmB,CAC3B,CAEG,CACmB,CAAC,EACzBnC,eAAe,GAChBwD,aAAA,CAACnF,IAAI;IAACwG,KAAK,EAAGpC;EAAsB,GACjCzC,eACG,CAAC,GAEPwD,aAAA,CAACnF,IAAI;IAACwG,KAAK,EAAGvC,cAAgB;IAAC2C,UAAU;EAAA,GACtChC,YAAY,CAACiC,WAAW,CAAC,CACtB,CACN,EACD1B,aAAA,CAAClF,wBAAwB;IACxBwG,OAAO,EAAGA,CAAA,KAAMxB,aAAa,CAAE,OAAQ,CAAG;IAC1CnD,OAAO,EAAGA;EAAS,GAEnBqD,aAAA,CAACpF,IAAI,QACF6B,KAAK,GACNuD,aAAA,CAACnF,IAAI;IAACwG,KAAK,EAAG7C;EAAkB,GAC7BnD,EAAE,CAAE,OAAQ,CACT,CAAC,GAEP2E,aAAA,CAACxE,IAAI;IACJ+F,IAAI,EAAG9F,KAAO;IACd+F,IAAI,EAAG,EAAI;IACXH,KAAK,EAAG7C;EAAkB,CAC1B,CAEG,CACmB,CACrB,CACL,CAAC;AAEL;AAEA,SAAS3C,WAAW"}
@@ -0,0 +1,168 @@
1
+ import { createElement } from "@wordpress/element";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import { View, PanResponder } from 'react-native';
6
+ import LinearGradient from 'react-native-linear-gradient';
7
+ import { colord } from 'colord';
8
+
9
+ /**
10
+ * WordPress dependencies
11
+ */
12
+ import React, { Component } from '@wordpress/element';
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+ import styles from './style.native.scss';
18
+ export default class SaturationValuePicker extends Component {
19
+ constructor(props) {
20
+ super(props);
21
+ this.panResponder = PanResponder.create({
22
+ onStartShouldSetPanResponder: () => true,
23
+ onStartShouldSetPanResponderCapture: () => true,
24
+ onMoveShouldSetPanResponder: () => true,
25
+ onMoveShouldSetPanResponderCapture: () => true,
26
+ onPanResponderGrant: (evt, gestureState) => {
27
+ const {
28
+ onPress
29
+ } = this.props;
30
+ const {
31
+ saturation,
32
+ value
33
+ } = this.computeSatValPress(evt);
34
+ this.dragStartValue = {
35
+ saturation,
36
+ value
37
+ };
38
+ if (onPress) {
39
+ onPress({
40
+ ...this.computeSatValPress(evt),
41
+ nativeEvent: evt.nativeEvent
42
+ });
43
+ }
44
+ this.fireDragEvent('onDragStart', gestureState);
45
+ },
46
+ onPanResponderMove: (evt, gestureState) => {
47
+ this.fireDragEvent('onDragMove', gestureState);
48
+ },
49
+ onPanResponderTerminationRequest: () => true,
50
+ onPanResponderRelease: (evt, gestureState) => {
51
+ this.fireDragEvent('onDragEnd', gestureState);
52
+ },
53
+ onPanResponderTerminate: (evt, gestureState) => {
54
+ this.fireDragEvent('onDragTerminate', gestureState);
55
+ },
56
+ onShouldBlockNativeResponder: () => true
57
+ });
58
+ }
59
+ normalizeValue(value) {
60
+ if (value < 0) return 0;
61
+ if (value > 1) return 1;
62
+ return value;
63
+ }
64
+ computeSatValDrag(gestureState) {
65
+ const {
66
+ dx,
67
+ dy
68
+ } = gestureState;
69
+ const {
70
+ size
71
+ } = this.props;
72
+ const {
73
+ saturation,
74
+ value
75
+ } = this.dragStartValue;
76
+ const diffx = dx / size.width;
77
+ const diffy = dy / size.height;
78
+ return {
79
+ saturation: this.normalizeValue(saturation + diffx),
80
+ value: this.normalizeValue(value - diffy)
81
+ };
82
+ }
83
+ computeSatValPress(event) {
84
+ const {
85
+ nativeEvent
86
+ } = event;
87
+ const {
88
+ locationX,
89
+ locationY
90
+ } = nativeEvent;
91
+ const {
92
+ size
93
+ } = this.props;
94
+ return {
95
+ saturation: this.normalizeValue(locationX / size.width),
96
+ value: 1 - this.normalizeValue(locationY / size.height)
97
+ };
98
+ }
99
+ fireDragEvent(eventName, gestureState) {
100
+ const {
101
+ [eventName]: event
102
+ } = this.props;
103
+ if (event) {
104
+ event({
105
+ ...this.computeSatValDrag(gestureState),
106
+ gestureState
107
+ });
108
+ }
109
+ }
110
+ render() {
111
+ const {
112
+ size,
113
+ sliderSize = 24,
114
+ hue = 0,
115
+ value = 1,
116
+ saturation = 1,
117
+ containerStyle = {},
118
+ borderRadius = 0,
119
+ currentColor
120
+ } = this.props;
121
+ return createElement(View, {
122
+ style: [styles['hsv-container'], containerStyle, {
123
+ height: size.height + sliderSize,
124
+ width: size.width + sliderSize
125
+ }],
126
+ ...this.panResponder.panHandlers
127
+ }, createElement(LinearGradient, {
128
+ style: [styles['gradient-container'], {
129
+ borderRadius
130
+ }],
131
+ colors: ['#fff', colord({
132
+ h: hue,
133
+ s: 100,
134
+ l: 50
135
+ }).toHex()],
136
+ start: {
137
+ x: 0,
138
+ y: 0.5
139
+ },
140
+ end: {
141
+ x: 1,
142
+ y: 0.5
143
+ }
144
+ }, createElement(LinearGradient, {
145
+ colors: ['rgba(0, 0, 0, 0)', '#000']
146
+ }, createElement(View, {
147
+ style: {
148
+ height: size.height,
149
+ width: size.width
150
+ }
151
+ }))), createElement(View, {
152
+ pointerEvents: "none",
153
+ style: [styles['saturation-slider'], {
154
+ width: sliderSize,
155
+ height: sliderSize,
156
+ borderRadius: sliderSize / 2,
157
+ borderWidth: sliderSize / 10,
158
+ backgroundColor: currentColor,
159
+ transform: [{
160
+ translateX: size.width * saturation
161
+ }, {
162
+ translateY: size.height * (1 - value)
163
+ }]
164
+ }]
165
+ }));
166
+ }
167
+ }
168
+ //# sourceMappingURL=saturation-picker.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["View","PanResponder","LinearGradient","colord","React","Component","styles","SaturationValuePicker","constructor","props","panResponder","create","onStartShouldSetPanResponder","onStartShouldSetPanResponderCapture","onMoveShouldSetPanResponder","onMoveShouldSetPanResponderCapture","onPanResponderGrant","evt","gestureState","onPress","saturation","value","computeSatValPress","dragStartValue","nativeEvent","fireDragEvent","onPanResponderMove","onPanResponderTerminationRequest","onPanResponderRelease","onPanResponderTerminate","onShouldBlockNativeResponder","normalizeValue","computeSatValDrag","dx","dy","size","diffx","width","diffy","height","event","locationX","locationY","eventName","render","sliderSize","hue","containerStyle","borderRadius","currentColor","createElement","style","panHandlers","colors","h","s","l","toHex","start","x","y","end","pointerEvents","borderWidth","backgroundColor","transform","translateX","translateY"],"sources":["@wordpress/components/src/color-picker/saturation-picker.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, PanResponder } from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport React, { Component } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.native.scss';\n\nexport default class SaturationValuePicker extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.panResponder = PanResponder.create( {\n\t\t\tonStartShouldSetPanResponder: () => true,\n\t\t\tonStartShouldSetPanResponderCapture: () => true,\n\t\t\tonMoveShouldSetPanResponder: () => true,\n\t\t\tonMoveShouldSetPanResponderCapture: () => true,\n\t\t\tonPanResponderGrant: ( evt, gestureState ) => {\n\t\t\t\tconst { onPress } = this.props;\n\t\t\t\tconst { saturation, value } = this.computeSatValPress( evt );\n\t\t\t\tthis.dragStartValue = {\n\t\t\t\t\tsaturation,\n\t\t\t\t\tvalue,\n\t\t\t\t};\n\n\t\t\t\tif ( onPress ) {\n\t\t\t\t\tonPress( {\n\t\t\t\t\t\t...this.computeSatValPress( evt ),\n\t\t\t\t\t\tnativeEvent: evt.nativeEvent,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tthis.fireDragEvent( 'onDragStart', gestureState );\n\t\t\t},\n\t\t\tonPanResponderMove: ( evt, gestureState ) => {\n\t\t\t\tthis.fireDragEvent( 'onDragMove', gestureState );\n\t\t\t},\n\t\t\tonPanResponderTerminationRequest: () => true,\n\t\t\tonPanResponderRelease: ( evt, gestureState ) => {\n\t\t\t\tthis.fireDragEvent( 'onDragEnd', gestureState );\n\t\t\t},\n\t\t\tonPanResponderTerminate: ( evt, gestureState ) => {\n\t\t\t\tthis.fireDragEvent( 'onDragTerminate', gestureState );\n\t\t\t},\n\t\t\tonShouldBlockNativeResponder: () => true,\n\t\t} );\n\t}\n\n\tnormalizeValue( value ) {\n\t\tif ( value < 0 ) return 0;\n\t\tif ( value > 1 ) return 1;\n\t\treturn value;\n\t}\n\n\tcomputeSatValDrag( gestureState ) {\n\t\tconst { dx, dy } = gestureState;\n\t\tconst { size } = this.props;\n\t\tconst { saturation, value } = this.dragStartValue;\n\t\tconst diffx = dx / size.width;\n\t\tconst diffy = dy / size.height;\n\t\treturn {\n\t\t\tsaturation: this.normalizeValue( saturation + diffx ),\n\t\t\tvalue: this.normalizeValue( value - diffy ),\n\t\t};\n\t}\n\n\tcomputeSatValPress( event ) {\n\t\tconst { nativeEvent } = event;\n\t\tconst { locationX, locationY } = nativeEvent;\n\t\tconst { size } = this.props;\n\t\treturn {\n\t\t\tsaturation: this.normalizeValue( locationX / size.width ),\n\t\t\tvalue: 1 - this.normalizeValue( locationY / size.height ),\n\t\t};\n\t}\n\n\tfireDragEvent( eventName, gestureState ) {\n\t\tconst { [ eventName ]: event } = this.props;\n\t\tif ( event ) {\n\t\t\tevent( {\n\t\t\t\t...this.computeSatValDrag( gestureState ),\n\t\t\t\tgestureState,\n\t\t\t} );\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsize,\n\t\t\tsliderSize = 24,\n\t\t\thue = 0,\n\t\t\tvalue = 1,\n\t\t\tsaturation = 1,\n\t\t\tcontainerStyle = {},\n\t\t\tborderRadius = 0,\n\t\t\tcurrentColor,\n\t\t} = this.props;\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles[ 'hsv-container' ],\n\t\t\t\t\tcontainerStyle,\n\t\t\t\t\t{\n\t\t\t\t\t\theight: size.height + sliderSize,\n\t\t\t\t\t\twidth: size.width + sliderSize,\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t\t{ ...this.panResponder.panHandlers }\n\t\t\t>\n\t\t\t\t<LinearGradient\n\t\t\t\t\tstyle={ [\n\t\t\t\t\t\tstyles[ 'gradient-container' ],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tborderRadius,\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t\tcolors={ [\n\t\t\t\t\t\t'#fff',\n\t\t\t\t\t\tcolord( { h: hue, s: 100, l: 50 } ).toHex(),\n\t\t\t\t\t] }\n\t\t\t\t\tstart={ { x: 0, y: 0.5 } }\n\t\t\t\t\tend={ { x: 1, y: 0.5 } }\n\t\t\t\t>\n\t\t\t\t\t<LinearGradient colors={ [ 'rgba(0, 0, 0, 0)', '#000' ] }>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\theight: size.height,\n\t\t\t\t\t\t\t\twidth: size.width,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</LinearGradient>\n\t\t\t\t</LinearGradient>\n\t\t\t\t<View\n\t\t\t\t\tpointerEvents=\"none\"\n\t\t\t\t\tstyle={ [\n\t\t\t\t\t\tstyles[ 'saturation-slider' ],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twidth: sliderSize,\n\t\t\t\t\t\t\theight: sliderSize,\n\t\t\t\t\t\t\tborderRadius: sliderSize / 2,\n\t\t\t\t\t\t\tborderWidth: sliderSize / 10,\n\t\t\t\t\t\t\tbackgroundColor: currentColor,\n\t\t\t\t\t\t\ttransform: [\n\t\t\t\t\t\t\t\t{ translateX: size.width * saturation },\n\t\t\t\t\t\t\t\t{ translateY: size.height * ( 1 - value ) },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,YAAY,QAAQ,cAAc;AACjD,OAAOC,cAAc,MAAM,8BAA8B;AACzD,SAASC,MAAM,QAAQ,QAAQ;;AAE/B;AACA;AACA;AACA,OAAOC,KAAK,IAAIC,SAAS,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,qBAAqB;AAExC,eAAe,MAAMC,qBAAqB,SAASF,SAAS,CAAC;EAC5DG,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IAEd,IAAI,CAACC,YAAY,GAAGT,YAAY,CAACU,MAAM,CAAE;MACxCC,4BAA4B,EAAEA,CAAA,KAAM,IAAI;MACxCC,mCAAmC,EAAEA,CAAA,KAAM,IAAI;MAC/CC,2BAA2B,EAAEA,CAAA,KAAM,IAAI;MACvCC,kCAAkC,EAAEA,CAAA,KAAM,IAAI;MAC9CC,mBAAmB,EAAEA,CAAEC,GAAG,EAAEC,YAAY,KAAM;QAC7C,MAAM;UAAEC;QAAQ,CAAC,GAAG,IAAI,CAACV,KAAK;QAC9B,MAAM;UAAEW,UAAU;UAAEC;QAAM,CAAC,GAAG,IAAI,CAACC,kBAAkB,CAAEL,GAAI,CAAC;QAC5D,IAAI,CAACM,cAAc,GAAG;UACrBH,UAAU;UACVC;QACD,CAAC;QAED,IAAKF,OAAO,EAAG;UACdA,OAAO,CAAE;YACR,GAAG,IAAI,CAACG,kBAAkB,CAAEL,GAAI,CAAC;YACjCO,WAAW,E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,CACP7C,MAAM,CAAE,oBAAoB,CAAE,EAC9B;QACC0C;MACD,CAAC,CACC;MACHK,MAAM,EAAG,CACR,MAAM,EACNlD,MAAM,CAAE;QAAEmD,CAAC,EAAER,GAAG;QAAES,CAAC,EAAE,GAAG;QAAEC,CAAC,EAAE;MAAG,CAAE,CAAC,CAACC,KAAK,CAAC,CAAC,CACzC;MACHC,KAAK,EAAG;QAAEC,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAI,CAAG;MAC1BC,GAAG,EAAG;QAAEF,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAI;IAAG,GAExBV,aAAA,CAAChD,cAAc;MAACmD,MAAM,EAAG,CAAE,kBAAkB,EAAE,MAAM;IAAI,GACxDH,aAAA,CAAClD,IAAI;MACJmD,KAAK,EAAG;QACPZ,MAAM,EAAEJ,IAAI,CAACI,MAAM;QACnBF,KAAK,EAAEF,IAAI,CAACE;MACb;IAAG,CACH,CACc,CACD,CAAC,EACjBa,aAAA,CAAClD,IAAI;MACJ8D,aAAa,EAAC,MAAM;MACpBX,KAAK,EAAG,CACP7C,MAAM,CAAE,mBAAmB,CAAE,EAC7B;QACC+B,KAAK,EAAEQ,UAAU;QACjBN,MAAM,EAAEM,UAAU;QAClBG,YAAY,EAAEH,UAAU,GAAG,CAAC;QAC5BkB,WAAW,EAAElB,UAAU,GAAG,EAAE;QAC5BmB,eAAe,EAAEf,YAAY;QAC7BgB,SAAS,EAAE,CACV;UAAEC,UAAU,EAAE/B,IAAI,CAACE,KAAK,GAAGjB;QAAW,CAAC,EACvC;UAAE+C,UAAU,EAAEhC,IAAI,CAACI,MAAM,IAAK,CAAC,GAAGlB,KAAK;QAAG,CAAC;MAE7C,CAAC;IACC,CACH,CACI,CAAC;EAET;AACD"}
@@ -29,7 +29,6 @@ function UnconnectedItem(props, forwardedRef) {
29
29
  * `Item` is used in combination with `ItemGroup` to display a list of items
30
30
  * grouped and styled together.
31
31
  *
32
- * @example
33
32
  * ```jsx
34
33
  * import {
35
34
  * __experimentalItemGroup as ItemGroup,
@@ -1 +1 @@
1
- {"version":3,"names":["useItem","contextConnect","View","UnconnectedItem","props","forwardedRef","role","wrapperClassName","otherProps","createElement","className","ref","Item"],"sources":["@wordpress/components/src/item-group/item/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ItemProps } from '../types';\nimport { useItem } from './hook';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport { View } from '../../view';\n\nfunction UnconnectedItem(\n\tprops: WordPressComponentProps< ItemProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { role, wrapperClassName, ...otherProps } = useItem( props );\n\n\treturn (\n\t\t<div role={ role } className={ wrapperClassName }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</div>\n\t);\n}\n\n/**\n * `Item` is used in combination with `ItemGroup` to display a list of items\n * grouped and styled together.\n *\n * @example\n * ```jsx\n * import {\n * __experimentalItemGroup as ItemGroup,\n * __experimentalItem as Item,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <ItemGroup>\n * <Item>Code</Item>\n * <Item>is</Item>\n * <Item>Poetry</Item>\n * </ItemGroup>\n * );\n * }\n * ```\n */\nexport const Item = contextConnect( UnconnectedItem, 'Item' );\n\nexport default Item;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,QAAQ;AAEhC,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,IAAI,QAAQ,YAAY;AAEjC,SAASC,eAAeA,CACvBC,KAAkD,EAClDC,YAAiC,EAChC;EACD,MAAM;IAAEC,IAAI;IAAEC,gBAAgB;IAAE,GAAGC;EAAW,CAAC,GAAGR,OAAO,CAAEI,KAAM,CAAC;EAElE,OACCK,aAAA;IAAKH,IAAI,EAAGA,IAAM;IAACI,SAAS,EAAGH;EAAkB,GAChDE,aAAA,CAACP,IAAI;IAAA,GAAMM,UAAU;IAAGG,GAAG,EAAGN;EAAc,CAAE,CAC1C,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,IAAI,GAAGX,cAAc,CAAEE,eAAe,EAAE,MAAO,CAAC;AAE7D,eAAeS,IAAI"}
1
+ {"version":3,"names":["useItem","contextConnect","View","UnconnectedItem","props","forwardedRef","role","wrapperClassName","otherProps","createElement","className","ref","Item"],"sources":["@wordpress/components/src/item-group/item/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ItemProps } from '../types';\nimport { useItem } from './hook';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport { View } from '../../view';\n\nfunction UnconnectedItem(\n\tprops: WordPressComponentProps< ItemProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { role, wrapperClassName, ...otherProps } = useItem( props );\n\n\treturn (\n\t\t<div role={ role } className={ wrapperClassName }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</div>\n\t);\n}\n\n/**\n * `Item` is used in combination with `ItemGroup` to display a list of items\n * grouped and styled together.\n *\n * ```jsx\n * import {\n * __experimentalItemGroup as ItemGroup,\n * __experimentalItem as Item,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <ItemGroup>\n * <Item>Code</Item>\n * <Item>is</Item>\n * <Item>Poetry</Item>\n * </ItemGroup>\n * );\n * }\n * ```\n */\nexport const Item = contextConnect( UnconnectedItem, 'Item' );\n\nexport default Item;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,QAAQ;AAEhC,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,IAAI,QAAQ,YAAY;AAEjC,SAASC,eAAeA,CACvBC,KAAkD,EAClDC,YAAiC,EAChC;EACD,MAAM;IAAEC,IAAI;IAAEC,gBAAgB;IAAE,GAAGC;EAAW,CAAC,GAAGR,OAAO,CAAEI,KAAM,CAAC;EAElE,OACCK,aAAA;IAAKH,IAAI,EAAGA,IAAM;IAACI,SAAS,EAAGH;EAAkB,GAChDE,aAAA,CAACP,IAAI;IAAA,GAAMM,UAAU;IAAGG,GAAG,EAAGN;EAAc,CAAE,CAC1C,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,IAAI,GAAGX,cAAc,CAAEE,eAAe,EAAE,MAAO,CAAC;AAE7D,eAAeS,IAAI"}