@scania/tegel 0.0.1-beta.1 → 0.0.1-beta.11

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 (212) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/sdds-accordion.cjs.entry.js +1 -1
  3. package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +1 -1
  4. package/dist/cjs/sdds-dropdown_2.cjs.entry.js +2 -2
  5. package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +1 -1
  6. package/dist/cjs/sdds-modal.cjs.entry.js +3 -3
  7. package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +1 -1
  8. package/dist/cjs/sdds-popover-canvas.cjs.entry.js +1 -1
  9. package/dist/cjs/sdds-popover-menu.cjs.entry.js +1 -1
  10. package/dist/cjs/sdds-slider.cjs.entry.js +1 -1
  11. package/dist/cjs/sdds-textarea.cjs.entry.js +1 -1
  12. package/dist/cjs/sdds-tooltip.cjs.entry.js +1 -1
  13. package/dist/cjs/tegel.cjs.js +1 -1
  14. package/dist/collection/collection-manifest.json +2 -2
  15. package/dist/collection/components/accordion/accordion.css +0 -14
  16. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +1 -1
  17. package/dist/collection/components/dropdown/dropdown.css +2 -2
  18. package/dist/collection/components/dropdown/dropdown.js +1 -1
  19. package/dist/collection/components/modal/modal.css +7 -8
  20. package/dist/collection/components/modal/modal.js +3 -3
  21. package/dist/collection/components/popover-canvas/popover-canvas.css +1 -2
  22. package/dist/collection/components/popover-menu/popover-menu.css +1 -1
  23. package/dist/collection/components/slider/slider.css +0 -1
  24. package/dist/collection/components/spinner/spinner.js +2 -2
  25. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +1 -1
  26. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +1 -1
  27. package/dist/collection/components/textarea/textarea.css +1 -1
  28. package/dist/collection/components/tooltip/tooltip.css +1 -1
  29. package/dist/collection/components/tooltip/tooltip.js +1 -1
  30. package/dist/components/dropdown-option.js +1 -1
  31. package/dist/components/dropdown.js +1 -1
  32. package/dist/components/sdds-accordion.js +1 -1
  33. package/dist/components/sdds-dropdown-filter.js +1 -1
  34. package/dist/components/sdds-inline-tabs-fullbleed.js +1 -1
  35. package/dist/components/sdds-modal.js +3 -3
  36. package/dist/components/sdds-navigation-tabs.js +1 -1
  37. package/dist/components/sdds-popover-canvas.js +1 -1
  38. package/dist/components/sdds-popover-menu.js +1 -1
  39. package/dist/components/sdds-slider.js +1 -1
  40. package/dist/components/sdds-textarea.js +1 -1
  41. package/dist/components/sdds-tooltip.js +1 -1
  42. package/dist/esm/loader.js +1 -1
  43. package/dist/esm/sdds-accordion.entry.js +1 -1
  44. package/dist/esm/sdds-dropdown-filter.entry.js +1 -1
  45. package/dist/esm/sdds-dropdown_2.entry.js +2 -2
  46. package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +1 -1
  47. package/dist/esm/sdds-modal.entry.js +3 -3
  48. package/dist/esm/sdds-navigation-tabs.entry.js +1 -1
  49. package/dist/esm/sdds-popover-canvas.entry.js +1 -1
  50. package/dist/esm/sdds-popover-menu.entry.js +1 -1
  51. package/dist/esm/sdds-slider.entry.js +1 -1
  52. package/dist/esm/sdds-textarea.entry.js +1 -1
  53. package/dist/esm/sdds-tooltip.entry.js +1 -1
  54. package/dist/esm/tegel.js +1 -1
  55. package/dist/tegel/{p-677baf7f.entry.js → p-0fc35c8c.entry.js} +1 -1
  56. package/dist/tegel/p-21dbda3f.entry.js +1 -0
  57. package/dist/tegel/{p-f2f7aa45.entry.js → p-28116fd7.entry.js} +1 -1
  58. package/dist/tegel/{p-4cb85347.entry.js → p-3c2de07c.entry.js} +1 -1
  59. package/dist/tegel/{p-7451779b.entry.js → p-46140930.entry.js} +1 -1
  60. package/dist/tegel/p-59e49a1c.entry.js +1 -0
  61. package/dist/tegel/{p-d91caec6.entry.js → p-6df7e735.entry.js} +1 -1
  62. package/dist/tegel/p-a468986d.entry.js +1 -0
  63. package/dist/tegel/{p-12ca5cfa.entry.js → p-b57a7d4f.entry.js} +1 -1
  64. package/dist/tegel/{p-4b58a02c.entry.js → p-df98e6db.entry.js} +1 -1
  65. package/dist/tegel/{p-cf72dfd9.entry.js → p-ee84d4a0.entry.js} +1 -1
  66. package/dist/tegel/tegel.css +2 -2
  67. package/dist/tegel/tegel.esm.js +1 -1
  68. package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.d.ts +1 -1
  69. package/dist/types/components/dropdown/dropdown.d.ts +1 -1
  70. package/dist/types/components/modal/modal.d.ts +1 -1
  71. package/dist/types/components/spinner/spinner.d.ts +2 -2
  72. package/dist/types/components/tooltip/tooltip.d.ts +1 -1
  73. package/dist/types/components.d.ts +12 -12
  74. package/package.json +4 -4
  75. package/readme.md +136 -2
  76. package/dist/collection/components/accordion/accordion.stories.js +0 -91
  77. package/dist/collection/components/badge/badge.stories.js +0 -101
  78. package/dist/collection/components/banner/banner.stories.js +0 -93
  79. package/dist/collection/components/block/block.stories.js +0 -46
  80. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +0 -26
  81. package/dist/collection/components/button/button-native.stories.js +0 -183
  82. package/dist/collection/components/button/button-webcomponent.stories.js +0 -182
  83. package/dist/collection/components/card/card.stories.js +0 -181
  84. package/dist/collection/components/checkbox/checkbox.stories.js +0 -54
  85. package/dist/collection/components/chips/chips.stories.js +0 -124
  86. package/dist/collection/components/data-table/native-table.stories.js +0 -182
  87. package/dist/collection/components/data-table/table-component-basic.stories.js +0 -163
  88. package/dist/collection/components/data-table/table-component-batch-actions.stories.js +0 -129
  89. package/dist/collection/components/data-table/table-component-bodydata.stories.js +0 -58
  90. package/dist/collection/components/data-table/table-component-custom-width.stories.js +0 -198
  91. package/dist/collection/components/data-table/table-component-event-listeners.stories.js +0 -153
  92. package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +0 -137
  93. package/dist/collection/components/data-table/table-component-filtering.stories.js +0 -139
  94. package/dist/collection/components/data-table/table-component-multiselect.stories.js +0 -160
  95. package/dist/collection/components/data-table/table-component-pagination.stories.js +0 -129
  96. package/dist/collection/components/data-table/table-component-sorting.stories.js +0 -107
  97. package/dist/collection/components/datetime/datetime.stories.js +0 -149
  98. package/dist/collection/components/divider/divider.stories.js +0 -116
  99. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +0 -130
  100. package/dist/collection/components/dropdown/dropdown-native.stories.js +0 -90
  101. package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +0 -151
  102. package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +0 -146
  103. package/dist/collection/components/footer/footer.stories.js +0 -100
  104. package/dist/collection/components/header/header-all.stories.js +0 -217
  105. package/dist/collection/components/header/header-default.stories.js +0 -47
  106. package/dist/collection/components/header/header-inline.stories.js +0 -113
  107. package/dist/collection/components/header/header-search.stories.js +0 -263
  108. package/dist/collection/components/header/header-toolbar.stories.js +0 -204
  109. package/dist/collection/components/icon/icon-font.stories.js +0 -57
  110. package/dist/collection/components/icon/icon-web-component.stories.js +0 -51
  111. package/dist/collection/components/link/link.stories.js +0 -45
  112. package/dist/collection/components/message/message.stories.js +0 -117
  113. package/dist/collection/components/modal/modal-native.stories.js +0 -121
  114. package/dist/collection/components/modal/modal-webcomponent.stories.js +0 -78
  115. package/dist/collection/components/popover-canvas/popover-canvas.stories.js +0 -87
  116. package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +0 -132
  117. package/dist/collection/components/popover-menu/popover-menu.stories.js +0 -109
  118. package/dist/collection/components/radio-button/radio-button.stories.js +0 -68
  119. package/dist/collection/components/side-menu/side-menu.stories.js +0 -182
  120. package/dist/collection/components/slider/slider.stories.js +0 -251
  121. package/dist/collection/components/spinner/spinner.stories.js +0 -59
  122. package/dist/collection/components/stepper/stepper.stories.js +0 -139
  123. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +0 -65
  124. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +0 -43
  125. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +0 -32
  126. package/dist/collection/components/textarea/textarea.stories.js +0 -149
  127. package/dist/collection/components/textfield/textfield.stories.js +0 -222
  128. package/dist/collection/components/toast/toast.stories.js +0 -119
  129. package/dist/collection/components/toggle/toggle.stories.js +0 -62
  130. package/dist/collection/components/tooltip/tooltip.stories.js +0 -113
  131. package/dist/collection/components/utility/colour/background-color.stories.js +0 -96
  132. package/dist/collection/components/utility/colour/text-color.stories.js +0 -94
  133. package/dist/collection/foundations-stories/colour/colour-brand.stories.js +0 -38
  134. package/dist/collection/foundations-stories/colour/colour-scales.stories.js +0 -71
  135. package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +0 -40
  136. package/dist/collection/foundations-stories/grid/grid.stories.js +0 -386
  137. package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +0 -100
  138. package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +0 -94
  139. package/dist/collection/foundations-stories/typography/typography-body.stories.js +0 -16
  140. package/dist/collection/foundations-stories/typography/typography-detail.stories.js +0 -17
  141. package/dist/collection/foundations-stories/typography/typography-headline.stories.js +0 -39
  142. package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +0 -12
  143. package/dist/tegel/p-2f376504.entry.js +0 -1
  144. package/dist/tegel/p-9d8caf51.entry.js +0 -1
  145. package/dist/tegel/p-b01cface.entry.js +0 -1
  146. package/dist/types/components/accordion/accordion.stories.d.ts +0 -77
  147. package/dist/types/components/badge/badge.stories.d.ts +0 -66
  148. package/dist/types/components/banner/banner.stories.d.ts +0 -68
  149. package/dist/types/components/block/block.stories.d.ts +0 -31
  150. package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +0 -12
  151. package/dist/types/components/button/button-native.stories.d.ts +0 -144
  152. package/dist/types/components/button/button-webcomponent.stories.d.ts +0 -143
  153. package/dist/types/components/card/card.stories.d.ts +0 -114
  154. package/dist/types/components/checkbox/checkbox.stories.d.ts +0 -39
  155. package/dist/types/components/chips/chips.stories.d.ts +0 -81
  156. package/dist/types/components/data-table/native-table.stories.d.ts +0 -147
  157. package/dist/types/components/data-table/table-component-basic.stories.d.ts +0 -100
  158. package/dist/types/components/data-table/table-component-batch-actions.stories.d.ts +0 -98
  159. package/dist/types/components/data-table/table-component-bodydata.stories.d.ts +0 -38
  160. package/dist/types/components/data-table/table-component-custom-width.stories.d.ts +0 -147
  161. package/dist/types/components/data-table/table-component-event-listeners.stories.d.ts +0 -87
  162. package/dist/types/components/data-table/table-component-expandable-rows.stories.d.ts +0 -87
  163. package/dist/types/components/data-table/table-component-filtering.stories.d.ts +0 -100
  164. package/dist/types/components/data-table/table-component-multiselect.stories.d.ts +0 -100
  165. package/dist/types/components/data-table/table-component-pagination.stories.d.ts +0 -100
  166. package/dist/types/components/data-table/table-component-sorting.stories.d.ts +0 -79
  167. package/dist/types/components/datetime/datetime.stories.d.ts +0 -80
  168. package/dist/types/components/divider/divider.stories.d.ts +0 -72
  169. package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.stories.d.ts +0 -73
  170. package/dist/types/components/dropdown/dropdown-native.stories.d.ts +0 -57
  171. package/dist/types/components/dropdown/dropdown-wc-default.stories.d.ts +0 -115
  172. package/dist/types/components/dropdown/dropdown-wc-multiselect.stories.d.ts +0 -115
  173. package/dist/types/components/footer/footer.stories.d.ts +0 -23
  174. package/dist/types/components/header/header-all.stories.d.ts +0 -29
  175. package/dist/types/components/header/header-default.stories.d.ts +0 -29
  176. package/dist/types/components/header/header-inline.stories.d.ts +0 -29
  177. package/dist/types/components/header/header-search.stories.d.ts +0 -29
  178. package/dist/types/components/header/header-toolbar.stories.d.ts +0 -29
  179. package/dist/types/components/icon/icon-font.stories.d.ts +0 -38
  180. package/dist/types/components/icon/icon-web-component.stories.d.ts +0 -38
  181. package/dist/types/components/link/link.stories.d.ts +0 -33
  182. package/dist/types/components/message/message.stories.d.ts +0 -67
  183. package/dist/types/components/modal/modal-native.stories.d.ts +0 -51
  184. package/dist/types/components/modal/modal-webcomponent.stories.d.ts +0 -44
  185. package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +0 -25
  186. package/dist/types/components/popover-menu/popover-menu-icons.stories.d.ts +0 -27
  187. package/dist/types/components/popover-menu/popover-menu.stories.d.ts +0 -27
  188. package/dist/types/components/radio-button/radio-button.stories.d.ts +0 -41
  189. package/dist/types/components/side-menu/side-menu.stories.d.ts +0 -42
  190. package/dist/types/components/slider/slider.stories.d.ts +0 -156
  191. package/dist/types/components/spinner/spinner.stories.d.ts +0 -37
  192. package/dist/types/components/stepper/stepper.stories.d.ts +0 -56
  193. package/dist/types/components/tabs/inline-tabs-default/inline-tabs.stories.d.ts +0 -41
  194. package/dist/types/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.d.ts +0 -25
  195. package/dist/types/components/tabs/navigation-tabs/navigation-tabs.stories.d.ts +0 -13
  196. package/dist/types/components/textarea/textarea.stories.d.ts +0 -111
  197. package/dist/types/components/textfield/textfield.stories.d.ts +0 -176
  198. package/dist/types/components/toast/toast.stories.d.ts +0 -58
  199. package/dist/types/components/toggle/toggle.stories.d.ts +0 -42
  200. package/dist/types/components/tooltip/tooltip.stories.d.ts +0 -54
  201. package/dist/types/components/utility/colour/background-color.stories.d.ts +0 -58
  202. package/dist/types/components/utility/colour/text-color.stories.d.ts +0 -58
  203. package/dist/types/foundations-stories/colour/colour-brand.stories.d.ts +0 -13
  204. package/dist/types/foundations-stories/colour/colour-scales.stories.d.ts +0 -13
  205. package/dist/types/foundations-stories/colour/colour-semantic.stories.d.ts +0 -13
  206. package/dist/types/foundations-stories/grid/grid.stories.d.ts +0 -35
  207. package/dist/types/foundations-stories/spacing/spacing-element.stories.d.ts +0 -8
  208. package/dist/types/foundations-stories/spacing/spacing-layout.stories.d.ts +0 -8
  209. package/dist/types/foundations-stories/typography/typography-body.stories.d.ts +0 -8
  210. package/dist/types/foundations-stories/typography/typography-detail.stories.d.ts +0 -8
  211. package/dist/types/foundations-stories/typography/typography-headline.stories.d.ts +0 -21
  212. package/dist/types/foundations-stories/typography/typography-paragraph.stories.d.ts +0 -8
