| EQUITY, LONG-TERM INCENTIVE COMPENSATION PLANS AND NON-CONTROLLING INTEREST - Share-based Compensation Expense (Details) - USD ($) $ in Thousands | 3 Months Ended | 9 Months Ended | |||
|---|---|---|---|---|---|
| Mar. 31, 2021 | Mar. 31, 2020 | Mar. 31, 2021 | Mar. 31, 2020 | Jun. 30, 2020 | |
| Stock-based compensation expense | |||||
| Stock-based compensation expense | $ 30,327 | $ 31,270 | $ 84,146 | $ 85,003 | |
| Stock-based compensation capitalized as inventory | 5,900 | 5,900 | $ 6,800 | ||
| Costs of revenues | |||||
| Stock-based compensation expense | |||||
| Stock-based compensation expense | 4,779 | 4,162 | 12,550 | 10,389 | |
| Research and development | |||||
| Stock-based compensation expense | |||||
| Stock-based compensation expense | 6,518 | 6,577 | 17,214 | 16,936 | |
| Selling, general and administrative | |||||
| Stock-based compensation expense | |||||
| Stock-based compensation expense | $ 19,030 | $ 20,531 | $ 54,382 | $ 57,678 | |
| X | ||||||||||
| 
- Definition Stock Based Compensation Capitalized As Inventory No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of expense for award under share-based payment arrangement. Excludes amount capitalized. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Line items represent financial concepts included in a table. These concepts are used to disclose reportable information associated with domain members defined in one or many axes to the table. No definition available. 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 |