Skip to content

Commit c7793a1

Browse files
committed
docs: Preview for components in documentation website (#80)
1 parent 14ce5bd commit c7793a1

File tree

103 files changed

+3060
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+3060
-86
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
./gradlew :miuix:dokkaGenerate
3636
mkdir -p ./docs/public/dokka
3737
mv ./miuix/build/dokka/html/* ./docs/public/dokka
38+
./gradlew :docs:demo:jsBrowserDistribution
39+
mkdir -p ./docs/public/compose
40+
mv ./docs/demo/build/dist/js/productionExecutable/* ./docs/public/compose
3841
cd ./docs
3942
yarn install
4043
yarn docs:build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ docs/node_modules
1616
docs/.vitepress/dist
1717
docs/.vitepress/cache
1818
docs/public/dokka
19+
docs/public/compose

docs/components/basiccomponent.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
This project builds upon it to provide some extended components, enabling developers to quickly create UI components that conform to design specifications. See the usage of [Extended Components](../components/#extended-components) for details.
66

7+
<div style="position: relative; max-width: 700px; height: 350px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
8+
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=basicComponent" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
9+
</div>
10+
711
## Import
812

913
```kotlin

docs/components/button.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
`Button` is a basic interactive component in Miuix, used to trigger actions or events. It provides multiple style options, including primary buttons, secondary buttons, and text buttons.
44

5+
<div style="position: relative; max-width: 700px; height: 200px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
6+
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=button" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
7+
</div>
8+
59
## Import
610

711
```kotlin

docs/components/card.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
`Card` is a basic container component in Miuix, used to hold related content and actions. It provides a card container with Miuix style, suitable for scenarios such as information display and content grouping. Supports both static display and interactive modes.
44

5+
<div style="position: relative; max-width: 700px; height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
6+
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=card" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
7+
</div>
8+
59
## Import
610

711
```kotlin

docs/components/checkbox.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
`CheckBox` is a basic selection component in Miuix, used for toggling between checked and unchecked states. It provides an interactive selection control with animation effects, suitable for multiple selection scenarios and enabling/disabling configuration items.
44

5+
<div style="position: relative; max-width: 700px; height: 100px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
6+
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=checkbox" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
7+
</div>
8+
59
## Import
610

711
```kotlin

docs/components/colorpicker.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
`ColorPicker` is a color selection component in Miuix that allows users to pick colors by adjusting hue, saturation, brightness, and transparency. The component provides an intuitive slider interface with haptic feedback and real-time color preview.
44

5+
<div style="position: relative; max-width: 700px; height: 260px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
6+
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=colorPicker" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
7+
</div>
8+
59
## Import
610

711
```kotlin

docs/components/divider.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
`Divider` is a basic layout component in Miuix used to separate content in lists and layouts. It provides both horizontal and vertical divider styles.
44

5+
<div style="position: relative; max-width: 700px; height: 160px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
6+
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=divider" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
7+
</div>
8+
59
## Import
610

711
```kotlin

docs/components/floatingactionbutton.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
This component is typically used in conjunction with the `Scaffold` component to maintain consistent layout and behavior across different pages in the application.
66

7+
<div style="position: relative; max-width: 700px; height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
8+
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=floatingActionButton" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
9+
</div>
10+
711
## Import
812

913
```kotlin

docs/components/floatingtoolbar.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
This component is usually used in conjunction with `Scaffold`, placed in a specific position on the page to provide quick actions or display information.
66

7+
<div style="position: relative; max-width: 700px; height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
8+
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=floatingToolbar" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
9+
</div>
10+
711
## Import
812

913
```kotlin
@@ -18,7 +22,10 @@ import top.yukonga.miuix.kmp.basic.ToolbarPosition // Used for Scaffold
1822
Scaffold(
1923
floatingToolbar = {
2024
FloatingToolbar {
21-
Row { // or Column
25+
Row(
26+
modifier = Modifier.padding(8.dp),
27+
horizontalArrangement = Arrangement.spacedBy(8.dp)
28+
) { // or Column
2229
IconButton(onClick = { /* Action 1 */ }) {
2330
Icon(MiuixIcons.Useful.Edit, contentDescription = "Edit")
2431
}
@@ -70,7 +77,10 @@ FloatingToolbar(
7077
outSidePadding = PaddingValues(24.dp),
7178
showDivider = false
7279
) {
73-
Row(modifier = Modifier.padding(horizontal = 8.dp)) {
80+
Row(
81+
modifier = Modifier.padding(8.dp),
82+
horizontalArrangement = Arrangement.spacedBy(8.dp)
83+
) { // or Column
7484
IconButton(onClick = { /* Action 1 */ }) {
7585
Icon(MiuixIcons.Useful.Edit, contentDescription = "Edit", tint = MiuixTheme.colorScheme.onPrimaryContainer)
7686
}
@@ -85,7 +95,10 @@ FloatingToolbar(
8595

8696
```kotlin
8797
FloatingToolbar {
88-
Column(modifier = Modifier.padding(vertical = 8.dp)) {
98+
Column(
99+
modifier = Modifier.padding(vertical = 8.dp),
100+
verticalArrangement = Arrangement.spacedBy(8.dp)
101+
) {
89102
IconButton(onClick = { /* Action 1 */ }) {
90103
Icon(MiuixIcons.Useful.Edit, contentDescription = "Edit")
91104
}

0 commit comments

Comments
 (0)