@@ -173,7 +173,7 @@ export namespace Components {
173
173
  */
174
174
  "state": string;
175
175
  /**
176
- * `Controls type of dropdown. 'Default', 'multiselect' and 'filter' are correct values
176
+ * `Controls type of dropdown.
177
177
  */
178
178
  "type": 'default' | 'multiselect' | 'filter';
179
179
  }
@@ -203,7 +203,7 @@ export namespace Components {
203
203
  */
204
204
  "label": string;
205
205
  /**
206
- * Position of label: `no-label` (default), `inside`, `outside`
206
+ * Position of label
207
207
  */
208
208
  "labelPosition": 'no-label' | 'inside' | 'outside';
209
209
  /**
@@ -312,7 +312,7 @@ export namespace Components {
312
312
  */
313
313
  "prevent": boolean;
314
314
  /**
315
- * Size of modal. Accepted strings are: xs, sm, md, lg.
315
+ * Size of modal
316
316
  */
317
317
  "size": 'xs' | 'sm' | 'md' | 'lg';
318
318
  }
@@ -430,11 +430,11 @@ export namespace Components {
430
430
  }
431
431
  interface SddsSpinner {
432
432
  /**
433
- * Size of spinner. Accepted strings are: xs, sm, md and lg.
433
+ * Size of spinner
434
434
  */
435
435
  "size": 'xs' | 'sm' | 'md' | 'lg';
436
436
  /**
437
- * Variant of spinner. Accepted strings are: standard and inverted
437
+ * Variant of spinner
438
438
  */
439
439
  "variant": 'standard' | 'inverted';
440
440
  }
