Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/patternfly/components/Label/examples/Label.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#ws-core-c-label-filled .ws-preview-html,
#ws-core-c-label-outline .ws-preview-html,
#ws-core-c-label-compact .ws-preview-html,
#ws-core-c-label-large .ws-preview-html,
#ws-core-c-label-overflow .ws-preview-html {
margin: -4px;
}

#ws-core-c-label-filled .pf-v6-c-label,
#ws-core-c-label-outline .pf-v6-c-label,
#ws-core-c-label-compact .pf-v6-c-label,
#ws-core-c-label-large .pf-v6-c-label,
#ws-core-c-label-overflow .pf-v6-c-label {
margin: 4px;
}
Expand Down
126 changes: 74 additions & 52 deletions src/patternfly/components/Label/examples/Label.md

Large diffs are not rendered by default.

27 changes: 21 additions & 6 deletions src/patternfly/components/Label/label--variants.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
label--id=(concat label--variants--id '-status-button-removable')
label-text--value=(concat label--variants--title ' button removable')}}

{{> label
label--IsRemovable=true
label-content--IsButton=true
label--id=(concat label--variants--id '-status-button-clicked')
label-text--value=(concat label--variants--title ' button clicked')
label--IsClicked=true}}

{{> label
label--id=(concat label--variants--id '-status-truncated')
label-text--value=(concat label--variants--title ', max-width truncation customization')
Expand Down Expand Up @@ -61,7 +68,7 @@

{{> label
label--id=(concat label--variants--id '-icon')
label-icon--value="cube"
label-icon--value="rh-ui-add-circle-fill"
label-text--value=(concat label--variants--title ' icon')}}

{{> label
Expand All @@ -73,7 +80,7 @@
label--IsRemovable=true
label--id=(concat label--variants--id '-icon-removable')
label-text--value=(concat label--variants--title ' icon removable')
label-icon--value="cube"}}
label-icon--value="rh-ui-add-circle-fill"}}

{{> label
label--id=(concat label--variants--id '-link')
Expand All @@ -97,34 +104,42 @@
label-text--value=(concat label--variants--title ' button removable')
label-content--IsButton=true}}

{{> label
label--IsRemovable=true
label--IsClicked=true
label--id=(concat label--variants--id '-button-clicked')
label-text--value=(concat label--variants--title ' button clicked')
label-content--IsButton=true
label-icon--value="rh-ui-add-circle-fill"}}

{{> label
label--id=(concat label--variants--id '-truncated')
label-text--value=(concat label--variants--title ' label, max-width truncation customization')
label-text--attribute='style="--pf-v6-c-label__text--MaxWidth: 28ch"'
label-icon--value="cube"}}
label-icon--value="rh-ui-add-circle-fill"}}

{{> label
label--IsRemovable=true
label--id=(concat label--variants--id '-truncated-with-icon')
label-text--value=(concat label--variants--title ' label with icon and set max-width truncation customization')
label-text--attribute='style="--pf-v6-c-label__text--MaxWidth: 38ch"'
label-icon--value="cube"}}
label-icon--value="rh-ui-add-circle-fill"}}

{{> label
label--IsRemovable=true
label--IsDisabled=true
label--id=(concat label--variants--id '-link-removable-disabled')
label-text--value=(concat label--variants--title ' link removable (disabled)')
label-content--IsLink=true
label-icon--value="cube"}}
label-icon--value="rh-ui-add-circle-fill"}}

{{> label
label--IsRemovable=true
label--IsDisabled=true
label--id=(concat label--variants--id '-button-removable-disabled')
label-text--value=(concat label--variants--title ' button removable (disabled)')
label-content--IsButton=true
label-icon--value="cube"}}
label-icon--value="rh-ui-add-circle-fill"}}

{{#if @partial-block}}
{{> @partial-block}}
Expand Down
14 changes: 7 additions & 7 deletions src/patternfly/components/Label/label-icon--map.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{#if label-icon--value}}
{{~label-icon--value}}
{{~pfIcon label-icon--value}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ~ in this and the ifEquals aren't really needed anymore because we aren't passing stings into classes anymore.

{{else}}
{{~#ifEquals label--status "success"}}check-circle{{/ifEquals}}
{{~#ifEquals label--status "warning"}}exclamation-triangle{{/ifEquals}}
{{~#ifEquals label--status "danger"}}exclamation-circle{{/ifEquals}}
{{~#ifEquals label--status "info"}}info-circle{{/ifEquals}}
{{~#ifEquals label--status "custom"}}bell{{/ifEquals}}
{{/if}}
{{~#ifEquals label--status "success"}}{{pfIcon "rh-ui-check-circle-fill"}}{{/ifEquals}}
{{~#ifEquals label--status "warning"}}{{pfIcon "rh-ui-warning-fill"}}{{/ifEquals}}
{{~#ifEquals label--status "danger"}}{{pfIcon "rh-ui-error-fill"}}{{/ifEquals}}
{{~#ifEquals label--status "info"}}{{pfIcon "rh-ui-information-fill"}}{{/ifEquals}}
{{~#ifEquals label--status "custom"}}{{pfIcon "rh-ui-notification-fill"}}{{/ifEquals}}
{{/if}}
2 changes: 1 addition & 1 deletion src/patternfly/components/Label/label-icon.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{{label-icon--attribute}}}
{{/if}}>
{{#ifAny label-icon--value label--status}}
<i class="fas fa-fw fa-{{~> label-icon--map~}}" aria-hidden="true"></i>
{{> label-icon--map}}
{{/ifAny}}
{{#if @partial-block}}
{{> @partial-block}}
Expand Down
2 changes: 2 additions & 0 deletions src/patternfly/components/Label/label.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
{{#if label--IsFilled}} pf-m-filled{{/if}}
{{#if label--IsOutlined}} pf-m-outline{{/if}}
{{#if label--IsCompact}} pf-m-compact{{/if}}
{{#if label--IsLarge}} pf-m-large{{/if}}
{{#if label--IsOverflow}} pf-m-overflow{{/if}}
{{#if label--IsAdd}} pf-m-add{{/if}}
{{#if label--IsEditable}} pf-m-editable{{/if}}
{{#if label--IsEditableActive}} pf-m-editable-active{{/if}}
{{#if label--IsDisabled}} pf-m-disabled{{/if}}
{{#if label--IsClicked}} pf-m-clicked{{/if}}
{{#ifAny label--color label--status}}
pf-m-{{ternary label--status label--status label--color}}
{{/ifAny}}
Expand Down
Loading
Loading