@skf-design-system/ui-components 1.0.0-alpha.33 → 1.0.0-alpha.35

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 (345) hide show
  1. package/README.md +20 -27
  2. package/dist/components/accordion/accordion-item.component.d.ts +36 -0
  3. package/dist/components/accordion/accordion-item.component.js +98 -0
  4. package/dist/components/accordion/accordion-item.d.ts +3 -3
  5. package/dist/components/accordion/accordion-item.js +4 -5
  6. package/dist/components/accordion/accordion-item.styles.js +77 -0
  7. package/dist/components/accordion/accordion.component.d.ts +9 -13
  8. package/dist/components/accordion/accordion.component.js +7 -7
  9. package/dist/components/accordion/accordion.d.ts +0 -1
  10. package/dist/components/alert/alert.component.d.ts +12 -12
  11. package/dist/components/alert/alert.component.js +57 -54
  12. package/dist/components/alert/alert.styles.js +50 -51
  13. package/dist/components/breadcrumb/breadcrumb-item.component.d.ts +25 -0
  14. package/dist/components/breadcrumb/breadcrumb-item.component.js +60 -0
  15. package/dist/components/breadcrumb/breadcrumb-item.d.ts +8 -0
  16. package/dist/components/breadcrumb/breadcrumb-item.js +6 -0
  17. package/dist/components/breadcrumb/breadcrumb-item.styles.js +63 -0
  18. package/dist/components/breadcrumb/breadcrumb.component.d.ts +32 -0
  19. package/dist/components/breadcrumb/breadcrumb.component.js +65 -0
  20. package/dist/components/breadcrumb/breadcrumb.d.ts +8 -0
  21. package/dist/components/breadcrumb/breadcrumb.js +6 -0
  22. package/dist/components/breadcrumb/breadcrumb.styles.js +25 -0
  23. package/dist/components/button/button.component.d.ts +17 -14
  24. package/dist/components/button/button.component.js +74 -60
  25. package/dist/components/button/button.styles.d.ts +1 -2
  26. package/dist/components/button/button.styles.js +13 -3
  27. package/dist/components/card/card.component.d.ts +4 -1
  28. package/dist/components/card/card.component.js +46 -36
  29. package/dist/components/card/card.styles.js +36 -23
  30. package/dist/components/checkbox/checkbox.component.d.ts +17 -13
  31. package/dist/components/checkbox/checkbox.component.js +75 -61
  32. package/dist/components/checkbox/checkbox.styles.d.ts +1 -2
  33. package/dist/components/checkbox/checkbox.styles.js +1 -5
  34. package/dist/components/datepicker/datepicker-calendar.component.d.ts +80 -0
  35. package/dist/components/datepicker/datepicker-calendar.component.js +415 -0
  36. package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
  37. package/dist/components/datepicker/datepicker-calendar.js +6 -0
  38. package/dist/components/datepicker/datepicker-calendar.styles.js +202 -0
  39. package/dist/components/datepicker/datepicker-popup.component.d.ts +64 -0
  40. package/dist/components/datepicker/datepicker-popup.component.js +261 -0
  41. package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
  42. package/dist/components/datepicker/datepicker-popup.helpers.d.ts +41 -0
  43. package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
  44. package/dist/components/datepicker/datepicker-popup.js +6 -0
  45. package/dist/components/datepicker/datepicker-popup.styles.js +87 -0
  46. package/dist/components/datepicker/datepicker.component.d.ts +121 -0
  47. package/dist/components/datepicker/datepicker.component.js +455 -0
  48. package/dist/components/datepicker/datepicker.d.ts +8 -0
  49. package/dist/components/datepicker/datepicker.helpers.d.ts +38 -0
  50. package/dist/components/datepicker/datepicker.helpers.js +31 -0
  51. package/dist/components/datepicker/datepicker.js +6 -0
  52. package/dist/components/datepicker/datepicker.styles.d.ts +1 -0
  53. package/dist/components/datepicker/datepicker.styles.js +18 -0
  54. package/dist/components/dialog/dialog.component.d.ts +20 -30
  55. package/dist/components/dialog/dialog.component.js +89 -78
  56. package/dist/components/dialog/dialog.d.ts +2 -2
  57. package/dist/components/dialog/dialog.styles.js +4 -4
  58. package/dist/components/divider/divider.component.d.ts +4 -8
  59. package/dist/components/divider/divider.component.js +24 -46
  60. package/dist/components/divider/divider.styles.js +34 -30
  61. package/dist/components/drawer/drawer.component.d.ts +61 -0
  62. package/dist/components/drawer/drawer.component.js +125 -0
  63. package/dist/components/drawer/drawer.d.ts +8 -0
  64. package/dist/components/drawer/drawer.js +6 -0
  65. package/dist/components/drawer/drawer.styles.js +71 -0
  66. package/dist/components/header/header.component.d.ts +46 -0
  67. package/dist/components/header/header.component.js +116 -0
  68. package/dist/components/header/header.d.ts +8 -0
  69. package/dist/components/header/header.js +6 -0
  70. package/dist/components/header/header.styles.js +68 -0
  71. package/dist/components/heading/heading.component.d.ts +8 -12
  72. package/dist/components/heading/heading.component.js +52 -24
  73. package/dist/components/heading/heading.styles.d.ts +1 -2
  74. package/dist/components/heading/heading.styles.js +35 -37
  75. package/dist/components/icon/icon.component.d.ts +19 -18
  76. package/dist/components/icon/icon.component.js +60 -40
  77. package/dist/components/icon/icon.styles.d.ts +1 -2
  78. package/dist/components/icon/icon.styles.js +61 -60
  79. package/dist/components/input/input.component.d.ts +31 -31
  80. package/dist/components/input/input.component.js +167 -146
  81. package/dist/components/input/input.controllers.d.ts +20 -6
  82. package/dist/components/input/input.controllers.js +14 -10
  83. package/dist/components/link/link.component.d.ts +12 -14
  84. package/dist/components/link/link.component.js +36 -34
  85. package/dist/components/link/link.styles.d.ts +1 -2
  86. package/dist/components/link/link.styles.js +24 -20
  87. package/dist/components/loader/loader.component.d.ts +1 -1
  88. package/dist/components/loader/loader.component.js +36 -40
  89. package/dist/components/loader/loader.styles.d.ts +1 -2
  90. package/dist/components/loader/loader.styles.js +40 -32
  91. package/dist/components/logo/logo.component.d.ts +8 -6
  92. package/dist/components/logo/logo.component.js +55 -51
  93. package/dist/components/logo/logo.styles.js +26 -16
  94. package/dist/components/menu/menu-item.component.d.ts +13 -0
  95. package/dist/components/{menu-item → menu}/menu-item.component.js +3 -3
  96. package/dist/components/{menu-item → menu}/menu-item.d.ts +2 -2
  97. package/dist/components/menu/menu.component.d.ts +10 -8
  98. package/dist/components/menu/menu.component.js +8 -10
  99. package/dist/components/menu/menu.d.ts +2 -2
  100. package/dist/components/nav/nav-item.component.d.ts +18 -0
  101. package/dist/components/nav/nav-item.component.js +38 -0
  102. package/dist/components/nav/nav-item.d.ts +8 -0
  103. package/dist/components/nav/nav-item.js +6 -0
  104. package/dist/components/nav/nav-item.styles.d.ts +1 -0
  105. package/dist/components/nav/nav-item.styles.js +39 -0
  106. package/dist/components/nav/nav.component.d.ts +17 -0
  107. package/dist/components/nav/nav.component.js +34 -0
  108. package/dist/components/nav/nav.d.ts +8 -0
  109. package/dist/components/nav/nav.js +6 -0
  110. package/dist/components/nav/nav.styles.d.ts +1 -0
  111. package/dist/components/nav/nav.styles.js +17 -0
  112. package/dist/components/popover/popover.component.d.ts +11 -8
  113. package/dist/components/popover/popover.component.js +24 -26
  114. package/dist/components/popover/popover.d.ts +2 -2
  115. package/dist/components/progress/progress.component.d.ts +2 -2
  116. package/dist/components/progress/progress.component.js +31 -37
  117. package/dist/components/progress/progress.d.ts +2 -2
  118. package/dist/components/progress/progress.styles.js +42 -35
  119. package/dist/components/radio/radio.component.d.ts +19 -13
  120. package/dist/components/radio/radio.component.js +13 -12
  121. package/dist/components/radio/radio.styles.d.ts +1 -2
  122. package/dist/components/radio/radio.styles.js +1 -1
  123. package/dist/components/segmented-button/segmented-button-item.component.d.ts +36 -0
  124. package/dist/components/segmented-button/segmented-button-item.component.js +56 -0
  125. package/dist/components/segmented-button/segmented-button-item.d.ts +8 -0
  126. package/dist/components/segmented-button/segmented-button-item.js +6 -0
  127. package/dist/components/segmented-button/segmented-button-item.styles.d.ts +1 -0
  128. package/dist/components/segmented-button/segmented-button-item.styles.js +62 -0
  129. package/dist/components/segmented-button/segmented-button.component.d.ts +30 -0
  130. package/dist/components/segmented-button/segmented-button.component.js +73 -0
  131. package/dist/components/segmented-button/segmented-button.d.ts +8 -0
  132. package/dist/components/segmented-button/segmented-button.js +6 -0
  133. package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
  134. package/dist/components/segmented-button/segmented-button.styles.js +16 -0
  135. package/dist/components/{select-option-group → select}/select-option-group.component.js +1 -1
  136. package/dist/components/{select-option-group → select}/select-option-group.d.ts +2 -2
  137. package/dist/components/select/select-option-group.style.d.ts +1 -0
  138. package/dist/components/{select-option → select}/select-option.component.d.ts +9 -10
  139. package/dist/components/{select-option → select}/select-option.component.js +23 -22
  140. package/dist/components/select/select-option.controllers.d.ts +15 -0
  141. package/dist/components/select/select-option.styles.d.ts +1 -0
  142. package/dist/components/select/select.component.d.ts +18 -17
  143. package/dist/components/select/select.component.js +22 -22
  144. package/dist/components/select/select.controllers.d.ts +21 -10
  145. package/dist/components/select/select.controllers.js +27 -22
  146. package/dist/components/select/stories/select.stories.icons.d.ts +7 -0
  147. package/dist/components/{stepper-item → stepper}/stepper-item.component.js +50 -49
  148. package/dist/components/{stepper-item → stepper}/stepper-item.d.ts +2 -2
  149. package/dist/components/stepper/stepper-item.styles.d.ts +1 -0
  150. package/dist/components/stepper/stepper.component.d.ts +4 -3
  151. package/dist/components/stepper/stepper.component.js +15 -15
  152. package/dist/components/stepper/stepper.d.ts +2 -2
  153. package/dist/components/stepper/stepper.helpers.d.ts +1 -1
  154. package/dist/components/switch/switch.component.d.ts +7 -6
  155. package/dist/components/switch/switch.component.js +21 -21
  156. package/dist/components/switch/switch.d.ts +2 -2
  157. package/dist/components/{tab-panel → tabs}/tab-panel.component.js +1 -1
  158. package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
  159. package/dist/components/tabs/tab-panel.styles.d.ts +1 -0
  160. package/dist/components/{tab → tabs}/tab.component.d.ts +2 -2
  161. package/dist/components/{tab → tabs}/tab.component.js +1 -1
  162. package/dist/components/{tab → tabs}/tab.d.ts +2 -2
  163. package/dist/components/tabs/tab.styles.d.ts +1 -0
  164. package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
  165. package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +31 -31
  166. package/dist/components/tabs/tabs.d.ts +8 -0
  167. package/dist/components/tabs/tabs.js +6 -0
  168. package/dist/components/tabs/tabs.styles.d.ts +1 -0
  169. package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
  170. package/dist/components/tag/tag.component.d.ts +20 -17
  171. package/dist/components/tag/tag.component.js +69 -67
  172. package/dist/components/tag/tag.d.ts +2 -2
  173. package/dist/components/tag/tag.styles.js +63 -50
  174. package/dist/components/textarea/textarea.component.d.ts +10 -11
  175. package/dist/components/textarea/textarea.component.js +66 -67
  176. package/dist/components/{toast-item → toast}/toast-item.component.js +15 -15
  177. package/dist/components/{toast-item → toast}/toast-item.d.ts +2 -0
  178. package/dist/components/{toast-item → toast}/toast-item.js +4 -0
  179. package/dist/components/toast/toast-item.styles.js +18 -0
  180. package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.js +1 -1
  181. package/dist/components/toast/toast-wrapper.styles.d.ts +1 -0
  182. package/dist/components/toast/toast.component.d.ts +9 -5
  183. package/dist/components/toast/toast.component.js +32 -28
  184. package/dist/components/toast/toast.singleton.d.ts +6 -11
  185. package/dist/components/toast/toast.singleton.js +23 -23
  186. package/dist/components/tooltip/tooltip.component.d.ts +7 -7
  187. package/dist/components/tooltip/tooltip.component.js +16 -11
  188. package/dist/components/tooltip/tooltip.d.ts +2 -2
  189. package/dist/custom-elements.json +4450 -2753
  190. package/dist/index.d.ts +22 -9
  191. package/dist/index.js +111 -74
  192. package/dist/internal/base-classes/popover/popover.base.d.ts +24 -9
  193. package/dist/internal/base-classes/popover/popover.base.js +138 -77
  194. package/dist/internal/base-classes/popover/popover.styles.js +14 -1
  195. package/dist/internal/components/hint/hint.component.d.ts +2 -2
  196. package/dist/internal/components/hint/hint.component.js +3 -2
  197. package/dist/internal/components/hint/hint.styles.d.ts +1 -2
  198. package/dist/internal/components/hint/hint.styles.js +1 -1
  199. package/dist/internal/components/skf-element.d.ts +1 -3
  200. package/dist/internal/components/skf-element.js +4 -9
  201. package/dist/internal/constants/iconSeverity.d.ts +3 -2
  202. package/dist/internal/constants/iconSeverity.js +2 -3
  203. package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
  204. package/dist/internal/controllers/popover.controller.d.ts +12 -6
  205. package/dist/internal/controllers/popover.controller.js +7 -11
  206. package/dist/internal/helpers/dateFormatter.d.ts +2 -0
  207. package/dist/internal/helpers/hintSeverity.d.ts +2 -2
  208. package/dist/internal/helpers/hintSeverity.js +1 -1
  209. package/dist/internal/helpers/stateMap.d.ts +14 -0
  210. package/dist/internal/helpers/stateMap.js +68 -0
  211. package/dist/internal/helpers/utilityTypes.d.ts +22 -0
  212. package/dist/internal/helpers/uuid.d.ts +15 -0
  213. package/dist/internal/helpers/uuid.js +14 -0
  214. package/dist/internal/helpers/watch.d.ts +1 -1
  215. package/dist/internal/helpers/watch.js +12 -12
  216. package/dist/internal/storybook/styles.d.ts +1 -0
  217. package/dist/internal/types/formField.d.ts +1 -1
  218. package/dist/internal/types.d.ts +18 -0
  219. package/dist/styles/component.styles.d.ts +1 -2
  220. package/dist/styles/component.styles.js +38 -37
  221. package/dist/styles/form-field.styles.js +11 -6
  222. package/dist/styles/global-alt.css +1 -0
  223. package/dist/styles/global.css +1 -1
  224. package/dist/types/jsx/custom-element-jsx.d.ts +767 -1282
  225. package/dist/types/vue/index.d.ts +572 -310
  226. package/dist/vscode.html-custom-data.json +547 -1068
  227. package/dist/web-types.json +1314 -769
  228. package/package.json +48 -64
  229. package/dist/components/accordion/accordion.test.d.ts +0 -1
  230. package/dist/components/checkbox/checkbox.test.d.ts +0 -1
  231. package/dist/components/collapse/collapse.component.d.ts +0 -40
  232. package/dist/components/collapse/collapse.component.js +0 -85
  233. package/dist/components/collapse/collapse.d.ts +0 -8
  234. package/dist/components/collapse/collapse.js +0 -6
  235. package/dist/components/collapse/collapse.styles.d.ts +0 -2
  236. package/dist/components/collapse/collapse.styles.js +0 -77
  237. package/dist/components/collapse/collapse.test.d.ts +0 -1
  238. package/dist/components/input/input.test.d.ts +0 -1
  239. package/dist/components/menu-item/menu-item.component.d.ts +0 -25
  240. package/dist/components/radio/radio.test.d.ts +0 -1
  241. package/dist/components/select-option/select-option.controllers.d.ts +0 -9
  242. package/dist/components/switch/switch.test.d.ts +0 -1
  243. package/dist/components/tab-group/tab-group.d.ts +0 -8
  244. package/dist/components/tab-group/tab-group.js +0 -6
  245. package/dist/components/toast-item/toast-item.styles.js +0 -16
  246. package/dist/internal/constants/heading.d.ts +0 -2
  247. package/dist/internal/playwright/index.d.ts +0 -1
  248. package/dist/react/index.d.ts +0 -33
  249. package/dist/react/index.js +0 -33
  250. package/dist/react/skf-accordion/index.d.ts +0 -3
  251. package/dist/react/skf-accordion/index.js +0 -13
  252. package/dist/react/skf-alert/index.d.ts +0 -9
  253. package/dist/react/skf-alert/index.js +0 -17
  254. package/dist/react/skf-button/index.d.ts +0 -9
  255. package/dist/react/skf-button/index.js +0 -17
  256. package/dist/react/skf-card/index.d.ts +0 -3
  257. package/dist/react/skf-card/index.js +0 -13
  258. package/dist/react/skf-checkbox/index.d.ts +0 -9
  259. package/dist/react/skf-checkbox/index.js +0 -17
  260. package/dist/react/skf-collapse/index.d.ts +0 -9
  261. package/dist/react/skf-collapse/index.js +0 -17
  262. package/dist/react/skf-dialog/index.d.ts +0 -15
  263. package/dist/react/skf-dialog/index.js +0 -19
  264. package/dist/react/skf-divider/index.d.ts +0 -3
  265. package/dist/react/skf-divider/index.js +0 -13
  266. package/dist/react/skf-heading/index.d.ts +0 -3
  267. package/dist/react/skf-heading/index.js +0 -13
  268. package/dist/react/skf-icon/index.d.ts +0 -3
  269. package/dist/react/skf-icon/index.js +0 -13
  270. package/dist/react/skf-input/index.d.ts +0 -12
  271. package/dist/react/skf-input/index.js +0 -18
  272. package/dist/react/skf-link/index.d.ts +0 -3
  273. package/dist/react/skf-link/index.js +0 -13
  274. package/dist/react/skf-loader/index.d.ts +0 -3
  275. package/dist/react/skf-loader/index.js +0 -13
  276. package/dist/react/skf-logo/index.d.ts +0 -3
  277. package/dist/react/skf-logo/index.js +0 -13
  278. package/dist/react/skf-menu/index.d.ts +0 -12
  279. package/dist/react/skf-menu/index.js +0 -18
  280. package/dist/react/skf-menu-item/index.d.ts +0 -27
  281. package/dist/react/skf-menu-item/index.js +0 -23
  282. package/dist/react/skf-popover/index.d.ts +0 -12
  283. package/dist/react/skf-popover/index.js +0 -18
  284. package/dist/react/skf-progress/index.d.ts +0 -3
  285. package/dist/react/skf-progress/index.js +0 -13
  286. package/dist/react/skf-radio/index.d.ts +0 -9
  287. package/dist/react/skf-radio/index.js +0 -17
  288. package/dist/react/skf-select/index.d.ts +0 -21
  289. package/dist/react/skf-select/index.js +0 -21
  290. package/dist/react/skf-select-option/index.d.ts +0 -9
  291. package/dist/react/skf-select-option/index.js +0 -17
  292. package/dist/react/skf-select-option-group/index.d.ts +0 -3
  293. package/dist/react/skf-select-option-group/index.js +0 -13
  294. package/dist/react/skf-stepper/index.d.ts +0 -9
  295. package/dist/react/skf-stepper/index.js +0 -17
  296. package/dist/react/skf-stepper-item/index.d.ts +0 -9
  297. package/dist/react/skf-stepper-item/index.js +0 -17
  298. package/dist/react/skf-switch/index.d.ts +0 -3
  299. package/dist/react/skf-switch/index.js +0 -13
  300. package/dist/react/skf-tab/index.d.ts +0 -12
  301. package/dist/react/skf-tab/index.js +0 -18
  302. package/dist/react/skf-tab-group/index.d.ts +0 -3
  303. package/dist/react/skf-tab-group/index.js +0 -13
  304. package/dist/react/skf-tab-panel/index.d.ts +0 -3
  305. package/dist/react/skf-tab-panel/index.js +0 -13
  306. package/dist/react/skf-tag/index.d.ts +0 -3
  307. package/dist/react/skf-tag/index.js +0 -13
  308. package/dist/react/skf-textarea/index.d.ts +0 -12
  309. package/dist/react/skf-textarea/index.js +0 -18
  310. package/dist/react/skf-toast/index.d.ts +0 -3
  311. package/dist/react/skf-toast/index.js +0 -13
  312. package/dist/react/skf-toast-wrapper/index.d.ts +0 -3
  313. package/dist/react/skf-toast-wrapper/index.js +0 -13
  314. package/dist/react/skf-tooltip/index.d.ts +0 -12
  315. package/dist/react/skf-tooltip/index.js +0 -18
  316. /package/dist/components/{menu-item/menu-item.styles.d.ts → accordion/accordion-item.styles.d.ts} +0 -0
  317. /package/dist/components/{select-option-group/select-option-group.style.d.ts → breadcrumb/breadcrumb-item.styles.d.ts} +0 -0
  318. /package/dist/components/{select-option/select-option.styles.d.ts → breadcrumb/breadcrumb.styles.d.ts} +0 -0
  319. /package/dist/components/{stepper-item/stepper-item.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
  320. /package/dist/components/{tab-group/tab-group.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
  321. /package/dist/components/{tab-panel/tab-panel.styles.d.ts → drawer/drawer.styles.d.ts} +0 -0
  322. /package/dist/components/{tab/tab.styles.d.ts → header/header.styles.d.ts} +0 -0
  323. /package/dist/components/{menu-item → menu}/menu-item.js +0 -0
  324. /package/dist/components/{toast-wrapper/toast-wrapper.styles.d.ts → menu/menu-item.styles.d.ts} +0 -0
  325. /package/dist/components/{menu-item → menu}/menu-item.styles.js +0 -0
  326. /package/dist/components/{select-option-group → select}/select-option-group.component.d.ts +0 -0
  327. /package/dist/components/{select-option-group → select}/select-option-group.js +0 -0
  328. /package/dist/components/{select-option-group → select}/select-option-group.style.js +0 -0
  329. /package/dist/components/{select-option → select}/select-option.d.ts +0 -0
  330. /package/dist/components/{select-option → select}/select-option.js +0 -0
  331. /package/dist/components/{select-option → select}/select-option.styles.js +0 -0
  332. /package/dist/components/{stepper-item → stepper}/stepper-item.component.d.ts +0 -0
  333. /package/dist/components/{stepper-item → stepper}/stepper-item.js +0 -0
  334. /package/dist/components/{stepper-item → stepper}/stepper-item.styles.js +0 -0
  335. /package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +0 -0
  336. /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
  337. /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
  338. /package/dist/components/{tab → tabs}/tab.js +0 -0
  339. /package/dist/components/{tab → tabs}/tab.styles.js +0 -0
  340. /package/dist/components/{toast-item → toast}/toast-item.component.d.ts +0 -0
  341. /package/dist/components/{toast-item → toast}/toast-item.styles.d.ts +0 -0
  342. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.d.ts +0 -0
  343. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.d.ts +0 -0
  344. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.js +0 -0
  345. /package/dist/components/{toast-wrapper → toast}/toast-wrapper.styles.js +0 -0
@@ -4,10 +4,10 @@ import { type CSSResultGroup } from 'lit';
4
4
  /**
5
5
  * The `<skf-switch>` is a component that displays a list of actions or options
6
6
  *
7
- * @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
7
+ * See [zeroheight](https://zeroheight.com/853e936c9/p/7282a2-switch) for design principle
8
8
  *
9
- * @attribute {boolean} disabled - If true, sets disabled state
10
- * @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
9
+ * @attribute {boolean} [disabled=false] - If true, sets disabled state
10
+ * @attribute {boolean} [required=false] - If true, value is required or must be checked for the form to be submittable
11
11
  *
12
12
  * @slot - The Switchs label. Alternatively, you can use the `label` attribute.
13
13
  *
@@ -15,13 +15,14 @@ import { type CSSResultGroup } from 'lit';
15
15
  */
16
16
  export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
17
17
  static styles: CSSResultGroup;
18
+ /** @internal */
18
19
  private _initialChecked;
19
20
  /** If true, outputs helping hints in console */
20
- debug?: boolean;
21
+ debug: boolean;
21
22
  /** If true, outputs helping hints in console */
22
- checked?: boolean;
23
+ checked: boolean;
23
24
  /** If true, hides the label visually */
24
- hideLabel?: boolean;
25
+ hideLabel: boolean;
25
26
  /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
26
27
  label?: string;
27
28
  /** If defined, adds name to the input-element */
@@ -1,21 +1,21 @@
1
1
  import { FormBase as o } from "../../internal/components/formBase.js";
2
2
  import { Asterisk as u } from "../../internal/templates/asterisk.js";
3
- import p from "../../styles/component.styles.js";
4
- import { html as c } from "lit";
5
- import { property as s, state as v, query as f } from "lit/decorators.js";
6
- import { classMap as m } from "lit/directives/class-map.js";
7
- import { ifDefined as _ } from "lit/directives/if-defined.js";
8
- import { styles as b } from "./switch.styles.js";
9
- var y = Object.defineProperty, i = (d, e, a, g) => {
10
- for (var l = void 0, r = d.length - 1, n; r >= 0; r--)
11
- (n = d[r]) && (l = n(e, a, l) || l);
12
- return l && y(e, a, l), l;
3
+ import { componentStyles as p } from "../../styles/component.styles.js";
4
+ import { nothing as c, html as v } from "lit";
5
+ import { property as s, state as f, query as m } from "lit/decorators.js";
6
+ import { classMap as _ } from "lit/directives/class-map.js";
7
+ import { ifDefined as b } from "lit/directives/if-defined.js";
8
+ import { styles as y } from "./switch.styles.js";
9
+ var g = Object.defineProperty, i = (d, e, a, k) => {
10
+ for (var l = void 0, h = d.length - 1, n; h >= 0; h--)
11
+ (n = d[h]) && (l = n(e, a, l) || l);
12
+ return l && g(e, a, l), l;
13
13
  };
14
- const h = class h extends o {
14
+ const r = class r extends o {
15
15
  constructor() {
16
- super(...arguments), this._initialChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._handleChange = (e) => {
16
+ super(...arguments), this._initialChecked = !1, this.debug = !1, this.checked = !1, this.hideLabel = !1, this.size = "md", this.value = "", this._invalid = !1, this._handleChange = (e) => {
17
17
  var a;
18
- e.stopPropagation(), this.pristine = !1, this.checked = (a = this.$input) == null ? void 0 : a.checked, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(null), this.emitEvent("change");
18
+ e.stopPropagation(), this.pristine = !1, this.checked = ((a = this.$input) == null ? void 0 : a.checked) ?? !1, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(null), this.emitEvent("change");
19
19
  }, this._handleInvalid = (e) => {
20
20
  this.pristine = !1, this._invalid = !0, this.customErrorDisplay && e.preventDefault();
21
21
  }, this._resetValue = (e) => {
@@ -51,9 +51,9 @@ const h = class h extends o {
51
51
  this.setValidity({});
52
52
  }
53
53
  render() {
54
- return c`
54
+ return v`
55
55
  <label
56
- class=${m({
56
+ class=${_({
57
57
  switch: !0,
58
58
  "switch--small": this.size === "sm"
59
59
  })}
@@ -67,11 +67,11 @@ const h = class h extends o {
67
67
  @reset=${this._resetValue}
68
68
  aria-invalid=${!!this._invalid}
69
69
  class="switch__input"
70
- name=${_(this.name)}
70
+ name=${b(this.name)}
71
71
  type="checkbox"
72
72
  value=${this.value}
73
73
  />
74
- <div class="switch__label">
74
+ <div class="switch__label ${this.hideLabel ? "visually-hidden" : c}">
75
75
  <slot>${this.label}</slot>
76
76
  ${this.required ? u(this.requiredLabel, "switch__asterisk") : null}
77
77
  </div>
@@ -79,8 +79,8 @@ const h = class h extends o {
79
79
  `;
80
80
  }
81
81
  };
82
- h.styles = [p, b];
83
- let t = h;
82
+ r.styles = [p, y];
83
+ let t = r;
84
84
  i([
85
85
  s({ type: Boolean })
86
86
  ], t.prototype, "debug");
@@ -106,10 +106,10 @@ i([
106
106
  s()
107
107
  ], t.prototype, "value");
108
108
  i([
109
- v()
109
+ f()
110
110
  ], t.prototype, "_invalid");
111
111
  i([
112
- f("input")
112
+ m("input")
113
113
  ], t.prototype, "$input");
114
114
  export {
115
115
  t as SkfSwitch
@@ -1,5 +1,5 @@
1
- import { SkfSwitch } from './switch.component';
2
- export * from './switch.component';
1
+ import { SkfSwitch } from './switch.component.js';
2
+ export * from './switch.component.js';
3
3
  export default SkfSwitch;
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
@@ -1,6 +1,6 @@
1
1
  import { SkfElement as c } from "../../internal/components/skf-element.js";
2
2
  import { watch as h } from "../../internal/helpers/watch.js";
3
- import l from "../../styles/component.styles.js";
3
+ import { componentStyles as l } from "../../styles/component.styles.js";
4
4
  import { html as v } from "lit";
5
5
  import { property as f, state as d } from "lit/decorators.js";
6
6
  import { styles as y } from "./tab-panel.styles.js";
@@ -1,5 +1,5 @@
1
- import { SkfTabPanel } from './tab-panel.component';
2
- export * from './tab-panel.component';
1
+ import { SkfTabPanel } from './tab-panel.component.js';
2
+ export * from './tab-panel.component.js';
3
3
  export default SkfTabPanel;
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -1,6 +1,6 @@
1
- import type { SkfTabGroup } from '../tab-group/tab-group.component.js';
2
1
  import { SkfElement } from '../../internal/components/skf-element';
3
2
  import { type CSSResultGroup } from 'lit';
3
+ import type { SkfTabs } from './tabs.component.js';
4
4
  export interface SkfTabEvent {
5
5
  tab: SkfTab;
6
6
  }
@@ -19,7 +19,7 @@ export declare class SkfTab extends SkfElement {
19
19
  /** The name of the tab-panel this tab is associated with. The panel must be located in the same tab group. */
20
20
  panel: string;
21
21
  selected: boolean;
22
- variant: SkfTabGroup['variant'];
22
+ variant: SkfTabs['variant'];
23
23
  constructor();
24
24
  /** @internal */
25
25
  handleSelectedChange(): void;
@@ -1,6 +1,6 @@
1
1
  import { SkfElement as n } from "../../internal/components/skf-element.js";
2
2
  import { watch as h } from "../../internal/helpers/watch.js";
3
- import m from "../../styles/component.styles.js";
3
+ import { componentStyles as m } from "../../styles/component.styles.js";
4
4
  import { html as f } from "lit";
5
5
  import { property as v, state as d } from "lit/decorators.js";
6
6
  import { classMap as b } from "lit/directives/class-map.js";
@@ -1,5 +1,5 @@
1
- import { SkfTab } from './tab.component';
2
- export * from './tab.component';
1
+ import { SkfTab } from './tab.component.js';
2
+ export * from './tab.component.js';
3
3
  export default SkfTab;
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -1,17 +1,16 @@
1
- import '../card/card.js';
2
1
  import { SkfElement } from '../../internal/components/skf-element';
3
2
  import { type CSSResultGroup, type PropertyValues } from 'lit';
4
3
  /**
5
- * The `<skf-tab-group>` is a component that displays a list of actions or options.
4
+ * The `<skf-tabs>` is a component that displays a list of actions or options
6
5
  *
7
6
  * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
8
7
  *
9
8
  * @slot - Used for grouping tab panels in the tab group. Must be <skf-tab-panel> elements
10
9
  * @slot tabs - Used for grouping tabs in the tab group. Must be <skf-tab> elements
11
10
  *
12
- * @tagname skf-tab-group
11
+ * @tagname skf-tabs
13
12
  */
14
- export declare class SkfTabGroup extends SkfElement {
13
+ export declare class SkfTabs extends SkfElement {
15
14
  static styles: CSSResultGroup;
16
15
  /** Sets the default selected tab */
17
16
  defaultSelected: number;
@@ -1,13 +1,13 @@
1
1
  import { SkfElement as p } from "../../internal/components/skf-element.js";
2
- import b from "../../styles/component.styles.js";
2
+ import { componentStyles as b } from "../../styles/component.styles.js";
3
3
  import { html as f } from "lit";
4
4
  import { property as o, queryAssignedElements as c } from "lit/decorators.js";
5
- import { classMap as u } from "lit/directives/class-map.js";
6
- import { styles as y } from "./tab-group.styles.js";
7
- var g = Object.defineProperty, i = (h, t, s, r) => {
8
- for (var e = void 0, n = h.length - 1, d; n >= 0; n--)
9
- (d = h[n]) && (e = d(t, s, e) || e);
10
- return e && g(t, s, e), e;
5
+ import { classMap as y } from "lit/directives/class-map.js";
6
+ import { styles as m } from "./tabs.styles.js";
7
+ var u = Object.defineProperty, n = (h, t, s, i) => {
8
+ for (var e = void 0, r = h.length - 1, d; r >= 0; r--)
9
+ (d = h[r]) && (e = d(t, s, e) || e);
10
+ return e && u(t, s, e), e;
11
11
  };
12
12
  const l = class l extends p {
13
13
  constructor() {
@@ -21,15 +21,15 @@ const l = class l extends p {
21
21
  this._selectTab(s);
22
22
  }, this._selectTab = (t) => {
23
23
  this.tabs.forEach((s) => {
24
- const r = this.panels.find((e) => e.name === s.panel);
25
- s.selected = s === t, r && (r.active = s === t);
24
+ const i = this.panels.find((e) => e.name === s.panel);
25
+ s.selected = s === t, i && (i.active = s === t);
26
26
  });
27
27
  }, this._syncTabsAndPanels = () => {
28
28
  this.tabs.forEach((t, s) => {
29
- const r = (s + 1).toString();
30
- t.id = t.id ? t.id : `skf-tab-${r}`, t.selected = this.defaultSelected === s;
31
- const e = this.panels.find((n) => n.name === t.panel);
32
- e && (e.id = e.id ? e.id : `skf-tab-panel-${r}`, t.setAttribute("aria-controls", e.id), e.setAttribute("aria-labelledby", t.id), e.active = t.selected);
29
+ const i = (s + 1).toString();
30
+ t.id = t.id ? t.id : `skf-tab-${i}`, t.selected = this.defaultSelected === s;
31
+ const e = this.panels.find((r) => r.name === t.panel);
32
+ e && (e.id = e.id ? e.id : `skf-tab-panel-${i}`, t.setAttribute("aria-controls", e.id), e.setAttribute("aria-labelledby", t.id), e.active = t.selected);
33
33
  });
34
34
  };
35
35
  }
@@ -50,48 +50,48 @@ const l = class l extends p {
50
50
  return f`
51
51
  <div
52
52
  @keydown=${this._handleKeyDown}
53
- class=${u({
54
- "tab-group": !0,
55
- "tab-group--compressed": this.variant === "compressed",
56
- "tab-group--expanded": this.variant === "expanded",
57
- "tab-group--no-border": this.noBorder,
58
- "tab-group--no-padding": this.noPadding,
59
- "tab-group--stretch": this.stretch
53
+ class=${y({
54
+ tabs: !0,
55
+ "tabs--compressed": this.variant === "compressed",
56
+ "tabs--expanded": this.variant === "expanded",
57
+ "tabs--no-border": this.noBorder,
58
+ "tabs--no-padding": this.noPadding,
59
+ "tabs--stretch": this.stretch
60
60
  })}
61
61
  >
62
- <div class="tab-group__tabs" role="tablist">
62
+ <div class="tabs__list" role="tablist">
63
63
  <slot name="tabs"></slot>
64
64
  </div>
65
- <div class="tab-group__body">
65
+ <div class="tabs__body">
66
66
  <slot></slot>
67
67
  </div>
68
68
  </div>
69
69
  `;
70
70
  }
71
71
  };
72
- l.styles = [b, y];
72
+ l.styles = [b, m];
73
73
  let a = l;
74
- i([
74
+ n([
75
75
  o({ type: Number, attribute: "default-selected" })
76
76
  ], a.prototype, "defaultSelected");
77
- i([
77
+ n([
78
78
  o({ type: Boolean, attribute: "no-border" })
79
79
  ], a.prototype, "noBorder");
80
- i([
80
+ n([
81
81
  o({ type: Boolean, attribute: "no-padding" })
82
82
  ], a.prototype, "noPadding");
83
- i([
83
+ n([
84
84
  o({ type: Boolean })
85
85
  ], a.prototype, "stretch");
86
- i([
86
+ n([
87
87
  o({ reflect: !0 })
88
88
  ], a.prototype, "variant");
89
- i([
89
+ n([
90
90
  c({ slot: "tabs" })
91
91
  ], a.prototype, "tabs");
92
- i([
92
+ n([
93
93
  c()
94
94
  ], a.prototype, "panels");
95
95
  export {
96
- a as SkfTabGroup
96
+ a as SkfTabs
97
97
  };
@@ -0,0 +1,8 @@
1
+ import { SkfTabs } from './tabs.component.js';
2
+ export * from './tabs.component.js';
3
+ export default SkfTabs;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-tabs': SkfTabs;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ import { SkfTabs as f } from "./tabs.component.js";
2
+ f.define("skf-tabs");
3
+ export {
4
+ f as SkfTabs,
5
+ f as default
6
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -1,5 +1,5 @@
1
- import { css as r } from "lit";
2
- const a = r`
1
+ import { css as s } from "lit";
2
+ const r = s`
3
3
  /* stylelint-disable selector-class-pattern */
4
4
  @layer components {
5
5
  :host {
@@ -13,13 +13,13 @@ const a = r`
13
13
  /**
14
14
  * Root
15
15
  */
16
- .tab-group {
16
+ .tabs {
17
17
  background-color: var(--skf-bg-color-neutral-1);
18
18
  }
19
19
 
20
- .tab-group--expanded {
20
+ .tabs--expanded {
21
21
  border: var(
22
- --_skf-tab-group-border,
22
+ --_skf-tabs-border,
23
23
  var(--skf-border-width-sm) solid var(--skf-border-color-tertiary)
24
24
  );
25
25
  border-end-end-radius: var(--skf-border-radius-sm);
@@ -31,11 +31,11 @@ const a = r`
31
31
  }
32
32
  }
33
33
 
34
- .tab-group--no-border {
35
- --_skf-tab-group-border: none;
34
+ .tabs--no-border {
35
+ --_skf-tabs-border: none;
36
36
  }
37
37
 
38
- .tab-group--stretch {
38
+ .tabs--stretch {
39
39
  block-size: inherit;
40
40
  display: flex;
41
41
  flex-direction: column;
@@ -44,10 +44,10 @@ const a = r`
44
44
  /**
45
45
  * Tabs
46
46
  */
47
- .tab-group__tabs {
47
+ .tabs__list {
48
48
  display: flex;
49
49
 
50
- .tab-group--compressed & {
50
+ .tabs--compressed & {
51
51
  gap: var(--skf-spacing-100);
52
52
  }
53
53
  }
@@ -55,15 +55,15 @@ const a = r`
55
55
  /**
56
56
  * Body
57
57
  */
58
- .tab-group__body {
59
- padding-block: var(--_skf-tab-group-body-padding-block, var(--skf-spacing-100) 0);
58
+ .tabs__body {
59
+ padding-block: var(--_skf-tabs-body-padding-block, var(--skf-spacing-100) 0);
60
60
 
61
- .tab-group--stretch & {
61
+ .tabs--stretch & {
62
62
  overflow-y: auto;
63
63
  }
64
64
 
65
- .tab-group--expanded:not(.tab-group--no-padding) & {
66
- --_skf-tab-group-body-padding-block: var(--skf-spacing-100);
65
+ .tabs--expanded:not(.tabs--no-padding) & {
66
+ --_skf-tabs-body-padding-block: var(--skf-spacing-100);
67
67
 
68
68
  padding-inline: var(--skf-spacing-100);
69
69
  }
@@ -71,5 +71,5 @@ const a = r`
71
71
  }
72
72
  `;
73
73
  export {
74
- a as styles
74
+ r as styles
75
75
  };
@@ -1,7 +1,8 @@
1
1
  import '../icon/icon.js';
2
2
  import { SkfElement } from '../../internal/components/skf-element';
3
- import type { Icon, SeverityBgColor } from '@skf-design-system/ui-assets';
3
+ import type { Icon, Severity } from '../../internal/types.js';
4
4
  import { type CSSResultGroup } from 'lit';
5
+ type Size = 'sm' | 'md';
5
6
  /**
6
7
  * The `<skf-tag>` is a component that displays a list of actions or options
7
8
  *
@@ -12,21 +13,18 @@ import { type CSSResultGroup } from 'lit';
12
13
  * @tagname skf-tag
13
14
  */
14
15
  export declare class SkfTag extends SkfElement {
16
+ #private;
15
17
  static styles: CSSResultGroup;
18
+ /** @internal */
16
19
  private _onClick?;
17
- protected _onRemove?: (event: Event) => void;
20
+ /** @internal */
21
+ private _onRemove?;
18
22
  /** Specifies Tag size */
19
- size: 'sm' | 'md' | 'lg';
20
- /**
21
- * If defined, displays leading/provided icon
22
- * @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" }
23
- */
23
+ size: Size;
24
+ /** If defined, displays leading/provided icon */
24
25
  icon?: Icon;
25
- /**
26
- * If defined, gives the supplied appearance
27
- * @type { "warning" | "success" | "info" | "error" | "alert" }
28
- */
29
- color?: SeverityBgColor;
26
+ /** If defined, gives the supplied appearance */
27
+ color?: Severity;
30
28
  /** If defined, accepts a function that runs on click */
31
29
  set onClick(onClickFn: ((event: Event) => void) | undefined);
32
30
  get onClick(): ((event: Event) => void) | undefined;
@@ -34,15 +32,20 @@ export declare class SkfTag extends SkfElement {
34
32
  set onRemove(onRemoveFn: ((event: Event) => void) | undefined);
35
33
  get onRemove(): ((event: Event) => void) | undefined;
36
34
  /** If true, adds trailing button to remove tag */
37
- removable?: boolean;
35
+ removable: boolean;
38
36
  /** @internal */
39
37
  $removeButton: HTMLButtonElement;
40
38
  connectedCallback(): void;
41
39
  disconnectedCallback(): void;
42
40
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
43
- protected _handleKeyDown: (e: KeyboardEvent) => void;
44
- /** run externally provided callback (if any) first. Let click propagate to handleClick. */
45
- protected _handleRemove: (e: Event) => void;
46
- protected _handleClick: (e: Event) => void;
41
+ /** @internal */
42
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
43
+ /** @internal */
44
+ private _handleKeyDown;
45
+ /** @internal run externally provided callback (if any) first. Let click propagate to handleClick. */
46
+ private _handleRemove;
47
+ /** @internal */
48
+ private _handleClick;
47
49
  render(): import("lit").TemplateResult<1>;
48
50
  }
51
+ export {};
@@ -1,26 +1,39 @@
1
- import { SkfElement as u } from "../../internal/components/skf-element.js";
2
- import f from "../../styles/component.styles.js";
3
- import { html as a, nothing as p } from "lit";
4
- import { property as l, query as d } from "lit/decorators.js";
5
- import { classMap as v } from "lit/directives/class-map.js";
6
- import { ifDefined as _ } from "lit/directives/if-defined.js";
7
- import { styles as k } from "./tag.styles.js";
8
- var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (m, t, s, r) => {
9
- for (var e = r > 1 ? void 0 : r ? y(t, s) : t, n = m.length - 1, c; n >= 0; n--)
10
- (c = m[n]) && (e = (r ? c(t, s, e) : c(e)) || e);
11
- return r && e && b(t, s, e), e;
1
+ var y = (e) => {
2
+ throw TypeError(e);
12
3
  };
13
- const h = class h extends u {
4
+ var k = (e, o, t) => o.has(e) || y("Cannot " + t);
5
+ var m = (e, o, t) => (k(e, o, "read from private field"), t ? t.call(e) : o.get(e)), d = (e, o, t) => o.has(e) ? y("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(e) : o.set(e, t), v = (e, o, t, i) => (k(e, o, "write to private field"), i ? i.call(e, t) : o.set(e, t), t);
6
+ import "../icon/icon.js";
7
+ import { SkfElement as _ } from "../../internal/components/skf-element.js";
8
+ import { stateMap as g } from "../../internal/helpers/stateMap.js";
9
+ import { watch as w } from "../../internal/helpers/watch.js";
10
+ import { componentStyles as $ } from "../../styles/component.styles.js";
11
+ import { nothing as C, html as f } from "lit";
12
+ import { property as c, query as R } from "lit/decorators.js";
13
+ import { ifDefined as D } from "lit/directives/if-defined.js";
14
+ import { styles as E } from "./tag.styles.js";
15
+ var P = Object.defineProperty, z = Object.getOwnPropertyDescriptor, r = (e, o, t, i) => {
16
+ for (var s = i > 1 ? void 0 : i ? z(o, t) : o, l = e.length - 1, p; l >= 0; l--)
17
+ (p = e[l]) && (s = (i ? p(o, t, s) : p(s)) || s);
18
+ return i && s && P(o, t, s), s;
19
+ };
20
+ const b = {
21
+ size: ["sm", "md"],
22
+ color: ["error", "info", "success", "warning"]
23
+ };
24
+ var a, h;
25
+ const u = class u extends _ {
14
26
  constructor() {
15
- super(...arguments), this.size = "md", this._handleKeyDown = (t) => {
27
+ super(...arguments);
28
+ d(this, a);
29
+ d(this, h);
30
+ v(this, a, this.attachInternals()), v(this, h, m(this, a).states), this.size = "md", this.removable = !1, this._handleKeyDown = (t) => {
16
31
  (t.key === "Enter" || t.key === " ") && this.$removeButton.click();
17
32
  }, this._handleRemove = (t) => {
18
33
  this._onRemove && this._onRemove(t);
19
34
  }, this._handleClick = (t) => {
20
- var e;
21
- t.stopPropagation();
22
- const s = t.composedPath()[0];
23
- console.log("$clickTarget", s), s.localName === "button" ? this.remove() : (e = this.onClick) == null || e.call(this, t);
35
+ var l;
36
+ t.stopPropagation(), t.composedPath()[0].localName === "button" ? this.remove() : (l = this.onClick) == null || l.call(this, t);
24
37
  };
25
38
  }
26
39
  set onClick(t) {
@@ -41,63 +54,52 @@ const h = class h extends u {
41
54
  disconnectedCallback() {
42
55
  super.disconnectedCallback(), this.removeEventListener("click", this._handleClick);
43
56
  }
44
- attributeChangedCallback(t, s, r) {
45
- super.attributeChangedCallback(t, s, r), t === "removable" && r !== null ? this.addEventListener("keydown", this._handleKeyDown) : this.removeEventListener("keydown", this._handleKeyDown);
57
+ attributeChangedCallback(t, i, s) {
58
+ super.attributeChangedCallback(t, i, s), t === "removable" && s !== null ? this.addEventListener("keydown", this._handleKeyDown) : this.removeEventListener("keydown", this._handleKeyDown);
59
+ }
60
+ _handleStateChange(t, i, s) {
61
+ g(m(this, h), b[t]).set(s);
46
62
  }
47
63
  render() {
48
- return a`
49
- <div
50
- class=${v({
51
- tag: !0,
52
- "tag--color-alert": this.color === "alert",
53
- "tag--color-error": this.color === "error",
54
- "tag--color-info": this.color === "info",
55
- "tag--color-success": this.color === "success",
56
- "tag--color-warning": this.color === "warning",
57
- "tag--small": this.size === "sm"
58
- })}
59
- >
60
- ${this.icon ? a`
61
- <skf-icon
62
- class="tag__icon"
63
- color=${_(this.color)}
64
- name=${this.icon}
65
- size="sm"
66
- ></skf-icon>
67
- ` : p}
68
- <slot class="tag__slot"></slot>
69
- ${this.removable ? a`
70
- <button @click=${this._handleRemove} class="tag__btn" type="button">
64
+ return f`
65
+ <div id="root">
66
+ ${this.icon ? f`<skf-icon color=${D(this.color)} name=${this.icon} size="sm"></skf-icon>` : C}
67
+ <slot></slot>
68
+ ${this.removable ? f`
69
+ <button @click=${this._handleRemove} type="button">
71
70
  <skf-icon name="close" size="xs"></skf-icon>
72
71
  </button>
73
- ` : p}
72
+ ` : C}
74
73
  </div>
75
74
  `;
76
75
  }
77
76
  };
78
- h.styles = [f, k];
79
- let o = h;
80
- i([
81
- l({ reflect: !0 })
82
- ], o.prototype, "size", 2);
83
- i([
84
- l()
85
- ], o.prototype, "icon", 2);
86
- i([
87
- l({ reflect: !0 })
88
- ], o.prototype, "color", 2);
89
- i([
90
- l({ attribute: !1 })
91
- ], o.prototype, "onClick", 1);
92
- i([
93
- l({ attribute: !1 })
94
- ], o.prototype, "onRemove", 1);
95
- i([
96
- l({ type: Boolean, reflect: !0 })
97
- ], o.prototype, "removable", 2);
98
- i([
99
- d("button")
100
- ], o.prototype, "$removeButton", 2);
77
+ a = new WeakMap(), h = new WeakMap(), u.styles = [$, E];
78
+ let n = u;
79
+ r([
80
+ c({ type: String })
81
+ ], n.prototype, "size", 2);
82
+ r([
83
+ c({ type: String })
84
+ ], n.prototype, "icon", 2);
85
+ r([
86
+ c({ type: String })
87
+ ], n.prototype, "color", 2);
88
+ r([
89
+ c({ attribute: !1 })
90
+ ], n.prototype, "onClick", 1);
91
+ r([
92
+ c({ attribute: !1 })
93
+ ], n.prototype, "onRemove", 1);
94
+ r([
95
+ c({ type: Boolean })
96
+ ], n.prototype, "removable", 2);
97
+ r([
98
+ R("button")
99
+ ], n.prototype, "$removeButton", 2);
100
+ r([
101
+ w(Object.keys(b))
102
+ ], n.prototype, "_handleStateChange", 1);
101
103
  export {
102
- o as SkfTag
104
+ n as SkfTag
103
105
  };