@duetds/components 8.6.0 → 8.6.2

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/hydrate/index.js +52 -170
  2. package/lib/cjs/duet-action-button.cjs.entry.js +5 -6
  3. package/lib/cjs/duet-banner.cjs.entry.js +10 -7
  4. package/lib/cjs/duet-caption_4.cjs.entry.js +5 -2
  5. package/lib/cjs/duet-choice_2.cjs.entry.js +7 -0
  6. package/lib/cjs/duet-menu-bar-button.cjs.entry.js +2 -34
  7. package/lib/cjs/duet-menu-bar-dropdown.cjs.entry.js +2 -37
  8. package/lib/cjs/duet-menu-bar-link.cjs.entry.js +2 -37
  9. package/lib/cjs/duet-submenu-bar-dropdown.cjs.entry.js +2 -5
  10. package/lib/cjs/duet-submenu-bar-link.cjs.entry.js +2 -37
  11. package/lib/cjs/duet.cjs.js +1 -1
  12. package/lib/cjs/loader.cjs.js +1 -1
  13. package/lib/collection/components/duet-action-button/duet-action-button.js +6 -8
  14. package/lib/collection/components/duet-banner/duet-banner.css +113 -133
  15. package/lib/collection/components/duet-banner/duet-banner.js +9 -6
  16. package/lib/collection/components/duet-choice-group/duet-choice-group.e2e.js +15 -0
  17. package/lib/collection/components/duet-choice-group/duet-choice-group.js +31 -0
  18. package/lib/collection/components/duet-link/duet-link.css +3 -0
  19. package/lib/collection/components/duet-link/duet-link.js +39 -1
  20. package/lib/collection/components/duet-menu-bar-button/duet-menu-bar-button.css +10 -0
  21. package/lib/collection/components/duet-menu-bar-button/duet-menu-bar-button.js +1 -38
  22. package/lib/collection/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.css +10 -0
  23. package/lib/collection/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.js +1 -41
  24. package/lib/collection/components/duet-menu-bar-link/duet-menu-bar-link.css +10 -0
  25. package/lib/collection/components/duet-menu-bar-link/duet-menu-bar-link.js +1 -41
  26. package/lib/collection/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.css +10 -0
  27. package/lib/collection/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.js +2 -6
  28. package/lib/collection/components/duet-submenu-bar-link/duet-submenu-bar-link.css +10 -0
  29. package/lib/collection/components/duet-submenu-bar-link/duet-submenu-bar-link.js +1 -41
  30. package/lib/collection/components/duet-upload-aria-status/duet-upload-aria-status.js +4 -0
  31. package/lib/collection/components/duet-upload-item/duet-upload-item.js +4 -0
  32. package/lib/dist-custom-elements/duet-action-button.js +1 -1
  33. package/lib/dist-custom-elements/duet-banner.js +10 -7
  34. package/lib/dist-custom-elements/duet-choice-group.js +9 -1
  35. package/lib/dist-custom-elements/duet-contact-card.js +1 -1
  36. package/lib/dist-custom-elements/duet-date-picker.js +1 -1
  37. package/lib/dist-custom-elements/duet-editable-table.js +1 -1
  38. package/lib/dist-custom-elements/duet-link.js +1 -1
  39. package/lib/dist-custom-elements/duet-menu-bar-button.js +2 -35
  40. package/lib/dist-custom-elements/duet-menu-bar-dropdown.js +2 -38
  41. package/lib/dist-custom-elements/duet-menu-bar-link.js +3 -39
  42. package/lib/dist-custom-elements/duet-pagination.js +1 -1
  43. package/lib/dist-custom-elements/duet-range-stepper.js +1 -1
  44. package/lib/dist-custom-elements/duet-submenu-bar-dropdown.js +2 -6
  45. package/lib/dist-custom-elements/duet-submenu-bar-link.js +3 -39
  46. package/lib/dist-custom-elements/duet-upload-item.js +1 -1
  47. package/lib/dist-custom-elements/duet-upload.js +3 -3
  48. package/lib/dist-custom-elements/{p-68ba7bf1.js → p-2f410810.js} +7 -2
  49. package/lib/dist-custom-elements/{p-24693e9a.js → p-e10f446d.js} +2 -2
  50. package/lib/dist-custom-elements/{p-03152b20.js → p-f4ac6968.js} +5 -6
  51. package/lib/duet/duet.esm.js +1 -1
  52. package/lib/duet/{p-c9370d43.system.entry.js → p-0fc721ab.system.entry.js} +1 -1
  53. package/lib/duet/p-25048bf8.system.entry.js +4 -0
  54. package/lib/duet/{p-aba91113.system.entry.js → p-27363096.system.entry.js} +1 -1
  55. package/lib/duet/{p-83238fe7.entry.js → p-436fcaf7.entry.js} +1 -1
  56. package/lib/duet/p-51e3af7b.system.entry.js +4 -0
  57. package/lib/duet/p-5c8e3667.entry.js +4 -0
  58. package/lib/duet/p-6151635f.system.js +1 -1
  59. package/lib/duet/p-69e67b58.entry.js +4 -0
  60. package/lib/duet/p-70b705ad.entry.js +4 -0
  61. package/lib/duet/p-723e165b.system.entry.js +4 -0
  62. package/lib/duet/p-82d1fd63.system.entry.js +4 -0
  63. package/lib/duet/p-9065a864.entry.js +4 -0
  64. package/lib/duet/p-9ac25886.system.entry.js +4 -0
  65. package/lib/duet/{p-cd87960a.system.entry.js → p-a659cdb5.system.entry.js} +1 -1
  66. package/lib/duet/p-b02ca265.entry.js +4 -0
  67. package/lib/duet/p-c12d34fd.system.entry.js +4 -0
  68. package/lib/duet/p-c776e072.entry.js +4 -0
  69. package/lib/duet/p-d1d79e0c.entry.js +4 -0
  70. package/lib/duet/p-ffab115e.entry.js +4 -0
  71. package/lib/esm/duet-action-button.entry.js +5 -6
  72. package/lib/esm/duet-banner.entry.js +10 -7
  73. package/lib/esm/duet-caption_4.entry.js +5 -2
  74. package/lib/esm/duet-choice_2.entry.js +7 -0
  75. package/lib/esm/duet-menu-bar-button.entry.js +2 -34
  76. package/lib/esm/duet-menu-bar-dropdown.entry.js +2 -37
  77. package/lib/esm/duet-menu-bar-link.entry.js +2 -37
  78. package/lib/esm/duet-submenu-bar-dropdown.entry.js +2 -5
  79. package/lib/esm/duet-submenu-bar-link.entry.js +2 -37
  80. package/lib/esm/duet.js +1 -1
  81. package/lib/esm/loader.js +1 -1
  82. package/lib/esm-es5/duet-action-button.entry.js +1 -1
  83. package/lib/esm-es5/duet-banner.entry.js +1 -1
  84. package/lib/esm-es5/duet-caption_4.entry.js +1 -1
  85. package/lib/esm-es5/duet-choice_2.entry.js +1 -1
  86. package/lib/esm-es5/duet-menu-bar-button.entry.js +1 -1
  87. package/lib/esm-es5/duet-menu-bar-dropdown.entry.js +2 -2
  88. package/lib/esm-es5/duet-menu-bar-link.entry.js +1 -1
  89. package/lib/esm-es5/duet-submenu-bar-dropdown.entry.js +2 -2
  90. package/lib/esm-es5/duet-submenu-bar-link.entry.js +1 -1
  91. package/lib/esm-es5/duet.js +1 -1
  92. package/lib/esm-es5/loader.js +1 -1
  93. package/lib/types/components/duet-banner/duet-banner.d.ts +1 -1
  94. package/lib/types/components/duet-choice-group/duet-choice-group.d.ts +5 -0
  95. package/lib/types/components/duet-link/duet-link.d.ts +11 -0
  96. package/lib/types/components/duet-menu-bar-button/duet-menu-bar-button.d.ts +1 -7
  97. package/lib/types/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.d.ts +1 -7
  98. package/lib/types/components/duet-menu-bar-link/duet-menu-bar-link.d.ts +1 -10
  99. package/lib/types/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.d.ts +1 -2
  100. package/lib/types/components/duet-submenu-bar-link/duet-submenu-bar-link.d.ts +1 -10
  101. package/lib/types/components/duet-upload-aria-status/duet-upload-aria-status.d.ts +4 -0
  102. package/lib/types/components/duet-upload-item/duet-upload-item.d.ts +4 -0
  103. package/lib/types/components.d.ts +17 -0
  104. package/package.json +2 -2
  105. package/lib/duet/p-0de8d0c0.system.entry.js +0 -4
  106. package/lib/duet/p-29491f9f.entry.js +0 -4
  107. package/lib/duet/p-36f031e7.entry.js +0 -4
  108. package/lib/duet/p-3f2d14e3.system.entry.js +0 -4
  109. package/lib/duet/p-8cc30578.entry.js +0 -4
  110. package/lib/duet/p-9735b2f9.entry.js +0 -4
  111. package/lib/duet/p-9be9b4d2.entry.js +0 -4
  112. package/lib/duet/p-b2fc4b72.system.entry.js +0 -4
  113. package/lib/duet/p-bece15cd.system.entry.js +0 -4
  114. package/lib/duet/p-cba00852.entry.js +0 -4
  115. package/lib/duet/p-cc949a27.entry.js +0 -4
  116. package/lib/duet/p-e614e39f.system.entry.js +0 -4
  117. package/lib/duet/p-e7fd0d14.entry.js +0 -4
  118. package/lib/duet/p-e86cafa6.system.entry.js +0 -4