@@ -662,7 +662,7 @@ export namespace Components {
662
662
  */
663
663
  "mouseOverTooltip": boolean;
664
664
  /**
665
- * Placement of tooltip. Possible values: auto, auto-start, auto-end, top, top-start, top-end, bottom, bottom-start, bottom-end, right, right-start, right-end, left, left-start, left-end.
665
+ * Placement of tooltip.
666
666
  */
667
667
  "placement": Placement;
668
668
  /**
@@ -1120,7 +1120,7 @@ declare namespace LocalJSX {
1120
1120
  */
1121
1121
  "state"?: string;
1122
1122
  /**
1123
- * `Controls type of dropdown. 'Default', 'multiselect' and 'filter' are correct values
1123
+ * `Controls type of dropdown.
1124
1124
  */
1125
1125
  "type"?: 'default' | 'multiselect' | 'filter';
1126
1126
  }
@@ -1150,7 +1150,7 @@ declare namespace LocalJSX {
1150
1150
  */
1151
1151
  "label"?: string;
1152
1152
  /**
1153
- * Position of label: `no-label` (default), `inside`, `outside`
1153
+ * Position of label
1154
1154
  */
1155
1155
  "labelPosition"?: 'no-label' | 'inside' | 'outside';
1156
1156
  /**
@@ -1260,7 +1260,7 @@ declare namespace LocalJSX {
1260
1260
  */
1261
1261
  "prevent"?: boolean;
1262
1262
  /**
1263
- * Size of modal. Accepted strings are: xs, sm, md, lg.
1263
+ * Size of modal
1264
1264
  */
1265
1265
  "size"?: 'xs' | 'sm' | 'md' | 'lg';
1266
1266
  }
