@scania/tegel 1.4.0 → 1.5.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 (218) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tds-dropdown.cjs.entry.js +17 -13
  3. package/dist/cjs/tds-header-cell.cjs.entry.js +2 -2
  4. package/dist/cjs/tds-icon.cjs.entry.js +3 -2
  5. package/dist/cjs/tds-modal.cjs.entry.js +1 -1
  6. package/dist/cjs/tegel.cjs.js +1 -1
  7. package/dist/collection/components/dropdown/dropdown.css +1 -0
  8. package/dist/collection/components/dropdown/dropdown.js +16 -12
  9. package/dist/collection/components/icon/icon.js +23 -5
  10. package/dist/collection/components/modal/modal.css +1 -1
  11. package/dist/collection/components/table/table-header-cell/table-header-cell.js +13 -10
  12. package/dist/components/icon.js +4 -2
  13. package/dist/components/tds-dropdown.js +17 -13
  14. package/dist/components/tds-header-cell.js +2 -2
  15. package/dist/components/tds-modal.js +1 -1
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/tds-dropdown.entry.js +17 -13
  18. package/dist/esm/tds-header-cell.entry.js +2 -2
  19. package/dist/esm/tds-icon.entry.js +3 -2
  20. package/dist/esm/tds-modal.entry.js +1 -1
  21. package/dist/esm/tegel.js +1 -1
  22. package/dist/tegel/p-15f8ac46.entry.js +1 -0
  23. package/dist/tegel/p-3b597a64.entry.js +1 -0
  24. package/dist/tegel/{p-6dc8f2dd.entry.js → p-78853c02.entry.js} +1 -1
  25. package/dist/tegel/p-7d93c35b.entry.js +1 -0
  26. package/dist/tegel/tegel.esm.js +1 -1
  27. package/dist/types/components/dropdown/dropdown.d.ts +2 -0
  28. package/dist/types/components/icon/icon.d.ts +6 -3
  29. package/dist/types/components/table/table-header-cell/table-header-cell.d.ts +14 -8
  30. package/dist/types/components.d.ts +20 -12
  31. package/package.json +1 -1
  32. package/dist/collection/components/accordion/accordion.stories.js +0 -100
  33. package/dist/collection/components/accordion/test/basic/accordion.e2e.js +0 -19
  34. package/dist/collection/components/accordion/test/disabled/accordion.e2e.js +0 -19
  35. package/dist/collection/components/accordion/test/expanded/accordion.e2e.js +0 -24
  36. package/dist/collection/components/accordion/test/padding-reset/accordion.e2e.js +0 -24
  37. package/dist/collection/components/badge/badge.stories.js +0 -106
  38. package/dist/collection/components/badge/test/basic/badge.e2e.js +0 -10
  39. package/dist/collection/components/badge/test/value/badge.e2e.js +0 -11
  40. package/dist/collection/components/banner/banner.stories.js +0 -92
  41. package/dist/collection/components/banner/test/basic/banner.e2e.js +0 -15
  42. package/dist/collection/components/banner/test/default/banner.e2e.js +0 -37
  43. package/dist/collection/components/banner/test/error/banner.e2e.js +0 -15
  44. package/dist/collection/components/banner/test/information/banner.e2e.js +0 -15
  45. package/dist/collection/components/block/block.stories.js +0 -49
  46. package/dist/collection/components/breadcrumbs/breadcrumbs.stories.js +0 -36
  47. package/dist/collection/components/breadcrumbs/test/default/breadcrumbs.e2e.js +0 -33
  48. package/dist/collection/components/button/button.stories.js +0 -185
  49. package/dist/collection/components/button/test/basic/button.e2e.js +0 -35
  50. package/dist/collection/components/button/test/danger/button.e2e.js +0 -18
  51. package/dist/collection/components/button/test/disabled/button.e2e.js +0 -24
  52. package/dist/collection/components/button/test/ghost/button.e2e.js +0 -18
  53. package/dist/collection/components/button/test/icon/button.e2e.js +0 -38
  54. package/dist/collection/components/button/test/secondary/button.e2e.js +0 -18
  55. package/dist/collection/components/card/card.stories.js +0 -163
  56. package/dist/collection/components/card/test/basic/card.e2e.js +0 -10
  57. package/dist/collection/components/card/test/clickable/card.e2e.js +0 -21
  58. package/dist/collection/components/card/test/default/card.e2e.js +0 -33
  59. package/dist/collection/components/checkbox/checkbox.stories.js +0 -93
  60. package/dist/collection/components/chip/chip.stories.js +0 -230
  61. package/dist/collection/components/datetime/datetime.stories.js +0 -219
  62. package/dist/collection/components/divider/divider.stories.js +0 -62
  63. package/dist/collection/components/dropdown/dropdown.stories.js +0 -260
  64. package/dist/collection/components/dropdown/test/basic/dropdown.e2e.js +0 -41
  65. package/dist/collection/components/dropdown/test/default/dropdown.e2e.js +0 -76
  66. package/dist/collection/components/dropdown/test/error/dropdown.e2e.js +0 -36
  67. package/dist/collection/components/dropdown/test/filter/dropdown.e2e.js +0 -56
  68. package/dist/collection/components/dropdown/test/filter/hide-no-result-message/dropdown.e2e.js +0 -23
  69. package/dist/collection/components/dropdown/test/filter/normalize-text-false/dropdown.e2e.js +0 -43
  70. package/dist/collection/components/dropdown/test/multiselect/dropdown.e2e.js +0 -81
  71. package/dist/collection/components/footer/footer.stories.js +0 -145
  72. package/dist/collection/components/footer/test/default/footer.e2e.js +0 -34
  73. package/dist/collection/components/header/header.stories.js +0 -82
  74. package/dist/collection/components/header/test/default/header.e2e.js +0 -44
  75. package/dist/collection/components/icon/icon.stories.js +0 -48
  76. package/dist/collection/components/link/link.stories.js +0 -59
  77. package/dist/collection/components/message/message.stories.js +0 -109
  78. package/dist/collection/components/message/test/basic/message.e2e.js +0 -16
  79. package/dist/collection/components/message/test/error/message.e2e.js +0 -28
  80. package/dist/collection/components/message/test/information/message.e2e.js +0 -10
  81. package/dist/collection/components/message/test/success/message.e2e.js +0 -10
  82. package/dist/collection/components/message/test/warning/message.e2e.js +0 -10
  83. package/dist/collection/components/modal/modal.stories.js +0 -119
  84. package/dist/collection/components/modal/test/default/modal.e2e.js +0 -28
  85. package/dist/collection/components/modal/test/open-close/modal.e2e.js +0 -63
  86. package/dist/collection/components/modal/test/prevent-true/modal.e2e.js +0 -13
  87. package/dist/collection/components/popover-canvas/popover-canvas.stories.js +0 -92
  88. package/dist/collection/components/popover-canvas/test/default/popover-canvas.e2e.js +0 -30
  89. package/dist/collection/components/popover-canvas/test/show-false/popover-canvas.e2e.js +0 -30
  90. package/dist/collection/components/popover-canvas/test/show-true/popover-canvas.e2e.js +0 -30
  91. package/dist/collection/components/popover-menu/popover-menu.stories.js +0 -146
  92. package/dist/collection/components/popover-menu/test/default/popover-menu.e2e.js +0 -60
  93. package/dist/collection/components/popover-menu/test/icons-fluid/popover-menu.e2e.js +0 -27
  94. package/dist/collection/components/popover-menu/test/show/popover-menu.e2e.js +0 -20
  95. package/dist/collection/components/popover-menu/test/show-false/popover-menu.e2e.js +0 -20
  96. package/dist/collection/components/radio-button/radio-button.stories.js +0 -91
  97. package/dist/collection/components/side-menu/side-menu.stories.js +0 -224
  98. package/dist/collection/components/side-menu/test/collapsible/side-menu.e2e.js +0 -28
  99. package/dist/collection/components/side-menu/test/default/side-menu.e2e.js +0 -38
  100. package/dist/collection/components/slider/slider.stories.js +0 -243
  101. package/dist/collection/components/spinner/spinner.stories.js +0 -61
  102. package/dist/collection/components/stepper/stepper.stories.js +0 -95
  103. package/dist/collection/components/table/table/test/batch/table.e2e.js +0 -24
  104. package/dist/collection/components/table/table/test/default/table.e2e.js +0 -46
  105. package/dist/collection/components/table/table/test/expandable-row/table.e2e.js +0 -64
  106. package/dist/collection/components/table/table/test/filtering/table.e2e.js +0 -41
  107. package/dist/collection/components/table/table/test/multiselect/table.e2e.js +0 -47
  108. package/dist/collection/components/table/table/test/pagination/table.e2e.js +0 -53
  109. package/dist/collection/components/table/table/test/sorting/table.e2e.js +0 -36
  110. package/dist/collection/components/table/table-component-basic.stories.js +0 -184
  111. package/dist/collection/components/table/table-component-batch-actions.stories.js +0 -188
  112. package/dist/collection/components/table/table-component-custom-width.stories.js +0 -174
  113. package/dist/collection/components/table/table-component-expandable-rows.stories.js +0 -160
  114. package/dist/collection/components/table/table-component-filtering.stories.js +0 -195
  115. package/dist/collection/components/table/table-component-multiselect.stories.js +0 -211
  116. package/dist/collection/components/table/table-component-pagination.stories.js +0 -196
  117. package/dist/collection/components/table/table-component-sorting.stories.js +0 -240
  118. package/dist/collection/components/tabs/folder-tabs/folder-tabs.stories.js +0 -105
  119. package/dist/collection/components/tabs/inline-tabs/inline-tabs.stories.js +0 -99
  120. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +0 -101
  121. package/dist/collection/components/text-field/text-field.stories.js +0 -247
  122. package/dist/collection/components/textarea/test/basic/textarea.e2e.js +0 -26
  123. package/dist/collection/components/textarea/test/default/textarea.e2e.js +0 -34
  124. package/dist/collection/components/textarea/test/read-only/textarea.e2e.js +0 -26
  125. package/dist/collection/components/textarea/textarea.stories.js +0 -188
  126. package/dist/collection/components/toast/toast.stories.js +0 -90
  127. package/dist/collection/components/toggle/toggle.stories.js +0 -95
  128. package/dist/collection/components/tooltip/tooltip.stories.js +0 -126
  129. package/dist/collection/stories/Installation/angular.stories.js +0 -111
  130. package/dist/collection/stories/Installation/javascript.stories.js +0 -99
  131. package/dist/collection/stories/Installation/react.stories.js +0 -117
  132. package/dist/collection/stories/announcements/announce-tegel.stories.js +0 -262
  133. package/dist/collection/stories/announcements/prefix-change.stories.js +0 -93
  134. package/dist/collection/stories/formatHtmlPreview.js +0 -10
  135. package/dist/collection/stories/foundations/color/color-brand.stories.js +0 -38
  136. package/dist/collection/stories/foundations/color/color-scales.stories.js +0 -71
  137. package/dist/collection/stories/foundations/color/color-semantic.stories.js +0 -40
  138. package/dist/collection/stories/foundations/grid/grid.stories.js +0 -386
  139. package/dist/collection/stories/foundations/spacing/spacing-element.stories.js +0 -100
  140. package/dist/collection/stories/foundations/spacing/spacing-layout.stories.js +0 -94
  141. package/dist/collection/stories/foundations/typography/typography-body.stories.js +0 -16
  142. package/dist/collection/stories/foundations/typography/typography-detail.stories.js +0 -17
  143. package/dist/collection/stories/foundations/typography/typography-headline.stories.js +0 -39
  144. package/dist/collection/stories/foundations/typography/typography-paragraph.stories.js +0 -12
  145. package/dist/collection/stories/patterns/navigation/navigation-basic.stories.js +0 -85
  146. package/dist/collection/stories/patterns/navigation/navigation-fewitems.stories.js +0 -259
  147. package/dist/collection/stories/patterns/navigation/navigation-manyitems.stories.js +0 -247
  148. package/dist/collection/stories/patterns/navigation/navigation-user-menu.stories.js +0 -140
  149. package/dist/collection/stories/tegel.stories.js +0 -283
  150. package/dist/collection/stories/utility/color/background-color.stories.js +0 -96
  151. package/dist/collection/stories/utility/color/text-color.stories.js +0 -94
  152. package/dist/tegel/p-556600b1.entry.js +0 -1
  153. package/dist/tegel/p-c6553022.entry.js +0 -1
  154. package/dist/tegel/p-f801cf0e.entry.js +0 -1
  155. package/dist/types/components/accordion/accordion.stories.d.ts +0 -77
  156. package/dist/types/components/badge/badge.stories.d.ts +0 -73
  157. package/dist/types/components/banner/banner.stories.d.ts +0 -69
  158. package/dist/types/components/block/block.stories.d.ts +0 -32
  159. package/dist/types/components/breadcrumbs/breadcrumbs.stories.d.ts +0 -16
  160. package/dist/types/components/button/button.stories.d.ts +0 -147
  161. package/dist/types/components/card/card.stories.d.ts +0 -128
  162. package/dist/types/components/checkbox/checkbox.stories.d.ts +0 -65
  163. package/dist/types/components/chip/chip.stories.d.ts +0 -99
  164. package/dist/types/components/datetime/datetime.stories.d.ts +0 -151
  165. package/dist/types/components/divider/divider.stories.d.ts +0 -58
  166. package/dist/types/components/dropdown/dropdown.stories.d.ts +0 -205
  167. package/dist/types/components/footer/footer.stories.d.ts +0 -44
  168. package/dist/types/components/header/header.stories.d.ts +0 -32
  169. package/dist/types/components/icon/icon.stories.d.ts +0 -36
  170. package/dist/types/components/link/link.stories.d.ts +0 -44
  171. package/dist/types/components/message/message.stories.d.ts +0 -88
  172. package/dist/types/components/modal/modal.stories.d.ts +0 -78
  173. package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +0 -27
  174. package/dist/types/components/popover-menu/popover-menu.stories.d.ts +0 -51
  175. package/dist/types/components/radio-button/radio-button.stories.d.ts +0 -39
  176. package/dist/types/components/side-menu/side-menu.stories.d.ts +0 -65
  177. package/dist/types/components/slider/slider.stories.d.ts +0 -235
  178. package/dist/types/components/spinner/spinner.stories.d.ts +0 -46
  179. package/dist/types/components/stepper/stepper.stories.d.ts +0 -80
  180. package/dist/types/components/table/table-component-basic.stories.d.ts +0 -144
  181. package/dist/types/components/table/table-component-batch-actions.stories.d.ts +0 -139
  182. package/dist/types/components/table/table-component-custom-width.stories.d.ts +0 -131
  183. package/dist/types/components/table/table-component-expandable-rows.stories.d.ts +0 -131
  184. package/dist/types/components/table/table-component-filtering.stories.d.ts +0 -131
  185. package/dist/types/components/table/table-component-multiselect.stories.d.ts +0 -147
  186. package/dist/types/components/table/table-component-pagination.stories.d.ts +0 -131
  187. package/dist/types/components/table/table-component-sorting.stories.d.ts +0 -183
  188. package/dist/types/components/tabs/folder-tabs/folder-tabs.stories.d.ts +0 -69
  189. package/dist/types/components/tabs/inline-tabs/inline-tabs.stories.d.ts +0 -61
  190. package/dist/types/components/tabs/navigation-tabs/navigation-tabs.stories.d.ts +0 -61
  191. package/dist/types/components/text-field/text-field.stories.d.ts +0 -201
  192. package/dist/types/components/textarea/textarea.stories.d.ts +0 -139
  193. package/dist/types/components/toast/toast.stories.d.ts +0 -64
  194. package/dist/types/components/toggle/toggle.stories.d.ts +0 -74
  195. package/dist/types/components/tooltip/tooltip.stories.d.ts +0 -66
  196. package/dist/types/stories/Installation/angular.stories.d.ts +0 -6
  197. package/dist/types/stories/Installation/javascript.stories.d.ts +0 -7
  198. package/dist/types/stories/Installation/react.stories.d.ts +0 -6
  199. package/dist/types/stories/announcements/announce-tegel.stories.d.ts +0 -6
  200. package/dist/types/stories/announcements/prefix-change.stories.d.ts +0 -6
  201. package/dist/types/stories/formatHtmlPreview.d.ts +0 -2
  202. package/dist/types/stories/foundations/color/color-brand.stories.d.ts +0 -13
  203. package/dist/types/stories/foundations/color/color-scales.stories.d.ts +0 -30
  204. package/dist/types/stories/foundations/color/color-semantic.stories.d.ts +0 -13
  205. package/dist/types/stories/foundations/grid/grid.stories.d.ts +0 -35
  206. package/dist/types/stories/foundations/spacing/spacing-element.stories.d.ts +0 -8
  207. package/dist/types/stories/foundations/spacing/spacing-layout.stories.d.ts +0 -8
  208. package/dist/types/stories/foundations/typography/typography-body.stories.d.ts +0 -8
  209. package/dist/types/stories/foundations/typography/typography-detail.stories.d.ts +0 -8
  210. package/dist/types/stories/foundations/typography/typography-headline.stories.d.ts +0 -21
  211. package/dist/types/stories/foundations/typography/typography-paragraph.stories.d.ts +0 -8
  212. package/dist/types/stories/patterns/navigation/navigation-basic.stories.d.ts +0 -23
  213. package/dist/types/stories/patterns/navigation/navigation-fewitems.stories.d.ts +0 -23
  214. package/dist/types/stories/patterns/navigation/navigation-manyitems.stories.d.ts +0 -38
  215. package/dist/types/stories/patterns/navigation/navigation-user-menu.stories.d.ts +0 -33
  216. package/dist/types/stories/tegel.stories.d.ts +0 -6
  217. package/dist/types/stories/utility/color/background-color.stories.d.ts +0 -64
  218. package/dist/types/stories/utility/color/text-color.stories.d.ts +0 -64
