| EQUITY, LONG-TERM INCENTIVE COMPENSATION PLANS AND NON-CONTROLLING INTEREST - Share-based Compensation Expense (Details) - USD ($) $ in Thousands | 12 Months Ended | ||
|---|---|---|---|
| Jun. 30, 2020 | Jun. 30, 2019 | Jun. 30, 2018 | |
| Stock-based compensation expense | |||
| Stock-based compensation expense | $ 111,381 | $ 94,194 | $ 62,784 | 
| Stock-based compensation expense associated with acceleration of equity awards | 10,900 | ||
| Stock-based compensation capitalized as inventory | 6,752 | 4,819 | |
| Costs of revenues | |||
| Stock-based compensation expense | |||
| Stock-based compensation expense | 14,680 | 10,384 | 8,062 | 
| Research and development | |||
| Stock-based compensation expense | |||
| Stock-based compensation expense | 23,530 | 16,225 | 11,249 | 
| Selling, general and administrative | |||
| Stock-based compensation expense | |||
| Stock-based compensation expense | $ 73,171 | $ 67,585 | $ 43,473 | 
| 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 | ||||||||||
| 
- Definition Amount of additional cost recognized for award under share-based payment arrangement from occurrence of event accelerating recognition of cost. No definition available. 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 |