@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,359 @@
1
+ import { h } from '@stencil/core';
2
+ export class Textfield {
3
+ constructor() {
4
+ this.type = 'text';
5
+ this.labelPosition = 'no-label';
6
+ this.label = '';
7
+ this.placeholder = '';
8
+ this.value = '';
9
+ this.disabled = false;
10
+ this.readonly = false;
11
+ this.size = 'lg';
12
+ this.modeVariant = 'primary';
13
+ this.noMinWidth = false;
14
+ this.name = '';
15
+ this.state = 'default';
16
+ this.maxLength = undefined;
17
+ this.autofocus = false;
18
+ this.focusInput = undefined;
19
+ }
20
+ // Data input event in value prop
21
+ handleInput(e) {
22
+ this.value = e.target.value;
23
+ }
24
+ // Change event isn't a composed:true by default in for input
25
+ handleChange(e) {
26
+ this.customChange.emit(e);
27
+ }
28
+ /** Set the input as focus when clicking the whole textfield with suffix/prefix */
29
+ handleFocusClick() {
30
+ this.textInput.focus();
31
+ this.focusInput = true;
32
+ }
33
+ render() {
34
+ var _a;
35
+ let className = ' sdds-textfield-input';
36
+ if (this.size === 'md') {
37
+ className += `${className}-md`;
38
+ }
39
+ if (this.size === 'sm') {
40
+ className += `${className}-sm`;
41
+ }
42
+ return (h("div", { class: `
43
+ ${this.noMinWidth ? 'sdds-form-textfield-nomin' : ''}
44
+ ${this.focusInput && !this.disabled
45
+ ? 'sdds-form-textfield sdds-textfield-focus'
46
+ : ' sdds-form-textfield'}
47
+ ${this.value ? 'sdds-textfield-data' : ''}
48
+ ${this.labelPosition === 'inside' && this.size !== 'sm'
49
+ ? 'sdds-textfield-container-label-inside'
50
+ : ''}
51
+ ${this.disabled ? 'sdds-form-textfield-disabled' : ''}
52
+ ${this.readonly ? 'sdds-form-textfield-readonly' : ''}
53
+ ${this.modeVariant === 'primary' ? 'sdds-on-white-bg' : ''}
54
+ ${this.size === 'md' ? 'sdds-form-textfield-md' : ''}
55
+ ${this.size === 'sm' ? 'sdds-form-textfield-sm' : ''}
56
+ ${this.state === 'error' || this.state === 'success'
57
+ ? `sdds-form-textfield-${this.state}`
58
+ : ''}
59
+ ` }, this.labelPosition === 'outside' && (h("div", { class: "sdds-textfield-label-outside" }, h("div", null, this.label))), h("div", { onClick: () => this.handleFocusClick(), class: "sdds-textfield-container" }, h("div", { class: `sdds-textfield-slot-wrap-prefix sdds-textfield-${this.state}` }, h("slot", { name: "sdds-prefix" })), h("div", { class: "sdds-textfield-input-container" }, h("input", { onFocus: (e) => {
60
+ if (this.readonly) {
61
+ e.preventDefault();
62
+ this.textInput.blur();
63
+ return;
64
+ }
65
+ this.focusInput = true;
66
+ }, onBlur: () => {
67
+ this.focusInput = false;
68
+ }, ref: (inputEl) => (this.textInput = inputEl), class: className, type: this.type, disabled: this.disabled, placeholder: this.placeholder, value: this.value, autofocus: this.autofocus, maxlength: this.maxLength, name: this.name, onInput: (e) => this.handleInput(e), onChange: (e) => this.handleChange(e) }), this.labelPosition === 'inside' && this.size !== 'sm' && (h("label", { class: "sdds-textfield-label-inside" }, this.label))), h("div", { class: "sdds-textfield-bar" }), h("div", { class: `sdds-textfield-slot-wrap-suffix sdds-textfield-${this.state}` }, h("slot", { name: "sdds-suffix" })), h("svg", { class: "sdds-textfield-icon__readonly", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M13.6242 10.7946L17.1365 7.28228C17.6247 6.79412 17.6247 6.00266 17.1365 5.5145L14.485 2.86295C13.9968 2.37479 13.2054 2.37479 12.7172 2.86295L9.20483 6.3753L10.0887 7.25919L11.3914 5.95654L14.0429 8.6081L12.7403 9.91075L13.6242 10.7946ZM13.6011 3.74684L16.2526 6.39839L14.9268 7.72421L12.2753 5.07265L13.6011 3.74684Z", fill: "#0D0F13" }), h("path", { d: "M7.43707 9.91075L5.00974 12.3381L4.01561 15.9837L7.6613 14.9896L10.0886 12.5623L10.9725 13.4462L8.54519 15.8735C8.39136 16.0274 8.20004 16.1384 7.99014 16.1956L3.28932 17.4774C3.07294 17.5364 2.84154 17.475 2.68295 17.3164C2.52436 17.1578 2.46291 16.9264 2.52191 16.71L3.80377 12.0092C3.861 11.7993 3.97202 11.608 4.12585 11.4542L6.55318 9.02686L7.43707 9.91075Z", fill: "#0D0F13" }), h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.43306 1.43306C1.67714 1.18898 2.07287 1.18898 2.31695 1.43306L18.5671 17.6832C18.8112 17.9273 18.8112 18.323 18.5671 18.5671C18.323 18.8112 17.9273 18.8112 17.6832 18.5671L1.43306 2.31695C1.18898 2.07287 1.18898 1.67714 1.43306 1.43306Z", fill: "#0D0F13" })), h("span", { class: "sdds-textfield-icon__readonly-label" }, "This field is non-editable")), h("div", { class: "sdds-textfield-helper" }, this.state === 'error' && (h("div", { class: "sdds-textfield-helper-error-state" }, h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8 2.00015C4.6853 2.00015 1.9982 4.68725 1.9982 8.00195C1.9982 11.3167 4.6853 14.0038 8 14.0038C11.3147 14.0038 14.0018 11.3167 14.0018 8.00195C14.0018 4.68725 11.3147 2.00015 8 2.00015ZM1 8.00195C1 4.13596 4.13401 1.00195 8 1.00195C11.866 1.00195 15 4.13596 15 8.00195C15 11.8679 11.866 15.002 8 15.002C4.13401 15.002 1 11.8679 1 8.00195Z", fill: "#FF2340" }), h("path", { d: "M7.4014 7.2352V5H8.5894V7.2352L8.4134 9.3824H7.5774L7.4014 7.2352ZM7.375 10.0512H8.6246V11.248H7.375V10.0512Z", fill: "#FF2340" })), h("slot", { name: "sdds-helper" }))), this.state !== 'error' && h("slot", { name: "sdds-helper" }), this.maxLength > 0 && (h("div", { class: "sdds-textfield-textcounter" }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, h("span", { class: "sdds-textfield-textcounter-divider" }, " / "), this.maxLength)))));
69
+ }
70
+ static get is() { return "sdds-textfield"; }
71
+ static get originalStyleUrls() {
72
+ return {
73
+ "$": ["textfield.scss"]
74
+ };
75
+ }
76
+ static get styleUrls() {
77
+ return {
78
+ "$": ["textfield.css"]
79
+ };
80
+ }
81
+ static get properties() {
82
+ return {
83
+ "type": {
84
+ "type": "string",
85
+ "mutable": false,
86
+ "complexType": {
87
+ "original": "'text' | 'password'",
88
+ "resolved": "\"password\" | \"text\"",
89
+ "references": {}
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [],
95
+ "text": "Which input type, text, password or similar"
96
+ },
97
+ "attribute": "type",
98
+ "reflect": true,
99
+ "defaultValue": "'text'"
100
+ },
101
+ "labelPosition": {
102
+ "type": "string",
103
+ "mutable": false,
104
+ "complexType": {
105
+ "original": "'inside' | 'outside' | 'no-label'",
106
+ "resolved": "\"inside\" | \"no-label\" | \"outside\"",
107
+ "references": {}
108
+ },
109
+ "required": false,
110
+ "optional": false,
111
+ "docs": {
112
+ "tags": [],
113
+ "text": "Position of the label for the textfield."
114
+ },
115
+ "attribute": "label-position",
116
+ "reflect": false,
117
+ "defaultValue": "'no-label'"
118
+ },
119
+ "label": {
120
+ "type": "string",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "string",
124
+ "resolved": "string",
125
+ "references": {}
126
+ },
127
+ "required": false,
128
+ "optional": false,
129
+ "docs": {
130
+ "tags": [],
131
+ "text": "Label text"
132
+ },
133
+ "attribute": "label",
134
+ "reflect": false,
135
+ "defaultValue": "''"
136
+ },
137
+ "placeholder": {
138
+ "type": "string",
139
+ "mutable": false,
140
+ "complexType": {
141
+ "original": "string",
142
+ "resolved": "string",
143
+ "references": {}
144
+ },
145
+ "required": false,
146
+ "optional": false,
147
+ "docs": {
148
+ "tags": [],
149
+ "text": "Placeholder text"
150
+ },
151
+ "attribute": "placeholder",
152
+ "reflect": false,
153
+ "defaultValue": "''"
154
+ },
155
+ "value": {
156
+ "type": "string",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "string",
160
+ "resolved": "string",
161
+ "references": {}
162
+ },
163
+ "required": false,
164
+ "optional": false,
165
+ "docs": {
166
+ "tags": [],
167
+ "text": "Value of the input text"
168
+ },
169
+ "attribute": "value",
170
+ "reflect": true,
171
+ "defaultValue": "''"
172
+ },
173
+ "disabled": {
174
+ "type": "boolean",
175
+ "mutable": false,
176
+ "complexType": {
177
+ "original": "boolean",
178
+ "resolved": "boolean",
179
+ "references": {}
180
+ },
181
+ "required": false,
182
+ "optional": false,
183
+ "docs": {
184
+ "tags": [],
185
+ "text": "Set input in disabled state"
186
+ },
187
+ "attribute": "disabled",
188
+ "reflect": false,
189
+ "defaultValue": "false"
190
+ },
191
+ "readonly": {
192
+ "type": "boolean",
193
+ "mutable": false,
194
+ "complexType": {
195
+ "original": "boolean",
196
+ "resolved": "boolean",
197
+ "references": {}
198
+ },
199
+ "required": false,
200
+ "optional": false,
201
+ "docs": {
202
+ "tags": [],
203
+ "text": "Set input in readonly state"
204
+ },
205
+ "attribute": "readonly",
206
+ "reflect": false,
207
+ "defaultValue": "false"
208
+ },
209
+ "size": {
210
+ "type": "string",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "'sm' | 'md' | 'lg'",
214
+ "resolved": "\"lg\" | \"md\" | \"sm\"",
215
+ "references": {}
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": "Size of the input"
222
+ },
223
+ "attribute": "size",
224
+ "reflect": false,
225
+ "defaultValue": "'lg'"
226
+ },
227
+ "modeVariant": {
228
+ "type": "string",
229
+ "mutable": false,
230
+ "complexType": {
231
+ "original": "'primary' | 'secondary'",
232
+ "resolved": "\"primary\" | \"secondary\"",
233
+ "references": {}
234
+ },
235
+ "required": false,
236
+ "optional": false,
237
+ "docs": {
238
+ "tags": [],
239
+ "text": "Variant of the tabs, primary= on white, secondary= on grey50"
240
+ },
241
+ "attribute": "mode-variant",
242
+ "reflect": false,
243
+ "defaultValue": "'primary'"
244
+ },
245
+ "noMinWidth": {
246
+ "type": "boolean",
247
+ "mutable": false,
248
+ "complexType": {
249
+ "original": "boolean",
250
+ "resolved": "boolean",
251
+ "references": {}
252
+ },
253
+ "required": false,
254
+ "optional": false,
255
+ "docs": {
256
+ "tags": [],
257
+ "text": "With setting"
258
+ },
259
+ "attribute": "no-min-width",
260
+ "reflect": false,
261
+ "defaultValue": "false"
262
+ },
263
+ "name": {
264
+ "type": "string",
265
+ "mutable": false,
266
+ "complexType": {
267
+ "original": "string",
268
+ "resolved": "string",
269
+ "references": {}
270
+ },
271
+ "required": false,
272
+ "optional": false,
273
+ "docs": {
274
+ "tags": [],
275
+ "text": "Name property"
276
+ },
277
+ "attribute": "name",
278
+ "reflect": false,
279
+ "defaultValue": "''"
280
+ },
281
+ "state": {
282
+ "type": "string",
283
+ "mutable": false,
284
+ "complexType": {
285
+ "original": "'error' | 'success' | 'default'",
286
+ "resolved": "\"default\" | \"error\" | \"success\"",
287
+ "references": {}
288
+ },
289
+ "required": false,
290
+ "optional": false,
291
+ "docs": {
292
+ "tags": [],
293
+ "text": "Error state of input"
294
+ },
295
+ "attribute": "state",
296
+ "reflect": false,
297
+ "defaultValue": "'default'"
298
+ },
299
+ "maxLength": {
300
+ "type": "number",
301
+ "mutable": false,
302
+ "complexType": {
303
+ "original": "number",
304
+ "resolved": "number",
305
+ "references": {}
306
+ },
307
+ "required": false,
308
+ "optional": false,
309
+ "docs": {
310
+ "tags": [],
311
+ "text": "Max length of input"
312
+ },
313
+ "attribute": "max-length",
314
+ "reflect": false
315
+ },
316
+ "autofocus": {
317
+ "type": "boolean",
318
+ "mutable": false,
319
+ "complexType": {
320
+ "original": "boolean",
321
+ "resolved": "boolean",
322
+ "references": {}
323
+ },
324
+ "required": false,
325
+ "optional": false,
326
+ "docs": {
327
+ "tags": [],
328
+ "text": "Autofocus for input"
329
+ },
330
+ "attribute": "autofocus",
331
+ "reflect": false,
332
+ "defaultValue": "false"
333
+ }
334
+ };
335
+ }
336
+ static get states() {
337
+ return {
338
+ "focusInput": {}
339
+ };
340
+ }
341
+ static get events() {
342
+ return [{
343
+ "method": "customChange",
344
+ "name": "customChange",
345
+ "bubbles": true,
346
+ "cancelable": true,
347
+ "composed": true,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": "Change event for the textfield"
351
+ },
352
+ "complexType": {
353
+ "original": "any",
354
+ "resolved": "any",
355
+ "references": {}
356
+ }
357
+ }];
358
+ }
359
+ }
@@ -0,0 +1,222 @@
1
+ import readme from './readme.md';
2
+ import { formatHtmlPreview } from '../../utils/utils';
3
+ export default {
4
+ title: 'Components/Textfield',
5
+ parameters: {
6
+ notes: readme,
7
+ layout: 'centered',
8
+ design: [
9
+ {
10
+ name: 'Figma',
11
+ type: 'figma',
12
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=1675%3A76544&t=Ne6myqwca5m00de7-1',
13
+ },
14
+ {
15
+ name: 'Link',
16
+ type: 'link',
17
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=1675%3A76544&t=Ne6myqwca5m00de7-1',
18
+ },
19
+ ],
20
+ },
21
+ argTypes: {
22
+ placeholderText: {
23
+ name: 'Placeholder',
24
+ description: 'Placeholder text',
25
+ control: {
26
+ type: 'text',
27
+ },
28
+ },
29
+ type: {
30
+ name: 'Type',
31
+ description: 'Which type of textfield',
32
+ control: {
33
+ type: 'radio',
34
+ options: ['password', 'text'],
35
+ },
36
+ },
37
+ size: {
38
+ name: 'Size',
39
+ description: 'Switch between different sizes',
40
+ control: {
41
+ type: 'radio',
42
+ options: ['Large', 'Medium', 'Small'],
43
+ },
44
+ },
45
+ minWidth: {
46
+ name: 'No minimum width',
47
+ description: 'Toggle the minimum width.',
48
+ control: {
49
+ type: 'boolean',
50
+ },
51
+ table: {
52
+ defaultValue: { summary: false },
53
+ },
54
+ },
55
+ disabled: {
56
+ description: 'Set textfield to disabled state',
57
+ name: 'Disabled',
58
+ control: {
59
+ type: 'boolean',
60
+ },
61
+ },
62
+ readonly: {
63
+ description: 'Set textfield to read only',
64
+ name: 'Read Only',
65
+ control: {
66
+ type: 'boolean',
67
+ },
68
+ },
69
+ label: {
70
+ description: 'Label text for specific textfield',
71
+ name: 'Label text',
72
+ control: {
73
+ type: 'text',
74
+ },
75
+ },
76
+ labelPosition: {
77
+ name: 'Label position',
78
+ control: {
79
+ type: 'radio',
80
+ },
81
+ options: ['None', 'Inside', 'Outside'],
82
+ description: 'Label text position',
83
+ },
84
+ prefix: {
85
+ name: 'Prefix',
86
+ description: 'Add prefix symbol/text before the textfield',
87
+ control: {
88
+ type: 'boolean',
89
+ },
90
+ table: {
91
+ defaultValue: { summary: false },
92
+ },
93
+ },
94
+ prefixType: {
95
+ name: 'Prefix type',
96
+ description: 'Choose icon or text for prefix.',
97
+ control: {
98
+ type: 'radio',
99
+ },
100
+ options: ['Icon', 'Text'],
101
+ if: { arg: 'prefix', eq: true },
102
+ },
103
+ suffix: {
104
+ name: 'Suffix',
105
+ description: 'Add suffix symbol/text after the textfield',
106
+ control: {
107
+ type: 'boolean',
108
+ },
109
+ table: {
110
+ defaultValue: { summary: false },
111
+ },
112
+ },
113
+ suffixType: {
114
+ name: 'Suffix type',
115
+ description: 'Choose icon or text for suffix.',
116
+ control: {
117
+ type: 'radio',
118
+ },
119
+ options: ['Icon', 'Text'],
120
+ if: { arg: 'suffix', eq: true },
121
+ },
122
+ helper: {
123
+ name: 'Helper text',
124
+ description: 'Add helper text for the textfield',
125
+ control: {
126
+ type: 'text',
127
+ },
128
+ },
129
+ maxLength: {
130
+ name: 'Max length',
131
+ description: 'Set a maximum value of how long the text can be.',
132
+ control: {
133
+ type: 'number',
134
+ },
135
+ },
136
+ state: {
137
+ name: 'State',
138
+ description: 'Switch between success or error state',
139
+ control: {
140
+ type: 'radio',
141
+ },
142
+ options: ['Default', 'Success', 'Error'],
143
+ },
144
+ variant: {
145
+ name: 'Mode Variant',
146
+ description: 'The variant of the textarea',
147
+ control: {
148
+ type: 'radio',
149
+ },
150
+ options: ['Primary', 'Secondary'],
151
+ },
152
+ },
153
+ args: {
154
+ placeholderText: 'Placeholder',
155
+ disabled: false,
156
+ readonly: false,
157
+ label: 'Label',
158
+ labelPosition: 'None',
159
+ helper: '',
160
+ maxLength: 0,
161
+ state: 'Default',
162
+ variant: 'Secondary',
163
+ suffix: false,
164
+ suffixType: 'Icon',
165
+ prefix: false,
166
+ prefixType: 'Icon',
167
+ minWidth: 'Default',
168
+ size: 'Large',
169
+ type: 'text',
170
+ },
171
+ };
172
+ const Template = ({ type, placeholderText, size, minWidth, disabled, readonly, label, labelPosition, state, variant, helper, prefix, prefixType, suffix, suffixType, maxLength, }) => {
173
+ const maxlength = maxLength > 0 ? `max-length="${maxLength}"` : '';
174
+ const variantValue = variant === 'Primary' ? 'primary' : 'secondary';
175
+ const stateValue = state.toLowerCase();
176
+ const sizeLookUp = {
177
+ Large: 'lg',
178
+ Medium: 'md',
179
+ Small: 'sm',
180
+ };
181
+ return formatHtmlPreview(`
182
+ <style>
183
+ /* demo-wrapper is for demonstration purposes only*/
184
+ .demo-wrapper {
185
+ width: 200px;
186
+ height: 150px;
187
+ }
188
+ </style>
189
+
190
+ <div class="demo-wrapper">
191
+ <sdds-textfield
192
+ type="${type}"
193
+ size="${sizeLookUp[size]}"
194
+ state="${stateValue}"
195
+ mode-variant="${variantValue}"
196
+ label="${label}"
197
+ label-position="${labelPosition.toLowerCase()}"
198
+ ${maxlength}
199
+ ${disabled ? 'disabled' : ''}
200
+ ${readonly ? 'readonly' : ''}
201
+ ${minWidth ? 'no-min-width' : ''}
202
+ placeholder="${placeholderText}" >
203
+ ${prefix
204
+ ? `
205
+ <span slot="sdds-prefix">
206
+ ${prefixType === 'Text' ? '$' : '<sdds-icon name="truck" size="20px"></sdds-icon> '}
207
+ </span>`
208
+ : ''}
209
+ ${helper ? `<span slot='sdds-helper'>${helper}</span>` : ''}
210
+ ${suffix
211
+ ? `
212
+ <span slot="sdds-suffix">
213
+ ${suffixType === 'Text' ? '$' : '<sdds-icon name="truck" size="20px"></sdds-icon> '}
214
+ </span>`
215
+ : ''}
216
+ </sdds-textfield>
217
+ </div>
218
+ `);
219
+ };
220
+ // ${true ? '<sdds-icon name="cross" slot="sdds-prefix"></sdds-icon>' : ''}
221
+ export const Default = Template.bind({});
222
+ Default.args = {};
@@ -0,0 +1,119 @@
1
+ import { formatHtmlPreview } from '../../utils/utils';
2
+ import { iconsNames } from '../icon/iconsArray';
3
+ export default {
4
+ title: 'Components/Toast',
5
+ parameters: {
6
+ layout: 'centered',
7
+ design: [
8
+ {
9
+ name: 'Figma',
10
+ type: 'figma',
11
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=5903%3A245536&t=Ne6myqwca5m00de7-1',
12
+ },
13
+ {
14
+ name: 'Link',
15
+ type: 'link',
16
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=5903%3A245536&t=Ne6myqwca5m00de7-1',
17
+ },
18
+ ],
19
+ },
20
+ argTypes: {
21
+ toastType: {
22
+ name: 'Message type',
23
+ description: 'Changes the type of message',
24
+ control: {
25
+ type: 'radio',
26
+ },
27
+ options: ['Success', 'Info', 'Warning', 'Error'],
28
+ },
29
+ subheader: {
30
+ name: 'Subheader',
31
+ description: 'Adds a subheader',
32
+ },
33
+ link: {
34
+ name: 'Link',
35
+ description: 'Adds a CTA link',
36
+ },
37
+ iconType: {
38
+ name: 'Icon type',
39
+ description: 'Native/Web Component',
40
+ control: {
41
+ type: 'radio',
42
+ },
43
+ options: ['Native', 'Web Component'],
44
+ },
45
+ icon: {
46
+ name: 'Icon',
47
+ description: 'Icon to display on the button. Choose "none" to exclude the icon, or choose "recommended" to pick the icon that is recommended for the type of toast.',
48
+ control: {
49
+ type: 'select',
50
+ },
51
+ options: ['none', 'recommended', ...iconsNames],
52
+ if: { arg: 'size', neq: 'xs' },
53
+ },
54
+ },
55
+ args: {
56
+ toastType: 'Success',
57
+ subheader: false,
58
+ link: false,
59
+ iconType: 'Web Component',
60
+ icon: 'recommended',
61
+ },
62
+ };
63
+ const typeLookup = {
64
+ Success: 'success',
65
+ Info: 'info',
66
+ Warning: 'warning',
67
+ Error: 'error',
68
+ };
69
+ const iconLookup = {
70
+ Success: 'tick',
71
+ Info: 'info',
72
+ Warning: 'warning',
73
+ Error: 'error',
74
+ };
75
+ const Template = ({ toastType, subheader, link, iconType, icon }) => {
76
+ const iconValue = icon === 'recommended' ? iconLookup[toastType] : icon;
77
+ return formatHtmlPreview(`
78
+ ${iconType === 'Native'
79
+ ? `
80
+ <style>
81
+ /* Note: In case using WebFont icons, please make sure to import icons css file in your implementation */
82
+ @import url('https://cdn.digitaldesign.scania.com/icons/webfont/css/sdds-icons.css');
83
+
84
+ </style>
85
+ `
86
+ : ''}
87
+ <div class="sdds-toast sdds-toast-${typeLookup[toastType]}">
88
+ ${icon === 'none'
89
+ ? ''
90
+ : `
91
+ <div class="sdds-toast-icon">
92
+ ${iconType === 'Native'
93
+ ? `<i class="sdds-icon ${iconValue}"></i>`
94
+ : `<sdds-icon name="${iconValue}" size="20px"></sdds-icon>
95
+ `}
96
+ </div>
97
+ `}
98
+ <div class="sdds-toast-content">
99
+ <div class="sdds-toast-header">
100
+ <span class="sdds-toast-headline">This is ${toastType === 'Success' || toastType === 'Warning' ? 'a' : 'an'} ${toastType.toLowerCase()} message</span>
101
+ <button type="button" aria-label="close" class="sdds-toast-dismiss">
102
+ ${iconType === 'Native'
103
+ ? `<i class="sdds-icon cross"></i>`
104
+ : `<sdds-icon name="cross" size="20px"></sdds-icon>
105
+ `}
106
+ </button>
107
+ </div>
108
+ ${subheader || link
109
+ ? `\n<div class="sdds-toast-body">\
110
+ ${subheader ? '\n<span class="sdds-toast-subheadline">Short subheader</span>' : ''}\
111
+ ${link ? '\n<a class="sdds-toast-link" href="#">Link example</a>' : ''}
112
+ </div> `
113
+ : ''}
114
+ </div>
115
+ </div>
116
+ `);
117
+ };
118
+ export const Default = Template.bind({});
119
+ Default.args = {};