@getflip/swirl-components 0.150.0 → 0.151.1
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/components.json +17 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-app-layout_6.cjs.entry.js +1 -1
- package/dist/cjs/swirl-badge.cjs.entry.js +2 -2
- package/dist/cjs/swirl-button.cjs.entry.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-shell-layout.cjs.entry.js +1 -1
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-app-layout/swirl-app-layout.js +1 -1
- package/dist/collection/components/swirl-avatar/swirl-avatar.stories.js +1 -0
- package/dist/collection/components/swirl-badge/swirl-badge.css +26 -17
- package/dist/collection/components/swirl-badge/swirl-badge.js +2 -2
- package/dist/collection/components/swirl-badge/swirl-badge.spec.js +1 -1
- package/dist/collection/components/swirl-badge/swirl-badge.stories.js +1 -2
- package/dist/collection/components/swirl-button/swirl-button.css +17 -0
- package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.css +1 -0
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-app-layout2.js +1 -1
- package/dist/components/swirl-badge2.js +10 -4
- package/dist/components/swirl-button2.js +1 -1
- package/dist/components/swirl-shell-layout.js +1 -1
- package/dist/components/swirl-shell-navigation-item.js +8 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-app-layout_6.entry.js +1 -1
- package/dist/esm/swirl-badge.entry.js +3 -3
- package/dist/esm/swirl-button.entry.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-shell-layout.entry.js +1 -1
- package/dist/swirl-components/p-66890b1c.entry.js +1 -0
- package/dist/swirl-components/p-82c90e51.entry.js +1 -0
- package/dist/swirl-components/p-dd853b96.entry.js +1 -0
- package/dist/swirl-components/{p-a1191351.entry.js → p-e2dbda36.entry.js} +1 -1
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/swirl-components/p-041f464a.entry.js +0 -1
- package/dist/swirl-components/p-57f671d6.entry.js +0 -1
- package/dist/swirl-components/p-ca8d79f8.entry.js +0 -1
|
@@ -197,7 +197,7 @@ export class SwirlAppLayout {
|
|
|
197
197
|
"app-layout--sidebar-active": this.mobileView === "sidebar" || this.sidebarActive,
|
|
198
198
|
"app-layout--sidebar-closing": this.sidebarClosing,
|
|
199
199
|
});
|
|
200
|
-
return (h(Host, null, h("section", { "aria-labelledby": "app-name", class: className
|
|
200
|
+
return (h(Host, null, h("section", { "aria-labelledby": "app-name", class: className }, h("div", { class: "app-layout__grid" }, h("header", { class: "app-layout__header" }, h("span", { class: "app-layout__navigation-mobile-menu-button" }, h("slot", { name: "navigation-mobile-menu-button" })), this.showNavigationBackButton && (h("span", { class: "app-layout__navigation-back-button" }, h("swirl-button", { hideLabel: true, icon: "<swirl-icon-arrow-back></swirl-icon-arrow-back>", label: this.navigationBackButtonLabel, onClick: this.onNavigationBackButtonClick }))), h("swirl-heading", { as: "h1", class: "app-layout__app-name", headingId: "app-name", level: 3, text: this.appName }), this.hasNavigation && (h("span", { class: "app-layout__navigation-controls" }, h("slot", { name: "navigation-controls" })))), h("nav", { "aria-label": this.navigationLabel, class: "app-layout__navigation" }, h("slot", { name: "navigation" })), h("section", { "aria-labelledby": "app-name", class: "app-layout__body" }, !this.hideAppBar && (h("header", { class: "app-layout__app-bar" }, h("span", { class: "app-layout__app-bar-mobile-menu-button" }, h("slot", { name: "app-bar-mobile-menu-button" })), showBackToNavigationButton && (h("span", { class: "app-layout__back-to-navigation-button" }, h("swirl-button", { hideLabel: true, icon: this.transitionStyle === "dialog"
|
|
201
201
|
? "<swirl-icon-close></swirl-icon-close>"
|
|
202
202
|
: "<swirl-icon-arrow-back></swirl-icon-arrow-back>", label: this.backToNavigationViewButtonLabel, onClick: this.onBackToNavigationViewButtonClick }))), h("span", { class: "app-layout__custom-app-bar-back-button" }, h("slot", { name: "custom-app-bar-back-button" })), h("div", { class: "app-layout__app-bar-content" }, h("slot", { name: "app-bar" })), h("div", { class: "app-layout__app-bar-controls" }, h("slot", { name: "app-bar-controls" })))), h("div", { class: "app-layout__banner" }, h("slot", { name: "banner" })), h("div", { class: "app-layout__content" }, h("slot", { name: "content" })), h("div", { class: "app-layout__bottom-bar" }, h("slot", { name: "bottom-bar" }))), h("aside", { class: "app-layout__sidebar" }, h("header", { class: "app-layout__custom-sidebar-header" }, h("slot", { name: "custom-sidebar-header" })), h("header", { class: "app-layout__sidebar-header" }, h("swirl-button", { class: "app-layout__sidebar-close-button", hideLabel: true, icon: "<swirl-icon-close></swirl-icon-close>", label: this.sidebarCloseButtonLabel, onClick: this.onSidebarCloseButtonClick }), h("swirl-heading", { as: "h3", class: "app-layout__sidebar-heading", headingId: "sidebar-heading", level: 3, text: this.sidebarHeading })), h("div", { class: "app-layout__sidebar-content" }, h("slot", { name: "sidebar" }))), h("span", { class: "app-layout__floating-action-button" }, this.ctaLabel && (h("swirl-button", { hideLabel: Boolean(this.ctaIcon), icon: this.ctaIcon, intent: "primary", label: this.ctaLabel, onClick: this.onCtaClick, variant: "floating" })), h("slot", { name: "floating-action-button" }))))));
|
|
203
203
|
}
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
max-width: 100%;
|
|
16
16
|
justify-content: center;
|
|
17
17
|
align-items: center;
|
|
18
|
-
box-shadow: 0 0 0 0.125rem var(--swirl-badge-border-color);
|
|
19
18
|
border-radius: 2rem;
|
|
20
19
|
color: var(--s-text-on-status);
|
|
21
20
|
font-size: var(--s-font-size-sm);
|
|
22
21
|
font-weight: var(--s-font-weight-medium);
|
|
22
|
+
box-shadow: 0 0 0 0.125rem var(--swirl-badge-border-color);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.badge--size-xs {
|
|
26
|
-
min-width:
|
|
27
|
-
height:
|
|
26
|
+
min-width: 1rem;
|
|
27
|
+
height: 1rem;
|
|
28
28
|
font-size: 0.6875rem;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.badge--size-xs .badge__label {
|
|
32
|
-
padding-right: 0.
|
|
33
|
-
padding-left: 0.
|
|
32
|
+
padding-right: 0.25rem;
|
|
33
|
+
padding-left: 0.25rem;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.badge--size-xs .badge__icon > swirl-icon,
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.badge--size-s {
|
|
43
|
-
min-width: 1.
|
|
44
|
-
height: 1.
|
|
43
|
+
min-width: 1.25rem;
|
|
44
|
+
height: 1.25rem;
|
|
45
45
|
font-size: 0.75rem;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.badge--size-s .badge__label {
|
|
49
|
-
padding-right: 0.
|
|
50
|
-
padding-left: 0.
|
|
49
|
+
padding-right: 0.375rem;
|
|
50
|
+
padding-left: 0.375rem;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.badge--size-s .badge__icon > swirl-icon,
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.badge--size-m {
|
|
60
|
-
min-width:
|
|
61
|
-
height:
|
|
60
|
+
min-width: 1.5rem;
|
|
61
|
+
height: 1.5rem;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.badge--size-m .badge__label {
|
|
65
|
-
padding-right: 0.
|
|
66
|
-
padding-left: 0.
|
|
65
|
+
padding-right: 0.4375rem;
|
|
66
|
+
padding-left: 0.4375rem;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.badge--has-icon {
|
|
@@ -117,18 +117,27 @@
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.badge--variant-dot {
|
|
120
|
-
width: 1.
|
|
120
|
+
width: 1.5rem;
|
|
121
121
|
min-width: 0;
|
|
122
|
-
height: 1.
|
|
122
|
+
height: 1.5rem;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
.badge--variant-dot.badge--size-xs {
|
|
126
|
+
width: 1rem;
|
|
127
|
+
height: 1rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.badge--variant-dot.badge--size-s {
|
|
131
|
+
width: 1.25rem;
|
|
132
|
+
height: 1.25rem;
|
|
133
|
+
}
|
|
134
|
+
|
|
125
135
|
.badge--variant-dot .badge__label {
|
|
126
136
|
padding-right: 0;
|
|
127
137
|
padding-left: 0;
|
|
128
138
|
}
|
|
129
139
|
|
|
130
|
-
.badge--variant-dot .
|
|
131
|
-
.badge--variant-dot .badge__icon {
|
|
140
|
+
.badge--variant-dot .badge__icon {
|
|
132
141
|
display: none;
|
|
133
142
|
}
|
|
134
143
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classnames from "classnames";
|
|
2
|
-
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { Fragment, h, Host } from "@stencil/core";
|
|
3
3
|
export class SwirlBadge {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.icon = undefined;
|
|
@@ -12,7 +12,7 @@ export class SwirlBadge {
|
|
|
12
12
|
const className = classnames("badge", `badge--intent-${this.intent}`, `badge--size-${this.size}`, `badge--variant-${this.variant}`, {
|
|
13
13
|
"badge--has-icon": this.icon,
|
|
14
14
|
});
|
|
15
|
-
return (h(Host, { role: "status" }, h("span", { class: className, part: "badge" }, this.icon && h("span", { class: "badge__icon", innerHTML: this.icon }), this.icon === undefined && (h("span", { class: "badge__label" }, this.label)))));
|
|
15
|
+
return (h(Host, { role: "status" }, h("span", { class: className, part: "badge" }, this.icon && h("span", { class: "badge__icon", innerHTML: this.icon }), this.icon === undefined && this.variant !== "dot" ? (h("span", { class: "badge__label" }, this.label)) : (h(Fragment, null, this.icon === undefined && (h("span", { class: "badge__label" }, "\u00A0")), h("swirl-visually-hidden", null, this.label))))));
|
|
16
16
|
}
|
|
17
17
|
static get is() { return "swirl-badge"; }
|
|
18
18
|
static get encapsulation() { return "shadow"; }
|
|
@@ -13,7 +13,7 @@ describe("swirl-badge", () => {
|
|
|
13
13
|
components: [SwirlBadge],
|
|
14
14
|
html: `<swirl-badge label="Label" icon="<swirl-icon-close></swirl-icon-close>"></swirl-badge>`,
|
|
15
15
|
});
|
|
16
|
-
expect(page.root.shadowRoot.innerHTML).toMatchInlineSnapshot(`"<span class=\\"badge badge--intent-critical badge--size-m badge--variant-default badge--has-icon\\" part=\\"badge\\"><span class=\\"badge__icon\\"><swirl-icon-close></swirl-icon-close></span></span>"`);
|
|
16
|
+
expect(page.root.shadowRoot.innerHTML).toMatchInlineSnapshot(`"<span class=\\"badge badge--intent-critical badge--size-m badge--variant-default badge--has-icon\\" part=\\"badge\\"><span class=\\"badge__icon\\"><swirl-icon-close></swirl-icon-close></span><swirl-visually-hidden>Label</swirl-visually-hidden></span>"`);
|
|
17
17
|
expect(page.root.querySelector(".badge__icon")).toBeDefined();
|
|
18
18
|
expect(page.root.querySelector(".badge__label")).toBeNull();
|
|
19
19
|
});
|
|
@@ -152,6 +152,23 @@
|
|
|
152
152
|
color: var(--s-icon-on-action-primary);
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
.button--variant-flat.button--intent-critical:not(:disabled) {
|
|
156
|
+
color: var(--s-text-on-status);
|
|
157
|
+
background-color: var(--s-action-critical-default);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.button--variant-flat.button--intent-critical:not(:disabled):hover {
|
|
161
|
+
background-color: var(--s-action-critical-hovered);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.button--variant-flat.button--intent-critical:not(:disabled):active {
|
|
165
|
+
background-color: var(--s-action-critical-pressed);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.button--variant-flat.button--intent-critical:not(:disabled) .button__icon {
|
|
169
|
+
color: var(--s-icon-on-status);
|
|
170
|
+
}
|
|
171
|
+
|
|
155
172
|
.button--variant-flat .button__icon {
|
|
156
173
|
color: var(--s-icon-strong);
|
|
157
174
|
}
|