@getflip/swirl-components 0.116.0 → 0.118.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.
Files changed (118) hide show
  1. package/components.json +395 -69
  2. package/dist/cjs/focus-trap.esm-21561e09.js +1145 -0
  3. package/dist/cjs/index-506fe4ea.js +14 -26
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/swirl-app-bar.cjs.entry.js +2 -1
  6. package/dist/cjs/swirl-app-icon.cjs.entry.js +1 -3
  7. package/dist/cjs/swirl-app-layout_6.cjs.entry.js +4 -2
  8. package/dist/cjs/swirl-badge.cjs.entry.js +1 -1
  9. package/dist/cjs/swirl-components.cjs.js +1 -1
  10. package/dist/cjs/swirl-icon-arrow-back_5.cjs.entry.js +87 -0
  11. package/dist/cjs/swirl-icon-check-small_3.cjs.entry.js +7 -2
  12. package/dist/cjs/swirl-icon-dock-left.cjs.entry.js +23 -0
  13. package/dist/cjs/swirl-modal.cjs.entry.js +2 -1143
  14. package/dist/cjs/swirl-shell-layout.cjs.entry.js +87 -75
  15. package/dist/cjs/swirl-shell-navigation-item.cjs.entry.js +1 -1
  16. package/dist/cjs/swirl-visually-hidden.cjs.entry.js +1 -1
  17. package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
  18. package/dist/collection/collection-manifest.json +1 -0
  19. package/dist/collection/components/swirl-app-bar/swirl-app-bar.js +20 -1
  20. package/dist/collection/components/swirl-app-icon/swirl-app-icon.css +3 -22
  21. package/dist/collection/components/swirl-app-icon/swirl-app-icon.js +0 -20
  22. package/dist/collection/components/swirl-app-layout/swirl-app-layout.css +54 -4
  23. package/dist/collection/components/swirl-app-layout/swirl-app-layout.js +4 -1
  24. package/dist/collection/components/swirl-badge/swirl-badge.css +18 -1
  25. package/dist/collection/components/swirl-badge/swirl-badge.js +1 -1
  26. package/dist/collection/components/swirl-icon/icons/swirl-icon-dock-left.js +52 -0
  27. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.css +26 -4
  28. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.js +23 -1
  29. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.spec.js +6 -3
  30. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.css +353 -132
  31. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.js +322 -95
  32. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.spec.js +8 -58
  33. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.stories.js +81 -102
  34. package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.css +46 -35
  35. package/dist/collection/components/swirl-visually-hidden/swirl-visually-hidden.js +1 -1
  36. package/dist/collection/components/swirl-visually-hidden/swirl-visually-hidden.spec.js +0 -3
  37. package/dist/components/assets/images/flip-logo.png +0 -0
  38. package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
  39. package/dist/components/focus-trap.esm.js +1143 -0
  40. package/dist/components/swirl-app-bar.js +3 -1
  41. package/dist/components/swirl-app-icon.js +1 -4
  42. package/dist/components/swirl-app-layout2.js +4 -2
  43. package/dist/components/swirl-badge2.js +1 -1
  44. package/dist/components/swirl-icon-arrow-back.js +1 -35
  45. package/dist/{esm/swirl-icon-arrow-back.entry.js → components/swirl-icon-arrow-back2.js} +26 -8
  46. package/dist/components/swirl-icon-arrow-forward.js +1 -35
  47. package/dist/{esm/swirl-icon-arrow-forward.entry.js → components/swirl-icon-arrow-forward2.js} +26 -8
  48. package/dist/components/swirl-icon-dock-left.d.ts +11 -0
  49. package/dist/components/swirl-icon-dock-left.js +40 -0
  50. package/dist/components/swirl-icon-double-arrow-left.js +1 -35
  51. package/dist/{esm/swirl-icon-double-arrow-left.entry.js → components/swirl-icon-double-arrow-left2.js} +26 -8
  52. package/dist/components/swirl-icon-double-arrow-right.js +1 -35
  53. package/dist/{esm/swirl-icon-double-arrow-right.entry.js → components/swirl-icon-double-arrow-right2.js} +26 -8
  54. package/dist/components/swirl-icon-menu.js +1 -35
  55. package/dist/{esm/swirl-icon-menu.entry.js → components/swirl-icon-menu2.js} +26 -8
  56. package/dist/components/swirl-modal.js +1 -1142
  57. package/dist/components/swirl-option-list-item2.js +8 -2
  58. package/dist/components/swirl-shell-layout.js +150 -89
  59. package/dist/components/swirl-shell-navigation-item.js +1 -1
  60. package/dist/components/swirl-visually-hidden2.js +2 -3
  61. package/dist/esm/focus-trap.esm-37cd2d2b.js +1143 -0
  62. package/dist/esm/index-99d0060d.js +14 -26
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/swirl-app-bar.entry.js +2 -1
  65. package/dist/esm/swirl-app-icon.entry.js +1 -3
  66. package/dist/esm/swirl-app-layout_6.entry.js +4 -2
  67. package/dist/esm/swirl-badge.entry.js +1 -1
  68. package/dist/esm/swirl-components.js +1 -1
  69. package/dist/esm/swirl-icon-arrow-back_5.entry.js +79 -0
  70. package/dist/esm/swirl-icon-check-small_3.entry.js +7 -2
  71. package/dist/esm/swirl-icon-dock-left.entry.js +19 -0
  72. package/dist/esm/swirl-modal.entry.js +1 -1142
  73. package/dist/esm/swirl-shell-layout.entry.js +88 -76
  74. package/dist/esm/swirl-shell-navigation-item.entry.js +1 -1
  75. package/dist/esm/swirl-visually-hidden.entry.js +1 -1
  76. package/dist/swirl-components/p-08fd60a5.entry.js +1 -0
  77. package/dist/swirl-components/p-11c6c9ba.entry.js +1 -0
  78. package/dist/swirl-components/p-25b4973d.entry.js +1 -0
  79. package/dist/swirl-components/p-262771e5.entry.js +1 -0
  80. package/dist/swirl-components/p-3795fbb4.entry.js +1 -0
  81. package/dist/swirl-components/p-40ee5f22.entry.js +1 -0
  82. package/dist/swirl-components/p-488d2a7d.entry.js +1 -0
  83. package/dist/swirl-components/p-4a69e7f3.entry.js +1 -0
  84. package/dist/swirl-components/p-68936168.entry.js +1 -0
  85. package/dist/swirl-components/p-76c36ee9.entry.js +1 -0
  86. package/dist/swirl-components/p-7c4a4b66.entry.js +1 -0
  87. package/dist/swirl-components/p-c2e1dfdb.js +10 -0
  88. package/dist/swirl-components/swirl-components.esm.js +1 -1
  89. package/dist/types/components/swirl-app-bar/swirl-app-bar.d.ts +1 -0
  90. package/dist/types/components/swirl-app-icon/swirl-app-icon.d.ts +0 -1
  91. package/dist/types/components/swirl-app-layout/swirl-app-layout.d.ts +1 -0
  92. package/dist/types/components/swirl-badge/swirl-badge.d.ts +1 -1
  93. package/dist/types/components/swirl-icon/icons/swirl-icon-dock-left.d.ts +5 -0
  94. package/dist/types/components/swirl-option-list-item/swirl-option-list-item.d.ts +2 -0
  95. package/dist/types/components/swirl-shell-layout/swirl-shell-layout.d.ts +42 -25
  96. package/dist/types/components.d.ts +52 -11
  97. package/icons.json +1 -1
  98. package/package.json +2 -2
  99. package/vscode-data.json +62 -6
  100. package/dist/cjs/swirl-icon-arrow-back.cjs.entry.js +0 -23
  101. package/dist/cjs/swirl-icon-arrow-forward.cjs.entry.js +0 -23
  102. package/dist/cjs/swirl-icon-double-arrow-left.cjs.entry.js +0 -23
  103. package/dist/cjs/swirl-icon-double-arrow-right.cjs.entry.js +0 -23
  104. package/dist/cjs/swirl-icon-menu.cjs.entry.js +0 -23
  105. package/dist/swirl-components/p-178d041a.entry.js +0 -1
  106. package/dist/swirl-components/p-3a2abee9.entry.js +0 -1
  107. package/dist/swirl-components/p-441c8210.entry.js +0 -1
  108. package/dist/swirl-components/p-4a84e63d.entry.js +0 -1
  109. package/dist/swirl-components/p-54e4ff0b.entry.js +0 -1
  110. package/dist/swirl-components/p-5da3a9a8.entry.js +0 -1
  111. package/dist/swirl-components/p-645a878c.entry.js +0 -1
  112. package/dist/swirl-components/p-79be22ea.entry.js +0 -10
  113. package/dist/swirl-components/p-97668c59.entry.js +0 -1
  114. package/dist/swirl-components/p-be2cf7ee.entry.js +0 -1
  115. package/dist/swirl-components/p-c4d4a99d.entry.js +0 -1
  116. package/dist/swirl-components/p-ca78767e.entry.js +0 -1
  117. package/dist/swirl-components/p-d2fc7935.entry.js +0 -1
  118. package/dist/swirl-components/p-f83a0b0f.entry.js +0 -1
