FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Start implementation on PageHeader and ServiceCard component groups · patternfly-java/patternfly-java@0d97d4f · GitHub

Commit 0d97d4f

Browse files
committed
Start implementation on PageHeader and ServiceCard component groups
1 parent 6484ea3 commit 0d97d4f

4 files changed

Lines changed: 179 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1010

1111
### Added
1212

13-
- Add [`Ordered`](https://patternfly-java.github.io/patternfly-java/org/patternfly/component/Ordered.html) interface.
13+
- Add [`Ordered`](https://patternfly-java.github.io/apidocs/org/patternfly/component/Ordered.html) interface.
1414

1515
## [0.4.16] - 2026-02-05
1616

‎components/src/main/java/org/patternfly/component/ComponentType.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ public enum ComponentType {
109109

110110
Page("pg", "PF6/Component/Page"),
111111

112+
PageHeader("ph", "PF6/Component/PageHeader"),
113+
112114
Panel("pnl", "PF6/Component/Panel"),
113115

114116
Popover("pvr", "PF6/Component/Popover"),
@@ -121,6 +123,8 @@ public enum ComponentType {
121123

122124
SearchInput("si", "PF6/Component/SearchInput"),
123125

126+
ServiceCard("sc", "PF6/Component/ServiceCard"),
127+
124128
Sidebar("sb", "PF6/Component/Sidebar"),
125129

126130
SimpleList("sl", "PF6/Component/SimpleList"),
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
package org.patternfly.componentgroup.pageheader;
2+
3+
import org.patternfly.component.BaseComponent;
4+
import org.patternfly.component.ComponentIcon;
5+
import org.patternfly.component.ComponentType;
6+
import org.patternfly.component.breadcrumb.Breadcrumb;
7+
import org.patternfly.component.label.Label;
8+
import elemental2.dom.Element;
9+
import elemental2.dom.HTMLElement;
10+
11+
import static org.jboss.elemento.Elements.div;
12+
13+
public class PageHeader extends BaseComponent<HTMLElement, PageHeader> implements
14+
ComponentIcon<HTMLElement, PageHeader> {
15+
16+
//language=HTML
17+
private final static String HTML_JUST_FOR_REFERENCE = """
18+
<section class="pf-v6-c-page__main-section">
19+
<div class="pf-v6-l-flex">
20+
<div class="pf-m-align-self-center iconMinWidth-0-2-1">
21+
<img src="/images/f4fb6361.svg" alt="page-header-icon">
22+
</div>
23+
<hr class="pf-v6-c-divider pf-m-vertical">
24+
<div class="pf-m-flex-1">
25+
<div class="pf-v6-l-split pf-m-gutter">
26+
<div class="pf-v6-l-split__item">
27+
<h1 class="pf-v6-c-content--h1 pf-v6-u-mb-sm">My Title</h1>
28+
</div>
29+
<div class="pf-v6-l-split__item">
30+
<span class="pf-v6-c-label pf-m-filled pf-v5-u-align-content-center">
31+
<span class="pf-v6-c-label__content">
32+
<span class="pf-v6-c-label__text">Org. Administrator</span>
33+
</span>
34+
</span>
35+
</div>
36+
<div class="pf-v6-l-split__item pf-m-fill"></div>
37+
<div class="pf-v6-l-split__item">
38+
<div class="pf-v6-c-action-list">
39+
<div class="pf-v6-c-action-list__item">
40+
<button class="pf-v6-c-menu-toggle pf-m-plain" type="button"
41+
aria-label="Action list single group kebab" aria-expanded="false">
42+
<span class="pf-v6-c-menu-toggle__icon">
43+
<svg class="pf-v6-svg" viewBox="0 0 192 512">
44+
<path d="M96..."></path>
45+
</svg>
46+
</span>
47+
</button>
48+
</div>
49+
</div>
50+
</div>
51+
</div>
52+
<p class="pf-v6-c-content--p">This is a subtitle for your page header</p>
53+
<a label="Go to this link" aria-disabled="false" class="pf-v6-c-button pf-m-link pf-m-inline">
54+
<span class="pf-v6-c-button__text">Go to this link</span>
55+
<span class="pf-v6-c-button__icon pf-m-end">
56+
<svg class="pf-v6-svg pf-v6-u-ml-sm" viewBox="0 0 512 512" width="1em" height="1em">
57+
<path d="M432..."></path>
58+
</svg>
59+
</span>
60+
</a>
61+
</div>
62+
</div>
63+
</section>
64+
""";
65+
66+
// ------------------------------------------------------ factory
67+
68+
public static PageHeader pageHeader() {
69+
return new PageHeader();
70+
}
71+
72+
// ------------------------------------------------------ instance
73+
74+
PageHeader() {
75+
super(ComponentType.PageHeader, div().element());
76+
}
77+
78+
// ------------------------------------------------------ add
79+
80+
public PageHeader addBreadcrumb(Breadcrumb breadcrumb) {
81+
return add(breadcrumb);
82+
}
83+
84+
public PageHeader add(Breadcrumb breadcrumb) {
85+
return this;
86+
}
87+
88+
public PageHeader addLabel(Label label) {
89+
return add(label);
90+
}
91+
92+
public PageHeader add(Label label) {
93+
return this;
94+
}
95+
96+
// ------------------------------------------------------ builder
97+
98+
@Override
99+
public PageHeader icon(Element icon) {
100+
return this;
101+
}
102+
103+
@Override
104+
public PageHeader removeIcon() {
105+
return this;
106+
}
107+
108+
public PageHeader title(String title) {
109+
return this;
110+
}
111+
112+
public PageHeader subTitle(String subTitle) {
113+
return this;
114+
}
115+
116+
@Override
117+
public PageHeader that() {
118+
return this;
119+
}
120+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package org.patternfly.componentgroup.servicecard;
2+
3+
import org.patternfly.component.BaseComponent;
4+
import org.patternfly.component.ComponentIcon;
5+
import org.patternfly.component.ComponentType;
6+
import elemental2.dom.Element;
7+
import elemental2.dom.HTMLElement;
8+
9+
import static org.jboss.elemento.Elements.div;
10+
11+
public class ServiceCard extends BaseComponent<HTMLElement, ServiceCard> implements
12+
ComponentIcon<HTMLElement, ServiceCard> {
13+
14+
// ------------------------------------------------------ factory
15+
16+
public ServiceCard serviceCard() {
17+
return new ServiceCard();
18+
}
19+
20+
// ------------------------------------------------------ instance
21+
22+
public ServiceCard() {
23+
super(ComponentType.ServiceCard, div().element());
24+
}
25+
26+
// ------------------------------------------------------ builder
27+
28+
@Override
29+
public ServiceCard icon(Element icon) {
30+
return this;
31+
}
32+
33+
@Override
34+
public ServiceCard removeIcon() {
35+
return this;
36+
}
37+
38+
public ServiceCard title(String title) {
39+
return this;
40+
}
41+
42+
public ServiceCard subTitle(String subTitle) {
43+
return this;
44+
}
45+
46+
public ServiceCard description(String description) {
47+
return this;
48+
}
49+
50+
@Override
51+
public ServiceCard that() {
52+
return this;
53+
}
54+
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL