@scania/tegel 1.23.0-block-nesting-beta.3 → 1.23.0-config-for-china.beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-e91e5f6c.js +152 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +21 -3
- package/dist/cjs/tds-icon.cjs.entry.js +1 -1
- package/dist/cjs/tds-link.cjs.entry.js +5 -3
- package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/tds-slider.cjs.entry.js +33 -7
- package/dist/cjs/tds-toggle.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/dropdown/dropdown.js +21 -3
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/iconsArray.js +20 -20
- package/dist/collection/components/link/link.css +7 -1
- package/dist/collection/components/link/link.js +22 -2
- package/dist/collection/components/popover-core/tds-popover-core.css +54 -139
- package/dist/collection/components/slider/slider.js +34 -8
- package/dist/collection/components/toggle/toggle.css +4 -2
- package/dist/collection/global/assets-loader.js +145 -0
- package/dist/components/index.js +146 -0
- package/dist/components/{p-3dcc0cad.js → p-075f9f21.js} +1 -1
- package/dist/components/{p-e7868876.js → p-4030e9bc.js} +1 -1
- package/dist/components/{p-2523819c.js → p-4f1aa84f.js} +22 -4
- package/dist/components/{p-c48c68b3.js → p-8a2d7b2f.js} +1 -1
- package/dist/components/{p-fa013b7c.js → p-bbe665ac.js} +1 -1
- package/dist/components/{p-18c1245b.js → p-e323cd2a.js} +1 -1
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-banner.js +1 -1
- package/dist/components/tds-datetime.js +1 -1
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-folder-tabs.js +1 -1
- package/dist/components/tds-footer-group.js +1 -1
- package/dist/components/tds-header-cell.js +1 -1
- package/dist/components/tds-header-dropdown.js +3 -3
- package/dist/components/tds-header-hamburger.js +1 -1
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher.js +4 -4
- package/dist/components/tds-icon.js +1 -1
- package/dist/components/tds-inline-tabs.js +1 -1
- package/dist/components/tds-link.js +7 -4
- package/dist/components/tds-message.js +1 -1
- package/dist/components/tds-modal.js +1 -1
- package/dist/components/tds-navigation-tabs.js +1 -1
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-popover-core.js +1 -1
- package/dist/components/tds-popover-menu.js +1 -1
- package/dist/components/tds-side-menu-close-button.js +1 -1
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-slider.js +34 -8
- package/dist/components/tds-step.js +1 -1
- package/dist/components/tds-table-body-input-wrapper.js +1 -1
- package/dist/components/tds-table-footer.js +3 -3
- package/dist/components/tds-table-header-input-wrapper.js +1 -1
- package/dist/components/tds-table-toolbar.js +1 -1
- package/dist/components/tds-text-field.js +1 -1
- package/dist/components/tds-textarea.js +1 -1
- package/dist/components/tds-toast.js +1 -1
- package/dist/components/tds-toggle.js +1 -1
- package/dist/components/tds-tooltip.js +1 -1
- package/dist/esm/app-globals-e179c521.js +150 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/tds-dropdown_2.entry.js +21 -3
- package/dist/esm/tds-icon.entry.js +1 -1
- package/dist/esm/tds-link.entry.js +5 -3
- package/dist/esm/tds-popover-core.entry.js +1 -1
- package/dist/esm/tds-slider.entry.js +34 -8
- package/dist/esm/tds-toggle.entry.js +1 -1
- package/dist/esm/tegel.js +2 -2
- package/dist/tegel/p-14f12f43.entry.js +1 -0
- package/dist/tegel/p-2557b79b.entry.js +1 -0
- package/dist/tegel/p-754c7b2e.js +1 -0
- package/dist/tegel/{p-e0ce5daa.entry.js → p-868435cd.entry.js} +1 -1
- package/dist/tegel/p-e13935b6.entry.js +1 -0
- package/dist/tegel/p-e33d9693.entry.js +1 -0
- package/dist/tegel/p-e97a2700.entry.js +1 -0
- package/dist/tegel/tegel.css +3 -3
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +3 -0
- package/dist/types/components/link/link.d.ts +2 -0
- package/dist/types/components/slider/slider.d.ts +7 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/global/assets-loader.d.ts +1 -0
- package/dist/types/types/Icons.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/tegel/p-23ddcd21.entry.js +0 -1
- package/dist/tegel/p-2eb47912.entry.js +0 -1
- package/dist/tegel/p-979f5255.entry.js +0 -1
- package/dist/tegel/p-c3513f1f.entry.js +0 -1
- package/dist/tegel/p-e1255160.js +0 -1
- package/dist/tegel/p-f91c6e9d.entry.js +0 -1
|
@@ -4203,119 +4203,6 @@ html {
|
|
|
4203
4203
|
width: 1856px;
|
|
4204
4204
|
}
|
|
4205
4205
|
}
|
|
4206
|
-
@font-face {
|
|
4207
|
-
font-family: "Scania Sans";
|
|
4208
|
-
font-weight: bold;
|
|
4209
|
-
unicode-range: U+0400-04FF;
|
|
4210
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCY-Bold.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCY-Bold.woff") format("woff");
|
|
4211
|
-
}
|
|
4212
|
-
@font-face {
|
|
4213
|
-
font-family: "Scania Sans";
|
|
4214
|
-
font-style: italic;
|
|
4215
|
-
unicode-range: U+0400-04FF;
|
|
4216
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCY-Italic.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCY-Italic.woff") format("woff");
|
|
4217
|
-
}
|
|
4218
|
-
@font-face {
|
|
4219
|
-
font-family: "Scania Sans";
|
|
4220
|
-
unicode-range: U+0400-04FF;
|
|
4221
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCY-Regular.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCY-Regular.woff") format("woff");
|
|
4222
|
-
}
|
|
4223
|
-
@font-face {
|
|
4224
|
-
font-family: "Scania Sans Condensed";
|
|
4225
|
-
font-weight: bold;
|
|
4226
|
-
unicode-range: U+0400-04FF;
|
|
4227
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYCondensed-Bold.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCYCondensed-Bold.woff") format("woff");
|
|
4228
|
-
}
|
|
4229
|
-
@font-face {
|
|
4230
|
-
font-family: "Scania Sans Condensed";
|
|
4231
|
-
font-style: italic;
|
|
4232
|
-
unicode-range: U+0400-04FF;
|
|
4233
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYCondensed-Italic.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCYCondensed-Italic.woff") format("woff");
|
|
4234
|
-
}
|
|
4235
|
-
@font-face {
|
|
4236
|
-
font-family: "Scania Sans Condensed";
|
|
4237
|
-
unicode-range: U+0400-04FF;
|
|
4238
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYCondensed-Regular.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCYCondensed-Regular.woff") format("woff");
|
|
4239
|
-
}
|
|
4240
|
-
@font-face {
|
|
4241
|
-
font-family: "Scania Sans Headline";
|
|
4242
|
-
font-weight: bold;
|
|
4243
|
-
unicode-range: U+0400-04FF;
|
|
4244
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYHeadline-Bold.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCYHeadline-Bold.woff") format("woff");
|
|
4245
|
-
}
|
|
4246
|
-
@font-face {
|
|
4247
|
-
font-family: "Scania Sans Headline";
|
|
4248
|
-
unicode-range: U+0400-04FF;
|
|
4249
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYHeadline-Regular.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCYHeadline-Regular.woff") format("woff");
|
|
4250
|
-
}
|
|
4251
|
-
@font-face {
|
|
4252
|
-
font-family: "Scania Sans Semi Condensed";
|
|
4253
|
-
font-weight: bold;
|
|
4254
|
-
unicode-range: U+0400-04FF;
|
|
4255
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYSemiCondensed-Bold.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCYSemiCondensed-Bold.woff") format("woff");
|
|
4256
|
-
}
|
|
4257
|
-
@font-face {
|
|
4258
|
-
font-family: "Scania Sans Semi Condensed";
|
|
4259
|
-
font-style: italic;
|
|
4260
|
-
unicode-range: U+0400-04FF;
|
|
4261
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYSemiCondensed-Italic.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCYSemiCondensed-Italic.woff") format("woff");
|
|
4262
|
-
}
|
|
4263
|
-
@font-face {
|
|
4264
|
-
font-family: "Scania Sans Semi Condensed";
|
|
4265
|
-
unicode-range: U+0400-04FF;
|
|
4266
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYSemiCondensed-Regular.woff") format("woff"), url("./assets/fonts/cyrillic/ScaniaSansCYSemiCondensed-Regular.woff") format("woff");
|
|
4267
|
-
}
|
|
4268
|
-
@font-face {
|
|
4269
|
-
font-family: "Scania Sans";
|
|
4270
|
-
font-weight: bold;
|
|
4271
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSans-Bold.woff") format("woff"), url("./assets/fonts/latin/ScaniaSans-Bold.woff") format("woff");
|
|
4272
|
-
}
|
|
4273
|
-
@font-face {
|
|
4274
|
-
font-family: "Scania Sans";
|
|
4275
|
-
font-style: italic;
|
|
4276
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSans-Italic.woff") format("woff"), url("./assets/fonts/latin/ScaniaSans-Italic.woff") format("woff");
|
|
4277
|
-
}
|
|
4278
|
-
@font-face {
|
|
4279
|
-
font-family: "Scania Sans";
|
|
4280
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSans-Regular.woff") format("woff"), url("./assets/fonts/latin/ScaniaSans-Regular.woff") format("woff");
|
|
4281
|
-
}
|
|
4282
|
-
@font-face {
|
|
4283
|
-
font-family: "Scania Sans Condensed";
|
|
4284
|
-
font-weight: bold;
|
|
4285
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSansCondensed-Bold.woff") format("woff"), url("./assets/fonts/latin/ScaniaSansCondensed-Bold.woff") format("woff");
|
|
4286
|
-
}
|
|
4287
|
-
@font-face {
|
|
4288
|
-
font-family: "Scania Sans Condensed";
|
|
4289
|
-
font-style: italic;
|
|
4290
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSansCondensed-Italic.woff") format("woff"), url("./assets/fonts/latin/ScaniaSansCondensed-Italic.woff") format("woff");
|
|
4291
|
-
}
|
|
4292
|
-
@font-face {
|
|
4293
|
-
font-family: "Scania Sans Condensed";
|
|
4294
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSansCondensed-Regular.woff") format("woff"), url("./assets/fonts/latin/ScaniaSansCondensed-Regular.woff") format("woff");
|
|
4295
|
-
}
|
|
4296
|
-
@font-face {
|
|
4297
|
-
font-family: "Scania Sans Headline";
|
|
4298
|
-
font-weight: bold;
|
|
4299
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSansHeadline-Bold.woff") format("woff"), url("./assets/fonts/latin/ScaniaSansHeadline-Bold.woff") format("woff");
|
|
4300
|
-
}
|
|
4301
|
-
@font-face {
|
|
4302
|
-
font-family: "Scania Sans Headline";
|
|
4303
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSansHeadline-Regular.woff") format("woff"), url("./assets/fonts/latin/ScaniaSansHeadline-Regular.woff") format("woff");
|
|
4304
|
-
}
|
|
4305
|
-
@font-face {
|
|
4306
|
-
font-family: "Scania Sans Semi Condensed";
|
|
4307
|
-
font-weight: bold;
|
|
4308
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSansSemiCondensed-Bold.woff") format("woff"), url("./assets/fonts/latin/ScaniaSansSemiCondensed-Bold.woff") format("woff");
|
|
4309
|
-
}
|
|
4310
|
-
@font-face {
|
|
4311
|
-
font-family: "Scania Sans Semi Condensed";
|
|
4312
|
-
font-style: italic;
|
|
4313
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSansSemiCondensed-Italic.woff") format("woff"), url("./assets/fonts/latin/ScaniaSansSemiCondensed-Italic.woff") format("woff");
|
|
4314
|
-
}
|
|
4315
|
-
@font-face {
|
|
4316
|
-
font-family: "Scania Sans Semi Condensed";
|
|
4317
|
-
src: url("https://cdn.digitaldesign.scania.com/fonts/scania-sans/1.0.0/latin/ScaniaSansSemiCondensed-Regular.woff") format("woff"), url("./assets/fonts/latin/ScaniaSansSemiCondensed-Regular.woff") format("woff");
|
|
4318
|
-
}
|
|
4319
4206
|
/* https://medium.com/swlh/full-text-styling-with-a-single-line-of-css-838e8c666f4d */
|
|
4320
4207
|
:root {
|
|
4321
4208
|
/* FUNCTIONAL TYPOGRAPHY */
|
|
@@ -4632,19 +4519,42 @@ h6 {
|
|
|
4632
4519
|
letter-spacing: -0.01em;
|
|
4633
4520
|
}
|
|
4634
4521
|
|
|
4635
|
-
:root
|
|
4636
|
-
|
|
4637
|
-
--tds-
|
|
4638
|
-
--tds-
|
|
4639
|
-
--tds-
|
|
4640
|
-
--tds-
|
|
4641
|
-
--tds-
|
|
4642
|
-
--tds-
|
|
4643
|
-
--tds-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4522
|
+
:root {
|
|
4523
|
+
--tds-logo-url-logotype-png: url("https://cdn.digitaldesign.scania.com/logos/scania-logotype.png");
|
|
4524
|
+
--tds-logo-url-logotype-svg: url("https://cdn.digitaldesign.scania.com/logos/scania-logotype.svg");
|
|
4525
|
+
--tds-logo-url-symbol-png: url("https://cdn.digitaldesign.scania.com/logos/scania-symbol.png");
|
|
4526
|
+
--tds-logo-url-symbol-svg: url("https://cdn.digitaldesign.scania.com/logos/scania-symbol.svg");
|
|
4527
|
+
--tds-logo-url-wordmark-png: url("https://cdn.digitaldesign.scania.com/logos/scania-wordmark.png");
|
|
4528
|
+
--tds-logo-url-wordmark-svg: url("https://cdn.digitaldesign.scania.com/logos/scania-wordmark.svg");
|
|
4529
|
+
--tds-logo-url-wordmark-white-png: url("https://cdn.digitaldesign.scania.com/logos/scania-wordmark-white.png");
|
|
4530
|
+
--tds-logo-url-wordmark-white-svg: url("https://cdn.digitaldesign.scania.com/logos/scania-wordmark-white.svg");
|
|
4531
|
+
}
|
|
4532
|
+
|
|
4533
|
+
.scania-logotype--png {
|
|
4534
|
+
background-image: var(--tds-logo-url-logotype-png);
|
|
4535
|
+
}
|
|
4536
|
+
.scania-logotype--svg {
|
|
4537
|
+
background-image: var(--tds-logo-url-logotype-svg);
|
|
4538
|
+
}
|
|
4539
|
+
|
|
4540
|
+
.scania-symbol--png {
|
|
4541
|
+
background-image: var(--tds-logo-url-symbol-png);
|
|
4542
|
+
}
|
|
4543
|
+
.scania-symbol--svg {
|
|
4544
|
+
background-image: var(--tds-logo-url-symbol-svg);
|
|
4545
|
+
}
|
|
4546
|
+
|
|
4547
|
+
.scania-wordmark--png {
|
|
4548
|
+
background-image: var(--tds-logo-url-wordmark-png);
|
|
4549
|
+
}
|
|
4550
|
+
.scania-wordmark--svg {
|
|
4551
|
+
background-image: var(--tds-logo-url-wordmark-svg);
|
|
4552
|
+
}
|
|
4553
|
+
.scania-wordmark-white--png {
|
|
4554
|
+
background-image: var(--tds-logo-url-wordmark-white-png);
|
|
4555
|
+
}
|
|
4556
|
+
.scania-wordmark-white--svg {
|
|
4557
|
+
background-image: var(--tds-logo-url-wordmark-white-svg);
|
|
4648
4558
|
}
|
|
4649
4559
|
|
|
4650
4560
|
/** The breakpoint at which the layout changes from fixed size to full-width. */
|
|
@@ -6100,34 +6010,39 @@ html {
|
|
|
6100
6010
|
|
|
6101
6011
|
:root,
|
|
6102
6012
|
.tds-mode-light {
|
|
6103
|
-
--tds-link: var(--tds-blue-
|
|
6013
|
+
--tds-link: var(--tds-blue-400);
|
|
6104
6014
|
--tds-link-hover: var(--tds-blue-400);
|
|
6105
6015
|
--tds-link-focus: var(--tds-blue-400);
|
|
6106
|
-
--tds-link-visited: var(--tds-
|
|
6016
|
+
--tds-link-visited: var(--tds-blue-700);
|
|
6107
6017
|
--tds-link-disabled: var(--tds-grey-400);
|
|
6108
6018
|
}
|
|
6109
6019
|
:root tds-toast,
|
|
6110
6020
|
.tds-mode-light tds-toast {
|
|
6111
|
-
--tds-link: var(--tds-blue-
|
|
6021
|
+
--tds-link: var(--tds-blue-400);
|
|
6112
6022
|
--tds-link-hover: var(--tds-blue-400);
|
|
6113
6023
|
--tds-link-focus: var(--tds-blue-400);
|
|
6114
|
-
--tds-link-visited: var(--tds-blue-
|
|
6115
|
-
--tds-link-disabled: var(--tds-grey-
|
|
6024
|
+
--tds-link-visited: var(--tds-blue-700);
|
|
6025
|
+
--tds-link-disabled: var(--tds-grey-400);
|
|
6116
6026
|
}
|
|
6117
6027
|
|
|
6118
6028
|
.tds-mode-dark {
|
|
6119
6029
|
--tds-link: var(--tds-blue-300);
|
|
6120
|
-
--tds-link-hover: var(--tds-blue-
|
|
6121
|
-
--tds-link-focus: var(--tds-blue-
|
|
6030
|
+
--tds-link-hover: var(--tds-blue-300);
|
|
6031
|
+
--tds-link-focus: var(--tds-blue-300);
|
|
6122
6032
|
--tds-link-visited: var(--tds-blue-100);
|
|
6123
|
-
--tds-link-disabled: var(--tds-grey-
|
|
6033
|
+
--tds-link-disabled: var(--tds-grey-700);
|
|
6124
6034
|
}
|
|
6125
6035
|
.tds-mode-dark tds-toast {
|
|
6126
|
-
--tds-link: var(--tds-blue-
|
|
6127
|
-
--tds-link-hover: var(--tds-blue-
|
|
6128
|
-
--tds-link-focus: var(--tds-blue-
|
|
6129
|
-
--tds-link-visited: var(--tds-
|
|
6130
|
-
--tds-link-disabled: var(--tds-grey-
|
|
6036
|
+
--tds-link: var(--tds-blue-300);
|
|
6037
|
+
--tds-link-hover: var(--tds-blue-300);
|
|
6038
|
+
--tds-link-focus: var(--tds-blue-300);
|
|
6039
|
+
--tds-link-visited: var(--tds-blue-100);
|
|
6040
|
+
--tds-link-disabled: var(--tds-grey-700);
|
|
6041
|
+
}
|
|
6042
|
+
|
|
6043
|
+
tds-link tds-icon {
|
|
6044
|
+
padding-bottom: 4px;
|
|
6045
|
+
padding-left: 5px;
|
|
6131
6046
|
}
|
|
6132
6047
|
|
|
6133
6048
|
:root,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
1
|
+
import { h, } from "@stencil/core";
|
|
2
2
|
import generateUniqueId from "../../utils/generateUniqueId";
|
|
3
3
|
export class TdsSlider {
|
|
4
4
|
constructor() {
|
|
@@ -16,6 +16,11 @@ export class TdsSlider {
|
|
|
16
16
|
this.useSnapping = false;
|
|
17
17
|
this.supposedValueSlot = -1;
|
|
18
18
|
this.resizeObserverAdded = false;
|
|
19
|
+
this.resetEventListenerAdded = false;
|
|
20
|
+
this.resetToInitialValue = () => {
|
|
21
|
+
this.forceValueUpdate(this.initialValue);
|
|
22
|
+
this.reset();
|
|
23
|
+
};
|
|
19
24
|
this.label = '';
|
|
20
25
|
this.value = '0';
|
|
21
26
|
this.min = '0';
|
|
@@ -295,26 +300,46 @@ export class TdsSlider {
|
|
|
295
300
|
}
|
|
296
301
|
this.calculateThumbLeftFromValue(this.value);
|
|
297
302
|
this.updateTrack();
|
|
303
|
+
// Only set the initial value once:
|
|
304
|
+
if (!this.initialValue) {
|
|
305
|
+
this.initialValue = this.value;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
componentDidRender() {
|
|
309
|
+
// Only add the event listener once:
|
|
310
|
+
if (!this.resetEventListenerAdded) {
|
|
311
|
+
this.formElement = this.host.closest('form');
|
|
312
|
+
if (this.formElement) {
|
|
313
|
+
this.formElement.addEventListener('reset', this.resetToInitialValue);
|
|
314
|
+
this.resetEventListenerAdded = true;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
disconnectedCallback() {
|
|
319
|
+
if (this.resetEventListenerAdded && this.formElement) {
|
|
320
|
+
this.formElement.removeEventListener('reset', this.resetToInitialValue);
|
|
321
|
+
this.resetEventListenerAdded = false;
|
|
322
|
+
}
|
|
298
323
|
}
|
|
299
324
|
render() {
|
|
300
|
-
return (h("div", { key: '
|
|
325
|
+
return (h("div", { key: 'ed4c71d1701e0711d8b01c015f137f6a3f10457e', class: {
|
|
301
326
|
'tds-slider-wrapper': true,
|
|
302
327
|
'read-only': this.readOnly,
|
|
303
|
-
} }, h("input", { key: '
|
|
328
|
+
} }, h("input", { key: '7d85ba109ec41e45a4ced646cfe092832b2013a7', class: "tds-slider-native-element", type: "range", name: this.name, min: this.min, max: this.max, value: this.value, disabled: this.disabled }), h("div", { key: '7c32efe653a6437068026e0b612bd1cdb0fd580d', class: {
|
|
304
329
|
'tds-slider': true,
|
|
305
330
|
'disabled': this.disabled,
|
|
306
331
|
'tds-slider-small': this.useSmall,
|
|
307
332
|
}, ref: (el) => {
|
|
308
333
|
this.wrapperElement = el;
|
|
309
|
-
} }, h("label", { key: '
|
|
334
|
+
} }, h("label", { key: '5561410214fda42ddb4553084f312de9943f825b', class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: '37340de05febbca285f031bd8df7d9c2588e315d', class: "tds-slider__input-values" }, h("div", { key: 'e973831529eb93eb0b0da6c5f92bd838dfb9bcdb', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: '1a710d2d1ffac7533f9bae2908d4341d3b40e2f0', class: "tds-slider__controls" }, h("div", { key: '0a741834782d8e69a7d55e6cd87a3fdf4938d744', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event) }, h("tds-icon", { key: '8c67943ac2e15d742726e76c2b4c029d15c20f32', name: "minus", size: "16px" })))), h("div", { key: '96c4229007fbe882e106bcc3deb34f504c9604e3', class: "tds-slider-inner" }, this.tickValues.length > 0 && (h("div", { key: '905fc1a02070f5419f76ec5d60d8f55d89d4650b', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: 'd2ccbea1b6e26ab1855c81e71730bebea0da37d8', class: "tds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "tds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { key: '30c9b4bb6f59631d443345ee6d1edf1973a83d0b', class: "tds-slider__track", ref: (el) => {
|
|
310
335
|
this.trackElement = el;
|
|
311
|
-
}, tabindex: this.disabled ? '-1' : '0' }, h("div", { key: '
|
|
336
|
+
}, tabindex: this.disabled ? '-1' : '0' }, h("div", { key: '7acbccae98c481c4cfaeb2dc66d67a2e19575b93', class: "tds-slider__track-fill", ref: (el) => {
|
|
312
337
|
this.trackFillElement = el;
|
|
313
|
-
} }), h("div", { key: '
|
|
338
|
+
} }), h("div", { key: '46a5c3135c5f765d5fb0845372dc3854586fa44d', class: "tds-slider__thumb", ref: (el) => {
|
|
314
339
|
this.thumbElement = el;
|
|
315
|
-
}, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb() }, this.tooltip && (h("div", { key: '
|
|
340
|
+
}, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb() }, this.tooltip && (h("div", { key: 'd39cd29d1e6302f8bd4a3d827797f8822e24b84d', class: "tds-slider__value" }, this.value, h("svg", { key: '5946f90b70b2afb2efc7f3a3bc5817a82ac3ca4a', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '9456df642aca39b94b17bb529ca02e2d6a2fde6c', d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "currentColor" })))), h("div", { key: 'b4ca73a085f837d7e87e3334b8e58e5638125118', class: "tds-slider__thumb-inner", ref: (el) => {
|
|
316
341
|
this.thumbInnerElement = el;
|
|
317
|
-
} })))), this.useInput && (h("div", { key: '
|
|
342
|
+
} })))), this.useInput && (h("div", { key: '6574286ac7764807fd1e18875d6fa39ab7f7b304', class: "tds-slider__input-values" }, h("div", { key: '57a92adf59551f551c4ae06355c276a69b34028a', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: '0e1632ca8c9510177d349147749e3162aa46f219', class: "tds-slider__input-field-wrapper" }, h("input", { key: '094d194bce54d1073a5d657f7bc3f30107f5fe41', size: this.calculateInputSizeFromMax(), class: "tds-slider__input-field", value: this.value, readOnly: this.readOnly, onBlur: (event) => this.updateSliderValueOnInputChange(event), onKeyDown: (event) => this.handleInputFieldEnterPress(event), type: "number", min: this.min, max: this.max })))), this.useControls && (h("div", { key: '207398a3fd02e11f09c70ebbb8b293d6c16afd1f', class: "tds-slider__controls" }, h("div", { key: 'ca93ce9a55d0db25a3eaefd6e4dbc53106afc895', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event) }, h("tds-icon", { key: '6ab123f8701fdd93580a61c500ae6da658b547fd', name: "plus", size: "16px" })))))));
|
|
318
343
|
}
|
|
319
344
|
static get is() { return "tds-slider"; }
|
|
320
345
|
static get originalStyleUrls() {
|
|
@@ -673,6 +698,7 @@ export class TdsSlider {
|
|
|
673
698
|
}
|
|
674
699
|
};
|
|
675
700
|
}
|
|
701
|
+
static get elementRef() { return "host"; }
|
|
676
702
|
static get watchers() {
|
|
677
703
|
return [{
|
|
678
704
|
"propName": "value",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
position: relative;
|
|
19
19
|
display: inline-block;
|
|
20
20
|
vertical-align: middle;
|
|
21
|
+
cursor: pointer;
|
|
21
22
|
/* Switch */
|
|
22
23
|
}
|
|
23
24
|
.tds-toggle input[type=checkbox]::after, .tds-toggle input[type=checkbox]::before {
|
|
@@ -42,10 +43,10 @@
|
|
|
42
43
|
left: 4px;
|
|
43
44
|
top: 4px;
|
|
44
45
|
}
|
|
45
|
-
.tds-toggle input[type=checkbox]:focus {
|
|
46
|
+
.tds-toggle input[type=checkbox]:focus, .tds-toggle input[type=checkbox]:hover {
|
|
46
47
|
outline: none;
|
|
47
48
|
}
|
|
48
|
-
.tds-toggle input[type=checkbox]:focus::before {
|
|
49
|
+
.tds-toggle input[type=checkbox]:focus::before, .tds-toggle input[type=checkbox]:hover::before {
|
|
49
50
|
background-color: var(--tds-toggle-off-slider-focus);
|
|
50
51
|
border: 1px solid var(--tds-toggle-off-border-focus);
|
|
51
52
|
}
|
|
@@ -105,6 +106,7 @@
|
|
|
105
106
|
letter-spacing: var(--tds-detail-01-ls);
|
|
106
107
|
color: var(--tds-toggle-label-color);
|
|
107
108
|
padding-left: 8px;
|
|
109
|
+
cursor: pointer;
|
|
108
110
|
}
|
|
109
111
|
.tds-toggle label.disabled {
|
|
110
112
|
color: var(--tds-toggle-label-color-disabled);
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
function initializeAssets() {
|
|
2
|
+
const defaultCDN = 'https://cdn.digitaldesign.scania.com';
|
|
3
|
+
const assetSource = window.TEGEL_ASSET_SOURCE || defaultCDN;
|
|
4
|
+
const root = document.documentElement;
|
|
5
|
+
console.log('Asset Source in Stencil:', assetSource, '\nTEGEL_ASSET_SOURCE value:', window.TEGEL_ASSET_SOURCE, '\nUsing CDN:', assetSource === defaultCDN);
|
|
6
|
+
// Define all font-face declarations
|
|
7
|
+
const fontFaces = `
|
|
8
|
+
/* Scania Sans */
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: 'Scania Sans';
|
|
11
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCY-Bold.woff') format('woff');
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
font-style: normal;
|
|
14
|
+
unicode-range: U+0400-04FF;
|
|
15
|
+
}
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: 'Scania Sans';
|
|
18
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCY-Italic.woff') format('woff');
|
|
19
|
+
font-weight: normal;
|
|
20
|
+
font-style: italic;
|
|
21
|
+
unicode-range: U+0400-04FF;
|
|
22
|
+
}
|
|
23
|
+
@font-face {
|
|
24
|
+
font-family: 'Scania Sans';
|
|
25
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCY-Regular.woff') format('woff');
|
|
26
|
+
font-weight: normal;
|
|
27
|
+
font-style: normal;
|
|
28
|
+
unicode-range: U+0400-04FF;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Scania Sans Condensed */
|
|
32
|
+
@font-face {
|
|
33
|
+
font-family: 'Scania Sans Condensed';
|
|
34
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYCondensed-Bold.woff') format('woff');
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
font-style: normal;
|
|
37
|
+
unicode-range: U+0400-04FF;
|
|
38
|
+
}
|
|
39
|
+
@font-face {
|
|
40
|
+
font-family: 'Scania Sans Condensed';
|
|
41
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYCondensed-Italic.woff') format('woff');
|
|
42
|
+
font-weight: normal;
|
|
43
|
+
font-style: italic;
|
|
44
|
+
unicode-range: U+0400-04FF;
|
|
45
|
+
}
|
|
46
|
+
@font-face {
|
|
47
|
+
font-family: 'Scania Sans Condensed';
|
|
48
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYCondensed-Regular.woff') format('woff');
|
|
49
|
+
font-weight: normal;
|
|
50
|
+
font-style: normal;
|
|
51
|
+
unicode-range: U+0400-04FF;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Scania Sans Headline */
|
|
55
|
+
@font-face {
|
|
56
|
+
font-family: 'Scania Sans Headline';
|
|
57
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYHeadline-Bold.woff') format('woff');
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
font-style: normal;
|
|
60
|
+
unicode-range: U+0400-04FF;
|
|
61
|
+
}
|
|
62
|
+
@font-face {
|
|
63
|
+
font-family: 'Scania Sans Headline';
|
|
64
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYHeadline-Regular.woff') format('woff');
|
|
65
|
+
font-weight: normal;
|
|
66
|
+
font-style: normal;
|
|
67
|
+
unicode-range: U+0400-04FF;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Scania Sans Semi Condensed */
|
|
71
|
+
@font-face {
|
|
72
|
+
font-family: 'Scania Sans Semi Condensed';
|
|
73
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYSemiCondensed-Bold.woff') format('woff');
|
|
74
|
+
font-weight: bold;
|
|
75
|
+
font-style: normal;
|
|
76
|
+
unicode-range: U+0400-04FF;
|
|
77
|
+
}
|
|
78
|
+
@font-face {
|
|
79
|
+
font-family: 'Scania Sans Semi Condensed';
|
|
80
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYSemiCondensed-Italic.woff') format('woff');
|
|
81
|
+
font-weight: normal;
|
|
82
|
+
font-style: italic;
|
|
83
|
+
unicode-range: U+0400-04FF;
|
|
84
|
+
}
|
|
85
|
+
@font-face {
|
|
86
|
+
font-family: 'Scania Sans Semi Condensed';
|
|
87
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYSemiCondensed-Regular.woff') format('woff');
|
|
88
|
+
font-weight: normal;
|
|
89
|
+
font-style: normal;
|
|
90
|
+
unicode-range: U+0400-04FF;
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
// Add font-face rules to document
|
|
94
|
+
const style = document.createElement('style');
|
|
95
|
+
style.textContent = fontFaces;
|
|
96
|
+
document.head.appendChild(style);
|
|
97
|
+
// Set font-family CSS variables
|
|
98
|
+
root.style.setProperty('--tds-font-family-primary', 'Scania Sans, Arial, sans-serif');
|
|
99
|
+
root.style.setProperty('--tds-font-family-condensed', 'Scania Sans Condensed, Arial Narrow, Arial, sans-serif');
|
|
100
|
+
root.style.setProperty('--tds-font-family-headline', 'Scania Sans Headline, Arial, sans-serif');
|
|
101
|
+
root.style.setProperty('--tds-font-family-semi-condensed', 'Scania Sans Semi Condensed, Arial, sans-serif');
|
|
102
|
+
// Set logotype variables
|
|
103
|
+
const logoPath = '/logos';
|
|
104
|
+
const logotypes = [
|
|
105
|
+
{ name: 'logotype', format: ['png', 'svg'] },
|
|
106
|
+
{ name: 'symbol', format: ['png', 'svg'] },
|
|
107
|
+
{ name: 'wordmark', format: ['png', 'svg'] },
|
|
108
|
+
{ name: 'wordmark-white', format: ['png', 'svg'] },
|
|
109
|
+
];
|
|
110
|
+
logotypes.forEach(({ name, format }) => {
|
|
111
|
+
format.forEach((ext) => {
|
|
112
|
+
root.style.setProperty(`--tds-logo-url-${name}-${ext}`, `url('${assetSource}${logoPath}/scania-${name}.${ext}')`);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
// Debug: Log all font-face rules
|
|
116
|
+
console.log('Font-face rules:', Array.from(document.styleSheets).flatMap((sheet) => {
|
|
117
|
+
try {
|
|
118
|
+
return Array.from(sheet.cssRules)
|
|
119
|
+
.filter((rule) => rule.type === CSSRule.FONT_FACE_RULE)
|
|
120
|
+
.map((rule) => rule.cssText);
|
|
121
|
+
}
|
|
122
|
+
catch (e) {
|
|
123
|
+
// Handle cross-origin stylesheet errors
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
}));
|
|
127
|
+
// Verify settings
|
|
128
|
+
console.log('Asset initialization complete:', {
|
|
129
|
+
assetSource,
|
|
130
|
+
fontFamilyPrimary: getComputedStyle(document.documentElement)
|
|
131
|
+
.getPropertyValue('--tds-font-family-primary')
|
|
132
|
+
.trim(),
|
|
133
|
+
logoUrl: getComputedStyle(document.documentElement)
|
|
134
|
+
.getPropertyValue('--tds-logo-url-logotype-svg')
|
|
135
|
+
.trim(),
|
|
136
|
+
usingCDN: assetSource === defaultCDN,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
// Initialize as early as possible
|
|
140
|
+
if (document.readyState === 'loading') {
|
|
141
|
+
document.addEventListener('DOMContentLoaded', initializeAssets);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
initializeAssets();
|
|
145
|
+
}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1,147 @@
|
|
|
1
1
|
export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-28ef5186.js';
|
|
2
|
+
|
|
3
|
+
function initializeAssets() {
|
|
4
|
+
const defaultCDN = 'https://cdn.digitaldesign.scania.com';
|
|
5
|
+
const assetSource = window.TEGEL_ASSET_SOURCE || defaultCDN;
|
|
6
|
+
const root = document.documentElement;
|
|
7
|
+
console.log('Asset Source in Stencil:', assetSource, '\nTEGEL_ASSET_SOURCE value:', window.TEGEL_ASSET_SOURCE, '\nUsing CDN:', assetSource === defaultCDN);
|
|
8
|
+
// Define all font-face declarations
|
|
9
|
+
const fontFaces = `
|
|
10
|
+
/* Scania Sans */
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: 'Scania Sans';
|
|
13
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCY-Bold.woff') format('woff');
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
font-style: normal;
|
|
16
|
+
unicode-range: U+0400-04FF;
|
|
17
|
+
}
|
|
18
|
+
@font-face {
|
|
19
|
+
font-family: 'Scania Sans';
|
|
20
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCY-Italic.woff') format('woff');
|
|
21
|
+
font-weight: normal;
|
|
22
|
+
font-style: italic;
|
|
23
|
+
unicode-range: U+0400-04FF;
|
|
24
|
+
}
|
|
25
|
+
@font-face {
|
|
26
|
+
font-family: 'Scania Sans';
|
|
27
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCY-Regular.woff') format('woff');
|
|
28
|
+
font-weight: normal;
|
|
29
|
+
font-style: normal;
|
|
30
|
+
unicode-range: U+0400-04FF;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Scania Sans Condensed */
|
|
34
|
+
@font-face {
|
|
35
|
+
font-family: 'Scania Sans Condensed';
|
|
36
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYCondensed-Bold.woff') format('woff');
|
|
37
|
+
font-weight: bold;
|
|
38
|
+
font-style: normal;
|
|
39
|
+
unicode-range: U+0400-04FF;
|
|
40
|
+
}
|
|
41
|
+
@font-face {
|
|
42
|
+
font-family: 'Scania Sans Condensed';
|
|
43
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYCondensed-Italic.woff') format('woff');
|
|
44
|
+
font-weight: normal;
|
|
45
|
+
font-style: italic;
|
|
46
|
+
unicode-range: U+0400-04FF;
|
|
47
|
+
}
|
|
48
|
+
@font-face {
|
|
49
|
+
font-family: 'Scania Sans Condensed';
|
|
50
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYCondensed-Regular.woff') format('woff');
|
|
51
|
+
font-weight: normal;
|
|
52
|
+
font-style: normal;
|
|
53
|
+
unicode-range: U+0400-04FF;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Scania Sans Headline */
|
|
57
|
+
@font-face {
|
|
58
|
+
font-family: 'Scania Sans Headline';
|
|
59
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYHeadline-Bold.woff') format('woff');
|
|
60
|
+
font-weight: bold;
|
|
61
|
+
font-style: normal;
|
|
62
|
+
unicode-range: U+0400-04FF;
|
|
63
|
+
}
|
|
64
|
+
@font-face {
|
|
65
|
+
font-family: 'Scania Sans Headline';
|
|
66
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYHeadline-Regular.woff') format('woff');
|
|
67
|
+
font-weight: normal;
|
|
68
|
+
font-style: normal;
|
|
69
|
+
unicode-range: U+0400-04FF;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Scania Sans Semi Condensed */
|
|
73
|
+
@font-face {
|
|
74
|
+
font-family: 'Scania Sans Semi Condensed';
|
|
75
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYSemiCondensed-Bold.woff') format('woff');
|
|
76
|
+
font-weight: bold;
|
|
77
|
+
font-style: normal;
|
|
78
|
+
unicode-range: U+0400-04FF;
|
|
79
|
+
}
|
|
80
|
+
@font-face {
|
|
81
|
+
font-family: 'Scania Sans Semi Condensed';
|
|
82
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYSemiCondensed-Italic.woff') format('woff');
|
|
83
|
+
font-weight: normal;
|
|
84
|
+
font-style: italic;
|
|
85
|
+
unicode-range: U+0400-04FF;
|
|
86
|
+
}
|
|
87
|
+
@font-face {
|
|
88
|
+
font-family: 'Scania Sans Semi Condensed';
|
|
89
|
+
src: url('${assetSource}/fonts/scania-sans/1.0.0/cyrillic/ScaniaSansCYSemiCondensed-Regular.woff') format('woff');
|
|
90
|
+
font-weight: normal;
|
|
91
|
+
font-style: normal;
|
|
92
|
+
unicode-range: U+0400-04FF;
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
// Add font-face rules to document
|
|
96
|
+
const style = document.createElement('style');
|
|
97
|
+
style.textContent = fontFaces;
|
|
98
|
+
document.head.appendChild(style);
|
|
99
|
+
// Set font-family CSS variables
|
|
100
|
+
root.style.setProperty('--tds-font-family-primary', 'Scania Sans, Arial, sans-serif');
|
|
101
|
+
root.style.setProperty('--tds-font-family-condensed', 'Scania Sans Condensed, Arial Narrow, Arial, sans-serif');
|
|
102
|
+
root.style.setProperty('--tds-font-family-headline', 'Scania Sans Headline, Arial, sans-serif');
|
|
103
|
+
root.style.setProperty('--tds-font-family-semi-condensed', 'Scania Sans Semi Condensed, Arial, sans-serif');
|
|
104
|
+
// Set logotype variables
|
|
105
|
+
const logoPath = '/logos';
|
|
106
|
+
const logotypes = [
|
|
107
|
+
{ name: 'logotype', format: ['png', 'svg'] },
|
|
108
|
+
{ name: 'symbol', format: ['png', 'svg'] },
|
|
109
|
+
{ name: 'wordmark', format: ['png', 'svg'] },
|
|
110
|
+
{ name: 'wordmark-white', format: ['png', 'svg'] },
|
|
111
|
+
];
|
|
112
|
+
logotypes.forEach(({ name, format }) => {
|
|
113
|
+
format.forEach((ext) => {
|
|
114
|
+
root.style.setProperty(`--tds-logo-url-${name}-${ext}`, `url('${assetSource}${logoPath}/scania-${name}.${ext}')`);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
// Debug: Log all font-face rules
|
|
118
|
+
console.log('Font-face rules:', Array.from(document.styleSheets).flatMap((sheet) => {
|
|
119
|
+
try {
|
|
120
|
+
return Array.from(sheet.cssRules)
|
|
121
|
+
.filter((rule) => rule.type === CSSRule.FONT_FACE_RULE)
|
|
122
|
+
.map((rule) => rule.cssText);
|
|
123
|
+
}
|
|
124
|
+
catch (e) {
|
|
125
|
+
// Handle cross-origin stylesheet errors
|
|
126
|
+
return [];
|
|
127
|
+
}
|
|
128
|
+
}));
|
|
129
|
+
// Verify settings
|
|
130
|
+
console.log('Asset initialization complete:', {
|
|
131
|
+
assetSource,
|
|
132
|
+
fontFamilyPrimary: getComputedStyle(document.documentElement)
|
|
133
|
+
.getPropertyValue('--tds-font-family-primary')
|
|
134
|
+
.trim(),
|
|
135
|
+
logoUrl: getComputedStyle(document.documentElement)
|
|
136
|
+
.getPropertyValue('--tds-logo-url-logotype-svg')
|
|
137
|
+
.trim(),
|
|
138
|
+
usingCDN: assetSource === defaultCDN,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
// Initialize as early as possible
|
|
142
|
+
if (document.readyState === 'loading') {
|
|
143
|
+
document.addEventListener('DOMContentLoaded', initializeAssets);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
initializeAssets();
|
|
147
|
+
}
|