@@ -115,6 +115,7 @@
115
115
  "./components/swirl-icon/icons/swirl-icon-delete.js",
116
116
  "./components/swirl-icon/icons/swirl-icon-description.js",
117
117
  "./components/swirl-icon/icons/swirl-icon-discover.js",
118
+ "./components/swirl-icon/icons/swirl-icon-dock-left.js",
118
119
  "./components/swirl-icon/icons/swirl-icon-double-arrow-left.js",
119
120
  "./components/swirl-icon/icons/swirl-icon-double-arrow-right.js",
120
121
  "./components/swirl-icon/icons/swirl-icon-download.js",
@@ -21,6 +21,7 @@ export class SwirlAppBar {
21
21
  this.stepDownButtonClick.emit(event);
22
22
  };
23
23
  this.backButtonLabel = "Go back";
24
+ this.closeButtonIcon = "<swirl-icon-close></swirl-icon-close>";
24
25
  this.closeButtonLabel = "Close";
25
26
  this.stepUpButtonLabel = "Previous item";
26
27
  this.stepDownButtonLabel = "Next item";
@@ -51,7 +52,7 @@ export class SwirlAppBar {
51
52
  "app-bar--has-cta": this.hasCta,
52
53
  "app-bar--has-right-controls": hasRightControls,
53
54
  });
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" })))));
55
+ 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: this.closeButtonIcon, 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" })))));
55
56
  }