@@ -1378,11 +1378,11 @@ declare namespace LocalJSX {
1378
1378
  }
1379
1379
  interface SddsSpinner {
1380
1380
  /**
1381
- * Size of spinner. Accepted strings are: xs, sm, md and lg.
1381
+ * Size of spinner
1382
1382
  */
1383
1383
  "size"?: 'xs' | 'sm' | 'md' | 'lg';
1384
1384
  /**
1385
- * Variant of spinner. Accepted strings are: standard and inverted
1385
+ * Variant of spinner
1386
1386
  */
1387
1387
  "variant"?: 'standard' | 'inverted';
1388
1388
  }
@@ -1666,7 +1666,7 @@ declare namespace LocalJSX {
1666
1666
  */
1667
1667
  "mouseOverTooltip"?: boolean;
1668
1668
  /**
1669
- * Placement of tooltip. Possible values: auto, auto-start, auto-end, top, top-start, top-end, bottom, bottom-start, bottom-end, right, right-start, right-end, left, left-start, left-end.
1669
+ * Placement of tooltip.
1670
1670
  */
1671
1671
  "placement"?: Placement;
1672
1672
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scania/tegel",
3
- "version": "0.0.1-beta.1",
3
+ "version": "0.0.1-beta.11",
4
4
  "description": "Tegel - Scania's Digital Design System",
5
5
  "keywords": [
6
6
  "tegel",
@@ -16,7 +16,7 @@
16
16
  "module": "dist/index.js",
17
17
  "es2015": "dist/esm/index.mjs",
18
18
  "es2017": "dist/esm/index.mjs",
19
- "types": "dist/types/index.d.ts",
19
+ "types": "dist/types/components.d.ts",
20
20
  "collection": "dist/collection/collection-manifest.json",
21
21
  "collection:main": "dist/collection/index.js",
22
22
  "unpkg": "dist/components/components.esm.js",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@popperjs/core": "^2.11.6",
50
- "@stencil/core": "^2.13.0",
50
+ "@stencil/core": "^2.20.0",
51
51
  "@storybook/addon-google-analytics": "^6.2.9",
52
52
  "concurrently": "^7.4.0",
53
53
  "dotenv": "^16.0.3",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "@babel/core": "^7.19.1",
59
- "@stencil/sass": "^2.0.0",
59
+ "@stencil/sass": "^2.0.1",
60
60
  "@storybook/addon-a11y": "^6.5.14",
61
61
  "@storybook/addon-actions": "^6.5.12",
62
62
  "@storybook/addon-essentials": "^6.5.12",
package/readme.md CHANGED
@@ -11,9 +11,143 @@
11
11
 
12
12
  Check out [Tegel Design System](https://tegel.scania.com/) for implementation and technical documentation.
13
13
 
14
- ## Quick start
15
14
 
16
- - Installation: [https://tegel.scania.com/development/getting-started-development/installation](https://tegel.scania.com/development/getting-started-development/installation)
15
+ [comment]: <> (Needs to be updated once a stable version is released.)
16
+ ## Installation
17
+ ### React
18
+
19
+ #### with Typescript
20
+
21
+ 1. Run `npm install @scania/tegel`
22
+ 2. src folder create a file called `register-webcomponents.ts`
23
+ 3. Paste the following into that file:
24
+ ```ts
25
+ import { defineCustomElements, JSX as LocalJSX } from '@scania/tegel/loader';
26
+ import { DetailedHTMLProps, HTMLAttributes } from 'react';
27
+
28
+ type StencilProps<T> = {
29
+ [P in keyof T]?: Omit<T[P], 'ref'> | HTMLAttributes<T>;
30
+ };
31
+
32
+ type ReactProps<T> = {
33
+ [P in keyof T]?: DetailedHTMLProps<HTMLAttributes<T[P]>, T[P]>;
34
+ };
35
+
36
+ type StencilToReact<T = LocalJSX.IntrinsicElements, U = HTMLElementTagNameMap> = StencilProps<T> &
37
+ ReactProps<U>;
38
+
39
+ declare global {
40
+ export namespace JSX {
41
+ interface IntrinsicElements extends StencilToReact { }
42
+ }
43
+ }
44
+
45
+ defineCustomElements(window)
46
+ ```
47
+ 4. In your index.tsx import `register-webcomponents.ts`
48
+ ```tsx
49
+ import React from 'react';
50
+ import ReactDOM from 'react-dom/client';
51
+ import './index.css';
52
+ import App from './App';
53
+ import reportWebVitals from './reportWebVitals';
54
+ import './register-webcomponents';
55
+
56
+ const root = ReactDOM.createRoot(
57
+ document.getElementById('root') as HTMLElement
58
+ );
59
+ root.render(
60
+ <React.StrictMode>
61
+ <App />
62
+ </React.StrictMode>
63
+ );
64
+
65
+ reportWebVitals();
66
+ ```
67
+ 5. In your global css file (usually `App.css`) import the tegel stylesheet.
68
+ ```css
69
+ @import url('@scania/tegel/dist/tegel/tegel.css');
70
+ ```
71
+
72
+ #### with Javascript
73
+ 1. Run `npm install @scania/tegel`
74
+ 2. In your index.jsx define the custom components:
75
+ ```jsx
76
+ import React from 'react';
77
+ import ReactDOM from 'react-dom/client';
78
+ import './index.css';
79
+ import App from './App';
80
+ import reportWebVitals from './reportWebVitals';
81
+ import {defineCustomElements} from '@scania/tegel/loader'
82
+
83
+ const root = ReactDOM.createRoot(document.getElementById('root'));
84
+ root.render(
85
+ <React.StrictMode>
86
+ <App />
87
+ </React.StrictMode>
88
+ );
89
+
90
+ reportWebVitals();
91
+ defineCustomElements()
92
+ ```
93
+ 3. In your global css file (usually `App.css`) import the tegel stylesheet.
94
+ ```css
95
+ @import url('@scania/tegel/dist/tegel/tegel.css');
96
+ ```
97
+
98
+ ### Angular
99
+
100
+ 1. Run `npm install @scania/tegel`
101
+ 2. In your `main.ts` import and call the function `defineCustomElements()`:
102
+
103
+ ```ts
104
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
105
+ import { defineCustomElements } from '@scania/tegel/loader'
106
+ import { AppModule } from './app/app.module';
107
+
108
+
109
+ platformBrowserDynamic().bootstrapModule(AppModule)
110
+ .catch(err => console.error(err));
111
+
112
+ defineCustomElements(window);
113
+ ```
114
+ 3. In your `app.module.ts` import `CUSTOM_ELEMENTS_SCHEMA`:
115
+ ```ts
116
+ import { BrowserModule } from '@angular/platform-browser';
117
+ import { AppComponent } from './app.component';
118
+
119
+ @NgModule({
120
+ declarations: [
121
+ AppComponent
122
+ ],
123
+ imports: [
124
+ BrowserModule
125
+ ],
126
+ providers: [],
127
+ bootstrap: [AppComponent],
128
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
129
+ })
130
+ export class AppModule { }
131
+ ```
132
+ 4. In your global css file (`styles.css`) import the tegel stylesheet.
133
+ ```css
134
+ @import url('@scania/tegel/dist/tegel/tegel.css');
135
+ ```
136
+
137
+ ### HTML
138
+
139
+ 1. Run `npm init` to generate a package.json
140
+ 2. Run `npm install @scania/tegel`
141
+ 3. Import the package and its style in your `<head>`:
142
+ ```html
143
+ <script type="module">
144
+ import { defineCustomElements } from "./node_modules/@scania/tegel/loader/index.es2017.js";
145
+ defineCustomElements();
146
+ </script>
147
+ <link rel="stylesheet" href="./node_modules/@scania/tegel/dist/tegel/tegel.css">
148
+ ```
149
+
150
+
17
151
 
18
152
 
19
153
  See all available components in the [Tegel Design System](https://tegel.scania.com/components/overview).
@@ -1,91 +0,0 @@
1
- import { formatHtmlPreview } from '../../utils/utils';
2
- import readme from './readme.md';
3
- import readmeItem from './accordion-item/readme.md';
4
- export default {
5
- title: 'Components/Accordion',
6
- argTypes: {
7
- iconPosition: {
8
- name: 'Expand icon position',
9
- control: {
10
- type: 'radio',
11
- },
12
- options: { End: 'end', Start: 'start' },
13
- description: 'The horizontal position of the expand icon.',
14
- table: {
15
- defaultValue: { summary: 'end' },
16
- },
17
- },
18
- disabled: {
19
- name: 'Disable all items',
20
- description: 'Disable all accordion items.',
21
- control: {
22
- type: 'boolean',
23
- },
24
- table: {
25
- defaultValue: { summary: 'false' },
26
- },
27
- },
28
- paddingReset: {
29
- name: 'Less padding right',
30
- description: 'Less padding on the right inside accordion items.',
31
- control: {
32
- type: 'boolean',
33
- },
34
- table: {
35
- defaultValue: { summary: 'false' },
36
- },
37
- },
38
- modeVariant: {
39
- name: 'Mode variant',
40
- description: 'Variant of the component.',
41
- control: {
42
- type: 'radio',
43
- },
44
- options: ['Primary', 'Secondary'],
45
- table: {
46
- defaultValue: { summary: 'primary' },
47
- },
48
- },
49
- },
50
- parameters: {
51
- notes: { 'Accordion': readme, 'Accordion item': readmeItem },
52
- design: [
53
- {
54
- name: 'Figma',
55
- type: 'figma',
56
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2762%3A84&t=rVXuTOgTmXPauyHd-1',
57
- },
58
- {
59
- name: 'Link',
60
- type: 'link',
61
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2762%3A84&t=rVXuTOgTmXPauyHd-1',
62
- },
63
- ],
64
- },
65
- args: {
66
- disabled: false,
67
- paddingReset: false,
68
- iconPosition: 'end',
69
- modeVariant: 'Primary',
70
- },
71
- };
72
- const Template = ({ disabled, iconPosition, paddingReset, modeVariant }) => {
73
- const affixAttr = iconPosition === 'start' ? 'expand-icon-position="start"' : '';
74
- const disabledAttr = disabled ? 'disabled' : '';
75
- const paddingResetAttr = paddingReset ? 'padding-reset' : '';
76
- const tabIndexAttr = 'tabindex="0"';
77
- return formatHtmlPreview(`
78
- <sdds-accordion mode-variant="${modeVariant.toLowerCase()}">
79
- <sdds-accordion-item header="First item" ${tabIndexAttr} ${affixAttr} ${disabledAttr} ${paddingResetAttr}>
80
- This is the panel, which contains associated information with the header. Usually it contains text, set in the same size as the header.
81
- Lorem ipsum doler sit amet.
82
- </sdds-accordion-item>
83
- <sdds-accordion-item header="Second item" ${tabIndexAttr} ${affixAttr} ${disabledAttr} ${paddingResetAttr} expanded>
84
- This is the panel, which contains associated information with the header. Usually it contains text, set in the same size as the header.
85
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis laoreet vestibulum fermentum.
86
- </sdds-accordion-item>
87
- </sdds-accordion>
88
- `);
89
- };
90
- export const Default = Template.bind({});
91
- Default.args = {};
@@ -1,101 +0,0 @@
1
- import { formatHtmlPreview } from '../../utils/utils';
2
- import readme from './readme.md';
3
- export default {
4
- title: 'Components/Badge',
5
- parameters: {
6
- layout: 'centered',
7
- notes: readme,
8
- design: [
9
- {
10
- name: 'Figma',
11
- type: 'figma',
12
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=7477%3A297479&t=rVXuTOgTmXPauyHd-1',
13
- },
14
- {
15
- name: 'Link',
16
- type: 'link',
17
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=7477%3A297479&t=rVXuTOgTmXPauyHd-1',
18
- },
19
- ],
20
- },
21
- argTypes: {
22
- visible: {
23
- name: 'Visible',
24
- description: 'Toggle visibility of badge',
25
- control: {
26
- type: 'boolean',
27
- },
28
- table: {
29
- defaultValue: { summary: false },
30
- },
31
- },
32
- value: {
33
- name: 'Value',
34
- description: 'Set a value to show on the badge',
35
- control: {
36
- type: 'number',
37
- },
38
- if: { arg: 'size', neq: 'sm' },
39
- table: {
40
- defaultValue: { summary: null },
41
- },
42
- },
43
- size: {
44
- name: 'Size',
45
- description: 'Size of the component',
46
- options: {
47
- Large: 'lg',
48
- Small: 'sm',
49
- },
50
- control: {
51
- type: 'radio',
52
- },
53
- table: {
54
- defaultValue: { summary: 'lg' },
55
- },
56
- },
57
- },
58
- args: {
59
- visible: true,
60
- size: 'lg',
61
- value: 1,
62
- },
63
- };
64
- const Template = ({ value, size, visible }) => formatHtmlPreview(`<sdds-badges
65
- ${value ? `value="${value}"` : ''}
66
- is-visible=${visible}
67
- size="${size}">
68
- </sdds-badges>`);
69
- export const Default = Template.bind({});
70
- const WithDemoTemplate = ({ value, size, visible }) => formatHtmlPreview(`
71
- <style>
72
- /* Note: Demo classes used here are just for demo purposes in Storybook */
73
- .badges-demo-box {
74
- margin:5px;
75
- height: 32px;
76
- width: 32px;
77
- position: relative;
78
- background-color: #C4C4C4;
79
- }
80
-
81
- .badges-demo-box sdds-badges[size="lg"]{
82
- position: absolute;
83
- left: 16px;
84
- top: -5px;
85
- }
86
-
87
- .badges-demo-box sdds-badges[size="sm"]{
88
- position: absolute;
89
- left: 26px;
90
- top: -2px;
91
- }
92
- </style>
93
-
94
- <div class="badges-demo-box">
95
- <sdds-badges
96
- ${value ? `value="${value}"` : ''}
97
- is-visible=${visible}
98
- size="${size}">
99
- </sdds-badges>
100
- </div>`);
101
- export const WithDemoComponent = WithDemoTemplate.bind({});
@@ -1,93 +0,0 @@
1
- import { formatHtmlPreview } from '../../utils/utils';
2
- // FIXME: CMS: Change state to type in Code tab of component
3
- export default {
4
- title: 'Components/Banner',
5
- parameters: {
6
- layout: 'fullscreen',
7
- design: [
8
- {
9
- name: 'Figma',
10
- type: 'figma',
11
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=5927%3A497&t=rVXuTOgTmXPauyHd-1',
12
- },
13
- {
14
- name: 'Link',
15
- type: 'link',
16
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=5927%3A497&t=rVXuTOgTmXPauyHd-1',
17
- },
18
- ],
19
- },
20
- argTypes: {
21
- state: {
22
- name: 'Type',
23
- description: 'Changes type of component',
24
- options: ['Default', 'Error', 'Info'],
25
- control: {
26
- type: 'radio',
27
- },
28
- table: {
29
- defaultValue: { summary: 'default' },
30
- },
31
- },
32
- header: {
33
- name: 'Header',
34
- description: 'Text to display in header section',
35
- control: {
36
- type: 'text',
37
- },
38
- },
39
- subheader: {
40
- name: 'Subheader',
41
- description: 'Text to display in subheader section',
42
- control: {
43
- type: 'text',
44
- },
45
- },
46
- link: {
47
- name: 'Link',
48
- description: 'Text to display in link section',
49
- control: {
50
- type: 'text',
51
- },
52
- },
53
- prefix: {
54
- name: 'Show icon',
55
- description: 'If an icon should be displayed. For type default the truck icon is used in this example, but it should be changed to suit your needs.',
56
- control: {
57
- type: 'boolean',
58
- },
59
- table: {
60
- defaultValue: { summary: 'true' },
61
- },
62
- },
63
- },
64
- args: {
65
- state: 'Default',
66
- header: 'This is a header text area',
67
- subheader: 'SubHeader text area',
68
- link: 'Learn more',
69
- prefix: true,
70
- },
71
- };
72
- const Template = ({ state, prefix, header, subheader, link }) => formatHtmlPreview(`
73
- <div class="sdds-banner sdds-banner-${state.toLowerCase()}">
74
- ${prefix && state === 'error'
75
- ? '<span class="sdds-banner-prefix"><sdds-icon name="error" size="20px"></sdds-icon></span>'
76
- : ''}
77
- ${prefix && state === 'info'
78
- ? '<span class="sdds-banner-prefix"><sdds-icon name="info" size="20px"></sdds-icon></span>'
79
- : ''}
80
- ${prefix && !(state === 'info' || state === 'error')
81
- ? '<span class="sdds-banner-prefix"><sdds-icon name="truck" size="20px"></sdds-icon></span>'
82
- : ''}
83
- <div class="sdds-banner-body">
84
- ${header && `<h6 class="sdds-banner-header">${header}</h6>`}
85
- ${subheader && `<div class="sdds-banner-subheader">${subheader}</div>`}
86
- ${link && `<a class="sdds-link sdds-banner-link">${link}</a>`}
87
- </div>
88
- <button type="button" aria-label="close" class="sdds-banner-close">
89
- <sdds-icon name="cross" size="20px"></sdds-icon>
90
- </button>
91
- </div>
92
- `);
93
- export const Default = Template.bind({});
@@ -1,46 +0,0 @@
1
- import { formatHtmlPreview } from '../../utils/utils';
2
- export default {
3
- title: 'Components/Block',
4
- parameters: {
5
- layout: 'padded',
6
- design: [
7
- {
8
- name: 'Figma',
9
- type: 'figma',
10
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9743%3A24020&t=rVXuTOgTmXPauyHd-1',
11
- },
12
- {
13
- name: 'Link',
14
- type: 'link',
15
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9743%3A24020&t=rVXuTOgTmXPauyHd-1',
16
- },
17
- ],
18
- },
19
- argTypes: {
20
- type: {
21
- name: 'Mode variation',
22
- description: 'Mode variation adjusts component colors to have better visibility depending on global mode and background. ',
23
- control: {
24
- type: 'radio',
25
- },
26
- options: ['Primary', 'Secondary'],
27
- table: {
28
- defaultValue: { summary: 'Primary' },
29
- },
30
- },
31
- },
32
- args: {
33
- type: 'Primary',
34
- },
35
- };
36
- const Template = ({ type }) => formatHtmlPreview(`
37
- <div class="sdds-block sdds-block-${type.toLowerCase()}">
38
- <h2 class="sdds-headline-02">Block</h2>
39
- <p class="sdds-body-01">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In condimentum nisi ut eleifend ultrices. Nunc venenatis maximus sapien, ac bibendum nisl aliquam in. Morbi ac velit et ligula consectetur interdum. Vestibulum condimentum, augue vitae lobortis rhoncus, mi est ultricies mi, sed tincidunt magna nibh in lectus. Pellentesque vel vulputate orci, vel lacinia orci. Sed suscipit leo at diam ullamcorper, vitae volutpat neque dapibus. Maecenas sit amet rhoncus arcu. Sed sed molestie elit. Nullam in interdum est, vitae aliquam ipsum. Nunc rutrum nibh ut arcu egestas egestas.</p>
40
- <div class="sdds-block">
41
- <h3 class="sdds-headline-03">Block in a block</h3>
42
- <p class="sdds-body-02">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In condimentum nisi ut eleifend ultrices. Nunc venenatis maximus sapien, ac bibendum nisl aliquam in. Morbi ac velit et ligula consectetur interdum. Vestibulum condimentum, augue vitae lobortis rhoncus, mi est ultricies mi, sed tincidunt magna nibh in lectus. Pellentesque vel vulputate orci, vel lacinia orci. Sed suscipit leo at diam ullamcorper, vitae volutpat neque dapibus. Maecenas sit amet rhoncus arcu. Sed sed molestie elit. Nullam in interdum est, vitae aliquam ipsum. Nunc rutrum nibh ut arcu egestas egestas.</p>
43
- </div>
44
- </div>
45
- `);
46
- export const Default = Template.bind({});
@@ -1,26 +0,0 @@
1
- export default {
2
- title: 'Components/Breadcrumb',
3
- parameters: {
4
- design: [
5
- {
6
- name: 'Figma',
7
- type: 'figma',
8
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2703%3A4725&t=rVXuTOgTmXPauyHd-1',
9
- },
10
- {
11
- name: 'Link',
12
- type: 'link',
13
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2703%3A4725&t=rVXuTOgTmXPauyHd-1',
14
- },
15
- ],
16
- }
17
- };
18
- const Template = () => `
19
- <div class="sdds-breadcrumb">
20
- <div class="sdds-breadcrumb-item"><a href="#">Page 1</a></div>
21
- <div class="sdds-breadcrumb-item"><a href="#">Page 2</a></div>
22
- <div class="sdds-breadcrumb-item sdds-breadcrumb-item-current"><a aria-current="page">Page 3</a></div>
23
- </div>
24
- `;
25
- export const Default = Template.bind({});
26
- Default.args = {};