Skip to content

Commit fba481f

Browse files
feat: use patternfly v6
1 parent 14e50e1 commit fba481f

28 files changed

Lines changed: 227 additions & 710 deletions

Cargo.lock

Lines changed: 98 additions & 512 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ browser-panic-hook = "0.2"
1313
chrono = { version = "0.4.30", default-features = false, features = ["wasmbind"] }
1414
gloo-utils = "0.2"
1515
log = "0.4"
16-
patternfly-yew = { version = "0.6.1", features = ["tree", "icons-fab"] }
16+
patternfly-yew = { version = "0.6.3", features = ["tree", "icons-fab"] }
1717
popper-rs = { version = "0.4", features = ["yew", "debug"] }
1818
serde_json = "1"
1919
strum = { version = "0.27", features = ["derive"] }
@@ -35,8 +35,8 @@ features = [
3535
]
3636

3737
[patch.crates-io]
38-
#patternfly-yew = { path = "../patternfly-yew" }
39-
#patternfly-yew = { git = "https://github.com/patternfly-yew/patternfly-yew", rev = "00b862fd1c72a98229b8c56cf13f9009992cf70c" } # FIXME: awaiting release
38+
# patternfly-yew = { path = "../patternfly-yew" }
39+
patternfly-yew = { git = "https://github.com/luminvent/patternfly-yew", branch = "feat/patternfly6" } # FIXME: awaiting release
4040
#yew-nested-router = { path = "../yew-nested-router" }
4141
#yew-more-hooks = { git = "https://github.com/ctron/yew-more-hooks", rev = "f535bb2e7b227aac7010035215c11d4aeae6cb62" } # FIXME: awaiting release
4242
#yew-more-hooks = { path = "../yew-more-hooks" }

assets/images/pf-logo.svg

Lines changed: 11 additions & 10 deletions
Loading

assets/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// only required if you are using the icons-far or icons-fab feature
2-
$fa-font-path: "webfonts";
2+
// $fa-font-path: "webfonts";
33
@import "../node_modules/@fortawesome/fontawesome-free/scss/fontawesome";
44
@import "../node_modules/@fortawesome/fontawesome-free/scss/brands";
55

package-lock.json

