@scania/tegel 0.0.1-beta

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 (416) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/index-e1c79686.js +1912 -0
  3. package/dist/cjs/index.cjs.js +2 -0
  4. package/dist/cjs/loader.cjs.js +21 -0
  5. package/dist/cjs/popper-11d5f714.js +1801 -0
  6. package/dist/cjs/sdds-accordion-item.cjs.entry.js +34 -0
  7. package/dist/cjs/sdds-accordion.cjs.entry.js +21 -0
  8. package/dist/cjs/sdds-badges.cjs.entry.js +55 -0
  9. package/dist/cjs/sdds-body-cell_2.cjs.entry.js +173 -0
  10. package/dist/cjs/sdds-button.cjs.entry.js +36 -0
  11. package/dist/cjs/sdds-datetime.cjs.entry.js +66 -0
  12. package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +92 -0
  13. package/dist/cjs/sdds-dropdown_2.cjs.entry.js +335 -0
  14. package/dist/cjs/sdds-header-cell.cjs.entry.js +141 -0
  15. package/dist/cjs/sdds-icon.cjs.entry.js +42 -0
  16. package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +96 -0
  17. package/dist/cjs/sdds-inline-tabs.cjs.entry.js +211 -0
  18. package/dist/cjs/sdds-modal.cjs.entry.js +49 -0
  19. package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +95 -0
  20. package/dist/cjs/sdds-popover-canvas.cjs.entry.js +76 -0
  21. package/dist/cjs/sdds-popover-menu.cjs.entry.js +75 -0
  22. package/dist/cjs/sdds-slider.cjs.entry.js +336 -0
  23. package/dist/cjs/sdds-spinner.cjs.entry.js +21 -0
  24. package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +81 -0
  25. package/dist/cjs/sdds-table-body.cjs.entry.js +289 -0
  26. package/dist/cjs/sdds-table-footer.cjs.entry.js +165 -0
  27. package/dist/cjs/sdds-table-header.cjs.entry.js +100 -0
  28. package/dist/cjs/sdds-table-toolbar.cjs.entry.js +66 -0
  29. package/dist/cjs/sdds-table.cjs.entry.js +69 -0
  30. package/dist/cjs/sdds-textarea.cjs.entry.js +61 -0
  31. package/dist/cjs/sdds-textfield.cjs.entry.js +82 -0
  32. package/dist/cjs/sdds-tooltip.cjs.entry.js +95 -0
  33. package/dist/cjs/tegel.cjs.js +19 -0
  34. package/dist/collection/collection-manifest.json +40 -0
  35. package/dist/collection/components/accordion/accordion-item/accordion-item.css +134 -0
  36. package/dist/collection/components/accordion/accordion-item/accordion-item.js +146 -0
  37. package/dist/collection/components/accordion/accordion.css +77 -0
  38. package/dist/collection/components/accordion/accordion.js +62 -0
  39. package/dist/collection/components/accordion/accordion.stories.js +91 -0
  40. package/dist/collection/components/badge/badge.stories.js +101 -0
  41. package/dist/collection/components/badge/badges.css +42 -0
  42. package/dist/collection/components/badge/badges.js +150 -0
  43. package/dist/collection/components/banner/banner.stories.js +93 -0
  44. package/dist/collection/components/block/block.stories.js +46 -0
  45. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +26 -0
  46. package/dist/collection/components/button/button-component.js +154 -0
  47. package/dist/collection/components/button/button-native.stories.js +183 -0
  48. package/dist/collection/components/button/button-webcomponent.stories.js +182 -0
  49. package/dist/collection/components/button/button.css +658 -0
  50. package/dist/collection/components/card/card.stories.js +181 -0
  51. package/dist/collection/components/checkbox/checkbox.stories.js +54 -0
  52. package/dist/collection/components/chips/chips.stories.js +124 -0
  53. package/dist/collection/components/data-table/native-table.stories.js +182 -0
  54. package/dist/collection/components/data-table/table/table.css +15 -0
  55. package/dist/collection/components/data-table/table/table.js +253 -0
  56. package/dist/collection/components/data-table/table-body/table-body.css +22 -0
  57. package/dist/collection/components/data-table/table-body/table-body.js +425 -0
  58. package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +40 -0
  59. package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +169 -0
  60. package/dist/collection/components/data-table/table-body-row/table-body-row.css +196 -0
  61. package/dist/collection/components/data-table/table-body-row/table-body-row.js +164 -0
  62. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +79 -0
  63. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +155 -0
  64. package/dist/collection/components/data-table/table-component-basic.stories.js +163 -0
  65. package/dist/collection/components/data-table/table-component-batch-actions.stories.js +129 -0
  66. package/dist/collection/components/data-table/table-component-bodydata.stories.js +58 -0
  67. package/dist/collection/components/data-table/table-component-custom-width.stories.js +198 -0
  68. package/dist/collection/components/data-table/table-component-event-listeners.stories.js +153 -0
  69. package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +137 -0
  70. package/dist/collection/components/data-table/table-component-filtering.stories.js +139 -0
  71. package/dist/collection/components/data-table/table-component-multiselect.stories.js +160 -0
  72. package/dist/collection/components/data-table/table-component-pagination.stories.js +129 -0
  73. package/dist/collection/components/data-table/table-component-sorting.stories.js +107 -0
  74. package/dist/collection/components/data-table/table-footer/table-footer.css +93 -0
  75. package/dist/collection/components/data-table/table-footer/table-footer.js +355 -0
  76. package/dist/collection/components/data-table/table-header/table-header.css +204 -0
  77. package/dist/collection/components/data-table/table-header/table-header.js +153 -0
  78. package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +126 -0
  79. package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +320 -0
  80. package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +92 -0
  81. package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +142 -0
  82. package/dist/collection/components/datetime/datetime.css +375 -0
  83. package/dist/collection/components/datetime/datetime.js +251 -0
  84. package/dist/collection/components/datetime/datetime.stories.js +149 -0
  85. package/dist/collection/components/divider/divider.stories.js +116 -0
  86. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +339 -0
  87. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +130 -0
  88. package/dist/collection/components/dropdown/dropdown-native.stories.js +90 -0
  89. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +185 -0
  90. package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +151 -0
  91. package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +146 -0
  92. package/dist/collection/components/dropdown/dropdown.css +891 -0
  93. package/dist/collection/components/dropdown/dropdown.js +554 -0
  94. package/dist/collection/components/footer/footer.stories.js +100 -0
  95. package/dist/collection/components/header/header-all.stories.js +217 -0
  96. package/dist/collection/components/header/header-default.stories.js +47 -0
  97. package/dist/collection/components/header/header-inline.stories.js +113 -0
  98. package/dist/collection/components/header/header-search.stories.js +263 -0
  99. package/dist/collection/components/header/header-toolbar.stories.js +204 -0
  100. package/dist/collection/components/icon/icon-font.stories.js +57 -0
  101. package/dist/collection/components/icon/icon-web-component.stories.js +51 -0
  102. package/dist/collection/components/icon/icon.css +16 -0
  103. package/dist/collection/components/icon/icon.js +89 -0
  104. package/dist/collection/components/icon/iconsArray.js +2 -0
  105. package/dist/collection/components/link/link.stories.js +45 -0
  106. package/dist/collection/components/message/message.stories.js +117 -0
  107. package/dist/collection/components/modal/modal-native.stories.js +121 -0
  108. package/dist/collection/components/modal/modal-webcomponent.stories.js +78 -0
  109. package/dist/collection/components/modal/modal.css +324 -0
  110. package/dist/collection/components/modal/modal.js +146 -0
  111. package/dist/collection/components/popover-canvas/popover-canvas.css +20 -0
  112. package/dist/collection/components/popover-canvas/popover-canvas.js +190 -0
  113. package/dist/collection/components/popover-canvas/popover-canvas.stories.js +87 -0
  114. package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +132 -0
  115. package/dist/collection/components/popover-menu/popover-menu.css +19 -0
  116. package/dist/collection/components/popover-menu/popover-menu.js +189 -0
  117. package/dist/collection/components/popover-menu/popover-menu.stories.js +109 -0
  118. package/dist/collection/components/radio-button/radio-button.stories.js +68 -0
  119. package/dist/collection/components/side-menu/side-menu.stories.js +182 -0
  120. package/dist/collection/components/slider/slider.css +260 -0
  121. package/dist/collection/components/slider/slider.js +682 -0
  122. package/dist/collection/components/slider/slider.stories.js +251 -0
  123. package/dist/collection/components/spinner/spinner.css +79 -0
  124. package/dist/collection/components/spinner/spinner.js +61 -0
  125. package/dist/collection/components/spinner/spinner.stories.js +59 -0
  126. package/dist/collection/components/stepper/stepper.stories.js +139 -0
  127. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +159 -0
  128. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +302 -0
  129. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +65 -0
  130. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +172 -0
  131. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +126 -0
  132. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +43 -0
  133. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +153 -0
  134. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +103 -0
  135. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +32 -0
  136. package/dist/collection/components/textarea/textarea.css +283 -0
  137. package/dist/collection/components/textarea/textarea.js +336 -0
  138. package/dist/collection/components/textarea/textarea.stories.js +149 -0
  139. package/dist/collection/components/textfield/textfield.css +494 -0
  140. package/dist/collection/components/textfield/textfield.js +359 -0
  141. package/dist/collection/components/textfield/textfield.stories.js +222 -0
  142. package/dist/collection/components/toast/toast.stories.js +119 -0
  143. package/dist/collection/components/toggle/toggle.stories.js +62 -0
  144. package/dist/collection/components/tooltip/tooltip.css +46 -0
  145. package/dist/collection/components/tooltip/tooltip.js +200 -0
  146. package/dist/collection/components/tooltip/tooltip.stories.js +113 -0
  147. package/dist/collection/components/utility/colour/background-color.stories.js +96 -0
  148. package/dist/collection/components/utility/colour/text-color.stories.js +94 -0
  149. package/dist/collection/foundations-stories/colour/colour-brand.stories.js +38 -0
  150. package/dist/collection/foundations-stories/colour/colour-scales.stories.js +71 -0
  151. package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +40 -0
  152. package/dist/collection/foundations-stories/grid/grid.stories.js +386 -0
  153. package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +100 -0
  154. package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +94 -0
  155. package/dist/collection/foundations-stories/typography/typography-body.stories.js +16 -0
  156. package/dist/collection/foundations-stories/typography/typography-detail.stories.js +17 -0
  157. package/dist/collection/foundations-stories/typography/typography-headline.stories.js +39 -0
  158. package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +12 -0
  159. package/dist/collection/index.js +1 -0
  160. package/dist/collection/stories/assets/code-brackets.svg +1 -0
  161. package/dist/collection/stories/assets/colors.svg +1 -0
  162. package/dist/collection/stories/assets/comments.svg +1 -0
  163. package/dist/collection/stories/assets/direction.svg +1 -0
  164. package/dist/collection/stories/assets/flow.svg +1 -0
  165. package/dist/collection/stories/assets/plugin.svg +1 -0
  166. package/dist/collection/stories/assets/repo.svg +1 -0
  167. package/dist/collection/stories/assets/stackalt.svg +1 -0
  168. package/dist/collection/utils/utils.js +12 -0
  169. package/dist/components/dropdown-option.js +100 -0
  170. package/dist/components/dropdown.js +296 -0
  171. package/dist/components/icon.js +58 -0
  172. package/dist/components/index.d.ts +50 -0
  173. package/dist/components/index.js +30 -0
  174. package/dist/components/popper.js +1799 -0
  175. package/dist/components/sdds-accordion-item.d.ts +11 -0
  176. package/dist/components/sdds-accordion-item.js +60 -0
  177. package/dist/components/sdds-accordion.d.ts +11 -0
  178. package/dist/components/sdds-accordion.js +38 -0
  179. package/dist/components/sdds-badges.d.ts +11 -0
  180. package/dist/components/sdds-badges.js +76 -0
  181. package/dist/components/sdds-body-cell.d.ts +11 -0
  182. package/dist/components/sdds-body-cell.js +6 -0
  183. package/dist/components/sdds-button.d.ts +11 -0
  184. package/dist/components/sdds-button.js +58 -0
  185. package/dist/components/sdds-datetime.d.ts +11 -0
  186. package/dist/components/sdds-datetime.js +90 -0
  187. package/dist/components/sdds-dropdown-filter.d.ts +11 -0
  188. package/dist/components/sdds-dropdown-filter.js +138 -0
  189. package/dist/components/sdds-dropdown-option.d.ts +11 -0
  190. package/dist/components/sdds-dropdown-option.js +6 -0
  191. package/dist/components/sdds-dropdown.d.ts +11 -0
  192. package/dist/components/sdds-dropdown.js +6 -0
  193. package/dist/components/sdds-header-cell.d.ts +11 -0
  194. package/dist/components/sdds-header-cell.js +173 -0
  195. package/dist/components/sdds-icon.d.ts +11 -0
  196. package/dist/components/sdds-icon.js +6 -0
  197. package/dist/components/sdds-inline-tabs-fullbleed.d.ts +11 -0
  198. package/dist/components/sdds-inline-tabs-fullbleed.js +115 -0
  199. package/dist/components/sdds-inline-tabs.d.ts +11 -0
  200. package/dist/components/sdds-inline-tabs.js +235 -0
  201. package/dist/components/sdds-modal.d.ts +11 -0
  202. package/dist/components/sdds-modal.js +69 -0
  203. package/dist/components/sdds-navigation-tabs.d.ts +11 -0
  204. package/dist/components/sdds-navigation-tabs.js +113 -0
  205. package/dist/components/sdds-popover-canvas.d.ts +11 -0
  206. package/dist/components/sdds-popover-canvas.js +97 -0
  207. package/dist/components/sdds-popover-menu.d.ts +11 -0
  208. package/dist/components/sdds-popover-menu.js +96 -0
  209. package/dist/components/sdds-slider.d.ts +11 -0
  210. package/dist/components/sdds-slider.js +366 -0
  211. package/dist/components/sdds-spinner.d.ts +11 -0
  212. package/dist/components/sdds-spinner.js +37 -0
  213. package/dist/components/sdds-table-body-row-expandable.d.ts +11 -0
  214. package/dist/components/sdds-table-body-row-expandable.js +104 -0
  215. package/dist/components/sdds-table-body-row.d.ts +11 -0
  216. package/dist/components/sdds-table-body-row.js +6 -0
  217. package/dist/components/sdds-table-body.d.ts +11 -0
  218. package/dist/components/sdds-table-body.js +337 -0
  219. package/dist/components/sdds-table-footer.d.ts +11 -0
  220. package/dist/components/sdds-table-footer.js +196 -0
  221. package/dist/components/sdds-table-header.d.ts +11 -0
  222. package/dist/components/sdds-table-header.js +125 -0
  223. package/dist/components/sdds-table-toolbar.d.ts +11 -0
  224. package/dist/components/sdds-table-toolbar.js +88 -0
  225. package/dist/components/sdds-table.d.ts +11 -0
  226. package/dist/components/sdds-table.js +92 -0
  227. package/dist/components/sdds-textarea.d.ts +11 -0
  228. package/dist/components/sdds-textarea.js +90 -0
  229. package/dist/components/sdds-textfield.d.ts +11 -0
  230. package/dist/components/sdds-textfield.js +111 -0
  231. package/dist/components/sdds-tooltip.d.ts +11 -0
  232. package/dist/components/sdds-tooltip.js +116 -0
  233. package/dist/components/table-body-cell.js +102 -0
  234. package/dist/components/table-body-row.js +119 -0
  235. package/dist/esm/index-b67b15a6.js +1884 -0
  236. package/dist/esm/index.js +1 -0
  237. package/dist/esm/loader.js +17 -0
  238. package/dist/esm/polyfills/core-js.js +11 -0
  239. package/dist/esm/polyfills/css-shim.js +1 -0
  240. package/dist/esm/polyfills/dom.js +79 -0
  241. package/dist/esm/polyfills/es5-html-element.js +1 -0
  242. package/dist/esm/polyfills/index.js +34 -0
  243. package/dist/esm/polyfills/system.js +6 -0
  244. package/dist/esm/popper-f860750c.js +1799 -0
  245. package/dist/esm/sdds-accordion-item.entry.js +30 -0
  246. package/dist/esm/sdds-accordion.entry.js +17 -0
  247. package/dist/esm/sdds-badges.entry.js +51 -0
  248. package/dist/esm/sdds-body-cell_2.entry.js +168 -0
  249. package/dist/esm/sdds-button.entry.js +32 -0
  250. package/dist/esm/sdds-datetime.entry.js +62 -0
  251. package/dist/esm/sdds-dropdown-filter.entry.js +88 -0
  252. package/dist/esm/sdds-dropdown_2.entry.js +330 -0
  253. package/dist/esm/sdds-header-cell.entry.js +137 -0
  254. package/dist/esm/sdds-icon.entry.js +38 -0
  255. package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +92 -0
  256. package/dist/esm/sdds-inline-tabs.entry.js +207 -0
  257. package/dist/esm/sdds-modal.entry.js +45 -0
  258. package/dist/esm/sdds-navigation-tabs.entry.js +91 -0
  259. package/dist/esm/sdds-popover-canvas.entry.js +72 -0
  260. package/dist/esm/sdds-popover-menu.entry.js +71 -0
  261. package/dist/esm/sdds-slider.entry.js +332 -0
  262. package/dist/esm/sdds-spinner.entry.js +17 -0
  263. package/dist/esm/sdds-table-body-row-expandable.entry.js +77 -0
  264. package/dist/esm/sdds-table-body.entry.js +285 -0
  265. package/dist/esm/sdds-table-footer.entry.js +161 -0
  266. package/dist/esm/sdds-table-header.entry.js +96 -0
  267. package/dist/esm/sdds-table-toolbar.entry.js +62 -0
  268. package/dist/esm/sdds-table.entry.js +65 -0
  269. package/dist/esm/sdds-textarea.entry.js +57 -0
  270. package/dist/esm/sdds-textfield.entry.js +78 -0
  271. package/dist/esm/sdds-tooltip.entry.js +91 -0
  272. package/dist/esm/tegel.js +17 -0
  273. package/dist/index.cjs.js +1 -0
  274. package/dist/index.js +1 -0
  275. package/dist/node_modules/@types/jest/index.d.ts +1512 -0
  276. package/dist/tegel/index.esm.js +0 -0
  277. package/dist/tegel/p-040efb32.entry.js +1 -0
  278. package/dist/tegel/p-12ca5cfa.entry.js +1 -0
  279. package/dist/tegel/p-157e1618.js +2 -0
  280. package/dist/tegel/p-1fe61cf6.entry.js +1 -0
  281. package/dist/tegel/p-2f376504.entry.js +1 -0
  282. package/dist/tegel/p-44ced895.entry.js +1 -0
  283. package/dist/tegel/p-4880f03d.entry.js +1 -0
  284. package/dist/tegel/p-4aba73a3.entry.js +1 -0
  285. package/dist/tegel/p-4b58a02c.entry.js +1 -0
  286. package/dist/tegel/p-4cb85347.entry.js +1 -0
  287. package/dist/tegel/p-52031b5a.entry.js +1 -0
  288. package/dist/tegel/p-677baf7f.entry.js +1 -0
  289. package/dist/tegel/p-71797eaf.entry.js +1 -0
  290. package/dist/tegel/p-7373284c.entry.js +1 -0
  291. package/dist/tegel/p-7451779b.entry.js +1 -0
  292. package/dist/tegel/p-77aeea3b.entry.js +1 -0
  293. package/dist/tegel/p-8582d6a7.entry.js +1 -0
  294. package/dist/tegel/p-96021bd0.entry.js +1 -0
  295. package/dist/tegel/p-9d8caf51.entry.js +1 -0
  296. package/dist/tegel/p-a5919930.entry.js +1 -0
  297. package/dist/tegel/p-b01cface.entry.js +1 -0
  298. package/dist/tegel/p-bf896643.entry.js +1 -0
  299. package/dist/tegel/p-c311725c.entry.js +1 -0
  300. package/dist/tegel/p-cf72dfd9.entry.js +1 -0
  301. package/dist/tegel/p-d91caec6.entry.js +1 -0
  302. package/dist/tegel/p-e10eec33.entry.js +1 -0
  303. package/dist/tegel/p-ec26fc38.js +1 -0
  304. package/dist/tegel/p-f2262a69.entry.js +1 -0
  305. package/dist/tegel/p-f2f7aa45.entry.js +1 -0
  306. package/dist/tegel/tegel.css +101 -0
  307. package/dist/tegel/tegel.esm.js +1 -0
  308. package/dist/types/components/accordion/accordion-item/accordion-item.d.ts +17 -0
  309. package/dist/types/components/accordion/accordion.d.ts +7 -0
  310. package/dist/types/components/accordion/accordion.stories.d.ts +77 -0
  311. package/dist/types/components/badge/badge.stories.d.ts +66 -0
  312. package/dist/types/components/badge/badges.d.ts +16 -0
  313. package/dist/types/components/banner/banner.stories.d.ts +68 -0
  314. package/dist/types/components/block/block.stories.d.ts +31 -0
  315. package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +12 -0
  316. package/dist/types/components/button/button-component.d.ts +15 -0
  317. package/dist/types/components/button/button-native.stories.d.ts +144 -0
  318. package/dist/types/components/button/button-webcomponent.stories.d.ts +143 -0
  319. package/dist/types/components/card/card.stories.d.ts +114 -0
  320. package/dist/types/components/checkbox/checkbox.stories.d.ts +39 -0
  321. package/dist/types/components/chips/chips.stories.d.ts +81 -0
  322. package/dist/types/components/data-table/native-table.stories.d.ts +147 -0
  323. package/dist/types/components/data-table/table/table.d.ts +47 -0
  324. package/dist/types/components/data-table/table-body/table-body.d.ts +54 -0
  325. package/dist/types/components/data-table/table-body-cell/table-body-cell.d.ts +24 -0
  326. package/dist/types/components/data-table/table-body-row/table-body-row.d.ts +27 -0
  327. package/dist/types/components/data-table/table-body-row-expandable/table-body-row-expandable.d.ts +27 -0
  328. package/dist/types/components/data-table/table-component-basic.stories.d.ts +100 -0
  329. package/dist/types/components/data-table/table-component-batch-actions.stories.d.ts +98 -0
  330. package/dist/types/components/data-table/table-component-bodydata.stories.d.ts +38 -0
  331. package/dist/types/components/data-table/table-component-custom-width.stories.d.ts +147 -0
  332. package/dist/types/components/data-table/table-component-event-listeners.stories.d.ts +87 -0
  333. package/dist/types/components/data-table/table-component-expandable-rows.stories.d.ts +87 -0
  334. package/dist/types/components/data-table/table-component-filtering.stories.d.ts +100 -0
  335. package/dist/types/components/data-table/table-component-multiselect.stories.d.ts +100 -0
  336. package/dist/types/components/data-table/table-component-pagination.stories.d.ts +100 -0
  337. package/dist/types/components/data-table/table-component-sorting.stories.d.ts +79 -0
  338. package/dist/types/components/data-table/table-footer/table-footer.d.ts +50 -0
  339. package/dist/types/components/data-table/table-header/table-header.d.ts +27 -0
  340. package/dist/types/components/data-table/table-header-cell/table-header-cell.d.ts +45 -0
  341. package/dist/types/components/data-table/table-toolbar/table-toolbar.d.ts +22 -0
  342. package/dist/types/components/datetime/datetime.d.ts +32 -0
  343. package/dist/types/components/datetime/datetime.stories.d.ts +80 -0
  344. package/dist/types/components/divider/divider.stories.d.ts +72 -0
  345. package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.d.ts +42 -0
  346. package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.stories.d.ts +73 -0
  347. package/dist/types/components/dropdown/dropdown-native.stories.d.ts +57 -0
  348. package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +19 -0
  349. package/dist/types/components/dropdown/dropdown-wc-default.stories.d.ts +115 -0
  350. package/dist/types/components/dropdown/dropdown-wc-multiselect.stories.d.ts +115 -0
  351. package/dist/types/components/dropdown/dropdown.d.ts +56 -0
  352. package/dist/types/components/footer/footer.stories.d.ts +23 -0
  353. package/dist/types/components/header/header-all.stories.d.ts +29 -0
  354. package/dist/types/components/header/header-default.stories.d.ts +29 -0
  355. package/dist/types/components/header/header-inline.stories.d.ts +29 -0
  356. package/dist/types/components/header/header-search.stories.d.ts +29 -0
  357. package/dist/types/components/header/header-toolbar.stories.d.ts +29 -0
  358. package/dist/types/components/icon/icon-font.stories.d.ts +38 -0
  359. package/dist/types/components/icon/icon-web-component.stories.d.ts +38 -0
  360. package/dist/types/components/icon/icon.d.ts +12 -0
  361. package/dist/types/components/link/link.stories.d.ts +33 -0
  362. package/dist/types/components/message/message.stories.d.ts +67 -0
  363. package/dist/types/components/modal/modal-native.stories.d.ts +51 -0
  364. package/dist/types/components/modal/modal-webcomponent.stories.d.ts +44 -0
  365. package/dist/types/components/modal/modal.d.ts +16 -0
  366. package/dist/types/components/popover-canvas/popover-canvas.d.ts +18 -0
  367. package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +25 -0
  368. package/dist/types/components/popover-menu/popover-menu-icons.stories.d.ts +27 -0
  369. package/dist/types/components/popover-menu/popover-menu.d.ts +18 -0
  370. package/dist/types/components/popover-menu/popover-menu.stories.d.ts +27 -0
  371. package/dist/types/components/radio-button/radio-button.stories.d.ts +41 -0
  372. package/dist/types/components/side-menu/side-menu.stories.d.ts +42 -0
  373. package/dist/types/components/slider/slider.d.ts +82 -0
  374. package/dist/types/components/slider/slider.stories.d.ts +156 -0
  375. package/dist/types/components/spinner/spinner.d.ts +7 -0
  376. package/dist/types/components/spinner/spinner.stories.d.ts +37 -0
  377. package/dist/types/components/stepper/stepper.stories.d.ts +56 -0
  378. package/dist/types/components/tabs/inline-tabs-default/inline-tabs.d.ts +41 -0
  379. package/dist/types/components/tabs/inline-tabs-default/inline-tabs.stories.d.ts +41 -0
  380. package/dist/types/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.d.ts +20 -0
  381. package/dist/types/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.d.ts +25 -0
  382. package/dist/types/components/tabs/navigation-tabs/navigation-tabs.d.ts +18 -0
  383. package/dist/types/components/tabs/navigation-tabs/navigation-tabs.stories.d.ts +13 -0
  384. package/dist/types/components/textarea/textarea.d.ts +41 -0
  385. package/dist/types/components/textarea/textarea.stories.d.ts +111 -0
  386. package/dist/types/components/textfield/textfield.d.ts +42 -0
  387. package/dist/types/components/textfield/textfield.stories.d.ts +176 -0
  388. package/dist/types/components/toast/toast.stories.d.ts +58 -0
  389. package/dist/types/components/toggle/toggle.stories.d.ts +42 -0
  390. package/dist/types/components/tooltip/tooltip.d.ts +20 -0
  391. package/dist/types/components/tooltip/tooltip.stories.d.ts +54 -0
  392. package/dist/types/components/utility/colour/background-color.stories.d.ts +58 -0
  393. package/dist/types/components/utility/colour/text-color.stories.d.ts +58 -0
  394. package/dist/types/components.d.ts +1752 -0
  395. package/dist/types/foundations-stories/colour/colour-brand.stories.d.ts +13 -0
  396. package/dist/types/foundations-stories/colour/colour-scales.stories.d.ts +13 -0
  397. package/dist/types/foundations-stories/colour/colour-semantic.stories.d.ts +13 -0
  398. package/dist/types/foundations-stories/grid/grid.stories.d.ts +35 -0
  399. package/dist/types/foundations-stories/spacing/spacing-element.stories.d.ts +8 -0
  400. package/dist/types/foundations-stories/spacing/spacing-layout.stories.d.ts +8 -0
  401. package/dist/types/foundations-stories/typography/typography-body.stories.d.ts +8 -0
  402. package/dist/types/foundations-stories/typography/typography-detail.stories.d.ts +8 -0
  403. package/dist/types/foundations-stories/typography/typography-headline.stories.d.ts +21 -0
  404. package/dist/types/foundations-stories/typography/typography-paragraph.stories.d.ts +8 -0
  405. package/dist/types/global.d.ts +2 -0
  406. package/dist/types/index.d.ts +1 -0
  407. package/dist/types/stencil-public-runtime.d.ts +1581 -0
  408. package/dist/types/utils/utils.d.ts +2 -0
  409. package/loader/cdn.js +3 -0
  410. package/loader/index.cjs.js +3 -0
  411. package/loader/index.d.ts +12 -0
  412. package/loader/index.es2017.js +3 -0
  413. package/loader/index.js +4 -0
  414. package/loader/package.json +11 -0
  415. package/package.json +86 -0
  416. package/readme.md +186 -0
