File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
compose-html-material3/src/jsMain/kotlin/com/huanshankeji/compose/html/material3 Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ package com.huanshankeji.compose.html.material3
2+
3+ @RequiresOptIn(
4+ " This API depends on components in the Material Web labs directory, which contains experimental features that are not recommended for production. " +
5+ " See https://github.com/material-components/material-web/tree/main/labs for more details." ,
6+ RequiresOptIn .Level .WARNING
7+ )
8+ @Retention(AnnotationRetention .BINARY )
9+ annotation class MaterialWebLabsApi
Original file line number Diff line number Diff line change 1+ package com.huanshankeji.compose.html.material3
2+
3+ import androidx.compose.runtime.Composable
4+ import com.huanshankeji.compose.web.attributes.Attrs
5+ import org.jetbrains.compose.web.dom.ElementScope
6+ import org.jetbrains.compose.web.dom.TagElement
7+ import org.w3c.dom.HTMLElement
8+
9+ /*
10+ https://github.com/material-components/material-web/blob/main/labs/card/internal/card.ts
11+ https://github.com/material-components/material-web/blob/main/labs/card/demo/stories.ts
12+ */
13+
14+ @MaterialWebLabsApi
15+ @Composable
16+ fun MdElevatedCard (
17+ attrs : Attrs <HTMLElement >? = null,
18+ content : @Composable (ElementScope <HTMLElement >.() -> Unit )?
19+ ) {
20+ require(" @material/web/labs/card/elevated-card.js" )
21+
22+ TagElement (" md-elevated-card" , attrs, content)
23+ }
24+
25+ @MaterialWebLabsApi
26+ @Composable
27+ fun MdFilledCard (
28+ attrs : Attrs <HTMLElement >? = null,
29+ content : @Composable (ElementScope <HTMLElement >.() -> Unit )?
30+ ) {
31+ require(" @material/web/labs/card/filled-card.js" )
32+
33+ TagElement (" md-filled-card" , attrs, content)
34+ }
35+
36+ @MaterialWebLabsApi
37+ @Composable
38+ fun MdOutlinedCard (
39+ attrs : Attrs <HTMLElement >? = null,
40+ content : @Composable (ElementScope <HTMLElement >.() -> Unit )?
41+ ) {
42+ require(" @material/web/labs/card/outlined-card.js" )
43+
44+ TagElement (" md-outlined-card" , attrs, content)
45+ }
You can’t perform that action at this time.
0 commit comments