56
57
  static get is() { return "swirl-app-bar"; }
57
58
  static get encapsulation() { return "shadow"; }
@@ -85,6 +86,24 @@ export class SwirlAppBar {
85
86
  "reflect": false,
86
87
  "defaultValue": "\"Go back\""
87
88
  },
89
+ "closeButtonIcon": {
90
+ "type": "string",
91
+ "mutable": false,
92
+ "complexType": {
93
+ "original": "string",
94
+ "resolved": "string",
95
+ "references": {}
96
+ },
97
+ "required": false,
98
+ "optional": true,
99
+ "docs": {
100
+ "tags": [],
101
+ "text": ""
102
+ },
103
+ "attribute": "close-button-icon",
104
+ "reflect": false,
105
+ "defaultValue": "\"<swirl-icon-close></swirl-icon-close>\""
106
+ },
88
107
  "closeButtonLabel": {
89
108
  "type": "string",
90
109
  "mutable": false,
@@ -9,10 +9,9 @@
9
9
  .app-icon {
10
10
  position: relative;
11
11
  overflow: hidden;
12
- width: 2.5rem;
13
- height: 2.5rem;
14
- border-radius: 0.625rem;
15
- background-color: var(--s-surface-default);
12
+ width: 1.25rem;
13
+ height: 1.25rem;
14
+ border-radius: var(--s-border-radius-s);
16
15
  }
17
16
 
18
17
  .app-icon > img {
@@ -20,28 +19,10 @@
20
19
  height: 100%;
21
20
  }
22
21
 
23
- .app-icon::after {
24
- position: absolute;
25
- top: 0;
26
- display: block;
27
- width: 100%;
28
- height: 100%;
29
- border-radius: 0.625rem;
30
- content: "";
31
- box-shadow: 0 0 var(--s-border-width-default) rgba(0, 0, 0, 0.1) inset,
32
- 0 0 var(--s-border-width-default) rgba(0, 0, 0, 0.1) inset;
33
- }
34
-
35
- .app-icon--hide-border::after {
36
- box-shadow: none;
37
- }
38
-
39
22
  .app-icon__icon {
40
23
  display: inline-flex;
41
24
  width: 100%;
42
25
  height: 100%;
43
26
  justify-content: center;
44
27
  align-items: center;
45
-
46
- color: var(--s-icon-default);
47
28
  }
@@ -10,7 +10,6 @@ export class SwirlAppIcon {
10
10
  };
11
11
  this.icon = undefined;
12
12
  this.src = undefined;
13
- this.hideBorder = false;
14
13
  this.imageAvailable = undefined;
15
14
  }
