@swisspost/design-system-components 1.3.10 → 1.4.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 (110) hide show
  1. package/dist/cjs/check-non-empty-35b4d0b5.js +14 -0
  2. package/dist/cjs/check-non-empty-35b4d0b5.js.map +1 -0
  3. package/dist/cjs/{package-f6bb523d.js → check-type-f24cf91d.js} +1 -4
  4. package/dist/cjs/{package-f6bb523d.js.map → check-type-f24cf91d.js.map} +1 -1
  5. package/dist/cjs/{index-272283b3.js → index-50d7d035.js} +15 -1
  6. package/dist/cjs/index-50d7d035.js.map +1 -0
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/package-e8a6597e.js +7 -0
  9. package/dist/cjs/package-e8a6597e.js.map +1 -0
  10. package/dist/cjs/post-collapsible.cjs.entry.js +5 -4
  11. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  12. package/dist/cjs/post-components.cjs.js +2 -2
  13. package/dist/cjs/post-icon.cjs.entry.js +9 -15
  14. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  15. package/dist/cjs/post-tab-header.cjs.entry.js +35 -0
  16. package/dist/cjs/post-tab-header.cjs.entry.js.map +1 -0
  17. package/dist/cjs/post-tab-panel.cjs.entry.js +29 -0
  18. package/dist/cjs/post-tab-panel.cjs.entry.js.map +1 -0
  19. package/dist/cjs/post-tabs.cjs.entry.js +141 -0
  20. package/dist/cjs/post-tabs.cjs.entry.js.map +1 -0
  21. package/dist/collection/animations/fade.js +6 -0
  22. package/dist/collection/animations/fade.js.map +1 -0
  23. package/dist/collection/animations/index.js +2 -0
  24. package/dist/collection/animations/index.js.map +1 -0
  25. package/dist/collection/collection-manifest.json +4 -1
  26. package/dist/collection/components/post-tab-header/post-tab-header.css +337 -0
  27. package/dist/collection/components/post-tab-header/post-tab-header.js +68 -0
  28. package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -0
  29. package/dist/collection/components/post-tab-panel/post-tab-panel.css +3 -0
  30. package/dist/collection/components/post-tab-panel/post-tab-panel.js +55 -0
  31. package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -0
  32. package/dist/collection/components/post-tabs/post-tabs.css +148 -0
  33. package/dist/collection/components/post-tabs/post-tabs.js +208 -0
  34. package/dist/collection/components/post-tabs/post-tabs.js.map +1 -0
  35. package/dist/components/check-non-empty.js +11 -0
  36. package/dist/components/check-non-empty.js.map +1 -0
  37. package/dist/{esm/package-bcf00737.js → components/check-type.js} +2 -4
  38. package/dist/components/check-type.js.map +1 -0
  39. package/dist/components/package.js +2 -20
  40. package/dist/components/package.js.map +1 -1
  41. package/dist/components/post-collapsible.js +2 -1
  42. package/dist/components/post-collapsible.js.map +1 -1
  43. package/dist/components/post-icon.js +3 -9
  44. package/dist/components/post-icon.js.map +1 -1
  45. package/dist/components/post-tab-header.d.ts +11 -0
  46. package/dist/components/post-tab-header.js +52 -0
  47. package/dist/components/post-tab-header.js.map +1 -0
  48. package/dist/components/post-tab-panel.d.ts +11 -0
  49. package/dist/components/post-tab-panel.js +46 -0
  50. package/dist/components/post-tab-panel.js.map +1 -0
  51. package/dist/components/post-tabs.d.ts +11 -0
  52. package/dist/components/post-tabs.js +158 -0
  53. package/dist/components/post-tabs.js.map +1 -0
  54. package/dist/docs.json +131 -1
  55. package/dist/esm/check-non-empty-554bdf88.js +11 -0
  56. package/dist/esm/check-non-empty-554bdf88.js.map +1 -0
  57. package/dist/esm/check-type-67411ed3.js +21 -0
  58. package/dist/esm/check-type-67411ed3.js.map +1 -0
  59. package/dist/esm/{index-60a84798.js → index-cc0e53f0.js} +15 -2
  60. package/dist/esm/index-cc0e53f0.js.map +1 -0
  61. package/dist/esm/loader.js +3 -3
  62. package/dist/esm/package-b514d0f6.js +5 -0
  63. package/dist/esm/package-b514d0f6.js.map +1 -0
  64. package/dist/esm/post-collapsible.entry.js +3 -2
  65. package/dist/esm/post-collapsible.entry.js.map +1 -1
  66. package/dist/esm/post-components.js +3 -3
  67. package/dist/esm/post-icon.entry.js +4 -10
  68. package/dist/esm/post-icon.entry.js.map +1 -1
  69. package/dist/esm/post-tab-header.entry.js +31 -0
  70. package/dist/esm/post-tab-header.entry.js.map +1 -0
  71. package/dist/esm/post-tab-panel.entry.js +25 -0
  72. package/dist/esm/post-tab-panel.entry.js.map +1 -0
  73. package/dist/esm/post-tabs.entry.js +137 -0
  74. package/dist/esm/post-tabs.entry.js.map +1 -0
  75. package/dist/post-components/p-1388585d.entry.js +2 -0
  76. package/dist/post-components/p-1388585d.entry.js.map +1 -0
  77. package/dist/post-components/p-58916755.js +2 -0
  78. package/dist/post-components/p-58916755.js.map +1 -0
  79. package/dist/post-components/p-5b3445dc.entry.js +2 -0
  80. package/dist/post-components/p-5b3445dc.entry.js.map +1 -0
  81. package/dist/post-components/p-6341b9b4.js +3 -0
  82. package/dist/post-components/p-6341b9b4.js.map +1 -0
  83. package/dist/post-components/p-6dad6a8a.entry.js +2 -0
  84. package/dist/post-components/{p-99ccf0cf.entry.js.map → p-6dad6a8a.entry.js.map} +1 -1
  85. package/dist/post-components/p-b95ec099.entry.js +2 -0
  86. package/dist/post-components/p-b95ec099.entry.js.map +1 -0
  87. package/dist/post-components/p-c8efe0ae.js +2 -0
  88. package/dist/post-components/p-c8efe0ae.js.map +1 -0
  89. package/dist/post-components/p-cc92afb7.entry.js +2 -0
  90. package/dist/post-components/p-cc92afb7.entry.js.map +1 -0
  91. package/dist/post-components/p-f549b3fc.js +2 -0
  92. package/dist/post-components/{p-4a3ff4c0.js.map → p-f549b3fc.js.map} +1 -1
  93. package/dist/post-components/post-components.esm.js +1 -1
  94. package/dist/post-components/post-components.esm.js.map +1 -1
  95. package/dist/types/animations/fade.d.ts +2 -0
  96. package/dist/types/animations/index.d.ts +1 -0
  97. package/dist/types/components/post-tab-header/post-tab-header.d.ts +11 -0
  98. package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +10 -0
  99. package/dist/types/components/post-tabs/post-tabs.d.ts +34 -0
  100. package/dist/types/components.d.ts +75 -0
  101. package/package.json +6 -6
  102. package/dist/cjs/index-272283b3.js.map +0 -1
  103. package/dist/esm/index-60a84798.js.map +0 -1
  104. package/dist/esm/package-bcf00737.js.map +0 -1
  105. package/dist/post-components/p-0096c140.js +0 -3
  106. package/dist/post-components/p-0096c140.js.map +0 -1
  107. package/dist/post-components/p-4a3ff4c0.js +0 -2
  108. package/dist/post-components/p-99ccf0cf.entry.js +0 -2
  109. package/dist/post-components/p-cafa0281.entry.js +0 -2
  110. package/dist/post-components/p-cafa0281.entry.js.map +0 -1
