@wordpress/components 19.17.0 → 20.0.1-next.d6164808d3.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 (599) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/build/alignment-matrix-control/index.js +1 -1
  3. package/build/alignment-matrix-control/index.js.map +1 -1
  4. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  5. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  6. package/build/angle-picker-control/index.js +3 -0
  7. package/build/angle-picker-control/index.js.map +1 -1
  8. package/build/angle-picker-control/styles/angle-picker-control-styles.js +14 -4
  9. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  10. package/build/autocomplete/index.js +9 -11
  11. package/build/autocomplete/index.js.map +1 -1
  12. package/build/base-control/styles/base-control-styles.js +8 -8
  13. package/build/base-control/styles/base-control-styles.js.map +1 -1
  14. package/build/base-field/styles.js +5 -5
  15. package/build/base-field/styles.js.map +1 -1
  16. package/build/box-control/styles/box-control-visualizer-styles.js +8 -8
  17. package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  18. package/build/color-list-picker/index.js +16 -5
  19. package/build/color-list-picker/index.js.map +1 -1
  20. package/build/color-palette/index.js +22 -12
  21. package/build/color-palette/index.js.map +1 -1
  22. package/build/color-palette/index.native.js +3 -3
  23. package/build/color-palette/index.native.js.map +1 -1
  24. package/build/combobox-control/index.js +7 -4
  25. package/build/combobox-control/index.js.map +1 -1
  26. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  27. package/build/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  28. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  29. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  30. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  31. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  32. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  33. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  34. package/build/custom-gradient-picker/index.js +19 -4
  35. package/build/custom-gradient-picker/index.js.map +1 -1
  36. package/build/custom-select-control/index.js +21 -11
  37. package/build/custom-select-control/index.js.map +1 -1
  38. package/build/custom-select-control/styles.js +34 -0
  39. package/build/custom-select-control/styles.js.map +1 -0
  40. package/build/date-time/constants.js +9 -0
  41. package/build/date-time/constants.js.map +1 -0
  42. package/build/date-time/date/index.js +175 -186
  43. package/build/date-time/date/index.js.map +1 -1
  44. package/build/date-time/date/styles.js +59 -40
  45. package/build/date-time/date/styles.js.map +1 -1
  46. package/build/date-time/date-time/index.js +5 -2
  47. package/build/date-time/date-time/index.js.map +1 -1
  48. package/build/date-time/time/index.js +22 -17
  49. package/build/date-time/time/index.js.map +1 -1
  50. package/build/date-time/utils.js +27 -0
  51. package/build/date-time/utils.js.map +1 -0
  52. package/build/dimension-control/index.js +2 -6
  53. package/build/dimension-control/index.js.map +1 -1
  54. package/build/disabled/index.js +28 -11
  55. package/build/disabled/index.js.map +1 -1
  56. package/build/disabled/styles/disabled-styles.js +3 -3
  57. package/build/disabled/styles/disabled-styles.js.map +1 -1
  58. package/build/{swatch → disabled}/types.js +0 -0
  59. package/build/{swatch → disabled}/types.js.map +0 -0
  60. package/build/dropdown/index.js +5 -6
  61. package/build/dropdown/index.js.map +1 -1
  62. package/build/duotone-picker/custom-duotone-bar.js +2 -2
  63. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  64. package/build/duotone-picker/duotone-picker.js +9 -1
  65. package/build/duotone-picker/duotone-picker.js.map +1 -1
  66. package/build/duotone-picker/duotone-swatch.js +13 -3
  67. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  68. package/build/focal-point-picker/index.js +4 -6
  69. package/build/focal-point-picker/index.js.map +1 -1
  70. package/build/focal-point-picker/styles/focal-point-style.js +4 -4
  71. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  72. package/build/font-size-picker/index.js +43 -14
  73. package/build/font-size-picker/index.js.map +1 -1
  74. package/build/font-size-picker/utils.js +32 -22
  75. package/build/font-size-picker/utils.js.map +1 -1
  76. package/build/form-token-field/index.js +11 -5
  77. package/build/form-token-field/index.js.map +1 -1
  78. package/build/gradient-picker/index.js +15 -3
  79. package/build/gradient-picker/index.js.map +1 -1
  80. package/build/guide/index.js +5 -3
  81. package/build/guide/index.js.map +1 -1
  82. package/build/guide/page-control.js +3 -7
  83. package/build/guide/page-control.js.map +1 -1
  84. package/build/item-group/styles.js +10 -10
  85. package/build/item-group/styles.js.map +1 -1
  86. package/build/mobile/bottom-sheet/index.native.js +3 -6
  87. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  88. package/build/mobile/global-styles-context/utils.native.js +3 -1
  89. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  90. package/build/mobile/image/index.native.js +6 -26
  91. package/build/mobile/image/index.native.js.map +1 -1
  92. package/build/mobile/picker/index.android.js +3 -3
  93. package/build/mobile/picker/index.android.js.map +1 -1
  94. package/build/modal/index.js +1 -3
  95. package/build/modal/index.js.map +1 -1
  96. package/build/navigable-container/container.js +9 -8
  97. package/build/navigable-container/container.js.map +1 -1
  98. package/build/navigator/navigator-back-button/hook.js +0 -4
  99. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  100. package/build/navigator/navigator-button/hook.js +0 -4
  101. package/build/navigator/navigator-button/hook.js.map +1 -1
  102. package/build/notice/list.js +10 -6
  103. package/build/notice/list.js.map +1 -1
  104. package/build/palette-edit/index.js +1 -0
  105. package/build/palette-edit/index.js.map +1 -1
  106. package/build/palette-edit/styles.js +10 -10
  107. package/build/palette-edit/styles.js.map +1 -1
  108. package/build/popover/index.js +100 -97
  109. package/build/popover/index.js.map +1 -1
  110. package/build/popover/utils.js +178 -0
  111. package/build/popover/utils.js.map +1 -0
  112. package/build/range-control/index.js +3 -0
  113. package/build/range-control/index.js.map +1 -1
  114. package/build/range-control/styles/range-control-styles.js +43 -37
  115. package/build/range-control/styles/range-control-styles.js.map +1 -1
  116. package/build/select-control/chevron-down.js +30 -0
  117. package/build/select-control/chevron-down.js.map +1 -0
  118. package/build/select-control/index.js +7 -7
  119. package/build/select-control/index.js.map +1 -1
  120. package/build/select-control/styles/select-control-styles.js +30 -15
  121. package/build/select-control/styles/select-control-styles.js.map +1 -1
  122. package/build/snackbar/list.js +5 -3
  123. package/build/snackbar/list.js.map +1 -1
  124. package/build/spinner/index.js +2 -0
  125. package/build/spinner/index.js.map +1 -1
  126. package/build/text/styles.js +7 -7
  127. package/build/text/styles.js.map +1 -1
  128. package/build/toggle-group-control/toggle-group-control/component.js +16 -8
  129. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  130. package/build/toggle-group-control/toggle-group-control/styles.js +7 -5
  131. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  132. package/build/toggle-group-control/toggle-group-control-option/component.js +15 -5
  133. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  134. package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  135. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  136. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +20 -7
  137. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  138. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +26 -7
  139. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  140. package/build/tools-panel/styles.js +11 -11
  141. package/build/tools-panel/styles.js.map +1 -1
  142. package/build/ui/context/context-connect.js +1 -3
  143. package/build/ui/context/context-connect.js.map +1 -1
  144. package/build/unit-control/index.js +2 -3
  145. package/build/unit-control/index.js.map +1 -1
  146. package/build/utils/colors-values.js +52 -142
  147. package/build/utils/colors-values.js.map +1 -1
  148. package/build/utils/config-values.js +1 -1
  149. package/build/utils/config-values.js.map +1 -1
  150. package/build/utils/input/input-control.js +1 -1
  151. package/build/utils/input/input-control.js.map +1 -1
  152. package/build/utils/rtl.js +6 -5
  153. package/build/utils/rtl.js.map +1 -1
  154. package/build/utils/strings.js +50 -0
  155. package/build/utils/strings.js.map +1 -0
  156. package/build-module/alignment-matrix-control/index.js +1 -1
  157. package/build-module/alignment-matrix-control/index.js.map +1 -1
  158. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  159. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  160. package/build-module/angle-picker-control/index.js +3 -0
  161. package/build-module/angle-picker-control/index.js.map +1 -1
  162. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +13 -4
  163. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  164. package/build-module/autocomplete/index.js +9 -10
  165. package/build-module/autocomplete/index.js.map +1 -1
  166. package/build-module/base-control/styles/base-control-styles.js +8 -8
  167. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  168. package/build-module/base-field/styles.js +5 -5
  169. package/build-module/base-field/styles.js.map +1 -1
  170. package/build-module/box-control/styles/box-control-visualizer-styles.js +8 -8
  171. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  172. package/build-module/color-list-picker/index.js +13 -5
  173. package/build-module/color-list-picker/index.js.map +1 -1
  174. package/build-module/color-palette/index.js +22 -11
  175. package/build-module/color-palette/index.js.map +1 -1
  176. package/build-module/color-palette/index.native.js +4 -4
  177. package/build-module/color-palette/index.native.js.map +1 -1
  178. package/build-module/combobox-control/index.js +6 -3
  179. package/build-module/combobox-control/index.js.map +1 -1
  180. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  181. package/build-module/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  182. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  183. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  184. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  185. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  186. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  187. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  188. package/build-module/custom-gradient-picker/index.js +16 -3
  189. package/build-module/custom-gradient-picker/index.js.map +1 -1
  190. package/build-module/custom-select-control/index.js +20 -12
  191. package/build-module/custom-select-control/index.js.map +1 -1
  192. package/build-module/custom-select-control/styles.js +22 -0
  193. package/build-module/custom-select-control/styles.js.map +1 -0
  194. package/build-module/date-time/constants.js +2 -0
  195. package/build-module/date-time/constants.js.map +1 -0
  196. package/build-module/date-time/date/index.js +178 -184
  197. package/build-module/date-time/date/index.js.map +1 -1
  198. package/build-module/date-time/date/styles.js +47 -38
  199. package/build-module/date-time/date/styles.js.map +1 -1
  200. package/build-module/date-time/date-time/index.js +4 -2
  201. package/build-module/date-time/date-time/index.js.map +1 -1
  202. package/build-module/date-time/time/index.js +20 -16
  203. package/build-module/date-time/time/index.js.map +1 -1
  204. package/build-module/date-time/utils.js +19 -0
  205. package/build-module/date-time/utils.js.map +1 -0
  206. package/build-module/dimension-control/index.js +1 -5
  207. package/build-module/dimension-control/index.js.map +1 -1
  208. package/build-module/disabled/index.js +28 -11
  209. package/build-module/disabled/index.js.map +1 -1
  210. package/build-module/disabled/styles/disabled-styles.js +3 -3
  211. package/build-module/disabled/styles/disabled-styles.js.map +1 -1
  212. package/build-module/{swatch → disabled}/types.js +0 -0
  213. package/build-module/{swatch → disabled}/types.js.map +0 -0
  214. package/build-module/dropdown/index.js +5 -6
  215. package/build-module/dropdown/index.js.map +1 -1
  216. package/build-module/duotone-picker/custom-duotone-bar.js +1 -1
  217. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  218. package/build-module/duotone-picker/duotone-picker.js +7 -1
  219. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  220. package/build-module/duotone-picker/duotone-swatch.js +11 -3
  221. package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
  222. package/build-module/focal-point-picker/index.js +4 -5
  223. package/build-module/focal-point-picker/index.js.map +1 -1
  224. package/build-module/focal-point-picker/styles/focal-point-style.js +4 -4
  225. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  226. package/build-module/font-size-picker/index.js +39 -14
  227. package/build-module/font-size-picker/index.js.map +1 -1
  228. package/build-module/font-size-picker/utils.js +31 -23
  229. package/build-module/font-size-picker/utils.js.map +1 -1
  230. package/build-module/form-token-field/index.js +12 -6
  231. package/build-module/form-token-field/index.js.map +1 -1
  232. package/build-module/gradient-picker/index.js +14 -3
  233. package/build-module/gradient-picker/index.js.map +1 -1
  234. package/build-module/guide/index.js +5 -3
  235. package/build-module/guide/index.js.map +1 -1
  236. package/build-module/guide/page-control.js +3 -6
  237. package/build-module/guide/page-control.js.map +1 -1
  238. package/build-module/item-group/styles.js +10 -10
  239. package/build-module/item-group/styles.js.map +1 -1
  240. package/build-module/mobile/bottom-sheet/index.native.js +3 -5
  241. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  242. package/build-module/mobile/global-styles-context/utils.native.js +2 -1
  243. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  244. package/build-module/mobile/image/index.native.js +8 -28
  245. package/build-module/mobile/image/index.native.js.map +1 -1
  246. package/build-module/mobile/picker/index.android.js +3 -3
  247. package/build-module/mobile/picker/index.android.js.map +1 -1
  248. package/build-module/modal/index.js +1 -2
  249. package/build-module/modal/index.js.map +1 -1
  250. package/build-module/navigable-container/container.js +9 -7
  251. package/build-module/navigable-container/container.js.map +1 -1
  252. package/build-module/navigator/navigator-back-button/hook.js +0 -4
  253. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  254. package/build-module/navigator/navigator-button/hook.js +0 -4
  255. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  256. package/build-module/notice/list.js +10 -5
  257. package/build-module/notice/list.js.map +1 -1
  258. package/build-module/palette-edit/index.js +1 -0
  259. package/build-module/palette-edit/index.js.map +1 -1
  260. package/build-module/palette-edit/styles.js +10 -10
  261. package/build-module/palette-edit/styles.js.map +1 -1
  262. package/build-module/popover/index.js +100 -98
  263. package/build-module/popover/index.js.map +1 -1
  264. package/build-module/popover/utils.js +164 -0
  265. package/build-module/popover/utils.js.map +1 -0
  266. package/build-module/range-control/index.js +3 -0
  267. package/build-module/range-control/index.js.map +1 -1
  268. package/build-module/range-control/styles/range-control-styles.js +43 -37
  269. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  270. package/build-module/select-control/chevron-down.js +21 -0
  271. package/build-module/select-control/chevron-down.js.map +1 -0
  272. package/build-module/select-control/index.js +7 -7
  273. package/build-module/select-control/index.js.map +1 -1
  274. package/build-module/select-control/styles/select-control-styles.js +24 -13
  275. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  276. package/build-module/snackbar/list.js +5 -2
  277. package/build-module/snackbar/list.js.map +1 -1
  278. package/build-module/spinner/index.js +2 -0
  279. package/build-module/spinner/index.js.map +1 -1
  280. package/build-module/text/styles.js +7 -7
  281. package/build-module/text/styles.js.map +1 -1
  282. package/build-module/toggle-group-control/toggle-group-control/component.js +14 -7
  283. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  284. package/build-module/toggle-group-control/toggle-group-control/styles.js +5 -4
  285. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  286. package/build-module/toggle-group-control/toggle-group-control-option/component.js +17 -3
  287. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  288. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  289. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  290. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +16 -6
  291. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  292. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +27 -5
  293. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  294. package/build-module/tools-panel/styles.js +11 -11
  295. package/build-module/tools-panel/styles.js.map +1 -1
  296. package/build-module/ui/context/context-connect.js +1 -2
  297. package/build-module/ui/context/context-connect.js.map +1 -1
  298. package/build-module/unit-control/index.js +2 -2
  299. package/build-module/unit-control/index.js.map +1 -1
  300. package/build-module/utils/colors-values.js +52 -141
  301. package/build-module/utils/colors-values.js.map +1 -1
  302. package/build-module/utils/config-values.js +1 -1
  303. package/build-module/utils/config-values.js.map +1 -1
  304. package/build-module/utils/input/input-control.js +1 -1
  305. package/build-module/utils/input/input-control.js.map +1 -1
  306. package/build-module/utils/rtl.js +6 -4
  307. package/build-module/utils/rtl.js.map +1 -1
  308. package/build-module/utils/strings.js +37 -0
  309. package/build-module/utils/strings.js.map +1 -0
  310. package/build-style/style-rtl.css +176 -1227
  311. package/build-style/style.css +171 -1225
  312. package/build-types/color-palette/index.d.ts +2 -1
  313. package/build-types/color-palette/index.d.ts.map +1 -1
  314. package/build-types/color-picker/styles.d.ts +2 -2
  315. package/build-types/date-time/constants.d.ts +2 -0
  316. package/build-types/date-time/constants.d.ts.map +1 -0
  317. package/build-types/date-time/date/index.d.ts +3 -1
  318. package/build-types/date-time/date/index.d.ts.map +1 -1
  319. package/build-types/date-time/date/styles.d.ts +22 -8
  320. package/build-types/date-time/date/styles.d.ts.map +1 -1
  321. package/build-types/date-time/date/test/index.d.ts +1 -1
  322. package/build-types/date-time/date/test/index.d.ts.map +1 -1
  323. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  324. package/build-types/date-time/time/index.d.ts.map +1 -1
  325. package/build-types/date-time/utils.d.ts +8 -0
  326. package/build-types/date-time/utils.d.ts.map +1 -0
  327. package/build-types/disabled/index.d.ts +35 -28
  328. package/build-types/disabled/index.d.ts.map +1 -1
  329. package/build-types/disabled/stories/index.d.ts +13 -0
  330. package/build-types/disabled/stories/index.d.ts.map +1 -0
  331. package/build-types/disabled/styles/disabled-styles.d.ts +2 -1
  332. package/build-types/disabled/styles/disabled-styles.d.ts.map +1 -1
  333. package/build-types/disabled/test/index.d.ts +2 -0
  334. package/build-types/{flyout/flyout → disabled/test}/index.d.ts.map +1 -1
  335. package/build-types/disabled/types.d.ts +14 -0
  336. package/build-types/disabled/types.d.ts.map +1 -0
  337. package/build-types/dropdown/index.d.ts.map +1 -1
  338. package/build-types/form-token-field/index.d.ts.map +1 -1
  339. package/build-types/form-token-field/stories/index.d.ts +1 -0
  340. package/build-types/form-token-field/stories/index.d.ts.map +1 -1
  341. package/build-types/form-token-field/types.d.ts +7 -0
  342. package/build-types/form-token-field/types.d.ts.map +1 -1
  343. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -3
  344. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  345. package/build-types/navigator/navigator-button/hook.d.ts +0 -3
  346. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  347. package/build-types/placeholder/test/index.d.ts +2 -0
  348. package/build-types/{flyout → placeholder/test}/index.d.ts.map +1 -1
  349. package/build-types/popover/index.d.ts +1 -1
  350. package/build-types/popover/index.d.ts.map +1 -1
  351. package/build-types/popover/utils.d.ts +26 -69
  352. package/build-types/popover/utils.d.ts.map +1 -1
  353. package/build-types/range-control/index.d.ts +2 -2
  354. package/build-types/range-control/index.d.ts.map +1 -1
  355. package/build-types/range-control/styles/range-control-styles.d.ts +5 -2
  356. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  357. package/build-types/range-control/types.d.ts +2 -2
  358. package/build-types/range-control/types.d.ts.map +1 -1
  359. package/build-types/select-control/chevron-down.d.ts +4 -0
  360. package/build-types/select-control/chevron-down.d.ts.map +1 -0
  361. package/build-types/select-control/index.d.ts.map +1 -1
  362. package/build-types/select-control/styles/select-control-styles.d.ts +8 -0
  363. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  364. package/build-types/spinner/index.d.ts.map +1 -1
  365. package/build-types/toggle-group-control/stories/index.d.ts +25 -0
  366. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -0
  367. package/build-types/toggle-group-control/test/index.d.ts +2 -0
  368. package/build-types/toggle-group-control/test/index.d.ts.map +1 -0
  369. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +6 -3
  370. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  371. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -0
  372. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  373. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +6 -7
  374. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  375. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  376. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +4 -0
  377. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  378. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +11 -9
  379. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  380. package/build-types/toggle-group-control/types.d.ts +23 -10
  381. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  382. package/build-types/ui/context/context-connect.d.ts +3 -0
  383. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  384. package/build-types/ui/form-group/use-form-group.d.ts +2 -2
  385. package/build-types/unit-control/index.d.ts +2 -1
  386. package/build-types/unit-control/index.d.ts.map +1 -1
  387. package/build-types/unit-control/types.d.ts +5 -1
  388. package/build-types/unit-control/types.d.ts.map +1 -1
  389. package/build-types/utils/colors-values.d.ts +18 -97
  390. package/build-types/utils/colors-values.d.ts.map +1 -1
  391. package/build-types/utils/rtl.d.ts.map +1 -1
  392. package/build-types/utils/strings.d.ts +2 -0
  393. package/build-types/utils/strings.d.ts.map +1 -0
  394. package/package.json +22 -21
  395. package/src/alignment-matrix-control/index.js +1 -1
  396. package/src/alignment-matrix-control/stories/index.js +49 -24
  397. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -3
  398. package/src/angle-picker-control/index.js +7 -1
  399. package/src/angle-picker-control/stories/index.js +8 -5
  400. package/src/angle-picker-control/styles/angle-picker-control-styles.js +12 -3
  401. package/src/autocomplete/index.js +9 -18
  402. package/src/base-control/styles/base-control-styles.ts +1 -1
  403. package/src/base-field/styles.js +1 -1
  404. package/src/base-field/test/__snapshots__/index.js.snap +2 -2
  405. package/src/box-control/styles/box-control-visualizer-styles.js +0 -1
  406. package/src/box-control/test/index.js +8 -8
  407. package/src/button/test/index.js +188 -146
  408. package/src/color-list-picker/index.js +15 -3
  409. package/src/color-list-picker/style.scss +11 -0
  410. package/src/color-palette/index.js +32 -16
  411. package/src/color-palette/index.native.js +10 -6
  412. package/src/color-palette/stories/index.js +1 -1
  413. package/src/color-palette/test/__snapshots__/index.js.snap +17 -3
  414. package/src/combobox-control/index.js +6 -5
  415. package/src/combobox-control/stories/index.js +9 -3
  416. package/src/combobox-control/style.scss +0 -1
  417. package/src/confirm-dialog/test/index.js +85 -62
  418. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  419. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +54 -50
  420. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -3
  421. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/test/utils.js +0 -0
  422. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  423. package/src/custom-gradient-picker/index.js +18 -3
  424. package/src/custom-gradient-picker/stories/index.js +4 -3
  425. package/src/custom-gradient-picker/style.scss +30 -27
  426. package/src/custom-select-control/README.md +10 -0
  427. package/src/custom-select-control/index.js +22 -16
  428. package/src/custom-select-control/stories/index.js +1 -1
  429. package/src/custom-select-control/style.scss +0 -12
  430. package/src/custom-select-control/styles.ts +28 -0
  431. package/src/custom-select-control/test/index.js +4 -1
  432. package/src/date-time/constants.ts +1 -0
  433. package/src/date-time/date/index.tsx +289 -184
  434. package/src/date-time/date/styles.ts +86 -27
  435. package/src/date-time/date/test/index.tsx +18 -28
  436. package/src/date-time/date-time/index.tsx +3 -2
  437. package/src/date-time/time/index.tsx +23 -19
  438. package/src/date-time/utils.ts +17 -0
  439. package/src/dimension-control/index.js +1 -5
  440. package/src/disabled/index.tsx +80 -0
  441. package/src/disabled/stories/index.tsx +87 -0
  442. package/src/disabled/styles/{disabled-styles.js → disabled-styles.tsx} +0 -0
  443. package/src/disabled/test/index.tsx +174 -0
  444. package/src/disabled/types.ts +13 -0
  445. package/src/dropdown/index.js +3 -5
  446. package/src/dropdown-menu/stories/index.js +13 -2
  447. package/src/duotone-picker/custom-duotone-bar.js +1 -1
  448. package/src/duotone-picker/duotone-picker.js +34 -26
  449. package/src/duotone-picker/duotone-swatch.js +12 -5
  450. package/src/duotone-picker/stories/duotone-picker.js +66 -0
  451. package/src/duotone-picker/stories/duotone-swatch.js +32 -0
  452. package/src/focal-point-picker/index.js +10 -5
  453. package/src/focal-point-picker/styles/focal-point-style.js +0 -1
  454. package/src/focal-point-picker/test/index.js +78 -45
  455. package/src/font-size-picker/index.js +161 -144
  456. package/src/font-size-picker/stories/index.js +1 -0
  457. package/src/font-size-picker/style.scss +8 -5
  458. package/src/font-size-picker/test/index.js +13 -6
  459. package/src/font-size-picker/test/{util.js → utils.js} +77 -1
  460. package/src/font-size-picker/utils.js +38 -23
  461. package/src/form-token-field/README.md +1 -0
  462. package/src/form-token-field/index.tsx +24 -10
  463. package/src/form-token-field/stories/index.tsx +8 -0
  464. package/src/form-token-field/test/index.js +31 -0
  465. package/src/form-token-field/types.ts +7 -0
  466. package/src/gradient-picker/index.js +22 -7
  467. package/src/gradient-picker/stories/index.js +56 -81
  468. package/src/guide/index.js +3 -1
  469. package/src/guide/page-control.js +1 -6
  470. package/src/guide/stories/index.js +12 -11
  471. package/src/guide/test/index.js +54 -37
  472. package/src/guide/test/page-control.js +14 -17
  473. package/src/higher-order/with-notices/test/index.js +4 -2
  474. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  475. package/src/item-group/styles.ts +3 -3
  476. package/src/menu-group/test/index.js +18 -7
  477. package/src/mobile/bottom-sheet/index.native.js +2 -4
  478. package/src/mobile/global-styles-context/utils.native.js +2 -1
  479. package/src/mobile/image/index.native.js +9 -30
  480. package/src/mobile/picker/index.android.js +10 -4
  481. package/src/mobile/picker/styles.native.scss +4 -4
  482. package/src/modal/index.js +1 -2
  483. package/src/modal/test/index.js +11 -9
  484. package/src/navigable-container/container.js +12 -18
  485. package/src/navigable-container/test/menu.js +14 -11
  486. package/src/navigator/navigator-back-button/hook.ts +0 -3
  487. package/src/navigator/navigator-button/hook.ts +0 -3
  488. package/src/notice/list.js +12 -10
  489. package/src/palette-edit/index.js +1 -0
  490. package/src/palette-edit/styles.js +6 -5
  491. package/src/placeholder/README.md +1 -1
  492. package/src/placeholder/style.scss +65 -20
  493. package/src/placeholder/test/index.tsx +174 -0
  494. package/src/popover/index.js +133 -112
  495. package/src/popover/stories/index.js +17 -3
  496. package/src/popover/test/__snapshots__/index.js.snap +6 -6
  497. package/src/popover/test/index.js +129 -36
  498. package/src/popover/utils.js +107 -0
  499. package/src/range-control/index.tsx +3 -0
  500. package/src/range-control/styles/range-control-styles.ts +9 -4
  501. package/src/range-control/types.ts +5 -2
  502. package/src/select-control/chevron-down.tsx +25 -0
  503. package/src/select-control/index.tsx +6 -9
  504. package/src/select-control/styles/select-control-styles.ts +23 -14
  505. package/src/slot-fill/test/slot.js +5 -5
  506. package/src/snackbar/list.js +3 -2
  507. package/src/spinner/index.tsx +2 -0
  508. package/src/style.scss +0 -2
  509. package/src/text/styles.js +1 -1
  510. package/src/text/test/index.tsx +1 -1
  511. package/src/toggle-group-control/stories/index.tsx +127 -0
  512. package/src/toggle-group-control/test/__snapshots__/{index.js.snap → index.tsx.snap} +28 -22
  513. package/src/toggle-group-control/test/{index.js → index.tsx} +2 -4
  514. package/src/toggle-group-control/toggle-group-control/README.md +2 -0
  515. package/src/toggle-group-control/toggle-group-control/component.tsx +18 -9
  516. package/src/toggle-group-control/toggle-group-control/styles.ts +9 -6
  517. package/src/toggle-group-control/toggle-group-control-option/component.tsx +19 -3
  518. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -0
  519. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +18 -0
  520. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +6 -8
  521. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +30 -7
  522. package/src/toggle-group-control/types.ts +74 -59
  523. package/src/toolbar/test/index.js +4 -4
  524. package/src/toolbar-group/test/index.js +9 -15
  525. package/src/tools-panel/styles.ts +2 -2
  526. package/src/tools-panel/test/index.js +3 -2
  527. package/src/tooltip/test/index.js +188 -172
  528. package/src/ui/context/context-connect.ts +3 -2
  529. package/src/unit-control/index.tsx +2 -2
  530. package/src/unit-control/types.ts +10 -1
  531. package/src/utils/colors-values.js +42 -137
  532. package/src/utils/config-values.js +1 -1
  533. package/src/utils/input/input-control.js +6 -6
  534. package/src/utils/rtl.js +6 -2
  535. package/src/utils/strings.ts +72 -0
  536. package/src/utils/test/strings.js +15 -0
  537. package/tsconfig.json +0 -1
  538. package/tsconfig.tsbuildinfo +1 -1
  539. package/build/custom-gradient-bar/constants.js.map +0 -1
  540. package/build/custom-gradient-bar/control-points.js.map +0 -1
  541. package/build/custom-gradient-bar/index.js.map +0 -1
  542. package/build/custom-gradient-bar/utils.js.map +0 -1
  543. package/build/date-time/date/utils.js +0 -34
  544. package/build/date-time/date/utils.js.map +0 -1
  545. package/build/swatch/index.js +0 -41
  546. package/build/swatch/index.js.map +0 -1
  547. package/build-module/custom-gradient-bar/constants.js.map +0 -1
  548. package/build-module/custom-gradient-bar/control-points.js.map +0 -1
  549. package/build-module/custom-gradient-bar/index.js.map +0 -1
  550. package/build-module/custom-gradient-bar/utils.js.map +0 -1
  551. package/build-module/date-time/date/utils.js +0 -22
  552. package/build-module/date-time/date/utils.js.map +0 -1
  553. package/build-module/swatch/index.js +0 -30
  554. package/build-module/swatch/index.js.map +0 -1
  555. package/build-types/color-picker/color-display.d.ts +0 -13
  556. package/build-types/color-picker/color-display.d.ts.map +0 -1
  557. package/build-types/date-time/date/test/utils.d.ts +0 -2
  558. package/build-types/date-time/date/test/utils.d.ts.map +0 -1
  559. package/build-types/date-time/date/utils.d.ts +0 -15
  560. package/build-types/date-time/date/utils.d.ts.map +0 -1
  561. package/build-types/flyout/context.d.ts +0 -6
  562. package/build-types/flyout/context.d.ts.map +0 -1
  563. package/build-types/flyout/flyout/component.d.ts +0 -21
  564. package/build-types/flyout/flyout/component.d.ts.map +0 -1
  565. package/build-types/flyout/flyout/hook.d.ts +0 -270
  566. package/build-types/flyout/flyout/hook.d.ts.map +0 -1
  567. package/build-types/flyout/flyout/index.d.ts +0 -3
  568. package/build-types/flyout/flyout-content/component.d.ts +0 -3
  569. package/build-types/flyout/flyout-content/component.d.ts.map +0 -1
  570. package/build-types/flyout/flyout-content/index.d.ts +0 -2
  571. package/build-types/flyout/flyout-content/index.d.ts.map +0 -1
  572. package/build-types/flyout/index.d.ts +0 -2
  573. package/build-types/flyout/styles.d.ts +0 -22
  574. package/build-types/flyout/styles.d.ts.map +0 -1
  575. package/build-types/flyout/types.d.ts +0 -80
  576. package/build-types/flyout/types.d.ts.map +0 -1
  577. package/build-types/flyout/utils.d.ts +0 -8
  578. package/build-types/flyout/utils.d.ts.map +0 -1
  579. package/build-types/swatch/index.d.ts +0 -5
  580. package/build-types/swatch/index.d.ts.map +0 -1
  581. package/build-types/swatch/types.d.ts +0 -11
  582. package/build-types/swatch/types.d.ts.map +0 -1
  583. package/build-types/utils/hooks/use-combined-ref.d.ts +0 -8
  584. package/build-types/utils/hooks/use-combined-ref.d.ts.map +0 -1
  585. package/src/date-time/date/datepicker.scss +0 -863
  586. package/src/date-time/date/style.scss +0 -85
  587. package/src/date-time/date/test/utils.ts +0 -32
  588. package/src/date-time/date/utils.ts +0 -20
  589. package/src/date-time/style.scss +0 -1
  590. package/src/disabled/index.js +0 -55
  591. package/src/disabled/stories/index.js +0 -61
  592. package/src/disabled/test/index.js +0 -240
  593. package/src/menu-group/test/__snapshots__/index.js.snap +0 -23
  594. package/src/placeholder/test/index.js +0 -163
  595. package/src/swatch/index.tsx +0 -22
  596. package/src/swatch/style.scss +0 -21
  597. package/src/swatch/types.ts +0 -11
  598. package/src/toggle-group-control/stories/index.js +0 -203
  599. package/src/tools-panel/test/__snapshots__/index.js.snap +0 -210
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tools-panel/styles.ts"],"names":["toolsPanelGrid","columns","css","spacing","item","fullWidth","ToolsPanel","CONFIG","borderWidth","COLORS","gray","ToolsPanelWithInnerWrapper","ToolsPanelHiddenInnerWrapper","ToolsPanelHeader","ToolsPanelHeading","ToolsPanelItem","BaseControlWrapper","BaseControlField","BaseControlHelp","LabelWrapper","ToolsPanelItemPlaceholder","DropdownMenu"],"mappings":";;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AACA;;;;AAEA,MAAMA,cAAc,GAAG;AACtBC,EAAAA,OAAO,EAAIA,OAAF,qBAAuBC,UAAvB,4BACmB,WAAWD,OAAS,oBADvC,4qKADa;AAItBE,EAAAA,OAAO,mBAAED,UAAF,iBACS,kBAAO,CAAP,CADT,eAEM,kBAAO,CAAP,CAFN,qqKAJe;AAQtBE,EAAAA,IAAI,EAAE;AACLC,IAAAA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADJ;AARgB,CAAvB;;AAeO,MAAMC,UAAU,GAAKL,OAAF,qBAAuBC,UAAvB,EACtBF,cAAc,CAACC,OAAf,CAAwBA,OAAxB,CADsB,OAEtBD,cAAc,CAACG,OAFO,kBAIVI,cAAOC,WAJG,aAIoBC,cAAOC,IAAP,CAAa,GAAb,CAJpB,+BAMb,kBAAO,CAAP,CANa,wqKAAnB;AASP;AACA;AACA;AACA;AACA;;;;;AAEO,MAAMC,0BAA0B,GAAKV,OAAF,IAAuB;AAChE,0BAAOC,UAAP,8CAGKF,cAAc,CAACC,OAAf,CAAwBA,OAAxB,CAHL,OAIKD,cAAc,CAACG,OAJpB,OAKKH,cAAc,CAACI,IAAf,CAAoBC,SALzB;AAQA,CATM;;;AAWA,MAAMO,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAlC;;AAMA,MAAMC,gBAAgB,oBAAGX,UAAH,EACzBF,cAAc,CAACI,IAAf,CAAoBC,SADK,WAEpB,kBAAO,CAAP,CAFoB,wCAYhB,kBAAO,CAAC,CAAR,CAZgB,mFAiBb,kBAAO,CAAP,CAjBa,+qKAAtB;;AAqBA,MAAMS,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAvB;;AAWA,MAAMC,cAAc,oBAAGb,UAAH,EACvBF,cAAc,CAACI,IAAf,CAAoBC,SADG,2EAapBW,0BAboB,uBAqBtBC,8BArBsB,oCA0BvBC,6BA1BuB,2BAqCpBC,gCArCoB,ssKAApB;;AA4CA,MAAMC,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAA/B;;AAIA,MAAMC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAlB","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport {\n\tStyledField as BaseControlField,\n\tStyledHelp as BaseControlHelp,\n\tWrapper as BaseControlWrapper,\n} from '../base-control/styles/base-control-styles';\nimport { LabelWrapper } from '../input-control/styles/input-control-styles';\nimport { COLORS, CONFIG } from '../utils';\nimport { space } from '../ui/utils/space';\n\nconst toolsPanelGrid = {\n\tcolumns: ( columns: number ) => css`\n\t\tgrid-template-columns: ${ `repeat( ${ columns }, minmax(0, 1fr) )` };\n\t`,\n\tspacing: css`\n\t\tcolumn-gap: ${ space( 4 ) };\n\t\trow-gap: ${ space( 6 ) };\n\t`,\n\titem: {\n\t\tfullWidth: css`\n\t\t\tgrid-column: 1 / -1;\n\t\t`,\n\t},\n};\n\nexport const ToolsPanel = ( columns: number ) => css`\n\t${ toolsPanelGrid.columns( columns ) }\n\t${ toolsPanelGrid.spacing }\n\n\tborder-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 300 ] };\n\tmargin-top: -1px;\n\tpadding: ${ space( 4 ) };\n`;\n\n/**\n * Items injected into a ToolsPanel via a virtual bubbling slot will require\n * an inner dom element to be injected. The following rule allows for the\n * CSS grid display to be re-established.\n */\n\nexport const ToolsPanelWithInnerWrapper = ( columns: number ) => {\n\treturn css`\n\t\t> div:not( :first-of-type ) {\n\t\t\tdisplay: grid;\n\t\t\t${ toolsPanelGrid.columns( columns ) }\n\t\t\t${ toolsPanelGrid.spacing }\n\t\t\t${ toolsPanelGrid.item.fullWidth }\n\t\t}\n\t`;\n};\n\nexport const ToolsPanelHiddenInnerWrapper = css`\n\t> div:not( :first-of-type ) {\n\t\tdisplay: none;\n\t}\n`;\n\nexport const ToolsPanelHeader = css`\n\t${ toolsPanelGrid.item.fullWidth }\n\tgap: ${ space( 2 ) };\n\n\t/**\n\t * The targeting of dropdown menu component classes here is a temporary\n\t * measure only.\n\t *\n\t * The following styles should be replaced once the DropdownMenu has been\n\t * refactored and can be targeted via component interpolation.\n\t */\n\t.components-dropdown-menu {\n\t\tmargin: ${ space( -1 ) } 0;\n\t\tline-height: 0;\n\t}\n\t&&&& .components-dropdown-menu__toggle {\n\t\tpadding: 0;\n\t\tmin-width: ${ space( 6 ) };\n\t}\n`;\n\nexport const ToolsPanelHeading = css`\n\tfont-size: inherit;\n\tfont-weight: 500;\n\tline-height: normal;\n\n\t/* Required to meet specificity requirements to ensure zero margin */\n\t&& {\n\t\tmargin: 0;\n\t}\n`;\n\nexport const ToolsPanelItem = css`\n\t${ toolsPanelGrid.item.fullWidth }\n\n\t/* Clear spacing in and around controls added as panel items. */\n\t/* Remove when they can be addressed via context system. */\n\t& > div,\n\t& > fieldset {\n\t\tpadding-bottom: 0;\n\t\tmargin-bottom: 0;\n\t\tmax-width: 100%;\n\t}\n\n\t/* Remove BaseControl components margins and leave spacing to grid layout */\n\t&& ${ BaseControlWrapper } {\n\t\tmargin-bottom: 0;\n\n\t\t/**\n\t\t * To maintain proper spacing within a base control, the field's bottom\n\t\t * margin should only be removed when there is no help text included and\n\t\t * it is therefore the last-child.\n\t\t */\n\t\t${ BaseControlField }:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t${ BaseControlHelp } {\n\t\tmargin-bottom: 0;\n\t}\n\n\t/**\n\t * Standardize InputControl and BaseControl labels with other labels when\n\t * inside ToolsPanel.\n\t *\n\t * This is a temporary fix until the different control components have their\n\t * labels normalized.\n\t */\n\t&& ${ LabelWrapper } {\n\t\tlabel {\n\t\t\tline-height: 1.4em;\n\t\t}\n\t}\n`;\n\nexport const ToolsPanelItemPlaceholder = css`\n\tdisplay: none;\n`;\n\nexport const DropdownMenu = css`\n\tmin-width: 200px;\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tools-panel/styles.ts"],"names":["toolsPanelGrid","columns","css","spacing","item","fullWidth","ToolsPanel","CONFIG","borderWidth","COLORS","gray","ToolsPanelWithInnerWrapper","ToolsPanelHiddenInnerWrapper","ToolsPanelHeader","ToolsPanelHeading","ToolsPanelItem","BaseControlWrapper","BaseControlField","BaseControlHelp","LabelWrapper","ToolsPanelItemPlaceholder","DropdownMenu"],"mappings":";;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AACA;;;;AAEA,MAAMA,cAAc,GAAG;AACtBC,EAAAA,OAAO,EAAIA,OAAF,qBAAuBC,UAAvB,4BACmB,WAAWD,OAAS,oBADvC,4qKADa;AAItBE,EAAAA,OAAO,mBAAED,UAAF,iBACS,kBAAO,CAAP,CADT,eAEM,kBAAO,CAAP,CAFN,qqKAJe;AAQtBE,EAAAA,IAA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\n * Internal dependencies\n */\nimport {\n\tStyledField as BaseControlField,\n\tStyledHelp as BaseControlHelp,\n\tWrapper as BaseControlWrapper,\n} from '../base-control/styles/base-control-styles';\nimport { LabelWrapper } from '../input-control/styles/input-control-styles';\nimport { COLORS, CONFIG } from '../utils';\nimport { space } from '../ui/utils/space';\n\nconst toolsPanelGrid = {\n\tcolumns: ( columns: number ) => css`\n\t\tgrid-template-columns: ${ `repeat( ${ columns }, minmax(0, 1fr) )` };\n\t`,\n\tspacing: css`\n\t\tcolumn-gap: ${ space( 2 ) };\n\t\trow-gap: ${ space( 4 ) };\n\t`,\n\titem: {\n\t\tfullWidth: css`\n\t\t\tgrid-column: 1 / -1;\n\t\t`,\n\t},\n};\n\nexport const ToolsPanel = ( columns: number ) => css`\n\t${ toolsPanelGrid.columns( columns ) }\n\t${ toolsPanelGrid.spacing }\n\n\tborder-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 300 ] };\n\tmargin-top: -1px;\n\tpadding: ${ space( 4 ) };\n`;\n\n/**\n * Items injected into a ToolsPanel via a virtual bubbling slot will require\n * an inner dom element to be injected. The following rule allows for the\n * CSS grid display to be re-established.\n */\n\nexport const ToolsPanelWithInnerWrapper = ( columns: number ) => {\n\treturn css`\n\t\t> div:not( :first-of-type ) {\n\t\t\tdisplay: grid;\n\t\t\t${ toolsPanelGrid.columns( columns ) }\n\t\t\t${ toolsPanelGrid.spacing }\n\t\t\t${ toolsPanelGrid.item.fullWidth }\n\t\t}\n\t`;\n};\n\nexport const ToolsPanelHiddenInnerWrapper = css`\n\t> div:not( :first-of-type ) {\n\t\tdisplay: none;\n\t}\n`;\n\nexport const ToolsPanelHeader = css`\n\t${ toolsPanelGrid.item.fullWidth }\n\tgap: ${ space( 2 ) };\n\n\t/**\n\t * The targeting of dropdown menu component classes here is a temporary\n\t * measure only.\n\t *\n\t * The following styles should be replaced once the DropdownMenu has been\n\t * refactored and can be targeted via component interpolation.\n\t */\n\t.components-dropdown-menu {\n\t\tmargin: ${ space( -1 ) } 0;\n\t\tline-height: 0;\n\t}\n\t&&&& .components-dropdown-menu__toggle {\n\t\tpadding: 0;\n\t\tmin-width: ${ space( 6 ) };\n\t}\n`;\n\nexport const ToolsPanelHeading = css`\n\tfont-size: inherit;\n\tfont-weight: 500;\n\tline-height: normal;\n\n\t/* Required to meet specificity requirements to ensure zero margin */\n\t&& {\n\t\tmargin: 0;\n\t}\n`;\n\nexport const ToolsPanelItem = css`\n\t${ toolsPanelGrid.item.fullWidth }\n\n\t/* Clear spacing in and around controls added as panel items. */\n\t/* Remove when they can be addressed via context system. */\n\t& > div,\n\t& > fieldset {\n\t\tpadding-bottom: 0;\n\t\tmargin-bottom: 0;\n\t\tmax-width: 100%;\n\t}\n\n\t/* Remove BaseControl components margins and leave spacing to grid layout */\n\t&& ${ BaseControlWrapper } {\n\t\tmargin-bottom: 0;\n\n\t\t/**\n\t\t * To maintain proper spacing within a base control, the field's bottom\n\t\t * margin should only be removed when there is no help text included and\n\t\t * it is therefore the last-child.\n\t\t */\n\t\t${ BaseControlField }:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t${ BaseControlHelp } {\n\t\tmargin-bottom: 0;\n\t}\n\n\t/**\n\t * Standardize InputControl and BaseControl labels with other labels when\n\t * inside ToolsPanel.\n\t *\n\t * This is a temporary fix until the different control components have their\n\t * labels normalized.\n\t */\n\t&& ${ LabelWrapper } {\n\t\tlabel {\n\t\t\tline-height: 1.4em;\n\t\t}\n\t}\n`;\n\nexport const ToolsPanelItemPlaceholder = css`\n\tdisplay: none;\n`;\n\nexport const DropdownMenu = css`\n\tmin-width: 200px;\n`;\n"]}
@@ -9,8 +9,6 @@ exports.contextConnect = contextConnect;
9
9
  exports.getConnectNamespace = getConnectNamespace;
10
10
  exports.hasConnectNamespace = hasConnectNamespace;
11
11
 
12
- var _lodash = require("lodash");
13
-
14
12
  var _element = require("@wordpress/element");
15
13
 
16
14
  var _warning = _interopRequireDefault(require("@wordpress/warning"));
@@ -76,7 +74,7 @@ function contextConnect(Component, namespace) {
76
74
 
77
75
  WrappedComponent.displayName = namespace; // @ts-ignore internal property
78
76
 
79
- WrappedComponent[_constants.CONNECT_STATIC_NAMESPACE] = (0, _lodash.uniq)(mergedNamespace); // @ts-ignore WordPressComponent property
77
+ WrappedComponent[_constants.CONNECT_STATIC_NAMESPACE] = [...new Set(mergedNamespace)]; // @ts-ignore WordPressComponent property
80
78
 
81
79
  WrappedComponent.selector = `.${(0, _getStyledClassNameFromKey.getStyledClassNameFromKey)(namespace)}`; // @ts-ignore
82
80
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/context/context-connect.ts"],"names":["contextConnect","Component","namespace","options","memo","memoProp","WrappedComponent","mergedNamespace","CONNECT_STATIC_NAMESPACE","Array","isArray","displayName","selector","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"mappings":";;;;;;;;;;;AAGA;;AAMA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CACNC,SADM,EAENC,SAFM,EAI6B;AAAA,MADnCC,OACmC,uEADF,EACE;AACnC,QAAM;AAAEC,IAAAA,IAAI,EAAEC,QAAQ,GAAG;AAAnB,MAA6BF,OAAnC;AAEA,MAAIG,gBAAgB,GAAG,yBAAYL,SAAZ,CAAvB;;AACA,MAAKI,QAAL,EAAgB;AACf;AACAC,IAAAA,gBAAgB,GAAG,mBAAMA,gBAAN,CAAnB;AACA;;AAED,MAAK,OAAOJ,SAAP,KAAqB,WAA1B,EAAwC;AACvC,mHAAM,4CAAN;AACA,GAXkC,CAanC;;;AACA,MAAIK,eAAe,GAAGD,gBAAgB,CAAEE,mCAAF,CAAhB,IAAgD,CACrEN,SADqE,CAAtE;AAIA;AACD;AACA;;AACC,MAAKO,KAAK,CAACC,OAAN,C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CAAP;AACA;;AACD,MAAKR,KAAK,CAACC,OAAN,CAAeO,KAAf,CAAL,EAA8B;AAC7B,WAAOA,KAAK,CAACE,IAAN,CAAcC,MAAF,IAClBP,mBAAmB,CAAEZ,SAAF,CAAnB,CAAiCiB,QAAjC,CAA2CE,MAA3C,CADM,CAAP;AAGA;;AAED,SAAO,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { uniq } from 'lodash';\nimport type { ForwardedRef, ReactChild, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, memo } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { CONNECT_STATIC_NAMESPACE } from './constants';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport type { WordPressComponentFromProps } from '.';\n\ntype ContextConnectOptions = {\n\t/** Defaults to `false`. */\n\tmemo?: boolean;\n};\n\n/**\n * Forwards ref (React.ForwardRef) and \"Connects\" (or registers) a component\n * within the Context system under a specified namespace.\n *\n * This is an (experimental) evolution of the initial connect() HOC.\n * The hope is that we can improve render performance by removing functional\n * component wrappers.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @param options\n * @return The connected WordPressComponent\n */\nexport function contextConnect< P >(\n\tComponent: ( props: P, ref: ForwardedRef< any > ) => JSX.Element | null,\n\tnamespace: string,\n\toptions: ContextConnectOptions = {}\n): WordPressComponentFromProps< P > {\n\tconst { memo: memoProp = false } = options;\n\n\tlet WrappedComponent = forwardRef( Component );\n\tif ( memoProp ) {\n\t\t// @ts-ignore\n\t\tWrappedComponent = memo( WrappedComponent );\n\t}\n\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'contextConnect: Please provide a namespace' );\n\t}\n\n\t// @ts-ignore internal property\n\tlet mergedNamespace = WrappedComponent[ CONNECT_STATIC_NAMESPACE ] || [\n\t\tnamespace,\n\t];\n\n\t/**\n\t * Consolidate (merge) namespaces before attaching it to the WrappedComponent.\n\t */\n\tif ( Array.isArray( namespace ) ) {\n\t\tmergedNamespace = [ ...mergedNamespace, ...namespace ];\n\t}\n\tif ( typeof namespace === 'string' ) {\n\t\tmergedNamespace = [ ...mergedNamespace, namespace ];\n\t}\n\n\tWrappedComponent.displayName = namespace;\n\n\t// @ts-ignore internal property\n\tWrappedComponent[ CONNECT_STATIC_NAMESPACE ] = uniq( mergedNamespace );\n\n\t// @ts-ignore WordPressComponent property\n\tWrappedComponent.selector = `.${ getStyledClassNameFromKey( namespace ) }`;\n\n\t// @ts-ignore\n\treturn WrappedComponent;\n}\n\n/**\n * Attempts to retrieve the connected namespace from a component.\n *\n * @param Component The component to retrieve a namespace from.\n * @return The connected namespaces.\n */\nexport function getConnectNamespace(\n\tComponent: ReactChild | undefined | {}\n): string[] {\n\tif ( ! Component ) return [];\n\n\tlet namespaces = [];\n\n\t// @ts-ignore internal property\n\tif ( Component[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore internal property\n\t\tnamespaces = Component[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\t// @ts-ignore\n\tif ( Component.type && Component.type[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore\n\t\tnamespaces = Component.type[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\treturn namespaces;\n}\n\n/**\n * Checks to see if a component is connected within the Context system.\n *\n * @param Component The component to retrieve a namespace from.\n * @param match The namespace to check.\n */\nexport function hasConnectNamespace(\n\tComponent: ReactNode,\n\tmatch: string[] | string\n): boolean {\n\tif ( ! Component ) return false;\n\n\tif ( typeof match === 'string' ) {\n\t\treturn getConnectNamespace( Component ).includes( match );\n\t}\n\tif ( Array.isArray( match ) ) {\n\t\treturn match.some( ( result ) =>\n\t\t\tgetConnectNamespace( Component ).includes( result )\n\t\t);\n\t}\n\n\treturn false;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/context/context-connect.ts"],"names":["contextConnect","Component","namespace","options","memo","memoProp","WrappedComponent","mergedNamespace","CONNECT_STATIC_NAMESPACE","Array","isArray","displayName","Set","selector","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"mappings":";;;;;;;;;;;AAQA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CACNC,SADM,EAENC,SAFM,EAI6B;AAAA,MADnCC,OACmC,uEADF,EACE;AACnC,QAAM;AAAEC,IAAAA,IAAI,EAAEC,QAAQ,GAAG;AAAnB,MAA6BF,OAAnC;AAEA,MAAIG,gBAAgB,GAAG,yBAAYL,SAAZ,CAAvB;;AACA,MAAKI,QAAL,EAAgB;AACf;AACAC,IAAAA,gBAAgB,GAAG,mBAAMA,gBAAN,CAAnB;AACA;;AAED,MAAK,OAAOJ,SAAP,KAAqB,WAA1B,EAAwC;AACvC,mHAAM,4CAAN;AACA,GAXkC,CAanC;;;AACA,MAAIK,eAAe,GAAGD,gBAAgB,CAAEE,mCAAF,CAAhB,IAAgD,CACrEN,SADqE,CAAtE;AAIA;AACD;AACA;;AACC,MAAKO,KAAK,CAACC,OAAN,CAAeR,SAAf,CAAL,EAAkC;AACjCK,IAAAA,eAAe,GAAG,CAAE,GAAGA,eAAL,EAAsB,GAAGL,SAAzB,CAAlB;AACA;;AACD,MAAK,OAAOA,SAAP,KAAqB,QAA1B,EAAqC;AACpCK,IAAAA,eAAe,GAAG,CAAE,GAAGA,eAAL,EAAsBL,SAAtB,CAAlB;AACA;;AAEDI,EAAAA,gBAAgB,CAACK,WAAjB,GAA+BT,SAA/B,CA5BmC,CA8BnC;;AACAI,EAAAA,gBAAgB,CAAEE,mCAAF,CAAhB,GAA+C,CAC9C,GAAG,IAAII,GAAJ,CAASL,eAAT,CAD2C,CAA/C,CA/BmC,CAmCnC;;AACAD,EAAAA,gBAAgB,CAACO,QAAjB,GAA6B,IAAI,0DAA2BX,SAA3B,CAAwC,EAAzE,CApCmC,CAsCnC;;AACA,SAAOI,gBAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASQ,mBAAT,CACNb,SADM,EAEK;AACX,MAAK,CAAEA,SAAP,EAAmB,OAAO,EAAP;AAEnB,MAAIc,UAAU,GAAG,EAAjB,CAHW,CAKX;;AACA,MAAKd,SAAS,CAAEO,mCAAF,CAAd,EAA6C;AAC5C;AACAO,IAAAA,UAAU,GAAGd,SAAS,CAAEO,mCAAF,CAAtB;AACA,GATU,CAWX;;;AACA,MAAKP,SAAS,CAACe,IAAV,IAAkBf,SAAS,CAACe,IAAV,CAAgBR,mCAAhB,CAAvB,EAAoE;AACnE;AACAO,IAAAA,UAAU,GAAGd,SAAS,CAACe,IAAV,CAAgBR,mCAAhB,CAAb;AACA;;AAED,SAAOO,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,mBAAT,CACNhB,SADM,EAENiB,KAFM,EAGI;AACV,MAAK,CAAEjB,SAAP,EAAmB,OAAO,KAAP;;AAEnB,MAAK,OAAOiB,KAAP,KAAiB,QAAtB,EAAiC;AAChC,WAAOJ,mBAAmB,CAAEb,SAAF,CAAnB,CAAiCkB,QAAjC,CAA2CD,KAA3C,CAAP;AACA;;AACD,MAAKT,KAAK,CAACC,OAAN,CAAeQ,KAAf,CAAL,EAA8B;AAC7B,WAAOA,KAAK,CAACE,IAAN,CAAcC,MAAF,IAClBP,mBAAmB,CAAEb,SAAF,CAAnB,CAAiCkB,QAAjC,CAA2CE,MAA3C,CADM,CAAP;AAGA;;AAED,SAAO,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, ReactChild, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, memo } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { CONNECT_STATIC_NAMESPACE } from './constants';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport type { WordPressComponentFromProps } from '.';\n\ntype ContextConnectOptions = {\n\t/** Defaults to `false`. */\n\tmemo?: boolean;\n};\n\n/**\n * Forwards ref (React.ForwardRef) and \"Connects\" (or registers) a component\n * within the Context system under a specified namespace.\n *\n * This is an (experimental) evolution of the initial connect() HOC.\n * The hope is that we can improve render performance by removing functional\n * component wrappers.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @param options\n * @return The connected WordPressComponent\n */\nexport function contextConnect< P >(\n\tComponent: ( props: P, ref: ForwardedRef< any > ) => JSX.Element | null,\n\tnamespace: string,\n\toptions: ContextConnectOptions = {}\n): WordPressComponentFromProps< P > {\n\tconst { memo: memoProp = false } = options;\n\n\tlet WrappedComponent = forwardRef( Component );\n\tif ( memoProp ) {\n\t\t// @ts-ignore\n\t\tWrappedComponent = memo( WrappedComponent );\n\t}\n\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'contextConnect: Please provide a namespace' );\n\t}\n\n\t// @ts-ignore internal property\n\tlet mergedNamespace = WrappedComponent[ CONNECT_STATIC_NAMESPACE ] || [\n\t\tnamespace,\n\t];\n\n\t/**\n\t * Consolidate (merge) namespaces before attaching it to the WrappedComponent.\n\t */\n\tif ( Array.isArray( namespace ) ) {\n\t\tmergedNamespace = [ ...mergedNamespace, ...namespace ];\n\t}\n\tif ( typeof namespace === 'string' ) {\n\t\tmergedNamespace = [ ...mergedNamespace, namespace ];\n\t}\n\n\tWrappedComponent.displayName = namespace;\n\n\t// @ts-ignore internal property\n\tWrappedComponent[ CONNECT_STATIC_NAMESPACE ] = [\n\t\t...new Set( mergedNamespace ),\n\t];\n\n\t// @ts-ignore WordPressComponent property\n\tWrappedComponent.selector = `.${ getStyledClassNameFromKey( namespace ) }`;\n\n\t// @ts-ignore\n\treturn WrappedComponent;\n}\n\n/**\n * Attempts to retrieve the connected namespace from a component.\n *\n * @param Component The component to retrieve a namespace from.\n * @return The connected namespaces.\n */\nexport function getConnectNamespace(\n\tComponent: ReactChild | undefined | {}\n): string[] {\n\tif ( ! Component ) return [];\n\n\tlet namespaces = [];\n\n\t// @ts-ignore internal property\n\tif ( Component[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore internal property\n\t\tnamespaces = Component[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\t// @ts-ignore\n\tif ( Component.type && Component.type[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore\n\t\tnamespaces = Component.type[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\treturn namespaces;\n}\n\n/**\n * Checks to see if a component is connected within the Context system.\n *\n * @param Component The component to retrieve a namespace from.\n * @param match The namespace to check.\n */\nexport function hasConnectNamespace(\n\tComponent: ReactNode,\n\tmatch: string[] | string\n): boolean {\n\tif ( ! Component ) return false;\n\n\tif ( typeof match === 'string' ) {\n\t\treturn getConnectNamespace( Component ).includes( match );\n\t}\n\tif ( Array.isArray( match ) ) {\n\t\treturn match.some( ( result ) =>\n\t\t\tgetConnectNamespace( Component ).includes( result )\n\t\t);\n\t}\n\n\treturn false;\n}\n"]}
@@ -23,8 +23,6 @@ var _element = require("@wordpress/element");
23
23
 
24
24
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
25
25
 
26
- var _lodash = require("lodash");
27
-
28
26
  var _classnames = _interopRequireDefault(require("classnames"));
29
27
 
30
28
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
@@ -56,6 +54,7 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) {
56
54
  const {
57
55
  __unstableStateReducer: stateReducerProp,
58
56
  autoComplete = 'off',
57
+ children,
59
58
  className,
60
59
  disabled = false,
61
60
  disableUnits = false,
@@ -236,7 +235,7 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) {
236
235
  }, (0, _element.createElement)(_unitControlStyles.ValueInput, (0, _extends2.default)({
237
236
  "aria-label": label,
238
237
  type: isPressEnterToChange ? 'text' : 'number'
239
- }, (0, _lodash.omit)(props, ['children']), {
238
+ }, props, {
240
239
  autoComplete: autoComplete,
241
240
  className: classes,
242
241
  disabled: disabled,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/unit-control/index.tsx"],"names":["UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","stateReducerProp","autoComplete","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","style","unit","unitProp","units","unitsProp","CSS_UNITS","value","valueProp","onBlur","onBlurProp","props","since","hint","version","nonNullValueProp","undefined","parsedQuantity","parsedUnit","setUnit","length","initial","fallback","refParsedQuantity","classes","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","mayUpdateUnit","event","isNaN","Number","currentTarget","current","validParsedQuantity","validParsedUnit","Array","isArray","find","option","handleOnBlur","handleOnKeyDown","key","unitControlStateReducer","state","action","nextState","type","inputControlActionTypes","COMMIT","toString","stateReducer","baseState","inputSuffix","step","activeUnit","UnitControl"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkBA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAMA;;AACA;;AACA;;AACA;;AAMA;;;;;;AAlCA;AACA;AACA;;AAYA;AACA;AACA;AAsBA,SAASA,sBAAT,CACCC,gBADD,EAMCC,YAND,EAOE;AACD,QAAM;AACLC,IAAAA,sBAAsB,EAAEC,gBADnB;AAELC,IAAAA,YAAY,GAAG,KAFV;AAGLC,IAAAA,SAHK;AAILC,IAAAA,QAAQ,GAAG,KAJN;AAKLC,IAAAA,YAAY,GAAG,KALV;AAMLC,IAAAA,oBAAoB,GAAG,KANlB;AAOLC,IAAAA,wBAAwB,GAAG,KAPtB;AAQLC,IAAAA,oBAAoB,GAAG,IARlB;AASLC,IAAAA,KATK;AAULC,IAAAA,QAAQ,EAAEC,YAVL;AAWLC,IAAAA,YAXK;AAYLC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Handler,\n\tKeyboardEvent,\n\tForwardedRef,\n\tSyntheticEvent,\n\tChangeEvent,\n\tPointerEvent,\n} from 'react';\nimport { omit } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { Root, ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedQuantityAndUnit,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedQuantityAndUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\nimport type { StateReducer } from '../input-control/reducer/state';\n\nfunction UnforwardedUnitControl(\n\tunitControlProps: WordPressComponentProps<\n\t\tUnitControlProps,\n\t\t'input',\n\t\tfalse\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tautoComplete = 'off',\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange: onChangeProp,\n\t\tonUnitChange,\n\t\tsize = 'default',\n\t\tstyle,\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\tonBlur: onBlurProp,\n\t\t...props\n\t} = unitControlProps;\n\n\tif ( 'unit' in unitControlProps ) {\n\t\tdeprecated( 'UnitControl unit prop', {\n\t\t\tsince: '5.6',\n\t\t\thint: 'The unit should be provided within the `value` prop.',\n\t\t\tversion: '6.2',\n\t\t} );\n\t}\n\n\t// The `value` prop, in theory, should not be `null`, but the following line\n\t// ensures it fallback to `undefined` in case a consumer of `UnitControl`\n\t// still passes `null` as a `value`.\n\tconst nonNullValueProp = valueProp ?? undefined;\n\tconst units = useMemo(\n\t\t() => getUnitsWithCurrentUnit( nonNullValueProp, unitProp, unitsProp ),\n\t\t[ nonNullValueProp, unitProp, unitsProp ]\n\t);\n\tconst [ parsedQuantity, parsedUnit ] = getParsedQuantityAndUnit(\n\t\tnonNullValueProp,\n\t\tunitProp,\n\t\tunits\n\t);\n\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunits.length === 1 ? units[ 0 ].value : unitProp,\n\t\t{\n\t\t\tinitial: parsedUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( parsedUnit !== undefined ) {\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t}, [ parsedUnit ] );\n\n\t// Stores parsed value for hand-off in state reducer.\n\tconst refParsedQuantity = useRef< number | undefined >( undefined );\n\n\tconst classes = classnames( 'components-unit-control', className );\n\n\tconst handleOnQuantityChange = (\n\t\tnextQuantityValue: number | string | undefined,\n\t\tchangeProps: {\n\t\t\tevent:\n\t\t\t\t| ChangeEvent< HTMLInputElement >\n\t\t\t\t| PointerEvent< HTMLInputElement >;\n\t\t}\n\t) => {\n\t\tif (\n\t\t\tnextQuantityValue === '' ||\n\t\t\ttypeof nextQuantityValue === 'undefined' ||\n\t\t\tnextQuantityValue === null\n\t\t) {\n\t\t\tonChangeProp?.( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tconst onChangeValue = getValidParsedQuantityAndUnit(\n\t\t\tnextQuantityValue,\n\t\t\tunits,\n\t\t\tparsedQuantity,\n\t\t\tunit\n\t\t).join( '' );\n\n\t\tonChangeProp?.( onChangeValue, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnextUnitValue,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ parsedQuantity ?? '' }${ nextUnitValue }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ nextUnitValue }`;\n\t\t}\n\n\t\tonChangeProp?.( nextValue, changeProps );\n\t\tonUnitChange?.( nextUnitValue, changeProps );\n\n\t\tsetUnit( nextUnitValue );\n\t};\n\n\tconst mayUpdateUnit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tif ( ! isNaN( Number( event.currentTarget.value ) ) ) {\n\t\t\trefParsedQuantity.current = undefined;\n\t\t\treturn;\n\t\t}\n\t\tconst [ validParsedQuantity, validParsedUnit ] =\n\t\t\tgetValidParsedQuantityAndUnit(\n\t\t\t\tevent.currentTarget.value,\n\t\t\t\tunits,\n\t\t\t\tparsedQuantity,\n\t\t\t\tunit\n\t\t\t);\n\n\t\trefParsedQuantity.current = validParsedQuantity;\n\n\t\tif ( isPressEnterToChange && validParsedUnit !== unit ) {\n\t\t\tconst data = Array.isArray( units )\n\t\t\t\t? units.find( ( option ) => option.value === validParsedUnit )\n\t\t\t\t: undefined;\n\t\t\tconst changeProps = { event, data };\n\n\t\t\t// The `onChange` callback already gets called, no need to call it explicitely.\n\t\t\tonUnitChange?.( validParsedUnit, changeProps );\n\n\t\t\tsetUnit( validParsedUnit );\n\t\t}\n\t};\n\n\tconst handleOnBlur: FocusEventHandler< HTMLInputElement > = ( event ) => {\n\t\tmayUpdateUnit( event );\n\t\tonBlurProp?.( event );\n\t};\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { key } = event;\n\t\tif ( key === 'Enter' ) {\n\t\t\tmayUpdateUnit( event );\n\t\t}\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @param state State from InputControl\n\t * @param action Action triggering state change\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst unitControlStateReducer: StateReducer = ( state, action ) => {\n\t\tconst nextState = { ...state };\n\n\t\t/*\n\t\t * On commits (when pressing ENTER and on blur if\n\t\t * isPressEnterToChange is true), if a parse has been performed\n\t\t * then use that result to update the state.\n\t\t */\n\t\tif ( action.type === inputControlActionTypes.COMMIT ) {\n\t\t\tif ( refParsedQuantity.current !== undefined ) {\n\t\t\t\tnextState.value = (\n\t\t\t\t\trefParsedQuantity.current ?? ''\n\t\t\t\t).toString();\n\t\t\t\trefParsedQuantity.current = undefined;\n\t\t\t}\n\t\t}\n\n\t\treturn nextState;\n\t};\n\n\tlet stateReducer: StateReducer = unitControlStateReducer;\n\tif ( stateReducerProp ) {\n\t\tstateReducer = ( state, action ) => {\n\t\t\tconst baseState = unitControlStateReducer( state, action );\n\t\t\treturn stateReducerProp( baseState, action );\n\t\t};\n\t}\n\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={ size }\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t\tonBlur={ onBlurProp }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<Root className=\"components-unit-control-wrapper\" style={ style }>\n\t\t\t<ValueInput\n\t\t\t\taria-label={ label }\n\t\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\t\t{ ...omit( props, [ 'children' ] ) }\n\t\t\t\tautoComplete={ autoComplete }\n\t\t\t\tclassName={ classes }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\tlabel={ label }\n\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\t\tonChange={ handleOnQuantityChange }\n\t\t\t\tref={ forwardedRef }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={ inputSuffix }\n\t\t\t\tvalue={ parsedQuantity ?? '' }\n\t\t\t\tstep={ step }\n\t\t\t\t__unstableStateReducer={ stateReducer }\n\t\t\t/>\n\t\t</Root>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * @example\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef( UnforwardedUnitControl );\n\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/unit-control/index.tsx"],"names":["UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","stateReducerProp","autoComplete","children","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","style","unit","unitProp","units","unitsProp","CSS_UNITS","value","valueProp","onBlur","onBlurProp","props","since","hint","version","nonNullValueProp","undefined","parsedQuantity","parsedUnit","setUnit","length","initial","fallback","refParsedQuantity","classes","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","mayUpdateUnit","event","isNaN","Number","currentTarget","current","validParsedQuantity","validParsedUnit","Array","isArray","find","option","handleOnBlur","handleOnKeyDown","key","unitControlStateReducer","state","action","nextState","type","inputControlActionTypes","COMMIT","toString","stateReducer","baseState","inputSuffix","step","activeUnit","UnitControl"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA;;;;AANA;;AAKA;;AAEA;;AAMA;;AACA;;AACA;;AACA;;AAMA;;;;;;AAjCA;AACA;AACA;;AAWA;AACA;AACA;AAsBA,SAASA,sBAAT,CACCC,gBADD,EAMCC,YAND,EAOE;AACD,QAAM;AACLC,IAAAA,sBAAsB,EAAEC,gBADnB;AAELC,IAAAA,YAAY,GAAG,KAFV;AAGLC,IAAAA,QAHK;AAILC,IAAAA,SAJK;AAKLC,IAAAA,QAAQ,GAAG,KALN;AAMLC,IAAAA,YAAY,GAAG,KANV;AAOLC,IAAAA,oBAAoB,GAAG,KAPlB;AAQLC,IAAAA,wBAAwB,GAAG,KARtB;AASLC,IAAAA,oBAAoB,GAAG,IATlB;AAULC,IAAAA,KAVK;AAWLC,IAAAA,QAAQ,EAAEC,YAXL;AAYLC,IAAAA,YAZK;AAaLC,IAAAA,IAAI,GAAG,SAbF;AAcLC,IAAAA,KAdK;AAeLC,IAAAA,IAAI,EAAEC,QAfD;AAgBLC,IAAAA,KAAK,EAAEC,SAAS,GAAGC,gBAhBd;AAiBLC,IAAAA,KAAK,EAAEC,SAjBF;AAkBLC,IAAAA,MAAM,EAAEC,UAlBH;AAmBL,OAAGC;AAnBE,MAoBF3B,gBApBJ;;AAsBA,MAAK,UAAUA,gBAAf,EAAkC;AACjC,6BAAY,uBAAZ,EAAqC;AACpC4B,MAAAA,KAAK,EAAE,KAD6B;AAEpCC,MAAAA,IAAI,EAAE,sDAF8B;AAGpCC,MAAAA,OAAO,EAAE;AAH2B,KAArC;AAKA,GA7BA,CA+BD;AACA;AACA;;;AACA,QAAMC,gBAAgB,GAAGP,SAAH,aAAGA,SAAH,cAAGA,SAAH,GAAgBQ,SAAtC;AACA,QAAMZ,KAAK,GAAG,sBACb,MAAM,oCAAyBW,gBAAzB,EAA2CZ,QAA3C,EAAqDE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AAGC,oBARxB;AASC,IAAA,KAAK,EAAGG,KATT;AAUC,IAAA,MAAM,EAAGmD,YAVV;AAWC,IAAA,SAAS,EAAGC,eAXb;AAYC,IAAA,QAAQ,EAAGvB,sBAZZ;AAaC,IAAA,GAAG,EAAGxC,YAbP;AAcC,IAAA,IAAI,EAAGe,IAdR;AAeC,IAAA,MAAM,EAAG4D,WAfV;AAgBC,IAAA,KAAK,EAAG3C,cAAH,aAAGA,cAAH,cAAGA,cAAH,GAAqB,EAhB3B;AAiBC,IAAA,IAAI,EAAG4C,IAjBR;AAkBC,IAAA,sBAAsB,EAAGH;AAlB1B,KADD,CADD;AAwBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMK,WAAW,GAAG,yBAAYhF,sBAAZ,CAApB;;eAGQgF,W","sourcesContent":["/**\n * External dependencies\n */\nimport type {\n\tFocusEventHandler,\n\tKeyboardEvent,\n\tForwardedRef,\n\tSyntheticEvent,\n\tChangeEvent,\n\tPointerEvent,\n} from 'react';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { Root, ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedQuantityAndUnit,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedQuantityAndUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\nimport type { StateReducer } from '../input-control/reducer/state';\n\nfunction UnforwardedUnitControl(\n\tunitControlProps: WordPressComponentProps<\n\t\tUnitControlProps,\n\t\t'input',\n\t\tfalse\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tautoComplete = 'off',\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange: onChangeProp,\n\t\tonUnitChange,\n\t\tsize = 'default',\n\t\tstyle,\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\tonBlur: onBlurProp,\n\t\t...props\n\t} = unitControlProps;\n\n\tif ( 'unit' in unitControlProps ) {\n\t\tdeprecated( 'UnitControl unit prop', {\n\t\t\tsince: '5.6',\n\t\t\thint: 'The unit should be provided within the `value` prop.',\n\t\t\tversion: '6.2',\n\t\t} );\n\t}\n\n\t// The `value` prop, in theory, should not be `null`, but the following line\n\t// ensures it fallback to `undefined` in case a consumer of `UnitControl`\n\t// still passes `null` as a `value`.\n\tconst nonNullValueProp = valueProp ?? undefined;\n\tconst units = useMemo(\n\t\t() => getUnitsWithCurrentUnit( nonNullValueProp, unitProp, unitsProp ),\n\t\t[ nonNullValueProp, unitProp, unitsProp ]\n\t);\n\tconst [ parsedQuantity, parsedUnit ] = getParsedQuantityAndUnit(\n\t\tnonNullValueProp,\n\t\tunitProp,\n\t\tunits\n\t);\n\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunits.length === 1 ? units[ 0 ].value : unitProp,\n\t\t{\n\t\t\tinitial: parsedUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( parsedUnit !== undefined ) {\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t}, [ parsedUnit ] );\n\n\t// Stores parsed value for hand-off in state reducer.\n\tconst refParsedQuantity = useRef< number | undefined >( undefined );\n\n\tconst classes = classnames( 'components-unit-control', className );\n\n\tconst handleOnQuantityChange = (\n\t\tnextQuantityValue: number | string | undefined,\n\t\tchangeProps: {\n\t\t\tevent:\n\t\t\t\t| ChangeEvent< HTMLInputElement >\n\t\t\t\t| PointerEvent< HTMLInputElement >;\n\t\t}\n\t) => {\n\t\tif (\n\t\t\tnextQuantityValue === '' ||\n\t\t\ttypeof nextQuantityValue === 'undefined' ||\n\t\t\tnextQuantityValue === null\n\t\t) {\n\t\t\tonChangeProp?.( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tconst onChangeValue = getValidParsedQuantityAndUnit(\n\t\t\tnextQuantityValue,\n\t\t\tunits,\n\t\t\tparsedQuantity,\n\t\t\tunit\n\t\t).join( '' );\n\n\t\tonChangeProp?.( onChangeValue, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnextUnitValue,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ parsedQuantity ?? '' }${ nextUnitValue }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ nextUnitValue }`;\n\t\t}\n\n\t\tonChangeProp?.( nextValue, changeProps );\n\t\tonUnitChange?.( nextUnitValue, changeProps );\n\n\t\tsetUnit( nextUnitValue );\n\t};\n\n\tconst mayUpdateUnit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tif ( ! isNaN( Number( event.currentTarget.value ) ) ) {\n\t\t\trefParsedQuantity.current = undefined;\n\t\t\treturn;\n\t\t}\n\t\tconst [ validParsedQuantity, validParsedUnit ] =\n\t\t\tgetValidParsedQuantityAndUnit(\n\t\t\t\tevent.currentTarget.value,\n\t\t\t\tunits,\n\t\t\t\tparsedQuantity,\n\t\t\t\tunit\n\t\t\t);\n\n\t\trefParsedQuantity.current = validParsedQuantity;\n\n\t\tif ( isPressEnterToChange && validParsedUnit !== unit ) {\n\t\t\tconst data = Array.isArray( units )\n\t\t\t\t? units.find( ( option ) => option.value === validParsedUnit )\n\t\t\t\t: undefined;\n\t\t\tconst changeProps = { event, data };\n\n\t\t\t// The `onChange` callback already gets called, no need to call it explicitely.\n\t\t\tonUnitChange?.( validParsedUnit, changeProps );\n\n\t\t\tsetUnit( validParsedUnit );\n\t\t}\n\t};\n\n\tconst handleOnBlur: FocusEventHandler< HTMLInputElement > = ( event ) => {\n\t\tmayUpdateUnit( event );\n\t\tonBlurProp?.( event );\n\t};\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { key } = event;\n\t\tif ( key === 'Enter' ) {\n\t\t\tmayUpdateUnit( event );\n\t\t}\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @param state State from InputControl\n\t * @param action Action triggering state change\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst unitControlStateReducer: StateReducer = ( state, action ) => {\n\t\tconst nextState = { ...state };\n\n\t\t/*\n\t\t * On commits (when pressing ENTER and on blur if\n\t\t * isPressEnterToChange is true), if a parse has been performed\n\t\t * then use that result to update the state.\n\t\t */\n\t\tif ( action.type === inputControlActionTypes.COMMIT ) {\n\t\t\tif ( refParsedQuantity.current !== undefined ) {\n\t\t\t\tnextState.value = (\n\t\t\t\t\trefParsedQuantity.current ?? ''\n\t\t\t\t).toString();\n\t\t\t\trefParsedQuantity.current = undefined;\n\t\t\t}\n\t\t}\n\n\t\treturn nextState;\n\t};\n\n\tlet stateReducer: StateReducer = unitControlStateReducer;\n\tif ( stateReducerProp ) {\n\t\tstateReducer = ( state, action ) => {\n\t\t\tconst baseState = unitControlStateReducer( state, action );\n\t\t\treturn stateReducerProp( baseState, action );\n\t\t};\n\t}\n\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={ size }\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t\tonBlur={ onBlurProp }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<Root className=\"components-unit-control-wrapper\" style={ style }>\n\t\t\t<ValueInput\n\t\t\t\taria-label={ label }\n\t\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\t\t{ ...props }\n\t\t\t\tautoComplete={ autoComplete }\n\t\t\t\tclassName={ classes }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\tlabel={ label }\n\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\t\tonChange={ handleOnQuantityChange }\n\t\t\t\tref={ forwardedRef }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={ inputSuffix }\n\t\t\t\tvalue={ parsedQuantity ?? '' }\n\t\t\t\tstep={ step }\n\t\t\t\t__unstableStateReducer={ stateReducer }\n\t\t\t/>\n\t\t</Root>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * @example\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef( UnforwardedUnitControl );\n\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;\n"]}
@@ -5,183 +5,93 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = exports.COLORS = void 0;
7
7
 
8
- var _lodash = require("lodash");
9
-
10
8
  var _colors = require("./colors");
11
9
 
12
- /**
13
- * External dependencies
14
- */
15
-
16
10
  /**
17
11
  * Internal dependencies
18
12
  */
19
- const BASE = {
20
- black: '#000',
21
- white: '#fff'
22
- };
23
- const G2 = {
24
- blue: {
25
- medium: {
26
- focus: '#007cba',
27
- focusDark: '#fff'
28
- }
29
- },
30
- gray: {
31
- 900: '#1e1e1e',
32
- 700: '#757575',
33
- // Meets 4.6:1 text contrast against white.
34
- 600: '#949494',
35
- // Meets 3:1 UI or large text contrast against white.
36
- 400: '#ccc',
37
- 300: '#ddd',
38
- // Used for most borders.
39
- 200: '#e0e0e0',
40
- // Used sparingly for light borders.
41
- 100: '#f0f0f0' // Used for light gray backgrounds.
13
+ const white = '#fff'; // Matches the grays in @wordpress/base-styles
14
+
15
+ const GRAY = {
16
+ 900: '#1e1e1e',
17
+ 800: '#2f2f2f',
18
+
19
+ /** Meets 4.6:1 text contrast against white. */
20
+ 700: '#757575',
42
21
 
43
- },
44
- mediumGray: {
45
- text: '#757575'
46
- },
47
- lightGray: {
48
- ui: '#949494',
49
- secondary: '#ccc',
50
- tertiary: '#e7e8e9'
51
- }
22
+ /** Meets 3:1 UI or large text contrast against white. */
23
+ 600: '#949494',
24
+ 400: '#ccc',
25
+
26
+ /** Used for most borders. */
27
+ 300: '#ddd',
28
+
29
+ /** Used sparingly for light borders. */
30
+ 200: '#e0e0e0',
31
+
32
+ /** Used for light gray backgrounds. */
33
+ 100: '#f0f0f0'
52
34
  };
53
35
  const DARK_GRAY = {
54
- 900: '#191e23',
55
- 800: '#23282d',
56
- 700: '#32373c',
57
- 600: '#40464d',
58
36
  500: '#555d66',
59
37
  // Use this most of the time for dark items.
60
- 400: '#606a73',
61
38
  300: '#6c7781',
62
39
  // Lightest gray that can be used for AA text contrast.
63
- 200: '#7e8993',
64
- 150: '#8d96a0',
65
- // Lightest gray that can be used for AA non-text contrast.
66
- 100: '#8f98a1',
67
- placeholder: (0, _colors.rgba)(G2.gray[900], 0.62)
68
- };
69
- const DARK_OPACITY = {
70
- 900: (0, _colors.rgba)('#000510', 0.9),
71
- 800: (0, _colors.rgba)('#00000a', 0.85),
72
- 700: (0, _colors.rgba)('#06060b', 0.8),
73
- 600: (0, _colors.rgba)('#000913', 0.75),
74
- 500: (0, _colors.rgba)('#0a1829', 0.7),
75
- 400: (0, _colors.rgba)('#0a1829', 0.65),
76
- 300: (0, _colors.rgba)('#0e1c2e', 0.62),
77
- 200: (0, _colors.rgba)('#162435', 0.55),
78
- 100: (0, _colors.rgba)('#223443', 0.5),
79
- backgroundFill: (0, _colors.rgba)(DARK_GRAY[700], 0.7)
80
- };
81
- const DARK_OPACITY_LIGHT = {
82
- 900: (0, _colors.rgba)('#304455', 0.45),
83
- 800: (0, _colors.rgba)('#425863', 0.4),
84
- 700: (0, _colors.rgba)('#667886', 0.35),
85
- 600: (0, _colors.rgba)('#7b86a2', 0.3),
86
- 500: (0, _colors.rgba)('#9197a2', 0.25),
87
- 400: (0, _colors.rgba)('#95959c', 0.2),
88
- 300: (0, _colors.rgba)('#829493', 0.15),
89
- 200: (0, _colors.rgba)('#8b8b96', 0.1),
90
- 100: (0, _colors.rgba)('#747474', 0.05)
40
+ 150: '#8d96a0' // Lightest gray that can be used for AA non-text contrast.
41
+
91
42
  };
92
43
  const LIGHT_GRAY = {
93
- 900: '#a2aab2',
94
44
  800: '#b5bcc2',
95
- 700: '#ccd0d4',
96
45
  600: '#d7dade',
97
- 500: '#e2e4e7',
98
- // Good for "grayed" items and borders.
99
46
  400: '#e8eaeb',
100
47
  // Good for "readonly" input fields and special text selection.
101
48
  300: '#edeff0',
102
- 200: '#f3f4f5',
103
- 100: '#f8f9f9',
104
- placeholder: (0, _colors.rgba)(BASE.white, 0.65)
105
- };
106
- const LIGHT_OPACITY_LIGHT = {
107
- 900: (0, _colors.rgba)(BASE.white, 0.5),
108
- 800: (0, _colors.rgba)(BASE.white, 0.45),
109
- 700: (0, _colors.rgba)(BASE.white, 0.4),
110
- 600: (0, _colors.rgba)(BASE.white, 0.35),
111
- 500: (0, _colors.rgba)(BASE.white, 0.3),
112
- 400: (0, _colors.rgba)(BASE.white, 0.25),
113
- 300: (0, _colors.rgba)(BASE.white, 0.2),
114
- 200: (0, _colors.rgba)(BASE.white, 0.15),
115
- 100: (0, _colors.rgba)(BASE.white, 0.1),
116
- backgroundFill: (0, _colors.rgba)(LIGHT_GRAY[300], 0.8)
117
- }; // Additional colors.
118
- // Some are from https://make.wordpress.org/design/handbook/foundations/colors/.
49
+ 200: '#f3f4f5'
50
+ }; // Matches @wordpress/base-styles
119
51
 
120
- const BLUE = {
121
- wordpress: {
122
- 700: '#00669b'
123
- },
124
- dark: {
125
- 900: '#0071a1'
126
- },
127
- medium: {
128
- 900: '#006589',
129
- 800: '#00739c',
130
- 700: '#007fac',
131
- 600: '#008dbe',
132
- 500: '#00a0d2',
133
- 400: '#33b3db',
134
- 300: '#66c6e4',
135
- 200: '#bfe7f3',
136
- 100: '#e5f5fa',
137
- highlight: '#b3e7fe',
138
- focus: '#007cba'
139
- }
140
- };
141
52
  const ALERT = {
142
53
  yellow: '#f0b849',
143
54
  red: '#d94f4f',
144
55
  green: '#4ab866'
145
- };
146
- const ADMIN = {
147
- theme: `var( --wp-admin-theme-color, ${BLUE.wordpress[700]})`,
148
- themeDark10: `var( --wp-admin-theme-color-darker-10, ${BLUE.medium.focus})`
149
- }; // Namespaced values for raw colors hex codes.
56
+ }; // Matches @wordpress/base-styles
150
57
 
