@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
@@ -459,15 +459,15 @@ export namespace Components {
459
459
  /**
460
460
  * The value of column key, usually comes from JSON, needed for sorting
461
461
  */
462
- "cellKey": string;
462
+ "cellKey"?: string;
463
463
  /**
464
464
  * Text that displays in column cell
465
465
  */
466
- "cellValue": string;
466
+ "cellValue"?: string;
467
467
  /**
468
- * In case noMinWidth is set, the user has to specify width value for each column.
468
+ * In case noMinWidth is set, the user has to specify the width value for each column.
469
469
  */
470
- "customWidth": string;
470
+ "customWidth"?: string;
471
471
  /**
472
472
  * Enables sorting on that column
473
473
  */
@@ -475,7 +475,7 @@ export namespace Components {
475
475
  /**
476
476
  * Setting for text align, default is left. Other accepted values are "right" or "end".
477
477
  */
478
- "textAlign": string;
478
+ "textAlign"?: string;
479
479
  }
480
480
  interface TdsHeaderDropdown {
481
481
  /**
@@ -561,17 +561,21 @@ export namespace Components {
561
561
  }
562
562
  interface TdsIcon {
563
563
  /**
564
- * Pass a name of the icon. For icon names, refer to Storybook Icon controls dropdown or https://tegel.scania.com/foundations/icons/icon-library
564
+ * Pass the name of the icon. For icon names, refer to Storybook Icon controls dropdown or https://tegel.scania.com/foundations/icons/icon-library
565
565
  */
566
566
  "name": string;
567
567
  /**
568
- * Pass a size of icon as a string, for example: 32px, 1rem, 4em...
568
+ * Pass a size of icon as a string, for example, 32px, 1rem, 4em...
569
569
  */
570
570
  "size": string;
571
+ /**
572
+ * Set description for the svg.
573
+ */
574
+ "svgDescription"?: string;
571
575
  /**
572
576
  * Override the default title for the svg.
573
577
  */
574
- "svgTitle": string;
578
+ "svgTitle"?: string;
575
579
  }
576
580
  interface TdsInlineTab {
577
581
  /**
@@ -2931,11 +2935,11 @@ declare namespace LocalJSX {
2931
2935
  */
2932
2936
  "cellValue"?: string;
2933
2937
  /**
2934
- * In case noMinWidth is set, the user has to specify width value for each column.
2938
+ * In case noMinWidth is set, the user has to specify the width value for each column.
2935
2939
  */
2936
2940
  "customWidth"?: string;
2937
2941
  /**
2938
- * Sends unique Table identifier, column key and sorting direction to the tds-table-body component, can also be listened to in order to implement custom-sorting logic.
2942
+ * Sends unique Table identifier, column key and sorting direction to the tds-table-body component, can also be listened to implement custom-sorting logic.
2939
2943
  */
2940
2944
  "onTdsSort"?: (event: TdsHeaderCellCustomEvent<{
2941
2945
  tableId: string;
@@ -3035,13 +3039,17 @@ declare namespace LocalJSX {
3035
3039
  }
3036
3040
  interface TdsIcon {
3037
3041
  /**
3038
- * Pass a name of the icon. For icon names, refer to Storybook Icon controls dropdown or https://tegel.scania.com/foundations/icons/icon-library
3042
+ * Pass the name of the icon. For icon names, refer to Storybook Icon controls dropdown or https://tegel.scania.com/foundations/icons/icon-library
3039
3043
  */
3040
3044
  "name"?: string;
3041
3045
  /**
3042
- * Pass a size of icon as a string, for example: 32px, 1rem, 4em...
3046
+ * Pass a size of icon as a string, for example, 32px, 1rem, 4em...
3043
3047
  */
3044
3048
  "size"?: string;
3049
+ /**
3050
+ * Set description for the svg.
3051
+ */
3052
+ "svgDescription"?: string;
3045
3053
  /**
3046
3054
  * Override the default title for the svg.
3047
3055
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scania/tegel",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Tegel Design System",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -1,100 +0,0 @@
1
- import formatHtmlPreview from "../../stories/formatHtmlPreview";
2
- import readme from "./readme.md";
3
- import readmeItem from "./accordion-item/readme.md";
4
- import { ComponentsFolder } from "../../utils/constants";
5
- export default {
6
- title: `${ComponentsFolder}/Accordion`,
7
- argTypes: {
8
- modeVariant: {
9
- name: 'Mode variant',
10
- description: 'Mode variant adjusts component colors to have better visibility depending on global mode and background.',
11
- control: {
12
- type: 'radio',
13
- },
14
- options: ['Inherit from parent', 'Primary', 'Secondary'],
15
- table: {
16
- defaultValue: { summary: 'Inherit from parent' },
17
- },
18
- },
19
- iconPosition: {
20
- name: 'Expand icon position',
21
- description: 'Sets the horizontal position of the expand icon.',
22
- control: {
23
- type: 'radio',
24
- },
25
- options: { End: 'end', Start: 'start' },
26
- table: {
27
- defaultValue: { summary: 'end' },
28
- },
29
- },
30
- paddingReset: {
31
- name: 'Less padding right',
32
- description: 'Sets less padding on the right inside Accordion Items.',
33
- control: {
34
- type: 'boolean',
35
- },
36
- table: {
37
- defaultValue: { summary: false },
38
- },
39
- },
40
- disabled: {
41
- name: 'Disable all items',
42
- description: 'Disables all Accordion Items.',
43
- control: {
44
- type: 'boolean',
45
- },
46
- table: {
47
- defaultValue: { summary: false },
48
- },
49
- },
50
- },
51
- parameters: {
52
- notes: { 'Accordion': readme, 'Accordion Item': readmeItem },
53
- design: [
54
- {
55
- name: 'Figma',
56
- type: 'figma',
57
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2762%3A84&t=rVXuTOgTmXPauyHd-1',
58
- },
59
- {
60
- name: 'Link',
61
- type: 'link',
62
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2762%3A84&t=rVXuTOgTmXPauyHd-1',
63
- },
64
- ],
65
- },
66
- args: {
67
- modeVariant: 'Inherit from parent',
68
- iconPosition: 'end',
69
- paddingReset: false,
70
- disabled: false,
71
- },
72
- };
73
- const Template = ({ disabled, iconPosition, paddingReset, modeVariant }) => {
74
- const affixAttr = iconPosition === 'start' ? 'expand-icon-position="start"' : '';
75
- const disabledAttr = disabled ? 'disabled' : '';
76
- const paddingResetAttr = paddingReset ? 'padding-reset' : '';
77
- return formatHtmlPreview(`
78
- <tds-accordion ${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}>
79
- <tds-accordion-item header="First item" ${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
- </tds-accordion-item>
83
- <tds-accordion-item ${affixAttr} ${disabledAttr} ${paddingResetAttr} expanded>
84
- <div slot="header">Second item</div>
85
- This is the panel, which contains associated information with the header. Usually it contains text, set in the same size as the header.
86
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis laoreet vestibulum fermentum.
87
- </tds-accordion-item>
88
- </tds-accordion>
89
-
90
- <!-- Script tag for demo purposes -->
91
- <script>
92
- accordionItems = document.querySelectorAll('tds-accordion-item');
93
- for (let i = 0; i < accordionItems.length; i++) {
94
- accordionItems[i].addEventListener('tdsToggle',(event) => {
95
- console.log(event)
96
- })
97
- }
98
- </script>`);
99
- };
100
- export const Default = Template.bind({});
@@ -1,19 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- test.describe('tds-accordion', () => {
4
- test('renders basic accordion correctly', async ({ page }) => {
5
- await page.goto('src/components/accordion/test/basic/index.html');
6
- const accordion = page.locator('tds-accordion');
7
- await expect(accordion).toHaveClass(/hydrated/);
8
- await expect(accordion).toContainText('First item');
9
- await expect(accordion).toContainText('Second item');
10
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
11
- });
12
- test('fires tdsToggle event on click', async ({ page }) => {
13
- await page.goto('src/components/accordion/test/basic/index.html');
14
- const accordionFirstItem = page.locator('tds-accordion-item[header="First item"]');
15
- const myEventSpy = await page.spyOnEvent('tdsToggle');
16
- await accordionFirstItem.click();
17
- expect(myEventSpy).toHaveReceivedEvent();
18
- });
19
- });
@@ -1,19 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- test.describe('tds-accordion', () => {
4
- test('renders disabled accordion correctly', async ({ page }) => {
5
- await page.goto('src/components/accordion/test/disabled/index.html');
6
- const accordion = page.locator('tds-accordion');
7
- await expect(accordion).toHaveClass(/hydrated/);
8
- await expect(accordion).toContainText('First item');
9
- await expect(accordion).toContainText('Second item');
10
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
11
- });
12
- test('does not fire tdsToggle event on click on disabled accordion', async ({ page }) => {
13
- await page.goto('src/components/accordion/test/disabled/index.html');
14
- const accordionFirstItem = page.locator('tds-accordion-item[header="First item"]');
15
- const myEventSpy = await page.spyOnEvent('tdsToggle');
16
- await accordionFirstItem.click();
17
- expect(myEventSpy).not.toHaveReceivedEvent();
18
- });
19
- });
@@ -1,24 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- test.describe('tds-accordion', () => {
4
- test('renders expanded accordion correctly', async ({ page }) => {
5
- await page.goto('src/components/accordion/test/expanded/index.html');
6
- const accordion = page.locator('tds-accordion');
7
- await expect(accordion).toHaveClass(/hydrated/);
8
- await expect(accordion).toContainText('First item');
9
- await expect(accordion).toContainText('Second item');
10
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
11
- });
12
- test('does fire tdsToggle event on click on accordion', async ({ page }) => {
13
- await page.goto('src/components/accordion/test/expanded/index.html');
14
- const accordionFirstItem = page.locator('tds-accordion-item[header="First item"]');
15
- const myEventSpy = await page.spyOnEvent('tdsToggle');
16
- await accordionFirstItem.click({
17
- position: {
18
- x: 1,
19
- y: 1,
20
- },
21
- });
22
- expect(myEventSpy).toHaveReceivedEvent();
23
- });
24
- });
@@ -1,24 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- test.describe('tds-accordion', () => {
4
- test('renders padding-reset accordion correctly', async ({ page }) => {
5
- await page.goto('src/components/accordion/test/padding-reset/index.html');
6
- const accordion = page.locator('tds-accordion');
7
- await expect(accordion).toHaveClass(/hydrated/);
8
- await expect(accordion).toContainText('First item');
9
- await expect(accordion).toContainText('Second item');
10
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
11
- });
12
- test('does fire tdsToggle event on click on accordion', async ({ page }) => {
13
- await page.goto('src/components/accordion/test/padding-reset/index.html');
14
- const accordionFirstItem = page.locator('tds-accordion-item[header="First item"]');
15
- const myEventSpy = await page.spyOnEvent('tdsToggle');
16
- await accordionFirstItem.click({
17
- position: {
18
- x: 1,
19
- y: 1,
20
- },
21
- });
22
- expect(myEventSpy).toHaveReceivedEvent();
23
- });
24
- });
@@ -1,106 +0,0 @@
1
- import formatHtmlPreview from "../../stories/formatHtmlPreview";
2
- import readme from "./readme.md";
3
- import { ComponentsFolder } from "../../utils/constants";
4
- export default {
5
- title: `${ComponentsFolder}/Badge`,
6
- parameters: {
7
- layout: 'centered',
8
- notes: readme,
9
- design: [
10
- {
11
- name: 'Figma',
12
- type: 'figma',
13
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=7477%3A297479&t=rVXuTOgTmXPauyHd-1',
14
- },
15
- {
16
- name: 'Link',
17
- type: 'link',
18
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=7477%3A297479&t=rVXuTOgTmXPauyHd-1',
19
- },
20
- ],
21
- },
22
- argTypes: {
23
- size: {
24
- name: 'Size',
25
- description: 'Sets the size of the component.',
26
- control: {
27
- type: 'radio',
28
- },
29
- options: {
30
- Large: 'lg',
31
- Small: 'sm',
32
- },
33
- table: {
34
- defaultValue: { summary: 'lg' },
35
- },
36
- },
37
- value: {
38
- name: 'Value',
39
- description: 'Sets a value to show on the Badge.',
40
- control: {
41
- type: 'number',
42
- },
43
- if: { arg: 'size', neq: 'sm' },
44
- },
45
- hidden: {
46
- name: 'Hidden',
47
- description: 'Toggles visibility of the Badge.',
48
- control: {
49
- type: 'boolean',
50
- },
51
- table: {
52
- defaultValue: { summary: false },
53
- },
54
- },
55
- demoCode: {
56
- name: 'Demo code',
57
- description: 'Displays code example of component usage. Not part of component props.',
58
- control: {
59
- type: 'boolean',
60
- },
61
- table: {
62
- defaultValue: { summary: false },
63
- },
64
- },
65
- },
66
- args: {
67
- size: 'lg',
68
- value: 1,
69
- hidden: false,
70
- demoCode: false,
71
- },
72
- };
73
- const Template = ({ value, size, hidden, demoCode }) => formatHtmlPreview(`
74
- ${demoCode
75
- ? `<style>
76
- /* Note: Demo classes used here are just for demo purposes in Storybook */
77
- .badge-demo-box {
78
- margin:5px;
79
- height: 32px;
80
- width: 32px;
81
- position: relative;
82
- background-color: #C4C4C4;
83
- }
84
-
85
- .badge-demo-box tds-badge[size="lg"]{
86
- position: absolute;
87
- left: 16px;
88
- top: -5px;
89
- }
90
-
91
- .badge-demo-box tds-badge[size="sm"]{
92
- position: absolute;
93
- left: 26px;
94
- top: -2px;
95
- }
96
- </style>`
97
- : ''}
98
-
99
- <div class="${demoCode ? 'badge-demo-box' : ''}">
100
- <tds-badge
101
- ${value ? `value="${value}"` : ''}
102
- ${hidden ? 'hidden' : ''}
103
- size="${size}">
104
- </tds-badge>
105
- </div>`);
106
- export const Default = Template.bind({});
@@ -1,10 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- test.describe('tds-badge', () => {
4
- test('renders basic badge correctly', async ({ page }) => {
5
- await page.goto('src/components/badge/test/basic/index.html');
6
- const accordion = page.locator('tds-badge');
7
- await expect(accordion).toHaveClass('hydrated');
8
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
9
- });
10
- });
@@ -1,11 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- test.describe('tds-badge', () => {
4
- test('renders value badge correctly', async ({ page }) => {
5
- await page.goto('src/components/badge/test/value/index.html');
6
- (await page.locator('tds-badge').all()).forEach(async (element) => {
7
- await expect(element).toHaveClass(/hydrated/);
8
- });
9
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
10
- });
11
- });
@@ -1,92 +0,0 @@
1
- import formatHtmlPreview from "../../stories/formatHtmlPreview";
2
- import { iconsNames } from "../icon/iconsArray";
3
- import readme from "./readme.md";
4
- import { ComponentsFolder } from "../../utils/constants";
5
- // FIXME: CMS: Change state to type in Code tab of component
6
- export default {
7
- title: `${ComponentsFolder}/Banner`,
8
- parameters: {
9
- notes: readme,
10
- layout: 'fullscreen',
11
- design: [
12
- {
13
- name: 'Figma',
14
- type: 'figma',
15
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=5927%3A497&t=rVXuTOgTmXPauyHd-1',
16
- },
17
- {
18
- name: 'Link',
19
- type: 'link',
20
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=5927%3A497&t=rVXuTOgTmXPauyHd-1',
21
- },
22
- ],
23
- },
24
- argTypes: {
25
- variant: {
26
- name: 'Variant',
27
- description: 'Changes the variant of the component.',
28
- options: ['Default', 'Error', 'Information'],
29
- control: {
30
- type: 'radio',
31
- },
32
- table: {
33
- defaultValue: { summary: 'default' },
34
- },
35
- },
36
- header: {
37
- name: 'Header',
38
- description: 'Sets text to be displayed in the header section.',
39
- control: {
40
- type: 'text',
41
- },
42
- },
43
- subheader: {
44
- name: 'Subheader',
45
- description: 'Sets text to be displayed in the subheader section.',
46
- control: {
47
- type: 'text',
48
- },
49
- },
50
- actions: {
51
- name: 'Actions slot',
52
- description: 'Slot for the bottom part of the Banner, used for links.',
53
- control: {
54
- type: 'text',
55
- },
56
- },
57
- icon: {
58
- name: 'Icon',
59
- description: 'Name of icon to display, choose `none` to remove the icon.',
60
- control: {
61
- type: 'select',
62
- },
63
- options: [...iconsNames, 'none'],
64
- if: { arg: 'variant', eq: 'Default' },
65
- },
66
- },
67
- args: {
68
- variant: 'Default',
69
- header: 'This is a header text area',
70
- subheader: 'This is the subheader text area',
71
- actions: '<tds-link slot="actions" ><a href="/">Link example</a></tds-link>',
72
- icon: 'truck',
73
- },
74
- };
75
- const Template = ({ variant, icon, header, subheader, actions }) => formatHtmlPreview(`
76
- <tds-banner
77
- ${variant !== 'Default' ? `variant="${variant.toLowerCase()}"` : ''}
78
- ${icon !== 'none' && variant === 'Default' ? `icon="${icon}"` : ''}
79
- ${header !== '' ? `header="${header}"` : ''}
80
- ${subheader ? `subheader="${subheader}"` : ''}
81
- >
82
- ${actions ? `${actions}` : ''}
83
- </tds-banner>
84
-
85
- <!-- Script tag with eventlistener for demo purposes. -->
86
- <script>
87
- document.addEventListener('tdsClose', (event) => {
88
- console.log(event)
89
- })
90
- </script>
91
- `);
92
- export const Default = Template.bind({});
@@ -1,15 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- const componentTestPath = 'src/components/banner/test/basic/index.html';
4
- test.describe('tds-banner-basic', () => {
5
- test('renders basic banner correctly', async ({ page }) => {
6
- await page.goto(componentTestPath);
7
- /* Check diff on screenshot */
8
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
9
- });
10
- test('the close button should be visible', async ({ page }) => {
11
- await page.goto(componentTestPath);
12
- const closeButton = page.getByRole('button');
13
- await expect(closeButton).toBeVisible();
14
- });
15
- });
@@ -1,37 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- const componentTestPath = 'src/components/banner/test/default/index.html';
4
- test.describe('tds-banner-default', () => {
5
- test('renders default banner correctly', async ({ page }) => {
6
- await page.goto(componentTestPath);
7
- /* Check diff on screenshot */
8
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
9
- });
10
- test('header exists', async ({ page }) => {
11
- await page.goto(componentTestPath);
12
- const bannerHeader = page.getByText('This is a header text area', { exact: true });
13
- await expect(bannerHeader).toBeVisible();
14
- });
15
- test('text exists', async ({ page }) => {
16
- await page.goto(componentTestPath);
17
- const bannerSubheader = page.getByText('This is the subheader text area', { exact: true });
18
- await expect(bannerSubheader).toBeVisible();
19
- });
20
- test('icons exists', async ({ page }) => {
21
- await page.goto(componentTestPath);
22
- const images = page.getByRole('img');
23
- await expect(images).toHaveCount(2);
24
- });
25
- test('link example exists', async ({ page }) => {
26
- await page.goto(componentTestPath);
27
- const linkExample = page.getByRole('link');
28
- await expect(linkExample).toHaveCount(1);
29
- await expect(linkExample).toBeVisible();
30
- });
31
- test('close button exists', async ({ page }) => {
32
- await page.goto(componentTestPath);
33
- const closeButton = page.getByRole('button');
34
- await expect(closeButton).toHaveCount(1);
35
- await expect(closeButton).toBeVisible();
36
- });
37
- });
@@ -1,15 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- const componentTestPath = 'src/components/banner/test/error/index.html';
4
- test.describe('tds-banner-error', () => {
5
- test('renders error banner correctly', async ({ page }) => {
6
- await page.goto(componentTestPath);
7
- /* Check diff on screenshot */
8
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
9
- });
10
- test('icons exists', async ({ page }) => {
11
- await page.goto(componentTestPath);
12
- const images = page.getByRole('img');
13
- await expect(images).toHaveCount(2);
14
- });
15
- });
@@ -1,15 +0,0 @@
1
- import { test } from "stencil-playwright";
2
- import { expect } from "@playwright/test";
3
- const componentTestPath = 'src/components/banner/test/information/index.html';
4
- test.describe('tds-banner-information', () => {
5
- test('renders information banner correctly', async ({ page }) => {
6
- await page.goto(componentTestPath);
7
- /* Check diff on screenshot */
8
- await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
9
- });
10
- test('icons exists', async ({ page }) => {
11
- await page.goto(componentTestPath);
12
- const images = page.getByRole('img');
13
- await expect(images).toHaveCount(2);
14
- });
15
- });
@@ -1,49 +0,0 @@
1
- import formatHtmlPreview from "../../stories/formatHtmlPreview";
2
- import readme from "./readme.md";
3
- import { ComponentsFolder } from "../../utils/constants";
4
- export default {
5
- title: `${ComponentsFolder}/Block`,
6
- parameters: {
7
- layout: 'padded',
8
- notes: readme,
9
- design: [
10
- {
11
- name: 'Figma',
12
- type: 'figma',
13
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9743%3A24020&t=rVXuTOgTmXPauyHd-1',
14
- },
15
- {
16
- name: 'Link',
17
- type: 'link',
18
- url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9743%3A24020&t=rVXuTOgTmXPauyHd-1',
19
- },
20
- ],
21
- },
22
- argTypes: {
23
- modeVariant: {
24
- name: 'Mode variant',
25
- description: 'Mode variant adjusts component colors to have better visibility depending on global mode and background. ',
26
- control: {
27
- type: 'radio',
28
- },
29
- options: ['Inherit from parent', 'Primary', 'Secondary'],
30
- table: {
31
- defaultValue: { summary: 'Inherit from parent' },
32
- },
33
- },
34
- },
35
- args: {
36
- modeVariant: 'Inherit from parent',
37
- },
38
- };
39
- const Template = ({ modeVariant }) => formatHtmlPreview(`
40
- <tds-block ${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}>
41
- <h2 class="tds-headline-02">Block</h2>
42
- <p class="tds-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>
43
- <tds-block>
44
- <h3 class="tds-headline-04">Nested block</h3>
45
- <p class="tds-detail-03">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>
46
- </tds-block>
47
- </tds-block>
48
- `);
49
- export const Default = Template.bind({});