@@ -0,0 +1,337 @@
1
+ /**
2
+ * Colors used by the post style guide
3
+ */
4
+ /**
5
+ * Maps. Allow maps to have custom colors from the project
6
+ * by always merging into a default empty map
7
+ */
8
+ .tab-title {
9
+ display: inline-block;
10
+ position: relative;
11
+ box-sizing: border-box;
12
+ padding: 1rem;
13
+ transition: background-color 100ms;
14
+ border-right: 1px solid transparent;
15
+ border-left: 1px solid transparent;
16
+ outline-color: currentColor;
17
+ opacity: 0.7;
18
+ color: var(--post-contrast-color);
19
+ text-decoration: none;
20
+ }
21
+ .tab-title:focus {
22
+ background-color: unset;
23
+ color: var(--post-contrast-color);
24
+ }
25
+ .tab-title:hover {
26
+ opacity: 1;
27
+ background-color: #fff;
28
+ color: var(--post-contrast-color);
29
+ }
30
+ .tab-title:focus-visible {
31
+ outline: transparent;
32
+ opacity: 1;
33
+ background-color: #fff;
34
+ color: var(--post-contrast-color);
35
+ box-shadow: none;
36
+ }
37
+ .tab-title:focus-visible::after {
38
+ content: "";
39
+ display: block;
40
+ position: absolute;
41
+ top: 2px;
42
+ right: 1px;
43
+ bottom: 0;
44
+ left: 1px;
45
+ box-shadow: 0 0 0 1px #fff, 0 0 0 2px hsl(0, 0%, 20%);
46
+ }
47
+ .tab-title.active {
48
+ z-index: 1;
49
+ border-right-color: hsl(0, 0%, 80%);
50
+ border-left-color: hsl(0, 0%, 80%);
51
+ opacity: 1;
52
+ background-color: #fff;
53
+ color: var(--post-contrast-color);
54
+ font-weight: 700;
55
+ }
56
+ .tab-title.active::before {
57
+ content: "";
58
+ display: block;
59
+ position: absolute;
60
+ top: 0;
61
+ right: -1px;
62
+ left: -1px;
63
+ height: 0.25rem;
64
+ background-color: #fc0;
65
+ }
66
+ :is(.bg-dark, .bg-primary, .bg-black, .bg-danger, .bg-nightblue, .bg-nightblue-bright, .bg-petrol, .bg-coral, .bg-olive, .bg-purple, .bg-purple-bright, .bg-aubergine, .bg-aubergine-bright) .tab-title:hover {
67
+ background-color: rgba(255, 255, 255, 0.2);
68
+ }
69
+ :is(.bg-dark, .bg-primary, .bg-black, .bg-danger, .bg-nightblue, .bg-nightblue-bright, .bg-petrol, .bg-coral, .bg-olive, .bg-purple, .bg-purple-bright, .bg-aubergine, .bg-aubergine-bright) .tab-title:focus-visible {
70
+ background-color: rgba(255, 255, 255, 0.2);
71
+ }
72
+ @media (forced-colors: active), (-ms-high-contrast: active), (-ms-high-contrast: white-on-black) {
73
+ .tab-title {
74
+ opacity: 1;
75
+ border-left-color: Canvas;
76
+ border-right-color: Canvas;
77
+ color: LinkText;
78
+ }
79
+ .tab-title:hover, .tab-title:focus, .tab-title:focus-within, .tab-title:focus-visible {
80
+ outline: 2px solid Highlight;
81
+ outline-offset: -0.25rem;
82
+ }
83
+ .tab-title.active {
84
+ border-left-color: ButtonText;
85
+ border-right-color: ButtonText;
86
+ color: Highlight;
87
+ }
88
+ .tab-title.active::before {
89
+ background-color: Highlight;
90
+ }
91
+ }
92
+
93
+ .bg-yellow .tab-title {
94
+ background-color: #fc0;
95
+ }
96
+ .bg-yellow .tab-title.active {
97
+ background-color: #fc0;
98
+ }
99
+ .bg-yellow .nav-item {
100
+ background-color: #fc0;
101
+ }
102
+
103
+ .bg-light .tab-title {
104
+ background-color: #faf9f8;
105
+ }
106
+ .bg-light .tab-title.active {
107
+ background-color: #faf9f8;
108
+ }
109
+ .bg-light .nav-item {
110
+ background-color: #faf9f8;
111
+ }
112
+
113
+ .bg-gray .tab-title {
114
+ background-color: #f4f3f1;
115
+ }
116
+ .bg-gray .tab-title.active {
117
+ background-color: #f4f3f1;
118
+ }
119
+ .bg-gray .nav-item {
120
+ background-color: #f4f3f1;
121
+ }
122
+
123
+ .bg-dark .tab-title {
124
+ background-color: hsl(0, 0%, 20%);
125
+ }
126
+ .bg-dark .tab-title.active {
127
+ background-color: hsl(0, 0%, 20%);
128
+ }
129
+ .bg-dark .nav-item {
130
+ background-color: hsl(0, 0%, 20%);
131
+ }
132
+
133
+ .bg-primary .tab-title {
134
+ background-color: hsl(0, 0%, 20%);
135
+ }
136
+ .bg-primary .tab-title.active {
137
+ background-color: hsl(0, 0%, 20%);
138
+ }
139
+ .bg-primary .nav-item {
140
+ background-color: hsl(0, 0%, 20%);
141
+ }
142
+
143
+ .bg-white .tab-title {
144
+ background-color: #fff;
145
+ }
146
+ .bg-white .tab-title.active {
147
+ background-color: #fff;
148
+ }
149
+ .bg-white .nav-item {
150
+ background-color: #fff;
151
+ }
152
+
153
+ .bg-black .tab-title {
154
+ background-color: #000;
155
+ }
156
+ .bg-black .tab-title.active {
157
+ background-color: #000;
158
+ }
159
+ .bg-black .nav-item {
160
+ background-color: #000;
161
+ }
162
+
163
+ .bg-success .tab-title {
164
+ background-color: #2c911c;
165
+ }
166
+ .bg-success .tab-title.active {
167
+ background-color: #2c911c;
168
+ }
169
+ .bg-success .nav-item {
170
+ background-color: #2c911c;
171
+ }
172
+
173
+ .bg-info .tab-title {
174
+ background-color: #cce4ee;
175
+ }
176
+ .bg-info .tab-title.active {
177
+ background-color: #cce4ee;
178
+ }
179
+ .bg-info .nav-item {
180
+ background-color: #cce4ee;
181
+ }
182
+
183
+ .bg-warning .tab-title {
184
+ background-color: #f49e00;
185
+ }
186
+ .bg-warning .tab-title.active {
187
+ background-color: #f49e00;
188
+ }
189
+ .bg-warning .nav-item {
190
+ background-color: #f49e00;
191
+ }
192
+
193
+ .bg-danger .tab-title {
194
+ background-color: #a51728;
195
+ }
196
+ .bg-danger .tab-title.active {
197
+ background-color: #a51728;
198
+ }
199
+ .bg-danger .nav-item {
200
+ background-color: #a51728;
201
+ }
202
+
203
+ .bg-nightblue .tab-title {
204
+ background-color: #004976;
205
+ }
206
+ .bg-nightblue .tab-title.active {
207
+ background-color: #004976;
208
+ }
209
+ .bg-nightblue .nav-item {
210
+ background-color: #004976;
211
+ }
212
+
213
+ .bg-nightblue-bright .tab-title {
214
+ background-color: #0076a8;
215
+ }
216
+ .bg-nightblue-bright .tab-title.active {
217
+ background-color: #0076a8;
218
+ }
219
+ .bg-nightblue-bright .nav-item {
220
+ background-color: #0076a8;
221
+ }
222
+
223
+ .bg-petrol .tab-title {
224
+ background-color: #006d68;
225
+ }
226
+ .bg-petrol .tab-title.active {
227
+ background-color: #006d68;
228
+ }
229
+ .bg-petrol .nav-item {
230
+ background-color: #006d68;
231
+ }
232
+
233
+ .bg-petrol-bright .tab-title {
234
+ background-color: #00968f;
235
+ }
236
+ .bg-petrol-bright .tab-title.active {
237
+ background-color: #00968f;
238
+ }
239
+ .bg-petrol-bright .nav-item {
240
+ background-color: #00968f;
241
+ }
242
+
243
+ .bg-coral .tab-title {
244
+ background-color: #9e2a2f;
245
+ }
246
+ .bg-coral .tab-title.active {
247
+ background-color: #9e2a2f;
248
+ }
249
+ .bg-coral .nav-item {
250
+ background-color: #9e2a2f;
251
+ }
252
+
253
+ .bg-coral-bright .tab-title {
254
+ background-color: #e03c31;
255
+ }
256
+ .bg-coral-bright .tab-title.active {
257
+ background-color: #e03c31;
258
+ }
259
+ .bg-coral-bright .nav-item {
260
+ background-color: #e03c31;
261
+ }
262
+
263
+ .bg-olive .tab-title {
264
+ background-color: #716135;
265
+ }
266
+ .bg-olive .tab-title.active {
267
+ background-color: #716135;
268
+ }
269
+ .bg-olive .nav-item {
270
+ background-color: #716135;
271
+ }
272
+
273
+ .bg-olive-bright .tab-title {
274
+ background-color: #aa9d2e;
275
+ }
276
+ .bg-olive-bright .tab-title.active {
277
+ background-color: #aa9d2e;
278
+ }
279
+ .bg-olive-bright .nav-item {
280
+ background-color: #aa9d2e;
281
+ }
282
+
283
+ .bg-purple .tab-title {
284
+ background-color: #80276c;
285
+ }
286
+ .bg-purple .tab-title.active {
287
+ background-color: #80276c;
288
+ }
289
+ .bg-purple .nav-item {
290
+ background-color: #80276c;
291
+ }
292
+
293
+ .bg-purple-bright .tab-title {
294
+ background-color: #c5299b;
295
+ }
296
+ .bg-purple-bright .tab-title.active {
297
+ background-color: #c5299b;
298
+ }
299
+ .bg-purple-bright .nav-item {
300
+ background-color: #c5299b;
301
+ }
302
+
303
+ .bg-aubergine .tab-title {
304
+ background-color: #523178;
305
+ }
306
+ .bg-aubergine .tab-title.active {
307
+ background-color: #523178;
308
+ }
309
+ .bg-aubergine .nav-item {
310
+ background-color: #523178;
311
+ }
312
+
313
+ .bg-aubergine-bright .tab-title {
314
+ background-color: #7566a0;
315
+ }
316
+ .bg-aubergine-bright .tab-title.active {
317
+ background-color: #7566a0;
318
+ }
319
+ .bg-aubergine-bright .nav-item {
320
+ background-color: #7566a0;
321
+ }
322
+
323
+ [class*=bg-] .tab-title.active:focus::after {
324
+ background-color: rgba(255, 255, 255, 0.2);
325
+ }
326
+ @supports selector(*:focus-visible) {
327
+ [class*=bg-] .tab-title.active:focus::after {
328
+ background-color: unset;
329
+ }
330
+ [class*=bg-] .tab-title.active:focus-visible::after {
331
+ background-color: rgba(255, 255, 255, 0.2);
332
+ }
333
+ }
334
+
335
+ :host {
336
+ display: block;
337
+ }
@@ -0,0 +1,68 @@
1
+ import { h, Host } from '@stencil/core';
2
+ import { version } from '../../../package.json';
3
+ import { checkNonEmpty } from '../../utils';
4
+ export class PostTabHeader {
5
+ constructor() {
6
+ this.tabId = undefined;
7
+ this.panel = undefined;
8
+ }
9
+ validateFor(newValue) {
10
+ checkNonEmpty(newValue, 'The "panel" prop is required for the post-tab-header.');
11
+ }
12
+ componentWillLoad() {
13
+ this.tabId = `tab-${this.host.id || crypto.randomUUID()}`;
14
+ }
15
+ render() {
16
+ return (h(Host, { "data-version": version }, h("li", { class: "nav-item" }, h("a", { "aria-selected": "false", class: "tab-title nav-link", href: "#", id: this.tabId, role: "tab" }, h("slot", null)))));
17
+ }
18
+ static get is() { return "post-tab-header"; }
19
+ static get encapsulation() { return "shadow"; }
20
+ static get originalStyleUrls() {
21
+ return {
22
+ "$": ["post-tab-header.scss"]
23
+ };
24
+ }
25
+ static get styleUrls() {
26
+ return {
27
+ "$": ["post-tab-header.css"]
28
+ };
29
+ }
30
+ static get properties() {
31
+ return {
32
+ "panel": {
33
+ "type": "string",
34
+ "mutable": false,
35
+ "complexType": {
36
+ "original": "HTMLPostTabPanelElement['name']",
37
+ "resolved": "string",
38
+ "references": {
39
+ "HTMLPostTabPanelElement": {
40
+ "location": "global"
41
+ }
42
+ }
43
+ },
44
+ "required": false,
45
+ "optional": false,
46
+ "docs": {
47
+ "tags": [],
48
+ "text": "The name of the panel controlled by the tab header."
49
+ },
50
+ "attribute": "panel",
51
+ "reflect": false
52
+ }
53
+ };
54
+ }
55
+ static get states() {
56
+ return {
57
+ "tabId": {}
58
+ };
59
+ }
60
+ static get elementRef() { return "host"; }
61
+ static get watchers() {
62
+ return [{
63
+ "propName": "panel",
64
+ "methodName": "validateFor"
65
+ }];
66
+ }
67
+ }
68
+ //# sourceMappingURL=post-tab-header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-tab-header.js","sourceRoot":"","sources":["../../../../src/components/post-tab-header/post-tab-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAO5C,MAAM,OAAO,aAAa;;;;;EAWxB,WAAW,CAAC,QAAyC;IACnD,aAAa,CAAC,QAAQ,EAAE,uDAAuD,CAAC,CAAC;EACnF,CAAC;EAED,iBAAiB;IACf,IAAI,CAAC,KAAK,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;EAC5D,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,oBAAe,OAAO;MACzB,UAAI,KAAK,EAAC,UAAU;QAClB,0BACgB,OAAO,EACrB,KAAK,EAAC,oBAAoB,EAC1B,IAAI,EAAC,GAAG,EACR,EAAE,EAAE,IAAI,CAAC,KAAK,EACd,IAAI,EAAC,KAAK;UAEV,eAAO,CACL,CACD,CACA,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { version } from '../../../package.json';\nimport { checkNonEmpty } from '../../utils';\n\n@Component({\n tag: 'post-tab-header',\n styleUrl: 'post-tab-header.scss',\n shadow: true,\n})\nexport class PostTabHeader {\n @Element() host: HTMLPostTabHeaderElement;\n\n @State() tabId: string;\n\n /**\n * The name of the panel controlled by the tab header.\n */\n @Prop() readonly panel: HTMLPostTabPanelElement['name'];\n\n @Watch('panel')\n validateFor(newValue: HTMLPostTabPanelElement['name']) {\n checkNonEmpty(newValue, 'The \"panel\" prop is required for the post-tab-header.');\n }\n\n componentWillLoad() {\n this.tabId = `tab-${this.host.id || crypto.randomUUID()}`;\n }\n\n render() {\n return (\n <Host data-version={version}>\n <li class=\"nav-item\">\n <a\n aria-selected=\"false\"\n class=\"tab-title nav-link\"\n href=\"#\"\n id={this.tabId}\n role=\"tab\"\n >\n <slot/>\n </a>\n </li>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: none;
3
+ }
@@ -0,0 +1,55 @@
1
+ import { h, Host } from '@stencil/core';
2
+ import { version } from '../../../package.json';
3
+ export class PostTabPanel {
4
+ constructor() {
5
+ this.panelId = undefined;
6
+ this.name = undefined;
7
+ }
8
+ componentWillLoad() {
9
+ // get the id set on the host element or use a random id by default
10
+ this.panelId = `panel-${this.host.id || crypto.randomUUID()}`;
11
+ }
12
+ render() {
13
+ return (h(Host, { "data-version": version }, h("div", { class: "tab-pane", id: this.panelId, role: "tabpanel" }, h("slot", null))));
14
+ }
15
+ static get is() { return "post-tab-panel"; }
16
+ static get encapsulation() { return "shadow"; }
17
+ static get originalStyleUrls() {
18
+ return {
19
+ "$": ["post-tab-panel.scss"]
20
+ };
21
+ }
22
+ static get styleUrls() {
23
+ return {
24
+ "$": ["post-tab-panel.css"]
25
+ };
26
+ }
27
+ static get properties() {
28
+ return {
29
+ "name": {
30
+ "type": "string",
31
+ "mutable": false,
32
+ "complexType": {
33
+ "original": "string",
34
+ "resolved": "string",
35
+ "references": {}
36
+ },
37
+ "required": false,
38
+ "optional": false,
39
+ "docs": {
40
+ "tags": [],
41
+ "text": "The name of the panel, used to associate it with a tab header."
42
+ },
43
+ "attribute": "name",
44
+ "reflect": false
45
+ }
46
+ };
47
+ }
48
+ static get states() {
49
+ return {
50
+ "panelId": {}
51
+ };
52
+ }
53
+ static get elementRef() { return "host"; }
54
+ }
55
+ //# sourceMappingURL=post-tab-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-tab-panel.js","sourceRoot":"","sources":["../../../../src/components/post-tab-panel/post-tab-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAOhD,MAAM,OAAO,YAAY;;;;;EAUvB,iBAAiB;IACf,mEAAmE;IACnE,IAAI,CAAC,OAAO,GAAG,SAAS,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;EAChE,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,oBAAe,OAAO;MACzB,WACE,KAAK,EAAC,UAAU,EAChB,EAAE,EAAE,IAAI,CAAC,OAAO,EAChB,IAAI,EAAC,UAAU;QAEf,eAAO,CACH,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, State } from '@stencil/core';\nimport { version } from '../../../package.json';\n\n@Component({\n tag: 'post-tab-panel',\n styleUrl: 'post-tab-panel.scss',\n shadow: true,\n})\nexport class PostTabPanel {\n @Element() host: HTMLPostTabPanelElement;\n\n @State() panelId: string;\n\n /**\n * The name of the panel, used to associate it with a tab header.\n */\n @Prop() readonly name: string;\n\n componentWillLoad() {\n // get the id set on the host element or use a random id by default\n this.panelId = `panel-${this.host.id || crypto.randomUUID()}`;\n }\n\n render() {\n return (\n <Host data-version={version}>\n <div\n class=\"tab-pane\"\n id={this.panelId}\n role=\"tabpanel\"\n >\n <slot/>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Colors used by the post style guide
3
+ */
4
+ /**
5
+ * Maps. Allow maps to have custom colors from the project
6
+ * by always merging into a default empty map
7
+ */
8
+ .tabs-wrapper {
9
+ position: relative;
10
+ padding-top: 1rem;
11
+ border: 0;
12
+ background-color: #faf9f8;
13
+ }
14
+ .tabs-wrapper::after {
15
+ content: "";
16
+ position: absolute;
17
+ bottom: 0;
18
+ width: 100%;
19
+ height: 1px;
20
+ background-color: hsl(0, 0%, 80%);
21
+ }
22
+ .tabs-wrapper .tabs {
23
+ background-color: transparent !important;
24
+ }
25
+ @media (forced-colors: active), (-ms-high-contrast: active), (-ms-high-contrast: white-on-black) {
26
+ .tabs-wrapper::after {
27
+ background-color: ButtonBorder;
28
+ }
29
+ }
30
+
31
+ .tabs {
32
+ margin: 0;
33
+ padding: 0;
34
+ list-style: none;
35
+ display: flex;
36
+ flex-wrap: nowrap;
37
+ overflow-x: auto;
38
+ /* prevent scroll chaining on x scroll */
39
+ overscroll-behavior-x: contain;
40
+ white-space: nowrap;
41
+ }
42
+ .tabs::after {
43
+ content: "";
44
+ display: block;
45
+ flex: 1 0 auto;
46
+ width: 1rem;
47
+ }
48
+
49
+ .tab-content {
50
+ padding-top: 1rem;
51
+ padding-bottom: 1rem;
52
+ }
53
+
54
+ .bg-yellow .tabs-wrapper {
55
+ background-color: #fc0;
56
+ }
57
+
58
+ .bg-light .tabs-wrapper {
59
+ background-color: #faf9f8;
60
+ }
61
+
62
+ .bg-gray .tabs-wrapper {
63
+ background-color: #f4f3f1;
64
+ }
65
+
66
+ .bg-dark .tabs-wrapper {
67
+ background-color: hsl(0, 0%, 20%);
68
+ }
69
+
70
+ .bg-primary .tabs-wrapper {
71
+ background-color: hsl(0, 0%, 20%);
72
+ }
73
+
74
+ .bg-white .tabs-wrapper {
75
+ background-color: #fff;
76
+ }
77
+
78
+ .bg-black .tabs-wrapper {
79
+ background-color: #000;
80
+ }
81
+
82
+ .bg-success .tabs-wrapper {
83
+ background-color: #2c911c;
84
+ }
85
+
86
+ .bg-info .tabs-wrapper {
87
+ background-color: #cce4ee;
88
+ }
89
+
90
+ .bg-warning .tabs-wrapper {
91
+ background-color: #f49e00;
92
+ }
93
+
94
+ .bg-danger .tabs-wrapper {
95
+ background-color: #a51728;
96
+ }
97
+
98
+ .bg-nightblue .tabs-wrapper {
99
+ background-color: #004976;
100
+ }
101
+
102
+ .bg-nightblue-bright .tabs-wrapper {
103
+ background-color: #0076a8;
104
+ }
105
+
106
+ .bg-petrol .tabs-wrapper {
107
+ background-color: #006d68;
108
+ }
109
+
110
+ .bg-petrol-bright .tabs-wrapper {
111
+ background-color: #00968f;
112
+ }
113
+
114
+ .bg-coral .tabs-wrapper {
115
+ background-color: #9e2a2f;
116
+ }
117
+
118
+ .bg-coral-bright .tabs-wrapper {
119
+ background-color: #e03c31;
120
+ }
121
+
122
+ .bg-olive .tabs-wrapper {
123
+ background-color: #716135;
124
+ }
125
+
126
+ .bg-olive-bright .tabs-wrapper {
127
+ background-color: #aa9d2e;
128
+ }
129
+
130
+ .bg-purple .tabs-wrapper {
131
+ background-color: #80276c;
132
+ }
133
+
134
+ .bg-purple-bright .tabs-wrapper {
135
+ background-color: #c5299b;
136
+ }
137
+
138
+ .bg-aubergine .tabs-wrapper {
139
+ background-color: #523178;
140
+ }
141
+
142
+ .bg-aubergine-bright .tabs-wrapper {
143
+ background-color: #7566a0;
144
+ }
145
+
146
+ :host {
147
+ display: block;
148
+ }