58
+ const ADMIN = {
59
+ theme: 'var( --wp-admin-theme-color, #007cba)',
60
+ themeDark10: 'var( --wp-admin-theme-color-darker-10, #006ba1)'
61
+ };
151
62
  const UI = {
152
63
  theme: ADMIN.theme,
153
- background: BASE.white,
64
+ background: white,
154
65
  backgroundDisabled: LIGHT_GRAY[200],
155
- border: G2.gray[700],
156
- borderHover: G2.gray[700],
66
+ // TODO: Replace with WordPress gray
67
+ border: GRAY[700],
68
+ borderHover: GRAY[700],
157
69
  borderFocus: ADMIN.themeDark10,
158
- borderDisabled: G2.gray[400],
159
- borderLight: G2.gray[300],
160
- label: DARK_GRAY[500],
70
+ borderDisabled: GRAY[400],
161
71
  textDisabled: DARK_GRAY[150],
162
- textDark: BASE.white,
163
- textLight: BASE.black
164
- }; // Using Object.assign instead of { ...spread } syntax helps TypeScript
165
- // to extract the correct type defs here.
166
-
167
- const COLORS = Object.assign({}, BASE, {
72
+ // TODO: Replace with WordPress gray
73
+ textDark: white,
74
+ // Matches @wordpress/base-styles
75
+ darkGrayPlaceholder: (0, _colors.rgba)(GRAY[900], 0.62),
76
+ lightGrayPlaceholder: (0, _colors.rgba)(white, 0.65)
77
+ };
78
+ const COLORS = Object.freeze({
79
+ /**
80
+ * @deprecated Try to use `gray` instead.
81
+ */
168
82
  darkGray: DARK_GRAY,
169
- darkOpacity: DARK_OPACITY,
170
- darkOpacityLight: DARK_OPACITY_LIGHT,
171
- mediumGray: G2.mediumGray,
172
83
 
173
84
  /**
174
- * The main gray color object (since Apr 16, 2022).
175
- *
176
- * We are in the process of simplifying the colors in this file,
177
- * please prefer this `gray` object in the meantime.
85
+ * The main gray color object.
86
+ */
87
+ gray: GRAY,
88
+
89
+ /**
90
+ * @deprecated Try to use `gray` instead.
178
91
  */
179
- gray: G2.gray,
180
- lightGray: (0, _lodash.merge)({}, LIGHT_GRAY, G2.lightGray),
181
- lightGrayLight: LIGHT_OPACITY_LIGHT,
182
- blue: (0, _lodash.merge)({}, BLUE, G2.blue),
92
+ lightGray: LIGHT_GRAY,
93
+ white,
183
94
  alert: ALERT,
184
- admin: ADMIN,
185
95
  ui: UI
186
96
  });
187
97
  exports.COLORS = COLORS;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/utils/colors-values.js"],"names":["BASE","black","white","G2","blue","medium","focus","focusDark","gray","mediumGray","text","lightGray","ui","secondary","tertiary","DARK_GRAY","placeholder","DARK_OPACITY","backgroundFill","DARK_OPACITY_LIGHT","LIGHT_GRAY","LIGHT_OPACITY_LIGHT","BLUE","wordpress","dark","highlight","ALERT","yellow","red","green","ADMIN","theme","themeDark10","UI","background","backgroundDisabled","border","borderHover","borderFocus","borderDisabled","borderLight","label","textDisabled","textDark","textLight","COLORS","Object","assign","darkGray","darkOpacity","darkOpacityLight","lightGrayLight","alert","admin"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG;AACZC,EAAAA,KAAK,EAAE,MADK;AAEZC,EAAAA,KAAK,EAAE;AAFK,CAAb;AAKA,MAAMC,EAAE,GAAG;AACVC,EAAAA,IAAI,EAAE;AACLC,IAAAA,MAAM,EAAE;AACPC,MAAAA,KAAK,EAAE,SADA;AAEPC,MAAAA,SAAS,EAAE;AAFJ;AADH,GADI;AAOVC,EAAAA,IAAI,EAAE;AACL,SAAK,SADA;AAEL,SAAK,SAFA;AAEW;AAChB,SAAK,SAHA;AAGW;AAChB,SAAK,MAJA;AAKL,SAAK,MALA;AAKQ;AACb,SAAK,SANA;AAMW;AAChB,SAAK,SAPA,CAOW;;AAPX,GAPI;AAgBVC,EAAAA,UAAU,EAAE;AACXC,IAAAA,IAAI,EAAE;AADK,GAhBF;AAmBVC,EAAAA,SAAS,EAAE;AACVC,IAAAA,EAAE,EAAE,SADM;AAEVC,IAAAA,SAAS,EAAE,MAFD;AAGVC,IAAAA,QAAQ,EAAE;AAHA;AAnBD,CAAX;AA0BA,MAAMC,SAAS,GAAG;AACjB,OAAK,SADY;AAEjB,OAAK,SAFY;AAGjB,OAAK,SAHY;AAIjB,OAAK,SAJY;AAKjB,OAAK,SALY;AAKD;AAChB,OAAK,SANY;AAOjB,OAAK,SAPY;AAOD;AAChB,OAAK,SARY;AASjB,OAA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AA,UAAU,EAAEN,EAAE,CAACM,UAJ+B;;AAK9C;AACD;AACA;AACA;AACA;AACA;AACCD,EAAAA,IAAI,EAAEL,EAAE,CAACK,IAXqC;AAY9CG,EAAAA,SAAS,EAAE,mBAAO,EAAP,EAAWS,UAAX,EAAuBjB,EAAE,CAACQ,SAA1B,CAZmC;AAa9CwC,EAAAA,cAAc,EAAE9B,mBAb8B;AAc9CjB,EAAAA,IAAI,EAAE,mBAAO,EAAP,EAAWkB,IAAX,EAAiBnB,EAAE,CAACC,IAApB,CAdwC;AAe9CgD,EAAAA,KAAK,EAAE1B,KAfuC;AAgB9C2B,EAAAA,KAAK,EAAEvB,KAhBuC;AAiB9ClB,EAAAA,EAAE,EAAEqB;AAjB0C,CAAzB,CAAf;;eAoBQY,M","sourcesContent":["/**\n * External dependencies\n */\nimport { merge } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport { rgba } from './colors';\n\nconst BASE = {\n\tblack: '#000',\n\twhite: '#fff',\n};\n\nconst G2 = {\n\tblue: {\n\t\tmedium: {\n\t\t\tfocus: '#007cba',\n\t\t\tfocusDark: '#fff',\n\t\t},\n\t},\n\tgray: {\n\t\t900: '#1e1e1e',\n\t\t700: '#757575', // Meets 4.6:1 text contrast against white.\n\t\t600: '#949494', // Meets 3:1 UI or large text contrast against white.\n\t\t400: '#ccc',\n\t\t300: '#ddd', // Used for most borders.\n\t\t200: '#e0e0e0', // Used sparingly for light borders.\n\t\t100: '#f0f0f0', // Used for light gray backgrounds.\n\t},\n\tmediumGray: {\n\t\ttext: '#757575',\n\t},\n\tlightGray: {\n\t\tui: '#949494',\n\t\tsecondary: '#ccc',\n\t\ttertiary: '#e7e8e9',\n\t},\n};\n\nconst DARK_GRAY = {\n\t900: '#191e23',\n\t800: '#23282d',\n\t700: '#32373c',\n\t600: '#40464d',\n\t500: '#555d66', // Use this most of the time for dark items.\n\t400: '#606a73',\n\t300: '#6c7781', // Lightest gray that can be used for AA text contrast.\n\t200: '#7e8993',\n\t150: '#8d96a0', // Lightest gray that can be used for AA non-text contrast.\n\t100: '#8f98a1',\n\tplaceholder: rgba( G2.gray[ 900 ], 0.62 ),\n};\n\nconst DARK_OPACITY = {\n\t900: rgba( '#000510', 0.9 ),\n\t800: rgba( '#00000a', 0.85 ),\n\t700: rgba( '#06060b', 0.8 ),\n\t600: rgba( '#000913', 0.75 ),\n\t500: rgba( '#0a1829', 0.7 ),\n\t400: rgba( '#0a1829', 0.65 ),\n\t300: rgba( '#0e1c2e', 0.62 ),\n\t200: rgba( '#162435', 0.55 ),\n\t100: rgba( '#223443', 0.5 ),\n\tbackgroundFill: rgba( DARK_GRAY[ 700 ], 0.7 ),\n};\n\nconst DARK_OPACITY_LIGHT = {\n\t900: rgba( '#304455', 0.45 ),\n\t800: rgba( '#425863', 0.4 ),\n\t700: rgba( '#667886', 0.35 ),\n\t600: rgba( '#7b86a2', 0.3 ),\n\t500: rgba( '#9197a2', 0.25 ),\n\t400: rgba( '#95959c', 0.2 ),\n\t300: rgba( '#829493', 0.15 ),\n\t200: rgba( '#8b8b96', 0.1 ),\n\t100: rgba( '#747474', 0.05 ),\n};\n\nconst LIGHT_GRAY = {\n\t900: '#a2aab2',\n\t800: '#b5bcc2',\n\t700: '#ccd0d4',\n\t600: '#d7dade',\n\t500: '#e2e4e7', // Good for \"grayed\" items and borders.\n\t400: '#e8eaeb', // Good for \"readonly\" input fields and special text selection.\n\t300: '#edeff0',\n\t200: '#f3f4f5',\n\t100: '#f8f9f9',\n\tplaceholder: rgba( BASE.white, 0.65 ),\n};\n\nconst LIGHT_OPACITY_LIGHT = {\n\t900: rgba( BASE.white, 0.5 ),\n\t800: rgba( BASE.white, 0.45 ),\n\t700: rgba( BASE.white, 0.4 ),\n\t600: rgba( BASE.white, 0.35 ),\n\t500: rgba( BASE.white, 0.3 ),\n\t400: rgba( BASE.white, 0.25 ),\n\t300: rgba( BASE.white, 0.2 ),\n\t200: rgba( BASE.white, 0.15 ),\n\t100: rgba( BASE.white, 0.1 ),\n\tbackgroundFill: rgba( LIGHT_GRAY[ 300 ], 0.8 ),\n};\n\n// Additional colors.\n// Some are from https://make.wordpress.org/design/handbook/foundations/colors/.\n\nconst BLUE = {\n\twordpress: {\n\t\t700: '#00669b',\n\t},\n\tdark: {\n\t\t900: '#0071a1',\n\t},\n\tmedium: {\n\t\t900: '#006589',\n\t\t800: '#00739c',\n\t\t700: '#007fac',\n\t\t600: '#008dbe',\n\t\t500: '#00a0d2',\n\t\t400: '#33b3db',\n\t\t300: '#66c6e4',\n\t\t200: '#bfe7f3',\n\t\t100: '#e5f5fa',\n\t\thighlight: '#b3e7fe',\n\t\tfocus: '#007cba',\n\t},\n};\n\nconst ALERT = {\n\tyellow: '#f0b849',\n\tred: '#d94f4f',\n\tgreen: '#4ab866',\n};\n\nconst ADMIN = {\n\ttheme: `var( --wp-admin-theme-color, ${ BLUE.wordpress[ 700 ] })`,\n\tthemeDark10: `var( --wp-admin-theme-color-darker-10, ${ BLUE.medium.focus })`,\n};\n\n// Namespaced values for raw colors hex codes.\nconst UI = {\n\ttheme: ADMIN.theme,\n\tbackground: BASE.white,\n\tbackgroundDisabled: LIGHT_GRAY[ 200 ],\n\tborder: G2.gray[ 700 ],\n\tborderHover: G2.gray[ 700 ],\n\tborderFocus: ADMIN.themeDark10,\n\tborderDisabled: G2.gray[ 400 ],\n\tborderLight: G2.gray[ 300 ],\n\tlabel: DARK_GRAY[ 500 ],\n\ttextDisabled: DARK_GRAY[ 150 ],\n\ttextDark: BASE.white,\n\ttextLight: BASE.black,\n};\n\n// Using Object.assign instead of { ...spread } syntax helps TypeScript\n// to extract the correct type defs here.\nexport const COLORS = Object.assign( {}, BASE, {\n\tdarkGray: DARK_GRAY,\n\tdarkOpacity: DARK_OPACITY,\n\tdarkOpacityLight: DARK_OPACITY_LIGHT,\n\tmediumGray: G2.mediumGray,\n\t/**\n\t * The main gray color object (since Apr 16, 2022).\n\t *\n\t * We are in the process of simplifying the colors in this file,\n\t * please prefer this `gray` object in the meantime.\n\t */\n\tgray: G2.gray,\n\tlightGray: merge( {}, LIGHT_GRAY, G2.lightGray ),\n\tlightGrayLight: LIGHT_OPACITY_LIGHT,\n\tblue: merge( {}, BLUE, G2.blue ),\n\talert: ALERT,\n\tadmin: ADMIN,\n\tui: UI,\n} );\n\nexport default COLORS;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/utils/colors-values.js"],"names":["white","GRAY","DARK_GRAY","LIGHT_GRAY","ALERT","yellow","red","green","ADMIN","theme","themeDark10","UI","background","backgroundDisabled","border","borderHover","borderFocus","borderDisabled","textDisabled","textDark","darkGrayPlaceholder","lightGrayPlaceholder","COLORS","Object","freeze","darkGray","gray","lightGray","alert","ui"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,KAAK,GAAG,MAAd,C,CAEA;;AACA,MAAMC,IAAI,GAAG;AACZ,OAAK,SADO;AAEZ,OAAK,SAFO;;AAGZ;AACA,OAAK,SAJO;;AAKZ;AACA,OAAK,SANO;AAOZ,OAAK,MAPO;;AAQZ;AACA,OAAK,MATO;;AAUZ;AACA,OAAK,SAXO;;AAYZ;AACA,OAAK;AAbO,CAAb;AAgBA,MAAMC,SAAS,GAAG;AACjB,OAAK,SADY;AACD;AAChB,OAAK,SAFY;AAED;AAChB,OAAK,SAHY,CAGD;;AAHC,CAAlB;AAMA,MAAMC,UAAU,GAAG;AAClB,OAAK,SADa;AAElB,OAAK,SAFa;AAGlB,OAAK,SAHa;AAGF;AAChB,OAAK,SAJa;AAKlB,OAAK;AALa,CAAnB,C,CAQA;;AACA,MAAMC,KAAK,GAAG;AACbC,EAAAA,MAAM,EAAE,SADK;AAEbC,EAAAA,GAAG,EAAE,SAFQ;AAGbC,EAAAA,KAAK,EAAE;AAHM,CAAd,C,CAMA;;AACA,MAAMC,KAAK,GAAG;AACbC,EAAAA,KAAK,EAAE,uCADM;AAEbC,EAAAA,WAAW,EAAE;AAFA,CAAd;AAKA,MAAMC,EAAE,GAAG;AACVF,EAAAA,KAAK,EAAED,KAAK,CAACC,KADH;AAEVG,EAAAA,UAAU,EAAEZ,KAFF;AAGVa,EAAAA,kBAAkB,EAAEV,UAAU,CAAE,GAAF,CAHpB;AAG6B;AACvCW,EAAAA,MAAM,EAAEb,IAAI,CAAE,GAAF,CAJF;AAKVc,EAAAA,WAAW,EAAEd,IAAI,CAAE,GAAF,CALP;AAMVe,EAAAA,WAAW,EAAER,KAAK,CAACE,WANT;AAOVO,EAAAA,cAAc,EAAEhB,IAAI,CAAE,GAAF,CAPV;AAQViB,EAAAA,YAAY,EAAEhB,SAAS,CAAE,GAAF,CARb;AAQsB;AAChCiB,EAAAA,QAAQ,EAAEnB,KATA;AAWV;AACAoB,EAAAA,mBAAmB,EAAE,kBAAMnB,IAAI,CAAE,GAAF,CAAV,EAAmB,IAAnB,CAZX;AAaVoB,EAAAA,oBAAoB,EAAE,kBAAMrB,KAAN,EAAa,IAAb;AAbZ,CAAX;AAgBO,MAAMsB,MAAM,GAAGC,MAAM,CAACC,MAAP,CAAe;AACpC;AACD;AACA;AACCC,EAAAA,QAAQ,EAAEvB,SAJ0B;;AAKpC;AACD;AACA;AACCwB,EAAAA,IAAI,EAAEzB,IAR8B;;AASpC;AACD;AACA;AACC0B,EAAAA,SAAS,EAAExB,UAZyB;AAapCH,EAAAA,KAboC;AAcpC4B,EAAAA,KAAK,EAAExB,KAd6B;AAepCyB,EAAAA,EAAE,EAAElB;AAfgC,CAAf,CAAf;;eAkBQW,M","sourcesContent":["/**\n * Internal dependencies\n */\nimport { rgba } from './colors';\n\nconst white = '#fff';\n\n// Matches the grays in @wordpress/base-styles\nconst GRAY = {\n\t900: '#1e1e1e',\n\t800: '#2f2f2f',\n\t/** Meets 4.6:1 text contrast against white. */\n\t700: '#757575',\n\t/** Meets 3:1 UI or large text contrast against white. */\n\t600: '#949494',\n\t400: '#ccc',\n\t/** Used for most borders. */\n\t300: '#ddd',\n\t/** Used sparingly for light borders. */\n\t200: '#e0e0e0',\n\t/** Used for light gray backgrounds. */\n\t100: '#f0f0f0',\n};\n\nconst DARK_GRAY = {\n\t500: '#555d66', // Use this most of the time for dark items.\n\t300: '#6c7781', // Lightest gray that can be used for AA text contrast.\n\t150: '#8d96a0', // Lightest gray that can be used for AA non-text contrast.\n};\n\nconst LIGHT_GRAY = {\n\t800: '#b5bcc2',\n\t600: '#d7dade',\n\t400: '#e8eaeb', // Good for \"readonly\" input fields and special text selection.\n\t300: '#edeff0',\n\t200: '#f3f4f5',\n};\n\n// Matches @wordpress/base-styles\nconst ALERT = {\n\tyellow: '#f0b849',\n\tred: '#d94f4f',\n\tgreen: '#4ab866',\n};\n\n// Matches @wordpress/base-styles\nconst ADMIN = {\n\ttheme: 'var( --wp-admin-theme-color, #007cba)',\n\tthemeDark10: 'var( --wp-admin-theme-color-darker-10, #006ba1)',\n};\n\nconst UI = {\n\ttheme: ADMIN.theme,\n\tbackground: white,\n\tbackgroundDisabled: LIGHT_GRAY[ 200 ], // TODO: Replace with WordPress gray\n\tborder: GRAY[ 700 ],\n\tborderHover: GRAY[ 700 ],\n\tborderFocus: ADMIN.themeDark10,\n\tborderDisabled: GRAY[ 400 ],\n\ttextDisabled: DARK_GRAY[ 150 ], // TODO: Replace with WordPress gray\n\ttextDark: white,\n\n\t// Matches @wordpress/base-styles\n\tdarkGrayPlaceholder: rgba( GRAY[ 900 ], 0.62 ),\n\tlightGrayPlaceholder: rgba( white, 0.65 ),\n};\n\nexport const COLORS = Object.freeze( {\n\t/**\n\t * @deprecated Try to use `gray` instead.\n\t */\n\tdarkGray: DARK_GRAY,\n\t/**\n\t * The main gray color object.\n\t */\n\tgray: GRAY,\n\t/**\n\t * @deprecated Try to use `gray` instead.\n\t */\n\tlightGray: LIGHT_GRAY,\n\twhite,\n\talert: ALERT,\n\tui: UI,\n} );\n\nexport default COLORS;\n"]}
@@ -25,7 +25,7 @@ const CONTROL_PROPS = {
25
25
  controlBorderColor: _colorsValues.COLORS.gray[700],
26
26
  controlBoxShadow: 'transparent',
27
27
  controlBorderColorHover: _colorsValues.COLORS.gray[700],
28
- controlBoxShadowFocus: `0 0 0 0.5px ${_colorsValues.COLORS.admin.theme}`,
28
+ controlBoxShadowFocus: `0 0 0 0.5px ${_colorsValues.COLORS.ui.theme}`,
29
29
  controlDestructiveBorderColor: _colorsValues.COLORS.alert.red,
30
30
  controlHeight: CONTROL_HEIGHT,
31
31
  controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/utils/config-values.js"],"names":["CONTROL_HEIGHT","CONTROL_PADDING_X","CONTROL_PROPS","controlSurfaceColor","COLORS","white","controlTextActiveColor","ui","theme","controlPaddingX","controlPaddingXLarge","controlPaddingXSmall","controlBackgroundColor","controlBorderRadius","controlBorderColor","gray","controlBoxShadow","controlBorderColorHover","controlBoxShadowFocus","admin","controlDestructiveBorderColor","alert","red","controlHeight","controlHeightXSmall","controlHeightSmall","controlHeightLarge","controlHeightXLarge","TOGGLE_GROUP_CONTROL_PROPS","toggleGroupControlBackgroundColor","toggleGroupControlBorderColor","border","toggleGroupControlBackdropBackgroundColor","toggleGroupControlBackdropBorderColor","toggleGroupControlBackdropBoxShadow","toggleGroupControlButtonColorActive","Object","assign","colorDivider","colorScrollbarThumb","colorScrollbarThumbHover","colorScrollbarTrack","elevationIntensity","radiusBlockUi","borderWidth","borderWidthFocus","borderWidthTab","spinnerSize","fontSize","fontSizeH1","fontSizeH2","fontSizeH3","fontSizeH4","fontSizeH5","fontSizeH6","fontSizeInputMobile","fontSizeMobile","fontSizeSmall","fontSizeXSmall","fontLineHeightBase","fontWeight","fontWeightHeading","gridBase","cardBorderRadius","cardPaddingXSmall","cardPaddingSmall","cardPaddingMedium","cardPaddingLarge","surfaceBackgroundColor","surfaceBackgroundSubtleColor","surfaceBackgroundTintColor","surfaceBorderColor","surfaceBorderBoldColor","surfaceBorderSubtleColor","surfaceBackgroundTertiaryColor","surfaceColor","transitionDuration","transitionDurationFast","transitionDurationFaster","transitionDurationFastest","transitionTimingFunction","transitionTimingFunctionControl"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,cAAc,GAAG,MAAvB;AACA,MAAMC,iBAAiB,GAAG,MAA1B;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,mBAAmB,EAAEC,qBAAOC,KADP;AAErBC,EAAAA,sBAAsB,EAAEF,qBAAOG,EAAP,CAAUC,KAFb;AAGrBC,EAAAA,eAAe,EAAER,iBAHI;AAIrBS,EAAAA,oBAAoB,EAAG,QAAQT,iBAAmB,YAJ7B;AAKrBU,EAAAA,oBAAoB,EAAG,QAAQV,iBAAmB,YAL7B;AAMrBW,EAAAA,sBAAsB,EAAER,qBAAOC,KANV;AAOrBQ,EAAAA,mBAAmB,EAAE,KAPA;AAQrBC,EAAAA,kBAAkB,EAAEV,qBAAOW,IAAP,CAAa,GAAb,CARC;AASrBC,EAAAA,gBAAgB,EAAE,aATG;AAUrBC,EAAAA,uBAAuB,EAAEb,qBAAOW,IAAP,CAAa,GAAb,CAVJ;AAWrBG,EAAAA,qBAAqB,EAAG,eAAed,qBAAOe,KAAP,CAAaX,KAAO,EAXtC;AAYrBY,EAAAA,6BAA6B,EAAEhB,qBAAOiB,KAAP,CAAaC,GAZvB;AAarBC,EAAAA,aAAa,EAAEvB,cAbM;AAcrBwB,EAAAA,mBAAmB,EAAG,SAASxB,cAAgB,UAd1B;AAerByB,EAAAA,kBAAkB,EAAG,SAASzB,cAAgB,UAfzB;AAgBrB0B,EAAAA,kBAAkB,EAAG,SAAS1B,cAAgB,UAhBzB;AAiBrB2B,EAAAA,mBAAmB,EAAG,SAAS3B,cAAgB;AAjB1B,CAAtB;AAoBA,MAAM4B,0BAA0B,GAAG;AAClCC,EAAAA,iCAAiC,EAAE3B,aAAa,CAACU,sBADf;AAElCkB,EAAAA,6BAA6B,EAAE1B,qBAAOG,EAAP,CAAUwB,MAFP;AAGlCC,EAAAA,yCAAy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EAAE,KA1B0D;AA2B5EC,EAAAA,iBAAiB,EAAG,GAAG,kBAAO,CAAP,CAAY,EA3ByC;AA4B5EC,EAAAA,gBAAgB,EAAG,GAAG,kBAAO,CAAP,CAAY,EA5B0C;AA6B5EC,EAAAA,iBAAiB,EAAG,GAAG,kBAAO,CAAP,CAAY,IAAI,kBAAO,CAAP,CAAY,EA7ByB;AA8B5EC,EAAAA,gBAAgB,EAAG,GAAG,kBAAO,CAAP,CAAY,IAAI,kBAAO,CAAP,CAAY,EA9B0B;AA+B5EC,EAAAA,sBAAsB,EAAEhE,qBAAOC,KA/B6C;AAgC5EgE,EAAAA,4BAA4B,EAAE,SAhC8C;AAiC5EC,EAAAA,0BAA0B,EAAE,SAjCgD;AAkC5EC,EAAAA,kBAAkB,EAAE,oBAlCwD;AAmC5EC,EAAAA,sBAAsB,EAAE,qBAnCoD;AAoC5EC,EAAAA,wBAAwB,EAAE,qBApCkD;AAqC5EC,EAAAA,8BAA8B,EAAEtE,qBAAOC,KArCqC;AAsC5EsE,EAAAA,YAAY,EAAEvE,qBAAOC,KAtCuD;AAuC5EuE,EAAAA,kBAAkB,EAAE,OAvCwD;AAwC5EC,EAAAA,sBAAsB,EAAE,OAxCoD;AAyC5EC,EAAAA,wBAAwB,EAAE,OAzCkD;AA0C5EC,EAAAA,yBAAyB,EAAE,OA1CiD;AA2C5EC,EAAAA,wBAAwB,EAAE,mCA3CkD;AA4C5EC,EAAAA,+BAA+B,EAAE;AA5C2C,CAA9D,C","sourcesContent":["/**\n * Internal dependencies\n */\nimport { space } from '../ui/utils/space';\nimport { COLORS } from './colors-values';\n\nconst CONTROL_HEIGHT = '36px';\nconst CONTROL_PADDING_X = '12px';\n\nconst CONTROL_PROPS = {\n\tcontrolSurfaceColor: COLORS.white,\n\tcontrolTextActiveColor: COLORS.ui.theme,\n\tcontrolPaddingX: CONTROL_PADDING_X,\n\tcontrolPaddingXLarge: `calc(${ CONTROL_PADDING_X } * 1.3334)`,\n\tcontrolPaddingXSmall: `calc(${ CONTROL_PADDING_X } / 1.3334)`,\n\tcontrolBackgroundColor: COLORS.white,\n\tcontrolBorderRadius: '2px',\n\tcontrolBorderColor: COLORS.gray[ 700 ],\n\tcontrolBoxShadow: 'transparent',\n\tcontrolBorderColorHover: COLORS.gray[ 700 ],\n\tcontrolBoxShadowFocus: `0 0 0 0.5px ${ COLORS.admin.theme }`,\n\tcontrolDestructiveBorderColor: COLORS.alert.red,\n\tcontrolHeight: CONTROL_HEIGHT,\n\tcontrolHeightXSmall: `calc( ${ CONTROL_HEIGHT } * 0.6 )`,\n\tcontrolHeightSmall: `calc( ${ CONTROL_HEIGHT } * 0.8 )`,\n\tcontrolHeightLarge: `calc( ${ CONTROL_HEIGHT } * 1.2 )`,\n\tcontrolHeightXLarge: `calc( ${ CONTROL_HEIGHT } * 1.4 )`,\n};\n\nconst TOGGLE_GROUP_CONTROL_PROPS = {\n\ttoggleGroupControlBackgroundColor: CONTROL_PROPS.controlBackgroundColor,\n\ttoggleGroupControlBorderColor: COLORS.ui.border,\n\ttoggleGroupControlBackdropBackgroundColor:\n\t\tCONTROL_PROPS.controlSurfaceColor,\n\ttoggleGroupControlBackdropBorderColor: COLORS.ui.border,\n\ttoggleGroupControlBackdropBoxShadow: 'transparent',\n\ttoggleGroupControlButtonColorActive: CONTROL_PROPS.controlBackgroundColor,\n};\n\n// Using Object.assign to avoid creating circular references when emitting\n// TypeScript type declarations.\nexport default Object.assign( {}, CONTROL_PROPS, TOGGLE_GROUP_CONTROL_PROPS, {\n\tcolorDivider: 'rgba(0, 0, 0, 0.1)',\n\tcolorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',\n\tcolorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',\n\tcolorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',\n\televationIntensity: 1,\n\tradiusBlockUi: '2px',\n\tborderWidth: '1px',\n\tborderWidthFocus: '1.5px',\n\tborderWidthTab: '4px',\n\tspinnerSize: 16,\n\tfontSize: '13px',\n\tfontSizeH1: 'calc(2.44 * 13px)',\n\tfontSizeH2: 'calc(1.95 * 13px)',\n\tfontSizeH3: 'calc(1.56 * 13px)',\n\tfontSizeH4: 'calc(1.25 * 13px)',\n\tfontSizeH5: '13px',\n\tfontSizeH6: 'calc(0.8 * 13px)',\n\tfontSizeInputMobile: '16px',\n\tfontSizeMobile: '15px',\n\tfontSizeSmall: 'calc(0.92 * 13px)',\n\tfontSizeXSmall: 'calc(0.75 * 13px)',\n\tfontLineHeightBase: '1.2',\n\tfontWeight: 'normal',\n\tfontWeightHeading: '600',\n\tgridBase: '4px',\n\tcardBorderRadius: '2px',\n\tcardPaddingXSmall: `${ space( 2 ) }`,\n\tcardPaddingSmall: `${ space( 4 ) }`,\n\tcardPaddingMedium: `${ space( 4 ) } ${ space( 6 ) }`,\n\tcardPaddingLarge: `${ space( 6 ) } ${ space( 8 ) }`,\n\tsurfaceBackgroundColor: COLORS.white,\n\tsurfaceBackgroundSubtleColor: '#F3F3F3',\n\tsurfaceBackgroundTintColor: '#F5F5F5',\n\tsurfaceBorderColor: 'rgba(0, 0, 0, 0.1)',\n\tsurfaceBorderBoldColor: 'rgba(0, 0, 0, 0.15)',\n\tsurfaceBorderSubtleColor: 'rgba(0, 0, 0, 0.05)',\n\tsurfaceBackgroundTertiaryColor: COLORS.white,\n\tsurfaceColor: COLORS.white,\n\ttransitionDuration: '200ms',\n\ttransitionDurationFast: '160ms',\n\ttransitionDurationFaster: '120ms',\n\ttransitionDurationFastest: '100ms',\n\ttransitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)',\n\ttransitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)',\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/utils/config-values.js"],"names":["CONTROL_HEIGHT","CONTROL_PADDING_X","CONTROL_PROPS","controlSurfaceColor","COLORS","white","controlTextActiveColor","ui","theme","controlPaddingX","controlPaddingXLarge","controlPaddingXSmall","controlBackgroundColor","controlBorderRadius","controlBorderColor","gray","controlBoxShadow","controlBorderColorHover","controlBoxShadowFocus","controlDestructiveBorderColor","alert","red","controlHeight","controlHeightXSmall","controlHeightSmall","controlHeightLarge","controlHeightXLarge","TOGGLE_GROUP_CONTROL_PROPS","toggleGroupControlBackgroundColor","toggleGroupControlBorderColor","border","toggleGroupControlBackdropBackgroundColor","toggleGroupControlBackdropBorderColor","toggleGroupControlBackdropBoxShadow","toggleGroupControlButtonColorActive","Object","assign","colorDivider","colorScrollbarThumb","colorScrollbarThumbHover","colorScrollbarTrack","elevationIntensity","radiusBlockUi","borderWidth","borderWidthFocus","borderWidthTab","spinnerSize","fontSize","fontSizeH1","fontSizeH2","fontSizeH3","fontSizeH4","fontSizeH5","fontSizeH6","fontSizeInputMobile","fontSizeMobile","fontSizeSmall","fontSizeXSmall","fontLineHeightBase","fontWeight","fontWeightHeading","gridBase","cardBorderRadius","cardPaddingXSmall","cardPaddingSmall","cardPaddingMedium","cardPaddingLarge","surfaceBackgroundColor","surfaceBackgroundSubtleColor","surfaceBackgroundTintColor","surfaceBorderColor","surfaceBorderBoldColor","surfaceBorderSubtleColor","surfaceBackgroundTertiaryColor","surfaceColor","transitionDuration","transitionDurationFast","transitionDurationFaster","transitionDurationFastest","transitionTimingFunction","transitionTimingFunctionControl"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,cAAc,GAAG,MAAvB;AACA,MAAMC,iBAAiB,GAAG,MAA1B;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,mBAAmB,EAAEC,qBAAOC,KADP;AAErBC,EAAAA,sBAAsB,EAAEF,qBAAOG,EAAP,CAAUC,KAFb;AAGrBC,EAAAA,eAAe,EAAER,iBAHI;AAIrBS,EAAAA,oBAAoB,EAAG,QAAQT,iBAAmB,YAJ7B;AAKrBU,EAAAA,oBAAoB,EAAG,QAAQV,iBAAmB,YAL7B;AAMrBW,EAAAA,sBAAsB,EAAER,qBAAOC,KANV;AA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AAE,oBAlCwD;AAmC5EC,EAAAA,sBAAsB,EAAE,qBAnCoD;AAoC5EC,EAAAA,wBAAwB,EAAE,qBApCkD;AAqC5EC,EAAAA,8BAA8B,EAAErE,qBAAOC,KArCqC;AAsC5EqE,EAAAA,YAAY,EAAEtE,qBAAOC,KAtCuD;AAuC5EsE,EAAAA,kBAAkB,EAAE,OAvCwD;AAwC5EC,EAAAA,sBAAsB,EAAE,OAxCoD;AAyC5EC,EAAAA,wBAAwB,EAAE,OAzCkD;AA0C5EC,EAAAA,yBAAyB,EAAE,OA1CiD;AA2C5EC,EAAAA,wBAAwB,EAAE,mCA3CkD;AA4C5EC,EAAAA,+BAA+B,EAAE;AA5C2C,CAA9D,C","sourcesContent":["/**\n * Internal dependencies\n */\nimport { space } from '../ui/utils/space';\nimport { COLORS } from './colors-values';\n\nconst CONTROL_HEIGHT = '36px';\nconst CONTROL_PADDING_X = '12px';\n\nconst CONTROL_PROPS = {\n\tcontrolSurfaceColor: COLORS.white,\n\tcontrolTextActiveColor: COLORS.ui.theme,\n\tcontrolPaddingX: CONTROL_PADDING_X,\n\tcontrolPaddingXLarge: `calc(${ CONTROL_PADDING_X } * 1.3334)`,\n\tcontrolPaddingXSmall: `calc(${ CONTROL_PADDING_X } / 1.3334)`,\n\tcontrolBackgroundColor: COLORS.white,\n\tcontrolBorderRadius: '2px',\n\tcontrolBorderColor: COLORS.gray[ 700 ],\n\tcontrolBoxShadow: 'transparent',\n\tcontrolBorderColorHover: COLORS.gray[ 700 ],\n\tcontrolBoxShadowFocus: `0 0 0 0.5px ${ COLORS.ui.theme }`,\n\tcontrolDestructiveBorderColor: COLORS.alert.red,\n\tcontrolHeight: CONTROL_HEIGHT,\n\tcontrolHeightXSmall: `calc( ${ CONTROL_HEIGHT } * 0.6 )`,\n\tcontrolHeightSmall: `calc( ${ CONTROL_HEIGHT } * 0.8 )`,\n\tcontrolHeightLarge: `calc( ${ CONTROL_HEIGHT } * 1.2 )`,\n\tcontrolHeightXLarge: `calc( ${ CONTROL_HEIGHT } * 1.4 )`,\n};\n\nconst TOGGLE_GROUP_CONTROL_PROPS = {\n\ttoggleGroupControlBackgroundColor: CONTROL_PROPS.controlBackgroundColor,\n\ttoggleGroupControlBorderColor: COLORS.ui.border,\n\ttoggleGroupControlBackdropBackgroundColor:\n\t\tCONTROL_PROPS.controlSurfaceColor,\n\ttoggleGroupControlBackdropBorderColor: COLORS.ui.border,\n\ttoggleGroupControlBackdropBoxShadow: 'transparent',\n\ttoggleGroupControlButtonColorActive: CONTROL_PROPS.controlBackgroundColor,\n};\n\n// Using Object.assign to avoid creating circular references when emitting\n// TypeScript type declarations.\nexport default Object.assign( {}, CONTROL_PROPS, TOGGLE_GROUP_CONTROL_PROPS, {\n\tcolorDivider: 'rgba(0, 0, 0, 0.1)',\n\tcolorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',\n\tcolorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',\n\tcolorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',\n\televationIntensity: 1,\n\tradiusBlockUi: '2px',\n\tborderWidth: '1px',\n\tborderWidthFocus: '1.5px',\n\tborderWidthTab: '4px',\n\tspinnerSize: 16,\n\tfontSize: '13px',\n\tfontSizeH1: 'calc(2.44 * 13px)',\n\tfontSizeH2: 'calc(1.95 * 13px)',\n\tfontSizeH3: 'calc(1.56 * 13px)',\n\tfontSizeH4: 'calc(1.25 * 13px)',\n\tfontSizeH5: '13px',\n\tfontSizeH6: 'calc(0.8 * 13px)',\n\tfontSizeInputMobile: '16px',\n\tfontSizeMobile: '15px',\n\tfontSizeSmall: 'calc(0.92 * 13px)',\n\tfontSizeXSmall: 'calc(0.75 * 13px)',\n\tfontLineHeightBase: '1.2',\n\tfontWeight: 'normal',\n\tfontWeightHeading: '600',\n\tgridBase: '4px',\n\tcardBorderRadius: '2px',\n\tcardPaddingXSmall: `${ space( 2 ) }`,\n\tcardPaddingSmall: `${ space( 4 ) }`,\n\tcardPaddingMedium: `${ space( 4 ) } ${ space( 6 ) }`,\n\tcardPaddingLarge: `${ space( 6 ) } ${ space( 8 ) }`,\n\tsurfaceBackgroundColor: COLORS.white,\n\tsurfaceBackgroundSubtleColor: '#F3F3F3',\n\tsurfaceBackgroundTintColor: '#F5F5F5',\n\tsurfaceBorderColor: 'rgba(0, 0, 0, 0.1)',\n\tsurfaceBorderBoldColor: 'rgba(0, 0, 0, 0.15)',\n\tsurfaceBorderSubtleColor: 'rgba(0, 0, 0, 0.05)',\n\tsurfaceBackgroundTertiaryColor: COLORS.white,\n\tsurfaceColor: COLORS.white,\n\ttransitionDuration: '200ms',\n\ttransitionDurationFast: '160ms',\n\ttransitionDurationFaster: '120ms',\n\ttransitionDurationFastest: '100ms',\n\ttransitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)',\n\ttransitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)',\n} );\n"]}
@@ -22,6 +22,6 @@ var _breakpoint = require("../breakpoint");
22
22
  /**
23
23
  * Internal dependencies
24
24
  */
25
- const inputControl = /*#__PURE__*/(0, _react.css)("font-family:", (0, _font.font)('default.fontFamily'), ";padding:6px 8px;", _base.inputStyleNeutral, ";font-size:", (0, _font.font)('mobileTextMinFontSize'), ";line-height:normal;", (0, _breakpoint.breakpoint)('small'), "{font-size:", (0, _font.font)('default.fontSize'), ";line-height:normal;}&:focus{", _base.inputStyleFocus, ";}&::-webkit-input-placeholder{color:", _colorsValues.COLORS.darkGray.placeholder, ";}&::-moz-placeholder{opacity:1;color:", _colorsValues.COLORS.darkGray.placeholder, ";}&:-ms-input-placeholder{color:", _colorsValues.COLORS.darkGray.placeholder, ";}.is-dark-theme &{&::-webkit-input-placeholder{color:", _colorsValues.COLORS.lightGray.placeholder, ";}&::-moz-placeholder{opacity:1;color:", _colorsValues.COLORS.lightGray.placeholder, ";}&:-ms-input-placeholder{color:", _colorsValues.COLORS.lightGray.placeholder, ";}}" + (process.env.NODE_ENV === "production" ? "" : ";label:inputControl;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdXRpbHMvaW5wdXQvaW5wdXQtY29udHJvbC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFhK0IiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy91dGlscy9pbnB1dC9pbnB1dC1jb250cm9sLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBpbnB1dFN0eWxlTmV1dHJhbCwgaW5wdXRTdHlsZUZvY3VzIH0gZnJvbSAnLi9iYXNlJztcbmltcG9ydCB7IGZvbnQgfSBmcm9tICcuLi9mb250JztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uL2NvbG9ycy12YWx1ZXMnO1xuaW1wb3J0IHsgYnJlYWtwb2ludCB9IGZyb20gJy4uL2JyZWFrcG9pbnQnO1xuXG5leHBvcnQgY29uc3QgaW5wdXRDb250cm9sID0gY3NzYFxuXHRmb250LWZhbWlseTogJHsgZm9udCggJ2RlZmF1bHQuZm9udEZhbWlseScgKSB9O1xuXHRwYWRkaW5nOiA2cHggOHB4O1xuXHQkeyBpbnB1dFN0eWxlTmV1dHJhbCB9O1xuXG5cdC8qIEZvbnRzIHNtYWxsZXIgdGhhbiAxNnB4IGNhdXNlcyBtb2JpbGUgc2FmYXJpIHRvIHpvb20uICovXG5cdGZvbnQtc2l6ZTogJHsgZm9udCggJ21vYmlsZVRleHRNaW5Gb250U2l6ZScgKSB9O1xuXHQvKiBPdmVycmlkZSBjb3JlIGxpbm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8gTmVjZXNzYXJ5IGJlY2F1c2UgRmlyZWZveCByZWR1Y2VzIHRoaXMgZnJvbSAxLlxuXHRcdFx0Y29sb3I6ICR7IENPTE9SUy5saWdodEdyYXkucGxhY2Vob2xkZXIgfTtcblx0XHR9XG5cblx0XHQmOi1tcy1pbnB1dC1wbGFjZWhvbGRlciB7XG5cdFx0XHRjb2xvcjogJHsgQ09MT1JTLmxpZ2h0R3JheS5wbGFjZWhvbGRlciB9O1xuXHRcdH1cblx0fVxuYDtcbiJdfQ== */");
25
+ const inputControl = /*#__PURE__*/(0, _react.css)("font-family:", (0, _font.font)('default.fontFamily'), ";padding:6px 8px;", _base.inputStyleNeutral, ";font-size:", (0, _font.font)('mobileTextMinFontSize'), ";line-height:normal;", (0, _breakpoint.breakpoint)('small'), "{font-size:", (0, _font.font)('default.fontSize'), ";line-height:normal;}&:focus{", _base.inputStyleFocus, ";}&::-webkit-input-placeholder{color:", _colorsValues.COLORS.ui.darkGrayPlaceholder, ";}&::-moz-placeholder{opacity:1;color:", _colorsValues.COLORS.ui.darkGrayPlaceholder, ";}&:-ms-input-placeholder{color:", _colorsValues.COLORS.ui.darkGrayPlaceholder, ";}.is-dark-theme &{&::-webkit-input-placeholder{color:", _colorsValues.COLORS.ui.lightGrayPlaceholder, ";}&::-moz-placeholder{opacity:1;color:", _colorsValues.COLORS.ui.lightGrayPlaceholder, ";}&:-ms-input-placeholder{color:", _colorsValues.COLORS.ui.lightGrayPlaceholder, ";}}" + (process.env.NODE_ENV === "production" ? "" : ";label:inputControl;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdXRpbHMvaW5wdXQvaW5wdXQtY29udHJvbC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFhK0IiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnR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bGFjZWhvbGRlciB9O1xuXHRcdH1cblx0fVxuYDtcbiJdfQ== */");
26
26
  exports.inputControl = inputControl;
27
27
  //# sourceMappingURL=input-control.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/utils/input/input-control.js"],"names":["inputControl","css","inputStyleNeutral","inputStyleFocus","COLORS","darkGray","placeholder","lightGray"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMO,MAAMA,YAAY,oBAAGC,UAAH,kBACR,gBAAM,oBAAN,CADQ,uBAGrBC,uBAHqB,iBAMV,gBAAM,uBAAN,CANU,0BAUrB,4BAAY,OAAZ,CAVqB,iBAWT,gBAAM,kBAAN,CAXS,mCAiBpBC,qBAjBoB,2CAsBbC,qBAAOC,QAAP,CAAgBC,WAtBH,4CA2BbF,qBAAOC,QAAP,CAAgBC,WA3BH,sCA+BbF,qBAAOC,QAAP,CAAgBC,WA/BH,4DAoCZF,qBAAOG,SAAP,CAAiBD,WApCL,4CAyCZF,qBAAOG,SAAP,CAAiBD,WAzCL,sCA6CZF,qBAAOG,SAAP,CAAiBD,WA7CL,ggFAAlB","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { inputStyleNeutral, inputStyleFocus } from './base';\nimport { font } from '../font';\nimport { COLORS } from '../colors-values';\nimport { breakpoint } from '../breakpoint';\n\nexport const inputControl = css`\n\tfont-family: ${ font( 'default.fontFamily' ) };\n\tpadding: 6px 8px;\n\t${ inputStyleNeutral };\n\n\t/* Fonts smaller than 16px causes mobile safari to zoom. */\n\tfont-size: ${ font( 'mobileTextMinFontSize' ) };\n\t/* Override core line-height. To be reviewed. */\n\tline-height: normal;\n\n\t${ breakpoint( 'small' ) } {\n\t\tfont-size: ${ font( 'default.fontSize' ) };\n\t\t/* Override core line-height. To be reviewed. */\n\t\tline-height: normal;\n\t}\n\n\t&:focus {\n\t\t${ inputStyleFocus }\n\t}\n\n\t// Use opacity to work in various editor styles.\n\t&::-webkit-input-placeholder {\n\t\tcolor: ${ COLORS.darkGray.placeholder };\n\t}\n\n\t&::-moz-placeholder {\n\t\topacity: 1; // Necessary because Firefox reduces this from 1.\n\t\tcolor: ${ COLORS.darkGray.placeholder };\n\t}\n\n\t&:-ms-input-placeholder {\n\t\tcolor: ${ COLORS.darkGray.placeholder };\n\t}\n\n\t.is-dark-theme & {\n\t\t&::-webkit-input-placeholder {\n\t\t\tcolor: ${ COLORS.lightGray.placeholder };\n\t\t}\n\n\t\t&::-moz-placeholder {\n\t\t\topacity: 1; // Necessary because Firefox reduces this from 1.\n\t\t\tcolor: ${ COLORS.lightGray.placeholder };\n\t\t}\n\n\t\t&:-ms-input-placeholder {\n\t\t\tcolor: ${ COLORS.lightGray.placeholder };\n\t\t}\n\t}\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/utils/input/input-control.js"],"names":["inputControl","css","inputStyleNeutral","inputStyleFocus","COLORS","ui","darkGrayPlaceholder","lightGrayPlaceholder"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMO,MAAMA,YAAY,oBAAGC,UAAH,kBACR,gBAAM,oBAAN,CADQ,uBAGrBC,uBAHqB,iBAMV,gBAAM,uBAAN,CANU,0BAUrB,4BAAY,OAAZ,CAVqB,iBAWT,gBAAM,kBAAN,CAXS,mCAiBpBC,qBAjBoB,2CAsBbC,qBAAOC,EAAP,CAAUC,mBAtBG,4CA2BbF,qBAAOC,EAAP,CAAUC,mBA3BG,sCA+BbF,qBAAOC,EAAP,CAAUC,mBA/BG,4DAoCZF,qBAAOC,EAAP,CAAUE,oBApCE,4CAyCZH,qBAAOC,EAAP,CAAUE,oBAzCE,sCA6CZH,qBAAOC,EAAP,CAAUE,oBA7CE,ghFAAlB","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { inputStyleNeutral, inputStyleFocus } from './base';\nimport { font } from '../font';\nimport { COLORS } from '../colors-values';\nimport { breakpoint } from '../breakpoint';\n\nexport const inputControl = css`\n\tfont-family: ${ font( 'default.fontFamily' ) };\n\tpadding: 6px 8px;\n\t${ inputStyleNeutral };\n\n\t/* Fonts smaller than 16px causes mobile safari to zoom. */\n\tfont-size: ${ font( 'mobileTextMinFontSize' ) };\n\t/* Override core line-height. To be reviewed. */\n\tline-height: normal;\n\n\t${ breakpoint( 'small' ) } {\n\t\tfont-size: ${ font( 'default.fontSize' ) };\n\t\t/* Override core line-height. To be reviewed. */\n\t\tline-height: normal;\n\t}\n\n\t&:focus {\n\t\t${ inputStyleFocus }\n\t}\n\n\t// Use opacity to work in various editor styles.\n\t&::-webkit-input-placeholder {\n\t\tcolor: ${ COLORS.ui.darkGrayPlaceholder };\n\t}\n\n\t&::-moz-placeholder {\n\t\topacity: 1; // Necessary because Firefox reduces this from 1.\n\t\tcolor: ${ COLORS.ui.darkGrayPlaceholder };\n\t}\n\n\t&:-ms-input-placeholder {\n\t\tcolor: ${ COLORS.ui.darkGrayPlaceholder };\n\t}\n\n\t.is-dark-theme & {\n\t\t&::-webkit-input-placeholder {\n\t\t\tcolor: ${ COLORS.ui.lightGrayPlaceholder };\n\t\t}\n\n\t\t&::-moz-placeholder {\n\t\t\topacity: 1; // Necessary because Firefox reduces this from 1.\n\t\t\tcolor: ${ COLORS.ui.lightGrayPlaceholder };\n\t\t}\n\n\t\t&:-ms-input-placeholder {\n\t\t\tcolor: ${ COLORS.ui.lightGrayPlaceholder };\n\t\t}\n\t}\n`;\n"]}