@patternfly/elements 4.1.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +14909 -12588
- package/package.json +26 -17
- package/pf-accordion/pf-accordion-header.css +37 -0
- package/pf-accordion/pf-accordion-header.d.ts +0 -61
- package/pf-accordion/pf-accordion-header.js +180 -2
- package/pf-accordion/pf-accordion-header.js.map +1 -1
- package/pf-accordion/pf-accordion-panel.css +12 -0
- package/pf-accordion/pf-accordion-panel.d.ts +0 -34
- package/pf-accordion/pf-accordion-panel.js +87 -2
- package/pf-accordion/pf-accordion-panel.js.map +1 -1
- package/pf-accordion/pf-accordion.css +62 -0
- package/pf-accordion/pf-accordion.d.ts +1 -64
- package/pf-accordion/pf-accordion.js +156 -2
- package/pf-accordion/pf-accordion.js.map +1 -1
- package/pf-alert/pf-alert.css +193 -0
- package/pf-alert/pf-alert.d.ts +95 -0
- package/pf-alert/pf-alert.js +406 -0
- package/pf-alert/pf-alert.js.map +1 -0
- package/pf-alert/test/pf-alert.e2e.d.ts +1 -0
- package/pf-alert/test/pf-alert.e2e.js +45 -0
- package/pf-alert/test/pf-alert.e2e.js.map +1 -0
- package/pf-alert/test/pf-alert.spec.d.ts +1 -0
- package/pf-alert/test/pf-alert.spec.js +42 -0
- package/pf-alert/test/pf-alert.spec.js.map +1 -0
- package/pf-avatar/pf-avatar.css +14 -0
- package/pf-avatar/pf-avatar.d.ts +1 -14
- package/pf-avatar/pf-avatar.js +82 -2
- package/pf-avatar/pf-avatar.js.map +1 -1
- package/pf-back-to-top/pf-back-to-top.css +12 -0
- package/pf-back-to-top/pf-back-to-top.d.ts +1 -17
- package/pf-back-to-top/pf-back-to-top.js +87 -3
- package/pf-back-to-top/pf-back-to-top.js.map +1 -1
- package/pf-back-to-top/test/pf-back-to-top.spec.js +3 -2
- package/pf-back-to-top/test/pf-back-to-top.spec.js.map +1 -1
- package/pf-background-image/pf-background-image.css +7 -0
- package/pf-background-image/pf-background-image.d.ts +1 -8
- package/pf-background-image/pf-background-image.js +76 -2
- package/pf-background-image/pf-background-image.js.map +1 -1
- package/pf-badge/pf-badge.css +13 -0
- package/pf-badge/pf-badge.d.ts +1 -13
- package/pf-badge/pf-badge.js +53 -2
- package/pf-badge/pf-badge.js.map +1 -1
- package/pf-banner/pf-banner.css +21 -0
- package/pf-banner/pf-banner.d.ts +1 -19
- package/pf-banner/pf-banner.js +122 -2
- package/pf-banner/pf-banner.js.map +1 -1
- package/pf-button/pf-button-tokens.css +38 -0
- package/pf-button/pf-button.d.ts +1 -106
- package/pf-button/pf-button.js +837 -4
- package/pf-button/pf-button.js.map +1 -1
- package/pf-card/pf-card.css +24 -0
- package/pf-card/pf-card.d.ts +1 -38
- package/pf-card/pf-card.js +248 -2
- package/pf-card/pf-card.js.map +1 -1
- package/pf-chip/pf-chip-group.css +15 -0
- package/pf-chip/pf-chip-group.d.ts +0 -15
- package/pf-chip/pf-chip-group.js +111 -2
- package/pf-chip/pf-chip-group.js.map +1 -1
- package/pf-chip/pf-chip.css +30 -1
- package/pf-chip/pf-chip.d.ts +1 -20
- package/pf-chip/pf-chip.js +135 -2
- package/pf-chip/pf-chip.js.map +1 -1
- package/pf-clipboard-copy/pf-clipboard-copy.css +25 -0
- package/pf-clipboard-copy/pf-clipboard-copy.d.ts +1 -27
- package/pf-clipboard-copy/pf-clipboard-copy.js +318 -3
- package/pf-clipboard-copy/pf-clipboard-copy.js.map +1 -1
- package/pf-code-block/pf-code-block.css +11 -1
- package/pf-code-block/pf-code-block.js +70 -18
- package/pf-code-block/pf-code-block.js.map +1 -1
- package/pf-dropdown/pf-dropdown-group.js +40 -2
- package/pf-dropdown/pf-dropdown-group.js.map +1 -1
- package/pf-dropdown/pf-dropdown-item.css +10 -0
- package/pf-dropdown/pf-dropdown-item.d.ts +0 -27
- package/pf-dropdown/pf-dropdown-item.js +155 -2
- package/pf-dropdown/pf-dropdown-item.js.map +1 -1
- package/pf-dropdown/pf-dropdown-menu.js +39 -2
- package/pf-dropdown/pf-dropdown-menu.js.map +1 -1
- package/pf-dropdown/pf-dropdown.css +13 -1
- package/pf-dropdown/pf-dropdown.d.ts +1 -9
- package/pf-dropdown/pf-dropdown.js +357 -2
- package/pf-dropdown/pf-dropdown.js.map +1 -1
- package/pf-helper-text/pf-helper-text.css +35 -0
- package/pf-helper-text/pf-helper-text.d.ts +41 -0
- package/pf-helper-text/pf-helper-text.js +107 -0
- package/pf-helper-text/pf-helper-text.js.map +1 -0
- package/pf-helper-text/test/pf-helper-text.e2e.d.ts +1 -0
- package/pf-helper-text/test/pf-helper-text.e2e.js +23 -0
- package/pf-helper-text/test/pf-helper-text.e2e.js.map +1 -0
- package/pf-helper-text/test/pf-helper-text.spec.d.ts +1 -0
- package/pf-helper-text/test/pf-helper-text.spec.js +57 -0
- package/pf-helper-text/test/pf-helper-text.spec.js.map +1 -0
- package/pf-hint/pf-hint.css +120 -0
- package/pf-hint/pf-hint.d.ts +19 -0
- package/pf-hint/pf-hint.js +180 -0
- package/pf-hint/pf-hint.js.map +1 -0
- package/pf-hint/test/pf-hint.e2e.d.ts +1 -0
- package/pf-hint/test/pf-hint.e2e.js +23 -0
- package/pf-hint/test/pf-hint.e2e.js.map +1 -0
- package/pf-hint/test/pf-hint.spec.d.ts +1 -0
- package/pf-hint/test/pf-hint.spec.js +87 -0
- package/pf-hint/test/pf-hint.spec.js.map +1 -0
- package/pf-icon/pf-icon.css +1 -0
- package/pf-icon/pf-icon.d.ts +1 -3
- package/pf-icon/pf-icon.js +44 -4
- package/pf-icon/pf-icon.js.map +1 -1
- package/pf-jump-links/pf-jump-links-item.css +7 -1
- package/pf-jump-links/pf-jump-links-item.d.ts +0 -8
- package/pf-jump-links/pf-jump-links-item.js +77 -2
- package/pf-jump-links/pf-jump-links-item.js.map +1 -1
- package/pf-jump-links/pf-jump-links-list.css +3 -0
- package/pf-jump-links/pf-jump-links-list.d.ts +0 -5
- package/pf-jump-links/pf-jump-links-list.js +20 -2
- package/pf-jump-links/pf-jump-links-list.js.map +1 -1
- package/pf-jump-links/pf-jump-links.css +36 -0
- package/pf-jump-links/pf-jump-links.d.ts +1 -38
- package/pf-jump-links/pf-jump-links.js +179 -2
- package/pf-jump-links/pf-jump-links.js.map +1 -1
- package/pf-label/pf-label.css +51 -1
- package/pf-label/pf-label.d.ts +1 -58
- package/pf-label/pf-label.js +257 -2
- package/pf-label/pf-label.js.map +1 -1
- package/pf-modal/pf-modal.css +11 -0
- package/pf-modal/pf-modal.d.ts +2 -25
- package/pf-modal/pf-modal.js +215 -2
- package/pf-modal/pf-modal.js.map +1 -1
- package/pf-panel/pf-panel.css +29 -0
- package/pf-panel/pf-panel.d.ts +1 -32
- package/pf-panel/pf-panel.js +204 -2
- package/pf-panel/pf-panel.js.map +1 -1
- package/pf-popover/pf-popover.css +33 -0
- package/pf-popover/pf-popover.d.ts +1 -108
- package/pf-popover/pf-popover.js +251 -3
- package/pf-popover/pf-popover.js.map +1 -1
- package/pf-progress/pf-progress.css +19 -0
- package/pf-progress/pf-progress.d.ts +1 -57
- package/pf-progress/pf-progress.js +231 -2
- package/pf-progress/pf-progress.js.map +1 -1
- package/pf-progress-stepper/pf-progress-step.js +126 -2
- package/pf-progress-stepper/pf-progress-step.js.map +1 -1
- package/pf-progress-stepper/pf-progress-stepper.css +96 -0
- package/pf-progress-stepper/pf-progress-stepper.d.ts +1 -115
- package/pf-progress-stepper/pf-progress-stepper.js +326 -2
- package/pf-progress-stepper/pf-progress-stepper.js.map +1 -1
- package/pf-search-input/pf-search-input.css +308 -0
- package/pf-search-input/pf-search-input.d.ts +75 -0
- package/pf-search-input/pf-search-input.js +630 -0
- package/pf-search-input/pf-search-input.js.map +1 -0
- package/pf-search-input/test/pf-search-input.e2e.d.ts +1 -0
- package/pf-search-input/test/pf-search-input.e2e.js +23 -0
- package/pf-search-input/test/pf-search-input.e2e.js.map +1 -0
- package/pf-search-input/test/pf-search-input.spec.d.ts +1 -0
- package/pf-search-input/test/pf-search-input.spec.js +1021 -0
- package/pf-search-input/test/pf-search-input.spec.js.map +1 -0
- package/pf-select/pf-option-group.js +27 -2
- package/pf-select/pf-option-group.js.map +1 -1
- package/pf-select/pf-option.css +9 -1
- package/pf-select/pf-option.js +83 -2
- package/pf-select/pf-option.js.map +1 -1
- package/pf-select/pf-select.css +157 -0
- package/pf-select/pf-select.d.ts +1 -158
- package/pf-select/pf-select.js +542 -5
- package/pf-select/pf-select.js.map +1 -1
- package/pf-spinner/pf-spinner.css +13 -0
- package/pf-spinner/pf-spinner.d.ts +1 -14
- package/pf-spinner/pf-spinner.js +101 -2
- package/pf-spinner/pf-spinner.js.map +1 -1
- package/pf-switch/pf-switch.css +22 -0
- package/pf-switch/pf-switch.d.ts +1 -30
- package/pf-switch/pf-switch.js +156 -2
- package/pf-switch/pf-switch.js.map +1 -1
- package/pf-table/pf-caption.js +10 -2
- package/pf-table/pf-caption.js.map +1 -1
- package/pf-table/pf-table.css +211 -0
- package/pf-table/pf-table.d.ts +1 -635
- package/pf-table/pf-table.js +437 -2
- package/pf-table/pf-table.js.map +1 -1
- package/pf-table/pf-tbody.js +18 -2
- package/pf-table/pf-tbody.js.map +1 -1
- package/pf-table/pf-td.js +107 -2
- package/pf-table/pf-td.js.map +1 -1
- package/pf-table/pf-th.js +95 -2
- package/pf-table/pf-th.js.map +1 -1
- package/pf-table/pf-thead.js +20 -2
- package/pf-table/pf-thead.js.map +1 -1
- package/pf-table/pf-tr.js +89 -2
- package/pf-table/pf-tr.js.map +1 -1
- package/pf-tabs/pf-tab-panel.css +1 -0
- package/pf-tabs/pf-tab-panel.d.ts +0 -2
- package/pf-tabs/pf-tab-panel.js +19 -3
- package/pf-tabs/pf-tab-panel.js.map +1 -1
- package/pf-tabs/pf-tab.css +33 -0
- package/pf-tabs/pf-tab.d.ts +0 -40
- package/pf-tabs/pf-tab.js +231 -2
- package/pf-tabs/pf-tab.js.map +1 -1
- package/pf-tabs/pf-tabs.css +26 -0
- package/pf-tabs/pf-tabs.d.ts +1 -34
- package/pf-tabs/pf-tabs.js +307 -2
- package/pf-tabs/pf-tabs.js.map +1 -1
- package/pf-text-area/pf-text-area.css +125 -0
- package/pf-text-area/pf-text-area.d.ts +1 -125
- package/pf-text-area/pf-text-area.js +320 -2
- package/pf-text-area/pf-text-area.js.map +1 -1
- package/pf-text-input/pf-text-input.css +126 -0
- package/pf-text-input/pf-text-input.d.ts +1 -126
- package/pf-text-input/pf-text-input.js +395 -2
- package/pf-text-input/pf-text-input.js.map +1 -1
- package/pf-tile/pf-tile.css +28 -8
- package/pf-tile/pf-tile.d.ts +1 -24
- package/pf-tile/pf-tile.js +156 -2
- package/pf-tile/pf-tile.js.map +1 -1
- package/pf-timestamp/pf-timestamp.d.ts +1 -0
- package/pf-timestamp/pf-timestamp.js +10 -2
- package/pf-timestamp/pf-timestamp.js.map +1 -1
- package/pf-tooltip/pf-tooltip.css +10 -0
- package/pf-tooltip/pf-tooltip.d.ts +1 -79
- package/pf-tooltip/pf-tooltip.js +113 -3
- package/pf-tooltip/pf-tooltip.js.map +1 -1
- package/pfe.min.js +0 -7439
- package/pfe.min.js.LEGAL.txt +0 -57
- package/pfe.min.js.map +0 -7
- package/react/pf-accordion/pf-accordion-header.d.ts +0 -5
- package/react/pf-accordion/pf-accordion-header.js +0 -12
- package/react/pf-accordion/pf-accordion-panel.d.ts +0 -5
- package/react/pf-accordion/pf-accordion-panel.js +0 -10
- package/react/pf-accordion/pf-accordion.d.ts +0 -5
- package/react/pf-accordion/pf-accordion.js +0 -13
- package/react/pf-avatar/pf-avatar.d.ts +0 -5
- package/react/pf-avatar/pf-avatar.js +0 -12
- package/react/pf-back-to-top/pf-back-to-top.d.ts +0 -5
- package/react/pf-back-to-top/pf-back-to-top.js +0 -10
- package/react/pf-background-image/pf-background-image.d.ts +0 -5
- package/react/pf-background-image/pf-background-image.js +0 -10
- package/react/pf-badge/pf-badge.d.ts +0 -5
- package/react/pf-badge/pf-badge.js +0 -10
- package/react/pf-banner/pf-banner.d.ts +0 -5
- package/react/pf-banner/pf-banner.js +0 -10
- package/react/pf-button/pf-button.d.ts +0 -5
- package/react/pf-button/pf-button.js +0 -12
- package/react/pf-card/pf-card.d.ts +0 -5
- package/react/pf-card/pf-card.js +0 -10
- package/react/pf-chip/pf-chip-group.d.ts +0 -5
- package/react/pf-chip/pf-chip-group.js +0 -13
- package/react/pf-chip/pf-chip.d.ts +0 -5
- package/react/pf-chip/pf-chip.js +0 -13
- package/react/pf-clipboard-copy/pf-clipboard-copy.d.ts +0 -5
- package/react/pf-clipboard-copy/pf-clipboard-copy.js +0 -12
- package/react/pf-code-block/pf-code-block.d.ts +0 -5
- package/react/pf-code-block/pf-code-block.js +0 -10
- package/react/pf-dropdown/pf-dropdown-group.d.ts +0 -5
- package/react/pf-dropdown/pf-dropdown-group.js +0 -10
- package/react/pf-dropdown/pf-dropdown-item.d.ts +0 -5
- package/react/pf-dropdown/pf-dropdown-item.js +0 -10
- package/react/pf-dropdown/pf-dropdown-menu.d.ts +0 -5
- package/react/pf-dropdown/pf-dropdown-menu.js +0 -10
- package/react/pf-dropdown/pf-dropdown.d.ts +0 -5
- package/react/pf-dropdown/pf-dropdown.js +0 -14
- package/react/pf-icon/pf-icon.d.ts +0 -5
- package/react/pf-icon/pf-icon.js +0 -13
- package/react/pf-jump-links/pf-jump-links-item.d.ts +0 -5
- package/react/pf-jump-links/pf-jump-links-item.js +0 -13
- package/react/pf-jump-links/pf-jump-links-list.d.ts +0 -5
- package/react/pf-jump-links/pf-jump-links-list.js +0 -10
- package/react/pf-jump-links/pf-jump-links.d.ts +0 -5
- package/react/pf-jump-links/pf-jump-links.js +0 -12
- package/react/pf-label/pf-label.d.ts +0 -5
- package/react/pf-label/pf-label.js +0 -12
- package/react/pf-modal/pf-modal.d.ts +0 -5
- package/react/pf-modal/pf-modal.js +0 -13
- package/react/pf-panel/pf-panel.d.ts +0 -5
- package/react/pf-panel/pf-panel.js +0 -10
- package/react/pf-popover/pf-popover.d.ts +0 -5
- package/react/pf-popover/pf-popover.js +0 -10
- package/react/pf-progress/pf-progress.d.ts +0 -5
- package/react/pf-progress/pf-progress.js +0 -10
- package/react/pf-progress-stepper/pf-progress-step.d.ts +0 -5
- package/react/pf-progress-stepper/pf-progress-step.js +0 -10
- package/react/pf-progress-stepper/pf-progress-stepper.d.ts +0 -5
- package/react/pf-progress-stepper/pf-progress-stepper.js +0 -10
- package/react/pf-select/pf-option-group.d.ts +0 -5
- package/react/pf-select/pf-option-group.js +0 -10
- package/react/pf-select/pf-option.d.ts +0 -5
- package/react/pf-select/pf-option.js +0 -10
- package/react/pf-select/pf-select.d.ts +0 -5
- package/react/pf-select/pf-select.js +0 -13
- package/react/pf-spinner/pf-spinner.d.ts +0 -5
- package/react/pf-spinner/pf-spinner.js +0 -10
- package/react/pf-switch/pf-switch.d.ts +0 -5
- package/react/pf-switch/pf-switch.js +0 -12
- package/react/pf-table/pf-caption.d.ts +0 -5
- package/react/pf-table/pf-caption.js +0 -10
- package/react/pf-table/pf-table.d.ts +0 -5
- package/react/pf-table/pf-table.js +0 -10
- package/react/pf-table/pf-tbody.d.ts +0 -5
- package/react/pf-table/pf-tbody.js +0 -10
- package/react/pf-table/pf-td.d.ts +0 -5
- package/react/pf-table/pf-td.js +0 -10
- package/react/pf-table/pf-th.d.ts +0 -5
- package/react/pf-table/pf-th.js +0 -10
- package/react/pf-table/pf-thead.d.ts +0 -5
- package/react/pf-table/pf-thead.js +0 -10
- package/react/pf-table/pf-tr.d.ts +0 -5
- package/react/pf-table/pf-tr.js +0 -10
- package/react/pf-tabs/pf-tab-panel.d.ts +0 -5
- package/react/pf-tabs/pf-tab-panel.js +0 -10
- package/react/pf-tabs/pf-tab.d.ts +0 -5
- package/react/pf-tabs/pf-tab.js +0 -12
- package/react/pf-tabs/pf-tabs.d.ts +0 -5
- package/react/pf-tabs/pf-tabs.js +0 -10
- package/react/pf-text-area/pf-text-area.d.ts +0 -5
- package/react/pf-text-area/pf-text-area.js +0 -10
- package/react/pf-text-input/pf-text-input.d.ts +0 -5
- package/react/pf-text-input/pf-text-input.js +0 -10
- package/react/pf-tile/pf-tile.d.ts +0 -5
- package/react/pf-tile/pf-tile.js +0 -10
- package/react/pf-timestamp/pf-timestamp.d.ts +0 -5
- package/react/pf-timestamp/pf-timestamp.js +0 -10
- package/react/pf-tooltip/pf-tooltip.d.ts +0 -5
- package/react/pf-tooltip/pf-tooltip.js +0 -10
package/pf-label/pf-label.js
CHANGED
|
@@ -7,7 +7,255 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
7
7
|
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
|
|
8
8
|
import '@patternfly/elements/pf-button/pf-button.js';
|
|
9
9
|
import { css } from "lit";
|
|
10
|
-
const styles = css `:host {
|
|
10
|
+
const styles = css `:host {
|
|
11
|
+
position: relative;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
border: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
pf-icon, ::slotted(pf-icon) {
|
|
17
|
+
color: currentColor;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host,
|
|
21
|
+
#container {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
vertical-align: middle;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#container {
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
text-overflow: ellipsis;
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
border-width: 0;
|
|
32
|
+
/** label top padding */
|
|
33
|
+
padding-top: var(--pf-c-label--PaddingTop, var(--pf-global--spacer--xs, 0.25rem));
|
|
34
|
+
/** label left padding */
|
|
35
|
+
padding-left: var(--pf-c-label--PaddingLeft, var(--pf-global--spacer--sm, 0.5rem));
|
|
36
|
+
/** label bottom padding */
|
|
37
|
+
padding-bottom: var(--pf-c-label--PaddingBottom, var(--pf-global--spacer--xs, 0.25rem));
|
|
38
|
+
/** label right padding */
|
|
39
|
+
padding-right: var(--pf-c-label--PaddingRight, var(--pf-global--spacer--sm, 0.5rem));
|
|
40
|
+
/** label font size */
|
|
41
|
+
font-size: var(--pf-c-label--FontSize, var(--pf-global--FontSize--sm, 0.875rem));
|
|
42
|
+
/** label text color */
|
|
43
|
+
color: var(--pf-c-label--Color, var(--pf-global--Color--100, #151515));
|
|
44
|
+
/** label background color */
|
|
45
|
+
background-color: var(--pf-c-label--BackgroundColor, var(--pf-global--palette--black-150, #f5f5f5));
|
|
46
|
+
/** label border radius */
|
|
47
|
+
border-radius: var(--pf-c-label--BorderRadius, 30em);
|
|
48
|
+
/** label content max width */
|
|
49
|
+
max-width: var(--pf-c-label__content--MaxWidth, 100%);
|
|
50
|
+
/** label content text color */
|
|
51
|
+
color: var(--pf-c-label__content--Color, var(--pf-global--Color--100, #151515));
|
|
52
|
+
|
|
53
|
+
--pf-global--icon--FontSize--sm: 14px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
#container::before {
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 0;
|
|
59
|
+
right: 0;
|
|
60
|
+
bottom: 0;
|
|
61
|
+
left: 0;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
content: "";
|
|
64
|
+
border-radius: var(--pf-c-label--BorderRadius, 30em);
|
|
65
|
+
/** label content border width and color */
|
|
66
|
+
border: var(--pf-c-label__content--before--BorderWidth, 1px) solid var(--pf-c-label__content--before--BorderColor, var(--pf-global--palette--black-300, #d2d2d2));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[part=icon] {
|
|
70
|
+
display: none;
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.hasIcon [part=icon] {
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
width: 1em;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.compact {
|
|
80
|
+
/** compact label top padding */
|
|
81
|
+
--pf-c-label--PaddingTop: var(--pf-c-label--m-compact--PaddingTop, 0);
|
|
82
|
+
/** compact label right padding */
|
|
83
|
+
--pf-c-label--PaddingRight: var(--pf-c-label--m-compact--PaddingRight, var(--pf-global--spacer--sm, 0.5rem));
|
|
84
|
+
/** compact label bottom padding */
|
|
85
|
+
--pf-c-label--PaddingBottom: var(--pf-c-label--m-compact--PaddingBottom, 0);
|
|
86
|
+
/** compact label left padding */
|
|
87
|
+
--pf-c-label--PaddingLeft: var(--pf-c-label--m-compact--PaddingLeft, var(--pf-global--spacer--sm, 0.5rem));
|
|
88
|
+
--pf-global--icon--FontSize--sm: 12px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.blue {
|
|
92
|
+
/** blue label content text color */
|
|
93
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-blue__content--Color, var(--pf-global--info-color--200, #002952));
|
|
94
|
+
/** blue label background color */
|
|
95
|
+
--pf-c-label--BackgroundColor: var(--pf-c-label--m-blue--BackgroundColor, var(--pf-global--palette--blue-50, #e7f1fa));
|
|
96
|
+
/** blue label content border color */
|
|
97
|
+
--pf-c-label__content--before--BorderColor: var(--pf-c-label--m-blue__content--before--BorderColor, var(--pf-global--palette--blue-100, #bee1f4));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.blue.outline {
|
|
101
|
+
/** outline blue label content text color */
|
|
102
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-outline__content--Color, var(--pf-c-label--m-outline--m-blue__content--Color, var(--pf-global--primary-color--100, #06c)));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.cyan {
|
|
106
|
+
/** cyan label content text color */
|
|
107
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-cyan__content--Color, var(--pf-global--default-color--300, #003737));
|
|
108
|
+
/** cyan label background color */
|
|
109
|
+
--pf-c-label--BackgroundColor: var(--pf-c-label--m-cyan--BackgroundColor, var(--pf-global--palette--cyan-50, #f2f9f9));
|
|
110
|
+
/** cyan label content border color */
|
|
111
|
+
--pf-c-label__content--before--BorderColor: var(--pf-c-label--m-cyan__content--before--BorderColor, var(--pf-global--palette--cyan-100, #a2d9d9));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.cyan.outline {
|
|
115
|
+
/** outline cyan label content text color */
|
|
116
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-outline__content--Color, var(--pf-c-label--m-outline--m-cyan__content--Color, var(--pf-global--palette--cyan-400, #005f60)))
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.green {
|
|
120
|
+
/** green label content text color */
|
|
121
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-green__content--Color,var(--pf-global--success-color--200, #1e4f18));
|
|
122
|
+
/** green label background color */
|
|
123
|
+
--pf-c-label--BackgroundColor: var(--pf-c-label--m-green--BackgroundColor, var(--pf-global--palette--green-50, #f3faf2));
|
|
124
|
+
/** green label content border color */
|
|
125
|
+
--pf-c-label__content--before--BorderColor: var(--pf-c-label--m-green__content--before--BorderColor, var(--pf-global--palette--green-100, #bde5b8));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.green.outline{
|
|
129
|
+
/** outline green label content text color */
|
|
130
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-outline__content--Color, var(--pf-c-label--m-outline--m-green__content--Color, var(--pf-global--success-color--100, #3e8635)))
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.orange {
|
|
134
|
+
/** orange label content text color */
|
|
135
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-orange__content--Color, var(--pf-global--palette--orange-700, #3b1f00));
|
|
136
|
+
/** orange label background color */
|
|
137
|
+
--pf-c-label--BackgroundColor: var(--pf-c-label--m-orange--BackgroundColor, var(--pf-global--palette--orange-50, #fff6ec));
|
|
138
|
+
/** orange label content border color */
|
|
139
|
+
--pf-c-label__content--before--BorderColor: var(--pf-c-label--m-orange__content--before--BorderColor, var(--pf-global--palette--orange-100, #f4b678));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.orange.outline {
|
|
143
|
+
/** outline orange label content text color */
|
|
144
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-outline__content--Color, var(--pf-c-label--m-outline--m-orange__content--Color, var(--pf-global--palette--orange-500, #8f4700)))
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.purple {
|
|
148
|
+
/** purple label content text color */
|
|
149
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-purple__content--Color, var(--pf-global--palette--purple-700, #1f0066));
|
|
150
|
+
/** purple label background color */
|
|
151
|
+
--pf-c-label--BackgroundColor: var(--pf-c-label--m-purple--BackgroundColor, var(--pf-global--palette--purple-50, #f2f0fc));
|
|
152
|
+
/** purple label content border color */
|
|
153
|
+
--pf-c-label__content--before--BorderColor: var(--pf-c-label--m-purple__content--before--BorderColor, var(--pf-global--palette--purple-100, #cbc1ff));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.purple.outline {
|
|
157
|
+
/** outline purple label content text color */
|
|
158
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-outline__content--Color, var(--pf-c-label--m-outline--m-purple__content--Color, var(--pf-global--palette--purple-500, #6753ac)))
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.red {
|
|
162
|
+
/** red label content text color */
|
|
163
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-red__content--Color, var(--pf-global--palette--red-300, #7d1007));
|
|
164
|
+
/** red label background color */
|
|
165
|
+
--pf-c-label--BackgroundColor: var(--pf-c-label--m-red--BackgroundColor, var(--pf-global--palette--red-50, #faeae8));
|
|
166
|
+
/** red label content border color */
|
|
167
|
+
--pf-c-label__content--before--BorderColor: var(--pf-c-label--m-red__content--before--BorderColor, var(--pf-global--palette--red-100, #c9190b));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.red.outline {
|
|
171
|
+
/** outline red label content text color */
|
|
172
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-outline__content--Color, var(--pf-c-label--m-outline--m-red__content--Color, var(--pf-global--danger-color--100, #c9190b)))
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.gold {
|
|
176
|
+
/** gold label content text color */
|
|
177
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-gold__content--Color, var(--pf-global--palette--gold-700, #3d2c00));
|
|
178
|
+
/** gold label background color */
|
|
179
|
+
--pf-c-label--BackgroundColor: var(--pf-c-label--m-gold--BackgroundColor, var(--pf-global--palette--gold-50, #fdf7e7));
|
|
180
|
+
/** gold label content border color */
|
|
181
|
+
--pf-c-label__content--before--BorderColor: var(--pf-c-label--m-gold__content--before--BorderColor, var(--pf-global--palette--gold-100, #f9e0a2));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.gold.outline {
|
|
185
|
+
/** outline gold label content text color */
|
|
186
|
+
--pf-c-label__content--Color: var(--pf-c-label--m-outline__content--Color, var(--pf-c-label--m-outline--m-gold__content--Color, var(--pf-global--palette--gold-600, #795600)))
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.outline {
|
|
190
|
+
/** outline label background color */
|
|
191
|
+
--pf-c-label--BackgroundColor: var(--pf-c-label--m-outline--BackgroundColor, #ffffff);
|
|
192
|
+
--pf-c-label__content--before--BorderColor: var(--pf-global--palette--black-300, #d2d2d2);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.hasIcon [part=icon] {
|
|
196
|
+
left: var(--pf-c-label--PaddingLeft, var(--pf-global--spacer--md, 1rem));
|
|
197
|
+
margin-inline-end: var(--pf-c-label__icon--MarginRight, var(--pf-global--spacer--xs, 0.25rem));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.blue .hasIcon [part=icon] {
|
|
201
|
+
/** blue label icon color */
|
|
202
|
+
color: var(--pf-c-label__icon--Color, var(--pf-c-label--m-blue__icon--Color, var(--pf-global--primary-color--100, #06c)));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.cyan .hasIcon [part=icon] {
|
|
206
|
+
/** cyan label icon color */
|
|
207
|
+
color: var(--pf-c-label__icon--Color, var(--pf-c-label--m-cyan__icon--Color, var(--pf-global--default-color--200, #009596)));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.green .hasIcon [part=icon] {
|
|
211
|
+
/** green label icon color */
|
|
212
|
+
color: var(--pf-c-label__icon--Color, var(--pf-c-label--m-green__icon--Color, var(--pf-global--success-color--100, #3e8635)));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.orange .hasIcon [part=icon] {
|
|
216
|
+
/** orange label icon color */
|
|
217
|
+
color: var(--pf-c-label__icon--Color, var(--pf-c-label--m-orange__icon--Color, var(--pf-global--palette--orange-300, #ec7a08)));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.purple .hasIcon [part=icon] {
|
|
221
|
+
/** purple label icon color */
|
|
222
|
+
color: var(--pf-c-label__icon--Color, var(--pf-c-label--m-purple__icon--Color, var(--pf-global--palette--purple-500, #6753ac)));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.red .hasIcon [part=icon] {
|
|
226
|
+
/** red label icon color */
|
|
227
|
+
color: var(--pf-c-label__icon--Color, var(--pf-c-label--m-red__icon--Color, var(--pf-global--danger-color--100, #c9190b)));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.gold .hasIcon [part=icon] {
|
|
231
|
+
/** gold label icon color */
|
|
232
|
+
color: var(--pf-c-label__icon--Color, var(--pf-c-label--m-gold__icon--Color, var(--pf-global--palette--gold-400, #f0ab00)));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
pf-button {
|
|
236
|
+
--pf-c-button--FontSize: var(--pf-c-label__c-button--FontSize,
|
|
237
|
+
var(--pf-global--FontSize--xs, 0.75rem));
|
|
238
|
+
--pf-c-button--PaddingTop: var(--pf-c-label__c-button--PaddingTop,
|
|
239
|
+
var(--pf-global--spacer--xs, 0.25rem));
|
|
240
|
+
--pf-c-button--PaddingRight: var(--pf-c-label__c-button--PaddingRight,
|
|
241
|
+
var(--pf-global--spacer--sm, 0.5rem));
|
|
242
|
+
--pf-c-button--PaddingBottom: var(--pf-c-label__c-button--PaddingBottom,
|
|
243
|
+
var(--pf-global--spacer--xs, 0.25rem));
|
|
244
|
+
--pf-c-button--PaddingLeft: var(--pf-c-label__c-button--PaddingLeft,
|
|
245
|
+
var(--pf-global--spacer--sm, 0.5rem));
|
|
246
|
+
margin-top: var(--pf-c-label__c-button--MarginTop, -0.5rem);
|
|
247
|
+
margin-right: var(--pf-c-label__c-button--MarginRight, -0.5rem);
|
|
248
|
+
margin-bottom: var(--pf-c-label__c-button--MarginBottom, -0.5rem);
|
|
249
|
+
margin-left: var(--pf-c-label__c-button--MarginLeft, 0.25rem);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
svg {
|
|
253
|
+
vertical-align:-0.125em;
|
|
254
|
+
fill: currentColor;
|
|
255
|
+
height: 1em;
|
|
256
|
+
width: 1em;
|
|
257
|
+
}
|
|
258
|
+
`;
|
|
11
259
|
export class LabelCloseEvent extends Event {
|
|
12
260
|
constructor() {
|
|
13
261
|
super('close', { bubbles: true, cancelable: true });
|
|
@@ -49,12 +297,19 @@ let PfLabel = class PfLabel extends LitElement {
|
|
|
49
297
|
[variant ?? '']: !!variant,
|
|
50
298
|
[color ?? '']: !!color
|
|
51
299
|
})}">
|
|
300
|
+
<!-- slot:
|
|
301
|
+
summary: Contains the labels's icon, e.g. web-icon-alert-success.
|
|
302
|
+
part:
|
|
303
|
+
summary: container for the label icon
|
|
304
|
+
-->
|
|
52
305
|
<slot name="icon" part="icon">
|
|
53
306
|
<pf-icon ?hidden="${!icon}"
|
|
54
307
|
size="sm"
|
|
55
308
|
.icon="${this.icon || undefined}"></pf-icon>
|
|
56
309
|
</slot>
|
|
310
|
+
<!-- summary: Must contain the text for the label. -->
|
|
57
311
|
<slot id="text"></slot>
|
|
312
|
+
<!-- summary: container for removable labels' close button -->
|
|
58
313
|
<span part="close-button" ?hidden=${!this.removable}>
|
|
59
314
|
<pf-button plain
|
|
60
315
|
@click="${__classPrivateFieldGet(this, _PfLabel_instances, "m", _PfLabel_onClickClose)}"
|
|
@@ -80,7 +335,7 @@ PfLabel.shadowRootOptions = {
|
|
|
80
335
|
...LitElement.shadowRootOptions,
|
|
81
336
|
delegatesFocus: true,
|
|
82
337
|
};
|
|
83
|
-
PfLabel.version = "4.
|
|
338
|
+
PfLabel.version = "4.3.0";
|
|
84
339
|
__decorate([
|
|
85
340
|
property()
|
|
86
341
|
], PfLabel.prototype, "variant", void 0);
|
package/pf-label/pf-label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pf-label.js","sourceRoot":"","sources":["pf-label.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAErF,OAAO,6CAA6C,CAAC
|
|
1
|
+
{"version":3,"file":"pf-label.js","sourceRoot":"","sources":["pf-label.ts"],"names":[],"mappings":"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","sourcesContent":["import { LitElement, html, type TemplateResult } from 'lit';\nimport { customElement } from 'lit/decorators/custom-element.js';\nimport { property } from 'lit/decorators/property.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nimport { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';\n\nimport '@patternfly/elements/pf-button/pf-button.js';\n\nimport styles from './pf-label.css';\n\nexport class LabelCloseEvent extends Event {\n constructor() {\n super('close', { bubbles: true, cancelable: true });\n }\n}\n\n/**\n * The **label** component allows users to add specific element captions for user\n * clarity and convenience.\n * @summary Allows users to display meta data in a stylized form.\n * @alias Label\n * @fires {LabelCloseEvent} close - when a removable label's close button is clicked\n */\n@customElement('pf-label')\nexport class PfLabel extends LitElement {\n static readonly styles: CSSStyleSheet[] = [styles];\n\n static override readonly shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Changes the style of the label.\n * - Filled: Colored background with colored border.\n * - Outline: White background with colored border.\n */\n @property() variant:\n | 'filled'\n | 'outline' = 'filled';\n\n /**\n * Changes the color of the label\n */\n @property() color:\n | 'blue'\n | 'cyan'\n | 'green'\n | 'orange'\n | 'purple'\n | 'red'\n | 'grey'\n | 'gold' = 'grey';\n\n /** Shorthand for the `icon` slot, the value is icon name */\n @property() icon?: string;\n\n /** Flag indicating the label is compact */\n @property({ type: Boolean }) compact = false;\n\n /** Flag indicating the label text should be truncated */\n @property({ type: Boolean }) truncated = false;\n\n /** Flag indicating the label is removable */\n @property({ type: Boolean }) removable = false;\n\n /** Text label for a removable label's close button */\n @property({ attribute: 'close-button-label' }) closeButtonLabel?: string;\n\n /** Represents the state of the anonymous and icon slots */\n #slots = new SlotController(this, null, 'icon');\n\n override render(): TemplateResult<1> {\n const { compact, truncated } = this;\n const { variant, color, icon } = this;\n const hasIcon = !!icon || this.#slots.hasSlotted('icon');\n return html`\n <span id=\"container\"\n class=\"${classMap({\n hasIcon,\n compact,\n truncated,\n [variant ?? '']: !!variant,\n [color ?? '']: !!color })}\">\n <!-- slot:\n summary: Contains the labels's icon, e.g. web-icon-alert-success.\n part:\n summary: container for the label icon\n -->\n <slot name=\"icon\" part=\"icon\">\n <pf-icon ?hidden=\"${!icon}\"\n size=\"sm\"\n .icon=\"${this.icon || undefined as unknown as string}\"></pf-icon>\n </slot>\n <!-- summary: Must contain the text for the label. -->\n <slot id=\"text\"></slot>\n <!-- summary: container for removable labels' close button -->\n <span part=\"close-button\" ?hidden=${!this.removable}>\n <pf-button plain\n @click=\"${this.#onClickClose}\"\n label=\"${this.closeButtonLabel ?? 'remove'}\">\n <svg viewBox=\"0 0 352 512\">\n <path d=\"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\"/>\n </svg>\n </pf-button>\n </span>\n </span>\n `;\n }\n\n #onClickClose() {\n if (this.removable && this.dispatchEvent(new LabelCloseEvent())) {\n this.remove();\n }\n }\n}\n\nexport type LabelVariant = PfLabel['variant'];\n\nexport type LabelColor = PfLabel['color'];\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'pf-label': PfLabel;\n }\n}\n"]}
|
package/pf-modal/pf-modal.css
CHANGED
|
@@ -19,6 +19,7 @@ section {
|
|
|
19
19
|
left: 0;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: center;
|
|
22
|
+
/** Z-index for modal box */
|
|
22
23
|
z-index: var(--pf-c-modal-box--ZIndex,
|
|
23
24
|
var(--pf-global--ZIndex--xl,
|
|
24
25
|
500));
|
|
@@ -44,20 +45,25 @@ section {
|
|
|
44
45
|
position: relative;
|
|
45
46
|
margin: 0 auto;
|
|
46
47
|
|
|
48
|
+
/** Width of modal */
|
|
47
49
|
width: var(--pf-c-modal-box--Width,
|
|
48
50
|
calc(100% - var(--pf-global--spacer--xl,2rem)));
|
|
49
51
|
|
|
52
|
+
/** Max width of modal */
|
|
50
53
|
max-width: var(--pf-c-modal-box--MaxWidth,
|
|
51
54
|
calc(100% - var(--pf-global--spacer--xl,2rem)));
|
|
52
55
|
|
|
56
|
+
/** Max height of modal */
|
|
53
57
|
max-height: var(--pf-c-modal-box--MaxHeight,
|
|
54
58
|
calc(100% - var(--pf-global--spacer--2xl,3rem)));
|
|
55
59
|
|
|
60
|
+
/** Box shadow for modal */
|
|
56
61
|
box-shadow: var(--pf-c-modal-box--BoxShadow,
|
|
57
62
|
var(--pf-global--BoxShadow--xl,
|
|
58
63
|
0 1rem 2rem 0 rgba(3, 3, 3, 0.16),
|
|
59
64
|
0 0 0.5rem 0 rgba(3, 3, 3, 0.1)));
|
|
60
65
|
|
|
66
|
+
/** Background color for modal */
|
|
61
67
|
background-color: var(--pf-c-modal-box--BackgroundColor,
|
|
62
68
|
var(--pf-global--BackgroundColor--100,
|
|
63
69
|
var(--pf-global--BackgroundColor--100, #fff)));
|
|
@@ -73,16 +79,19 @@ section {
|
|
|
73
79
|
|
|
74
80
|
:host([width="small"]) [part=dialog],
|
|
75
81
|
:host([variant="small"]) [part=dialog] {
|
|
82
|
+
/** Max width for small modal */
|
|
76
83
|
--pf-c-modal-box--Width: var(--pf-c-modal-box--m-sm--sm--MaxWidth, 35rem);
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
:host([width="medium"]) [part=dialog],
|
|
80
87
|
:host([variant="medium"]) [part=dialog] {
|
|
88
|
+
/** Max width for medium modal */
|
|
81
89
|
--pf-c-modal-box--Width: var(--pf-c-modal-box--m-md--Width, 52.5rem);
|
|
82
90
|
}
|
|
83
91
|
|
|
84
92
|
:host([width="large"]) [part=dialog],
|
|
85
93
|
:host([variant="large"]) [part=dialog] {
|
|
94
|
+
/** Max width for large modal */
|
|
86
95
|
--pf-c-modal-box--Width: var(--pf-c-modal-box--m-lg--lg--MaxWidth, 70rem);
|
|
87
96
|
}
|
|
88
97
|
|
|
@@ -111,10 +120,12 @@ header {
|
|
|
111
120
|
}
|
|
112
121
|
|
|
113
122
|
header ::slotted(:is(h1,h2,h3,h4,h5,h6)[slot="header"]) {
|
|
123
|
+
/** Font size for modal title */
|
|
114
124
|
font-size: var(--pf-c-modal-box__title--FontSize,
|
|
115
125
|
var(--pf-global--FontSize--2xl,
|
|
116
126
|
1.5rem));
|
|
117
127
|
font-weight: var(--pf-global--FontWeight--normal, 400);
|
|
128
|
+
/** Font family for modal title */
|
|
118
129
|
font-family: var(--pf-c-modal-box__title--FontFamily,
|
|
119
130
|
var(--pf-global--FontFamily--heading--sans-serif,
|
|
120
131
|
var(--pf-global--FontFamily--redhat-updated--heading--sans-serif,
|
package/pf-modal/pf-modal.d.ts
CHANGED
|
@@ -17,34 +17,11 @@ export declare class ModalOpenEvent extends ComposedEvent {
|
|
|
17
17
|
* A **modal** displays important information to a user without requiring them to navigate
|
|
18
18
|
* to a new page.
|
|
19
19
|
* @summary Displays information or helps a user focus on a task
|
|
20
|
-
* @
|
|
21
|
-
* @slot header - The header is an optional slot that appears at the top of the modal window. It should be a header tag (h2-h6).
|
|
22
|
-
* @slot footer - Optional footer content. Good place to put action buttons.
|
|
20
|
+
* @alias Modal
|
|
23
21
|
* @fires {ModalOpenEvent} open - Fires when a user clicks on the trigger or manually opens a modal.
|
|
24
22
|
* @fires {ModalCloseEvent} close - Fires when either a user clicks on either the close button or the overlay or manually closes a modal.
|
|
25
|
-
* @csspart overlay - The modal overlay which lies under the dialog and above the page body
|
|
26
|
-
* @csspart dialog - The dialog element
|
|
27
|
-
* @csspart content - The container for the dialog content
|
|
28
|
-
* @csspart header - The container for the optional dialog header
|
|
29
|
-
* @csspart description - The container for the optional dialog description in the header
|
|
30
|
-
* @csspart close-button - The modal's close button
|
|
31
|
-
* @csspart footer - Actions footer container
|
|
32
|
-
* @cssprop {<length>} [--pf-c-modal-box--ZIndex=500]
|
|
33
|
-
* @cssprop {<length>} [--pf-c-modal-box--Width=calc(100 - 2rem)] - Width of the modal
|
|
34
|
-
* @cssprop {<length>} [--pf-c-modal-box--MaxWidth=calc(100 - 2rem)] - Max width of the modal
|
|
35
|
-
* @cssprop {<length>} [--pf-c-modal-box--m-sm--sm--MaxWidth=35rem] - Max width of the small variant modal
|
|
36
|
-
* @cssprop {<length>} [--pf-c-modal-box--m-md--MaxWidth=52.5rem] - Max width of the small variant modal
|
|
37
|
-
* @cssprop {<length>} [--pf-c-modal-box--m-lg--lg--MaxWidth=70rem] - Max width of the large variant modal
|
|
38
|
-
* @cssprop {<length>} [--pf-c-modal-box--MaxHeight=calc(100 - 3rem)] - Max height of the modal
|
|
39
|
-
* @cssprop {<length>} [--pf-c-modal-box--BoxShadow=var(--pf-global--BoxShadow--xl)] -
|
|
40
|
-
* @cssprop {<length>} [--pf-c-modal-box__title--FontSize=1.5rem] -
|
|
41
|
-
* @cssprop {<length>} [--pf-c-modal-box--m-align-top--MarginTop=2rem] -
|
|
42
|
-
* @cssprop {<length>} --pf-c-modal-box--m-align-top--MaxWidth
|
|
43
|
-
* @cssprop {<length>} --pf-c-modal-box--m-align-top--MaxHeight
|
|
44
|
-
* @cssprop {<color>} [--pf-c-modal-box--BackgroundColor=#fff] -
|
|
45
|
-
* @cssprop --pf-c-modal-box__title--FontFamily - default font family for header-slotted headings
|
|
46
23
|
*/
|
|
47
|
-
export declare class PfModal extends LitElement
|
|
24
|
+
export declare class PfModal extends LitElement {
|
|
48
25
|
#private;
|
|
49
26
|
static readonly shadowRootOptions: ShadowRootInit;
|
|
50
27
|
static readonly styles: CSSStyleSheet[];
|