Lines changed: 16 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"test": "echo \"Error: no test specified\" && exit 1"
77
},
88
"dependencies": {
9-
"@fortawesome/fontawesome-free": "^6.5.2",
10-
"@patternfly/patternfly": "^5.3.0"
9+
"@fortawesome/fontawesome-free": "^7.1.0",
10+
"@patternfly/patternfly": "^6.4.0"
1111
},
1212
"//dependencies": {
1313
"@fortawesome/fontawesome-free": "Only required if you are enabling the icons-fab or icons-far feature"

src/app/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub enum Component {
2424
Button,
2525
Card,
2626
Clipboard,
27-
Chip,
2827
CodeBlock,
2928
Date(Date),
3029
DescriptionList,
@@ -144,7 +143,6 @@ fn switch_app_route(target: AppRoute) -> Html {
144143
Component::Breadcrumb => html! {<components::BreadcrumbExample/>},
145144
Component::Button => html! {<components::ButtonExample/>},
146145
Component::Card => html! {<components::CardExample/>},
147-
Component::Chip => html! {<components::ChipExample/>},
148146
Component::Clipboard => html! {<components::ClipboardExample/>},
149147
Component::CodeBlock => html! {<components::CodeBlockExample/>},
150148
Component::Date(Date::Calendar) => html! {<components::CalendarExample/>},
@@ -268,7 +266,7 @@ fn page(props: &PageProps) -> Html {
268266
<NavRouterItem<AppRoute> to={AppRoute::Counter}>{"Counter"}</NavRouterItem<AppRoute>>
269267
<NavRouterItem<AppRoute> to={AppRoute::Icons}>{"Icons"}</NavRouterItem<AppRoute>>
270268
<NavRouterItem<AppRoute> to={AppRoute::Panic}>{"Panic"}</NavRouterItem<AppRoute>>
271-
<NavLink href="https://github.com/patternfly-yew/patternfly-yew" target="_blank">{"PatternFly Yew "} {Icon::ExternalLinkAlt.with_classes(classes!("pf-v5-u-ml-sm", "pf-v5-u-color-200"))}</NavLink>
269+
<NavLink href="https://github.com/patternfly-yew/patternfly-yew" target="_blank">{"PatternFly Yew "} {Icon::ExternalLinkAlt.with_classes(classes!("pf-v6-u-ml-sm", "pf-v6-u-color-200"))}</NavLink>
272270
</NavExpandable>
273271
<NavExpandable title="Components">
274272
<NavRouterItem<AppRoute> to={AppRoute::Component(Component::Accordion)}>{"Accordion"}</NavRouterItem<AppRoute>>
@@ -280,7 +278,6 @@ fn page(props: &PageProps) -> Html {
280278
<NavRouterItem<AppRoute> to={AppRoute::Component(Component::Breadcrumb)}>{"Breadcrumb"}</NavRouterItem<AppRoute>>
281279
<NavRouterItem<AppRoute> to={AppRoute::Component(Component::Button)}>{"Button"}</NavRouterItem<AppRoute>>
282280
<NavRouterItem<AppRoute> to={AppRoute::Component(Component::Card)}>{"Card"}</NavRouterItem<AppRoute>>
283-
<NavRouterItem<AppRoute> to={AppRoute::Component(Component::Chip)}>{"Chip"}</NavRouterItem<AppRoute>>
284281
<NavRouterItem<AppRoute> to={AppRoute::Component(Component::Clipboard)}>{"Clipboard"}</NavRouterItem<AppRoute>>
285282
<NavRouterItem<AppRoute> to={AppRoute::Component(Component::CodeBlock)}>{"Code Block"}</NavRouterItem<AppRoute>>
286283
<NavExpandable title="Date">
@@ -348,7 +345,9 @@ fn page(props: &PageProps) -> Html {
348345

349346
let brand = html! (
350347
<MastheadBrand>
351-
<Brand src="assets/images/pf-logo.svg" alt="Patternfly Logo" style="--pf-v5-c-brand--Height: 36px;"/>
348+
<div className="show-light">
349+
<Brand src="/images/pf-logo.svg" alt="Patternfly Logo" style="--pf-v6-c-brand--Height: 36px;"/>
350+
</div>
352351
</MastheadBrand>
353352
);
354353

@@ -377,7 +376,7 @@ fn page(props: &PageProps) -> Html {
377376

378377
// apply dark mode
379378
use_effect_with(*darkmode, |state| match state {
380-
true => gloo_utils::document_element().set_class_name("pf-v5-theme-dark"),
379+
true => gloo_utils::document_element().set_class_name("pf-v6-theme-dark"),
381380
false => gloo_utils::document_element().set_class_name(""),
382381
});
383382

@@ -388,7 +387,7 @@ fn page(props: &PageProps) -> Html {
388387
<Toolbar full_height=true>
389388
<ToolbarContent>
390389
<ToolbarGroup
391-
modifiers={ToolbarElementModifier::Right.all()}
390+
modifiers={ToolbarElementModifier::End.all()}
392391
variant={GroupVariant::IconButton}
393392
>
394393
<ToolbarItem>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
html!(
2-
<Brand src="assets/images/pf_logo.svg" alt="PatternFly logo" />
2+
<Brand src="/images/pf-logo.svg" alt="PatternFly logo" />
33
)

src/components/card/card.2.example

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
let flat = use_state(|| false);
3939
let full_height = use_state(|| false);
4040
let plain = use_state(|| false);
41-
let rounded = use_state(|| false);
4241

4342
let change_callback = |handle: &UseStateHandle<bool>| {
4443
let handle = handle.clone();
@@ -54,9 +53,8 @@
5453
<ListItem><Switch label="flat" checked={*flat} onchange={change_callback(&flat)} /></ListItem>
5554
<ListItem><Switch label="full height" checked={*full_height} onchange={change_callback(&full_height)} /></ListItem>
5655
<ListItem><Switch label="plain" checked={*plain} onchange={change_callback(&plain)} /></ListItem>
57-
<ListItem><Switch label="rounded" checked={*rounded} onchange={change_callback(&rounded)} /></ListItem>
5856
<ListItem>
59-
<Dropdown text={card_size_to_text(*size)}>
57+
<Dropdown text={html!{card_size_to_text(*size)}}>
6058
<SizeAction size={CardSize::Default} onchange={change_size.clone()} />
6159
<SizeAction size={CardSize::Compact} onchange={change_size.clone()} />
6260
<SizeAction size={CardSize::Large} onchange={change_size.clone()} />
@@ -71,7 +69,6 @@
7169
flat={*flat}
7270
full_height={*full_height}
7371
plain={*plain}
74-
rounded={*rounded}
7572
>
7673
<CardBody>{ "Body" }</CardBody>
7774
<CardFooter>{ "Footer" }</CardFooter>

src/components/chip/chip.1.example

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)