@govtechsg/sgds-web-component 3.0.0-rc.1 → 3.0.0-rc.2

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 (478) hide show
  1. package/README.md +5 -5
  2. package/base/button.js +1 -1
  3. package/base/form-control-element.d.ts +4 -11
  4. package/base/form-control-element.js +13 -23
  5. package/base/form-control-element.js.map +1 -1
  6. package/components/Accordion/accordion-item.js +1 -1
  7. package/components/Accordion/index.umd.js +7 -19
  8. package/components/Accordion/index.umd.js.map +1 -1
  9. package/components/Accordion/sgds-accordion-item.d.ts +3 -7
  10. package/components/Accordion/sgds-accordion-item.js +6 -18
  11. package/components/Accordion/sgds-accordion-item.js.map +1 -1
  12. package/components/ActionCard/index.umd.js +407 -329
  13. package/components/ActionCard/index.umd.js.map +1 -1
  14. package/components/Alert/alert.js +1 -1
  15. package/components/Alert/index.umd.js +553 -485
  16. package/components/Alert/index.umd.js.map +1 -1
  17. package/components/Alert/sgds-alert.d.ts +2 -2
  18. package/components/Alert/sgds-alert.js +6 -13
  19. package/components/Alert/sgds-alert.js.map +1 -1
  20. package/components/Badge/badge.js +1 -1
  21. package/components/Badge/index.umd.js +8 -9
  22. package/components/Badge/index.umd.js.map +1 -1
  23. package/components/Badge/sgds-badge.d.ts +4 -5
  24. package/components/Badge/sgds-badge.js +5 -6
  25. package/components/Badge/sgds-badge.js.map +1 -1
  26. package/components/Button/index.umd.js +8 -81
  27. package/components/Button/index.umd.js.map +1 -1
  28. package/components/Button/sgds-button.js +1 -1
  29. package/components/Button/sgds-button.js.map +1 -1
  30. package/components/Checkbox/checkbox.js +1 -1
  31. package/components/Checkbox/index.umd.js +541 -475
  32. package/components/Checkbox/index.umd.js.map +1 -1
  33. package/components/Checkbox/sgds-checkbox-group.d.ts +7 -1
  34. package/components/Checkbox/sgds-checkbox-group.js +15 -4
  35. package/components/Checkbox/sgds-checkbox-group.js.map +1 -1
  36. package/components/Checkbox/sgds-checkbox.d.ts +30 -21
  37. package/components/Checkbox/sgds-checkbox.js +77 -60
  38. package/components/Checkbox/sgds-checkbox.js.map +1 -1
  39. package/components/ComboBox/index.umd.js +385 -216
  40. package/components/ComboBox/index.umd.js.map +1 -1
  41. package/components/Datepicker/datepicker-input.d.ts +4 -2
  42. package/components/Datepicker/datepicker-input.js +24 -7
  43. package/components/Datepicker/datepicker-input.js.map +1 -1
  44. package/components/Datepicker/index.umd.js +433 -244
  45. package/components/Datepicker/index.umd.js.map +1 -1
  46. package/components/Datepicker/sgds-datepicker.d.ts +1 -1
  47. package/components/Datepicker/sgds-datepicker.js.map +1 -1
  48. package/components/Drawer/index.umd.js +2 -2
  49. package/components/Drawer/index.umd.js.map +1 -1
  50. package/components/Dropdown/index.umd.js +8 -81
  51. package/components/Dropdown/index.umd.js.map +1 -1
  52. package/components/FileUpload/file-upload.js +1 -1
  53. package/components/FileUpload/index.umd.js +579 -272
  54. package/components/FileUpload/index.umd.js.map +1 -1
  55. package/components/FileUpload/sgds-file-upload.d.ts +42 -30
  56. package/components/FileUpload/sgds-file-upload.js +147 -103
  57. package/components/FileUpload/sgds-file-upload.js.map +1 -1
  58. package/components/Footer/footer-item.js +6 -0
  59. package/components/Footer/footer-item.js.map +1 -0
  60. package/components/Footer/footer.js +1 -1
  61. package/components/Footer/index.d.ts +2 -0
  62. package/components/Footer/index.js +2 -0
  63. package/components/Footer/index.js.map +1 -1
  64. package/components/Footer/index.umd.js +93 -94
  65. package/components/Footer/index.umd.js.map +1 -1
  66. package/components/Footer/sgds-footer-item.d.ts +13 -0
  67. package/components/Footer/sgds-footer-item.js +27 -0
  68. package/components/Footer/sgds-footer-item.js.map +1 -0
  69. package/components/Footer/sgds-footer.d.ts +9 -30
  70. package/components/Footer/sgds-footer.js +65 -90
  71. package/components/Footer/sgds-footer.js.map +1 -1
  72. package/components/Icon/icon.js +6 -0
  73. package/components/Icon/icon.js.map +1 -0
  74. package/components/Icon/index.d.ts +6 -0
  75. package/components/Icon/index.js +4 -0
  76. package/components/Icon/index.js.map +1 -0
  77. package/components/Icon/index.umd.js +4389 -0
  78. package/components/Icon/index.umd.js.map +1 -0
  79. package/components/Icon/sgds-icon.d.ts +21 -0
  80. package/components/Icon/sgds-icon.js +64 -0
  81. package/components/Icon/sgds-icon.js.map +1 -0
  82. package/components/IconButton/icon-button.js +1 -1
  83. package/components/IconButton/index.umd.js +6 -9
  84. package/components/IconButton/index.umd.js.map +1 -1
  85. package/components/IconButton/sgds-icon-button.d.ts +2 -2
  86. package/components/IconButton/sgds-icon-button.js +4 -9
  87. package/components/IconButton/sgds-icon-button.js.map +1 -1
  88. package/components/Input/index.umd.js +1734 -1376
  89. package/components/Input/index.umd.js.map +1 -1
  90. package/components/Input/sgds-input.d.ts +41 -21
  91. package/components/Input/sgds-input.js +103 -66
  92. package/components/Input/sgds-input.js.map +1 -1
  93. package/components/Modal/index.umd.js +2 -2
  94. package/components/Modal/index.umd.js.map +1 -1
  95. package/components/QuantityToggle/index.umd.js +894 -316
  96. package/components/QuantityToggle/index.umd.js.map +1 -1
  97. package/components/QuantityToggle/sgds-quantity-toggle.d.ts +42 -15
  98. package/components/QuantityToggle/sgds-quantity-toggle.js +129 -62
  99. package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
  100. package/components/Radio/index.umd.js +516 -203
  101. package/components/Radio/index.umd.js.map +1 -1
  102. package/components/Radio/sgds-radio-group.d.ts +38 -27
  103. package/components/Radio/sgds-radio-group.js +100 -84
  104. package/components/Radio/sgds-radio-group.js.map +1 -1
  105. package/components/Radio/sgds-radio.js +1 -1
  106. package/components/Radio/sgds-radio.js.map +1 -1
  107. package/components/Stepper/index.umd.js +1 -0
  108. package/components/Stepper/index.umd.js.map +1 -1
  109. package/components/Stepper/sgds-stepper.d.ts +1 -0
  110. package/components/Stepper/sgds-stepper.js +1 -0
  111. package/components/Stepper/sgds-stepper.js.map +1 -1
  112. package/components/Switch/index.umd.js +21 -321
  113. package/components/Switch/index.umd.js.map +1 -1
  114. package/components/Switch/sgds-switch.js +1 -2
  115. package/components/Switch/sgds-switch.js.map +1 -1
  116. package/components/Textarea/index.umd.js +1554 -1336
  117. package/components/Textarea/index.umd.js.map +1 -1
  118. package/components/Textarea/sgds-textarea.d.ts +33 -22
  119. package/components/Textarea/sgds-textarea.js +78 -75
  120. package/components/Textarea/sgds-textarea.js.map +1 -1
  121. package/components/Textarea/textarea.js +1 -1
  122. package/components/Toast/index.umd.js +9 -21
  123. package/components/Toast/index.umd.js.map +1 -1
  124. package/components/Toast/sgds-toast.d.ts +2 -1
  125. package/components/Toast/sgds-toast.js +6 -18
  126. package/components/Toast/sgds-toast.js.map +1 -1
  127. package/components/Toast/toast.js +1 -1
  128. package/components/Tooltip/index.umd.js +14 -14
  129. package/components/Tooltip/index.umd.js.map +1 -1
  130. package/components/Tooltip/sgds-tooltip.d.ts +4 -7
  131. package/components/Tooltip/sgds-tooltip.js +14 -14
  132. package/components/Tooltip/sgds-tooltip.js.map +1 -1
  133. package/components/index.d.ts +1 -0
  134. package/components/index.js +1 -0
  135. package/components/index.js.map +1 -1
  136. package/components/index.umd.js +1318 -1124
  137. package/components/index.umd.js.map +1 -1
  138. package/icons/arrow-bar-down.svg +3 -0
  139. package/icons/arrow-bar-left.svg +3 -0
  140. package/icons/arrow-bar-right.svg +3 -0
  141. package/icons/arrow-bar-up.svg +3 -0
  142. package/icons/arrow-clockwise.svg +3 -0
  143. package/icons/arrow-down.svg +3 -0
  144. package/icons/arrow-left.svg +3 -0
  145. package/icons/arrow-repeat.svg +3 -0
  146. package/icons/arrow-right.svg +3 -0
  147. package/icons/arrow-up.svg +3 -0
  148. package/icons/bank-fill.svg +3 -0
  149. package/icons/bell-slash.svg +3 -0
  150. package/icons/bell.svg +3 -0
  151. package/icons/bi-funnel.svg +3 -0
  152. package/icons/bookmark-fill.svg +3 -0
  153. package/icons/bookmark.svg +3 -0
  154. package/icons/box-arrow-up-right.svg +3 -0
  155. package/icons/box-seam.svg +3 -0
  156. package/icons/building.svg +3 -0
  157. package/icons/calculator.svg +3 -0
  158. package/icons/calendar-check.svg +4 -0
  159. package/icons/calendar-x.svg +4 -0
  160. package/icons/calendar.svg +3 -0
  161. package/icons/camera.svg +3 -0
  162. package/icons/chat-left-text.svg +3 -0
  163. package/icons/check-circle-fill.svg +3 -0
  164. package/icons/check-circle.svg +3 -0
  165. package/icons/check.svg +3 -0
  166. package/icons/chevron-down.svg +3 -0
  167. package/icons/chevron-left.svg +3 -0
  168. package/icons/chevron-right.svg +3 -0
  169. package/icons/chevron-up .svg +3 -0
  170. package/icons/clock.svg +4 -0
  171. package/icons/cloud-check.svg +4 -0
  172. package/icons/cloud-download.svg +3 -0
  173. package/icons/cloud-upload.svg +3 -0
  174. package/icons/cloud.svg +3 -0
  175. package/icons/compass.svg +4 -0
  176. package/icons/cross.svg +3 -0
  177. package/icons/cursor-fill.svg +3 -0
  178. package/icons/cursor.svg +3 -0
  179. package/icons/dash-circle.svg +3 -0
  180. package/icons/dash-square.svg +3 -0
  181. package/icons/dash.svg +3 -0
  182. package/icons/download.svg +3 -0
  183. package/icons/exclamation-circle-fill.svg +3 -0
  184. package/icons/exclamation-circle.svg +4 -0
  185. package/icons/exclamation-triangle-fill.svg +3 -0
  186. package/icons/exclamation-triangle.svg +4 -0
  187. package/icons/exclamation.svg +4 -0
  188. package/icons/eye-fill.svg +3 -0
  189. package/icons/eye-slash-fill.svg +4 -0
  190. package/icons/eye-slash.svg +3 -0
  191. package/icons/eye.svg +3 -0
  192. package/icons/facebook.svg +3 -0
  193. package/icons/file-earmark-text.svg +3 -0
  194. package/icons/file-pdf.svg +4 -0
  195. package/icons/file-plus.svg +4 -0
  196. package/icons/file-text.svg +3 -0
  197. package/icons/file.svg +3 -0
  198. package/icons/files.svg +4 -0
  199. package/icons/folder-check.svg +4 -0
  200. package/icons/folder-minus.svg +4 -0
  201. package/icons/folder-plus.svg +4 -0
  202. package/icons/folder.svg +3 -0
  203. package/icons/gear.svg +3 -0
  204. package/icons/geo-alt.svg +4 -0
  205. package/icons/geo-fill.svg +4 -0
  206. package/icons/geo.svg +4 -0
  207. package/icons/google.svg +3 -0
  208. package/icons/grid-fill.svg +3 -0
  209. package/icons/hand-thumbs-down.svg +3 -0
  210. package/icons/hand-thumbs-up.svg +3 -0
  211. package/icons/hdd.svg +3 -0
  212. package/icons/house-door.svg +3 -0
  213. package/icons/house.svg +3 -0
  214. package/icons/image.svg +3 -0
  215. package/icons/inbox.svg +3 -0
  216. package/icons/info-circle-fill.svg +3 -0
  217. package/icons/info-circle.svg +4 -0
  218. package/icons/instagram.svg +3 -0
  219. package/icons/layers.svg +3 -0
  220. package/icons/layout-text-window-reverse.svg +3 -0
  221. package/icons/layout-text-window.svg +3 -0
  222. package/icons/layout.svg +3 -0
  223. package/icons/link.svg +3 -0
  224. package/icons/linkedin.svg +3 -0
  225. package/icons/list.svg +3 -0
  226. package/icons/lock-fill.svg +3 -0
  227. package/icons/lock.svg +3 -0
  228. package/icons/mail.svg +3 -0
  229. package/icons/map.svg +3 -0
  230. package/icons/paperclip.svg +3 -0
  231. package/icons/pencil.svg +3 -0
  232. package/icons/pending-circle.svg +3 -0
  233. package/icons/person-dash.svg +3 -0
  234. package/icons/person-plus.svg +3 -0
  235. package/icons/person-x.svg +3 -0
  236. package/icons/person.svg +3 -0
  237. package/icons/pin-map-fill.svg +3 -0
  238. package/icons/pin.svg +3 -0
  239. package/icons/placeholder.svg +3 -0
  240. package/icons/plus-circle.svg +3 -0
  241. package/icons/plus-square.svg +3 -0
  242. package/icons/plus.svg +3 -0
  243. package/icons/printer.svg +3 -0
  244. package/icons/question-circle.svg +4 -0
  245. package/icons/save.svg +3 -0
  246. package/icons/search.svg +3 -0
  247. package/icons/share.svg +3 -0
  248. package/icons/slash-circle.svg +3 -0
  249. package/icons/sliders.svg +3 -0
  250. package/icons/speedometer.svg +3 -0
  251. package/icons/star-fill.svg +3 -0
  252. package/icons/star.svg +3 -0
  253. package/icons/stoplights.svg +4 -0
  254. package/icons/telephone.svg +3 -0
  255. package/icons/three-dots-vertical.svg +3 -0
  256. package/icons/three-dots.svg +3 -0
  257. package/icons/toggle-off.svg +3 -0
  258. package/icons/toggle-on.svg +3 -0
  259. package/icons/trash.svg +3 -0
  260. package/icons/twitter-x.svg +3 -0
  261. package/icons/unlock.svg +3 -0
  262. package/icons/upload.svg +3 -0
  263. package/icons/window-dash.svg +4 -0
  264. package/icons/window-desktop.svg +4 -0
  265. package/icons/window-dock.svg +4 -0
  266. package/icons/window-fullscreen.svg +3 -0
  267. package/icons/window-plus.svg +4 -0
  268. package/icons/window-sidebar.svg +3 -0
  269. package/icons/window-split.svg +3 -0
  270. package/icons/window-stack.svg +3 -0
  271. package/icons/window-x.svg +4 -0
  272. package/icons/window.svg +3 -0
  273. package/icons/x-circle-fill.svg +3 -0
  274. package/icons/x-circle.svg +3 -0
  275. package/icons/youtube.svg +3 -0
  276. package/icons/zoom-in.svg +3 -0
  277. package/icons/zoom-out.svg +3 -0
  278. package/index.d.ts +1 -0
  279. package/index.js +1 -0
  280. package/index.js.map +1 -1
  281. package/index.umd.js +1338 -1119
  282. package/index.umd.js.map +1 -1
  283. package/internals/CloseButton/close-button.js +1 -1
  284. package/internals/CloseButton/sgds-close-button.js +1 -1
  285. package/internals/CloseButton/sgds-close-button.js.map +1 -1
  286. package/package.json +1 -1
  287. package/react/base/button.cjs.js +1 -1
  288. package/react/base/button.js +1 -1
  289. package/react/base/form-control-element.cjs.js +13 -23
  290. package/react/base/form-control-element.cjs.js.map +1 -1
  291. package/react/base/form-control-element.js +13 -23
  292. package/react/base/form-control-element.js.map +1 -1
  293. package/react/checkbox/index.cjs.js +2 -0
  294. package/react/checkbox/index.cjs.js.map +1 -1
  295. package/react/checkbox/index.d.ts +2 -0
  296. package/react/checkbox/index.js +2 -0
  297. package/react/checkbox/index.js.map +1 -1
  298. package/react/components/Accordion/accordion-item.cjs.js +1 -1
  299. package/react/components/Accordion/accordion-item.js +1 -1
  300. package/react/components/Accordion/sgds-accordion-item.cjs.js +6 -18
  301. package/react/components/Accordion/sgds-accordion-item.cjs.js.map +1 -1
  302. package/react/components/Accordion/sgds-accordion-item.js +6 -18
  303. package/react/components/Accordion/sgds-accordion-item.js.map +1 -1
  304. package/react/components/Alert/alert.cjs.js +1 -1
  305. package/react/components/Alert/alert.js +1 -1
  306. package/react/components/Alert/sgds-alert.cjs.js +5 -12
  307. package/react/components/Alert/sgds-alert.cjs.js.map +1 -1
  308. package/react/components/Alert/sgds-alert.js +6 -13
  309. package/react/components/Alert/sgds-alert.js.map +1 -1
  310. package/react/components/Badge/badge.cjs.js +1 -1
  311. package/react/components/Badge/badge.js +1 -1
  312. package/react/components/Badge/sgds-badge.cjs.js +5 -6
  313. package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
  314. package/react/components/Badge/sgds-badge.js +5 -6
  315. package/react/components/Badge/sgds-badge.js.map +1 -1
  316. package/react/components/Button/sgds-button.cjs.js +2 -2
  317. package/react/components/Button/sgds-button.cjs.js.map +1 -1
  318. package/react/components/Button/sgds-button.js +1 -1
  319. package/react/components/Button/sgds-button.js.map +1 -1
  320. package/react/components/Checkbox/checkbox.cjs.js +1 -1
  321. package/react/components/Checkbox/checkbox.js +1 -1
  322. package/react/components/Checkbox/sgds-checkbox-group.cjs.js +15 -4
  323. package/react/components/Checkbox/sgds-checkbox-group.cjs.js.map +1 -1
  324. package/react/components/Checkbox/sgds-checkbox-group.js +15 -4
  325. package/react/components/Checkbox/sgds-checkbox-group.js.map +1 -1
  326. package/react/components/Checkbox/sgds-checkbox.cjs.js +77 -60
  327. package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
  328. package/react/components/Checkbox/sgds-checkbox.js +77 -60
  329. package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
  330. package/react/components/Datepicker/datepicker-input.cjs.js +24 -7
  331. package/react/components/Datepicker/datepicker-input.cjs.js.map +1 -1
  332. package/react/components/Datepicker/datepicker-input.js +24 -7
  333. package/react/components/Datepicker/datepicker-input.js.map +1 -1
  334. package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
  335. package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
  336. package/react/components/FileUpload/file-upload.cjs.js +1 -1
  337. package/react/components/FileUpload/file-upload.js +1 -1
  338. package/react/components/FileUpload/sgds-file-upload.cjs.js +145 -101
  339. package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
  340. package/react/components/FileUpload/sgds-file-upload.js +147 -103
  341. package/react/components/FileUpload/sgds-file-upload.js.map +1 -1
  342. package/react/components/Footer/footer-item.cjs.js +11 -0
  343. package/react/components/Footer/footer-item.cjs.js.map +1 -0
  344. package/react/components/Footer/footer-item.js +7 -0
  345. package/react/components/Footer/footer-item.js.map +1 -0
  346. package/react/components/Footer/footer.cjs.js +1 -1
  347. package/react/components/Footer/footer.js +1 -1
  348. package/react/components/Footer/sgds-footer-item.cjs.js +33 -0
  349. package/react/components/Footer/sgds-footer-item.cjs.js.map +1 -0
  350. package/react/components/Footer/sgds-footer-item.js +28 -0
  351. package/react/components/Footer/sgds-footer-item.js.map +1 -0
  352. package/react/components/Footer/sgds-footer.cjs.js +65 -90
  353. package/react/components/Footer/sgds-footer.cjs.js.map +1 -1
  354. package/react/components/Footer/sgds-footer.js +65 -90
  355. package/react/components/Footer/sgds-footer.js.map +1 -1
  356. package/react/components/Icon/icon.cjs.js +11 -0
  357. package/react/components/Icon/icon.cjs.js.map +1 -0
  358. package/react/components/Icon/icon.js +7 -0
  359. package/react/components/Icon/icon.js.map +1 -0
  360. package/react/components/Icon/sgds-icon.cjs.js +70 -0
  361. package/react/components/Icon/sgds-icon.cjs.js.map +1 -0
  362. package/react/components/Icon/sgds-icon.js +65 -0
  363. package/react/components/Icon/sgds-icon.js.map +1 -0
  364. package/react/components/IconButton/icon-button.cjs.js +1 -1
  365. package/react/components/IconButton/icon-button.js +1 -1
  366. package/react/components/IconButton/sgds-icon-button.cjs.js +4 -9
  367. package/react/components/IconButton/sgds-icon-button.cjs.js.map +1 -1
  368. package/react/components/IconButton/sgds-icon-button.js +4 -9
  369. package/react/components/IconButton/sgds-icon-button.js.map +1 -1
  370. package/react/components/Input/sgds-input.cjs.js +101 -64
  371. package/react/components/Input/sgds-input.cjs.js.map +1 -1
  372. package/react/components/Input/sgds-input.js +103 -66
  373. package/react/components/Input/sgds-input.js.map +1 -1
  374. package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +128 -61
  375. package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
  376. package/react/components/QuantityToggle/sgds-quantity-toggle.js +129 -62
  377. package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
  378. package/react/components/Radio/sgds-radio-group.cjs.js +99 -83
  379. package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -1
  380. package/react/components/Radio/sgds-radio-group.js +100 -84
  381. package/react/components/Radio/sgds-radio-group.js.map +1 -1
  382. package/react/components/Radio/sgds-radio.cjs.js +1 -1
  383. package/react/components/Radio/sgds-radio.cjs.js.map +1 -1
  384. package/react/components/Radio/sgds-radio.js +1 -1
  385. package/react/components/Radio/sgds-radio.js.map +1 -1
  386. package/react/components/Stepper/sgds-stepper.cjs.js +1 -0
  387. package/react/components/Stepper/sgds-stepper.cjs.js.map +1 -1
  388. package/react/components/Stepper/sgds-stepper.js +1 -0
  389. package/react/components/Stepper/sgds-stepper.js.map +1 -1
  390. package/react/components/Switch/sgds-switch.cjs.js +1 -2
  391. package/react/components/Switch/sgds-switch.cjs.js.map +1 -1
  392. package/react/components/Switch/sgds-switch.js +1 -2
  393. package/react/components/Switch/sgds-switch.js.map +1 -1
  394. package/react/components/Textarea/sgds-textarea.cjs.js +76 -73
  395. package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -1
  396. package/react/components/Textarea/sgds-textarea.js +78 -75
  397. package/react/components/Textarea/sgds-textarea.js.map +1 -1
  398. package/react/components/Textarea/textarea.cjs.js +1 -1
  399. package/react/components/Textarea/textarea.js +1 -1
  400. package/react/components/Toast/sgds-toast.cjs.js +6 -18
  401. package/react/components/Toast/sgds-toast.cjs.js.map +1 -1
  402. package/react/components/Toast/sgds-toast.js +6 -18
  403. package/react/components/Toast/sgds-toast.js.map +1 -1
  404. package/react/components/Toast/toast.cjs.js +1 -1
  405. package/react/components/Toast/toast.js +1 -1
  406. package/react/components/Tooltip/sgds-tooltip.cjs.js +14 -14
  407. package/react/components/Tooltip/sgds-tooltip.cjs.js.map +1 -1
  408. package/react/components/Tooltip/sgds-tooltip.js +14 -14
  409. package/react/components/Tooltip/sgds-tooltip.js.map +1 -1
  410. package/react/footer-item/index.cjs.js +39 -0
  411. package/react/footer-item/index.cjs.js.map +1 -0
  412. package/react/footer-item/index.d.ts +3 -0
  413. package/react/footer-item/index.js +15 -0
  414. package/react/footer-item/index.js.map +1 -0
  415. package/react/icon/index.cjs.js +42 -0
  416. package/react/icon/index.cjs.js.map +1 -0
  417. package/react/icon/index.d.ts +6 -0
  418. package/react/icon/index.js +18 -0
  419. package/react/icon/index.js.map +1 -0
  420. package/react/index.cjs.js +64 -60
  421. package/react/index.cjs.js.map +1 -1
  422. package/react/index.d.ts +2 -0
  423. package/react/index.js +2 -0
  424. package/react/index.js.map +1 -1
  425. package/react/input/index.cjs.js +3 -1
  426. package/react/input/index.cjs.js.map +1 -1
  427. package/react/input/index.d.ts +2 -0
  428. package/react/input/index.js +3 -1
  429. package/react/input/index.js.map +1 -1
  430. package/react/internals/CloseButton/close-button.cjs.js +1 -1
  431. package/react/internals/CloseButton/close-button.js +1 -1
  432. package/react/internals/CloseButton/sgds-close-button.cjs.js +1 -1
  433. package/react/internals/CloseButton/sgds-close-button.cjs.js.map +1 -1
  434. package/react/internals/CloseButton/sgds-close-button.js +1 -1
  435. package/react/internals/CloseButton/sgds-close-button.js.map +1 -1
  436. package/react/styles/form-hint.cjs.js +1 -1
  437. package/react/styles/form-hint.js +1 -1
  438. package/react/styles/form-label.cjs.js +1 -1
  439. package/react/styles/form-label.js +1 -1
  440. package/react/utils/formSubmitController.cjs.js +64 -0
  441. package/react/utils/formSubmitController.cjs.js.map +1 -0
  442. package/react/utils/formSubmitController.js +60 -0
  443. package/react/utils/formSubmitController.js.map +1 -0
  444. package/react/utils/inputValidationController.cjs.js +130 -0
  445. package/react/utils/inputValidationController.cjs.js.map +1 -0
  446. package/react/utils/inputValidationController.js +126 -0
  447. package/react/utils/inputValidationController.js.map +1 -0
  448. package/react/utils/validatorMixin.cjs.js +108 -0
  449. package/react/utils/validatorMixin.cjs.js.map +1 -0
  450. package/react/utils/validatorMixin.js +104 -0
  451. package/react/utils/validatorMixin.js.map +1 -0
  452. package/styles/form-hint.js +1 -1
  453. package/styles/form-label.js +1 -1
  454. package/themes/day.css +1 -1
  455. package/themes/night.css +3 -2
  456. package/themes/root.css +1 -0
  457. package/utils/{form.d.ts → formSubmitController.d.ts} +10 -20
  458. package/utils/formSubmitController.js +59 -0
  459. package/utils/formSubmitController.js.map +1 -0
  460. package/utils/inputValidationController.d.ts +70 -0
  461. package/utils/inputValidationController.js +125 -0
  462. package/utils/inputValidationController.js.map +1 -0
  463. package/utils/validatorMixin.d.ts +24 -0
  464. package/utils/validatorMixin.js +103 -0
  465. package/utils/validatorMixin.js.map +1 -0
  466. package/base/form-check-element.d.ts +0 -50
  467. package/base/form-check-element.js +0 -169
  468. package/base/form-check-element.js.map +0 -1
  469. package/react/base/form-check-element.cjs.js +0 -175
  470. package/react/base/form-check-element.cjs.js.map +0 -1
  471. package/react/base/form-check-element.js +0 -170
  472. package/react/base/form-check-element.js.map +0 -1
  473. package/react/utils/form.cjs.js +0 -137
  474. package/react/utils/form.cjs.js.map +0 -1
  475. package/react/utils/form.js +0 -133
  476. package/react/utils/form.js.map +0 -1
  477. package/utils/form.js +0 -132
  478. package/utils/form.js.map +0 -1