16
15
  render() {
@@ -20,7 +19,6 @@ export class SwirlAppIcon {
20
19
  const showFallbackIcon = !showImage && !showIcon;
21
20
  const className = classnames("app-icon", {
22
21
  "app-icon--has-icon": showIcon || showFallbackIcon,
23
- "app-icon--hide-border": this.hideBorder,
24
22
  });
25
23
  return (h(Host, null, h("span", { class: className }, showImage && (h("img", { alt: "", height: "40", onError: this.setImageUnavailable, onLoad: this.setImageAvailable, src: this.src, width: "40" })), showIcon && (h("span", { class: "app-icon__icon", innerHTML: this.icon })))));
26
24
  }
@@ -71,24 +69,6 @@ export class SwirlAppIcon {
71
69
  },
72
70
  "attribute": "src",
73
71
  "reflect": false
74
- },
75
- "hideBorder": {
76
- "type": "boolean",
77
- "mutable": false,
78
- "complexType": {
79
- "original": "boolean",
80
- "resolved": "boolean",
81
- "references": {}
82
- },
83
- "required": false,
84
- "optional": true,
85
- "docs": {
86
- "tags": [],
87
- "text": ""
88
- },
89
- "attribute": "hide-border",
90
- "reflect": false,
91
- "defaultValue": "false"
92
72
  }
93
73
  };
94
74
  }
@@ -80,6 +80,18 @@
80
80
  }
81
81
  }
82
82
 
