Skip to content

Commit

Permalink
Move state to core.state package
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Oct 21, 2023
1 parent 223ab02 commit da43d5a
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 84 deletions.
1 change: 1 addition & 0 deletions core/src/main/kotlin/org/jetbrains/jewel/Outline.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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.foundation.Stroke
import org.jetbrains.jewel.foundation.border
import org.jetbrains.jewel.util.thenIf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ 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.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.FocusableComponentState
import org.jetbrains.jewel.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.foundation.Stroke
import org.jetbrains.jewel.foundation.border
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ 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.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Indeterminate
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.CommonStateBitMask.Selected
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.LocalSwingCompatMode
import org.jetbrains.jewel.Outline
import org.jetbrains.jewel.ToggleableComponentState
import org.jetbrains.jewel.ToggleableComponentState.Companion.readToggleableState
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.foundation.Stroke
import org.jetbrains.jewel.outline
import org.jetbrains.jewel.painter.PainterHint
Expand Down
16 changes: 8 additions & 8 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,16 +25,16 @@ 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.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.CommonStateBitMask.Selected
import org.jetbrains.jewel.FocusableComponentState
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.SelectableComponentState
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.foundation.Stroke
import org.jetbrains.jewel.foundation.border
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ 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.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.FocusableComponentState
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.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.foundation.Stroke
import org.jetbrains.jewel.foundation.border
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ 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.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.FocusableComponentState
import org.jetbrains.jewel.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.foundation.Stroke
import org.jetbrains.jewel.foundation.border
Expand Down
14 changes: 7 additions & 7 deletions core/src/main/kotlin/org/jetbrains/jewel/core/component/Link.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.TextUnit
import org.jetbrains.jewel.CommonStateBitMask
import org.jetbrains.jewel.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.FocusableComponentState
import org.jetbrains.jewel.JewelTheme.Companion.isSwingCompatMode
import org.jetbrains.jewel.core.component.styling.LinkStyle
import org.jetbrains.jewel.core.component.styling.LocalLinkStyle
import org.jetbrains.jewel.core.component.styling.LocalMenuStyle
import org.jetbrains.jewel.core.component.styling.MenuStyle
import org.jetbrains.jewel.core.state.CommonStateBitMask
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.disabled
import org.jetbrains.jewel.focusOutline
import org.jetbrains.jewel.foundation.onHover
Expand Down
14 changes: 7 additions & 7 deletions core/src/main/kotlin/org/jetbrains/jewel/core/component/Menu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@ import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.PopupProperties
import org.jetbrains.jewel.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.CommonStateBitMask.Selected
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.LocalMenuManager
import org.jetbrains.jewel.MenuManager
import org.jetbrains.jewel.Orientation
import org.jetbrains.jewel.SelectableComponentState
import org.jetbrains.jewel.core.component.styling.LocalMenuStyle
import org.jetbrains.jewel.core.component.styling.MenuItemColors
import org.jetbrains.jewel.core.component.styling.MenuItemMetrics
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.CommonStateBitMask.Selected
import org.jetbrains.jewel.core.state.SelectableComponentState
import org.jetbrains.jewel.foundation.Stroke
import org.jetbrains.jewel.foundation.border
import org.jetbrains.jewel.foundation.onHover
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.takeOrElse
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.text.TextStyle
import org.jetbrains.jewel.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.CommonStateBitMask.Selected
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.LocalSwingCompatMode
import org.jetbrains.jewel.Outline
import org.jetbrains.jewel.SelectableComponentState
import org.jetbrains.jewel.core.component.styling.RadioButtonStyle
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.SelectableComponentState
import org.jetbrains.jewel.foundation.Stroke
import org.jetbrains.jewel.outline
import org.jetbrains.jewel.painter.hints.Selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.platform.LocalLayoutDirection
import org.jetbrains.jewel.CommonStateBitMask
import org.jetbrains.jewel.FocusableComponentState
import org.jetbrains.jewel.core.state.CommonStateBitMask
import org.jetbrains.jewel.core.state.FocusableComponentState
import org.jetbrains.jewel.foundation.onHover

@Composable
Expand Down
14 changes: 7 additions & 7 deletions core/src/main/kotlin/org/jetbrains/jewel/core/component/Tabs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ import androidx.compose.ui.input.pointer.isTertiary
import androidx.compose.ui.input.pointer.onPointerEvent
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.unit.dp
import org.jetbrains.jewel.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.CommonStateBitMask.Selected
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.NoIndication
import org.jetbrains.jewel.SelectableComponentState
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.SelectableComponentState
import org.jetbrains.jewel.painter.hints.Stateful

@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.state

internal object CommonStateBitMask {

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.state

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import org.jetbrains.jewel.JewelTheme

interface FocusableComponentState : InteractiveComponentState {

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.state

import androidx.compose.runtime.Stable

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.state

import androidx.compose.runtime.Stable

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

import androidx.compose.runtime.Stable
import androidx.compose.ui.state.ToggleableState
import org.jetbrains.jewel.CommonStateBitMask.Indeterminate
import org.jetbrains.jewel.CommonStateBitMask.Selected
import org.jetbrains.jewel.core.state.CommonStateBitMask.Indeterminate
import org.jetbrains.jewel.core.state.CommonStateBitMask.Selected

interface ToggleableComponentState : SelectableComponentState {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import org.jetbrains.jewel.CommonStateBitMask
import org.jetbrains.jewel.CommonStateBitMask.Active
import org.jetbrains.jewel.CommonStateBitMask.Enabled
import org.jetbrains.jewel.CommonStateBitMask.Focused
import org.jetbrains.jewel.CommonStateBitMask.Hovered
import org.jetbrains.jewel.CommonStateBitMask.Pressed
import org.jetbrains.jewel.CommonStateBitMask.Selected
import org.jetbrains.jewel.InteractiveComponentState
import org.jetbrains.jewel.SelectableComponentState
import org.jetbrains.jewel.core.state.CommonStateBitMask
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.InteractiveComponentState
import org.jetbrains.jewel.core.state.SelectableComponentState
import org.jetbrains.jewel.foundation.lazy.SelectableLazyColumn
import org.jetbrains.jewel.foundation.lazy.SelectableLazyItemScope
import org.jetbrains.jewel.foundation.lazy.SelectionMode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.jetbrains.jewel.painter.hints

import androidx.compose.runtime.Immutable
import org.jetbrains.jewel.SelectableComponentState
import org.jetbrains.jewel.core.state.SelectableComponentState
import org.jetbrains.jewel.painter.PainterHint
import org.jetbrains.jewel.painter.PainterSuffixHint

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.jetbrains.jewel.painter.hints

import androidx.compose.runtime.Immutable
import org.jetbrains.jewel.FocusableComponentState
import org.jetbrains.jewel.InteractiveComponentState
import org.jetbrains.jewel.core.state.FocusableComponentState
import org.jetbrains.jewel.core.state.InteractiveComponentState
import org.jetbrains.jewel.painter.PainterHint
import org.jetbrains.jewel.painter.PainterSuffixHint

Expand Down

0 comments on commit da43d5a

Please sign in to comment.