@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
@@ -0,0 +1,455 @@
1
+ import "../icon/icon.js";
2
+ import { computePosition as P, flip as S, offset as E } from "@floating-ui/dom";
3
+ import { FormBase as C } from "../../internal/components/formBase.js";
4
+ import "../../internal/components/hint/hint.js";
5
+ import { PopoverController as I } from "../../internal/controllers/popover.controller.js";
6
+ import { hintSeverity as O } from "../../internal/helpers/hintSeverity.js";
7
+ import { watch as M } from "../../internal/helpers/watch.js";
8
+ import { Asterisk as T } from "../../internal/templates/asterisk.js";
9
+ import { Temporal as w } from "@js-temporal/polyfill";
10
+ import { componentStyles as B } from "../../styles/component.styles.js";
11
+ import { nothing as g, html as y } from "lit";
12
+ import { property as h, state as $, query as b, queryAssignedNodes as x } from "lit/decorators.js";
13
+ import { ifDefined as u } from "lit/directives/if-defined.js";
14
+ import { live as F } from "lit/directives/live.js";
15
+ import "./datepicker-popup.js";
16
+ import { dateFormatter as v, is as f, isPopoverOpen as L, debounce as R } from "./datepicker.helpers.js";
17
+ import { styles as A } from "./datepicker.styles.js";
18
+ var j = Object.defineProperty, q = Object.getOwnPropertyDescriptor, r = (D, e, t, a) => {
19
+ for (var o = a > 1 ? void 0 : a ? q(e, t) : e, n = D.length - 1, d; n >= 0; n--)
20
+ (d = D[n]) && (o = (a ? d(e, t, o) : d(o)) || o);
21
+ return a && o && j(e, t, o), o;
22
+ };
23
+ const _ = class _ extends C {
24
+ constructor() {
25
+ super(), this.popoverController = new I(this), this.id = "skf-datepicker-input", this.placeholder = "YYYY-MM-DD", this.range = !1, this.size = "md", this.validateOn = "change", this.invalid = !1, this.selectedRangeDates = { start: null, end: null }, this.showClearbutton = !1, this.abortController = new AbortController(), this.abortSignal = this.abortController.signal, this._handleSelectedDate = () => {
26
+ this.pristine = !1, this._internals.setFormValue(this.value ?? ""), this.validateInput();
27
+ }, this._handleDateSelected = (e) => {
28
+ if (this.range && "start" in e.detail.date && "end" in e.detail.date) {
29
+ const t = e.detail.date.start, a = e.detail.date.end;
30
+ this.value = `${v(t)},${v(a)}`, this.selectedRangeDates = { start: t, end: a };
31
+ } else !this.range && e.detail.date instanceof Date && (this.value = v(e.detail.date), this._animatePopover({ el: this.$popover, show: !1 }).then(() => {
32
+ this.$popover.hidePopover();
33
+ }));
34
+ }, this._handleKeyboardEvents = (e) => {
35
+ var a, o;
36
+ const t = e.target.closest("input");
37
+ if (t) {
38
+ if ((t.selectionStart ?? 0) < t.value.length && /[[0-9-]/.test(e.key)) {
39
+ const n = t.selectionStart ?? 0, p = t.value.split("").slice(0, n);
40
+ t.value = p.join("");
41
+ }
42
+ if (t.name.endsWith("-end") && (e.key === "Backspace" && t.value.length === 0 || t.selectionStart === 0 && e.key === "ArrowLeft") && (e.preventDefault(), this.$input.focus()), e.key === "Tab" && !e.shiftKey && t.name.endsWith("-end")) {
43
+ e.preventDefault();
44
+ const d = (a = this.$popover.childNodes[1].shadowRoot) == null ? void 0 : a.querySelector("skf-datepicker-calendar"), p = (o = d == null ? void 0 : d.shadowRoot) == null ? void 0 : o.querySelector("button");
45
+ p == null || p.focus();
46
+ }
47
+ if ((t.value.length === 4 || t.value.length === 7) && /[[0-9]/.test(e.key) && (t.value = `${t.value}-${e.key}`, e.preventDefault()), e.key === "Escape")
48
+ if (t.blur(), this.$popover.hidePopover(), this.range) {
49
+ const n = this.$input.value, d = this.$input_range_end.value;
50
+ if (!f(n, d).date()) return;
51
+ this.$datepickerPopup.selectedDateRange = {
52
+ start: new Date(n),
53
+ end: new Date(d)
54
+ }, this.$datepickerPopup.emit("selected-date-changed", {
55
+ detail: { date: new Date(n) }
56
+ });
57
+ } else {
58
+ if (!t.value || !f(t.value).date()) return;
59
+ this.$datepickerPopup.emit("selected-date-changed", {
60
+ detail: { date: new Date(t.value) }
61
+ });
62
+ }
63
+ e.key === "Enter" && (t.blur(), this.$popover.hidePopover());
64
+ }
65
+ }, this._handleFocus = () => {
66
+ this.showPopover();
67
+ }, this._handleBlur = (e) => {
68
+ !e.target.name.endsWith("-end") && this.range;
69
+ }, this._handleClose = () => {
70
+ this.$anchor.blur();
71
+ }, this.clearInput = () => {
72
+ this.value = "", this.$datepickerPopup.clearSelection();
73
+ }, this._handleInput = (e) => {
74
+ const t = e.target, a = String(t.value).replace(/[^0-9-]/g, "");
75
+ if (t.value = a, t.setCustomValidity(this.customError ?? ""), !!f(t.value).ISO()) {
76
+ if (this.focusTimeoutId && clearTimeout(this.focusTimeoutId), this.$datepickerPopup.date = t.value, this.range) {
77
+ this.$datepickerPopup.selectedDateRange = {
78
+ start: f(this.$input.value).ISO() ? new Date(this.$input.value) : null,
79
+ end: f(this.$input_range_end.value).ISO() ? new Date(this.$input_range_end.value) : null
80
+ };
81
+ const o = Object.values(this.$datepickerPopup.selectedDateRange).filter(Boolean).map((n) => new Date(n).toLocaleDateString("en-CA")).join();
82
+ this.value = o, f(this.$input.value).ISO() && (this.focusTimeoutId = setTimeout(() => {
83
+ this.$input_range_end.focus();
84
+ }, 200));
85
+ } else
86
+ this.$datepickerPopup.selectedDate = new Date(t.value), this.$datepickerPopup.emit("selected-date-changed", {
87
+ detail: { date: new Date(t.value) }
88
+ });
89
+ this.validateOn === "input" && (this._pristine = !1, this.validateInput());
90
+ }
91
+ }, this._toggleClearButton = (e = !1) => {
92
+ this.showClearbutton = e;
93
+ }, this.reposition = async () => {
94
+ const { x: e, y: t } = await P(this.$anchor, this.$popover, {
95
+ placement: "bottom-start",
96
+ middleware: [S(), E(0)],
97
+ strategy: "fixed"
98
+ });
99
+ Object.assign(this.$popover.style, {
100
+ left: `${String(e)}px`,
101
+ top: `${String(t)}px`
102
+ });
103
+ }, this.addEventListener("skf-datepicker-selected", this._handleDateSelected), this.addEventListener("reset", () => {
104
+ this.clearInput(), this.validateInput();
105
+ });
106
+ }
107
+ set customInvalid(e) {
108
+ this.customError = e ?? "";
109
+ }
110
+ get customInvalid() {
111
+ return this.customError;
112
+ }
113
+ connectedCallback() {
114
+ var e;
115
+ super.connectedCallback(), this._init_date = (e = this.value) == null ? void 0 : e.split(",")[0], this.addEventListener("selected-date-changed", this._handleSelectedDate);
116
+ }
117
+ disconnectedCallback() {
118
+ super.disconnectedCallback(), this.abortController.abort();
119
+ }
120
+ firstUpdated() {
121
+ var e;
122
+ this.$datepickerPopup.date = this._init_date ? w.PlainDate.from(this._init_date).toString() : w.Now.plainDateISO().toString(), this.range ? this.$datepickerPopup.selectedDateRange = {
123
+ start: this._init_date ? new Date(this._init_date) : null,
124
+ end: (e = this.value) != null && e.split(",")[1] ? new Date(this.value.split(",")[1]) : null
125
+ } : this.$datepickerPopup.selectedDate = this._init_date ? new Date(this._init_date) : void 0, this.hint && !this.hasAttribute("hint") && this.setAttribute("hint", this.hint), this.validateInput();
126
+ }
127
+ attributeChangedCallback(e, t, a) {
128
+ if (super.attributeChangedCallback(e, t, a), e === "custom-invalid")
129
+ if (typeof a == "string") {
130
+ const n = this.withFallback(a);
131
+ this._pristine = !1, this._internals.setValidity({ customError: !0 }, n), this.invalid = !0, this.hint = n, this.checkValidity();
132
+ } else
133
+ this._internals.setValidity({}), this.validateInput();
134
+ }
135
+ _handleValueChange() {
136
+ var e, t, a, o, n, d, p, i;
137
+ (e = this.value) != null && e.trim() || this.$datepickerPopup.clearSelection(), this._internals.setFormValue(this.value ?? ""), this.validateInput(), this._pristine = !1, this.$input.value = v((t = this.value) == null ? void 0 : t.split(",")[0]), this.range ? (this.$datepickerPopup.selectedDateRange = {
138
+ start: (n = this.value) != null && n.split(",")[0] ? new Date(this.value.split(",")[0]) : null,
139
+ end: (d = this.value) != null && d.split(",")[1] ? new Date(this.value.split(",")[1]) : null
140
+ }, this.$input_range_end.value = v((p = this.value) == null ? void 0 : p.split(",")[1]), this.$datepickerPopup.date = ((i = this.value) == null ? void 0 : i.split(",")[0]) ?? "") : (this.$datepickerPopup.selectedDate = (a = this.value) != null && a.split(",")[0] ? new Date(this.value.split(",")[0]) : void 0, this.$datepickerPopup.date = ((o = this.value) == null ? void 0 : o.split(",")[0]) ?? ""), this.validateInput();
141
+ }
142
+ showPopover() {
143
+ if (L(this.$popover)) return;
144
+ R(() => {
145
+ this.$popover.showPopover(), this._animatePopover({ show: !0 });
146
+ }, 200)(), this.addEventListener("focusout", this.hidePopover.bind(this), {
147
+ once: !0,
148
+ signal: this.abortSignal
149
+ });
150
+ }
151
+ hidePopover() {
152
+ var t;
153
+ this.removeEventListener("focusout", this.hidePopover.bind(this)), ((t = document.activeElement) == null ? void 0 : t.closest("skf-datepicker-input")) !== this && this.$popover.hidePopover();
154
+ }
155
+ /**
156
+ * Clears the input field
157
+ */
158
+ clear() {
159
+ this.clearInput(), this._toggleClearButton(!1);
160
+ }
161
+ /** @internal */
162
+ async _animatePopover({ el: e = this.$popover, show: t }) {
163
+ return t && (e.style.opacity = "0", e.style.transform = "scaleY(0.5)"), new Promise((a) => {
164
+ const o = [
165
+ { opacity: 0, transform: "scaleY(0.5)" },
166
+ { opacity: 1, transform: "scaleY(1)" }
167
+ ], n = t ? o : o.reverse();
168
+ setTimeout(
169
+ () => {
170
+ e.style.transformOrigin = "top";
171
+ const d = this.$popover.animate(n, {
172
+ duration: 100,
173
+ easing: "linear",
174
+ fill: "both"
175
+ });
176
+ d.onfinish = () => {
177
+ a();
178
+ };
179
+ },
180
+ t ? 0 : 50
181
+ );
182
+ });
183
+ }
184
+ /** @internal consider sharing this functionality with input */
185
+ validateInput() {
186
+ if (this._internals.validity.customError) return;
187
+ let t = JSON.parse(JSON.stringify(this._internals.validity)), a = {};
188
+ if (this.selectableFrom) {
189
+ const { validityFragment: i, errorMessageFragment: l } = o(this);
190
+ t = { ...t, ...i }, a = { ...a, ...l };
191
+ }
192
+ if (this.selectableTo) {
193
+ const { validityFragment: i, errorMessageFragment: l } = n(this);
194
+ t = { ...t, ...i }, a = { ...a, ...l };
195
+ }
196
+ if (this.range) {
197
+ const { validityFragment: i, errorMessageFragment: l } = d(this);
198
+ t = { ...t, ...i }, a = { ...a, ...l };
199
+ }
200
+ if (this.required) {
201
+ const { validityFragment: i, errorMessageFragment: l } = p(this);
202
+ t = { ...t, ...i }, a = { ...a, ...l };
203
+ }
204
+ if (t.valid = !Object.values(t).some((i) => i), this.invalid = !1, t.valid)
205
+ this._internals.setValidity({ customError: this._internals.validity.customError }), this.hint = this.getAttribute("hint") ?? "";
206
+ else {
207
+ this.invalid = !this._pristine && !t.valid;
208
+ let i;
209
+ for (i in t) {
210
+ const l = `data-${i.toString()}`;
211
+ if (t[i]) {
212
+ this.validationError = i.toString();
213
+ const c = this.hasAttribute(l) ? this.getAttribute(l) : a[i];
214
+ this._internals.setValidity(
215
+ { [this.validationError]: !0, customError: this._internals.validity.customError },
216
+ this.withFallback(c)
217
+ ), c && !this._pristine && (this.hint = c), this.invalid && this.customErrorDisplay && this.checkValidity();
218
+ }
219
+ }
220
+ }
221
+ function o(i) {
222
+ const l = { validityFragment: {}, errorMessageFragment: {} };
223
+ if (!i.selectableFrom) return l;
224
+ const c = new Date(i.selectableFrom);
225
+ if (new Date(i.$input.value) < c) {
226
+ const m = i.getAttribute("data-rangeunderflow") ?? `Date is out of range. Earliest selectable date is ${i.selectableFrom}.`;
227
+ return {
228
+ validityFragment: { rangeUnderflow: !0, valid: !1 },
229
+ errorMessageFragment: { rangeUnderflow: m }
230
+ };
231
+ }
232
+ return l;
233
+ }
234
+ function n(i) {
235
+ const l = { validityFragment: {}, errorMessageFragment: {} };
236
+ if (!i.selectableTo) return l;
237
+ const c = new Date(i.selectableTo);
238
+ if (new Date(i.$input.value) > c) {
239
+ const m = i.getAttribute("data-rangeoverflow") ?? `Date is out of range. Latest selectable date is ${i.selectableTo}.`;
240
+ return {
241
+ validityFragment: { rangeOverflow: !0, valid: !1 },
242
+ errorMessageFragment: { rangeOverflow: m }
243
+ };
244
+ }
245
+ return l;
246
+ }
247
+ function d(i) {
248
+ const l = { validityFragment: {}, errorMessageFragment: {} }, c = new Date(i.$input.value);
249
+ if (new Date(i.$input_range_end.value) < c) {
250
+ const m = i.getAttribute("data-rangeunderflow") ?? "End date cannot be before start date";
251
+ return {
252
+ validityFragment: { rangeUnderflow: !0, valid: !1 },
253
+ errorMessageFragment: { rangeUnderflow: m }
254
+ };
255
+ }
256
+ return l;
257
+ }
258
+ function p(i) {
259
+ const l = { validityFragment: {}, errorMessageFragment: {} };
260
+ return !i.$input.value || i.range && !i.$input_range_end.value ? {
261
+ validityFragment: { valueMissing: !0, valid: !1 },
262
+ errorMessageFragment: { valueMissing: "This field is required" }
263
+ } : l;
264
+ }
265
+ }
266
+ render() {
267
+ var t, a, o, n, d, p, i, l;
268
+ const e = (this._defaultSlot.length === 0 || !((a = (t = this._defaultSlot[0]) == null ? void 0 : t.textContent) != null && a.trim())) && !this.label;
269
+ return y`
270
+ <div
271
+ id="root"
272
+ @mouseenter=${() => {
273
+ this.value && this._toggleClearButton(!0);
274
+ }}
275
+ @mouseleave=${() => {
276
+ this._toggleClearButton(!1);
277
+ }}
278
+ >
279
+ <label>
280
+ <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${e} id="label">
281
+ <slot>${this.label}</slot>
282
+ ${this.required ? T(this.requiredLabel) : null}
283
+ </div>
284
+ <div id="input">
285
+ <input
286
+ ?disabled=${this.disabled}
287
+ ?readonly=${this.readonly}
288
+ .value=${F(
289
+ this.range ? v((o = this.value) == null ? void 0 : o.split(",")[0]) : v(this.value)
290
+ )}
291
+ @blur=${this._handleBlur}
292
+ @click=${this._handleFocus}
293
+ @focus=${this._handleFocus}
294
+ @input=${this._handleInput}
295
+ @keydown=${this._handleKeyboardEvents}
296
+ aria-describedby=${u((n = this.hint) != null && n.trim() ? "hint" : g)}
297
+ aria-errormessage=${u((d = this.hint) != null && d.trim() ? "hint" : g)}
298
+ aria-invalid=${!!this.invalid}
299
+ autocomplete="off"
300
+ data-testid="field-input"
301
+ inputmode=${u(this.inputMode)}
302
+ maxlength="10"
303
+ name=${this.name ?? "calendar"}
304
+ placeholder=${u(this.placeholder)}
305
+ type="text"
306
+ />
307
+ ${this.range ? y`
308
+ <skf-icon name="arrowRight"></skf-icon>
309
+ <input
310
+ ?disabled=${this.disabled}
311
+ ?readonly=${this.readonly}
312
+ .value=${F(v((p = this.value) == null ? void 0 : p.split(",")[1]))}
313
+ @blur=${this._handleBlur}
314
+ @click=${this._handleFocus}
315
+ @focus=${this._handleFocus}
316
+ @input=${this._handleInput}
317
+ @keydown=${this._handleKeyboardEvents}
318
+ aria-describedby=${u((i = this.hint) != null && i.trim() ? "hint" : g)}
319
+ aria-errormessage=${u((l = this.hint) != null && l.trim() ? "hint" : g)}
320
+ aria-invalid=${!!this.invalid}
321
+ autocomplete="off"
322
+ data-testid="field-input-range-end"
323
+ inputmode=${u(this.inputMode)}
324
+ maxlength="10"
325
+ name=${(this.name ?? "calendar") + "-end"}
326
+ placeholder=${u(this.placeholder)}
327
+ type="text"
328
+ />
329
+ ` : g}
330
+ ${this.showClearbutton ? y`
331
+ <button
332
+ class="password skf-icon-host"
333
+ type="button"
334
+ @click=${this.clear.bind(this)}
335
+ >
336
+ <skf-icon name="close" size="sm"></skf-icon>
337
+ </button>
338
+ ` : y`
339
+ <button class="password skf-icon-host" type="button">
340
+ <skf-icon name="calendarMonth" size="sm"></skf-icon>
341
+ </button>
342
+ `}
343
+ </div>
344
+ </label>
345
+ ${this.hint && y`
346
+ <skf-hint
347
+ aria-live=${this.invalid ? "assertive" : "polite"}
348
+ id="hint"
349
+ severity=${u(O(this.invalid, this.severity))}
350
+ >${this.customInvalid ?? this.hint}
351
+ </skf-hint>
352
+ `}
353
+ </div>
354
+
355
+ <div id="popover" popover @close=${this._handleClose}>
356
+ <skf-datepicker-popup
357
+ ?range=${this.range}
358
+ id=${this.id}
359
+ invalid-dates=${u(this.invalidDates)}
360
+ selectable-from=${u(this.selectableFrom)}
361
+ selectable-to=${u(this.selectableTo)}
362
+ ></skf-datepicker-popup>
363
+ </div>
364
+ `;
365
+ }
366
+ };
367
+ _.styles = [B, A];
368
+ let s = _;
369
+ r([
370
+ h({ attribute: "custom-invalid", reflect: !0 })
371
+ ], s.prototype, "customInvalid", 1);
372
+ r([
373
+ h({ type: String })
374
+ ], s.prototype, "id", 2);
375
+ r([
376
+ h()
377
+ ], s.prototype, "label", 2);
378
+ r([
379
+ h({ type: Boolean, attribute: "hide-label" })
380
+ ], s.prototype, "hideLabel", 2);
381
+ r([
382
+ h()
383
+ ], s.prototype, "hint", 2);
384
+ r([
385
+ h({ attribute: "invalid-dates" })
386
+ ], s.prototype, "invalidDates", 2);
387
+ r([
388
+ h({ reflect: !0 })
389
+ ], s.prototype, "name", 2);
390
+ r([
391
+ h()
392
+ ], s.prototype, "placeholder", 2);
393
+ r([
394
+ h({ type: Boolean })
395
+ ], s.prototype, "range", 2);
396
+ r([
397
+ h({ type: Boolean })
398
+ ], s.prototype, "readonly", 2);
399
+ r([
400
+ h({ attribute: "required-label" })
401
+ ], s.prototype, "requiredLabel", 2);
402
+ r([
403
+ h({ attribute: "selectable-from" })
404
+ ], s.prototype, "selectableFrom", 2);
405
+ r([
406
+ h({ attribute: "selectable-to" })
407
+ ], s.prototype, "selectableTo", 2);
408
+ r([
409
+ h({ reflect: !0 })
410
+ ], s.prototype, "severity", 2);
411
+ r([
412
+ h({ reflect: !0 })
413
+ ], s.prototype, "size", 2);
414
+ r([
415
+ h({ type: String, attribute: "validate-on" })
416
+ ], s.prototype, "validateOn", 2);
417
+ r([
418
+ h()
419
+ ], s.prototype, "value", 2);
420
+ r([
421
+ $()
422
+ ], s.prototype, "_init_date", 2);
423
+ r([
424
+ h({ type: Boolean, reflect: !0 })
425
+ ], s.prototype, "invalid", 2);
426
+ r([
427
+ $()
428
+ ], s.prototype, "selectedRangeDates", 2);
429
+ r([
430
+ $()
431
+ ], s.prototype, "showClearbutton", 2);
432
+ r([
433
+ b("#popover")
434
+ ], s.prototype, "$popover", 2);
435
+ r([
436
+ b("#input")
437
+ ], s.prototype, "$anchor", 2);
438
+ r([
439
+ b('input[data-testid="field-input"]')
440
+ ], s.prototype, "$input", 2);
441
+ r([
442
+ b('input[data-testid="field-input-range-end"]')
443
+ ], s.prototype, "$input_range_end", 2);
444
+ r([
445
+ b("skf-datepicker-popup")
446
+ ], s.prototype, "$datepickerPopup", 2);
447
+ r([
448
+ x({ flatten: !0 })
449
+ ], s.prototype, "_defaultSlot", 2);
450
+ r([
451
+ M("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
452
+ ], s.prototype, "_handleValueChange", 1);
453
+ export {
454
+ s as SkfDatepicker
455
+ };
@@ -0,0 +1,8 @@
1
+ import { SkfDatepicker } from './datepicker.component.js';
2
+ export * from './datepicker.component.js';
3
+ export default SkfDatepicker;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-datepicker': SkfDatepicker;
7
+ }
8
+ }
@@ -0,0 +1,38 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * @param date - a date to format, defaults to yyyy-mm-dd
4
+ * @param locale
5
+ * @returns - a formatted date string
6
+ */
7
+ export declare function dateFormatter(date?: string | Date | null, locale?: string): string;
8
+ /**
9
+ * Questionable if this really works
10
+ *
11
+ * @param element - a popover element to check if it is open
12
+ * @returns - true if the popover is open, false otherwise
13
+ */
14
+ export declare const isPopoverOpen: (element: HTMLElement) => boolean;
15
+ /**
16
+ * @param func - a function to debounce
17
+ * @param delay - the delay in milliseconds to debounce the function
18
+ * @returns - a debounced function
19
+ */
20
+ export declare function debounce<T extends (...args: unknown[]) => void>(func: T, delay: number): (...args: Parameters<T>) => void;
21
+ /**
22
+ * Returns true if all given dates matches a least one of the given types.
23
+ *
24
+ * @param assertDate - dates to check if they match one valid date
25
+ * @returns - true if the date is a valid date, false otherwise
26
+ *
27
+ * @example - is('2021-01-01', new Date(), Temporal.PlainDate.from('2021-01-01')).dateISOPlainDate; // true
28
+ * @example - is('2021-01-01', new Date(), Temporal.PlainDate.from('2021-01-01')).dateISO; // false
29
+ */
30
+ export declare const is: (...assertDates: (Date | Temporal.PlainDate | string | null)[]) => {
31
+ date: () => boolean;
32
+ ISO: () => boolean;
33
+ plain: () => boolean;
34
+ dateISO: () => boolean;
35
+ datePlain: () => boolean;
36
+ dateISOPlain: () => boolean;
37
+ plainISO: () => boolean;
38
+ };
@@ -0,0 +1,31 @@
1
+ import { Temporal as u } from "@js-temporal/polyfill";
2
+ function l(n, e = "en-CA") {
3
+ return n ? (typeof n == "string" && (n = new Date(n)), n.toLocaleDateString(e)) : "";
4
+ }
5
+ const p = (n) => n.matches(":popover-open");
6
+ let i = null;
7
+ function a(n, e) {
8
+ return (...o) => {
9
+ i && clearTimeout(i), i = setTimeout(() => {
10
+ n(...o);
11
+ }, e);
12
+ };
13
+ }
14
+ const f = (...n) => {
15
+ const e = () => n.some((t) => t instanceof Date && !isNaN(t.valueOf())), o = () => n.some((t) => typeof t == "string" && /^\d{4}-\d{2}-\d{2}$/.test(t)), r = () => n.some((t) => t instanceof u.PlainDate);
16
+ return {
17
+ date: e,
18
+ ISO: o,
19
+ plain: r,
20
+ dateISO: () => e() || o(),
21
+ datePlain: () => e() || r(),
22
+ dateISOPlain: () => e() || o() || r(),
23
+ plainISO: () => r() || o()
24
+ };
25
+ };
26
+ export {
27
+ l as dateFormatter,
28
+ a as debounce,
29
+ f as is,
30
+ p as isPopoverOpen
31
+ };
@@ -0,0 +1,6 @@
1
+ import { SkfDatepicker as e } from "./datepicker.component.js";
2
+ e.define("skf-datepicker");
3
+ export {
4
+ e as SkfDatepicker,
5
+ e as default
6
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult[];
@@ -0,0 +1,18 @@
1
+ import o from "../../styles/form-field.styles.js";
2
+ import { visuallyHidden as r } from "../../styles/util.styles.js";
3
+ import { css as e } from "lit";
4
+ const m = [
5
+ r,
6
+ o,
7
+ e`
8
+ @layer components {
9
+ #popover {
10
+ border: none;
11
+ overflow: visible;
12
+ }
13
+ }
14
+ `
15
+ ];
16
+ export {
17
+ m as styles
18
+ };
@@ -4,28 +4,20 @@ import '../icon/icon.js';
4
4
  import { SkfElement } from '../../internal/components/skf-element';
5
5
  import { type CSSResultGroup } from 'lit';
6
6
  /**
7
- * TODO: Is modal the right name? Should it be "blocking" or "blocking-dialog"?
7
+ * The `<skf-dialog>` is a component that open up a dialog of type modal with the content provided. (MDN refrains from opening the dialog using the `open` attribute, however skf-dialog does not have that limitation)
8
8
  *
9
- * TBD: Should we inert the page behind the dialog? Maybe only if it is modal-dialog?
10
- *
11
- * TBD: Should we disable scrolling on the page behind the dialog? Maybe only if it is modal?
12
- */
13
- /**
14
- * The `<skf-dialog>` is a component that open up a dialog with the content provided
15
- *
16
- * @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
9
+ * @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/329940-dialogmodal) for design principles
17
10
  *
18
11
  * @slot - The dialog component's content
19
- * @slot heading - The dialog component's heading
20
12
  * @slot footer - The dialog component's buttons goes here
21
13
  *
22
- * @event skf-dialog-open - Fires when the dialog is opened (after transitioned in)
23
- * @event skf-dialog-close - Fires when the dialog is closed (before transitioned out)
24
- * @event close - Fires when the dialog is closed (after transitioned out)
25
- *
26
14
  * @cssproperty --skf-dialog-height - A custom height for the Dialog. Pass valid CSS **block-size** values
27
15
  * @cssproperty --skf-dialog-width - A custom width for the Dialog Pass valid CSS **inline-size** values
28
16
  *
17
+ * @event {CustomEvent} skf-dialog-opened - Fires when the dialog is opened (after transitioned in)
18
+ * @event {CustomEvent} skf-dialog-closing - Fires when the dialog is closing (before transitioned out)
19
+ * @event {CustomEvent} skf-dialog-closed - Fires when the dialog is closed (after transitioned out)
20
+ *
29
21
  * @tagname skf-dialog
30
22
  */
31
23
  export declare class SkfDialog extends SkfElement {
@@ -41,35 +33,33 @@ export declare class SkfDialog extends SkfElement {
41
33
  noCloseButton?: boolean | undefined;
42
34
  /** If defined, removes the inner padding */
43
35
  noPadding: boolean;
44
- open?: boolean | null;
45
- /** If provided, will run function on dialog close */
36
+ /** If true, indicates that the dialog is active and is available for interaction */
37
+ open: boolean;
38
+ /** @internal */
46
39
  onClose?: ((event: Event) => void) | null;
47
40
  /** @internal */
48
- $dialog: HTMLDialogElement;
41
+ renderFoot: boolean;
49
42
  /** @internal */
50
- footerEls?: HTMLElement[];
43
+ $dialog?: HTMLDialogElement;
51
44
  /** @internal */
52
- modal: boolean;
45
+ footerEls?: HTMLElement[];
53
46
  /** @internal */
54
- renderFoot: boolean;
55
- protected firstUpdated(): void;
56
47
  handleOpenChange(): void;
48
+ protected firstUpdated(): void;
49
+ /** @internal */
50
+ _handleBackdropClick: (event: MouseEvent) => void;
51
+ /** @internal */
52
+ _handleClose: (event: Event) => void;
57
53
  /** @internal */
58
- show: () => Promise<boolean>;
54
+ _handleKeyDown: (event: KeyboardEvent) => void;
59
55
  /** @internal */
60
56
  _transition(): {
61
57
  entry: () => Promise<unknown>;
62
58
  exit: () => Promise<unknown>;
63
59
  };
64
- /** @internal */
65
- _handleBackdropClick: (event: MouseEvent) => void;
66
- /** @internal */
67
- _handleClose: (event: Event) => void;
68
- /** @internal */
69
- get _isModal(): boolean;
70
60
  /** Method that opens the dialog in modal state */
71
- showModal: () => Promise<boolean>;
61
+ showModal(): Promise<boolean>;
72
62
  /** Method that closes the dialog */
73
- close: () => Promise<boolean | undefined>;
63
+ close(): Promise<boolean | undefined>;
74
64
  render(): import("lit").TemplateResult<1>;
75
65
  }