@@ -1,140 +0,0 @@
1
- import formatHtmlPreview from "../../formatHtmlPreview";
2
- import readme from "./readme.md";
3
- export default {
4
- title: 'Patterns/Navigation',
5
- parameters: {
6
- notes: {
7
- Readme: readme,
8
- },
9
- layout: 'fullscreen',
10
- docs: {
11
- source: {
12
- state: 'closed',
13
- },
14
- },
15
- design: [
16
- {
17
- name: 'Figma',
18
- type: 'figma',
19
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=11142%3A42941&t=Ne6myqwca5m00de7-1',
20
- },
21
- {
22
- name: 'Link',
23
- type: 'link',
24
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=11142%3A42941&t=Ne6myqwca5m00de7-1',
25
- },
26
- ],
27
- },
28
- argTypes: {
29
- siteName: {
30
- name: 'Site name',
31
- description: 'Set a custom title for the Header.',
32
- control: {
33
- type: 'text',
34
- },
35
- },
36
- },
37
- args: {
38
- siteName: 'Application',
39
- },
40
- };
41
- const Template = () => formatHtmlPreview(`
42
- <script>
43
- /* For demonstration purposes only. Do this in the preferred way of your framework instead. */
44
- window.demoSideMenu = document.querySelector('#demo-side-menu');
45
- window.demoHamburger = document.querySelector('#demo-hamburger');
46
- </script>
47
- <style>
48
- /* If an extra button in the Header is required except on
49
- very narrow screens, you can use classes like these: */
50
- .demo-hide {
51
- display: none;
52
- }
53
-
54
- @media (min-width: 992px) {
55
- .demo-xs-hide {
56
- display: none;
57
- }
58
- .demo-xs-show {
59
- display: block;
60
- }
61
- }
62
- </style>
63
-
64
-
65
- <div class="demo-layout">
66
- <tds-header>
67
- <tds-header-hamburger class="demo-xs-hide" onclick="demoSideMenu.open = true;demoHamburger.setAttribute('aria-expanded', true);" aria-label="Open application drawer" aria-haspopup="true" aria-expanded="false"></tds-header-hamburger>
68
-
69
- <tds-header-title>
70
- Example: User menu
71
- </tds-header-title>
72
-
73
- <tds-header-launcher slot="end">
74
- <tds-header-launcher-list-title>Sustainable tools</tds-header-launcher-list-title>
75
- <tds-header-launcher-list>
76
- <tds-header-launcher-list-item>
77
- <a href="https://tegel.scania.com">Button</a>
78
- </tds-header-launcher-list-item>
79
- <tds-header-launcher-list-item>
80
- <a href="https://tegel.scania.com">Button</a>
81
- </tds-header-launcher-list-item>
82
- </tds-header-launcher-list>
83
- </tds-header-launcher>
84
-
85
- <tds-header-dropdown slot="end" class="demo-hide demo-xs-show" no-dropdown-icon selected>
86
- <img slot="icon" src="https://www.svgrepo.com/show/384676/account-avatar-profile-user-6.svg" alt="User menu."/>
87
- <tds-header-dropdown-list size="lg">
88
- <tds-header-dropdown-list-user
89
- header="Name Nameson"
90
- subheader="Company name">
91
- </tds-header-dropdown-list-user>
92
- <tds-header-dropdown-list-item selected>
93
- <a href="https://www.scania.com">My Instructions</a>
94
- </tds-header-dropdown-list-item>
95
- <tds-header-dropdown-list-item>
96
- <a href="https://www.scania.com">Task List</a>
97
- </tds-header-dropdown-list-item>
98
- </tds-header-dropdown-list>
99
- </tds-header-dropdown>
100
-
101
- <tds-header-brand-symbol slot="end">
102
- <a aria-label="Scania - red gryphon on blue shield" href="https://scania.com"></a>
103
- </tds-header-brand-symbol>
104
-
105
- </tds-header>
106
-
107
- <tds-side-menu id="demo-side-menu" aria-label="Side menu">
108
- <tds-side-menu-overlay slot="overlay" onclick="demoSideMenu.open = false;demoHamburger.setAttribute('aria-expanded', false);"></tds-side-menu-overlay>
109
-
110
- <tds-side-menu-close-button slot="close-button" onclick="demoSideMenu.open = false;demoHamburger.setAttribute('aria-expanded', false);"></tds-side-menu-close-button>
111
-
112
- <tds-side-menu-dropdown slot="end" class="demo-xs-hide" selected default-open>
113
- <tds-side-menu-user
114
- slot="label"
115
- heading="Name Namesson"
116
- subheading="Company name"
117
- img-src="https://www.svgrepo.com/show/384676/account-avatar-profile-user-6.svg"
118
- img-alt="">
119
- </tds-side-menu-user>
120
- <tds-side-menu-dropdown-list type="lg">
121
- <tds-side-menu-dropdown-list-item selected>
122
- <a href="https://www.scania.com">My Instructions</a>
123
- </tds-side-menu-dropdown-list-item>
124
- <tds-side-menu-dropdown-list-item>
125
- <a href="https://www.scania.com">Task List</a>
126
- </tds-side-menu-dropdown-list-item>
127
- </tds-side-menu-dropdown-list>
128
- </tds-side-menu-dropdown>
129
-
130
-
131
- </tds-side-menu>
132
-
133
- <main class="demo-main tds-u-p3" style="box-sizing: border-box;">
134
- <p>If you display a user menu, a side menu is needed to show it on extra small screens.</p>
135
- <br/>
136
- <p><i>Tip: Resize the window to see the user menu move in to a side menu drawer.</i></p>
137
- </main>
138
- </div>
139
- `);
140
- export const UserMenu = Template.bind({});
@@ -1,283 +0,0 @@
1
- const meta = {
2
- title: 'Intro/Tegel Design System',
3
- parameters: {
4
- layout: 'fullscreen',
5
- options: {
6
- showPanel: false,
7
- showToolbar: false,
8
- },
9
- },
10
- };
11
- export default meta;
12
- export const TegelDesignSystem = {
13
- render: () => `<style>
14
- article {
15
- box-sizing: border-box;
16
- max-width: 688px;
17
- padding: 32px;
18
- margin: auto;
19
- > * {
20
- margin-bottom: 72px;
21
- }
22
- }
23
-
24
- section > p,
25
- section > ul,
26
- section > tds-link {
27
- margin-bottom: 32px;
28
- }
29
-
30
- tds-link {
31
- display: inline-block;
32
- }
33
-
34
- .mb-72 {
35
- margin-bottom: 72px;
36
- }
37
- </style>
38
- <article class="tds-body-01">
39
- <section>
40
- <h1 class="tds-headline-02 mb-72">Tegel Design System</h1>
41
- <p class="tds-paragraph-01 mb-72">The design system supports the design and development of digital solutions at
42
- Scania. The purpose is to secure a
43
- coherent, premium brand and user experience across all of Scania's digital touchpoints.
44
- </p>
45
-
46
- <tds-link>
47
- <a href="https://tegel.scania.com/">
48
- https://tegel.scania.com/
49
- </a>
50
- </tds-link>
51
- </section>
52
- <section>
53
- <h4 class="tds-u-mb2">Status</h4>
54
-
55
- <p>
56
- This package is currently in a <b>beta</b> stage. We are now working hard towards a 1.0 release,
57
- but if
58
- you
59
- want to try out the package today you can! It's available via <tds-link><a href="https://www.npmjs.com/package/@scania/tegel">NPM</a></tds-link> and can be installed using the
60
- installation
61
- guide which you can find <tds-link><a target="_self" href="?path=/story/intro-installation--page">here.</a></tds-link>
62
- </p>
63
-
64
- </section>
65
- <section>
66
- <h4 class="tds-u-mb2">@scania/tegel 🧱</h4>
67
-
68
- <p>
69
- <b>TLDR;</b> The new @scania/tegel package is an improvement and continuation of the previous
70
- @scania/component,
71
- @scania/theme-light, and @scania/icons packages. It simplifies the installation process and ships with types
72
- which offers type safety and improves the developer experience with intellisence and autocompletion.
73
- </p>
74
- <p>
75
- The new
76
- package includes all components as web components, removes the old CSS class components and makes the
77
- installation and updates easier. The current prefix for components, CSS variables, and utility classes -
78
- "sdds",
79
- will be changed. We have also created a new Storybook for @scania/tegel, which allows developers and
80
- designers
81
- to preview all variants of the components by changing the props.
82
- </p>
83
- </section>
84
- <section>
85
- <h4 class="tds-u-mb2">
86
- What is @scania/tegel? 🧱
87
- </h4>
88
-
89
-
90
-
91
-
92
- <p>
93
- In short, the new @scania/tegel package is an improvement and continuation of the previous
94
- @scania/component,
95
- @scania/theme-light and @scania/icons packages. These three packages have now instead been merged into one
96
- to
97
- simplify both the installation process, but also to make it easier for us to maintain and keep improving
98
- going
99
- forward.
100
- </p>
101
- <p>
102
- The new @scania/tegel is also shipped with types. This makes integrations in other Stenciljs
103
- projects
104
- possible, but also improves the developer experience with intellisence and autocompletion, and of course
105
- type
106
- safety. In this work we have also bumped the Stenciljs version (the compiler used to build our components)
107
- to
108
- the
109
- latest major.
110
- </p>
111
- <p>
112
- And we have saved the best for last, @scania/tegel is 100% web components. Previous packages
113
- had
114
- some
115
- web components, but also CSS class components, these were utility classes that could be added to a predefined
116
- HTML
117
- structure to create the look and feel of Tegel. Now we are making a big effort to provide all components as
118
- web components.
119
- </p>
120
- </section>
121
- <section>
122
- <h4 class="tds-u-mb2">
123
- What improvements does @scania/tegel have? 🚀
124
- </h4>
125
-
126
-
127
- <p>
128
- So, what we are striving for in the new package is:
129
-
130
- <ul>
131
- <li>Easy installation and updates</li>
132
- <li>A clear and intuitive API</li>
133
- <li>Types to be included in package bundle</li>
134
- <li>All input elements to work within a form</li>
135
- <li>Only web components</li>
136
- <li>Dark mode</li>
137
- <li>Improved interactive documentation - Storybook</li>
138
- </ul>
139
-
140
- <p>
141
- With this new package we are creating a foundation for us to stand on going forward. We will keep improving
142
- and
143
- maintaining it after its initial release and with the changes we are introducing now we hope to be able to
144
- do
145
- this as
146
- smoothly as possible.
147
- </p>
148
-
149
-
150
-
151
- </p>
152
- </section>
153
- <section>
154
- <h4 class="tds-u-mb2">
155
- Removing CSS class components ❌
156
- </h4>
157
-
158
-
159
- <p>
160
- With this new package we are also removing our CSS components and instead introducing web component
161
- counterparts to these. This means that every component that was available as a CSS component in
162
- @scania/components will have a web component alternative in @scania/tegel. This removal will be done in our
163
- next
164
- release of @scania/tegel. This change does not change the current @scania/components package.
165
-
166
- </p>
167
- </section>
168
- <section>
169
- <h4 class="tds-u-mb2">
170
- Prefix change 🔁
171
- </h4>
172
-
173
-
174
- <tds-link class="tds-u-mt2 tds-body-01">
175
- <a target="_self" href="?path=/story/intro-announcements--prefix-change">Read more here.</a>
176
- </tds-link>
177
- <p>
178
- We are also working on a prefix change for our new package. Instead of "sdds" the components, CSS variables
179
- and
180
- utility classes will instead be prefixed with something else, for example:
181
- <ul>
182
- <li> <{prefix}-button /> </li>
183
- <li> --{prefix}-button-color </li>
184
- <li>.{prefix}-u-flex</li>
185
- </ul>
186
- <p>
187
- This is done to have a clear distinction between what was @scania/components and what is @scania/tegel. What
188
- it
189
- also
190
- does is that it enables the two solutions to be installed alongside each other. This means that your
191
- migration
192
- can
193
- be
194
- done incrementally.
195
- </p>
196
- </p>
197
- </section>
198
- <section>
199
- <h4 class="tds-u-mb1">
200
- Migration docs 📜
201
- </h4>
202
-
203
-
204
- <p>
205
- Migrations are always hard, but during the last couple of months we have put a lot of effort into creating a
206
- "migration document", which explains and highlights all the changes in our API from version 4 of
207
- @scania/components
208
- and @scania/tegel. We hope that this will ease your migration to our new package. The migration document
209
- will
210
- continue to be updated until we release 1.0 and is available
211
- <tds-link><a target="_self"
212
- href="?path=/story/intro-migrating-from-components-v4--page">here.</a></tds-link>
213
- </p>
214
- </section>
215
- <section>
216
- <h4 class="tds-u-mb1">
217
- Support for @scania/components 🤳
218
- </h4>
219
-
220
-
221
- <p>
222
- We will keep supporting @scania/components for a short while going forward, however we see no major
223
- updates
224
- being
225
- done to the package. This means we will keep answering and helping with support questions and do
226
- minor
227
- releases with
228
- bugfixes, but we are not introducing any new features.
229
-
230
- </p>
231
- </section>
232
- <section>
233
- <h4 class="tds-u-mb1">
234
- When can I try our @scania/tegel? 🧪
235
- </h4>
236
-
237
-
238
- <p>
239
- Today! Some of you have already tried this package out, and provided us with valuable feedback,
240
- thank
241
- you!
242
- But
243
- please note that this package is still in beta and breaking changes are to be expected before we
244
- release
245
- 1.0. The
246
- package is available via npm and an installation guide is available <tds-link><a
247
- href="https://www.npmjs.com/package/@scania/tegel">here.</a></tds-link>
248
-
249
- </p>
250
- </section>
251
- <section>
252
-
253
- <h4 class="tds-u-mb1">
254
- Want to get in touch? 📞
255
- </h4>
256
-
257
-
258
- <p>
259
- Awesome! We are available via teams and have two support channels. One for
260
- <tds-link>
261
- <a
262
- href="https://teams.microsoft.com/l/channel/19%3a5e33f67fe502441f914fbcdc6e2548f5%40thread.skype/Development%2520support?groupId=79f9bfeb-73e2-424d-9477-b236191ece5e&tenantId=3bc062e4-ac9d-4c17-b4dd-3aad637ff1ac">development</a>
263
- </tds-link>
264
- and one for
265
- <tds-link>
266
- <a
267
- href="https://teams.microsoft.com/l/channel/19%3A8d30ded56af14672b471062ec1e66345%40thread.skype/Design%2520support?groupId=79f9bfeb-73e2-424d-9477-b236191ece5e&tenantId=3bc062e4-ac9d-4c17-b4dd-3aad637ff1ac">design.</a>
268
-
269
- </tds-link>
270
- If you want to submit a bug report or feature request, please do so via our
271
- <tds-link>
272
- <a href="https://github.com/scania-digital-design-system/tegel/issues">GitHub</a>
273
- </tds-link>.
274
-
275
- <p>
276
- All the best,<br />
277
- The Tegel Team.
278
- </p>
279
- </p>
280
- </section>
281
- </article>
282
- `,
283
- };
@@ -1,96 +0,0 @@
1
- import formatHtmlPreview from "../../formatHtmlPreview";
2
- export default {
3
- title: 'Utilities/Colors',
4
- parameters: {
5
- layout: 'centered',
6
- },
7
- argTypes: {
8
- backgroundColor: {
9
- name: 'Background color',
10
- description: 'The color of the text',
11
- control: {
12
- type: 'select',
13
- },
14
- options: { Red: 'red', Blue: 'blue', Grey: 'grey' },
15
- },
16
- greyScale: {
17
- name: 'Scale',
18
- description: 'The color scale used.',
19
- control: {
20
- type: 'select',
21
- },
22
- options: [
23
- '50',
24
- '100',
25
- '200',
26
- '300',
27
- '400',
28
- '500',
29
- '600',
30
- '700',
31
- '800',
32
- '846',
33
- '868',
34
- '900',
35
- '958',
36
- ],
37
- if: { arg: 'backgroundColor', eq: 'grey' },
38
- },
39
- redScale: {
40
- name: 'Scale',
41
- description: 'The color scale used.',
42
- control: {
43
- type: 'select',
44
- },
45
- options: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
46
- if: { arg: 'backgroundColor', eq: 'red' },
47
- },
48
- blueScale: {
49
- name: 'Scale',
50
- description: 'The color scale used.',
51
- control: {
52
- type: 'select',
53
- },
54
- options: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
55
- if: { arg: 'backgroundColor', eq: 'blue' },
56
- },
57
- },
58
- args: {
59
- backgroundColor: 'blue',
60
- blueScale: '500',
61
- redScale: '500',
62
- greyScale: '958',
63
- },
64
- };
65
- const Template = ({ backgroundColor, greyScale, blueScale, redScale }) => {
66
- let scale = 100;
67
- switch (backgroundColor) {
68
- case 'blue':
69
- scale = blueScale;
70
- break;
71
- case 'grey':
72
- scale = greyScale;
73
- break;
74
- case 'red':
75
- scale = redScale;
76
- break;
77
- default:
78
- scale = blueScale;
79
- break;
80
- }
81
- return formatHtmlPreview(`
82
- <style>
83
- .demo-wrapper{
84
- height: 400px;
85
- width: 400px;
86
- display: flex;
87
- justify-content: center;
88
- align-items: center;
89
- }
90
- </style>
91
- <div class="tds-background-${backgroundColor}-${scale} demo-wrapper">
92
- <h1>background-color:${backgroundColor}</h1>
93
- </div>
94
- `);
95
- };
96
- export const BackgroundColor = Template.bind({});
@@ -1,94 +0,0 @@
1
- import formatHtmlPreview from "../../formatHtmlPreview";
2
- export default {
3
- title: 'Utilities/Colors',
4
- parameters: {
5
- layout: 'centered',
6
- },
7
- argTypes: {
8
- color: {
9
- name: 'Color',
10
- description: 'The color of the text',
11
- control: {
12
- type: 'select',
13
- },
14
- options: { Red: 'red', Blue: 'blue', Grey: 'grey' },
15
- },
16
- greyScale: {
17
- name: 'Scale',
18
- description: 'The color scale used.',
19
- control: {
20
- type: 'select',
21
- },
22
- options: [
23
- '50',
24
- '100',
25
- '200',
26
- '300',
27
- '400',
28
- '500',
29
- '600',
30
- '700',
31
- '800',
32
- '846',
33
- '868',
34
- '900',
35
- '958',
36
- ],
37
- if: { arg: 'color', eq: 'grey' },
38
- },
39
- redScale: {
40
- name: 'Scale',
41
- description: 'The color scale used.',
42
- control: {
43
- type: 'select',
44
- },
45
- options: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
46
- if: { arg: 'color', eq: 'red' },
47
- },
48
- blueScale: {
49
- name: 'Scale',
50
- description: 'The color scale used.',
51
- control: {
52
- type: 'select',
53
- },
54
- options: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
55
- if: { arg: 'color', eq: 'blue' },
56
- },
57
- },
58
- args: {
59
- color: 'blue',
60
- blueScale: '500',
61
- redScale: '500',
62
- greyScale: '958',
63
- },
64
- };
65
- const Template = ({ color, greyScale, blueScale, redScale }) => {
66
- let scale = 100;
67
- switch (color) {
68
- case 'blue':
69
- scale = blueScale;
70
- break;
71
- case 'grey':
72
- scale = greyScale;
73
- break;
74
- case 'red':
75
- scale = redScale;
76
- break;
77
- default:
78
- scale = blueScale;
79
- break;
80
- }
81
- return formatHtmlPreview(`
82
- <style>
83
- .demo-wrapper h1 {
84
- margin: 0;
85
- width: 300px;
86
- }
87
- </style>
88
- <div class="demo-wrapper">
89
- <h1 class="tds-text-${color}-${scale}">A text ${color} heading</h1>
90
- <p class="tds-text-${color}-${scale}">A text ${color} paragraph</p>
91
- </div>
92
- `);
93
- };
94
- export const TextColor = Template.bind({});
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as s,H as a,g as l}from"./p-4d661599.js";const d=["multiselect","expandableRows","compactDesign","noMinWidth","verticalDividers"],o=class{constructor(a){t(this,a),this.tdsSort=e(this,"tdsSort",7),this.internalSortButtonClicked=e(this,"internalSortButtonClicked",6),this.internalTdsTextAlign=e(this,"internalTdsTextAlign",6),this.internalTdsHover=e(this,"internalTdsHover",6),this.sortButtonClick=()=>{this.sortingDirection="asc"!==this.sortingDirection?"asc":"desc",this.sortedByMyKey=!0,this.tdsSort.emit({tableId:this.tableId,columnKey:this.cellKey,sortingDirection:this.sortingDirection}),this.internalSortButtonClicked.emit({tableId:this.tableId,key:this.cellKey})},this.headerCellContent=()=>this.sortable?s("button",{class:"tds-table__header-button",onClick:()=>this.sortButtonClick()},s("span",{class:"tds-table__header-button-text",style:{textAlign:this.textAlignState}},this.cellValue),null===this.sortingDirection&&s("svg",{class:"tds-table__header-button-icon",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 15"},s("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.45 13.67V4.62a.5.5 0 0 1 1 0v9.05h-1Z"}),s("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.07 10.28a.5.5 0 0 1 .7.08l2.1 2.66a.1.1 0 0 0 .15 0l2.09-2.66a.5.5 0 1 1 .78.62l-2.08 2.66a1.1 1.1 0 0 1-1.73 0l-2.1-2.66a.5.5 0 0 1 .1-.7ZM3.55.4v9.04a.5.5 0 1 1-1 0V.39h1Z"}),s("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.93 3.78a.5.5 0 0 1-.7-.08l-2.1-2.66a.1.1 0 0 0-.15 0L.89 3.7a.5.5 0 0 1-.78-.62L2.19.42a1.1 1.1 0 0 1 1.73 0l2.1 2.66a.5.5 0 0 1-.1.7Z"})),this.sortingDirection&&s("svg",{class:"tds-table__header-button-icon "+("desc"===this.sortingDirection?"tds-table__header-button-icon--rotate":""),fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},s("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 2.974a1 1 0 0 0-2 0v24.3l-9.312-9.312a1 1 0 0 0-1.414 1.414l9.887 9.888a2.6 2.6 0 0 0 3.677 0l9.888-9.888a1 1 0 0 0-1.414-1.414L17 27.274v-24.3Z"}))):s("p",{class:"tds-table__header-text",style:{textAlign:this.textAlignState}},this.cellValue),this.onHeadCellHover=t=>{this.internalTdsHover.emit({tableId:this.tableId,key:t})},this.cellKey=void 0,this.cellValue=void 0,this.customWidth=void 0,this.sortable=!1,this.textAlign=void 0,this.textAlignState=void 0,this.sortingDirection="asc",this.sortedByMyKey=!1,this.verticalDividers=!1,this.compactDesign=!1,this.noMinWidth=!1,this.multiselect=!1,this.enableToolbarDesign=!1,this.tableId="",this.expandableRows=!1}internalTdsPropChangeListener(t){this.tableId===t.detail.tableId&&t.detail.changed.filter((t=>d.includes(t))).forEach((e=>{if(void 0===this[e])throw new Error(`Table prop is not supported: ${e}`);this[e]=t.detail[e]}))}updateOptionsContent(t){const{tableId:e,key:s}=t.detail;this.tableId===e&&this.cellKey!==s&&(this.sortedByMyKey=!1,setTimeout((()=>{this.sortingDirection=null}),200))}connectedCallback(){this.tableEl=this.host.closest("tds-table"),this.tableId=this.tableEl.tableId}componentWillLoad(){d.forEach((t=>{this[t]=this.tableEl[t]}))}componentWillRender(){this.textAlignState="right"===this.textAlign||"end"===this.textAlign?"right":"left",this.internalTdsTextAlign.emit([this.tableId,this.cellKey,this.textAlignState]),this.enableToolbarDesign=this.host.closest("tds-table").getElementsByTagName("tds-table-toolbar").length>=1}render(){return s(a,{class:{"tds-table__header-cell":!0,"tds-table__header-cell--sortable":this.sortable,"tds-table__header-cell--is-sorted":this.sortedByMyKey,"tds-table__header-cell--custom-width":""!==this.customWidth,"tds-table__header-cell--right-align":"right"===this.textAlignState,"tds-table--compact":this.compactDesign,"tds-table--divider":this.verticalDividers,"tds-table--no-min-width":this.noMinWidth,"tds-table--extra-column":this.multiselect||this.expandableRows,"tds-table--toolbar-available":this.enableToolbarDesign},style:{width:this.customWidth},onMouseOver:()=>this.onHeadCellHover(this.cellKey),onMouseLeave:()=>this.onHeadCellHover("")},this.headerCellContent())}get host(){return l(this)}};o.style=":host(.tds-table__header-cell){box-sizing:border-box;font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);display:table-cell;text-align:left;color:var(--tds-table-color);background-color:var(--tds-table-header-background);border-bottom:1px solid var(--tds-table-header-background-hover);padding:0;height:48px;min-width:192px;box-sizing:border-box;vertical-align:middle;overflow:hidden;transition:background-color 200ms ease}:host(.tds-table__header-cell) *{box-sizing:border-box}:host(.tds-table__header-cell) .tds-table__header-text{padding:0 16px;margin:0}:host(.tds-table__header-cell--sortable) .tds-table__header-button{display:flex;align-items:center;gap:8px;justify-content:start;flex-direction:row;width:100%;height:100%;padding:0 16px;background-color:transparent;border:none;cursor:pointer;transition:background-color 200ms ease}:host(.tds-table__header-cell--sortable) .tds-table__header-button:focus{outline:2px solid var(--tds-table-header-btn-focus);outline-offset:-2px}:host(.tds-table__header-cell--sortable) .tds-table__header-button:focus .tds-table__header-button-icon{opacity:1}:host(.tds-table__header-cell--sortable) .tds-table__header-button .tds-table__header-button-text{font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);text-align:left;color:var(--tds-table-header-btn-color)}:host(.tds-table__header-cell--sortable) .tds-table__header-button .tds-table__header-button-icon{flex:0 0 16px;height:16px;width:16px;opacity:0;transform-origin:center;transition:opacity 200ms ease-in, transform 200ms ease;fill:var(--tds-table-color)}:host(.tds-table__header-cell--sortable) .tds-table__header-button:hover .tds-table__header-button-icon{opacity:1}:host(.tds-table__header-cell--right-align) .tds-table__header-button{text-align:right;justify-content:end;flex-direction:row-reverse}:host(.tds-table__header-cell--is-sorted) .tds-table__header-button{background-color:var(--tds-table-header-btn-background)}:host(.tds-table__header-cell--is-sorted) .tds-table__header-button:hover{background-color:var(--tds-table-header-btn-background-hover)}:host(.tds-table__header-cell--is-sorted) .tds-table__header-button .tds-table__header-button-icon{opacity:1}:host(.tds-table__header-cell--is-sorted) .tds-table__header-button .tds-table__header-button-icon--rotate{transform:rotate(180deg)}:host(.tds-table--compact){height:33px}:host(.tds-table--divider){border-right:1px solid var(--tds-table-divider)}:host(.tds-table--divider:last-of-type){border-right:none}:host(.tds-table--no-min-width){min-width:unset}:host(.tds-table__header-cell:first-of-type){border-top-left-radius:4px}:host(.tds-table__header-cell:last-of-type){border-top-right-radius:4px}:host(.tds-table--extra-column:first-of-type){border-top-left-radius:0}:host(.tds-table--toolbar-available){border-radius:0}:host(.tds-table--extra-column.tds-table--toolbar-available){border-radius:0}:host(.tds-table__header-cell.tds-table--toolbar-available:first-of-type){border-top-left-radius:0}:host(.tds-table__header-cell.tds-table--toolbar-available:last-of-type){border-top-right-radius:0}";export{o as tds_header_cell}
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as o,H as e,g as i}from"./p-4d661599.js";const l=class{constructor(o){t(this,o),this.tdsChange=s(this,"tdsChange",6),this.tdsFocus=s(this,"tdsFocus",6),this.tdsBlur=s(this,"tdsBlur",6),this.tdsInput=s(this,"tdsInput",6),this.setDefaultOption=()=>{Array.from(this.host.children).filter((t=>"TDS-DROPDOWN-OPTION"===t.tagName)).forEach((t=>(this.multiselect?this.defaultValue.split(",").forEach((s=>{s===t.value&&(t.setSelected(!0),this.value=this.value?[...this.value,t.value]:[t.value])})):this.defaultValue===t.value?(t.setSelected(!0),this.value=[t.value]):t.setSelected(!1),this.setValueAttribute(),t)))},this.getChildren=()=>{const t=Array.from(this.host.children).filter((t=>"TDS-DROPDOWN-OPTION"===t.tagName));if(0!==t.length)return t;console.warn("TDS DROPDOWN: Data missing. Disregard if loading data asynchronously.")},this.getOpenDirection=()=>{var t,s,o,e,i;if("auto"===this.openDirection||!this.openDirection){const l=null!==(s=null===(t=this.dropdownList)||void 0===t?void 0:t.offsetHeight)&&void 0!==s?s:0;return(null!==(i=null===(e=(o=this.host).getBoundingClientRect)||void 0===e?void 0:e.call(o).top)&&void 0!==i?i:0)+l+57>window.innerHeight?"up":"down"}return this.openDirection},this.getSelectedChildren=()=>{var t;return null===(t=this.value)||void 0===t?void 0:t.map((t=>this.getChildren().find((s=>s.value===t)))).filter(Boolean)},this.getSelectedChildrenLabels=()=>{var t;return null===(t=this.getSelectedChildren())||void 0===t?void 0:t.map((t=>t.textContent.trim()))},this.getValue=()=>{const t=this.getSelectedChildrenLabels();return t?this.filter?null==t?void 0:t.join(", "):null==t?void 0:t.toString():""},this.setValueAttribute=()=>{var t,s,o;""===(null===(t=this.value)||void 0===t?void 0:t.toString())&&(this.value=null),this.host.setAttribute("value",null!==(o=null===(s=this.value)||void 0===s?void 0:s.map((t=>t)).toString())&&void 0!==o?o:null)},this.handleFilter=t=>{this.tdsInput.emit(t);const s=t.target.value.toLowerCase(),o=this.getChildren();""===s?(o.forEach((t=>(t.removeAttribute("hidden"),t))),this.filterResult=null):this.filterResult=o.filter((t=>(this.normalizeString(t.textContent).toLowerCase().includes(this.normalizeString(s).toLowerCase())?t.removeAttribute("hidden"):t.setAttribute("hidden",""),!t.hasAttribute("hidden")))).length},this.handleFocus=t=>{this.tdsFocus.emit(t)},this.handleBlur=t=>{this.tdsBlur.emit(t)},this.handleChange=()=>{var t,s;this.tdsChange.emit({name:this.name,value:null!==(s=null===(t=this.value)||void 0===t?void 0:t.map((t=>t)).toString())&&void 0!==s?s:null})},this.name=void 0,this.disabled=!1,this.helper=void 0,this.label=void 0,this.labelPosition=void 0,this.modeVariant=null,this.openDirection="auto",this.placeholder=void 0,this.size="lg",this.error=!1,this.multiselect=!1,this.filter=!1,this.normalizeText=!0,this.noResultText="No result",this.defaultValue=void 0,this.open=!1,this.value=void 0,this.filterResult=void 0,this.filterFocus=void 0}async reset(){this.internalReset(),this.handleChange()}async setValue(t,s){let o;o="string"==typeof t?[t]:t,!this.multiselect&&o.length>1&&(console.warn("Tried to select multiple items, but multiselect is not enabled."),o=[o[0]]),this.internalReset();for(let t=0;t<o.length;t++)this.getChildren().some((s=>s.value===o[t]))||o.splice(t,1);this.value=o,this.setValueAttribute(),this.selectChildrenAsSelectedBasedOnSelectionProp(),this.handleChange();const e=this.getSelectedChildren().map((t=>({value:t.value,label:t.textContent.trim()})));return this.inputElement.value=this.filter?this.getValue():e.length>0?e[0].label:"",e}async appendValue(t){this.setValue(this.multiselect&&this.value?[...this.value,t]:t)}async removeValue(t){var s,o;let e;return this.multiselect?null===(s=this.getChildren())||void 0===s||s.forEach((s=>{var o;return s.value===t&&(this.value=null===(o=this.value)||void 0===o?void 0:o.filter((t=>t!==s.value)),e=s.textContent.trim(),s.setSelected(!1)),s})):this.reset(),this.handleChange(),this.setValueAttribute(),null===(o=this.value)||void 0===o?void 0:o.map((t=>({value:t,label:e})))}async close(){this.open=!1}onAnyClick(t){this.open&&!t.composedPath().includes(this.host)&&(this.open=!1)}async onKeyDown(t){const{activeElement:s}=document;if(!s)return;const o=this.getChildren();if("ArrowDown"===t.key){const t=s.nextElementSibling?o.findIndex((t=>t===s.nextElementSibling)):0;o[((t,s)=>{if(void 0===t[s])return 0;for(let o=s;o<t.length;o++)if(!t[o].disabled)return o})(o,t)].focus()}else"ArrowUp"===t.key?o[((t,s)=>{if(void 0===t[s])return t.length-1;for(let o=s;o>=0;o--)if(!t[o].disabled)return o})(o,s.nextElementSibling?this.getChildren().findIndex((t=>t===s.previousElementSibling)):0)].focus():"Escape"===t.key&&(this.open=!1)}handleOpenState(){this.filter&&this.multiselect&&(this.open||(this.inputElement.value=this.getValue()))}componentWillLoad(){this.defaultValue&&this.setDefaultOption()}normalizeString(t){return this.normalizeText?t.normalize("NFD").replace(/\p{Diacritic}/gu,""):t}internalReset(){this.getChildren().forEach((t=>(t.setSelected(!1),t))),this.value=null,this.setValueAttribute()}selectChildrenAsSelectedBasedOnSelectionProp(){this.getChildren().forEach((t=>{this.value.forEach((s=>{t.value!==s?this.multiselect||t.setSelected(!1):t.setSelected(!0)}))}))}render(){var t,s,i,l;return((t,s,o,e)=>{let i=t.querySelector("input");t.querySelector("input")||(i=t.ownerDocument.createElement("input"),i.type="hidden",t.appendChild(i)),i.disabled=e,i.name=s,i.value=o||""})(this.host,this.name,null===(t=this.value)||void 0===t?void 0:t.map((t=>t)).toString(),this.disabled),o(e,{role:"select",class:this.modeVariant?`tds-mode-variant-${this.modeVariant}`:""},this.label&&"outside"===this.labelPosition&&o("div",{class:"label-outside "+(this.disabled?"disabled":"")},this.label),o("div",{class:`dropdown-select ${this.size} ${this.disabled?"disabled":""}`},this.filter?o("div",{class:{filter:!0,focus:this.filterFocus,disabled:this.disabled,error:this.error}},o("div",{class:"value-wrapper"},this.label&&"inside"===this.labelPosition&&this.placeholder&&o("div",{class:`label-inside ${this.size}`},this.label),this.label&&"inside"===this.labelPosition&&!this.placeholder&&o("div",{class:`\n label-inside-as-placeholder\n ${this.size}\n ${(null===(s=this.value)||void 0===s?void 0:s.length)?"selected":""}\n `},this.label),o("input",{ref:t=>this.inputElement=t,class:"inside"===this.labelPosition?"placeholder":"",type:"text",placeholder:this.placeholder,value:this.getValue(),disabled:this.disabled,onInput:t=>this.handleFilter(t),onBlur:t=>{this.filterFocus=!1,this.handleBlur(t)},onFocus:t=>{this.open=!0,this.filterFocus=!0,this.handleFocus(t)},onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)}})),o("tds-icon",{onClick:()=>{this.open=!this.open,this.open&&this.inputElement.focus()},class:this.open?"open":"closed",name:"chevron_down",size:"16px"})):o("button",{onClick:()=>{this.open=!this.open},onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)},class:`\n ${this.value?"value":"placeholder"}\n ${this.open?"open":"closed"}\n ${this.error?"error":""}\n `,disabled:this.disabled},o("div",{class:`value-wrapper ${this.size}`},this.label&&"inside"===this.labelPosition&&this.placeholder&&o("div",{class:`label-inside ${this.size}`},this.label),this.label&&"inside"===this.labelPosition&&!this.placeholder&&o("div",{class:`\n label-inside-as-placeholder\n ${this.size}\n ${(null===(i=this.value)||void 0===i?void 0:i.length)?"selected":""}\n `},this.label),o("div",{class:`placeholder ${this.size}`},(null===(l=this.value)||void 0===l?void 0:l.length)?this.getValue():this.placeholder),o("tds-icon",{class:this.open?"open":"closed",name:"chevron_down",size:"16px"})))),o("div",{ref:t=>this.dropdownList=t,class:`dropdown-list\n ${this.size}\n ${this.open?"open":"closed"}\n ${this.getOpenDirection()}\n ${this.label&&"outside"===this.labelPosition?"label-outside":""}`},o("slot",null),0===this.filterResult&&""!==this.noResultText&&o("div",{class:`no-result ${this.size}`},this.noResultText)),this.helper&&o("div",{class:`helper ${this.error?"error":""} ${this.disabled?"disabled":""}`},this.error&&o("tds-icon",{name:"error",size:"16px"}),this.helper))}get host(){return i(this)}static get watchers(){return{open:["handleOpenState"]}}};l.style='@charset "UTF-8";:host button{all:unset;height:100%;width:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);border-radius:4px 4px 0 0}:host button:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host button .value-wrapper{padding:0 16px;display:flex;align-items:center;justify-content:space-between}:host button.placeholder{color:var(--tds-dropdown-placeholder-color);line-height:1.3}:host button.value{color:var(--tds-dropdown-value-color);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3}:host button:focus{border-bottom-color:var(--tds-dropdown-border-bottom-open)}:host button:focus::before{content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background:var(--tds-dropdown-border-bottom-open)}:host button.error{border-bottom:1px solid var(--tds-negative)}:host button.error:focus{border-bottom-color:transparent}:host button.error:focus::before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-negative)}:host button:disabled{color:var(--tds-dropdown-disabled-color);border-bottom:1px solid transparent}:host .filter{display:flex;align-items:center;justify-content:space-between;height:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);padding-left:16px;border-radius:4px 4px 0 0}:host .filter:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host .filter.disabled{color:var(--tds-dropdown-disabled-color)}:host .filter .value-wrapper{display:flex;width:100%;height:100%}:host .filter .label-inside-as-placeholder{position:absolute;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3;color:var(--tds-dropdown-placeholder-color)}:host .filter .label-inside-as-placeholder.lg{top:20px}:host .filter .label-inside-as-placeholder.md{top:16px}:host .filter .label-inside-as-placeholder.sm{display:none}:host .filter .label-inside-as-placeholder.selected{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .filter .label-inside-as-placeholder.selected.lg{top:12px}:host .filter .label-inside-as-placeholder.selected.md{top:8px}:host .filter .label-inside-as-placeholder.selected.sm{display:none}:host .filter .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .filter.focus{border-bottom-color:transparent}:host .filter.focus::before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-dropdown-border-bottom-open)}:host .filter.error{border-bottom:1px solid var(--tds-negative)}:host .filter.error.focus{border-bottom-color:transparent}:host .filter.error.focus::before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-negative)}:host .filter input{flex:1;all:unset;width:100%}:host .filter input::placeholder{color:var(--tds-dropdown-placeholder-color)}:host .filter input:disabled::placeholder{color:var(--tds-dropdown-disabled-color)}:host .filter tds-icon{margin-right:16px}:host{display:block;position:relative;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls)}:host .label-outside{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);color:var(--tds-dropdown-label-color);margin-bottom:8px}:host .label-outside.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select{position:relative}:host .dropdown-select.disabled .label-inside,:host .dropdown-select.disabled .placeholder,:host .dropdown-select.disabled .label-inside-as-placeholder,:host .dropdown-select.disabled .value-wrapper{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select .label-inside{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);color:var(--tds-dropdown-label-inside-color)}:host .dropdown-select .label-inside.lg{top:12px;left:16px}:host .dropdown-select .label-inside.md{top:8px;left:16px}:host .dropdown-select .label-inside.sm{display:none}:host .dropdown-select .label-inside+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select .placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .dropdown-select .label-inside-as-placeholder{color:var(--tds-dropdown-placeholder-color)}:host .dropdown-select .label-inside-as-placeholder.selected{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .dropdown-select .label-inside-as-placeholder.selected.lg{top:12px}:host .dropdown-select .label-inside-as-placeholder.selected.md{top:8px}:host .dropdown-select .label-inside-as-placeholder.selected.sm{display:none}:host .dropdown-select .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select.lg{height:55px}:host .dropdown-select.md{height:47px}:host .dropdown-select.sm{height:39px}:host .helper{margin-top:4px;color:var(--tds-dropdown-helper-color);font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);display:flex;align-items:center;gap:8px}:host .helper.error{color:var(--tds-negative)}:host .helper.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-list{z-index:100;position:absolute;margin-top:1px;width:100%;transform-origin:top;transition:transform 0.2s ease-in-out;box-shadow:rgba(0, 0, 0, 0.1) 0 2px 3px 0;border-radius:0 0 4px 4px;overflow-y:auto}:host .dropdown-list::-webkit-scrollbar{width:4px;background-color:inherit}:host .dropdown-list::-webkit-scrollbar-thumb{background-color:var(--tds-grey-300)}:host .dropdown-list ::-webkit-scrollbar-button{height:0;width:0}:host .dropdown-list.lg{max-height:312px}:host .dropdown-list.md{max-height:312px}:host .dropdown-list.sm{max-height:260px}:host .dropdown-list.up{bottom:100%;margin-top:0;margin-bottom:1px;transform-origin:bottom;display:flex;flex-direction:column-reverse;box-shadow:rgba(0, 0, 0, 0.1) 0 -1px 3px 0;border-radius:4px 4px 0 0}:host .dropdown-list.up.label-outside{bottom:calc(100% - 24px)}:host .dropdown-list.closed{transform:scaleY(0);visibility:hidden}:host .dropdown-list.open{transform:scaleY(1)}:host .dropdown-list .no-result{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);display:flex;align-items:center;padding:0 16px;background-color:var(--tds-dropdown-bg)}:host .dropdown-list .no-result.lg{height:56px}:host .dropdown-list .no-result.md{height:48px}:host .dropdown-list .no-result.sm{height:40px}:host tds-icon{transition:transform 0.2s ease-in-out}:host tds-icon.open{transform:rotateZ(180deg)}';export{l as tds_dropdown}