@scania/tegel 0.0.1-beta.3 → 0.0.1-beta.5

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 (275) hide show
  1. package/dist/cjs/index-e1c79686.js +1912 -0
  2. package/dist/cjs/index.cjs.js +2 -0
  3. package/dist/cjs/loader.cjs.js +21 -0
  4. package/dist/cjs/popper-11d5f714.js +1801 -0
  5. package/dist/cjs/sdds-accordion-item.cjs.entry.js +34 -0
  6. package/dist/cjs/sdds-accordion.cjs.entry.js +21 -0
  7. package/dist/cjs/sdds-badges.cjs.entry.js +55 -0
  8. package/dist/cjs/sdds-body-cell_2.cjs.entry.js +173 -0
  9. package/dist/cjs/sdds-button.cjs.entry.js +36 -0
  10. package/dist/cjs/sdds-datetime.cjs.entry.js +66 -0
  11. package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +92 -0
  12. package/dist/cjs/sdds-dropdown_2.cjs.entry.js +335 -0
  13. package/dist/cjs/sdds-header-cell.cjs.entry.js +141 -0
  14. package/dist/cjs/sdds-icon.cjs.entry.js +42 -0
  15. package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +96 -0
  16. package/dist/cjs/sdds-inline-tabs.cjs.entry.js +211 -0
  17. package/dist/cjs/sdds-modal.cjs.entry.js +49 -0
  18. package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +95 -0
  19. package/dist/cjs/sdds-popover-canvas.cjs.entry.js +76 -0
  20. package/dist/cjs/sdds-popover-menu.cjs.entry.js +75 -0
  21. package/dist/cjs/sdds-slider.cjs.entry.js +336 -0
  22. package/dist/cjs/sdds-spinner.cjs.entry.js +21 -0
  23. package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +81 -0
  24. package/dist/cjs/sdds-table-body.cjs.entry.js +289 -0
  25. package/dist/cjs/sdds-table-footer.cjs.entry.js +165 -0
  26. package/dist/cjs/sdds-table-header.cjs.entry.js +100 -0
  27. package/dist/cjs/sdds-table-toolbar.cjs.entry.js +66 -0
  28. package/dist/cjs/sdds-table.cjs.entry.js +69 -0
  29. package/dist/cjs/sdds-textarea.cjs.entry.js +61 -0
  30. package/dist/cjs/sdds-textfield.cjs.entry.js +82 -0
  31. package/dist/cjs/sdds-tooltip.cjs.entry.js +95 -0
  32. package/dist/cjs/tegel.cjs.js +19 -0
  33. package/dist/collection/collection-manifest.json +40 -0
  34. package/dist/collection/components/accordion/accordion-item/accordion-item.css +134 -0
  35. package/dist/collection/components/accordion/accordion-item/accordion-item.js +146 -0
  36. package/dist/collection/components/accordion/accordion.css +77 -0
  37. package/dist/collection/components/accordion/accordion.js +62 -0
  38. package/dist/collection/components/accordion/accordion.stories.js +91 -0
  39. package/dist/collection/components/badge/badge.stories.js +101 -0
  40. package/dist/collection/components/badge/badges.css +42 -0
  41. package/dist/collection/components/badge/badges.js +150 -0
  42. package/dist/collection/components/banner/banner.stories.js +93 -0
  43. package/dist/collection/components/block/block.stories.js +46 -0
  44. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +26 -0
  45. package/dist/collection/components/button/button-component.js +154 -0
  46. package/dist/collection/components/button/button-native.stories.js +183 -0
  47. package/dist/collection/components/button/button-webcomponent.stories.js +182 -0
  48. package/dist/collection/components/button/button.css +658 -0
  49. package/dist/collection/components/card/card.stories.js +181 -0
  50. package/dist/collection/components/checkbox/checkbox.stories.js +54 -0
  51. package/dist/collection/components/chips/chips.stories.js +124 -0
  52. package/dist/collection/components/data-table/native-table.stories.js +182 -0
  53. package/dist/collection/components/data-table/table/table.css +15 -0
  54. package/dist/collection/components/data-table/table/table.js +253 -0
  55. package/dist/collection/components/data-table/table-body/table-body.css +22 -0
  56. package/dist/collection/components/data-table/table-body/table-body.js +425 -0
  57. package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +40 -0
  58. package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +169 -0
  59. package/dist/collection/components/data-table/table-body-row/table-body-row.css +196 -0
  60. package/dist/collection/components/data-table/table-body-row/table-body-row.js +164 -0
  61. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +79 -0
  62. package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +155 -0
  63. package/dist/collection/components/data-table/table-component-basic.stories.js +163 -0
  64. package/dist/collection/components/data-table/table-component-batch-actions.stories.js +129 -0
  65. package/dist/collection/components/data-table/table-component-bodydata.stories.js +58 -0
  66. package/dist/collection/components/data-table/table-component-custom-width.stories.js +198 -0
  67. package/dist/collection/components/data-table/table-component-event-listeners.stories.js +153 -0
  68. package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +137 -0
  69. package/dist/collection/components/data-table/table-component-filtering.stories.js +139 -0
  70. package/dist/collection/components/data-table/table-component-multiselect.stories.js +160 -0
  71. package/dist/collection/components/data-table/table-component-pagination.stories.js +129 -0
  72. package/dist/collection/components/data-table/table-component-sorting.stories.js +107 -0
  73. package/dist/collection/components/data-table/table-footer/table-footer.css +93 -0
  74. package/dist/collection/components/data-table/table-footer/table-footer.js +355 -0
  75. package/dist/collection/components/data-table/table-header/table-header.css +204 -0
  76. package/dist/collection/components/data-table/table-header/table-header.js +153 -0
  77. package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +126 -0
  78. package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +320 -0
  79. package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +92 -0
  80. package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +142 -0
  81. package/dist/collection/components/datetime/datetime.css +375 -0
  82. package/dist/collection/components/datetime/datetime.js +251 -0
  83. package/dist/collection/components/datetime/datetime.stories.js +149 -0
  84. package/dist/collection/components/divider/divider.stories.js +116 -0
  85. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +339 -0
  86. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +130 -0
  87. package/dist/collection/components/dropdown/dropdown-native.stories.js +90 -0
  88. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +185 -0
  89. package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +151 -0
  90. package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +146 -0
  91. package/dist/collection/components/dropdown/dropdown.css +891 -0
  92. package/dist/collection/components/dropdown/dropdown.js +554 -0
  93. package/dist/collection/components/footer/footer.stories.js +100 -0
  94. package/dist/collection/components/header/header-all.stories.js +217 -0
  95. package/dist/collection/components/header/header-default.stories.js +47 -0
  96. package/dist/collection/components/header/header-inline.stories.js +113 -0
  97. package/dist/collection/components/header/header-search.stories.js +263 -0
  98. package/dist/collection/components/header/header-toolbar.stories.js +204 -0
  99. package/dist/collection/components/icon/icon-font.stories.js +57 -0
  100. package/dist/collection/components/icon/icon-web-component.stories.js +51 -0
  101. package/dist/collection/components/icon/icon.css +16 -0
  102. package/dist/collection/components/icon/icon.js +89 -0
  103. package/dist/collection/components/icon/iconsArray.js +2 -0
  104. package/dist/collection/components/link/link.stories.js +45 -0
  105. package/dist/collection/components/message/message.stories.js +117 -0
  106. package/dist/collection/components/modal/modal-native.stories.js +121 -0
  107. package/dist/collection/components/modal/modal-webcomponent.stories.js +78 -0
  108. package/dist/collection/components/modal/modal.css +324 -0
  109. package/dist/collection/components/modal/modal.js +146 -0
  110. package/dist/collection/components/popover-canvas/popover-canvas.css +20 -0
  111. package/dist/collection/components/popover-canvas/popover-canvas.js +190 -0
  112. package/dist/collection/components/popover-canvas/popover-canvas.stories.js +87 -0
  113. package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +132 -0
  114. package/dist/collection/components/popover-menu/popover-menu.css +19 -0
  115. package/dist/collection/components/popover-menu/popover-menu.js +189 -0
  116. package/dist/collection/components/popover-menu/popover-menu.stories.js +109 -0
  117. package/dist/collection/components/radio-button/radio-button.stories.js +68 -0
  118. package/dist/collection/components/side-menu/side-menu.stories.js +182 -0
  119. package/dist/collection/components/slider/slider.css +260 -0
  120. package/dist/collection/components/slider/slider.js +682 -0
  121. package/dist/collection/components/slider/slider.stories.js +251 -0
  122. package/dist/collection/components/spinner/spinner.css +79 -0
  123. package/dist/collection/components/spinner/spinner.js +61 -0
  124. package/dist/collection/components/spinner/spinner.stories.js +59 -0
  125. package/dist/collection/components/stepper/stepper.stories.js +139 -0
  126. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +159 -0
  127. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +302 -0
  128. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +65 -0
  129. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +172 -0
  130. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +126 -0
  131. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +43 -0
  132. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +153 -0
  133. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +103 -0
  134. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +32 -0
  135. package/dist/collection/components/textarea/textarea.css +283 -0
  136. package/dist/collection/components/textarea/textarea.js +336 -0
  137. package/dist/collection/components/textarea/textarea.stories.js +149 -0
  138. package/dist/collection/components/textfield/textfield.css +494 -0
  139. package/dist/collection/components/textfield/textfield.js +359 -0
  140. package/dist/collection/components/textfield/textfield.stories.js +222 -0
  141. package/dist/collection/components/toast/toast.stories.js +119 -0
  142. package/dist/collection/components/toggle/toggle.stories.js +62 -0
  143. package/dist/collection/components/tooltip/tooltip.css +46 -0
  144. package/dist/collection/components/tooltip/tooltip.js +200 -0
  145. package/dist/collection/components/tooltip/tooltip.stories.js +113 -0
  146. package/dist/collection/components/utility/colour/background-color.stories.js +96 -0
  147. package/dist/collection/components/utility/colour/text-color.stories.js +94 -0
  148. package/dist/collection/foundations-stories/colour/colour-brand.stories.js +38 -0
  149. package/dist/collection/foundations-stories/colour/colour-scales.stories.js +71 -0
  150. package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +40 -0
  151. package/dist/collection/foundations-stories/grid/grid.stories.js +386 -0
  152. package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +100 -0
  153. package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +94 -0
  154. package/dist/collection/foundations-stories/typography/typography-body.stories.js +16 -0
  155. package/dist/collection/foundations-stories/typography/typography-detail.stories.js +17 -0
  156. package/dist/collection/foundations-stories/typography/typography-headline.stories.js +39 -0
  157. package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +12 -0
  158. package/dist/collection/index.js +1 -0
  159. package/dist/collection/stories/assets/code-brackets.svg +1 -0
  160. package/dist/collection/stories/assets/colors.svg +1 -0
  161. package/dist/collection/stories/assets/comments.svg +1 -0
  162. package/dist/collection/stories/assets/direction.svg +1 -0
  163. package/dist/collection/stories/assets/flow.svg +1 -0
  164. package/dist/collection/stories/assets/plugin.svg +1 -0
  165. package/dist/collection/stories/assets/repo.svg +1 -0
  166. package/dist/collection/stories/assets/stackalt.svg +1 -0
  167. package/dist/collection/utils/utils.js +12 -0
  168. package/dist/components/dropdown-option.js +0 -1
  169. package/dist/components/dropdown.js +0 -1
  170. package/dist/components/icon.js +0 -1
  171. package/dist/components/sdds-accordion-item.js +0 -1
  172. package/dist/components/sdds-accordion.js +0 -1
  173. package/dist/components/sdds-badges.js +0 -1
  174. package/dist/components/sdds-button.js +0 -1
  175. package/dist/components/sdds-datetime.js +0 -1
  176. package/dist/components/sdds-dropdown-filter.js +0 -1
  177. package/dist/components/sdds-header-cell.js +0 -1
  178. package/dist/components/sdds-inline-tabs-fullbleed.js +0 -1
  179. package/dist/components/sdds-inline-tabs.js +0 -1
  180. package/dist/components/sdds-modal.js +0 -1
  181. package/dist/components/sdds-navigation-tabs.js +0 -1
  182. package/dist/components/sdds-popover-canvas.js +0 -1
  183. package/dist/components/sdds-popover-menu.js +0 -1
  184. package/dist/components/sdds-slider.js +0 -1
  185. package/dist/components/sdds-spinner.js +0 -1
  186. package/dist/components/sdds-table-body-row-expandable.js +0 -1
  187. package/dist/components/sdds-table-body.js +0 -1
  188. package/dist/components/sdds-table-footer.js +0 -1
  189. package/dist/components/sdds-table-header.js +0 -1
  190. package/dist/components/sdds-table-toolbar.js +0 -1
  191. package/dist/components/sdds-table.js +0 -1
  192. package/dist/components/sdds-textarea.js +0 -1
  193. package/dist/components/sdds-textfield.js +0 -1
  194. package/dist/components/sdds-tooltip.js +0 -1
  195. package/dist/components/table-body-cell.js +0 -1
  196. package/dist/components/table-body-row.js +0 -1
  197. package/dist/esm/index-b67b15a6.js +1884 -0
  198. package/dist/esm/index.js +1 -0
  199. package/dist/esm/loader.js +17 -0
  200. package/dist/esm/polyfills/core-js.js +11 -0
  201. package/dist/esm/polyfills/css-shim.js +1 -0
  202. package/dist/esm/polyfills/dom.js +79 -0
  203. package/dist/esm/polyfills/es5-html-element.js +1 -0
  204. package/dist/esm/polyfills/index.js +34 -0
  205. package/dist/esm/polyfills/system.js +6 -0
  206. package/dist/esm/popper-f860750c.js +1799 -0
  207. package/dist/esm/sdds-accordion-item.entry.js +30 -0
  208. package/dist/esm/sdds-accordion.entry.js +17 -0
  209. package/dist/esm/sdds-badges.entry.js +51 -0
  210. package/dist/esm/sdds-body-cell_2.entry.js +168 -0
  211. package/dist/esm/sdds-button.entry.js +32 -0
  212. package/dist/esm/sdds-datetime.entry.js +62 -0
  213. package/dist/esm/sdds-dropdown-filter.entry.js +88 -0
  214. package/dist/esm/sdds-dropdown_2.entry.js +330 -0
  215. package/dist/esm/sdds-header-cell.entry.js +137 -0
  216. package/dist/esm/sdds-icon.entry.js +38 -0
  217. package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +92 -0
  218. package/dist/esm/sdds-inline-tabs.entry.js +207 -0
  219. package/dist/esm/sdds-modal.entry.js +45 -0
  220. package/dist/esm/sdds-navigation-tabs.entry.js +91 -0
  221. package/dist/esm/sdds-popover-canvas.entry.js +72 -0
  222. package/dist/esm/sdds-popover-menu.entry.js +71 -0
  223. package/dist/esm/sdds-slider.entry.js +332 -0
  224. package/dist/esm/sdds-spinner.entry.js +17 -0
  225. package/dist/esm/sdds-table-body-row-expandable.entry.js +77 -0
  226. package/dist/esm/sdds-table-body.entry.js +285 -0
  227. package/dist/esm/sdds-table-footer.entry.js +161 -0
  228. package/dist/esm/sdds-table-header.entry.js +96 -0
  229. package/dist/esm/sdds-table-toolbar.entry.js +62 -0
  230. package/dist/esm/sdds-table.entry.js +65 -0
  231. package/dist/esm/sdds-textarea.entry.js +57 -0
  232. package/dist/esm/sdds-textfield.entry.js +78 -0
  233. package/dist/esm/sdds-tooltip.entry.js +91 -0
  234. package/dist/esm/tegel.js +17 -0
  235. package/dist/index.cjs.js +1 -0
  236. package/dist/index.js +1 -0
  237. package/dist/tegel/index.esm.js +0 -0
  238. package/dist/tegel/p-040efb32.entry.js +1 -0
  239. package/dist/tegel/p-12ca5cfa.entry.js +1 -0
  240. package/dist/tegel/p-157e1618.js +2 -0
  241. package/dist/tegel/p-1fe61cf6.entry.js +1 -0
  242. package/dist/tegel/p-2f376504.entry.js +1 -0
  243. package/dist/tegel/p-44ced895.entry.js +1 -0
  244. package/dist/tegel/p-4880f03d.entry.js +1 -0
  245. package/dist/tegel/p-4aba73a3.entry.js +1 -0
  246. package/dist/tegel/p-4b58a02c.entry.js +1 -0
  247. package/dist/tegel/p-4cb85347.entry.js +1 -0
  248. package/dist/tegel/p-52031b5a.entry.js +1 -0
  249. package/dist/tegel/p-677baf7f.entry.js +1 -0
  250. package/dist/tegel/p-71797eaf.entry.js +1 -0
  251. package/dist/tegel/p-7373284c.entry.js +1 -0
  252. package/dist/tegel/p-7451779b.entry.js +1 -0
  253. package/dist/tegel/p-77aeea3b.entry.js +1 -0
  254. package/dist/tegel/p-8582d6a7.entry.js +1 -0
  255. package/dist/tegel/p-96021bd0.entry.js +1 -0
  256. package/dist/tegel/p-9d8caf51.entry.js +1 -0
  257. package/dist/tegel/p-a5919930.entry.js +1 -0
  258. package/dist/tegel/p-b01cface.entry.js +1 -0
  259. package/dist/tegel/p-bf896643.entry.js +1 -0
  260. package/dist/tegel/p-c311725c.entry.js +1 -0
  261. package/dist/tegel/p-cf72dfd9.entry.js +1 -0
  262. package/dist/tegel/p-d91caec6.entry.js +1 -0
  263. package/dist/tegel/p-e10eec33.entry.js +1 -0
  264. package/dist/tegel/p-ec26fc38.js +1 -0
  265. package/dist/tegel/p-f2262a69.entry.js +1 -0
  266. package/dist/tegel/p-f2f7aa45.entry.js +1 -0
  267. package/dist/tegel/tegel.css +101 -0
  268. package/dist/tegel/tegel.esm.js +1 -0
  269. package/loader/cdn.js +3 -0
  270. package/loader/index.cjs.js +3 -0
  271. package/loader/index.d.ts +12 -0
  272. package/loader/index.es2017.js +3 -0
  273. package/loader/index.js +4 -0
  274. package/loader/package.json +11 -0
  275. package/package.json +4 -4
