Skip to content

Commit

Permalink
Move other bits to core and foundation packages
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Oct 21, 2023
1 parent da43d5a commit 83d01dd
Show file tree
Hide file tree
Showing 155 changed files with 2,385 additions and 2,360 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/jewel-check-public-api.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apiValidation {
}

poko {
pokoAnnotation.set("org.jetbrains.jewel.GenerateDataFunctions")
pokoAnnotation.set("org.jetbrains.jewel.foundation.GenerateDataFunctions")
}

tasks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal object IntUiThemeDescriptorReader {
addImport(colorClassName.packageName, colorClassName.simpleName)

addType(TypeSpec.objectBuilder(className).apply {
addSuperinterface(ClassName.bestGuess("org.jetbrains.jewel.ThemeDescriptor"))
addSuperinterface(ClassName.bestGuess("org.jetbrains.jewel.core.ThemeDescriptor"))

addProperty(
PropertySpec.builder("isDark", Boolean::class, KModifier.OVERRIDE)
Expand All @@ -52,9 +52,9 @@ internal object IntUiThemeDescriptorReader {
}.build()

private val colorPaletteClassName =
ClassName.bestGuess("org.jetbrains.jewel.ThemeColorPalette")
ClassName.bestGuess("org.jetbrains.jewel.core.ThemeColorPalette")
private val iconDataClassName =
ClassName.bestGuess("org.jetbrains.jewel.ThemeIconData")
ClassName.bestGuess("org.jetbrains.jewel.core.ThemeIconData")

private fun TypeSpec.Builder.readColors(colors: Map<String, String>) {
val colorGroups = colors.entries.groupBy {
Expand Down
3,491 changes: 1,746 additions & 1,745 deletions core/api/core.api

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

interface ClassLoaderProvider {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.foundation.LocalContextMenuRepresentation
import androidx.compose.runtime.Composable
Expand All @@ -13,6 +13,7 @@ import org.jetbrains.jewel.core.component.styling.TabStyle
import org.jetbrains.jewel.core.component.styling.TextAreaStyle
import org.jetbrains.jewel.core.component.styling.TextFieldStyle
import org.jetbrains.jewel.core.component.styling.TooltipStyle
import org.jetbrains.jewel.foundation.GenerateDataFunctions

@Stable
@GenerateDataFunctions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.foundation.ContextMenuItem
import androidx.compose.foundation.ContextMenuRepresentation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.ColorMatrix
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color
import org.jetbrains.jewel.foundation.GenerateDataFunctions

@Immutable
@GenerateDataFunctions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.unit.Dp
import org.jetbrains.jewel.foundation.GenerateDataFunctions

@Immutable
@GenerateDataFunctions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.foundation.layout.Row
import androidx.compose.runtime.Composable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.input.InputMode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.foundation.Indication
import androidx.compose.foundation.IndicationInstance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

/**
* Class to define possible directions.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.unit.Dp
import org.jetbrains.jewel.core.state.FocusableComponentState
import org.jetbrains.jewel.core.util.thenIf
import org.jetbrains.jewel.foundation.Stroke
import org.jetbrains.jewel.foundation.border
import org.jetbrains.jewel.util.thenIf
import org.jetbrains.jewel.foundation.state.FocusableComponentState

enum class Outline {
None,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.Color
import org.jetbrains.jewel.foundation.GenerateDataFunctions

private val colorKeyRegex: Regex
get() = "([a-z]+)(\\d+)".toRegex(RegexOption.IGNORE_CASE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import org.jetbrains.jewel.foundation.GenerateDataFunctions

@Immutable
@GenerateDataFunctions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.runtime.Immutable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jetbrains.jewel
package org.jetbrains.jewel.core

import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.Color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.takeOrElse
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.text.TextStyle
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.core.JewelTheme
import org.jetbrains.jewel.core.component.styling.ButtonStyle
import org.jetbrains.jewel.core.state.CommonStateBitMask.Active
import org.jetbrains.jewel.core.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.core.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.core.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.core.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.core.state.FocusableComponentState
import org.jetbrains.jewel.focusOutline
import org.jetbrains.jewel.core.focusOutline
import org.jetbrains.jewel.foundation.Stroke
import org.jetbrains.jewel.foundation.border
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Active
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.foundation.state.FocusableComponentState

@Composable
fun DefaultButton(
Expand Down
34 changes: 17 additions & 17 deletions core/src/main/kotlin/org/jetbrains/jewel/core/component/Checkbox.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,28 @@ import androidx.compose.ui.graphics.takeOrElse
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.state.ToggleableState
import androidx.compose.ui.text.TextStyle
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.LocalSwingCompatMode
import org.jetbrains.jewel.Outline
import org.jetbrains.jewel.core.JewelTheme
import org.jetbrains.jewel.core.LocalSwingCompatMode
import org.jetbrains.jewel.core.Outline
import org.jetbrains.jewel.core.component.styling.CheckboxColors
import org.jetbrains.jewel.core.component.styling.CheckboxIcons
import org.jetbrains.jewel.core.component.styling.CheckboxMetrics
import org.jetbrains.jewel.core.component.styling.LocalCheckboxStyle
import org.jetbrains.jewel.core.state.CommonStateBitMask.Active
import org.jetbrains.jewel.core.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.core.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.core.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.core.state.CommonStateBitMask.Indeterminate
import org.jetbrains.jewel.core.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.core.state.CommonStateBitMask.Selected
import org.jetbrains.jewel.core.state.ToggleableComponentState
import org.jetbrains.jewel.core.state.ToggleableComponentState.Companion.readToggleableState
import org.jetbrains.jewel.core.outline
import org.jetbrains.jewel.core.painter.PainterHint
import org.jetbrains.jewel.core.painter.PainterSuffixHint
import org.jetbrains.jewel.core.painter.hints.Selected
import org.jetbrains.jewel.core.painter.hints.Stateful
import org.jetbrains.jewel.foundation.Stroke
import org.jetbrains.jewel.outline
import org.jetbrains.jewel.painter.PainterHint
import org.jetbrains.jewel.painter.PainterSuffixHint
import org.jetbrains.jewel.painter.hints.Selected
import org.jetbrains.jewel.painter.hints.Stateful
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Active
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Indeterminate
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Selected
import org.jetbrains.jewel.foundation.state.ToggleableComponentState
import org.jetbrains.jewel.foundation.state.ToggleableComponentState.Companion.readToggleableState

@Composable
fun Checkbox(
Expand Down
20 changes: 10 additions & 10 deletions core/src/main/kotlin/org/jetbrains/jewel/core/component/Chip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.isUnspecified
import androidx.compose.ui.semantics.Role
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.core.JewelTheme
import org.jetbrains.jewel.core.component.styling.ChipStyle
import org.jetbrains.jewel.core.state.CommonStateBitMask.Active
import org.jetbrains.jewel.core.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.core.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.core.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.core.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.core.state.CommonStateBitMask.Selected
import org.jetbrains.jewel.core.state.FocusableComponentState
import org.jetbrains.jewel.core.state.SelectableComponentState
import org.jetbrains.jewel.focusOutline
import org.jetbrains.jewel.core.focusOutline
import org.jetbrains.jewel.foundation.Stroke
import org.jetbrains.jewel.foundation.border
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Active
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Selected
import org.jetbrains.jewel.foundation.state.FocusableComponentState
import org.jetbrains.jewel.foundation.state.SelectableComponentState

@Composable
fun Chip(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import androidx.compose.ui.res.loadSvgPainter
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.delay
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.core.JewelTheme
import org.jetbrains.jewel.core.component.styling.CircularProgressStyle
import org.jetbrains.jewel.util.toRgbaHexString
import org.jetbrains.jewel.core.util.toRgbaHexString

@Composable
fun CircularProgressIndicator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.takeOrElse
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.takeOrElse
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.Orientation
import org.jetbrains.jewel.core.JewelTheme
import org.jetbrains.jewel.core.Orientation
import org.jetbrains.jewel.core.component.styling.DividerStyle

@Composable
Expand Down
28 changes: 14 additions & 14 deletions core/src/main/kotlin/org/jetbrains/jewel/core/component/Dropdown.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ import androidx.compose.ui.platform.LocalInputModeManager
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.PopupProperties
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.LocalMenuManager
import org.jetbrains.jewel.MenuManager
import org.jetbrains.jewel.Outline
import org.jetbrains.jewel.core.JewelTheme
import org.jetbrains.jewel.core.LocalMenuManager
import org.jetbrains.jewel.core.MenuManager
import org.jetbrains.jewel.core.Outline
import org.jetbrains.jewel.core.component.styling.DropdownStyle
import org.jetbrains.jewel.core.component.styling.LocalMenuStyle
import org.jetbrains.jewel.core.component.styling.MenuStyle
import org.jetbrains.jewel.core.state.CommonStateBitMask.Active
import org.jetbrains.jewel.core.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.core.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.core.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.core.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.core.state.FocusableComponentState
import org.jetbrains.jewel.focusOutline
import org.jetbrains.jewel.core.focusOutline
import org.jetbrains.jewel.core.outline
import org.jetbrains.jewel.core.painter.hints.Stateful
import org.jetbrains.jewel.core.util.thenIf
import org.jetbrains.jewel.foundation.Stroke
import org.jetbrains.jewel.foundation.border
import org.jetbrains.jewel.outline
import org.jetbrains.jewel.painter.hints.Stateful
import org.jetbrains.jewel.util.thenIf
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Active
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.foundation.state.FocusableComponentState

@Composable
fun Dropdown(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
import org.jetbrains.jewel.painter.rememberResourcePainterProvider
import org.jetbrains.jewel.core.painter.rememberResourcePainterProvider
import org.xml.sax.InputSource
import java.io.InputStream

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.Role
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.NoIndication
import org.jetbrains.jewel.core.JewelTheme
import org.jetbrains.jewel.core.NoIndication
import org.jetbrains.jewel.core.component.styling.IconButtonStyle

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ import androidx.compose.ui.text.TextLayoutResult
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.input.VisualTransformation
import org.jetbrains.jewel.Outline
import org.jetbrains.jewel.core.Outline
import org.jetbrains.jewel.core.component.styling.InputFieldStyle
import org.jetbrains.jewel.core.state.CommonStateBitMask.Active
import org.jetbrains.jewel.core.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.core.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.core.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.core.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.core.state.FocusableComponentState
import org.jetbrains.jewel.focusOutline
import org.jetbrains.jewel.core.focusOutline
import org.jetbrains.jewel.core.outline
import org.jetbrains.jewel.core.util.thenIf
import org.jetbrains.jewel.foundation.Stroke
import org.jetbrains.jewel.foundation.border
import org.jetbrains.jewel.outline
import org.jetbrains.jewel.util.thenIf
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Active
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Enabled
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Focused
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Hovered
import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Pressed
import org.jetbrains.jewel.foundation.state.FocusableComponentState

@Composable
internal fun InputField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.unit.offset
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.Outline
import org.jetbrains.jewel.core.JewelTheme
import org.jetbrains.jewel.core.Outline
import org.jetbrains.jewel.core.component.styling.LabelledTextFieldStyle

/**
Expand Down
Loading

0 comments on commit 83d01dd

Please sign in to comment.