@@ -0,0 +1,93 @@
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({});
@@ -0,0 +1,46 @@
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({});
@@ -0,0 +1,26 @@
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 = {};
@@ -0,0 +1,154 @@
1
+ import { h } from '@stencil/core';
2
+ export class SddsButton {
3
+ constructor() {
4
+ this.text = '';
5
+ this.type = 'primary';
6
+ this.variant = 'default';
7
+ this.size = 'lg';
8
+ this.disabled = false;
9
+ this.fullbleed = false;
10
+ this.onlyIcon = false;
11
+ }
12
+ componentWillLoad() {
13
+ if (this.text === '') {
14
+ this.onlyIcon = true;
15
+ }
16
+ }
17
+ render() {
18
+ return (h("button", { class: `sdds-btn sdds-btn-${this.type}
19
+ ${`sdds-btn-${this.size}`}
20
+ ${this.disabled ? 'disabled' : ''}
21
+ ${this.fullbleed ? 'sdds-btn-fullbleed' : ''}
22
+ ${this.variant === 'variant' ? 'sdds-on-white-bg' : ''}
23
+ ${this.onlyIcon ? 'sdds-btn-only-icon' : ''}` }, h("span", { class: "sdds-btn-text" }, this.text), h("slot", { name: "icon" })));
24
+ }
25
+ static get is() { return "sdds-button"; }
26
+ static get encapsulation() { return "shadow"; }
27
+ static get originalStyleUrls() {
28
+ return {
29
+ "$": ["button.scss"]
30
+ };
31
+ }
32
+ static get styleUrls() {
33
+ return {
34
+ "$": ["button.css"]
35
+ };
36
+ }
37
+ static get properties() {
38
+ return {
39
+ "text": {
40
+ "type": "string",
41
+ "mutable": false,
42
+ "complexType": {
43
+ "original": "string",
44
+ "resolved": "string",
45
+ "references": {}
46
+ },
47
+ "required": false,
48
+ "optional": false,
49
+ "docs": {
50
+ "tags": [],
51
+ "text": "Text inside a button"
52
+ },
53
+ "attribute": "text",
54
+ "reflect": false,
55
+ "defaultValue": "''"
56
+ },
57
+ "type": {
58
+ "type": "string",
59
+ "mutable": false,
60
+ "complexType": {
61
+ "original": "'primary' | 'secondary' | 'ghost' | 'danger'",
62
+ "resolved": "\"danger\" | \"ghost\" | \"primary\" | \"secondary\"",
63
+ "references": {}
64
+ },
65
+ "required": false,
66
+ "optional": false,
67
+ "docs": {
68
+ "tags": [],
69
+ "text": "Type of button"
70
+ },
71
+ "attribute": "type",
72
+ "reflect": false,
73
+ "defaultValue": "'primary'"
74
+ },
75
+ "variant": {
76
+ "type": "string",
77
+ "mutable": false,
78
+ "complexType": {
79
+ "original": "'default' | 'variant'",
80
+ "resolved": "\"default\" | \"variant\"",
81
+ "references": {}
82
+ },
83
+ "required": false,
84
+ "optional": false,
85
+ "docs": {
86
+ "tags": [],
87
+ "text": ""
88
+ },
89
+ "attribute": "variant",
90
+ "reflect": false,
91
+ "defaultValue": "'default'"
92
+ },
93
+ "size": {
94
+ "type": "string",
95
+ "mutable": false,
96
+ "complexType": {
97
+ "original": "'xs' | 'sm' | 'md' | 'lg'",
98
+ "resolved": "\"lg\" | \"md\" | \"sm\" | \"xs\"",
99
+ "references": {}
100
+ },
101
+ "required": false,
102
+ "optional": false,
103
+ "docs": {
104
+ "tags": [],
105
+ "text": ""
106
+ },
107
+ "attribute": "size",
108
+ "reflect": false,
109
+ "defaultValue": "'lg'"
110
+ },
111
+ "disabled": {
112
+ "type": "boolean",
113
+ "mutable": false,
114
+ "complexType": {
115
+ "original": "boolean",
116
+ "resolved": "boolean",
117
+ "references": {}
118
+ },
119
+ "required": false,
120
+ "optional": false,
121
+ "docs": {
122
+ "tags": [],
123
+ "text": "Control for disabled state of component"
124
+ },
125
+ "attribute": "disabled",
126
+ "reflect": false,
127
+ "defaultValue": "false"
128
+ },
129
+ "fullbleed": {
130
+ "type": "boolean",
131
+ "mutable": false,
132
+ "complexType": {
133
+ "original": "boolean",
134
+ "resolved": "boolean",
135
+ "references": {}
136
+ },
137
+ "required": false,
138
+ "optional": false,
139
+ "docs": {
140
+ "tags": [],
141
+ "text": "When enabled, makes button take 100% width"
142
+ },
143
+ "attribute": "fullbleed",
144
+ "reflect": false,
145
+ "defaultValue": "false"
146
+ }
147
+ };
148
+ }
149
+ static get states() {
150
+ return {
151
+ "onlyIcon": {}
152
+ };
153
+ }
154
+ }
@@ -0,0 +1,183 @@
1
+ import { formatHtmlPreview } from '../../utils/utils';
2
+ import { iconsNames } from '../icon/iconsArray';
3
+ export default {
4
+ title: 'Components/Button',
5
+ parameters: {
6
+ layout: 'padded',
7
+ chromatic: {
8
+ disableSnapshot: false, // enables snapshotting for the component
9
+ },
10
+ design: [
11
+ {
12
+ name: 'Figma',
13
+ type: 'figma',
14
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=1574%3A72148&t=rVXuTOgTmXPauyHd-1',
15
+ },
16
+ {
17
+ name: 'Link',
18
+ type: 'link',
19
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=1574%3A72148&t=rVXuTOgTmXPauyHd-1',
20
+ },
21
+ ],
22
+ },
23
+ argTypes: {
24
+ text: {
25
+ name: 'Text',
26
+ description: 'The text to be displayed on the button',
27
+ control: {
28
+ type: 'text',
29
+ },
30
+ },
31
+ btnType: {
32
+ name: 'Type',
33
+ description: 'Four different button types to help the user to distinguish the level of importance of the task they represent',
34
+ control: {
35
+ type: 'radio',
36
+ },
37
+ options: ['Primary', 'Secondary', 'Ghost', 'Danger'],
38
+ table: {
39
+ defaultValue: { summary: 'primary' },
40
+ },
41
+ },
42
+ size: {
43
+ name: 'Size',
44
+ description: 'Size of the button',
45
+ control: {
46
+ type: 'radio',
47
+ },
48
+ options: ['Large', 'Medium', 'Small', 'Extra small'],
49
+ table: {
50
+ defaultValue: { summary: 'lg' },
51
+ },
52
+ },
53
+ variant: {
54
+ name: 'Variant',
55
+ description: 'Button variant.',
56
+ control: {
57
+ type: 'radio',
58
+ },
59
+ options: ['On light', 'On dark'],
60
+ table: {
61
+ defaultValue: { summary: 'on-dark' },
62
+ },
63
+ },
64
+ fullbleed: {
65
+ name: 'Fullbleed',
66
+ defaultValue: false,
67
+ description: 'Fluid width in certain components-old',
68
+ control: {
69
+ type: 'boolean',
70
+ },
71
+ table: {
72
+ defaultValue: { summary: false },
73
+ },
74
+ if: { arg: 'onlyIcon', eq: false },
75
+ },
76
+ disabled: {
77
+ name: 'Disabled',
78
+ type: 'boolean',
79
+ description: 'Choose to disable the button',
80
+ table: {
81
+ defaultValue: { summary: false },
82
+ },
83
+ },
84
+ onlyIcon: {
85
+ name: 'Only Icon',
86
+ description: 'Displays only the icon and excludes any text from the button',
87
+ control: {
88
+ type: 'boolean',
89
+ },
90
+ table: {
91
+ defaultValue: { summary: false },
92
+ },
93
+ if: { arg: 'size', neq: 'Extra small' },
94
+ },
95
+ icon: {
96
+ name: 'Icon',
97
+ description: 'Icon to display on the button. Choose "none" to exclude the icon.',
98
+ control: {
99
+ type: 'select',
100
+ },
101
+ options: ['none', ...iconsNames],
102
+ if: { arg: 'size', neq: 'Extra small' },
103
+ },
104
+ iconType: {
105
+ name: 'Icon type',
106
+ description: 'Native/Web Component',
107
+ control: {
108
+ type: 'radio',
109
+ },
110
+ options: ['Native', 'Web Component'],
111
+ if: { arg: 'icon', neq: 'none' },
112
+ },
113
+ },
114
+ args: {
115
+ text: 'Button',
116
+ btnType: 'Primary',
117
+ size: 'Large',
118
+ variant: 'On dark',
119
+ fullbleed: false,
120
+ disabled: false,
121
+ onlyIcon: false,
122
+ icon: 'none',
123
+ iconType: 'Native',
124
+ },
125
+ };
126
+ const NativeTemplate = ({ size, variant, btnType, fullbleed, text = 'Button', disabled = '', onlyIcon, icon, iconType, }) => {
127
+ const fbClass = fullbleed ? 'sdds-btn-fullbleed' : '';
128
+ const onlyIconCss = onlyIcon ? 'sdds-btn-icon' : '';
129
+ const btnTypeLookUp = {
130
+ Primary: 'primary',
131
+ Secondary: 'secondary',
132
+ Ghost: 'ghost',
133
+ Danger: 'danger',
134
+ };
135
+ const sizeLookUp = {
136
+ 'Large': 'lg',
137
+ 'Medium': 'md',
138
+ 'Small': 'sm',
139
+ 'Extra small': 'xs',
140
+ };
141
+ const varaintLookup = {
142
+ 'On light': 'on-light',
143
+ 'On dark': 'on-dark',
144
+ };
145
+ return formatHtmlPreview(`
146
+ <style>
147
+ /* demo-wrapper is for demonstration purposes only*/
148
+ ${icon && iconType === 'Native'
149
+ ? `@import url('https://cdn.digitaldesign.scania.com/icons/webfont/css/sdds-icons.css');
150
+ i.sdds-btn-icon{
151
+ font-size: ${size === 'Small' ? '16' : '20'}px;
152
+ }\n `
153
+ : ''}\ .demo-wrapper{
154
+ width: 100%;
155
+ }
156
+ </style>
157
+
158
+ <div class="demo-wrapper">
159
+ <button class="sdds-btn sdds-btn-${btnTypeLookUp[btnType]} sdds-btn-${sizeLookUp[size]} ${fbClass} ${disabled ? 'disabled' : ''} ${onlyIconCss} ${varaintLookup[variant] === 'on-light' ? 'sdds-on-white-bg' : ''} ${onlyIcon ? 'sdds-btn-only-icon' : ''}">
160
+ ${!onlyIcon ? `<span class="sdds-btn-text">${text}</span>` : ''}
161
+ ${onlyIcon || (icon && icon !== 'none')
162
+ ? `
163
+ ${iconType === 'Native'
164
+ ? `<i class="sdds-btn-icon sdds-icon ${icon}"></i>`
165
+ : `<sdds-icon class='sdds-btn-icon ' size='${sizeLookUp[size] === 'sm' ? '16px' : '20px'}' name='${icon}'></sdds-icon>`}
166
+ `
167
+ : ''}
168
+ </button>
169
+ </div>
170
+ `);
171
+ };
172
+ export const Native = NativeTemplate.bind({});
173
+ Native.args = {};
174
+ export const NativeWithIcon = NativeTemplate.bind({});
175
+ NativeWithIcon.args = {
176
+ icon: 'truck',
177
+ };
178
+ export const NativeOnlyIcon = NativeTemplate.bind({});
179
+ NativeOnlyIcon.args = {
180
+ text: '',
181
+ onlyIcon: true,
182
+ icon: 'truck',
183
+ };
@@ -0,0 +1,182 @@
1
+ import { formatHtmlPreview } from '../../utils/utils';
2
+ import { iconsNames } from '../icon/iconsArray';
3
+ import readme from './readme.md';
4
+ export default {
5
+ title: 'Components/Button',
6
+ parameters: {
7
+ notes: readme,
8
+ layout: 'padded',
9
+ chromatic: {
10
+ disableSnapshot: false, // enables snapshotting for the component
11
+ },
12
+ design: [
13
+ {
14
+ name: 'Figma',
15
+ type: 'figma',
16
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=1574%3A72148&t=rVXuTOgTmXPauyHd-1',
17
+ },
18
+ {
19
+ name: 'Link',
20
+ type: 'link',
21
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=1574%3A72148&t=rVXuTOgTmXPauyHd-1',
22
+ },
23
+ ],
24
+ },
25
+ argTypes: {
26
+ text: {
27
+ name: 'Text',
28
+ description: 'The text to be displayed on the button',
29
+ control: {
30
+ type: 'text',
31
+ },
32
+ },
33
+ btnType: {
34
+ name: 'Type',
35
+ description: 'Four different button types to help the user to distinguish the level of importance of the task they represent',
36
+ control: {
37
+ type: 'radio',
38
+ },
39
+ options: ['Primary', 'Secondary', 'Ghost', 'Danger'],
40
+ table: {
41
+ defaultValue: { summary: 'primary' },
42
+ },
43
+ },
44
+ size: {
45
+ name: 'Size',
46
+ control: {
47
+ type: 'radio',
48
+ },
49
+ options: ['Large', 'Medium', 'Small', 'Extra small'],
50
+ table: {
51
+ defaultValue: { summary: 'lg' },
52
+ },
53
+ description: 'Size of the button',
54
+ },
55
+ variant: {
56
+ name: 'Variant',
57
+ control: {
58
+ type: 'radio',
59
+ },
60
+ options: ['On light', 'On dark'],
61
+ description: 'Button variant.',
62
+ table: {
63
+ defaultValue: { summary: 'on-dark' },
64
+ },
65
+ },
66
+ fullbleed: {
67
+ name: 'Fullbleed',
68
+ type: 'boolean',
69
+ description: 'Fluid width in certain components-old',
70
+ table: {
71
+ defaultValue: { summary: false },
72
+ },
73
+ if: { arg: 'onlyIcon', truthy: false },
74
+ },
75
+ disabled: {
76
+ name: 'Disabled',
77
+ type: 'boolean',
78
+ description: 'Choose to disable the button',
79
+ table: {
80
+ defaultValue: { summary: false },
81
+ },
82
+ },
83
+ onlyIcon: {
84
+ name: 'Only Icon',
85
+ description: 'Displays only the icon and excludes any text from the button',
86
+ control: {
87
+ type: 'boolean',
88
+ },
89
+ table: {
90
+ defaultValue: { summary: false },
91
+ },
92
+ if: { arg: 'size', neq: 'Extra small' },
93
+ },
94
+ icon: {
95
+ name: 'Icon',
96
+ description: 'Icon to display on the button. Choose "none" to exclude the icon.',
97
+ control: {
98
+ type: 'select',
99
+ },
100
+ options: ['none', ...iconsNames],
101
+ if: { arg: 'size', neq: 'Extra small' },
102
+ },
103
+ iconType: {
104
+ name: 'Icon type',
105
+ description: 'Native/Web Component',
106
+ control: {
107
+ type: 'radio',
108
+ },
109
+ options: ['Native', 'Web Component'],
110
+ if: { arg: 'icon', neq: 'none' },
111
+ },
112
+ },
113
+ args: {
114
+ text: 'Button',
115
+ btnType: 'Primary',
116
+ size: 'Large',
117
+ variant: 'On dark',
118
+ fullbleed: false,
119
+ disabled: false,
120
+ onlyIcon: false,
121
+ icon: 'none',
122
+ iconType: 'Web Component',
123
+ },
124
+ };
125
+ const WebComponentTemplate = ({ onlyIcon, size, variant, btnType, fullbleed, disabled, icon, iconType, text = 'Button', }) => {
126
+ const btnTypeLookUp = {
127
+ Primary: 'primary',
128
+ Secondary: 'secondary',
129
+ Ghost: 'ghost',
130
+ Danger: 'danger',
131
+ };
132
+ const sizeLookUp = {
133
+ 'Large': 'lg',
134
+ 'Medium': 'md',
135
+ 'Small': 'sm',
136
+ 'Extra small': 'xs',
137
+ };
138
+ const varaintLookup = {
139
+ 'On light': 'on-light',
140
+ 'On dark': 'on-dark',
141
+ };
142
+ return formatHtmlPreview(`
143
+ <style>
144
+ /* demo-wrapper is for demonstration purposes only*/${icon && iconType === 'Native'
145
+ ? `@import url('https://cdn.digitaldesign.scania.com/icons/webfont/css/sdds-icons.css');
146
+ i.sdds-icon::before{
147
+ font-size: ${size === 'Large' || size === 'Medium' ? '20' : '16'}px;
148
+ }`
149
+ : ''}
150
+ .demo-wrapper{
151
+ width: 100%;
152
+ }
153
+ </style>
154
+
155
+ <div class="demo-wrapper">
156
+ <sdds-button ${onlyIcon ? 'onlyIcon' : ''} type="${btnTypeLookUp[btnType]}" size="${sizeLookUp[size]}" ${disabled ? 'disabled' : ''} ${fullbleed ? 'fullbleed' : ''} text="${onlyIcon ? '' : text}" variant="${varaintLookup[variant]}" >
157
+ ${onlyIcon || (icon && icon !== 'none')
158
+ ? `
159
+ ${iconType === 'Native'
160
+ ? `<i class="sdds-btn-icon sdds-icon ${icon}" slot="icon"></i>`
161
+ : `<sdds-icon slot="icon" class='sdds-btn-icon ' size='${sizeLookUp[size] == 'sm' ? '16px' : '20px'}' name='${icon}'></sdds-icon>`}
162
+ `
163
+ : ''}
164
+ </sdds-button>
165
+ </div>
166
+ `);
167
+ };
168
+ /** Button as web component */
169
+ export const WebComponent = WebComponentTemplate.bind({});
170
+ WebComponent.args = {};
171
+ export const WebComponentWithIcon = WebComponentTemplate.bind({});
172
+ WebComponentWithIcon.args = {
173
+ icon: 'truck',
174
+ iconType: 'Web Component',
175
+ };
176
+ export const WebComponentOnlyIcon = WebComponentTemplate.bind({});
177
+ WebComponentOnlyIcon.args = {
178
+ text: '',
179
+ iconType: 'Web Component',
180
+ onlyIcon: true,
181
+ icon: 'truck',
182
+ };