@@ -12,37 +12,19 @@ var footer = require('./footer.cjs.js');
12
12
  /**
13
13
  * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.
14
14
  *
15
- * @csspart footer-top - The component's footer-top section container.
16
- * @csspart footer-bottom - The component's footer-bottom section container.
15
+ * @slot title - The slot for title
16
+ * @slot description - The slot for description
17
+ * @slot items - The slot for the list of footer items
18
+ * @slot social-media - The slot for the list of social media with icons
17
19
  *
18
- * @cssproperty footer-top - The component's footer-top section container.
19
- * @cssproperty footer-bottom - The component's footer-bottom section container.
20
20
  */
21
21
  class SgdsFooter extends sgdsElement["default"] {
22
22
  constructor() {
23
23
  super(...arguments);
24
- /**
25
- * Sets title of SgdsFooter
26
- */
27
- this.title = "";
28
- /**
29
- * Sets description of SgdsFooter
30
- */
31
- this.description = "";
32
24
  /**
33
25
  * Sets copyrightLiner of SgdsFooter
34
26
  */
35
27
  this.copyrightLiner = "Government of Singapore";
36
- /**
37
- * Array of type
38
- *
39
- * `interface ColumnLinks { title: string; links : Links[] } interface Links { href: string; label: string; }`
40
- */
41
- this.links = [];
42
- /**
43
- * String date for last updated date
44
- */
45
- this.lastUpdatedDate = "";
46
28
  /**
47
29
  * href link for contacts
48
30
  */
@@ -51,6 +33,10 @@ class SgdsFooter extends sgdsElement["default"] {
51
33
  * href link for feedback
52
34
  */
53
35
  this.feedbackHref = "#";
36
+ /**
37
+ * href link for faq
38
+ */
39
+ this.faqHref = "#";
54
40
  /**
55
41
  * href link for privacy statement
56
42
  */
@@ -60,64 +46,64 @@ class SgdsFooter extends sgdsElement["default"] {
60
46
  */
61
47
  this.termsOfUseHref = "#";
62
48
  }
49
+ firstUpdated() {
50
+ const socialMediaSlot = this.shadowRoot.querySelector("slot[name='social-media']");
51
+ const footerTitleSlot = this.shadowRoot.querySelector("slot[name='title']");
52
+ const footerDescriptionSlot = this.shadowRoot.querySelector("slot[name='description']");
53
+ const footerItemsSlot = this.shadowRoot.querySelector("slot[name='items']");
54
+ const socialMediaChildNodes = socialMediaSlot.assignedNodes({ flatten: true });
55
+ const footerTitleChildNodes = footerTitleSlot.assignedNodes({ flatten: true });
56
+ const footerDescriptionChildNodes = footerDescriptionSlot.assignedNodes({ flatten: true });
57
+ const footerItemsChildNodes = footerItemsSlot.assignedNodes({ flatten: true });
58
+ if (socialMediaChildNodes.length === 0) {
59
+ const socialMediaContainer = this.shadowRoot.querySelector(".social-media");
60
+ socialMediaContainer.style.display = "none";
61
+ }
62
+ if (footerTitleChildNodes.length === 0 && footerDescriptionChildNodes.length === 0) {
63
+ const footerHeaderContainer = this.shadowRoot.querySelector(".footer-header");
64
+ footerHeaderContainer.style.display = "none";
65
+ }
66
+ if (footerItemsChildNodes.length === 0) {
67
+ const footerItemsContainer = this.shadowRoot.querySelector(".footer-items");
68
+ footerItemsContainer.style.display = "none";
69
+ }
70
+ if (footerTitleChildNodes.length === 0 &&
71
+ footerDescriptionChildNodes.length === 0 &&
72
+ footerItemsChildNodes.length === 0) {
73
+ const footerTopContainer = this.shadowRoot.querySelector(".footer-top");
74
+ footerTopContainer.style.display = "none";
75
+ }
76
+ }
63
77
  render() {
64
- // if description is defined
65
- const hasDescription = lit.html ` <div class="description">${this.description}</div>`;
66
78
  return lit.html `
67
- <footer class="sgds footer">
68
- <section class="footer-top" part="footer-top">
69
- <div class="container-fluid">
70
- <div class="row footer-header">
71
- <div class="col col-lg-6 col-md-12">
72
- <div class="title">${this.title ? this.title : "Footer title"}</div>
73
- ${this.description ? hasDescription : undefined}
74
- </div>
75
- </div>
76
- <div class="row footer-items">
77
- ${this.links.map((item) => lit.html `
78
- <div class="col-xxl-2 col-md-4 mb-3">
79
- <div class="title">${item.title}</div>
80
- <ul class="links">
81
- ${item.links.map((link) => lit.html ` <li><a href=${link.href}>${link.label}</a></li> `)}
82
- </ul>
83
- </div>
84
- `)}
85
- </div>
86
- <div class="row footer-contact-links">
87
- <div class="col">
88
- <div class="d-flex justify-content-lg-end">
89
- <ul>
90
- <li><a href=${this.contactHref}>Contact</a></li>
91
- <li><a href=${this.feedbackHref}>Feedback</a></li>
92
- </ul>
93
- </div>
94
- </div>
95
- </div>
79
+ <footer class="footer">
80
+ <section class="footer-top">
81
+ <div class="footer-header">
82
+ <slot name="title"></slot>
83
+ <slot name="description"></slot>
84
+ </div>
85
+ <div class="footer-items">
86
+ <slot name="items"></slot>
96
87
  </div>
97
88
  </section>
98
- <section class="footer-bottom" part="footer-bottom">
99
- <div class="container-fluid">
100
- <div class="row footer-mandatory-links">
101
- <div class="col">
102
- <ul>
103
- <li>
104
- <a href="https://tech.gov.sg/report_vulnerability" target="_blank" rel="noopener noreferrer"
105
- >Report Vulnerability</a
106
- >
107
- </li>
108
- <li><a href=${this.privacyHref}>Privacy Statement</a></li>
109
- <li><a href=${this.termsOfUseHref}>Terms of use</a></li>
110
- </ul>
111
- </div>
112
- </div>
113
- <div class="row footer-copyrights">
114
- <div class="col">
115
- <div class="d-flex justify-content-lg-end text-end">
116
- © ${new Date().getFullYear()} ${this.copyrightLiner}<br />
117
- Last Updated ${this.lastUpdatedDate}
118
- </div>
119
- </div>
120
- </div>
89
+ <section class="footer-bottom">
90
+ <div class="social-media">
91
+ <slot name="social-media"></slot>
92
+ </div>
93
+ <div class="footer-mandatory-links">
94
+ <ul>
95
+ <li><a href=${this.contactHref}>Contact</a></li>
96
+ <li><a href=${this.feedbackHref}>Feedback</a></li>
97
+ <li><a href=${this.faqHref}>FAQ</a></li>
98
+ <li>
99
+ <a href="https://tech.gov.sg/report_vulnerability" target="_blank" rel="noopener noreferrer">
100
+ Report Vulnerability
101
+ </a>
102
+ </li>
103
+ <li><a href=${this.privacyHref}>Privacy Statement</a></li>
104
+ <li><a href=${this.termsOfUseHref}>Terms of use</a></li>
105
+ </ul>
106
+ <div class="footer-copyrights">© ${new Date().getFullYear()}, ${this.copyrightLiner}</div>
121
107
  </div>
122
108
  </section>
123
109
  </footer>
@@ -125,29 +111,18 @@ class SgdsFooter extends sgdsElement["default"] {
125
111
  }
126
112
  }
127
113
  SgdsFooter.styles = [...sgdsElement["default"].styles, footer["default"]];
128
- tslib.__decorate([
129
- decorators_js.property({ type: String })
130
- ], SgdsFooter.prototype, "title", void 0);
131
- tslib.__decorate([
132
- decorators_js.property({ type: String })
133
- ], SgdsFooter.prototype, "description", void 0);
134
114
  tslib.__decorate([
135
115
  decorators_js.property({ type: String })
136
116
  ], SgdsFooter.prototype, "copyrightLiner", void 0);
137
- tslib.__decorate([
138
- decorators_js.property({
139
- type: Array
140
- })
141
- ], SgdsFooter.prototype, "links", void 0);
142
- tslib.__decorate([
143
- decorators_js.property({ type: String })
144
- ], SgdsFooter.prototype, "lastUpdatedDate", void 0);
145
117
  tslib.__decorate([
146
118
  decorators_js.property({ type: String })
147
119
  ], SgdsFooter.prototype, "contactHref", void 0);
148
120
  tslib.__decorate([
149
121
  decorators_js.property({ type: String })
150
122
  ], SgdsFooter.prototype, "feedbackHref", void 0);
123
+ tslib.__decorate([
124
+ decorators_js.property({ type: String })
125
+ ], SgdsFooter.prototype, "faqHref", void 0);
151
126
  tslib.__decorate([
152
127
  decorators_js.property({ type: String })
153
128
  ], SgdsFooter.prototype, "privacyHref", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-footer.cjs.js","sources":["../../../../src/components/Footer/sgds-footer.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport footerStyle from \"./footer.css\";\nexport interface ColumnLinks {\n title: string;\n links: Links[];\n}\nexport interface Links {\n href: string;\n label: string;\n}\n\n/**\n * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.\n *\n * @csspart footer-top - The component's footer-top section container.\n * @csspart footer-bottom - The component's footer-bottom section container.\n *\n * @cssproperty footer-top - The component's footer-top section container.\n * @cssproperty footer-bottom - The component's footer-bottom section container.\n */\nexport class SgdsFooter extends SgdsElement {\n static styles = [...SgdsElement.styles, footerStyle];\n\n /**\n * \tSets title of SgdsFooter\n */\n @property({ type: String })\n title = \"\";\n\n /**\n * \tSets description of SgdsFooter\n */\n @property({ type: String })\n description = \"\";\n\n /**\n * \tSets copyrightLiner of SgdsFooter\n */\n @property({ type: String })\n copyrightLiner = \"Government of Singapore\";\n\n /**\n * Array of type\n *\n * `interface ColumnLinks { title: string; links : Links[] } interface Links { href: string; label: string; }`\n */\n @property({\n type: Array\n })\n links: ColumnLinks[] = [];\n\n /**\n * String date for last updated date\n */\n @property({ type: String })\n lastUpdatedDate = \"\";\n\n /**\n * \thref link for contacts\n */\n @property({ type: String })\n contactHref = \"#\";\n\n /**\n * \thref link for feedback\n */\n @property({ type: String })\n feedbackHref = \"#\";\n\n /**\n * \thref link for privacy statement\n */\n @property({ type: String })\n privacyHref = \"#\";\n\n /**\n * \thref link for terms of use\n */\n @property({ type: String })\n termsOfUseHref = \"#\";\n\n render() {\n // if description is defined\n const hasDescription = html` <div class=\"description\">${this.description}</div>`;\n\n return html`\n <footer class=\"sgds footer\">\n <section class=\"footer-top\" part=\"footer-top\">\n <div class=\"container-fluid\">\n <div class=\"row footer-header\">\n <div class=\"col col-lg-6 col-md-12\">\n <div class=\"title\">${this.title ? this.title : \"Footer title\"}</div>\n ${this.description ? hasDescription : undefined}\n </div>\n </div>\n <div class=\"row footer-items\">\n ${this.links.map(\n (item: ColumnLinks) =>\n html`\n <div class=\"col-xxl-2 col-md-4 mb-3\">\n <div class=\"title\">${item.title}</div>\n <ul class=\"links\">\n ${item.links.map((link: Links) => html` <li><a href=${link.href}>${link.label}</a></li> `)}\n </ul>\n </div>\n `\n )}\n </div>\n <div class=\"row footer-contact-links\">\n <div class=\"col\">\n <div class=\"d-flex justify-content-lg-end\">\n <ul>\n <li><a href=${this.contactHref}>Contact</a></li>\n <li><a href=${this.feedbackHref}>Feedback</a></li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </section>\n <section class=\"footer-bottom\" part=\"footer-bottom\">\n <div class=\"container-fluid\">\n <div class=\"row footer-mandatory-links\">\n <div class=\"col\">\n <ul>\n <li>\n <a href=\"https://tech.gov.sg/report_vulnerability\" target=\"_blank\" rel=\"noopener noreferrer\"\n >Report Vulnerability</a\n >\n </li>\n <li><a href=${this.privacyHref}>Privacy Statement</a></li>\n <li><a href=${this.termsOfUseHref}>Terms of use</a></li>\n </ul>\n </div>\n </div>\n <div class=\"row footer-copyrights\">\n <div class=\"col\">\n <div class=\"d-flex justify-content-lg-end text-end\">\n © ${new Date().getFullYear()} ${this.copyrightLiner}<br />\n Last Updated ${this.lastUpdatedDate}\n </div>\n </div>\n </div>\n </div>\n </section>\n </footer>\n `;\n }\n}\n\nexport default SgdsFooter;\n"],"names":["SgdsElement","html","footerStyle","__decorate","property"],"mappings":";;;;;;;;;;;AAaA;;;;;;;;AAQG;AACG,MAAO,UAAW,SAAQA,sBAAW,CAAA;AAA3C,IAAA,WAAA,GAAA;;AAGE;;AAEG;QAEH,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;AAEX;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,EAAE,CAAC;AAEjB;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,yBAAyB,CAAC;AAE3C;;;;AAIG;QAIH,IAAK,CAAA,KAAA,GAAkB,EAAE,CAAC;AAE1B;;AAEG;QAEH,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;AAErB;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;;AAEG;QAEH,IAAY,CAAA,YAAA,GAAG,GAAG,CAAC;AAEnB;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,GAAG,CAAC;KAqEtB;IAnEC,MAAM,GAAA;;QAEJ,MAAM,cAAc,GAAGC,QAAI,CAAA,6BAA6B,IAAI,CAAC,WAAW,CAAA,MAAA,CAAQ,CAAC;AAEjF,QAAA,OAAOA,QAAI,CAAA,CAAA;;;;;;qCAMsB,IAAI,CAAC,KAAK,GAAG,IAA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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAU3CD,gBAAA,CAAA;AAHC,IAAAC,sBAAQ,CAAC;AACR,QAAA,IAAI,EAAE,KAAK;KACZ,CAAC;AACwB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAM1BD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACN,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMrBD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACT,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlBD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACR,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMnBD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACT,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlBD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACN,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
1
+ {"version":3,"file":"sgds-footer.cjs.js","sources":["../../../../src/components/Footer/sgds-footer.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport footerStyle from \"./footer.css\";\n\n/**\n * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.\n *\n * @slot title - The slot for title\n * @slot description - The slot for description\n * @slot items - The slot for the list of footer items\n * @slot social-media - The slot for the list of social media with icons\n *\n */\nexport class SgdsFooter extends SgdsElement {\n static styles = [...SgdsElement.styles, footerStyle];\n\n /**\n * \tSets copyrightLiner of SgdsFooter\n */\n @property({ type: String })\n copyrightLiner = \"Government of Singapore\";\n\n /**\n * \thref link for contacts\n */\n @property({ type: String })\n contactHref = \"#\";\n\n /**\n * \thref link for feedback\n */\n @property({ type: String })\n feedbackHref = \"#\";\n\n /**\n * \thref link for faq\n */\n @property({ type: String })\n faqHref = \"#\";\n\n /**\n * \thref link for privacy statement\n */\n @property({ type: String })\n privacyHref = \"#\";\n\n /**\n * \thref link for terms of use\n */\n @property({ type: String })\n termsOfUseHref = \"#\";\n\n firstUpdated() {\n const socialMediaSlot = this.shadowRoot.querySelector(\"slot[name='social-media']\") as HTMLSlotElement;\n const footerTitleSlot = this.shadowRoot.querySelector(\"slot[name='title']\") as HTMLSlotElement;\n const footerDescriptionSlot = this.shadowRoot.querySelector(\"slot[name='description']\") as HTMLSlotElement;\n const footerItemsSlot = this.shadowRoot.querySelector(\"slot[name='items']\") as HTMLSlotElement;\n const socialMediaChildNodes = socialMediaSlot.assignedNodes({ flatten: true });\n const footerTitleChildNodes = footerTitleSlot.assignedNodes({ flatten: true });\n const footerDescriptionChildNodes = footerDescriptionSlot.assignedNodes({ flatten: true });\n const footerItemsChildNodes = footerItemsSlot.assignedNodes({ flatten: true });\n if (socialMediaChildNodes.length === 0) {\n const socialMediaContainer = this.shadowRoot.querySelector(\".social-media\") as HTMLDivElement;\n socialMediaContainer.style.display = \"none\";\n }\n\n if (footerTitleChildNodes.length === 0 && footerDescriptionChildNodes.length === 0) {\n const footerHeaderContainer = this.shadowRoot.querySelector(\".footer-header\") as HTMLDivElement;\n footerHeaderContainer.style.display = \"none\";\n }\n\n if (footerItemsChildNodes.length === 0) {\n const footerItemsContainer = this.shadowRoot.querySelector(\".footer-items\") as HTMLDivElement;\n footerItemsContainer.style.display = \"none\";\n }\n\n if (\n footerTitleChildNodes.length === 0 &&\n footerDescriptionChildNodes.length === 0 &&\n footerItemsChildNodes.length === 0\n ) {\n const footerTopContainer = this.shadowRoot.querySelector(\".footer-top\") as HTMLDivElement;\n footerTopContainer.style.display = \"none\";\n }\n }\n\n render() {\n return html`\n <footer class=\"footer\">\n <section class=\"footer-top\">\n <div class=\"footer-header\">\n <slot name=\"title\"></slot>\n <slot name=\"description\"></slot>\n </div>\n <div class=\"footer-items\">\n <slot name=\"items\"></slot>\n </div>\n </section>\n <section class=\"footer-bottom\">\n <div class=\"social-media\">\n <slot name=\"social-media\"></slot>\n </div>\n <div class=\"footer-mandatory-links\">\n <ul>\n <li><a href=${this.contactHref}>Contact</a></li>\n <li><a href=${this.feedbackHref}>Feedback</a></li>\n <li><a href=${this.faqHref}>FAQ</a></li>\n <li>\n <a href=\"https://tech.gov.sg/report_vulnerability\" target=\"_blank\" rel=\"noopener noreferrer\">\n Report Vulnerability\n </a>\n </li>\n <li><a href=${this.privacyHref}>Privacy Statement</a></li>\n <li><a href=${this.termsOfUseHref}>Terms of use</a></li>\n </ul>\n <div class=\"footer-copyrights\" ${new Date().getFullYear()}, ${this.copyrightLiner}</div>\n </div>\n </section>\n </footer>\n `;\n }\n}\n\nexport default SgdsFooter;\n"],"names":["SgdsElement","html","footerStyle","__decorate","property"],"mappings":";;;;;;;;;;;AAKA;;;;;;;;AAQG;AACG,MAAO,UAAW,SAAQA,sBAAW,CAAA;AAA3C,IAAA,WAAA,GAAA;;AAGE;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,yBAAyB,CAAC;AAE3C;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;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AAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAM3CD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACT,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlBD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACR,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMnBD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACb,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMdD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACT,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlBD,gBAAA,CAAA;AADC,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACN,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
@@ -8,37 +8,19 @@ import css_248z from './footer.js';
8
8
  /**
9
9
  * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.
10
10
  *
11
- * @csspart footer-top - The component's footer-top section container.
12
- * @csspart footer-bottom - The component's footer-bottom section container.
11
+ * @slot title - The slot for title
12
+ * @slot description - The slot for description
13
+ * @slot items - The slot for the list of footer items
14
+ * @slot social-media - The slot for the list of social media with icons
13
15
  *
14
- * @cssproperty footer-top - The component's footer-top section container.
15
- * @cssproperty footer-bottom - The component's footer-bottom section container.
16
16
  */
17
17
  class SgdsFooter extends SgdsElement {
18
18
  constructor() {
19
19
  super(...arguments);
20
- /**
21
- * Sets title of SgdsFooter
22
- */
23
- this.title = "";
24
- /**
25
- * Sets description of SgdsFooter
26
- */
27
- this.description = "";
28
20
  /**
29
21
  * Sets copyrightLiner of SgdsFooter
30
22
  */
31
23
  this.copyrightLiner = "Government of Singapore";
32
- /**
33
- * Array of type
34
- *
35
- * `interface ColumnLinks { title: string; links : Links[] } interface Links { href: string; label: string; }`
36
- */
37
- this.links = [];
38
- /**
39
- * String date for last updated date
40
- */
41
- this.lastUpdatedDate = "";
42
24
  /**
43
25
  * href link for contacts
44
26
  */
@@ -47,6 +29,10 @@ class SgdsFooter extends SgdsElement {
47
29
  * href link for feedback
48
30
  */
49
31
  this.feedbackHref = "#";
32
+ /**
33
+ * href link for faq
34
+ */
35
+ this.faqHref = "#";
50
36
  /**
51
37
  * href link for privacy statement
52
38
  */
@@ -56,64 +42,64 @@ class SgdsFooter extends SgdsElement {
56
42
  */
57
43
  this.termsOfUseHref = "#";
58
44
  }
45
+ firstUpdated() {
46
+ const socialMediaSlot = this.shadowRoot.querySelector("slot[name='social-media']");
47
+ const footerTitleSlot = this.shadowRoot.querySelector("slot[name='title']");
48
+ const footerDescriptionSlot = this.shadowRoot.querySelector("slot[name='description']");
49
+ const footerItemsSlot = this.shadowRoot.querySelector("slot[name='items']");
50
+ const socialMediaChildNodes = socialMediaSlot.assignedNodes({ flatten: true });
51
+ const footerTitleChildNodes = footerTitleSlot.assignedNodes({ flatten: true });
52
+ const footerDescriptionChildNodes = footerDescriptionSlot.assignedNodes({ flatten: true });
53
+ const footerItemsChildNodes = footerItemsSlot.assignedNodes({ flatten: true });
54
+ if (socialMediaChildNodes.length === 0) {
55
+ const socialMediaContainer = this.shadowRoot.querySelector(".social-media");
56
+ socialMediaContainer.style.display = "none";
57
+ }
58
+ if (footerTitleChildNodes.length === 0 && footerDescriptionChildNodes.length === 0) {
59
+ const footerHeaderContainer = this.shadowRoot.querySelector(".footer-header");
60
+ footerHeaderContainer.style.display = "none";
61
+ }
62
+ if (footerItemsChildNodes.length === 0) {
63
+ const footerItemsContainer = this.shadowRoot.querySelector(".footer-items");
64
+ footerItemsContainer.style.display = "none";
65
+ }
66
+ if (footerTitleChildNodes.length === 0 &&
67
+ footerDescriptionChildNodes.length === 0 &&
68
+ footerItemsChildNodes.length === 0) {
69
+ const footerTopContainer = this.shadowRoot.querySelector(".footer-top");
70
+ footerTopContainer.style.display = "none";
71
+ }
72
+ }
59
73
  render() {
60
- // if description is defined
61
- const hasDescription = html ` <div class="description">${this.description}</div>`;
62
74
  return html `
63
- <footer class="sgds footer">
64
- <section class="footer-top" part="footer-top">
65
- <div class="container-fluid">
66
- <div class="row footer-header">
67
- <div class="col col-lg-6 col-md-12">
68
- <div class="title">${this.title ? this.title : "Footer title"}</div>
69
- ${this.description ? hasDescription : undefined}
70
- </div>
71
- </div>
72
- <div class="row footer-items">
73
- ${this.links.map((item) => html `
74
- <div class="col-xxl-2 col-md-4 mb-3">
75
- <div class="title">${item.title}</div>
76
- <ul class="links">
77
- ${item.links.map((link) => html ` <li><a href=${link.href}>${link.label}</a></li> `)}
78
- </ul>
79
- </div>
80
- `)}
81
- </div>
82
- <div class="row footer-contact-links">
83
- <div class="col">
84
- <div class="d-flex justify-content-lg-end">
85
- <ul>
86
- <li><a href=${this.contactHref}>Contact</a></li>
87
- <li><a href=${this.feedbackHref}>Feedback</a></li>
88
- </ul>
89
- </div>
90
- </div>
91
- </div>
75
+ <footer class="footer">
76
+ <section class="footer-top">
77
+ <div class="footer-header">
78
+ <slot name="title"></slot>
79
+ <slot name="description"></slot>
80
+ </div>
81
+ <div class="footer-items">
82
+ <slot name="items"></slot>
92
83
  </div>
93
84
  </section>
94
- <section class="footer-bottom" part="footer-bottom">
95
- <div class="container-fluid">
96
- <div class="row footer-mandatory-links">
97
- <div class="col">
98
- <ul>
99
- <li>
100
- <a href="https://tech.gov.sg/report_vulnerability" target="_blank" rel="noopener noreferrer"
101
- >Report Vulnerability</a
102
- >
103
- </li>
104
- <li><a href=${this.privacyHref}>Privacy Statement</a></li>
105
- <li><a href=${this.termsOfUseHref}>Terms of use</a></li>
106
- </ul>
107
- </div>
108
- </div>
109
- <div class="row footer-copyrights">
110
- <div class="col">
111
- <div class="d-flex justify-content-lg-end text-end">
112
- © ${new Date().getFullYear()} ${this.copyrightLiner}<br />
113
- Last Updated ${this.lastUpdatedDate}
114
- </div>
115
- </div>
116
- </div>
85
+ <section class="footer-bottom">
86
+ <div class="social-media">
87
+ <slot name="social-media"></slot>
88
+ </div>
89
+ <div class="footer-mandatory-links">
90
+ <ul>
91
+ <li><a href=${this.contactHref}>Contact</a></li>
92
+ <li><a href=${this.feedbackHref}>Feedback</a></li>
93
+ <li><a href=${this.faqHref}>FAQ</a></li>
94
+ <li>
95
+ <a href="https://tech.gov.sg/report_vulnerability" target="_blank" rel="noopener noreferrer">
96
+ Report Vulnerability
97
+ </a>
98
+ </li>
99
+ <li><a href=${this.privacyHref}>Privacy Statement</a></li>
100
+ <li><a href=${this.termsOfUseHref}>Terms of use</a></li>
101
+ </ul>
102
+ <div class="footer-copyrights">© ${new Date().getFullYear()}, ${this.copyrightLiner}</div>
117
103
  </div>
118
104
  </section>
119
105
  </footer>
@@ -121,29 +107,18 @@ class SgdsFooter extends SgdsElement {
121
107
  }
122
108
  }
123
109
  SgdsFooter.styles = [...SgdsElement.styles, css_248z];
124
- __decorate([
125
- property({ type: String })
126
- ], SgdsFooter.prototype, "title", void 0);
127
- __decorate([
128
- property({ type: String })
129
- ], SgdsFooter.prototype, "description", void 0);
130
110
  __decorate([
131
111
  property({ type: String })
132
112
  ], SgdsFooter.prototype, "copyrightLiner", void 0);
133
- __decorate([
134
- property({
135
- type: Array
136
- })
137
- ], SgdsFooter.prototype, "links", void 0);
138
- __decorate([
139
- property({ type: String })
140
- ], SgdsFooter.prototype, "lastUpdatedDate", void 0);
141
113
  __decorate([
142
114
  property({ type: String })
143
115
  ], SgdsFooter.prototype, "contactHref", void 0);
144
116
  __decorate([
145
117
  property({ type: String })
146
118
  ], SgdsFooter.prototype, "feedbackHref", void 0);
119
+ __decorate([
120
+ property({ type: String })
121
+ ], SgdsFooter.prototype, "faqHref", void 0);
147
122
  __decorate([
148
123
  property({ type: String })
149
124
  ], SgdsFooter.prototype, "privacyHref", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-footer.js","sources":["../../../../src/components/Footer/sgds-footer.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport footerStyle from \"./footer.css\";\nexport interface ColumnLinks {\n title: string;\n links: Links[];\n}\nexport interface Links {\n href: string;\n label: string;\n}\n\n/**\n * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.\n *\n * @csspart footer-top - The component's footer-top section container.\n * @csspart footer-bottom - The component's footer-bottom section container.\n *\n * @cssproperty footer-top - The component's footer-top section container.\n * @cssproperty footer-bottom - The component's footer-bottom section container.\n */\nexport class SgdsFooter extends SgdsElement {\n static styles = [...SgdsElement.styles, footerStyle];\n\n /**\n * \tSets title of SgdsFooter\n */\n @property({ type: String })\n title = \"\";\n\n /**\n * \tSets description of SgdsFooter\n */\n @property({ type: String })\n description = \"\";\n\n /**\n * \tSets copyrightLiner of SgdsFooter\n */\n @property({ type: String })\n copyrightLiner = \"Government of Singapore\";\n\n /**\n * Array of type\n *\n * `interface ColumnLinks { title: string; links : Links[] } interface Links { href: string; label: string; }`\n */\n @property({\n type: Array\n })\n links: ColumnLinks[] = [];\n\n /**\n * String date for last updated date\n */\n @property({ type: String })\n lastUpdatedDate = \"\";\n\n /**\n * \thref link for contacts\n */\n @property({ type: String })\n contactHref = \"#\";\n\n /**\n * \thref link for feedback\n */\n @property({ type: String })\n feedbackHref = \"#\";\n\n /**\n * \thref link for privacy statement\n */\n @property({ type: String })\n privacyHref = \"#\";\n\n /**\n * \thref link for terms of use\n */\n @property({ type: String })\n termsOfUseHref = \"#\";\n\n render() {\n // if description is defined\n const hasDescription = html` <div class=\"description\">${this.description}</div>`;\n\n return html`\n <footer class=\"sgds footer\">\n <section class=\"footer-top\" part=\"footer-top\">\n <div class=\"container-fluid\">\n <div class=\"row footer-header\">\n <div class=\"col col-lg-6 col-md-12\">\n <div class=\"title\">${this.title ? this.title : \"Footer title\"}</div>\n ${this.description ? hasDescription : undefined}\n </div>\n </div>\n <div class=\"row footer-items\">\n ${this.links.map(\n (item: ColumnLinks) =>\n html`\n <div class=\"col-xxl-2 col-md-4 mb-3\">\n <div class=\"title\">${item.title}</div>\n <ul class=\"links\">\n ${item.links.map((link: Links) => html` <li><a href=${link.href}>${link.label}</a></li> `)}\n </ul>\n </div>\n `\n )}\n </div>\n <div class=\"row footer-contact-links\">\n <div class=\"col\">\n <div class=\"d-flex justify-content-lg-end\">\n <ul>\n <li><a href=${this.contactHref}>Contact</a></li>\n <li><a href=${this.feedbackHref}>Feedback</a></li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </section>\n <section class=\"footer-bottom\" part=\"footer-bottom\">\n <div class=\"container-fluid\">\n <div class=\"row footer-mandatory-links\">\n <div class=\"col\">\n <ul>\n <li>\n <a href=\"https://tech.gov.sg/report_vulnerability\" target=\"_blank\" rel=\"noopener noreferrer\"\n >Report Vulnerability</a\n >\n </li>\n <li><a href=${this.privacyHref}>Privacy Statement</a></li>\n <li><a href=${this.termsOfUseHref}>Terms of use</a></li>\n </ul>\n </div>\n </div>\n <div class=\"row footer-copyrights\">\n <div class=\"col\">\n <div class=\"d-flex justify-content-lg-end text-end\">\n © ${new Date().getFullYear()} ${this.copyrightLiner}<br />\n Last Updated ${this.lastUpdated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,CAAC;AACN,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMrB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACT,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACR,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMnB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACT,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACN,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"sgds-footer.js","sources":["../../../../src/components/Footer/sgds-footer.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport footerStyle from \"./footer.css\";\n\n/**\n * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.\n *\n * @slot title - The slot for title\n * @slot description - The slot for description\n * @slot items - The slot for the list of footer items\n * @slot social-media - The slot for the list of social media with icons\n *\n */\nexport class SgdsFooter extends SgdsElement {\n static styles = [...SgdsElement.styles, footerStyle];\n\n /**\n * \tSets copyrightLiner of SgdsFooter\n */\n @property({ type: String })\n copyrightLiner = \"Government of Singapore\";\n\n /**\n * \thref link for contacts\n */\n @property({ type: String })\n contactHref = \"#\";\n\n /**\n * \thref link for feedback\n */\n @property({ type: String })\n feedbackHref = \"#\";\n\n /**\n * \thref link for faq\n */\n @property({ type: String })\n faqHref = \"#\";\n\n /**\n * \thref link for privacy statement\n */\n @property({ type: String })\n privacyHref = \"#\";\n\n /**\n * \thref link for terms of use\n */\n @property({ type: String })\n termsOfUseHref = \"#\";\n\n firstUpdated() {\n const socialMediaSlot = this.shadowRoot.querySelector(\"slot[name='social-media']\") as HTMLSlotElement;\n const footerTitleSlot = this.shadowRoot.querySelector(\"slot[name='title']\") as HTMLSlotElement;\n const footerDescriptionSlot = this.shadowRoot.querySelector(\"slot[name='description']\") as HTMLSlotElement;\n const footerItemsSlot = this.shadowRoot.querySelector(\"slot[name='items']\") as HTMLSlotElement;\n const socialMediaChildNodes = socialMediaSlot.assignedNodes({ flatten: true });\n const footerTitleChildNodes = footerTitleSlot.assignedNodes({ flatten: true });\n const footerDescriptionChildNodes = footerDescriptionSlot.assignedNodes({ flatten: true });\n const footerItemsChildNodes = footerItemsSlot.assignedNodes({ flatten: true });\n if (socialMediaChildNodes.length === 0) {\n const socialMediaContainer = this.shadowRoot.querySelector(\".social-media\") as HTMLDivElement;\n socialMediaContainer.style.display = \"none\";\n }\n\n if (footerTitleChildNodes.length === 0 && footerDescriptionChildNodes.length === 0) {\n const footerHeaderContainer = this.shadowRoot.querySelector(\".footer-header\") as HTMLDivElement;\n footerHeaderContainer.style.display = \"none\";\n }\n\n if (footerItemsChildNodes.length === 0) {\n const footerItemsContainer = this.shadowRoot.querySelector(\".footer-items\") as HTMLDivElement;\n footerItemsContainer.style.display = \"none\";\n }\n\n if (\n footerTitleChildNodes.length === 0 &&\n footerDescriptionChildNodes.length === 0 &&\n footerItemsChildNodes.length === 0\n ) {\n const footerTopContainer = this.shadowRoot.querySelector(\".footer-top\") as HTMLDivElement;\n footerTopContainer.style.display = \"none\";\n }\n }\n\n render() {\n return html`\n <footer class=\"footer\">\n <section class=\"footer-top\">\n <div class=\"footer-header\">\n <slot name=\"title\"></slot>\n <slot name=\"description\"></slot>\n </div>\n <div class=\"footer-items\">\n <slot name=\"items\"></slot>\n </div>\n </section>\n <section class=\"footer-bottom\">\n <div class=\"social-media\">\n <slot name=\"social-media\"></slot>\n </div>\n <div class=\"footer-mandatory-links\">\n <ul>\n <li><a href=${this.contactHref}>Contact</a></li>\n <li><a href=${this.feedbackHref}>Feedback</a></li>\n <li><a href=${this.faqHref}>FAQ</a></li>\n <li>\n <a href=\"https://tech.gov.sg/report_vulnerability\" target=\"_blank\" rel=\"noopener noreferrer\">\n Report Vulnerability\n </a>\n </li>\n <li><a href=${this.privacyHref}>Privacy Statement</a></li>\n <li><a href=${this.termsOfUseHref}>Terms of use</a></li>\n </ul>\n <div class=\"footer-copyrights\" ${new Date().getFullYear()}, ${this.copyrightLiner}</div>\n </div>\n </section>\n </footer>\n `;\n }\n}\n\nexport default SgdsFooter;\n"],"names":["footerStyle"],"mappings":";;;;;;;AAKA;;;;;;;;AAQG;AACG,MAAO,UAAW,SAAQ,WAAW,CAAA;AAA3C,IAAA,WAAA,GAAA;;AAGE;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,yBAAyB,CAAC;AAE3C;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;;AAEG;QAEH,IAAY,CAAA,YAAA,GAAG,GAAG,CAAC;AAEnB;;AAEG;QAEH,IAAO,CAAA,OAAA,GAAG,GAAG,CAAC;AAEd;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,GAAG,CAAC;KAuEtB;IArEC,YAAY,GAAA;QACV,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,2BAA2B,CAAoB,CAAC;QACtG,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,oBAAoB,CAAoB,CAAC;QAC/F,MAAM,q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,CAAA,CAAA,CAAA;AAMnB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACb,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMd,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACT,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACN,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var lit = require('lit');
7
+
8
+ var css_248z = lit.css`:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;
9
+
10
+ exports["default"] = css_248z;
11
+ //# sourceMappingURL=icon.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import { css } from 'lit';
3
+
4
+ var css_248z = css`:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;
5
+
6
+ export { css_248z as default };
7
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,70 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var tslib = require('tslib');
7
+ var sgdsElement = require('../../base/sgds-element.cjs.js');
8
+ var staticHtml_js = require('lit/static-html.js');
9
+ var decorators_js = require('lit/decorators.js');
10
+ var unsafeSvg_js = require('lit/directives/unsafe-svg.js');
11
+ var icon = require('./icon.cjs.js');
12
+
13
+ /**
14
+ * @summary Icons offer a form of visual shorthand that we are all familiar with. They can label, inform and aid navigation quickly and effectively in minimal space. Icons must first and foremost communicate meaning. By default, the icon component renders icons form SgdsIcon library set
15
+ *
16
+ * @event sgds-blur - Emitted when the button is blurred.
17
+ * @event sgds-focus - Emitted when the button is focused.
18
+ */
19
+ class SgdsIcon extends sgdsElement["default"] {
20
+ constructor() {
21
+ super(...arguments);
22
+ /** Specifies a small, medium or large icon, the size is medium by default. */
23
+ this.size = "lg";
24
+ /** @internal */
25
+ this._svgContent = null;
26
+ }
27
+ async firstUpdated() {
28
+ if (this.name) {
29
+ this.loadSvg(this.name);
30
+ }
31
+ }
32
+ updated() {
33
+ this.style.display = this._svgContent ? "flex" : "none";
34
+ }
35
+ async loadSvg(name) {
36
+ if (name) {
37
+ // Dynamically import the SVG if not cached
38
+ try {
39
+ //TODO: This path is too specific to our repo, it won't work for users
40
+ const response = await fetch(`/src/icons/${name}.svg`);
41
+ if (response.ok) {
42
+ const svgContent = await response.text();
43
+ // Render the SVG
44
+ // this.renderSvg(svgContent);
45
+ this._svgContent = svgContent;
46
+ }
47
+ }
48
+ catch (error) {
49
+ console.error(`Error loading SVG: ${name}`, error);
50
+ }
51
+ }
52
+ }
53
+ render() {
54
+ return staticHtml_js.html `${unsafeSvg_js.unsafeSVG(this._svgContent)}`;
55
+ }
56
+ }
57
+ SgdsIcon.styles = [...sgdsElement["default"].styles, icon["default"]];
58
+ tslib.__decorate([
59
+ decorators_js.property({ type: String, reflect: true })
60
+ ], SgdsIcon.prototype, "name", void 0);
61
+ tslib.__decorate([
62
+ decorators_js.property({ type: String, reflect: true })
63
+ ], SgdsIcon.prototype, "size", void 0);
64
+ tslib.__decorate([
65
+ decorators_js.state()
66
+ ], SgdsIcon.prototype, "_svgContent", void 0);
67
+
68
+ exports.SgdsIcon = SgdsIcon;
69
+ exports["default"] = SgdsIcon;
70
+ //# sourceMappingURL=sgds-icon.cjs.js.map