@@ -25,6 +25,8 @@
25
25
  display: flex;
26
26
  justify-content: center;
27
27
  width: auto;
28
+ container: duet-banner-container;
29
+ container-type: inline-size;
28
30
  }
29
31
  :host:last-child, :host:last-of-type {
30
32
  margin-right: 0 !important;
@@ -36,12 +38,16 @@
36
38
 
37
39
  .duet-banner {
38
40
  display: grid;
41
+ grid-template-rows: min-content 1fr;
39
42
  width: 100%;
40
43
  height: 100%;
41
44
  font-family: "localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
42
45
  font-style: normal;
43
46
  text-align: left;
44
- border-radius: 24px;
47
+ border-radius: 16px;
48
+ /* stylelint-disable */
49
+ /* stylelint-disable */
50
+ /* stylelint-disable */
45
51
  }
46
52
  .duet-banner.duet-p-0 {
47
53
  padding: 0 !important;
@@ -51,34 +57,45 @@
51
57
  }
52
58
  .duet-banner .visual {
53
59
  position: relative;
60
+ display: none;
54
61
  overflow: hidden;
55
- border-top-left-radius: 24px;
56
- border-top-right-radius: 24px;
62
+ /* stylelint-disable */
63
+ }
64
+ @container duet-banner-container (min-width: 0px) {
65
+ .duet-banner .visual {
66
+ /* stylelint-enable */
67
+ display: block;
68
+ }
57
69
  }
58
70
  .duet-banner .visual .image-container {
59
71
  position: relative;
60
- width: 400px;
61
- height: 400px;
72
+ aspect-ratio: 2/1;
62
73
  overflow: hidden;
63
- border-radius: 20%;
64
- transform: rotate(7deg);
65
74
  }
66
75
  .duet-banner .visual .image {
67
76
  position: relative;
68
- top: 20px;
69
77
  width: 100%;
70
78
  height: 100%;
71
- transform: rotate(-7deg);
72
79
  object-fit: cover;
80
+ object-position: center;
73
81
  }
74
82
  .duet-banner .visual .icon {
75
83
  position: absolute;
76
84
  }
85
+ .duet-banner .visual .brand-shape {
86
+ position: absolute;
87
+ top: 0;
88
+ left: 72%;
89
+ display: none;
90
+ width: 100%;
91
+ height: 100%;
92
+ background: url("data:image/svg+xml,%3Csvg%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20160%20344%22%20fill%3D%22none%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M2.72641e-07%2091.1902C0.000476976%2097.9034%200.626077%20104.726%201.92282%20111.592L42.7493%20327.771C43.8045%20333.358%2045.2667%20338.776%2047.0996%20344H160V0H51.1439C19.7799%2019.1253%200.00268143%2053.4178%202.72641e-07%2091.1749C-9.08807e-08%2091.18%20-9.08875e-08%2091.1851%202.72641e-07%2091.1902Z%22%20fill%3D%22%23E6F2F8%22%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fsvg%3E");
93
+ }
77
94
  .duet-banner .content {
78
95
  display: flex;
79
96
  flex-direction: column;
80
97
  gap: 8px;
81
- padding: 0 20px 36px;
98
+ padding: 16px 20px 28px;
82
99
  }
83
100
  .duet-banner .content .description {
84
101
  hyphens: auto;
@@ -91,135 +108,98 @@
91
108
  justify-content: flex-end;
92
109
  padding-top: 16px;
93
110
  }
94
- .duet-banner.small {
95
- grid-template-rows: 335px 1fr;
96
- max-width: 335px;
97
- }
98
- .duet-banner.small .visual {
99
- border-top-left-radius: 24px;
100
- border-top-right-radius: 24px;
111
+ .duet-banner .visual {
112
+ border-top-left-radius: 16px;
113
+ border-top-right-radius: 16px;
101
114
  }
102
- .duet-banner.small .visual .image-container {
103
- top: -130px;
104
- left: -40px;
115
+ .duet-banner .visual .image-container {
116
+ width: 100%;
117
+ height: auto;
118
+ border-radius: 0;
105
119
  }
106
- .duet-banner.small .visual .icon {
120
+ .duet-banner .visual .icon {
107
121
  bottom: 30px;
108
122
  left: 15px;
109
123
  }
110
- .duet-banner.medium {
111
- grid-template-rows: none;
112
- grid-template-columns: 50% 50%;
113
- max-width: 542px;
114
- height: 288px;
115
- }
116
- .duet-banner.medium .visual {
117
- border-top-left-radius: 24px;
118
- border-bottom-left-radius: 24px;
119
- }
120
- .duet-banner.medium .visual .image-container {
121
- position: absolute;
122
- bottom: -72px;
123
- left: -178px;
124
- }
125
- .duet-banner.medium .visual .image {
126
- width: auto;
127
- height: auto;
128
- }
129
- .duet-banner.medium .visual .icon {
130
- top: 36px;
131
- left: 168px;
132
- }
133
- .duet-banner.medium .content {
134
- align-items: flex-start;
135
- justify-content: center;
136
- padding: 0 72px 0 0;
137
- }
138
- .duet-banner.medium .action {
139
- flex-grow: 0;
140
- }
141
- .duet-banner.large {
142
- grid-template-rows: none;
143
- grid-template-columns: 50% 50%;
144
- max-width: 1112px;
145
- height: 320px;
146
- max-height: none;
147
- }
148
- .duet-banner.large .visual {
149
- border-top-left-radius: 24px;
150
- border-bottom-left-radius: 24px;
151
- }
152
- .duet-banner.large .visual .image-container {
153
- position: relative;
154
- top: -30px;
155
- left: -30px;
156
- }
157
- .duet-banner.large .visual .image {
158
- top: -15px;
159
- left: 30px;
160
- width: 100%;
161
- height: 100%;
162
- }
163
- .duet-banner.large .visual .icon {
164
- top: 40px;
165
- bottom: auto;
166
- left: 335px;
167
- }
168
- .duet-banner.large .content {
169
- align-items: flex-start;
170
- justify-content: center;
171
- padding: 0 72px 0 0;
172
- }
173
- .duet-banner.large .action {
174
- flex-grow: 0;
175
- }
176
124
  .duet-banner.duet-theme-turva {
177
125
  font-family: "turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
178
126
  }
179
- .duet-banner.duet-theme-turva .visual .image-container {
180
- width: 526px;
181
- height: 456px;
182
- transform: none;
183
- -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20160%20140%22%3E%3Cpath%20d%3D%22M87.8%20139.6a57.3%2057.3%200%2000-18.4-3.3c-8-.5-16.3-2.5-24.6-6-16.7-7-29-18.7-37.1-35.3a73.5%2073.5%200%2001-5-52.4c1.7-4%203-6.7%204-7.8a33%2033%200%20004-7.8C33.4%203.5%2063.2-4.3%20100%203.2c30.5%204%2049.7%2019.9%2057.6%2047.4l1.6%2024c4.4%2036-11.5%2056-47.5%2060.3-4%202.4-12%203.9-24%204.7%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E");
184
- -webkit-mask-repeat: no-repeat;
185
- mask-image: url("data:image/svg+xml,%3Csvg%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20160%20140%22%3E%3Cpath%20d%3D%22M87.8%20139.6a57.3%2057.3%200%2000-18.4-3.3c-8-.5-16.3-2.5-24.6-6-16.7-7-29-18.7-37.1-35.3a73.5%2073.5%200%2001-5-52.4c1.7-4%203-6.7%204-7.8a33%2033%200%20004-7.8C33.4%203.5%2063.2-4.3%20100%203.2c30.5%204%2049.7%2019.9%2057.6%2047.4l1.6%2024c4.4%2036-11.5%2056-47.5%2060.3-4%202.4-12%203.9-24%204.7%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E");
186
- mask-repeat: no-repeat;
187
- }
188
- .duet-banner.duet-theme-turva .visual .image {
189
- transform: none;
190
- }
191
- .duet-banner.duet-theme-turva.small .visual .image-container {
192
- top: -164px;
193
- left: -147px;
194
- }
195
- .duet-banner.duet-theme-turva.small .visual .image {
196
- top: 0;
197
- left: 0;
198
- }
199
- .duet-banner.duet-theme-turva.small .visual .icon {
200
- bottom: 15px;
201
- }
202
- .duet-banner.duet-theme-turva.medium .visual .image-container {
203
- top: -54.923px;
204
- left: -185px;
205
- width: 410px;
206
- height: 422px;
207
- }
208
- .duet-banner.duet-theme-turva.medium .visual .image {
209
- top: 0;
210
- left: 0;
211
- }
212
- .duet-banner.duet-theme-turva.large .visual .image-container {
213
- top: -54.923px;
214
- left: -147px;
215
- width: 526px;
216
- height: 456px;
217
- }
218
- .duet-banner.duet-theme-turva.large .visual .image {
219
- top: 0;
220
- left: 0;
221
- }
222
- .duet-banner.duet-theme-turva.large .visual .icon {
223
- bottom: auto;
224
- left: 295px;
127
+ .duet-banner.duet-theme-turva .visual .brand-shape {
128
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 344' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_7920_3801)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2.58983 142.533C0.751086 155.147 0.0746585 167.857 0.00796847 179.225C0.00263853 179.814 0 180.409 0 181.007C0 194.845 1.41172 210.806 3.58065 223.171C5.6528 234.934 8.58716 246.495 12.5981 257.779C21.2249 282.059 34.0151 304.109 50.8401 323.977C56.7824 330.993 63.0921 337.68 69.8162 344H160V0H65.0733C52.1771 10.7866 41.4339 23.4177 32.7528 37.7978C21.1154 57.0822 14.0367 77.9583 9.75424 99.7913C9.09214 103.157 8.55049 106.545 8.00901 109.933C7.75185 111.542 7.49474 113.15 7.22478 114.756C6.74308 117.618 6.24543 120.479 5.74776 123.34C4.6361 129.729 3.52432 136.12 2.58983 142.533Z' fill='%23F5F5F7'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_7920_3801'%3E%3Crect width='160' height='344' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
129
+ }
130
+ @container duet-banner-container (min-width: 486px) {
131
+ .duet-banner {
132
+ /* stylelint-enable */
133
+ grid-template-rows: none;
134
+ grid-template-columns: 50% 50%;
135
+ }
136
+ .duet-banner .visual {
137
+ border-top-left-radius: 16px;
138
+ border-top-right-radius: 0;
139
+ border-bottom-left-radius: 16px;
140
+ }
141
+ .duet-banner .visual .image-container {
142
+ height: 100%;
143
+ }
144
+ .duet-banner .visual .image {
145
+ width: 100%;
146
+ height: 100%;
147
+ }
148
+ .duet-banner .visual .icon {
149
+ top: 36px;
150
+ left: 168px;
151
+ }
152
+ .duet-banner .visual .brand-shape {
153
+ display: block;
154
+ }
155
+ .duet-banner .content {
156
+ align-items: flex-start;
157
+ justify-content: center;
158
+ padding: 28px 28px 28px 0;
159
+ }
160
+ .duet-banner .action {
161
+ flex-grow: 0;
162
+ }
163
+ }
164
+ @container duet-banner-container (min-width: 586px) {
165
+ .duet-banner {
166
+ /* stylelint-enable */
167
+ }
168
+ .duet-banner .visual .brand-shape {
169
+ left: 80%;
170
+ }
171
+ }
172
+ @container duet-banner-container (min-width: 900px) {
173
+ .duet-banner {
174
+ /* stylelint-enable */
175
+ grid-template-rows: none;
176
+ grid-template-columns: 50% 50%;
177
+ }
178
+ .duet-banner .visual {
179
+ border-top-left-radius: 16px;
180
+ border-bottom-left-radius: 16px;
181
+ }
182
+ .duet-banner .visual .image-container {
183
+ height: 100%;
184
+ }
185
+ .duet-banner .visual .image {
186
+ width: 100%;
187
+ height: 100%;
188
+ }
189
+ .duet-banner .visual .icon {
190
+ top: 40px;
191
+ bottom: auto;
192
+ left: 335px;
193
+ }
194
+ .duet-banner .visual .brand-shape {
195
+ display: block;
196
+ }
197
+ .duet-banner .content {
198
+ align-items: flex-start;
199
+ justify-content: center;
200
+ padding: 48px 48px 48px 0;
201
+ }
202
+ .duet-banner .action {
203
+ flex-grow: 0;
204
+ }
225
205
  }
@@ -14,7 +14,7 @@ import { getColorByName } from "../../utils/token-utils";
14
14
  */
15
15
  export class DuetBanner {
16
16
  constructor() {
17
- this.checkBannerSize = () => {
17
+ this.checkCurrentSize = () => {
18
18
  const elementSize = this.element.clientWidth;
19
19
  if (elementSize < 500 || this.size === "small") {
20
20
  this.currentSize = "small";
@@ -31,12 +31,15 @@ export class DuetBanner {
31
31
  * Default to smaller button size for small and medium banners.
32
32
  */
33
33
  this.setButtonSize = () => {
34
- if (this.hasActionSlot) {
34
+ if (this.hasActionSlot && this.currentSize) {
35
35
  const buttons = this.element.querySelectorAll("[slot='action'] duet-button, duet-button[slot='action']");
36
36
  for (const button of buttons) {
37
37
  if (button && button.getAttribute("size") === null && this.currentSize !== "large") {
38
38
  button.size = "small";
39
39
  }
40
+ else if (button && button.getAttribute("size") === null && this.currentSize === "large") {
41
+ button.size = "medium";
42
+ }
40
43
  }
41
44
  }
42
45
  };
@@ -65,13 +68,13 @@ export class DuetBanner {
65
68
  this.setButtonSize();
66
69
  }
67
70
  connectedCallback() {
68
- window.addEventListener("resize", this.checkBannerSize);
71
+ window.addEventListener("resize", this.checkCurrentSize);
69
72
  }
70
73
  disconnectedCallback() {
71
- window.removeEventListener("resize", this.checkBannerSize);
74
+ window.removeEventListener("resize", this.checkCurrentSize);
72
75
  }
73
76
  componentDidRender() {
74
- this.checkBannerSize();
77
+ this.checkCurrentSize();
75
78
  }
76
79
  /**
77
80
  * render() function
@@ -92,7 +95,7 @@ export class DuetBanner {
92
95
  "duet-banner": true,
93
96
  "duet-theme-turva": this.theme === "turva",
94
97
  [this.currentSize]: true,
95
- }, style: bannerStyles }, h("div", { class: "visual" }, h("div", { class: "image-container" }, this.image && h(DuetPicture, Object.assign({}, pictureSource))), this.icon && (h("duet-icon", { theme: this.theme, class: "icon", name: this.icon, shape: "brand", size: this.currentSize === "large" ? "xx-large" : "x-large", color: this.iconColor, background: this.iconBackgroundColor, "background-rotation": "7", "background-opacity": "0.85", margin: "none" }))), h("div", { class: "content" }, this.hasHeadingSlot && (h("div", { class: "heading" }, h("duet-heading", { theme: this.theme, level: this.headingLevel, "visual-level": this.currentSize === "large" ? "h2" : "h3", "fixed-size": true, margin: "none", color: this.textColor }, h("span", null, h("slot", { name: "heading" }))))), this.hasDescriptionSlot && (h("div", { class: "description", style: { color } }, h("slot", { name: "description" }))), this.hasActionSlot && (h("div", { class: "action" }, h("slot", { name: "action" })))))));
98
+ }, style: bannerStyles }, h("div", { class: "visual" }, h("div", { class: "image-container" }, this.image && h(DuetPicture, Object.assign({}, pictureSource))), 1 > 2 && this.icon && (h("duet-icon", { theme: this.theme, class: "icon", name: this.icon, shape: "brand", size: this.currentSize === "large" ? "xx-large" : "x-large", color: this.iconColor, background: this.iconBackgroundColor, "background-rotation": "7", "background-opacity": "0.85", margin: "none" })), h("div", { class: "brand-shape" })), h("div", { class: "content" }, this.hasHeadingSlot && (h("div", { class: "heading" }, h("duet-heading", { theme: this.theme, level: this.headingLevel, "visual-level": this.currentSize === "large" ? "h2" : "h3", "fixed-size": true, margin: "none", color: this.textColor }, h("span", null, h("slot", { name: "heading" }))))), this.hasDescriptionSlot && (h("div", { class: "description", style: { color } }, h("slot", { name: "description" }))), this.hasActionSlot && (h("div", { class: "action" }, h("slot", { name: "action" })))))));
96
99
  }
97
100
  static get is() { return "duet-banner"; }
98
101
  static get encapsulation() { return "shadow"; }
@@ -84,4 +84,19 @@ describe("duet-choice-group", () => {
84
84
  const value = await choiceGroup.getProperty("value");
85
85
  expect(value).toBe("svenska");
86
86
  });
87
+ it("Should correctly update initial value if it's undefined", async () => {
88
+ const page = await createPage(`
89
+ <duet-choice-group label="This choice group has a tooltip" tooltip="Hello, I'm a tooltip!.">
90
+ <duet-choice label="Elainvakuutus" type="radio" value="one" expand></duet-choice>
91
+ <duet-choice label="Autovakuutus" type="radio" value="two" expand></duet-choice>
92
+ </duet-choice-group>
93
+ `);
94
+ const component = await page.find("duet-choice-group");
95
+ const initialValue = await component.callMethod("getInitialValue");
96
+ expect(initialValue).toBeUndefined();
97
+ component.setProperty("value", "one");
98
+ await page.waitForTimeout(100);
99
+ const initialValueAfterSet = await component.callMethod("getInitialValue");
100
+ expect(initialValueAfterSet).toBe("one");
101
+ });
87
102
  });
@@ -80,6 +80,13 @@ export class DuetChoiceGroup {
80
80
  this.initialValue = this.value;
81
81
  }
82
82
  }
83
+ /**
84
+ * @internal
85
+ * Get initial value
86
+ */
87
+ async getInitialValue() {
88
+ return this.initialValue;
89
+ }
83
90
  /**
84
91
  * Local methods
85
92
  */
@@ -461,6 +468,30 @@ export class DuetChoiceGroup {
461
468
  }
462
469
  };
463
470
  }
471
+ static get methods() {
472
+ return {
473
+ "getInitialValue": {
474
+ "complexType": {
475
+ "signature": "() => Promise<string>",
476
+ "parameters": [],
477
+ "references": {
478
+ "Promise": {
479
+ "location": "global",
480
+ "id": "global::Promise"
481
+ }
482
+ },
483
+ "return": "Promise<string>"
484
+ },
485
+ "docs": {
486
+ "text": "",
487
+ "tags": [{
488
+ "name": "internal",
489
+ "text": "Get initial value"
490
+ }]
491
+ }
492
+ }
493
+ };
494
+ }
464
495
  static get elementRef() { return "element"; }
465
496
  static get watchers() {
466
497
  return [{
@@ -150,6 +150,9 @@ button {
150
150
  .block.duet-link.none {
151
151
  padding: 0;
152
152
  }
153
+ .block .block__icon {
154
+ display: flex;
155
+ }
153
156
  .block .block__content {
154
157
  position: relative;
155
158
  bottom: 2px;
@@ -24,6 +24,8 @@ export class DuetLink {
24
24
  this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
25
25
  this.accessibleLabelDownloadDefaults = DuetStringsDownloadLinkDefaults;
26
26
  this.accessibleLabelDownload = getLocaleString(this.accessibleLabelDownloadDefaults);
27
+ this.accessibleExpanded = undefined;
28
+ this.accessiblePopup = "false";
27
29
  this.identifier = undefined;
28
30
  this.theme = "";
29
31
  this.url = "#";
@@ -141,6 +143,7 @@ export class DuetLink {
141
143
  */
142
144
  render() {
143
145
  const Tag = !this.url ? "button" : "a";
146
+ const isButton = Tag === "button";
144
147
  return (h(Host, { class: {
145
148
  [`duet-link-${this.variation}`]: true,
146
149
  "duet-m-0": this.margin === "none",
@@ -155,7 +158,7 @@ export class DuetLink {
155
158
  "duet-p-0": this.padding === "none",
156
159
  [this.padding]: true,
157
160
  [this.variation]: true,
158
- }, target: this.download || !this.url ? null : this.external ? "_blank" : "_self", download: this.resolvedDownload, "aria-label": this.getAccessibleLabel(), id: this.identifier, ref: el => (this.nativeLink = el), part: "duet-link", rel: this.external ? "noopener" : undefined }, this.renderContent())));
161
+ }, target: this.download || !this.url ? null : this.external ? "_blank" : "_self", download: this.resolvedDownload, "aria-label": this.getAccessibleLabel(), "aria-expanded": this.accessibleExpanded != null && isButton ? this.accessibleExpanded.toString() : undefined, "aria-haspopup": this.accessiblePopup != null && isButton ? this.accessiblePopup.toString() : undefined, id: this.identifier, ref: el => (this.nativeLink = el), part: "duet-link", rel: this.external ? "noopener" : undefined }, this.renderContent())));
159
162
  }
160
163
  static get is() { return "duet-link"; }
161
164
  static get encapsulation() { return "shadow"; }
@@ -339,6 +342,41 @@ export class DuetLink {
339
342
  "reflect": false,
340
343
  "defaultValue": "getLocaleString(this.accessibleLabelDownloadDefaults)"
341
344
  },
345
+ "accessibleExpanded": {
346
+ "type": "boolean",
347
+ "mutable": true,
348
+ "complexType": {
349
+ "original": "boolean",
350
+ "resolved": "boolean",
351
+ "references": {}
352
+ },
353
+ "required": false,
354
+ "optional": false,
355
+ "docs": {
356
+ "tags": [],
357
+ "text": "If a button expands or collapses adjacent content, then use the ariaExpanded\nprop to add the aria-expanded attribute to the button. Set the value to convey\nthe current expanded (true) or collapsed (false) state of the content.\nOnly works with empty url."
358
+ },
359
+ "attribute": "accessible-expanded",
360
+ "reflect": true
361
+ },
362
+ "accessiblePopup": {
363
+ "type": "string",
364
+ "mutable": true,
365
+ "complexType": {
366
+ "original": "string",
367
+ "resolved": "string",
368
+ "references": {}
369
+ },
370
+ "required": false,
371
+ "optional": false,
372
+ "docs": {
373
+ "tags": [],
374
+ "text": "Use this property to add an aria-haspopup attribute to a button. Only works with empty url."
375
+ },
376
+ "attribute": "accessible-popup",
377
+ "reflect": true,
378
+ "defaultValue": "\"false\""
379
+ },
342
380
  "identifier": {
343
381
  "type": "string",
344
382
  "mutable": false,
@@ -45,6 +45,16 @@
45
45
  .duet-theme-turva .duet-menu-bar-button:focus, .duet-menu-bar-button:focus.duet-theme-turva {
46
46
  box-shadow: 0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a;
47
47
  }
48
+ .duet-menu-bar-button .menu-bar-button-icon {
49
+ width: 20px;
50
+ height: 20px;
51
+ }
52
+ @media (min-width: 62em) {
53
+ .duet-menu-bar-button .menu-bar-button-icon {
54
+ width: 16px;
55
+ height: 16px;
56
+ }
57
+ }
48
58
  .duet-menu-bar-button.duet-theme-turva {
49
59
  font-family: "turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
50
60
  }
@@ -1,22 +1,10 @@
1
1
  /*!
2
2
  * Built with Duet Design System
3
3
  */
4
- import { media_query_large } from "@duetds/tokens/lib/tokens.json";
5
4
  import { h, Host } from "@stencil/core";
6
5
  import { inheritGlobalTheme } from "../../common/themeable-component";
7
6
  export class DuetMenuBarButton {
8
7
  constructor() {
9
- this.mql = [window.matchMedia(media_query_large.replace(/'/g, ""))];
10
- this.boundMqlFunctions = [];
11
- this.changeIconSize = () => {
12
- if (this.mql[0].matches) {
13
- this.iconSize = "x-small";
14
- }
15
- else {
16
- this.iconSize = "small";
17
- }
18
- };
19
- this.iconSize = "x-small";
20
8
  this.accessibleLabel = undefined;
21
9
  this.accessibleControls = undefined;
22
10
  this.accessiblePopup = "false";
@@ -37,26 +25,6 @@ export class DuetMenuBarButton {
37
25
  componentWillLoad() {
38
26
  inheritGlobalTheme(this);
39
27
  }
40
- connectedCallback() {
41
- this.changeIconSize();
42
- for (let i = 0; i < this.mql.length; i++) {
43
- // addEventListener is not available in Stencil hydrate
44
- if (this.mql[i].addEventListener) {
45
- const bound = this.changeIconSize.bind(this);
46
- this.mql[i].addEventListener("change", bound);
47
- this.boundMqlFunctions[i] = bound;
48
- }
49
- }
50
- }
51
- disconnectedCallback() {
52
- for (let i = 0; i < this.mql.length; i++) {
53
- // removeEventListener is not available in Stencil hydrate
54
- if (this.mql[i].removeEventListener) {
55
- this.mql[i].removeEventListener("change", this.boundMqlFunctions[i]);
56
- }
57
- }
58
- this.boundMqlFunctions = [];
59
- }
60
28
  /**
61
29
  * Sets focus on underlying button element.
62
30
  */
@@ -73,7 +41,7 @@ export class DuetMenuBarButton {
73
41
  return (h(Host, { role: "listitem", onfocus: () => this.setFocus() }, h("button", { ref: button => (this.nativeButton = button), class: {
74
42
  "duet-menu-bar-button": true,
75
43
  "duet-theme-turva": this.theme === "turva",
76
- }, "aria-controls": this.accessibleControls, "aria-label": this.accessibleLabel, "aria-expanded": this.accessibleExpanded != null ? this.accessibleExpanded.toString() : undefined, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": this.accessibleDescribedBy, "aria-labelledby": this.accessibleLabelledBy, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, "aria-pressed": this.accessiblePressed != null ? this.accessiblePressed.toString() : undefined, "aria-haspopup": this.accessiblePopup != null ? this.accessiblePopup.toString() : undefined }, this.icon && (h("duet-icon", { theme: this.theme, size: this.iconSize, name: this.icon, margin: "none", color: "currentColor" })), h("slot", null))));
44
+ }, "aria-controls": this.accessibleControls, "aria-label": this.accessibleLabel, "aria-expanded": this.accessibleExpanded != null ? this.accessibleExpanded.toString() : undefined, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": this.accessibleDescribedBy, "aria-labelledby": this.accessibleLabelledBy, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, "aria-pressed": this.accessiblePressed != null ? this.accessiblePressed.toString() : undefined, "aria-haspopup": this.accessiblePopup != null ? this.accessiblePopup.toString() : undefined }, this.icon && (h("duet-icon", { class: "menu-bar-button-icon", theme: this.theme, size: "auto", name: this.icon, margin: "none", color: "currentColor" })), h("slot", null))));
77
45
  }
78
46
  static get is() { return "duet-menu-bar-button"; }
79
47
  static get encapsulation() { return "shadow"; }
@@ -324,11 +292,6 @@ export class DuetMenuBarButton {
324
292
  }
325
293
  };
326
294
  }
327
- static get states() {
328
- return {
329
- "iconSize": {}
330
- };
331
- }
332
295
  static get methods() {
333
296
  return {
334
297
  "setFocus": {
@@ -103,6 +103,16 @@
103
103
  .duet-theme-turva .duet-menu-bar-dropdown button.active::after {
104
104
  background: rgb(198, 12, 48);
105
105
  }
106
+ .duet-menu-bar-dropdown .menu-bar-dropdown-icon {
107
+ width: 20px;
108
+ height: 20px;
109
+ }
110
+ @media (min-width: 62em) {
111
+ .duet-menu-bar-dropdown .menu-bar-dropdown-icon {
112
+ width: 16px;
113
+ height: 16px;
114
+ }
115
+ }
106
116
  .duet-menu-bar-dropdown .items {
107
117
  position: absolute;
108
118
  top: 70%;