@getflip/swirl-components 0.101.5 → 0.101.6

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.
@@ -14,6 +14,8 @@
14
14
  min-width: -moz-min-content;
15
15
  min-width: min-content;
16
16
  min-height: 3.5rem;
17
+ padding-right: var(--s-space-16);
18
+ padding-left: var(--s-space-16);
17
19
  align-items: center;
18
20
  gap: var(--s-space-16);
19
21
  }
@@ -22,6 +24,10 @@
22
24
  display: block;
23
25
  }
24
26
 
27
+ .app-bar:not(.app-bar--has-right-controls) .app-bar__right-controls {
28
+ display: none;
29
+ }
30
+
25
31
  .app-bar__left-controls {
26
32
  display: flex;
27
33
  min-width: 0;
@@ -46,8 +46,10 @@ export class SwirlAppBar {
46
46
  }
47
47
  render() {
48
48
  const showLeftControls = this.showBackButton || this.showCloseButton || this.showStepperControls;
49
+ const hasRightControls = Boolean(this.el.querySelector('[slot="right-controls"]'));
49
50
  const className = classnames("app-bar", {
50
51
  "app-bar--has-cta": this.hasCta,
52
+ "app-bar--has-right-controls": hasRightControls,
51
53
  });
52
54
  return (h(Host, null, h("div", { class: className }, showLeftControls && (h("div", { class: "app-bar__left-controls" }, (this.showBackButton || this.showCloseButton) && (h("div", { class: "app-bar__main-navigation-control" }, this.showBackButton && (h("swirl-button", { hideLabel: true, icon: "<swirl-icon-arrow-back></swirl-icon-arrow-back>", label: this.backButtonLabel, onClick: this.onBackButtonClick })), this.showCloseButton && (h("swirl-button", { hideLabel: true, icon: "<swirl-icon-close></swirl-icon-close>", label: this.closeButtonLabel, onClick: this.onCloseButtonClick })))), this.showStepperControls && (h("div", { class: "app-bar__stepper-controls" }, h("swirl-button", { hideLabel: true, icon: "<swirl-icon-arrow-upward></swirl-icon-arrow-upward>", label: this.stepUpButtonLabel, onClick: this.onStepUpButtonClick }), h("swirl-button", { hideLabel: true, icon: "<swirl-icon-arrow-downward></swirl-icon-arrow-downward>", label: this.stepDownButtonLabel, onClick: this.onStepDownButtonClick }))))), h("div", { class: "app-bar__cta" }, h("slot", { name: "cta" })), h("div", { class: "app-bar__heading" }, h("slot", { name: "heading" })), h("div", { class: "app-bar__center-controls" }, h("slot", { name: "center-controls" })), h("div", { class: "app-bar__right-controls" }, h("slot", { name: "right-controls" })))));
53
55
  }
@@ -21,7 +21,7 @@ describe("swirl-app-bar", () => {
21
21
  expect(page.root).toEqualHtml(`
22
22
  <swirl-app-bar>
23
23
  <mock:shadow-root>
24
- <div class="app-bar app-bar--has-cta">
24
+ <div class="app-bar app-bar--has-cta app-bar--has-right-controls">
25
25
  <div class="app-bar__cta">
26
26
  <slot name="cta"></slot>
27
27
  </div>
@@ -322,14 +322,6 @@
322
322
  gap: var(--s-space-8);
323
323
  }
324
324
 
325
- @media (min-width: 768px) {
326
-
327
- .app-layout__app-bar {
328
- padding-right: var(--s-space-16);
329
- padding-left: var(--s-space-16)
330
- }
331
- }
332
-
333
325
  .app-layout__back-to-navigation-button {
334
326
  padding-left: var(--s-space-8);
335
327
  }
@@ -348,16 +340,8 @@
348
340
  .app-layout__app-bar-content {
349
341
  min-width: 0;
350
342
  flex-grow: 1;
351
- padding-right: var(--s-space-8);
352
343
  }
353
344
 
354
- @media (min-width: 768px) {
355
-
356
- .app-layout__app-bar-content {
357
- padding-right: 0
358
- }
359
- }
360
-
361
345
  .app-layout__app-bar-controls {
362
346
  display: none;
363
347
  padding-right: var(--s-space-8);
@@ -366,7 +350,7 @@
366
350
  @media (min-width: 768px) {
367
351
 
368
352
  .app-layout__app-bar-controls {
369
- padding-right: 0
353
+ padding-right: var(--s-space-16)
370
354
  }
371
355
  }
372
356
 
@@ -26,16 +26,16 @@ const Template = (args) => {
26
26
  element.innerHTML = `
27
27
  <swirl-button hide-label="true" icon="<swirl-icon-menu></swirl-icon-menu>" label="Menu" slot="navigation-mobile-menu-button"></swirl-button>
28
28
  <swirl-resource-list label="Items" slot="navigation">
29
- <swirl-resource-list-item description="With a description" label="This is a resource item" class="item"></swirl-resource-list-item>
30
- <swirl-resource-list-item description="With a description" label="This is a resource item" class="item"></swirl-resource-list-item>
31
- <swirl-resource-list-item description="With a description" label="This is a resource item" class="item"></swirl-resource-list-item>
29
+ <swirl-resource-list-item description="With a description" label="This is a resource item" class="item"></swirl-resource-list-item>
30
+ <swirl-resource-list-item description="With a description" label="This is a resource item" class="item"></swirl-resource-list-item>
31
+ <swirl-resource-list-item description="With a description" label="This is a resource item" class="item"></swirl-resource-list-item>
32
32
  </swirl-resource-list>
33
33
  <swirl-button
34
- hide-label
35
- icon="<swirl-icon-settings></swirl-icon-settings>"
36
- label="Settings"
37
- slot="navigation-controls"
38
- ></swirl-button>
34
+ hide-label
35
+ icon="<swirl-icon-settings></swirl-icon-settings>"
36
+ label="Settings"
37
+ slot="navigation-controls"
38
+ ></swirl-button>
39
39
  <swirl-app-bar show-close-button="false" show-stepper-controls="false" slot="app-bar">
40
40
  <swirl-heading as="h2" level="3" slot="heading" text="Heading" truncate=""></swirl-heading>
41
41
  <swirl-stack justify="center" orientation="horizontal" spacing="8" slot="center-controls">