@@ -0,0 +1,251 @@
1
+ import { h } from '@stencil/core';
2
+ export class Datetime {
3
+ constructor() {
4
+ this.type = 'text';
5
+ this.value = '';
6
+ this.disabled = false;
7
+ this.size = '';
8
+ this.noMinWidth = false;
9
+ this.name = '';
10
+ this.state = undefined;
11
+ this.autofocus = false;
12
+ this.focusInput = undefined;
13
+ }
14
+ // Listener if input enters focus state
15
+ handleFocusIn() {
16
+ this.focusInput = true;
17
+ }
18
+ // Listener if input leaves focus state
19
+ handleFocusOut() {
20
+ this.focusInput = false;
21
+ }
22
+ // Data input event in value prop
23
+ handleInput(e) {
24
+ this.value = e.target.value;
25
+ }
26
+ // Change event isn't a composed:true by default in for input
27
+ handleChange(e) {
28
+ this.customChange.emit(e);
29
+ }
30
+ /** Set the input as focus when clicking the whole datetime with suffix/prefix */
31
+ handleFocusClick() {
32
+ this.textInput.focus();
33
+ }
34
+ render() {
35
+ let className = ' sdds-datetime-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-datetime-nomin' : ''}
44
+ ${this.focusInput ? 'sdds-form-datetime sdds-datetime-focus' : ' sdds-form-datetime'}
45
+ ${this.value.length > 0 ? 'sdds-datetime-data' : ''}
46
+ ${this.disabled ? 'sdds-form-datetime-disabled' : ''}
47
+ ${this.size === 'md' ? 'sdds-form-datetime-md' : ''}
48
+ ${this.size === 'sm' ? 'sdds-form-datetime-sm' : ''}
49
+ ${this.state === 'error' || this.state === 'success'
50
+ ? `sdds-form-datetime-${this.state}`
51
+ : ''}
52
+ ` }, h("slot", { name: "sdds-label" }), h("div", { onClick: () => this.handleFocusClick(), class: "sdds-datetime-container sdds-datetime-container" }, h("div", { class: "sdds-datetime-input-container" }, h("input", { ref: (inputEl) => (this.textInput = inputEl), class: className, type: this.type, disabled: this.disabled, value: this.value, autofocus: this.autofocus, name: this.name, onInput: (e) => this.handleInput(e), onChange: (e) => this.handleChange(e) }), h("div", { class: "datetime-icon icon-datetime-local" }, h("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M23.625 2.977a1 1 0 1 0-2 0v2.985l-11.344.01V2.99a1 1 0 1 0-2 0v2.985H6.25a4.2 4.2 0 0 0-4.2 4.2V25.77a4.2 4.2 0 0 0 4.2 4.2h19.54a4.2 4.2 0 0 0 4.2-4.2V10.167a4.2 4.2 0 0 0-4.191-4.2l-2.174-.004V2.977ZM4.05 10.174a2.2 2.2 0 0 1 2.2-2.2l16.376-.013 3.17.006a2.2 2.2 0 0 1 2.195 2.2v1.847H4.05l-.001-1.84Zm0 3.84V25.77a2.2 2.2 0 0 0 2.2 2.2h19.54a2.2 2.2 0 0 0 2.2-2.2V14.014H4.05Z", fill: "currentColor" }))), h("div", { class: "datetime-icon icon-time" }, h("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { d: "M17 7a1 1 0 1 0-2 0v8a2 2 0 0 0 2 2h6a1 1 0 1 0 0-2h-6V7Z", fill: "currentColor" }), h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M16 2C8.268 2 2 8.268 2 16s6.268 14 14 14 14-6.268 14-14S23.732 2 16 2ZM4 16C4 9.373 9.373 4 16 4s12 5.373 12 12-5.373 12-12 12S4 22.627 4 16Z", fill: "currentColor" })))), h("div", { class: "sdds-datetime-bar" })), h("div", { class: "sdds-datetime-helper" }, h("slot", { name: "sdds-helper" }))));
53
+ }
54
+ static get is() { return "sdds-datetime"; }
55
+ static get encapsulation() { return "shadow"; }
56
+ static get originalStyleUrls() {
57
+ return {
58
+ "$": ["datetime.scss"]
59
+ };
60
+ }
61
+ static get styleUrls() {
62
+ return {
63
+ "$": ["datetime.css"]
64
+ };
65
+ }
66
+ static get properties() {
67
+ return {
68
+ "type": {
69
+ "type": "string",
70
+ "mutable": false,
71
+ "complexType": {
72
+ "original": "string",
73
+ "resolved": "string",
74
+ "references": {}
75
+ },
76
+ "required": false,
77
+ "optional": false,
78
+ "docs": {
79
+ "tags": [],
80
+ "text": "Which input type, text, password or similar"
81
+ },
82
+ "attribute": "type",
83
+ "reflect": true,
84
+ "defaultValue": "'text'"
85
+ },
86
+ "value": {
87
+ "type": "string",
88
+ "mutable": false,
89
+ "complexType": {
90
+ "original": "string",
91
+ "resolved": "string",
92
+ "references": {}
93
+ },
94
+ "required": false,
95
+ "optional": false,
96
+ "docs": {
97
+ "tags": [],
98
+ "text": "Value of the input text"
99
+ },
100
+ "attribute": "value",
101
+ "reflect": true,
102
+ "defaultValue": "''"
103
+ },
104
+ "disabled": {
105
+ "type": "boolean",
106
+ "mutable": false,
107
+ "complexType": {
108
+ "original": "boolean",
109
+ "resolved": "boolean",
110
+ "references": {}
111
+ },
112
+ "required": false,
113
+ "optional": false,
114
+ "docs": {
115
+ "tags": [],
116
+ "text": "Set input in disabled state"
117
+ },
118
+ "attribute": "disabled",
119
+ "reflect": false,
120
+ "defaultValue": "false"
121
+ },
122
+ "size": {
123
+ "type": "string",
124
+ "mutable": false,
125
+ "complexType": {
126
+ "original": "'sm' | 'md' | ''",
127
+ "resolved": "\"\" | \"md\" | \"sm\"",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": "Size of the input"
135
+ },
136
+ "attribute": "size",
137
+ "reflect": false,
138
+ "defaultValue": "''"
139
+ },
140
+ "noMinWidth": {
141
+ "type": "boolean",
142
+ "mutable": false,
143
+ "complexType": {
144
+ "original": "boolean",
145
+ "resolved": "boolean",
146
+ "references": {}
147
+ },
148
+ "required": false,
149
+ "optional": false,
150
+ "docs": {
151
+ "tags": [],
152
+ "text": "With setting"
153
+ },
154
+ "attribute": "no-min-width",
155
+ "reflect": false,
156
+ "defaultValue": "false"
157
+ },
158
+ "name": {
159
+ "type": "string",
160
+ "mutable": false,
161
+ "complexType": {
162
+ "original": "string",
163
+ "resolved": "string",
164
+ "references": {}
165
+ },
166
+ "required": false,
167
+ "optional": false,
168
+ "docs": {
169
+ "tags": [],
170
+ "text": "Name property"
171
+ },
172
+ "attribute": "name",
173
+ "reflect": false,
174
+ "defaultValue": "''"
175
+ },
176
+ "state": {
177
+ "type": "string",
178
+ "mutable": false,
179
+ "complexType": {
180
+ "original": "string",
181
+ "resolved": "string",
182
+ "references": {}
183
+ },
184
+ "required": false,
185
+ "optional": false,
186
+ "docs": {
187
+ "tags": [],
188
+ "text": "Error state of input"
189
+ },
190
+ "attribute": "state",
191
+ "reflect": false
192
+ },
193
+ "autofocus": {
194
+ "type": "boolean",
195
+ "mutable": false,
196
+ "complexType": {
197
+ "original": "boolean",
198
+ "resolved": "boolean",
199
+ "references": {}
200
+ },
201
+ "required": false,
202
+ "optional": false,
203
+ "docs": {
204
+ "tags": [],
205
+ "text": "Autofocus for input"
206
+ },
207
+ "attribute": "autofocus",
208
+ "reflect": false,
209
+ "defaultValue": "false"
210
+ }
211
+ };
212
+ }
213
+ static get states() {
214
+ return {
215
+ "focusInput": {}
216
+ };
217
+ }
218
+ static get events() {
219
+ return [{
220
+ "method": "customChange",
221
+ "name": "customChange",
222
+ "bubbles": true,
223
+ "cancelable": true,
224
+ "composed": true,
225
+ "docs": {
226
+ "tags": [],
227
+ "text": "Change event for the datetime"
228
+ },
229
+ "complexType": {
230
+ "original": "any",
231
+ "resolved": "any",
232
+ "references": {}
233
+ }
234
+ }];
235
+ }
236
+ static get listeners() {
237
+ return [{
238
+ "name": "focus",
239
+ "method": "handleFocusIn",
240
+ "target": undefined,
241
+ "capture": false,
242
+ "passive": false
243
+ }, {
244
+ "name": "focusout",
245
+ "method": "handleFocusOut",
246
+ "target": undefined,
247
+ "capture": false,
248
+ "passive": false
249
+ }];
250
+ }
251
+ }
@@ -0,0 +1,149 @@
1
+ import readme from './readme.md';
2
+ import { formatHtmlPreview } from '../../utils/utils';
3
+ export default {
4
+ title: 'Components/Datetime',
5
+ parameters: {
6
+ layout: 'centered',
7
+ notes: readme,
8
+ design: [
9
+ {
10
+ name: 'Figma',
11
+ type: 'figma',
12
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10241%3A40193&t=rVXuTOgTmXPauyHd-1',
13
+ },
14
+ {
15
+ name: 'Link',
16
+ type: 'link',
17
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10241%3A40193&t=rVXuTOgTmXPauyHd-1',
18
+ },
19
+ ],
20
+ },
21
+ argTypes: {
22
+ type: {
23
+ name: 'Type',
24
+ description: 'Set the field to display date, time or both',
25
+ control: {
26
+ type: 'radio',
27
+ },
28
+ options: ['Datetime', 'Date', 'Time'],
29
+ },
30
+ size: {
31
+ name: 'Size',
32
+ description: 'Switch between different sizes',
33
+ control: {
34
+ type: 'radio',
35
+ // todo: make consistent with other sizes, for example 'xs', 'sm', etc
36
+ },
37
+ options: ['Large', 'Medium', 'Small'],
38
+ },
39
+ minWidth: {
40
+ name: 'Min width',
41
+ description: 'Toggle min width',
42
+ control: {
43
+ type: 'boolean',
44
+ },
45
+ },
46
+ disabled: {
47
+ description: 'Set textfield to disabled state',
48
+ name: 'Disabled',
49
+ control: {
50
+ type: 'boolean',
51
+ },
52
+ },
53
+ label: {
54
+ description: 'Label text for specific textfield',
55
+ name: 'Label text',
56
+ control: {
57
+ type: 'text',
58
+ },
59
+ },
60
+ helper: {
61
+ name: 'Helper text',
62
+ description: 'Add helper text for the textfield',
63
+ control: {
64
+ type: 'text',
65
+ },
66
+ },
67
+ state: {
68
+ name: 'State',
69
+ description: 'Switch between success or error state',
70
+ control: {
71
+ type: 'radio',
72
+ },
73
+ options: ['None', 'Success', 'Error'],
74
+ },
75
+ },
76
+ args: {
77
+ type: 'Datetime',
78
+ size: 'Large',
79
+ minWidth: 'Default',
80
+ disabled: false,
81
+ state: 'None',
82
+ label: 'Label text',
83
+ helper: 'Helper text',
84
+ },
85
+ };
86
+ const datetimeTemplate = ({ type, size, minWidth, disabled, label, state, helper }) => {
87
+ const typeLookup = {
88
+ Datetime: 'datetime-local',
89
+ Date: 'date',
90
+ Time: 'time',
91
+ };
92
+ const sizeLookup = {
93
+ Large: 'lg',
94
+ Medium: 'md',
95
+ Small: 'sm',
96
+ };
97
+ const stateLookup = {
98
+ None: 'none',
99
+ Success: 'success',
100
+ Error: 'error',
101
+ };
102
+ return formatHtmlPreview(`
103
+
104
+ <style>
105
+ /* Note: Demo classes used here are just for demo purposes in Storybook */
106
+ .demo-wrapper {
107
+ width: 208px;
108
+ }
109
+ </style>
110
+
111
+ <div class="demo-wrapper">
112
+
113
+ <sdds-datetime
114
+ id="datetime"
115
+ type="${typeLookup[type]}"
116
+ size="${sizeLookup[size]}"
117
+ state="${stateLookup[state]}"
118
+ ${disabled ? 'disabled' : ''}
119
+ ${minWidth ? 'no-min-width' : ''}>
120
+ ${label ? `<label slot='sdds-label'>${label}</label>` : ''}
121
+ ${helper ? `<span slot='sdds-helper'>${helper}</span>` : ''}
122
+ </sdds-datetime>
123
+
124
+
125
+ <script>
126
+ /* You can listen for the 'customChange' event to get value updates. */
127
+ const datetimeEl = document.getElementById('datetime');
128
+ datetimeEl.addEventListener('customChange', (event) => {
129
+ console.log(event.target.value);
130
+ });
131
+ </script>
132
+ </div>`);
133
+ };
134
+ export const Default = datetimeTemplate.bind({});
135
+ Default.args = {};
136
+ export const ErrorState = datetimeTemplate.bind({});
137
+ ErrorState.args = {
138
+ state: 'Error',
139
+ helper: 'Helper text',
140
+ label: 'Label text',
141
+ };
142
+ export const Time = datetimeTemplate.bind({});
143
+ Time.args = {
144
+ type: 'time',
145
+ };
146
+ export const Date = datetimeTemplate.bind({});
147
+ Date.args = {
148
+ type: 'date',
149
+ };
@@ -0,0 +1,116 @@
1
+ import { formatHtmlPreview } from '../../utils/utils';
2
+ export default {
3
+ title: 'Components/Divider',
4
+ parameters: {
5
+ layout: 'centered',
6
+ design: [
7
+ {
8
+ name: 'Figma',
9
+ type: 'figma',
10
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=993%3A47555&t=M7Ova7xZaoeMwb5e-1',
11
+ },
12
+ {
13
+ name: 'Link',
14
+ type: 'link',
15
+ url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=993%3A47555&t=M7Ova7xZaoeMwb5e-1',
16
+ },
17
+ ],
18
+ },
19
+ argTypes: {
20
+ style: {
21
+ name: 'Style',
22
+ description: 'Set the style of the divider.',
23
+ control: {
24
+ type: 'select',
25
+ },
26
+ options: ['Light', 'Dark', 'Coloured'],
27
+ },
28
+ type: {
29
+ name: 'Type',
30
+ description: 'Choose divider type.',
31
+ control: {
32
+ type: 'radio',
33
+ },
34
+ options: ['Horizontal', 'Vertical', 'Border'],
35
+ },
36
+ width: {
37
+ name: 'Width',
38
+ description: 'Choose divider width.',
39
+ control: {
40
+ type: 'number',
41
+ },
42
+ if: { arg: 'type', eq: 'Horizontal' },
43
+ },
44
+ height: {
45
+ name: 'Height',
46
+ description: 'Choose divider height.',
47
+ control: {
48
+ type: 'number',
49
+ },
50
+ if: { arg: 'type', eq: 'Vertical' },
51
+ },
52
+ direction: {
53
+ name: 'Direction',
54
+ description: 'Set the direction of the divider',
55
+ control: {
56
+ type: 'select',
57
+ },
58
+ options: ['Top', 'Right', 'Bottom', 'Left'],
59
+ if: { arg: 'type', eq: 'Border' },
60
+ },
61
+ },
62
+ args: {
63
+ style: 'Dark',
64
+ type: 'Horizontal',
65
+ width: 100,
66
+ height: 100,
67
+ direction: 'Top',
68
+ },
69
+ };
70
+ const styleLookup = {
71
+ Light: 'light',
72
+ Dark: 'dark',
73
+ Coloured: 'coloured',
74
+ };
75
+ const directionLookup = {
76
+ Top: 'top',
77
+ Right: 'right',
78
+ Bottom: 'bottom',
79
+ Left: 'left',
80
+ };
81
+ const Template = ({ type, style, width, direction, height }) => {
82
+ const classLookup = {
83
+ Horizontal: `sdds-divider-${styleLookup[style]}`,
84
+ Vertical: `sdds-divider-${styleLookup[style]}-vertical`,
85
+ Border: `divider-border-demo sdds-divider-${styleLookup[style]}-border-${directionLookup[direction]}`,
86
+ };
87
+ return formatHtmlPreview(`
88
+ <style>
89
+ ${direction
90
+ ? `/* demo-wrapper is for demonstration purposes only*/
91
+ .demo-wrapper {
92
+ height: 200px;
93
+ width: 200px;
94
+ background-color: var(--sdds-grey-100);
95
+ }
96
+ `
97
+ : ''} ${height
98
+ ? `/* demo-wrapper is for demonstration purposes only*/
99
+ .demo-wrapper {
100
+ height: ${height}px;
101
+ }`
102
+ : ''} ${width
103
+ ? `/* demo-wrapper is for demonstration purposes only*/
104
+ .demo-wrapper {
105
+ width: ${width}px;
106
+ }`
107
+ : ''}
108
+ </style>
109
+
110
+ <div
111
+ class="${classLookup[type]} demo-wrapper ">
112
+ ${direction ? 'DEMO' : ''}</div>
113
+ `);
114
+ };
115
+ export const Default = Template.bind({});
116
+ Default.args = {};