├── .gitattributes
├── .github
└── workflows
│ ├── kotlin-multiplatform-ci.yml
│ └── site-gh-pages.yml
├── .gitignore
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── build.gradle.kts
├── buildSrc
├── build.gradle.kts
└── src
│ └── main
│ └── kotlin
│ ├── VersionsAndDependencies.kt
│ ├── lib-conventions-without-publishing.gradle.kts
│ └── lib-conventions.gradle.kts
├── compose-html-common
├── api
│ └── compose-html-common.klib.api
├── build.gradle.kts
└── src
│ └── jsMain
│ └── kotlin
│ └── com
│ └── huanshankeji
│ └── compose
│ └── web
│ ├── Layouts.kt
│ ├── PreferringKobwebComposeLayoutApi.kt
│ ├── Types.kt
│ ├── attributes
│ ├── AttrBuilderContext.kt
│ ├── AttrConversion.kt
│ ├── Attrs.kt
│ ├── Types.kt
│ └── ext
│ │ ├── Attrs.kt
│ │ └── EventAttrs.kt
│ ├── css
│ ├── CSS.kt
│ ├── StyleScope.kt
│ └── Styles.kt
│ └── dom
│ └── ext
│ └── dom.kt
├── compose-html-material-legacy
├── api
│ └── compose-html-material-legacy.klib.api
├── build.gradle.kts
└── src
│ └── jsMain
│ └── kotlin
│ └── com
│ └── huanshankeji
│ ├── compose
│ └── web
│ │ └── material
│ │ ├── Components.kt
│ │ ├── Layouts.kt
│ │ ├── MwcRequires.kt
│ │ └── Styles.kt
│ └── material
│ └── Colors.kt
├── compose-html-material3
├── api
│ └── compose-html-material3.klib.api
├── build.gradle.kts
└── src
│ └── jsMain
│ └── kotlin
│ └── com
│ └── huanshankeji
│ └── compose
│ └── html
│ └── material3
│ ├── MaterialWebLabsApi.kt
│ ├── MdButton.kt
│ ├── MdCard.kt
│ ├── MdCheckbox.kt
│ ├── MdFab.kt
│ ├── MdIcon.kt
│ ├── MdIconButton.kt
│ ├── MdList.kt
│ ├── MdMenu.kt
│ ├── MdNavigationBar.kt
│ ├── MdNavigationTab.kt
│ ├── MdProgress.kt
│ ├── MdSwitch.kt
│ ├── MdTextField.kt
│ ├── Require.kt
│ └── attributes
│ └── Attrs.kt
├── gradle-plugins
├── README.md
├── api
│ └── compose-html-material-gradle-plugins-legacy.api
├── build.gradle.kts
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── huanshankeji
│ ├── Versions.kt
│ └── compose-html-material-conventions-legacy.gradle.kts
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── kotlin-js-store
└── yarn.lock
├── legacy
├── README.md
└── demo
│ ├── html
│ └── demo.html
│ └── webpack.config.d
│ └── further_adjustments.js
├── settings.gradle.kts
└── site
└── index.html
/.gitattributes:
--------------------------------------------------------------------------------
1 | #
2 | # https://help.github.com/articles/dealing-with-line-endings/
3 | #
4 | # These are explicitly windows files and should use crlf
5 | *.bat text eol=crlf
6 |
7 |
--------------------------------------------------------------------------------
/.github/workflows/kotlin-multiplatform-ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | workflow_dispatch:
5 | push:
6 | branches: ["*"]
7 | # pull_request:
8 | # branches: [ "*" ]
9 |
10 | jobs:
11 | test-and-check:
12 | runs-on: ubuntu-latest
13 | permissions:
14 | contents: read
15 |
16 | steps:
17 | - uses: huanshankeji/.github/actions/gradle-test-and-check@v0.1.0
18 | with:
19 | jdk-versions: 11-temurin
20 |
21 | dependency-submission:
22 | runs-on: ubuntu-latest
23 | permissions:
24 | contents: write
25 |
26 | steps:
27 | - uses: huanshankeji/.github/actions/dependency-submission@v0.1.0
28 | with:
29 | java-version: 11
30 | distribution: temurin
31 |
--------------------------------------------------------------------------------
/.github/workflows/site-gh-pages.yml:
--------------------------------------------------------------------------------
1 | name: Deploy the site to GitHub Pages
2 |
3 | on:
4 | push:
5 | branches: [ "release" ]
6 | pull_request:
7 | branches: [ "release" ]
8 |
9 | # Allows you to run this workflow manually from the Actions tab
10 | workflow_dispatch:
11 |
12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13 | permissions:
14 | contents: read
15 | pages: write
16 | id-token: write
17 |
18 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20 | concurrency:
21 | group: "pages"
22 | cancel-in-progress: false
23 |
24 | jobs:
25 | # Build job
26 | build:
27 | runs-on: ubuntu-latest
28 | steps:
29 | - name: Checkout
30 | uses: actions/checkout@v4
31 | - name: Setup Pages
32 | uses: actions/configure-pages@v5
33 |
34 | - name: Set up JDK 11
35 | uses: actions/setup-java@v4
36 | with:
37 | java-version: "11"
38 | distribution: "temurin"
39 |
40 | - name: Setup Gradle
41 | uses: gradle/actions/setup-gradle@v4
42 |
43 | - name: Build the distribution with Gradle Wrapper
44 | run: ./gradlew :generateSite
45 |
46 | - name: Upload artifact
47 | uses: actions/upload-pages-artifact@v3
48 | with:
49 | path: build/site/
50 |
51 | # Deployment job
52 | deploy:
53 | environment:
54 | name: github-pages
55 | url: ${{ steps.deployment.outputs.page_url }}
56 | runs-on: ubuntu-latest
57 | needs: build
58 | steps:
59 | - name: Deploy to GitHub Pages
60 | id: deployment
61 | uses: actions/deploy-pages@v4
62 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | .kotlin
3 | build
4 | .idea
5 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change log
2 |
3 | ## v0.4.0 / 2014-10-19
4 |
5 | * bump Kotlin to 2.0.10 and Compose to 1.7.0
6 | * Add the menu composables `MdMenu`, `MdMenuItem`, and `MdSubMenu`
7 | * Add the progress composables `MdLinearProgress` and `MdCircularProgress`
8 | * `LoadingState` is removed and moved to [compose-multiplatform-material](https://github.com/huanshankeji/compose-multiplatform-material)
9 | * add a `TextareaInputType` for the text field
10 | * the legacy modules are no longer published
11 | * fix a bug that the `AttrsScope<*>.disabled` function recursively calls itself
12 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, religion, or sexual identity
10 | and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the
26 | overall community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or
31 | advances of any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email
35 | address, without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | shreckye@gmail.com.
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series
86 | of actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or
93 | permanent ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within
113 | the community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.0, available at
119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120 |
121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
122 | enforcement ladder](https://github.com/mozilla/diversity).
123 |
124 | [homepage]: https://www.contributor-covenant.org
125 |
126 | For answers to common questions about this code of conduct, see the FAQ at
127 | https://www.contributor-covenant.org/faq. Translations are available at
128 | https://www.contributor-covenant.org/translations.
129 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing guidelines
2 |
3 | Hello, thank you for your interest in contributing to our project.
4 |
5 | ## Issues and Discussions
6 |
7 | You are welcome to submit issues on bugs or feature requests. If you have questions, please ask them in GitHub Discussions.
8 |
9 | ## Pull requests
10 |
11 | If you want to contribute to the code of our project, you are welcome to open pull requests. However, it's always a good idea to open a related issue or talk with us in Discussions first.
12 |
13 | ## Development
14 |
15 | Please make sure you have a valid JDK installed. Some projects may require multiple JDKs of different versions. The JDK version we use can be found in the [GitHub Actions workflow files](.github/workflows).
16 |
17 | We recommend developing with IntelliJ IDEA. In IntelliJ IDEA, select the correct [Project SDK in Project Structure](https://www.jetbrains.com/help/idea/project-settings-and-structure.html#project-sdk) and it's recommended to set [Gradle JVM](https://www.jetbrains.com/help/idea/gradle-jvm-selection.html#jvm_settings) to "Project SDK".
18 |
19 | Run the `publishToMavenLocal` Gradle task to publish the libraries to your machine's Maven Local Repository so your projects can depend on the changes you have made, run `check` to ensure our limited number of tests pass.
20 |
21 | ## Furthur notice
22 |
23 | We are currently a small team with limited effort. While we may not always implement your requested features, merge your pull requests, or do such things in time, you are always welcome to create your own fork and make any changes you like.
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Compose HTML Material
2 |
3 | [](https://search.maven.org/artifact/com.huanshankeji/compose-html-material3)
4 |
5 | Material 3 wrapper components for Compose HTML based on [Material Web](https://github.com/material-components/material-web)
6 |
7 | For unified multiplatform APIs which are more akin to those in `androidx.compose`, check out [Compose Multiplatform HTML Unified](https://github.com/huanshankeji/compose-multiplatform-html-unified) which also depends on this library. Also see its [side-by-side demo site](https://huanshankeji.github.io/compose-multiplatform-html-unified/) for the visual effects of the components.
8 |
9 | For Material 2, you are recommended to check out [KMDC](https://github.com/mpetuska/kmdc) instead. For information on our obsolete work on legacy Material 2 components, check out [the legacy README](/legacy/README.md).
10 |
11 | [Check out the API documentation here.](https://huanshankeji.github.io/compose-html-material/api-documentation/index.html)
12 |
13 | ## Supported components
14 |
15 | Not all components of Material Web are supported yet (see [#11](https://github.com/huanshankeji/compose-html-material/issues/11)). Also, not all Material Design components are supported by Material Web yet (see [their roadmap](https://github.com/material-components/material-web/blob/main/docs/roadmap.md)).
16 |
17 | Here is a list of supported compoent APIs:
18 |
19 | - `MdElevatedButton`, `MdFilledButton`, `MdFilledTonalButton`, `MdOutlinedButton`, `MdTextButton`
20 | - `MdCheckbox`
21 | - `MdFab`, `MdBrandedFab`
22 | - `MdIcon`
23 | - `MdIconButton`, `MdFilledIconButton`, `MdFilledTonalIconButton`, `MdOutlinedIconButton`
24 | - `MdList`, `MdListItem`
25 | - `MdMenu`, `MdMenuItem`, `MdSubMenu`
26 | - `MdLinearProgress`, `MdCircularProgress`
27 | - `MdSwitch`, `LabelWithMdSwitch`
28 | - `MdFilledTextField`, `MdOutlinedTextField`
29 |
30 | ### "labs" components
31 |
32 | Here is a list of supported component APIs in the [Material Web "labs" directory](https://github.com/material-components/material-web/tree/main/labs), which "contains experimental features that are not recommended for production" as they state:
33 |
34 | - `MdElevatedCard`, `MdOutlinedCard`
35 | - `MdNavigationBar`
36 | - `MdNavigationTab`
37 |
38 | You should opt-in to `@MaterialWebLabsApi` to use them.
39 |
40 | ## Brief Instructions
41 |
42 | ### Add the dependency
43 |
44 | With Gradle:
45 |
46 | ```kotlin
47 | kotlin {
48 | sourceSets {
49 | jsMain {
50 | dependencies {
51 | // ...
52 | implementation("com.huanshankeji:compose-html-material3:$version")
53 | }
54 | }
55 | }
56 | }
57 | ```
58 |
59 | This project depends on [Kobweb](https://github.com/varabyte/kobweb) which is not published to Maven Central yet, so you have to add the following Maven repository:
60 |
61 | ```kotlin
62 | repositories {
63 | mavenCentral()
64 | maven("https://us-central1-maven.pkg.dev/varabyte-repos/public")
65 | }
66 | ```
67 |
68 | ### Material Symbols & Icons
69 |
70 | The Material 3 module uses [Material Symbols & Icons](https://fonts.google.com/icons), but doesn't depend on the stylesheet directly. For Material Icons to work properly, you may need to configure your project following the quick instructions below or [the developer guide](https://developers.google.com/fonts/docs/material_symbols).
71 |
72 | #### Quick instructions
73 |
74 | In short, there are 3 ways to add the Material Symbols & Icons dependency:
75 |
76 | 1. Add the stylesheet hosted by Google directly in your HTML file `head`:
77 |
78 | ```html
79 |
80 | ```
81 |
82 | 1. Use [Marella's self-hosted Material Symbols](https://www.npmjs.com/package/material-symbols).
83 |
84 | First add the dependency in your build script:
85 |
86 | ```kotlin
87 | implementation(npm("material-symbols", "0.17.4"))
88 | ```
89 |
90 | And then import the icons in your program. For example you can use CommonJS `require`:
91 |
92 | ```kotlin
93 | external fun require(module: String): dynamic
94 | fun main() {
95 | require("material-symbols/outlined.css")
96 | renderComposableInBody { App() }
97 | }
98 | ```
99 |
100 | If you are familiar with web development and Kotlin/JS, you can depend on the stylesheet in any way that works and you prefer. For example, you can use `@JsModule` corresponding to the UMD import, or configure it as a Webpack entry point. See the following docs fore more details:
101 | 1. [JavaScript modules | Kotlin Documentation](https://kotlinlang.org/docs/js-modules.html)
102 | 1. [the "webpack configuration file" section in Set up a Kotlin/JS project | Kotlin Documentation](https://kotlinlang.org/docs/js-project-setup.html#webpack-configuration-file)
103 | 1. [Code Splitting | webpack](https://webpack.js.org/guides/code-splitting/)
104 | 1. [Advanced entry | webpack](https://webpack.js.org/guides/entry-advanced/)
105 |
106 | 1. [Download and self-host the latest font](https://developers.google.com/fonts/docs/material_symbols#self-hosting_the_font).
107 |
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import org.jetbrains.dokka.gradle.tasks.DokkaGeneratePublicationTask
2 |
3 | tasks.wrapper {
4 | distributionType = Wrapper.DistributionType.ALL
5 | }
6 |
7 | plugins {
8 | id("org.jetbrains.dokka")
9 | id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.3"
10 | }
11 |
12 | dependencies {
13 | listOf(
14 | "compose-html-common",
15 | "compose-html-material3"
16 | ).forEach {
17 | dokka(project(":$it"))
18 | }
19 | }
20 |
21 | val dokkaGeneratePublicationHtml by tasks.getting(DokkaGeneratePublicationTask::class)
22 | tasks.register("generateSite") {
23 | group = "site"
24 |
25 | val destRootDir = layout.buildDirectory.dir("site")
26 | into(destRootDir)
27 | from(dokkaGeneratePublicationHtml) {
28 | into("api-documentation")
29 | }
30 | from(layout.projectDirectory.dir("site"))
31 | }
32 |
33 | apiValidation {
34 | @OptIn(kotlinx.validation.ExperimentalBCVApi::class)
35 | klib {
36 | enabled = true
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/buildSrc/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | `kotlin-dsl`
3 | }
4 | repositories {
5 | //mavenLocal() // comment out when not needed
6 | gradlePluginPortal()
7 | //maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
8 | }
9 |
10 | dependencies {
11 | val kotlinVersion = "2.1.0"
12 | implementation(kotlin("gradle-plugin", kotlinVersion))
13 | implementation("org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlinVersion")
14 | implementation("org.jetbrains.compose:compose-gradle-plugin:1.7.1")
15 | val huanshankejiGradlePluginsVersion = "0.9.0" // don't use a snapshot version in a main branch
16 | implementation("com.huanshankeji:kotlin-common-gradle-plugins:$huanshankejiGradlePluginsVersion")
17 | implementation("com.huanshankeji.team:gradle-plugins:$huanshankejiGradlePluginsVersion")
18 | implementation("com.huanshankeji:common-gradle-dependencies:0.9.0-20241203") // don't use a snapshot version in a main branch
19 | implementation("org.jetbrains.dokka:dokka-gradle-plugin:2.0.0-Beta")
20 | }
21 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/VersionsAndDependencies.kt:
--------------------------------------------------------------------------------
1 | import com.huanshankeji.CommonDependencies
2 |
3 | const val projectVersion = "0.4.1-SNAPSHOT"
4 |
5 | object DependencyVersions {
6 | val kobweb = "0.20.0"
7 | val materialWeb = "2.2.0"
8 |
9 |
10 | // legacy versions that don't need to be updated
11 |
12 | val webcomponents = "2.6.0"
13 | val mwc = "0.25.3"
14 |
15 | val mdc = "13.0.0"
16 | }
17 |
18 | val commonDependencies = CommonDependencies()
19 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/lib-conventions-without-publishing.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.huanshankeji.kotlin-multiplatform-js-browser-conventions")
3 | kotlin("plugin.compose")
4 | id("org.jetbrains.compose")
5 | id("com.huanshankeji.kotlin-multiplatform-sonatype-ossrh-publish-conventions")
6 | }
7 |
8 | repositories {
9 | mavenCentral()
10 | maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
11 | maven("https://us-central1-maven.pkg.dev/varabyte-repos/public") // for Kobweb
12 | }
13 |
14 | group = "com.huanshankeji"
15 | version = projectVersion
16 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/lib-conventions.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("lib-conventions-without-publishing")
3 | id("com.huanshankeji.kotlin-multiplatform-sonatype-ossrh-publish-conventions")
4 | id("com.huanshankeji.team.dokka.github-dokka-convention")
5 | }
6 |
--------------------------------------------------------------------------------
/compose-html-common/api/compose-html-common.klib.api:
--------------------------------------------------------------------------------
1 | // Klib ABI Dump
2 | // Targets: [js]
3 | // Rendering settings:
4 | // - Signature version: 2
5 | // - Show manifest properties: true
6 | // - Show declarations: true
7 |
8 | // Library unique name:
9 | open annotation class com.huanshankeji.compose.web/PreferringKobwebComposeLayoutApi : kotlin/Annotation { // com.huanshankeji.compose.web/PreferringKobwebComposeLayoutApi|null[0]
10 | constructor () // com.huanshankeji.compose.web/PreferringKobwebComposeLayoutApi.|(){}[0]
11 | }
12 |
13 | final enum class com.huanshankeji.compose.web.attributes/AutoCapitalize : kotlin/Enum { // com.huanshankeji.compose.web.attributes/AutoCapitalize|null[0]
14 | enum entry Characters // com.huanshankeji.compose.web.attributes/AutoCapitalize.Characters|null[0]
15 | enum entry None // com.huanshankeji.compose.web.attributes/AutoCapitalize.None|null[0]
16 | enum entry Sentences // com.huanshankeji.compose.web.attributes/AutoCapitalize.Sentences|null[0]
17 | enum entry Words // com.huanshankeji.compose.web.attributes/AutoCapitalize.Words|null[0]
18 |
19 | final val alternativeStrValue // com.huanshankeji.compose.web.attributes/AutoCapitalize.alternativeStrValue|{}alternativeStrValue[0]
20 | final fun (): kotlin/String? // com.huanshankeji.compose.web.attributes/AutoCapitalize.alternativeStrValue.|(){}[0]
21 | final val entries // com.huanshankeji.compose.web.attributes/AutoCapitalize.entries|#static{}entries[0]
22 | final fun (): kotlin.enums/EnumEntries // com.huanshankeji.compose.web.attributes/AutoCapitalize.entries.|#static(){}[0]
23 | final val strValue // com.huanshankeji.compose.web.attributes/AutoCapitalize.strValue|{}strValue[0]
24 | final fun (): kotlin/String // com.huanshankeji.compose.web.attributes/AutoCapitalize.strValue.|(){}[0]
25 |
26 | final fun valueOf(kotlin/String): com.huanshankeji.compose.web.attributes/AutoCapitalize // com.huanshankeji.compose.web.attributes/AutoCapitalize.valueOf|valueOf#static(kotlin.String){}[0]
27 | final fun values(): kotlin/Array // com.huanshankeji.compose.web.attributes/AutoCapitalize.values|values#static(){}[0]
28 |
29 | final object Companion { // com.huanshankeji.compose.web.attributes/AutoCapitalize.Companion|null[0]
30 | final val valueSet // com.huanshankeji.compose.web.attributes/AutoCapitalize.Companion.valueSet|{}valueSet[0]
31 | final fun (): kotlin.collections/Set // com.huanshankeji.compose.web.attributes/AutoCapitalize.Companion.valueSet.|(){}[0]
32 | }
33 | }
34 |
35 | final enum class com.huanshankeji.compose.web.attributes/EnterKeyHint : kotlin/Enum { // com.huanshankeji.compose.web.attributes/EnterKeyHint|null[0]
36 | enum entry Done // com.huanshankeji.compose.web.attributes/EnterKeyHint.Done|null[0]
37 | enum entry Enter // com.huanshankeji.compose.web.attributes/EnterKeyHint.Enter|null[0]
38 | enum entry Go // com.huanshankeji.compose.web.attributes/EnterKeyHint.Go|null[0]
39 | enum entry Next // com.huanshankeji.compose.web.attributes/EnterKeyHint.Next|null[0]
40 | enum entry Previous // com.huanshankeji.compose.web.attributes/EnterKeyHint.Previous|null[0]
41 | enum entry Search // com.huanshankeji.compose.web.attributes/EnterKeyHint.Search|null[0]
42 | enum entry Send // com.huanshankeji.compose.web.attributes/EnterKeyHint.Send|null[0]
43 |
44 | final val entries // com.huanshankeji.compose.web.attributes/EnterKeyHint.entries|#static{}entries[0]
45 | final fun (): kotlin.enums/EnumEntries // com.huanshankeji.compose.web.attributes/EnterKeyHint.entries.|#static(){}[0]
46 | final val strValue // com.huanshankeji.compose.web.attributes/EnterKeyHint.strValue|{}strValue[0]
47 | final fun (): kotlin/String // com.huanshankeji.compose.web.attributes/EnterKeyHint.strValue.|(){}[0]
48 |
49 | final fun valueOf(kotlin/String): com.huanshankeji.compose.web.attributes/EnterKeyHint // com.huanshankeji.compose.web.attributes/EnterKeyHint.valueOf|valueOf#static(kotlin.String){}[0]
50 | final fun values(): kotlin/Array // com.huanshankeji.compose.web.attributes/EnterKeyHint.values|values#static(){}[0]
51 |
52 | final object Companion { // com.huanshankeji.compose.web.attributes/EnterKeyHint.Companion|null[0]
53 | final val valueSet // com.huanshankeji.compose.web.attributes/EnterKeyHint.Companion.valueSet|{}valueSet[0]
54 | final fun (): kotlin.collections/Set // com.huanshankeji.compose.web.attributes/EnterKeyHint.Companion.valueSet.|(){}[0]
55 | }
56 | }
57 |
58 | abstract interface com.huanshankeji.compose.web.css/Visibility : org.jetbrains.compose.web.css/StylePropertyEnum { // com.huanshankeji.compose.web.css/Visibility|null[0]
59 | final object Companion { // com.huanshankeji.compose.web.css/Visibility.Companion|null[0]
60 | final val Collapse // com.huanshankeji.compose.web.css/Visibility.Companion.Collapse|{}Collapse[0]
61 | final inline fun (): com.huanshankeji.compose.web.css/Visibility // com.huanshankeji.compose.web.css/Visibility.Companion.Collapse.|(){}[0]
62 | final val Hidden // com.huanshankeji.compose.web.css/Visibility.Companion.Hidden|{}Hidden[0]
63 | final inline fun (): com.huanshankeji.compose.web.css/Visibility // com.huanshankeji.compose.web.css/Visibility.Companion.Hidden.|(){}[0]
64 | final val Visible // com.huanshankeji.compose.web.css/Visibility.Companion.Visible|{}Visible[0]
65 | final inline fun (): com.huanshankeji.compose.web.css/Visibility // com.huanshankeji.compose.web.css/Visibility.Companion.Visible.|(){}[0]
66 | }
67 | }
68 |
69 | final const val com.huanshankeji.compose.web.css/FIT_CONTENT // com.huanshankeji.compose.web.css/FIT_CONTENT|{}FIT_CONTENT[0]
70 | final fun (): kotlin/String // com.huanshankeji.compose.web.css/FIT_CONTENT.|(){}[0]
71 | final const val com.huanshankeji.compose.web/WITH_STYLES_DEPRECATED_MESSAGE // com.huanshankeji.compose.web/WITH_STYLES_DEPRECATED_MESSAGE|{}WITH_STYLES_DEPRECATED_MESSAGE[0]
72 | final fun (): kotlin/String // com.huanshankeji.compose.web/WITH_STYLES_DEPRECATED_MESSAGE.|(){}[0]
73 |
74 | final val com.huanshankeji.compose.web/DivComposable // com.huanshankeji.compose.web/DivComposable|{}DivComposable[0]
75 | final fun (): kotlin/Function4, kotlin/Unit>?, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>?, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit> // com.huanshankeji.compose.web/DivComposable.|(){}[0]
76 |
77 | final var com.huanshankeji.compose.web.dom.ext/value // com.huanshankeji.compose.web.dom.ext/value|@org.w3c.dom.HTMLElement{}value[0]
78 | final fun (org.w3c.dom/HTMLElement).(): kotlin/String // com.huanshankeji.compose.web.dom.ext/value.|@org.w3c.dom.HTMLElement(){}[0]
79 | final fun (org.w3c.dom/HTMLElement).(kotlin/String) // com.huanshankeji.compose.web.dom.ext/value.|@org.w3c.dom.HTMLElement(kotlin.String){}[0]
80 |
81 | final fun (kotlin/Boolean).com.huanshankeji.compose.web.attributes/isFalseOrNull(): kotlin/Boolean? // com.huanshankeji.compose.web.attributes/isFalseOrNull|isFalseOrNull@kotlin.Boolean(){}[0]
82 | final fun (kotlin/Boolean).com.huanshankeji.compose.web.attributes/isTrueOrNull(): kotlin/Boolean? // com.huanshankeji.compose.web.attributes/isTrueOrNull|isTrueOrNull@kotlin.Boolean(){}[0]
83 | final fun (kotlin/Boolean).com.huanshankeji.compose.web.attributes/toOnOrOff(): kotlin/String // com.huanshankeji.compose.web.attributes/toOnOrOff|toOnOrOff@kotlin.Boolean(){}[0]
84 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/ariaLabel(kotlin/String): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes.ext/ariaLabel|ariaLabel@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String){}[0]
85 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/autoCapitalize(kotlin/String?): org.jetbrains.compose.web.attributes/AttrsScope? // com.huanshankeji.compose.web.attributes.ext/autoCapitalize|autoCapitalize@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
86 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/autoCapitalizeRequiringValid(kotlin/String) // com.huanshankeji.compose.web.attributes.ext/autoCapitalizeRequiringValid|autoCapitalizeRequiringValid@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String){}[0]
87 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/autoComplete(org.jetbrains.compose.web.attributes/AutoComplete?) // com.huanshankeji.compose.web.attributes.ext/autoComplete|autoComplete@org.jetbrains.compose.web.attributes.AttrsScope<*>(org.jetbrains.compose.web.attributes.AutoComplete?){}[0]
88 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/disabled(kotlin/Boolean?) // com.huanshankeji.compose.web.attributes.ext/disabled|disabled@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.Boolean?){}[0]
89 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/enterKeyHintIfValid(kotlin/String) // com.huanshankeji.compose.web.attributes.ext/enterKeyHintIfValid|enterKeyHintIfValid@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String){}[0]
90 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/form(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/form|form@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
91 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/href(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/href|href@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
92 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/label(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/label|label@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
93 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/max(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/max|max@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
94 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/maxLength(kotlin/Int?) // com.huanshankeji.compose.web.attributes.ext/maxLength|maxLength@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.Int?){}[0]
95 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/min(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/min|min@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
96 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/minLength(kotlin/Int?) // com.huanshankeji.compose.web.attributes.ext/minLength|minLength@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.Int?){}[0]
97 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/multiple(kotlin/Boolean?) // com.huanshankeji.compose.web.attributes.ext/multiple|multiple@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.Boolean?){}[0]
98 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/name(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/name|name@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
99 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/pattern(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/pattern|pattern@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
100 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/placeholder(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/placeholder|placeholder@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
101 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/readOnly(kotlin/Boolean?) // com.huanshankeji.compose.web.attributes.ext/readOnly|readOnly@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.Boolean?){}[0]
102 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/required(kotlin/Boolean?) // com.huanshankeji.compose.web.attributes.ext/required|required@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.Boolean?){}[0]
103 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/selected(kotlin/Boolean?) // com.huanshankeji.compose.web.attributes.ext/selected|selected@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.Boolean?){}[0]
104 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/step(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/step|step@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
105 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/target(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/target|target@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
106 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/type(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/type|type@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
107 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/type(org.jetbrains.compose.web.attributes/InputType<*>?) // com.huanshankeji.compose.web.attributes.ext/type|type@org.jetbrains.compose.web.attributes.AttrsScope<*>(org.jetbrains.compose.web.attributes.InputType<*>?){}[0]
108 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes.ext/value(kotlin/String?) // com.huanshankeji.compose.web.attributes.ext/value|value@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String?){}[0]
109 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/attr(kotlin/String, kotlin/Boolean = ...): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/attr|attr@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String;kotlin.Boolean){}[0]
110 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/attr(kotlin/String, kotlin/Int): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/attr|attr@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String;kotlin.Int){}[0]
111 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/attr(kotlin/String, kotlin/Number): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/attr|attr@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String;kotlin.Number){}[0]
112 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/attrIfNotNull(kotlin/String, kotlin/Boolean?) // com.huanshankeji.compose.web.attributes/attrIfNotNull|attrIfNotNull@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String;kotlin.Boolean?){}[0]
113 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/attrIfNotNull(kotlin/String, kotlin/Int?) // com.huanshankeji.compose.web.attributes/attrIfNotNull|attrIfNotNull@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String;kotlin.Int?){}[0]
114 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/attrIfNotNull(kotlin/String, kotlin/Number?) // com.huanshankeji.compose.web.attributes/attrIfNotNull|attrIfNotNull@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String;kotlin.Number?){}[0]
115 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/attrIfNotNull(kotlin/String, kotlin/String?) // com.huanshankeji.compose.web.attributes/attrIfNotNull|attrIfNotNull@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String;kotlin.String?){}[0]
116 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/autoCapitalize(com.huanshankeji.compose.web.attributes/AutoCapitalize): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/autoCapitalize|autoCapitalize@org.jetbrains.compose.web.attributes.AttrsScope<*>(com.huanshankeji.compose.web.attributes.AutoCapitalize){}[0]
117 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/autoCapitalize(kotlin/String): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/autoCapitalize|autoCapitalize@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String){}[0]
118 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/autocorrect(kotlin/Boolean): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/autocorrect|autocorrect@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.Boolean){}[0]
119 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/autocorrect(kotlin/String): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/autocorrect|autocorrect@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String){}[0]
120 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/booleanAttr(kotlin/String, kotlin/Boolean): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/booleanAttr|booleanAttr@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String;kotlin.Boolean){}[0]
121 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/enterKeyHint(com.huanshankeji.compose.web.attributes/EnterKeyHint): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/enterKeyHint|enterKeyHint@org.jetbrains.compose.web.attributes.AttrsScope<*>(com.huanshankeji.compose.web.attributes.EnterKeyHint){}[0]
122 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/enterKeyHint(kotlin/String): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/enterKeyHint|enterKeyHint@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String){}[0]
123 | final fun (org.jetbrains.compose.web.attributes/AttrsScope<*>).com.huanshankeji.compose.web.attributes/slot(kotlin/String): org.jetbrains.compose.web.attributes/AttrsScope // com.huanshankeji.compose.web.attributes/slot|slot@org.jetbrains.compose.web.attributes.AttrsScope<*>(kotlin.String){}[0]
124 | final fun (org.jetbrains.compose.web.css/StyleScope).com.huanshankeji.compose.web.css/height(kotlin/String) // com.huanshankeji.compose.web.css/height|height@org.jetbrains.compose.web.css.StyleScope(kotlin.String){}[0]
125 | final fun (org.jetbrains.compose.web.css/StyleScope).com.huanshankeji.compose.web.css/visibility(com.huanshankeji.compose.web.css/Visibility) // com.huanshankeji.compose.web.css/visibility|visibility@org.jetbrains.compose.web.css.StyleScope(com.huanshankeji.compose.web.css.Visibility){}[0]
126 | final fun (org.jetbrains.compose.web.css/StyleScope).com.huanshankeji.compose.web.css/width(kotlin/String) // com.huanshankeji.compose.web.css/width|width@org.jetbrains.compose.web.css.StyleScope(kotlin.String){}[0]
127 | final fun <#A: org.w3c.dom/Element> (kotlin/Function1, kotlin/Unit>).com.huanshankeji.compose.web.attributes/plus(kotlin/Function1, kotlin/Unit>?): kotlin/Function1, kotlin/Unit> // com.huanshankeji.compose.web.attributes/plus|plus@kotlin.Function1,kotlin.Unit>(kotlin.Function1,kotlin.Unit>?){0§}[0]
128 | final fun <#A: org.w3c.dom/Element> (kotlin/Function1?).com.huanshankeji.compose.web.css/wrapInAttrs(): kotlin/Function1, kotlin/Unit>? // com.huanshankeji.compose.web.css/wrapInAttrs|wrapInAttrs@kotlin.Function1?(){0§}[0]
129 | final fun <#A: org.w3c.dom/HTMLElement> (org.jetbrains.compose.web.attributes/AttrsScope<#A>).com.huanshankeji.compose.web.attributes.ext/onInput(kotlin/Function1, kotlin/Unit>) // com.huanshankeji.compose.web.attributes.ext/onInput|onInput@org.jetbrains.compose.web.attributes.AttrsScope<0:0>(kotlin.Function1,kotlin.Unit>){0§}[0]
130 | final fun com.huanshankeji.compose.web/Centered(kotlin/Function1, kotlin/Unit>?, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/Centered|Centered(kotlin.Function1,kotlin.Unit>?;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
131 | final fun com.huanshankeji.compose.web/CenteredInViewport(kotlin/Function1, kotlin/Unit>?, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/CenteredInViewport|CenteredInViewport(kotlin.Function1,kotlin.Unit>?;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
132 | final fun com.huanshankeji.compose.web/Column(kotlin/Function1, kotlin/Unit>?, kotlin/Boolean, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/Column|Column(kotlin.Function1,kotlin.Unit>?;kotlin.Boolean;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
133 | final fun com.huanshankeji.compose.web/ColumnS(kotlin/Function1?, kotlin/Boolean, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/ColumnS|ColumnS(kotlin.Function1?;kotlin.Boolean;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
134 | final fun com.huanshankeji.compose.web/ColumnWithGaps(kotlin/Function1, kotlin/Unit>?, org.jetbrains.compose.web.css/CSSNumericValue, kotlin/Boolean, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/ColumnWithGaps|ColumnWithGaps(kotlin.Function1,kotlin.Unit>?;org.jetbrains.compose.web.css.CSSNumericValue;kotlin.Boolean;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
135 | final fun com.huanshankeji.compose.web/ColumnWithSpaceBetween(kotlin/Function1, kotlin/Unit>?, kotlin/Boolean, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/ColumnWithSpaceBetween|ColumnWithSpaceBetween(kotlin.Function1,kotlin.Unit>?;kotlin.Boolean;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
136 | final fun com.huanshankeji.compose.web/Flexbox(kotlin/Function1, kotlin/Unit>?, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/Flexbox|Flexbox(kotlin.Function1,kotlin.Unit>?;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
137 | final fun com.huanshankeji.compose.web/FlexboxS(kotlin/Function1?, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/FlexboxS|FlexboxS(kotlin.Function1?;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
138 | final fun com.huanshankeji.compose.web/FrGrid(kotlin/Int, org.jetbrains.compose.web.css/CSSNumericValue, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>?, androidx.compose.runtime/Composer?, kotlin/Int) // com.huanshankeji.compose.web/FrGrid|FrGrid(kotlin.Int;org.jetbrains.compose.web.css.CSSNumericValue;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;androidx.compose.runtime.Composer?;kotlin.Int){}[0]
139 | final fun com.huanshankeji.compose.web/Row(kotlin/Function1, kotlin/Unit>?, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/Row|Row(kotlin.Function1,kotlin.Unit>?;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
140 | final fun com.huanshankeji.compose.web/RowS(kotlin/Function1?, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/RowS|RowS(kotlin.Function1?;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
141 | final fun com.huanshankeji.compose.web/RowWithGaps(kotlin/Function1, kotlin/Unit>?, org.jetbrains.compose.web.css/CSSNumericValue, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/RowWithGaps|RowWithGaps(kotlin.Function1,kotlin.Unit>?;org.jetbrains.compose.web.css.CSSNumericValue;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
142 | final fun com.huanshankeji.compose.web/RowWithSpaceBetween(kotlin/Function1, kotlin/Unit>?, kotlin/Function3, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // com.huanshankeji.compose.web/RowWithSpaceBetween|RowWithSpaceBetween(kotlin.Function1,kotlin.Unit>?;kotlin.Function3,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
143 | final fun com.huanshankeji.compose.web/Spacer(kotlin/Int, androidx.compose.runtime/Composer?, kotlin/Int) // com.huanshankeji.compose.web/Spacer|Spacer(kotlin.Int;androidx.compose.runtime.Composer?;kotlin.Int){}[0]
144 | final inline fun <#A: org.w3c.dom/Element> com.huanshankeji.compose.web.attributes/attrs(noinline kotlin/Function1, kotlin/Unit>): kotlin/Function1, kotlin/Unit> // com.huanshankeji.compose.web.attributes/attrs|attrs(kotlin.Function1,kotlin.Unit>){0§}[0]
145 | final inline fun com.huanshankeji.compose.web.css/Visibility(kotlin/String): com.huanshankeji.compose.web.css/Visibility // com.huanshankeji.compose.web.css/Visibility|Visibility(kotlin.String){}[0]
146 |
--------------------------------------------------------------------------------
/compose-html-common/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import com.huanshankeji.team.`Shreck Ye`
2 | import com.huanshankeji.team.pomForTeamDefaultOpenSource
3 |
4 | plugins {
5 | `lib-conventions`
6 | }
7 |
8 | kotlin {
9 | sourceSets {
10 | val jsMain by getting {
11 | dependencies {
12 | implementation(compose.html.core)
13 | implementation(compose.runtime)
14 | api("com.varabyte.kobweb:compose-html-ext:${DependencyVersions.kobweb}")
15 | //implementation(commonDependencies.kotlinx.coroutines.core())
16 | }
17 | }
18 | }
19 | }
20 |
21 | publishing.publications.withType {
22 | pomForTeamDefaultOpenSource(
23 | project,
24 | "Huanshankeji Compose HTML common",
25 | "Huanshankeji's common code for Compose HTML"
26 | ) {
27 | `Shreck Ye`()
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/Layouts.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web
2 |
3 | import androidx.compose.runtime.Composable
4 | import com.huanshankeji.compose.web.attributes.attrs
5 | import com.huanshankeji.compose.web.attributes.plus
6 | import com.huanshankeji.compose.web.css.Styles
7 | import com.huanshankeji.compose.web.css.wrapInAttrs
8 | import com.varabyte.kobweb.compose.css.Width
9 | import com.varabyte.kobweb.compose.css.width
10 | import org.jetbrains.compose.web.css.*
11 | import org.jetbrains.compose.web.dom.AttrBuilderContext
12 | import org.jetbrains.compose.web.dom.ContentBuilder
13 | import org.jetbrains.compose.web.dom.Div
14 | import org.w3c.dom.HTMLDivElement
15 |
16 | // try to follow names in Android Jetpack Compose
17 |
18 | // TODO: remove these deprecated functions
19 |
20 | const val WITH_STYLES_DEPRECATED_MESSAGE = "The functions with `withStyles` suffixes are deprecated."
21 |
22 | @Composable
23 | fun Flexbox(
24 | attrs: AttrBuilderContext? = null,
25 | content: ContentBuilder
26 | ) =
27 | Div(attrs {
28 | style {
29 | display(DisplayStyle.Flex)
30 | }
31 | } + attrs, content)
32 |
33 | @PreferringKobwebComposeLayoutApi
34 | @Deprecated(WITH_STYLES_DEPRECATED_MESSAGE)
35 | @Composable
36 | fun FlexboxS(styles: Styles? = null, content: ContentBuilder) =
37 | Flexbox(styles.wrapInAttrs(), content)
38 |
39 | @PreferringKobwebComposeLayoutApi
40 | @Composable
41 | fun Column(
42 | attrs: AttrBuilderContext? = null,
43 | fitContent: Boolean = true,
44 | content: ContentBuilder
45 | ) =
46 | Flexbox(attrs {
47 | style {
48 | flexDirection(FlexDirection.Column)
49 | if (fitContent) width(Width.FitContent)
50 | }
51 | } + attrs, content)
52 |
53 | @PreferringKobwebComposeLayoutApi
54 | @Deprecated(WITH_STYLES_DEPRECATED_MESSAGE)
55 | @Composable
56 | fun ColumnS(styles: Styles? = null, fitContent: Boolean = true, content: ContentBuilder) =
57 | Column(styles.wrapInAttrs(), fitContent, content)
58 |
59 | @PreferringKobwebComposeLayoutApi
60 | @Composable
61 | fun ColumnWithSpaceBetween(
62 | attrs: AttrBuilderContext? = null,
63 | fitContent: Boolean = true,
64 | content: ContentBuilder
65 | ) =
66 | Column(attrs {
67 | style {
68 | justifyContent(JustifyContent.SpaceBetween)
69 | }
70 | } + attrs, fitContent, content)
71 |
72 |
73 | @PreferringKobwebComposeLayoutApi
74 | @Composable
75 | fun Row(
76 | attrs: AttrBuilderContext? = null,
77 | content: ContentBuilder
78 | ) =
79 | Flexbox(attrs {
80 | style {
81 | flexDirection(FlexDirection.Row)
82 | }
83 | } + attrs, content)
84 |
85 | @PreferringKobwebComposeLayoutApi
86 | @Deprecated(WITH_STYLES_DEPRECATED_MESSAGE)
87 | @Composable
88 | fun RowS(
89 | styles: Styles? = null,
90 | content: ContentBuilder
91 | ) =
92 | Row(styles.wrapInAttrs(), content)
93 |
94 | @PreferringKobwebComposeLayoutApi
95 | @Composable
96 | fun RowWithSpaceBetween(
97 | attrs: AttrBuilderContext? = null,
98 | content: ContentBuilder
99 | ) =
100 | Row(attrs {
101 | style {
102 | justifyContent(JustifyContent.SpaceBetween)
103 | }
104 | } + attrs, content)
105 |
106 | @PreferringKobwebComposeLayoutApi
107 | @Composable
108 | fun ColumnWithGaps(
109 | attrs: AttrBuilderContext? = null,
110 | gap: CSSNumeric,
111 | fitContent: Boolean = true,
112 | content: ContentBuilder
113 | ) =
114 | Column(attrs {
115 | style {
116 | gap(gap)
117 | }
118 | } + attrs, fitContent, content)
119 |
120 | @PreferringKobwebComposeLayoutApi
121 | @Composable
122 | fun RowWithGaps(
123 | attrs: AttrBuilderContext? = null,
124 | gap: CSSNumeric,
125 | content: ContentBuilder
126 | ) =
127 | Row(attrs {
128 | style {
129 | gap(gap)
130 | }
131 | } + attrs, content)
132 |
133 | @Composable
134 | fun Centered(
135 | attrs: AttrBuilderContext? = null,
136 | content: ContentBuilder
137 | ) =
138 | Flexbox(attrs {
139 | style {
140 | alignItems(AlignItems.Center)
141 | justifyContent(JustifyContent.Center)
142 | }
143 | } + attrs, content)
144 |
145 | @Composable
146 | fun CenteredInViewport(
147 | attrs: AttrBuilderContext? = null,
148 | content: ContentBuilder
149 | ) =
150 | Centered(attrs {
151 | style {
152 | minHeight(100.vh)
153 | }
154 | } + attrs, content)
155 |
156 | @Composable
157 | fun FrGrid(
158 | numColumns: Int,
159 | gap: CSSNumeric,
160 | content: HTMLElementContent
161 | ) =
162 | Div({
163 | style {
164 | display(DisplayStyle.Grid)
165 | gridTemplateColumns("repeat($numColumns, 1fr)")
166 | gap(gap)
167 | }
168 | }, content)
169 |
170 | @PreferringKobwebComposeLayoutApi
171 | @Deprecated("This API is not implemented yet.")
172 | @Composable
173 | fun Spacer(numPxs: Int) =
174 | TODO() as Unit
175 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/PreferringKobwebComposeLayoutApi.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web
2 |
3 | @RequiresOptIn(
4 | "You are recommend to use the similar layout APIs in Kobweb Compose. See \"https://github.com/varabyte/kobweb/tree/main/frontend/kobweb-compose/src/jsMain/kotlin/com/varabyte/kobweb/compose/foundation/layout\".",
5 | RequiresOptIn.Level.WARNING
6 | )
7 | @Retention(AnnotationRetention.BINARY)
8 | @Target(AnnotationTarget.FUNCTION)
9 | annotation class PreferringKobwebComposeLayoutApi
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/Types.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web
2 |
3 | import androidx.compose.runtime.Composable
4 | import org.jetbrains.compose.web.dom.AttrBuilderContext
5 | import org.jetbrains.compose.web.dom.ContentBuilder
6 | import org.jetbrains.compose.web.dom.Div
7 | import org.jetbrains.compose.web.dom.ElementScope
8 | import org.w3c.dom.HTMLDivElement
9 | import org.w3c.dom.HTMLElement
10 |
11 | typealias ElementComposable = @Composable (
12 | attrs: AttrBuilderContext?,
13 | content: ContentBuilder?
14 | ) -> Unit
15 |
16 | typealias DivElementComposable = ElementComposable
17 |
18 | // `::Div` cannot be used directly because "Function References of @Composable functions are not currently supported"
19 | val DivComposable: ElementComposable = { attrs, content -> Div(attrs, content) }
20 |
21 | typealias HTMLElementContent = (@Composable ElementScope.() -> Unit)?
22 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/AttrBuilderContext.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web.attributes
2 |
3 | import org.jetbrains.compose.web.dom.AttrBuilderContext
4 | import org.w3c.dom.Element
5 |
6 | operator fun AttrBuilderContext.plus(other: AttrBuilderContext?): AttrBuilderContext =
7 | if (other === null) this
8 | else {
9 | {
10 | this@plus()
11 | other()
12 | }
13 | }
14 |
15 | /** A helper function to create [AttrBuilderContext]s where type inference doesn't work */
16 | @Suppress("NOTHING_TO_INLINE")
17 | inline fun attrs(noinline attrs: AttrBuilderContext) =
18 | attrs
19 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/AttrConversion.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web.attributes
2 |
3 | // consider moving to a "web-common" or "html-common" module
4 |
5 | fun Boolean.isTrueOrNull(): Boolean? =
6 | if (this) true else null
7 |
8 | fun Boolean.isFalseOrNull(): Boolean? =
9 | if (this) null else false
10 |
11 | fun Boolean.toOnOrOff(): String =
12 | if (this) "on" else "off"
13 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/Attrs.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web.attributes
2 |
3 | import org.jetbrains.compose.web.attributes.AttrsScope
4 |
5 | /**
6 | * Adds an attribute that is made present by its key aka [attr].
7 | * @see AttrsScope.attr
8 | */
9 | fun AttrsScope<*>.attr(attr: String, value: Boolean = true) =
10 | attr(attr, value.toString())
11 |
12 | /**
13 | * [Int] attributes are used in Compose HTML. See [org.jetbrains.compose.web.attributes.maxLength] for example.
14 | */
15 | fun AttrsScope<*>.attr(attr: String, value: Int) =
16 | attr(attr, value.toString())
17 |
18 | fun AttrsScope<*>.attr(attr: String, value: Number) =
19 | attr(attr, value.toString())
20 |
21 | /**
22 | * Adds an attribute that has an explicit [Boolean] value unlike [attr].
23 | */
24 | fun AttrsScope<*>.booleanAttr(attr: String, value: Boolean) =
25 | attr(attr, value.toString())
26 |
27 |
28 | fun AttrsScope<*>.attrIfNotNull(attr: String, value: String?) {
29 | value?.let { attr(attr, it) }
30 | }
31 |
32 | fun AttrsScope<*>.attrIfNotNull(attr: String, value: Boolean?) {
33 | value?.let { attr(attr, it) }
34 | }
35 |
36 | fun AttrsScope<*>.attrIfNotNull(attr: String, value: Int?) {
37 | value?.let { attr(attr, it) }
38 | }
39 |
40 | fun AttrsScope<*>.attrIfNotNull(attr: String, value: Number?) {
41 | value?.let { attr(attr, it) }
42 | }
43 |
44 |
45 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot
46 | fun AttrsScope<*>.slot(value: String) =
47 | attr("slot", value)
48 |
49 |
50 | enum class AutoCapitalize(val strValue: String, val alternativeStrValue: String? = null) {
51 | None("none", "off"), Sentences("sentences", "on"), Words("words"), Characters("characters");
52 |
53 | companion object {
54 | val valueSet = entries.asSequence().map { it.strValue }.toSet()
55 | }
56 | }
57 |
58 | // This is actually a global attribute
59 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize
60 | fun AttrsScope<*>.autoCapitalize(value: String) =
61 | attr("autocapitalize", value)
62 |
63 | fun AttrsScope<*>.autoCapitalize(value: AutoCapitalize) =
64 | autoCapitalize(value.strValue)
65 |
66 |
67 | // Safari only
68 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#attr-autocorrect
69 | fun AttrsScope<*>.autocorrect(value: String) =
70 | attr("autocorrect", value)
71 |
72 | fun AttrsScope<*>.autocorrect(onOrOff: Boolean) =
73 | attr("autocorrect", onOrOff.toOnOrOff())
74 |
75 |
76 | enum class EnterKeyHint(val strValue: String) {
77 | Enter("enter"), Done("done"), Go("go"), Next("next"), Previous("previous"), Search("search"), Send("send");
78 |
79 | companion object {
80 | val valueSet = entries.map { it.strValue }.toSet()
81 | }
82 | }
83 |
84 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint
85 | fun AttrsScope<*>.enterKeyHint(value: String) =
86 | attr("enterkeyhint", value)
87 |
88 | fun AttrsScope<*>.enterKeyHint(value: EnterKeyHint) =
89 | enterKeyHint(value.strValue)
90 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/Types.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web.attributes
2 |
3 | import org.jetbrains.compose.web.attributes.AttrsScope
4 |
5 | typealias Attrs = AttrsScope.() -> Unit
6 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/ext/Attrs.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web.attributes.ext
2 |
3 | import com.huanshankeji.compose.web.attributes.AutoCapitalize
4 | import com.huanshankeji.compose.web.attributes.EnterKeyHint
5 | import com.huanshankeji.compose.web.attributes.attrIfNotNull
6 | import com.huanshankeji.compose.web.attributes.autoCapitalize
7 | import com.huanshankeji.compose.web.attributes.enterKeyHint
8 | import org.jetbrains.compose.web.attributes.AttrsScope
9 | import org.jetbrains.compose.web.attributes.AutoComplete
10 | import org.jetbrains.compose.web.attributes.InputType
11 |
12 | /*
13 | Attributes in the `ext` package are one of 2 kinds:
14 | 1. Those for `HTMLElement`s which don't implement the interfaces (such as `HTMLInputElement`) of the elements they behave like,
15 | such as the `HTMLElement`s of those components in Material Web.
16 | These attributes should not be universally available on most elements.
17 | 1. Those taking nullable values.
18 |
19 | Also consider moving to a `compose-html-material-common` module and depend on them with `implementation`.
20 | Consider reordering them.
21 | */
22 |
23 |
24 | // https://www.w3schools.com/accessibility/accessibility_labels.php
25 | // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label
26 | fun AttrsScope<*>.ariaLabel(value: String) =
27 | attr("aria-label", value)
28 |
29 |
30 | // https://www.w3schools.com/tags/att_disabled.asp
31 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled
32 | fun AttrsScope<*>.disabled(value: Boolean?) =
33 | attrIfNotNull("disabled", value)
34 |
35 | // https://www.w3schools.com/tags/att_href.asp
36 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href
37 | fun AttrsScope<*>.href(value: String?) =
38 | attrIfNotNull("href", value)
39 |
40 | // https://www.w3schools.com/tags/att_target.asp
41 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target
42 | fun AttrsScope<*>.target(value: String?) =
43 | attrIfNotNull("target", value)
44 |
45 |
46 | // https://www.w3schools.com/tags/att_input_type.asp
47 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#type
48 | fun AttrsScope<*>.type(value: String?) =
49 | attrIfNotNull("type", value)
50 |
51 | // https://www.w3schools.com/tags/att_value.asp
52 | fun AttrsScope<*>.value(value: String?) =
53 | attrIfNotNull("value", value)
54 |
55 |
56 | // https://www.w3schools.com/tags/att_name.asp
57 | fun AttrsScope<*>.name(value: String?) =
58 | attrIfNotNull("name", value)
59 |
60 |
61 | // https://www.w3schools.com/tags/att_form.asp
62 | fun AttrsScope<*>.form(value: String?) =
63 | attrIfNotNull("form", value)
64 |
65 | // https://www.w3schools.com/tags/att_required.asp
66 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required
67 | fun AttrsScope<*>.required(value: Boolean?) =
68 | attrIfNotNull("required", value)
69 |
70 | // https://www.geeksforgeeks.org/html-label-attribute/
71 | // https://www.w3schools.com/tags/att_label.asp
72 | fun AttrsScope<*>.label(value: String?) =
73 | attrIfNotNull("label", value)
74 |
75 | // copied and adapted from `Attrs.kt` in `org.jetbrains.compose.web.attributes`
76 |
77 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
78 | fun AttrsScope<*>.max(value: String?) =
79 | attrIfNotNull("max", value)
80 |
81 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
82 | fun AttrsScope<*>.maxLength(value: Int?) =
83 | attrIfNotNull("maxlength", value)
84 |
85 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min
86 | fun AttrsScope<*>.min(value: String?) =
87 | attrIfNotNull("min", value)
88 |
89 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength
90 | fun AttrsScope<*>.minLength(value: Int?) =
91 | attrIfNotNull("minlength", value)
92 |
93 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
94 | fun AttrsScope<*>.pattern(value: String?) =
95 | attrIfNotNull("pattern", value)
96 |
97 | // https://www.w3schools.com/tags/att_input_placeholder.asp
98 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder
99 | fun AttrsScope<*>.placeholder(value: String?) =
100 | attrIfNotNull("placeholder", value)
101 |
102 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly
103 | fun AttrsScope<*>.readOnly(value: Boolean?) =
104 | attrIfNotNull("readonly", value)
105 |
106 |
107 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple
108 | fun AttrsScope<*>.multiple(value: Boolean?) =
109 | attrIfNotNull("multiple", value)
110 |
111 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step
112 | fun AttrsScope<*>.step(value: String?) =
113 | attrIfNotNull("step", value)
114 |
115 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
116 | fun AttrsScope<*>.type(value: InputType<*>?) {
117 | value?.let { attr("type", it.typeStr) }
118 | }
119 |
120 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
121 | fun AttrsScope<*>.autoComplete(value: AutoComplete?) {
122 | value?.let { attr("autocomplete", it.unsafeCast()) }
123 | }
124 |
125 |
126 | // This is actually a global attribute
127 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize
128 | fun AttrsScope<*>.autoCapitalize(value: String?) =
129 | value?.let { this@autoCapitalize.autoCapitalize(value) }
130 |
131 | fun AttrsScope<*>.autoCapitalizeRequiringValid(value: String) {
132 | require(value in AutoCapitalize.valueSet)
133 | autoCapitalize(value)
134 | }
135 |
136 |
137 | fun AttrsScope<*>.enterKeyHintIfValid(value: String) {
138 | if (value in EnterKeyHint.valueSet) enterKeyHint(value)
139 | }
140 |
141 |
142 | // https://www.w3schools.com/tags/att_selected.asp
143 | fun AttrsScope<*>.selected(value: Boolean?) =
144 | attrIfNotNull("selected", value)
145 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/ext/EventAttrs.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web.attributes.ext
2 |
3 | import androidx.compose.web.events.SyntheticEvent
4 | import org.jetbrains.compose.web.attributes.AttrsScope
5 | import org.jetbrains.compose.web.attributes.EventsListenerScope
6 | import org.w3c.dom.HTMLElement
7 |
8 | /**
9 | * @see com.huanshankeji.compose.web.dom.ext.value
10 | */
11 | //fun EventsListenerScope.onInput(
12 | fun AttrsScope.onInput(
13 | listener: (SyntheticEvent) -> Unit
14 | ) =
15 | addEventListener(EventsListenerScope.INPUT, listener)
16 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/css/CSS.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("NOTHING_TO_INLINE")
2 |
3 | package com.huanshankeji.compose.web.css
4 |
5 | import org.jetbrains.compose.web.css.StylePropertyEnum
6 | import org.jetbrains.compose.web.css.StyleScope
7 |
8 | fun StyleScope.visibility(visibility: Visibility) =
9 | property("visibility", visibility)
10 |
11 | interface Visibility : StylePropertyEnum {
12 | companion object {
13 | inline val Visible get() = Visibility("visible")
14 | inline val Hidden get() = Visibility("hidden")
15 | inline val Collapse get() = Visibility("collapse")
16 | }
17 | }
18 |
19 | inline fun Visibility(value: String) = value.unsafeCast()
20 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/css/StyleScope.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web.css
2 |
3 | import org.jetbrains.compose.web.css.StyleScope
4 |
5 | fun StyleScope.width(value: String) =
6 | property("width", value)
7 |
8 | fun StyleScope.height(value: String) =
9 | property("height", value)
10 |
11 | const val FIT_CONTENT = "fit-content"
12 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/css/Styles.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web.css
2 |
3 | import org.jetbrains.compose.web.css.StyleScope
4 | import org.jetbrains.compose.web.dom.AttrBuilderContext
5 | import org.w3c.dom.Element
6 |
7 | typealias Styles = StyleScope.() -> Unit
8 |
9 | fun Styles?.wrapInAttrs(): AttrBuilderContext? =
10 | this?.let { { style { it() } } }
11 |
--------------------------------------------------------------------------------
/compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/dom/ext/dom.kt:
--------------------------------------------------------------------------------
1 | package com.huanshankeji.compose.web.dom.ext
2 |
3 | import org.w3c.dom.HTMLElement
4 |
5 | /**
6 | * @see com.huanshankeji.compose.web.attributes.ext.onInput
7 | */
8 | var HTMLElement.value: String
9 | get() = asDynamic().value as String
10 | set(value) {
11 | asDynamic().value = value
12 | }
13 |
--------------------------------------------------------------------------------
/compose-html-material-legacy/api/compose-html-material-legacy.klib.api:
--------------------------------------------------------------------------------
1 | // Klib ABI Dump
2 | // Targets: [js]
3 | // Rendering settings:
4 | // - Signature version: 2
5 | // - Show manifest properties: true
6 | // - Show declarations: true
7 |
8 | // Library unique name:
9 | final class com.huanshankeji.compose.web.material/MwcButtonAttrsScopeBuilder : com.huanshankeji.compose.web.material/MwcSimpleComponentAttrsScopeBuilder { // com.huanshankeji.compose.web.material/MwcButtonAttrsScopeBuilder|null[0]
10 | constructor (org.jetbrains.compose.web.attributes/AttrsScope) // com.huanshankeji.compose.web.material/MwcButtonAttrsScopeBuilder.|(org.jetbrains.compose.web.attributes.AttrsScope){}[0]
11 |
12 | final fun dense(kotlin/Boolean = ...) // com.huanshankeji.compose.web.material/MwcButtonAttrsScopeBuilder.dense|dense(kotlin.Boolean){}[0]
13 | final fun disabled(kotlin/Boolean = ...) // com.huanshankeji.compose.web.material/MwcButtonAttrsScopeBuilder.disabled|disabled(kotlin.Boolean){}[0]
14 | final fun outlined(kotlin/Boolean = ...) // com.huanshankeji.compose.web.material/MwcButtonAttrsScopeBuilder.outlined|outlined(kotlin.Boolean){}[0]
15 | final fun raised(kotlin/Boolean = ...) // com.huanshankeji.compose.web.material/MwcButtonAttrsScopeBuilder.raised|raised(kotlin.Boolean){}[0]
16 | final fun unelevated(kotlin/Boolean = ...) // com.huanshankeji.compose.web.material/MwcButtonAttrsScopeBuilder.unelevated|unelevated(kotlin.Boolean){}[0]
17 | }
18 |
19 | final class com.huanshankeji.compose.web.material/MwcCircularProgressAttrsScopeBuilder : com.huanshankeji.compose.web.material/MwcAttrsScopeBuilder { // com.huanshankeji.compose.web.material/MwcCircularProgressAttrsScopeBuilder|null[0]
20 | constructor (org.jetbrains.compose.web.attributes/AttrsScope) // com.huanshankeji.compose.web.material/MwcCircularProgressAttrsScopeBuilder.|(org.jetbrains.compose.web.attributes.AttrsScope){}[0]
21 |
22 | final fun indeterminate(kotlin/Boolean = ...) // com.huanshankeji.compose.web.material/MwcCircularProgressAttrsScopeBuilder.indeterminate|indeterminate(kotlin.Boolean){}[0]
23 | final fun progress(org.jetbrains.compose.web.css/CSSNumericValue) // com.huanshankeji.compose.web.material/MwcCircularProgressAttrsScopeBuilder.progress|progress(org.jetbrains.compose.web.css.CSSNumericValue){}[0]
24 | }
25 |
26 | final class com.huanshankeji.compose.web.material/MwcIconButtonAttrsScopeBuilder : com.huanshankeji.compose.web.material/MwcAttrsScopeBuilder { // com.huanshankeji.compose.web.material/MwcIconButtonAttrsScopeBuilder|null[0]
27 | constructor (org.jetbrains.compose.web.attributes/AttrsScope) // com.huanshankeji.compose.web.material/MwcIconButtonAttrsScopeBuilder.|(org.jetbrains.compose.web.attributes.AttrsScope){}[0]
28 |
29 | final fun ariaLabel(kotlin/String) // com.huanshankeji.compose.web.material/MwcIconButtonAttrsScopeBuilder.ariaLabel|ariaLabel(kotlin.String){}[0]
30 | final fun disabled(kotlin/Boolean = ...) // com.huanshankeji.compose.web.material/MwcIconButtonAttrsScopeBuilder.disabled|disabled(kotlin.Boolean){}[0]
31 | final fun icon(kotlin/String) // com.huanshankeji.compose.web.material/MwcIconButtonAttrsScopeBuilder.icon|icon(kotlin.String){}[0]
32 | }
33 |
34 | final class com.huanshankeji.compose.web.material/MwcListItemAttrsScopeBuilder : com.huanshankeji.compose.web.material/MwcSimpleComponentAttrsScopeBuilder { // com.huanshankeji.compose.web.material/MwcListItemAttrsScopeBuilder|null[0]
35 | constructor (org.jetbrains.compose.web.attributes/AttrsScope) // com.huanshankeji.compose.web.material/MwcListItemAttrsScopeBuilder.|(org.jetbrains.compose.web.attributes.AttrsScope){}[0]
36 |
37 | final fun graphicEqIcon() // com.huanshankeji.compose.web.material/MwcListItemAttrsScopeBuilder.graphicEqIcon|graphicEqIcon(){}[0]
38 | final fun selected(kotlin/Boolean = ...) // com.huanshankeji.compose.web.material/MwcListItemAttrsScopeBuilder.selected|selected(kotlin.Boolean){}[0]
39 | final fun value(kotlin/String) // com.huanshankeji.compose.web.material/MwcListItemAttrsScopeBuilder.value|value(kotlin.String){}[0]
40 | }
41 |
42 | final class com.huanshankeji.compose.web.material/MwcSelectAttrsScopeBuilder : com.huanshankeji.compose.web.material/MwcInputComponentAttrsScopeBuilder { // com.huanshankeji.compose.web.material/MwcSelectAttrsScopeBuilder|null[0]
43 | constructor (org.jetbrains.compose.web.attributes/AttrsScope) // com.huanshankeji.compose.web.material/MwcSelectAttrsScopeBuilder.|(org.jetbrains.compose.web.attributes.AttrsScope){}[0]
44 |
45 | final fun onSelected(kotlin/Function1, kotlin/Unit>) // com.huanshankeji.compose.web.material/MwcSelectAttrsScopeBuilder.onSelected|onSelected(kotlin.Function1,kotlin.Unit>){}[0]
46 | final fun onSelectedWithIndex(kotlin/Function1) // com.huanshankeji.compose.web.material/MwcSelectAttrsScopeBuilder.onSelectedWithIndex|onSelectedWithIndex(kotlin.Function1){}[0]
47 | }
48 |
49 | final class com.huanshankeji.compose.web.material/MwcSnackbarAttrsScopeBuilder : com.huanshankeji.compose.web.material/MwcAttrsScopeBuilder { // com.huanshankeji.compose.web.material/MwcSnackbarAttrsScopeBuilder|null[0]
50 | constructor (org.jetbrains.compose.web.attributes/AttrsScope) // com.huanshankeji.compose.web.material/MwcSnackbarAttrsScopeBuilder.|(org.jetbrains.compose.web.attributes.AttrsScope){}[0]
51 |
52 | final fun labelText(kotlin/String) // com.huanshankeji.compose.web.material/MwcSnackbarAttrsScopeBuilder.labelText|labelText(kotlin.String){}[0]
53 | final fun open(kotlin/Boolean = ...) // com.huanshankeji.compose.web.material/MwcSnackbarAttrsScopeBuilder.open|open(kotlin.Boolean){}[0]
54 | final fun timeoutMs(kotlin/Number) // com.huanshankeji.compose.web.material/MwcSnackbarAttrsScopeBuilder.timeoutMs|timeoutMs(kotlin.Number){}[0]
55 | }
56 |
57 | final class com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate : org.jetbrains.compose.web.dom/ElementScope { // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate|null[0]
58 | constructor (org.jetbrains.compose.web.dom/ElementScope) // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate.|(org.jetbrains.compose.web.dom.ElementScope){}[0]
59 |
60 | final val scopeElement // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate.scopeElement|@androidx.compose.runtime.DisposableEffectScope{}scopeElement[0]
61 | final fun (androidx.compose.runtime/DisposableEffectScope).(): org.w3c.dom/HTMLElement // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate.scopeElement.|@androidx.compose.runtime.DisposableEffectScope(){}[0]
62 |
63 | final fun (com.huanshankeji.compose.web.material/MwcButtonAttrsScopeBuilder).slot(kotlin/String) // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate.slot|slot@com.huanshankeji.compose.web.material.MwcButtonAttrsScopeBuilder(kotlin.String){}[0]
64 | final fun (com.huanshankeji.compose.web.material/MwcIconButtonAttrsScopeBuilder).slot(kotlin/String) // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate.slot|slot@com.huanshankeji.compose.web.material.MwcIconButtonAttrsScopeBuilder(kotlin.String){}[0]
65 | final fun DisposableRefEffect(kotlin/Any?, kotlin/Function2, androidx.compose.runtime/Composer?, kotlin/Int) // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate.DisposableRefEffect|DisposableRefEffect(kotlin.Any?;kotlin.Function2;androidx.compose.runtime.Composer?;kotlin.Int){}[0]
66 | final fun DisposableRefEffect(kotlin/Function2, androidx.compose.runtime/Composer?, kotlin/Int) // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate.DisposableRefEffect|DisposableRefEffect(kotlin.Function2;androidx.compose.runtime.Composer?;kotlin.Int){}[0]
67 | final fun DomSideEffect(kotlin/Any?, kotlin/Function2, androidx.compose.runtime/Composer?, kotlin/Int) // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate.DomSideEffect|DomSideEffect(kotlin.Any?;kotlin.Function2;androidx.compose.runtime.Composer?;kotlin.Int){}[0]
68 | final fun DomSideEffect(kotlin/Function2, androidx.compose.runtime/Composer?, kotlin/Int) // com.huanshankeji.compose.web.material/MwcSnackbarElementScopeDelegate.DomSideEffect|DomSideEffect(kotlin.Function2;androidx.compose.runtime.Composer?;kotlin.Int){}[0]
69 | }
70 |
71 | final class com.huanshankeji.compose.web.material/MwcTextfieldAttrsScopeBuilder : com.huanshankeji.compose.web.material/MwcInputComponentAttrsScopeBuilder { // com.huanshankeji.compose.web.material/MwcTextfieldAttrsScopeBuilder|null[0]
72 | constructor (org.jetbrains.compose.web.attributes/AttrsScope