Skip to content

Commit 6919a2c

Browse files
authored
feat: Allow icon sets to be updated (#867)
* feat Working through updates to allow icon sets to be updated * feat Tidy demo page for icon set * feat Update styles to support circled states * feat Developing the storybook instance * feat Update pfe-icon-panel to support pfe-icon updates * feat Update icon panel so that if circle exists, use XL, else use LG * feat Update template for icon panel and adjust styles for simplicity * feat Update tests * feat Do we need these anymore? * feat Update demo page local iconset function and schema for panel * feat Fix failing test * feat Fix ES6 syntax in the demo page so it will upgrade in IE11 * feat Fix local icon set * feat Remove console log from pfelement * feat Add documentation for icon registery * feat Update readme * feat Fix issues uncovered from failing tests * feat Update index, remove pfe-test * feat Update changelog
1 parent 235e9a8 commit 6919a2c

29 files changed

+1297
-1549
lines changed

.storybook/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export function autoPropKnobs(properties, bridge) {
241241
}
242242

243243
// Convert the array into an object
244-
options.map(item => (opts[item.sentenceCase()] = item));
244+
options.map(item => (opts[item] = item));
245245

246246
// If the default value is not defined, use the new null option as the default
247247
if (defaultValue === "" || defaultValue === null) {

CHANGELOG-prerelease.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
- [775b821](https://github.com/patternfly/patternfly-elements/commit/775b821702c903f926b8bf9fdf9c948ac949335f) feat: Add automatic labeling to PRs
44
- [82bf8e6](https://github.com/patternfly/patternfly-elements/commit/82bf8e6a0d407a651571dac1e37d06a2b14fa3d4) feat: Move PR cards automatically in the Project when labels are changed
5-
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: Move tab headings to the ShadowDOM
5+
- [2adef08](https://github.com/patternfly/patternfly-elements/commit/2adef088768ac52f813899d42ba5a45119761ea3) fix: Add watch task to components generated before infra change
6+
- [235e9a8](https://github.com/patternfly/patternfly-elements/commit/235e9a816b763dc9251e3022c914cba72f148368) fix: Move tab headings to the ShadowDOM
7+
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: pfe-icon and pfe-icon-panel updates
8+
- Update paths to built-in sets: (#723)
9+
- Storybook icon listing: (#728)
10+
- Icon panel storybook: (#719)
11+
612

713
## Prerelease 49 ( 2020-05-29 )
814

915
- [9adb7ce](https://github.com/patternfly/patternfly-elements/commit/9adb7ce4e5a672192ca49af8a7b7f9afb5f56e75) feat: pfe-jump-links (#858)
1016
- [b1e69ee](https://github.com/patternfly/patternfly-elements/commit/b1e69ee03f5a56a64c5f57dbc8327e8a2430f0fc) feat: pfe-dropdown (#668)
1117
- [7fe6014](https://github.com/patternfly/patternfly-elements/commit/7fe60149d05ec984e4411a73cf2e1f8185a2df98) fix: pfe-tabs vertical height (#796)
12-
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: Add watch task to components generated before infra change
1318

1419
## Prerelease 48 ( 2020-05-19 )
1520

elements/pfe-badge/package-lock.json

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

elements/pfe-icon-panel/README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1-
# PFElements Icon Panel Element
1+
# PatternFly Elements | Icon Panel Element
22

33
## Usage
44

55
```html
66
<pfe-icon-panel icon="pfe-icon-server">
7-
<h3 slot="header">This is pfe-icon-panel</h3>
7+
<h3 slot="pfe-icon-panel--header">This is pfe-icon-panel</h3>
88
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
9-
<pfe-cta slot="footer">
9+
<pfe-cta slot="pfe-icon-panel--footer">
1010
<a href="https://pfelements.github.io">Learn more about PFElements</a>
1111
</pfe-cta>
1212
</pfe-icon-panel>
1313
```
1414

1515
## Slots
1616

17-
### header
18-
The header of the icon panel
17+
### Header
18+
The header of the icon panel. Assign content to this region using `slot="pfe-icon-panel--header`.
1919

2020
### Default slot (body)
2121
Any content that is not designated for the header or footer slot, will go to this slot.
2222

23-
### footer
24-
Use this slot for anything that you want in the footer of the icon panel.
23+
### Footer
24+
Use this slot for anything that you want in the footer of the icon panel. Assign content to this region using `slot="pfe-icon-panel--footer`.
2525

2626
## Attributes
2727

28-
### icon (observed)
29-
30-
The name of the icon that you want to use. If the value of this attribute changes, the new icon will show up in the UI.
28+
| Name | Values | Description |
29+
| --- | --- | --- |
30+
| `icon` | `iconSet-iconName` | For example, `rh-leaf` loads a leaf icon from an icon set named "rh". |
31+
| `pfe-color` | `base` `lightest` `lighter` `darker` `darkest` `complement` `accent` `accent` `critical` `important` `moderate` `success` `info` `default` | The color variant to use. This draws from your theming layer to color the icon. This will set icon color or background color (if `pfe-circled` is true). |
32+
| `pfe-circled` | boolean attribute | Whether to draw a circular background behind the icon. If this is chosen, the icon will render as `lg` size; otherwise the icon renders at the `xl` size. |
33+
| `pfe-stacked` | boolean attribute | Whether to stack the icon on top of the content. |
3134

3235
## Test
3336

elements/pfe-icon-panel/demo/index.html

Lines changed: 55 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/2.3.0/custom-elements-es5-adapter.js"></script>
2525
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/2.3.0/webcomponents-bundle.js"></script>
2626
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js"></script>
27-
<script>require(['../dist/pfe-icon-panel.umd.js'])</script>
27+
<script>require(['../dist/pfe-icon-panel.umd', '../../pfe-band/dist/pfe-band.umd', '../../pfe-cta/dist/pfe-cta.umd'])</script>
2828

2929
<noscript>
3030
<link href="../../pfelement/dist/pfelement--noscript.min.css" rel="stylesheet">
@@ -33,30 +33,59 @@
3333
<link href="../../pfelement/dist/pfelement.min.css" rel="stylesheet">
3434
</head>
3535
<body unresolved>
36-
<pfe-icon-panel icon="rh-server" circled color="critical">
37-
<h3 slot="header">Default</h3>
38-
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
39-
<pfe-cta slot="footer"><a href="#">Learn more</a></pfe-cta>
40-
</pfe-icon-panel>
41-
<pfe-icon-panel icon="rh-server-stack" stacked>
42-
<h3 slot="header">Stacked</h3>
43-
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
44-
</pfe-icon-panel>
45-
<pfe-icon-panel icon="rh-server-stack-alt1" stacked centered>
46-
<h3 slot="header">Stacked &amp; Centered</h3>
47-
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
48-
</pfe-icon-panel>
49-
<pfe-icon-panel icon="rh-server-alt1" circled>
50-
<h3 slot="header">Circled Default</h3>
51-
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
52-
</pfe-icon-panel>
53-
<pfe-icon-panel icon="rh-server-alt2" circled color="dark">
54-
<h3 slot="header">Circled Default</h3>
55-
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
56-
</pfe-icon-panel>
57-
<pfe-icon-panel icon="rh-server-deploy" circled color="darkest">
58-
<h3 slot="header">Circled Default</h3>
59-
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
60-
</pfe-icon-panel>
36+
<pfe-band pfe-color="lightest">
37+
<h1 slot="pfe-band--header"><code>&lt;pfe-icon-panel&gt;</code></h1>
38+
<pfe-icon-panel icon="rh-server">
39+
<h3 slot="pfe-icon-panel--header">Default</h3>
40+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
41+
<pfe-cta slot="pfe-icon-panel--footer"><a href="#">Learn more</a></pfe-cta>
42+
</pfe-icon-panel>
43+
</pfe-band>
44+
45+
<pfe-band pfe-color="lightest" pfe-size="small">
46+
<h2 slot="pfe-band--header">Stacked variants</h2>
47+
<div class="pfe-l-grid pfe-m-gutters pfe-m-all-4-col">
48+
<pfe-icon-panel icon="rh-server-stack" pfe-stacked>
49+
<h3 slot="pfe-icon-panel--header">Default</h3>
50+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
51+
</pfe-icon-panel>
52+
<pfe-icon-panel icon="rh-server-stack-alt1" pfe-stacked pfe-centered>
53+
<h3 slot="pfe-icon-panel--header">Centered</h3>
54+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
55+
</pfe-icon-panel>
56+
<pfe-icon-panel icon="rh-server-alt1" pfe-circled="false" pfe-stacked>
57+
<h3 slot="pfe-icon-panel--header">No circle</h3>
58+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
59+
</pfe-icon-panel>
60+
</div>
61+
</pfe-band>
62+
63+
<pfe-band pfe-color="lightest" pfe-size="small">
64+
<h2 slot="pfe-band--header">No circle variants</h2>
65+
<div class="pfe-l-grid pfe-m-gutters pfe-m-all-8-col-on-sm">
66+
<pfe-icon-panel icon="rh-server-alt1" pfe-circled="false">
67+
<h3 slot="pfe-icon-panel--header">Default</h3>
68+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
69+
</pfe-icon-panel>
70+
<pfe-icon-panel icon="rh-server-alt1" pfe-circled="false" pfe-color="critical">
71+
<h3 slot="pfe-icon-panel--header">Color</h3>
72+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
73+
</pfe-icon-panel>
74+
</div>
75+
</pfe-band>
76+
77+
<pfe-band pfe-color="lightest" pfe-size="small">
78+
<h2 slot="pfe-band--header">Color variants</h2>
79+
<div class="pfe-l-grid pfe-m-gutters pfe-m-all-8-col-on-sm">
80+
<pfe-icon-panel icon="rh-server-alt2" pfe-circled pfe-color="darker">
81+
<h3 slot="pfe-icon-panel--header">Darker</h3>
82+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
83+
</pfe-icon-panel>
84+
<pfe-icon-panel icon="rh-server-deploy" pfe-circled pfe-color="accent">
85+
<h3 slot="pfe-icon-panel--header">Accent</h3>
86+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
87+
</pfe-icon-panel>
88+
</div>
89+
</pfe-band>
6190
</body>
6291
</html>

0 commit comments

Comments
 (0)