83
+ @media (min-width: 768px) {
84
+ .app-layout--has-sidebar:not(.app-layout--has-navigation).app-layout--sidebar-active .app-layout__grid {
85
+ animation: app-layout-no-nav-sidebar-slide-in 0.3s;
86
+ }
87
+ }
88
+
89
+ @media (min-width: 768px) {
90
+ .app-layout--has-sidebar:not(.app-layout--has-navigation).app-layout--sidebar-closing .app-layout__grid {
91
+ animation: app-layout-no-nav-sidebar-slide-out 0.3s;
92
+ }
93
+ }
94
+
83
95
  @media (min-width: 768px) {
84
96
  .app-layout--has-sidebar.app-layout--sidebar-active .app-layout__grid {
85
97
  grid-template-columns: 1fr min(50%, 25rem);
@@ -96,7 +108,7 @@
96
108
  "body";
97
109
  }
98
110
 
99
- @media (min-width: 1440px) {
111
+ @media (min-width: 1800px) {
100
112
  .app-layout--has-navigation.app-layout--has-sidebar.app-layout--sidebar-active .app-layout__grid {
101
113
  animation: app-layout-sidebar-slide-in 0.3s;
102
114
  grid-template-columns: 25rem 1fr 25rem;
@@ -132,7 +144,7 @@
132
144
  }
133
145
  }
134
146
 
135
- @media (min-width: 768px) and (max-width: 1439px) {
147
+ @media (min-width: 768px) and (max-width: 1799px) {
136
148
  .app-layout--has-navigation.app-layout--has-sidebar .app-layout__sidebar {
137
149
  position: absolute;
138
150
  top: 0;
@@ -196,7 +208,7 @@
196
208
  }
197
209
  }
198
210
 
199
- @media (min-width: 1440px) {
211
+ @media (min-width: 1800px) {
200
212
 
201
213
  .app-layout--sidebar-closing .app-layout__sidebar {
202
214
  animation: none
@@ -211,6 +223,14 @@
211
223
  display: block;
212
224
  }
213
225
 
226
+ .app-layout--has-custom-sidebar-header .app-layout__sidebar-header {
227
+ display: none;
228
+ }
229
+
230
+ .app-layout--has-custom-sidebar-header .app-layout__custom-sidebar-header {
231
+ display: block;
232
+ }
233
+
214
234
  .app-layout--hide-app-bar .app-layout__body {
215
235
  grid-template-rows: auto 1fr;
216
236
  grid-template-areas:
@@ -397,7 +417,7 @@
397
417
  }
398
418
  }
399
419
 
400
- @media (min-width: 1440px) {
420
+ @media (min-width: 1800px) {
401
421
 
402
422
  .app-layout__sidebar {
403
423
  width: 25rem;
@@ -405,6 +425,14 @@
405
425
  }
406
426
  }
407
427
 
428
+ .app-layout__custom-sidebar-header {
429
+ display: none;
430
+ min-width: 0;
431
+ border-bottom: var(--s-border-width-default) solid var(--s-border-default);
432
+ background-color: var(--s-background-default);
433
+ grid-area: sidebar-header;
434
+ }
435
+
408
436
  .app-layout__sidebar-header {
409
437
  display: flex;
410
438
  min-width: 0;
@@ -777,3 +805,25 @@
777
805
  }
778
806
  }
779
807
 
808
+ @keyframes app-layout-no-nav-sidebar-slide-in {
809
+ from {
810
+ overflow: hidden;
811
+ grid-template-columns: 1fr 0;
812
+ }
813
+ to {
814
+ overflow: hidden;
815
+ grid-template-columns: 1fr 25rem;
816
+ }
817
+ }
818
+
819
+ @keyframes app-layout-no-nav-sidebar-slide-out {
820
+ from {
821
+ overflow: hidden;
822
+ grid-template-columns: 1fr 25rem;
823
+ }
824
+ to {
825
+ overflow: hidden;
826
+ grid-template-columns: 1fr 0;
827
+ }
828
+ }
829
+
@@ -11,6 +11,7 @@ import { isMobileViewport } from "../../utils";
11
11
  * @slot app-bar-mobile-menu-button - Used to add a mobile shell layout menu button to the app bar
12
12
  * @slot banner - Used to show a banner below the app bar
13
13
  * @slot sidebar - Content of the right sidebar
14
+ * @slot custom-sidebar-header - Replaces the default sidebar header
14
15
  */
15
16
  export class SwirlAppLayout {
16
17
  constructor() {
@@ -177,10 +178,12 @@ export class SwirlAppLayout {
177
178
  !this.hasCustomAppBarBackButton;
178
179
  const hasAppBarControls = Boolean(this.el.querySelector('[slot="app-bar-controls"]'));
179
180
  const hasAppBarMobileMenuButton = Boolean(this.el.querySelector('[slot="app-bar-mobile-menu-button"]'));
181
+ const hasCustomSidebarHeader = Boolean(this.el.querySelector('[slot="custom-sidebar-header"]'));
180
182
  const className = classnames("app-layout", `app-layout--mobile-view-${this.mobileView}`, `app-layout--transitioning-from-${this.transitioningFrom}`, `app-layout--transitioning-to-${this.transitioningTo}`, `app-layout--transition-style-${this.transitionStyle}`, {
181
183
  "app-layout--has-app-bar-mobile-menu-button": hasAppBarMobileMenuButton,
182
184
  "app-layout--has-app-bar-controls": hasAppBarControls,
183
185
  "app-layout--has-custom-app-bar-back-button": this.hasCustomAppBarBackButton,
186
+ "app-layout--has-custom-sidebar-header": hasCustomSidebarHeader,
184
187
  "app-layout--has-navigation": this.hasNavigation,
185
188
  "app-layout--has-sidebar": this.hasSidebar,
186
189
  "app-layout--hide-app-bar": this.hideAppBar,
@@ -189,7 +192,7 @@ export class SwirlAppLayout {
189
192
  });
190
193
  return (h(Host, null, h("section", { "aria-labelledby": "app-name", class: className, role: "document", tabIndex: 0 }, 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"
191
194
  ? "<swirl-icon-close></swirl-icon-close>"
192
- : "<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("aside", { class: "app-layout__sidebar" }, 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" }))), this.ctaLabel && (h("span", { class: "app-layout__floating-cta" }, h("swirl-button", { hideLabel: Boolean(this.ctaIcon), icon: this.ctaIcon, intent: "primary", label: this.ctaLabel, onClick: this.onCtaClick, variant: "floating" })))))));
195
+ : "<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("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" }))), this.ctaLabel && (h("span", { class: "app-layout__floating-cta" }, h("swirl-button", { hideLabel: Boolean(this.ctaIcon), icon: this.ctaIcon, intent: "primary", label: this.ctaLabel, onClick: this.onCtaClick, variant: "floating" })))))));
193
196
  }
194
197
  static get is() { return "swirl-app-layout"; }
195
198
  static get encapsulation() { return "shadow"; }
@@ -15,13 +15,30 @@
15
15
  max-width: 100%;
16
16
  justify-content: center;
17
17
  align-items: center;
18
- border: 0.25rem solid var(--swirl-badge-border-color);
18
+ border: 0.125rem solid var(--swirl-badge-border-color);
19
19
  border-radius: 2rem;
20
20
  color: var(--s-text-on-status);
21
21
  font-size: var(--s-font-size-sm);
22
22
  font-weight: var(--s-font-weight-medium);
23
23
  }
24
24
 
25
+ .badge--size-xs {
26
+ min-width: 1.25rem;
27
+ height: 1.25rem;
28
+ font-size: 0.6875rem;
29
+ }
30
+
31
+ .badge--size-xs .badge__label {
32
+ padding-right: 0.125rem;
33
+ padding-left: 0.125rem;
34
+ }
35
+
36
+ .badge--size-xs .badge__icon > swirl-icon,
37
+ .badge--size-xs .badge__icon > *::part(icon) {
38
+ width: 0.75rem;
39
+ height: 0.75rem;
40
+ }
41
+
25
42
  .badge--size-s {
26
43
  min-width: 1.5rem;
27
44
  height: 1.5rem;
@@ -90,7 +90,7 @@ export class SwirlBadge {
90
90
  "mutable": false,
91
91
  "complexType": {
92
92
  "original": "SwirlBadgeSize",
93
- "resolved": "\"m\" | \"s\"",
93
+ "resolved": "\"m\" | \"s\" | \"xs\"",
94
94
  "references": {
95
95
  "SwirlBadgeSize": {
96
96
  "location": "local",
@@ -0,0 +1,52 @@
1
+ // DO NOT EDIT. THIS FILE GETS GENERATED VIA "yarn generate".
2
+ import { Fragment, h } from "@stencil/core";
3
+ import classnames from "classnames";
4
+ export class SwirlIconDockLeft {
5
+ constructor() {
6
+ this.size = 24;
7
+ }
8
+ render() {
9
+ const viewBoxSize = this.size === 20 ? 24 : this.size;
10
+ const className = classnames("swirl-icon", `swirl-icon--size-${this.size}`);
11
+ return (h("svg", { class: className, fill: "none", height: this.size, part: "icon", viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, width: this.size, xmlns: "http://www.w3.org/2000/svg" }, this.size === 16 && (h(Fragment, null, h("path", { d: "M3.33333 14C2.96667 14 2.65278 13.8694 2.39167 13.6083C2.13056 13.3472 2 13.0333 2 12.6667V3.33333C2 2.96667 2.13056 2.65278 2.39167 2.39167C2.65278 2.13056 2.96667 2 3.33333 2H12.6667C13.0333 2 13.3472 2.13056 13.6083 2.39167C13.8694 2.65278 14 2.96667 14 3.33333V12.6667C14 13.0333 13.8694 13.3472 13.6083 13.6083C13.3472 13.8694 13.0333 14 12.6667 14H3.33333ZM5.33333 12.6667V3.33333H3.33333V12.6667H5.33333ZM6.66667 12.6667H12.6667V3.33333H6.66667V12.6667Z", fill: "currentColor" }))), (this.size === 20 || this.size === 24) && (h(Fragment, null, h("path", { d: "M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H19C19.55 3 20.0208 3.19583 20.4125 3.5875C20.8042 3.97917 21 4.45 21 5V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM8 19V5H5V19H8ZM10 19H19V5H10V19Z", fill: "currentColor" }))), this.size === 28 && (h(Fragment, null, h("path", { d: "M5.83333 24.5C5.19167 24.5 4.64236 24.2715 4.18542 23.8146C3.72847 23.3576 3.5 22.8083 3.5 22.1667V5.83333C3.5 5.19167 3.72847 4.64236 4.18542 4.18542C4.64236 3.72847 5.19167 3.5 5.83333 3.5H22.1667C22.8083 3.5 23.3576 3.72847 23.8146 4.18542C24.2715 4.64236 24.5 5.19167 24.5 5.83333V22.1667C24.5 22.8083 24.2715 23.3576 23.8146 23.8146C23.3576 24.2715 22.8083 24.5 22.1667 24.5H5.83333ZM9.33333 22.1667V5.83333H5.83333V22.1667H9.33333ZM11.6667 22.1667H22.1667V5.83333H11.6667V22.1667Z", fill: "currentColor" })))));
12
+ }
13
+ static get is() { return "swirl-icon-dock-left"; }
14
+ static get encapsulation() { return "shadow"; }
15
+ static get originalStyleUrls() {
16
+ return {
17
+ "$": ["../swirl-icon.css"]
18
+ };
19
+ }
20
+ static get styleUrls() {
21
+ return {
22
+ "$": ["../swirl-icon.css"]
23
+ };
24
+ }
25
+ static get properties() {
26
+ return {
27
+ "size": {
28
+ "type": "number",
29
+ "mutable": false,
30
+ "complexType": {
31
+ "original": "SwirlIconSize",
32
+ "resolved": "16 | 20 | 24 | 28",
33
+ "references": {
34
+ "SwirlIconSize": {
35
+ "location": "import",
36
+ "path": "../swirl-icon.types"
37
+ }
38
+ }
39
+ },
40
+ "required": false,
41
+ "optional": false,
42
+ "docs": {
43
+ "tags": [],
44
+ "text": ""
45
+ },
46
+ "attribute": "size",
47
+ "reflect": false,
48
+ "defaultValue": "24"
49
+ }
50
+ };
51
+ }
52
+ }
@@ -45,13 +45,13 @@
45
45
  }
46
46
  }
47
47
 
48
- .option-list-item--draggable .option-list-item__label {
48
+ .option-list-item--draggable .option-list-item__label-container {
49
49
  padding-right: calc(var(--s-space-16) + 1.5rem);
50
50
  }
51
51
 
52
52
  @media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px) {
53
53
 
54
- .option-list-item--draggable .option-list-item__label {
54
+ .option-list-item--draggable .option-list-item__label-container {
55
55
  padding-right: calc(var(--s-space-16) + 1rem)
56
56
  }
57
57
  }
@@ -94,7 +94,8 @@
94
94
  color: var(--s-text-on-status);
95
95
  }
96
96
 
97
- .option-list-item--disabled .option-list-item__label {
97
+ .option-list-item--disabled .option-list-item__label,
98
+ .option-list-item--disabled .option-list-item__description {
98
99
  color: var(--s-text-disabled);
99
100
  }
100
101
 
@@ -109,8 +110,13 @@
109
110
  background-color: var(--s-surface-overlay-default);
110
111
  }
111
112
 
112
- .option-list-item__label {
113
+ .option-list-item__label-container {
114
+ display: flex;
113
115
  flex-grow: 1;
116
+ flex-direction: column;
117
+ }
118
+
119
+ .option-list-item__label {
114
120
  color: var(--s-text-default);
115
121
  font-size: var(--s-font-size-base);
116
122
  font-weight: var(--s-font-weight-medium);
@@ -126,6 +132,22 @@
126
132
  }
127
133
  }
128
134
 
135
+ .option-list-item__description {
136
+ color: var(--s-text-subdued);
137
+ font-size: var(--s-font-size-base);
138
+ font-weight: var(--s-font-weight-medium);
139
+ line-height: var(--s-line-height-base);
140
+ text-align: left;
141
+ }
142
+
143
+ @media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px) {
144
+
145
+ .option-list-item__description {
146
+ font-size: var(--s-font-size-sm);
147
+ line-height: var(--s-line-height-sm)
148
+ }
149
+ }
150
+
129
151
  .option-list-item__icon {
130
152
  display: inline-flex;
131
153
  flex-shrink: 0;
@@ -1,9 +1,11 @@
1
1
  import { h, Host, } from "@stencil/core";
2
2
  import classnames from "classnames";
3
3
  import { getDesktopMediaQuery } from "../../utils";
4
+ import { v4 as uuid } from "uuid";
4
5
  export class SwirlOptionListItem {
5
6
  constructor() {
6
7
  this.desktopMediaQuery = getDesktopMediaQuery();
8
+ this.id = uuid();
7
9
  this.desktopMediaQueryHandler = (event) => {
8
10
  this.forceIconProps(event.matches);
9
11
  this.updateIconSize(event.matches);
@@ -22,6 +24,7 @@ export class SwirlOptionListItem {
22
24
  };
23
25
  this.allowDrag = undefined;
24
26
  this.context = "single-select";
27
+ this.description = undefined;
25
28
  this.disabled = undefined;
26
29
  this.dragging = undefined;
27
30
  this.dragHandleDescription = "Press spacebar to toggle grab";
@@ -61,7 +64,9 @@ export class SwirlOptionListItem {
61
64
  "option-list-item--dragging": this.dragging,
62
65
  "option-list-item--selected": this.selected,
63
66
  });
64
- return (h(Host, null, h("div", { "aria-checked": this.swirlAriaRole === "menuitemradio" ? ariaSelected : undefined, "aria-disabled": ariaDisabled, "aria-selected": this.swirlAriaRole === "option" ? ariaSelected : undefined, class: className, onBlur: this.onBlur, onFocus: this.onFocus, part: "option-list-item", role: this.swirlAriaRole }, showIcon && (h("span", { class: "option-list-item__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), showCheckbox && (h("span", { class: "option-list-item__checkbox" }, h("span", { class: "option-list-item__checkbox-box" }, this.selected && (h("swirl-icon-check-strong", { class: "option-list-item__checkbox-icon", size: 16 }))))), h("span", { class: "option-list-item__label", part: "option-list-item__label" }, this.label), showSelectionIcon && (h("span", { class: "option-list-item__selection-icon" }, h("swirl-icon-check-small", { size: this.iconSize })))), this.allowDrag && (h("button", { "aria-describedby": this.dragHandleDescription, "aria-label": `${this.dragHandleLabel} "${this.label}"`, class: "option-list-item__drag-handle", onKeyDown: this.onDragHandleKeyDown, tabIndex: this.focused ? 0 : -1, type: "button" }, h("swirl-icon-drag-handle", { size: this.iconSize })))));
67
+ return (h(Host, null, h("div", { "aria-checked": this.swirlAriaRole === "menuitemradio" ? ariaSelected : undefined, "aria-describedby": Boolean(this.description)
68
+ ? `option-list-item-${this.id}-description`
69
+ : undefined, "aria-disabled": ariaDisabled, "aria-labelledby": `option-list-item-${this.id}-label`, "aria-selected": this.swirlAriaRole === "option" ? ariaSelected : undefined, class: className, id: `option-list-item-${this.id}`, onBlur: this.onBlur, onFocus: this.onFocus, part: "option-list-item", role: this.swirlAriaRole }, showIcon && (h("span", { class: "option-list-item__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), showCheckbox && (h("span", { class: "option-list-item__checkbox" }, h("span", { class: "option-list-item__checkbox-box" }, this.selected && (h("swirl-icon-check-strong", { class: "option-list-item__checkbox-icon", size: 16 }))))), h("span", { class: "option-list-item__label-container" }, h("span", { class: "option-list-item__label", id: `option-list-item-${this.id}-label`, part: "option-list-item__label" }, this.label), this.description && (h("span", { class: "option-list-item__description", id: `option-list-item-${this.id}-description` }, this.description))), showSelectionIcon && (h("span", { class: "option-list-item__selection-icon" }, h("swirl-icon-check-small", { size: this.iconSize })))), this.allowDrag && (h("button", { "aria-describedby": this.dragHandleDescription, "aria-label": `${this.dragHandleLabel} "${this.label}"`, class: "option-list-item__drag-handle", onKeyDown: this.onDragHandleKeyDown, tabIndex: this.focused ? 0 : -1, type: "button" }, h("swirl-icon-drag-handle", { size: this.iconSize })))));
65
70
  }
66
71
  static get is() { return "swirl-option-list-item"; }
67
72
  static get encapsulation() { return "scoped"; }
@@ -117,6 +122,23 @@ export class SwirlOptionListItem {
117
122
  "reflect": false,
118
123
  "defaultValue": "\"single-select\""
119
124
  },
125
+ "description": {
126
+ "type": "string",
127
+ "mutable": false,
128
+ "complexType": {
129
+ "original": "string",
130
+ "resolved": "string",
131
+ "references": {}
132
+ },
133
+ "required": false,
134
+ "optional": true,
135
+ "docs": {
136
+ "tags": [],
137
+ "text": ""
138
+ },
139
+ "attribute": "description",
140
+ "reflect": false
141
+ },
120
142
  "disabled": {
121
143
  "type": "boolean",
122
144
  "mutable": false,
@@ -13,14 +13,17 @@ describe("swirl-option-list-item", () => {
13
13
  value="Value">
14
14
  </swirl-option-list-item>`,
15
15
  });
16
+ const id = page.root.children[0].id;
16
17
  expect(page.root).toEqualHtml(`
17
18
  <swirl-option-list-item context="single-select" disabled="false" icon="<swirl-icon-mention></swirl-icon-mention>" label="Option List Item" selected="true" value="Value">
18
- <div aria-selected="true" class="option-list-item option-list-item--context-single-select option-list-item--selected" part="option-list-item" role="option">
19
+ <div aria-labelledby="${id}-label" aria-selected="true" class="option-list-item option-list-item--context-single-select option-list-item--selected" id="${id}" part="option-list-item" role="option">
19
20
  <span class="option-list-item__icon">
20
21
  <swirl-icon-mention size="24"></swirl-icon-mention>
21
22
  </span>
22
- <span class="option-list-item__label" part="option-list-item__label">
23
- Option List Item
23
+ <span class="option-list-item__label-container">
24
+ <span class="option-list-item__label" id="${id}-label" part="option-list-item__label">
25
+ Option List Item
26
+ </span>
24
27
  </span>
25
28
  <span class="option-list-item__selection-icon">
26
29
  <swirl-icon-check-small size="24"></swirl-icon-check-small>