Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstyl committed May 1, 2024
0 parents commit b0cb5f3
Show file tree
Hide file tree
Showing 47 changed files with 3,448 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ci
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Prepare demo app
run: bash /scripts/update_demo.sh
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*.iml
.gradle
**/build/
xcuserdata
!src/**/build/
local.properties
.idea
kotlin-js-store/
.DS_Store
captures
.externalNativeBuild
.cxx
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcodeproj/project.xcworkspace/
!*.xcworkspace/contents.xcworkspacedata
**/xcshareddata/WorkspaceSettings.xcsettings
venv/
.cache/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Composable Horizons

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Compose Menu (Dropdown)

An unstyled Composable component for Compose Multiplatform that can be used to implement Dropdown Menus with the styling of your choice.

Comes with built-in Keyboard management and animation support. Supports Compose Desktop, Web (WASM), Android and iOS.

## Installation

Ensure you have `mavenCentral()` to your `dependencyResolutionManagement{}` block, then add the dependency:

```kotlin
dependencies {
implementation("com.composables.ui:menu:0.0.2")
}
```

## Contributing

We are currently accepting contributions in the form of bug reports and feature requests, in the form of Github issues.
24 changes: 24 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties

plugins {
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
id("com.android.application") version "8.2.0" apply false
id("com.android.library") version "8.2.0" apply false
id("org.jetbrains.dokka").version("1.9.10").apply(false)
id("io.github.gradle-nexus.publish-plugin").version("2.0.0-rc-1")
}

nexusPublishing {
repositories {
sonatype {
with(gradleLocalProperties(rootDir)) {
stagingProfileId.set(getProperty("sonatype.stagingProfileId") ?: System.getenv("SONATYPE_STAGING_PROFILE_ID"))
username.set(getProperty("sonatype.username") ?: System.getenv("OSSRH_USERNAME"))
password.set(getProperty("sonatype.password") ?: System.getenv("OSSRH_PASSWORD"))
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
}
83 changes: 83 additions & 0 deletions demo/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.jetbrainsCompose)
id("com.android.application")
}

kotlin {
@OptIn(ExperimentalWasmDsl::class) wasmJs {
moduleName = "demo"
browser {
commonWebpackConfig {
outputFileName = "composeApp.js"
}
}
binaries.executable()
}

jvm("desktop")

androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}

listOf(iosX64(), iosArm64(), iosSimulatorArm64()).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "ComposeApp"
isStatic = true
}
}

sourceSets {
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(project(":menu"))
}

val desktopMain by getting {
dependencies {
implementation(compose.desktop.common)
implementation(compose.desktop.currentOs)
}
}

val androidMain by getting {
dependencies {
implementation ("androidx.compose.ui:ui:1.6.6")
implementation ("androidx.activity:activity-compose:1.9.0")
}
}
}
}

compose.experimental {
web.application {}
}

compose.desktop {
application {
mainClass = "MainKt"
}
}

android {
namespace = "com.composables.ui.demo"
compileSdk = 34
defaultConfig {
minSdk = 21
targetSdk = 34

applicationId = "com.composables.ui.demo"
versionCode = 1
versionName = "1.0.0"
}
}
15 changes: 15 additions & 0 deletions demo/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET"/>

<application>
<activity android:name="MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>

</manifest>
25 changes: 25 additions & 0 deletions demo/src/androidMain/kotlin/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.composables.ui

import App
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.systemBarsPadding
import androidx.compose.ui.Modifier

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

enableEdgeToEdge()
actionBar?.hide()

setContent {
Box(Modifier.systemBarsPadding()) {
App()
}
}
}
}
Loading

0 comments on commit b0cb5f3

Please sign in to comment.