@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.
- package/README.md +5 -5
- package/base/button.js +1 -1
- package/base/form-control-element.d.ts +4 -11
- package/base/form-control-element.js +13 -23
- package/base/form-control-element.js.map +1 -1
- package/components/Accordion/accordion-item.js +1 -1
- package/components/Accordion/index.umd.js +7 -19
- package/components/Accordion/index.umd.js.map +1 -1
- package/components/Accordion/sgds-accordion-item.d.ts +3 -7
- package/components/Accordion/sgds-accordion-item.js +6 -18
- package/components/Accordion/sgds-accordion-item.js.map +1 -1
- package/components/ActionCard/index.umd.js +407 -329
- package/components/ActionCard/index.umd.js.map +1 -1
- package/components/Alert/alert.js +1 -1
- package/components/Alert/index.umd.js +553 -485
- package/components/Alert/index.umd.js.map +1 -1
- package/components/Alert/sgds-alert.d.ts +2 -2
- package/components/Alert/sgds-alert.js +6 -13
- package/components/Alert/sgds-alert.js.map +1 -1
- package/components/Badge/badge.js +1 -1
- package/components/Badge/index.umd.js +8 -9
- package/components/Badge/index.umd.js.map +1 -1
- package/components/Badge/sgds-badge.d.ts +4 -5
- package/components/Badge/sgds-badge.js +5 -6
- package/components/Badge/sgds-badge.js.map +1 -1
- package/components/Button/index.umd.js +8 -81
- package/components/Button/index.umd.js.map +1 -1
- package/components/Button/sgds-button.js +1 -1
- package/components/Button/sgds-button.js.map +1 -1
- package/components/Checkbox/checkbox.js +1 -1
- package/components/Checkbox/index.umd.js +541 -475
- package/components/Checkbox/index.umd.js.map +1 -1
- package/components/Checkbox/sgds-checkbox-group.d.ts +7 -1
- package/components/Checkbox/sgds-checkbox-group.js +15 -4
- package/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/components/Checkbox/sgds-checkbox.d.ts +30 -21
- package/components/Checkbox/sgds-checkbox.js +77 -60
- package/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/components/ComboBox/index.umd.js +385 -216
- package/components/ComboBox/index.umd.js.map +1 -1
- package/components/Datepicker/datepicker-input.d.ts +4 -2
- package/components/Datepicker/datepicker-input.js +24 -7
- package/components/Datepicker/datepicker-input.js.map +1 -1
- package/components/Datepicker/index.umd.js +433 -244
- package/components/Datepicker/index.umd.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.d.ts +1 -1
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Drawer/index.umd.js +2 -2
- package/components/Drawer/index.umd.js.map +1 -1
- package/components/Dropdown/index.umd.js +8 -81
- package/components/Dropdown/index.umd.js.map +1 -1
- package/components/FileUpload/file-upload.js +1 -1
- package/components/FileUpload/index.umd.js +579 -272
- package/components/FileUpload/index.umd.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.d.ts +42 -30
- package/components/FileUpload/sgds-file-upload.js +147 -103
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/Footer/footer-item.js +6 -0
- package/components/Footer/footer-item.js.map +1 -0
- package/components/Footer/footer.js +1 -1
- package/components/Footer/index.d.ts +2 -0
- package/components/Footer/index.js +2 -0
- package/components/Footer/index.js.map +1 -1
- package/components/Footer/index.umd.js +93 -94
- package/components/Footer/index.umd.js.map +1 -1
- package/components/Footer/sgds-footer-item.d.ts +13 -0
- package/components/Footer/sgds-footer-item.js +27 -0
- package/components/Footer/sgds-footer-item.js.map +1 -0
- package/components/Footer/sgds-footer.d.ts +9 -30
- package/components/Footer/sgds-footer.js +65 -90
- package/components/Footer/sgds-footer.js.map +1 -1
- package/components/Icon/icon.js +6 -0
- package/components/Icon/icon.js.map +1 -0
- package/components/Icon/index.d.ts +6 -0
- package/components/Icon/index.js +4 -0
- package/components/Icon/index.js.map +1 -0
- package/components/Icon/index.umd.js +4389 -0
- package/components/Icon/index.umd.js.map +1 -0
- package/components/Icon/sgds-icon.d.ts +21 -0
- package/components/Icon/sgds-icon.js +64 -0
- package/components/Icon/sgds-icon.js.map +1 -0
- package/components/IconButton/icon-button.js +1 -1
- package/components/IconButton/index.umd.js +6 -9
- package/components/IconButton/index.umd.js.map +1 -1
- package/components/IconButton/sgds-icon-button.d.ts +2 -2
- package/components/IconButton/sgds-icon-button.js +4 -9
- package/components/IconButton/sgds-icon-button.js.map +1 -1
- package/components/Input/index.umd.js +1734 -1376
- package/components/Input/index.umd.js.map +1 -1
- package/components/Input/sgds-input.d.ts +41 -21
- package/components/Input/sgds-input.js +103 -66
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Modal/index.umd.js +2 -2
- package/components/Modal/index.umd.js.map +1 -1
- package/components/QuantityToggle/index.umd.js +894 -316
- package/components/QuantityToggle/index.umd.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.d.ts +42 -15
- package/components/QuantityToggle/sgds-quantity-toggle.js +129 -62
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Radio/index.umd.js +516 -203
- package/components/Radio/index.umd.js.map +1 -1
- package/components/Radio/sgds-radio-group.d.ts +38 -27
- package/components/Radio/sgds-radio-group.js +100 -84
- package/components/Radio/sgds-radio-group.js.map +1 -1
- package/components/Radio/sgds-radio.js +1 -1
- package/components/Radio/sgds-radio.js.map +1 -1
- package/components/Stepper/index.umd.js +1 -0
- package/components/Stepper/index.umd.js.map +1 -1
- package/components/Stepper/sgds-stepper.d.ts +1 -0
- package/components/Stepper/sgds-stepper.js +1 -0
- package/components/Stepper/sgds-stepper.js.map +1 -1
- package/components/Switch/index.umd.js +21 -321
- package/components/Switch/index.umd.js.map +1 -1
- package/components/Switch/sgds-switch.js +1 -2
- package/components/Switch/sgds-switch.js.map +1 -1
- package/components/Textarea/index.umd.js +1554 -1336
- package/components/Textarea/index.umd.js.map +1 -1
- package/components/Textarea/sgds-textarea.d.ts +33 -22
- package/components/Textarea/sgds-textarea.js +78 -75
- package/components/Textarea/sgds-textarea.js.map +1 -1
- package/components/Textarea/textarea.js +1 -1
- package/components/Toast/index.umd.js +9 -21
- package/components/Toast/index.umd.js.map +1 -1
- package/components/Toast/sgds-toast.d.ts +2 -1
- package/components/Toast/sgds-toast.js +6 -18
- package/components/Toast/sgds-toast.js.map +1 -1
- package/components/Toast/toast.js +1 -1
- package/components/Tooltip/index.umd.js +14 -14
- package/components/Tooltip/index.umd.js.map +1 -1
- package/components/Tooltip/sgds-tooltip.d.ts +4 -7
- package/components/Tooltip/sgds-tooltip.js +14 -14
- package/components/Tooltip/sgds-tooltip.js.map +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/components/index.umd.js +1318 -1124
- package/components/index.umd.js.map +1 -1
- package/icons/arrow-bar-down.svg +3 -0
- package/icons/arrow-bar-left.svg +3 -0
- package/icons/arrow-bar-right.svg +3 -0
- package/icons/arrow-bar-up.svg +3 -0
- package/icons/arrow-clockwise.svg +3 -0
- package/icons/arrow-down.svg +3 -0
- package/icons/arrow-left.svg +3 -0
- package/icons/arrow-repeat.svg +3 -0
- package/icons/arrow-right.svg +3 -0
- package/icons/arrow-up.svg +3 -0
- package/icons/bank-fill.svg +3 -0
- package/icons/bell-slash.svg +3 -0
- package/icons/bell.svg +3 -0
- package/icons/bi-funnel.svg +3 -0
- package/icons/bookmark-fill.svg +3 -0
- package/icons/bookmark.svg +3 -0
- package/icons/box-arrow-up-right.svg +3 -0
- package/icons/box-seam.svg +3 -0
- package/icons/building.svg +3 -0
- package/icons/calculator.svg +3 -0
- package/icons/calendar-check.svg +4 -0
- package/icons/calendar-x.svg +4 -0
- package/icons/calendar.svg +3 -0
- package/icons/camera.svg +3 -0
- package/icons/chat-left-text.svg +3 -0
- package/icons/check-circle-fill.svg +3 -0
- package/icons/check-circle.svg +3 -0
- package/icons/check.svg +3 -0
- package/icons/chevron-down.svg +3 -0
- package/icons/chevron-left.svg +3 -0
- package/icons/chevron-right.svg +3 -0
- package/icons/chevron-up .svg +3 -0
- package/icons/clock.svg +4 -0
- package/icons/cloud-check.svg +4 -0
- package/icons/cloud-download.svg +3 -0
- package/icons/cloud-upload.svg +3 -0
- package/icons/cloud.svg +3 -0
- package/icons/compass.svg +4 -0
- package/icons/cross.svg +3 -0
- package/icons/cursor-fill.svg +3 -0
- package/icons/cursor.svg +3 -0
- package/icons/dash-circle.svg +3 -0
- package/icons/dash-square.svg +3 -0
- package/icons/dash.svg +3 -0
- package/icons/download.svg +3 -0
- package/icons/exclamation-circle-fill.svg +3 -0
- package/icons/exclamation-circle.svg +4 -0
- package/icons/exclamation-triangle-fill.svg +3 -0
- package/icons/exclamation-triangle.svg +4 -0
- package/icons/exclamation.svg +4 -0
- package/icons/eye-fill.svg +3 -0
- package/icons/eye-slash-fill.svg +4 -0
- package/icons/eye-slash.svg +3 -0
- package/icons/eye.svg +3 -0
- package/icons/facebook.svg +3 -0
- package/icons/file-earmark-text.svg +3 -0
- package/icons/file-pdf.svg +4 -0
- package/icons/file-plus.svg +4 -0
- package/icons/file-text.svg +3 -0
- package/icons/file.svg +3 -0
- package/icons/files.svg +4 -0
- package/icons/folder-check.svg +4 -0
- package/icons/folder-minus.svg +4 -0
- package/icons/folder-plus.svg +4 -0
- package/icons/folder.svg +3 -0
- package/icons/gear.svg +3 -0
- package/icons/geo-alt.svg +4 -0
- package/icons/geo-fill.svg +4 -0
- package/icons/geo.svg +4 -0
- package/icons/google.svg +3 -0
- package/icons/grid-fill.svg +3 -0
- package/icons/hand-thumbs-down.svg +3 -0
- package/icons/hand-thumbs-up.svg +3 -0
- package/icons/hdd.svg +3 -0
- package/icons/house-door.svg +3 -0
- package/icons/house.svg +3 -0
- package/icons/image.svg +3 -0
- package/icons/inbox.svg +3 -0
- package/icons/info-circle-fill.svg +3 -0
- package/icons/info-circle.svg +4 -0
- package/icons/instagram.svg +3 -0
- package/icons/layers.svg +3 -0
- package/icons/layout-text-window-reverse.svg +3 -0
- package/icons/layout-text-window.svg +3 -0
- package/icons/layout.svg +3 -0
- package/icons/link.svg +3 -0
- package/icons/linkedin.svg +3 -0
- package/icons/list.svg +3 -0
- package/icons/lock-fill.svg +3 -0
- package/icons/lock.svg +3 -0
- package/icons/mail.svg +3 -0
- package/icons/map.svg +3 -0
- package/icons/paperclip.svg +3 -0
- package/icons/pencil.svg +3 -0
- package/icons/pending-circle.svg +3 -0
- package/icons/person-dash.svg +3 -0
- package/icons/person-plus.svg +3 -0
- package/icons/person-x.svg +3 -0
- package/icons/person.svg +3 -0
- package/icons/pin-map-fill.svg +3 -0
- package/icons/pin.svg +3 -0
- package/icons/placeholder.svg +3 -0
- package/icons/plus-circle.svg +3 -0
- package/icons/plus-square.svg +3 -0
- package/icons/plus.svg +3 -0
- package/icons/printer.svg +3 -0
- package/icons/question-circle.svg +4 -0
- package/icons/save.svg +3 -0
- package/icons/search.svg +3 -0
- package/icons/share.svg +3 -0
- package/icons/slash-circle.svg +3 -0
- package/icons/sliders.svg +3 -0
- package/icons/speedometer.svg +3 -0
- package/icons/star-fill.svg +3 -0
- package/icons/star.svg +3 -0
- package/icons/stoplights.svg +4 -0
- package/icons/telephone.svg +3 -0
- package/icons/three-dots-vertical.svg +3 -0
- package/icons/three-dots.svg +3 -0
- package/icons/toggle-off.svg +3 -0
- package/icons/toggle-on.svg +3 -0
- package/icons/trash.svg +3 -0
- package/icons/twitter-x.svg +3 -0
- package/icons/unlock.svg +3 -0
- package/icons/upload.svg +3 -0
- package/icons/window-dash.svg +4 -0
- package/icons/window-desktop.svg +4 -0
- package/icons/window-dock.svg +4 -0
- package/icons/window-fullscreen.svg +3 -0
- package/icons/window-plus.svg +4 -0
- package/icons/window-sidebar.svg +3 -0
- package/icons/window-split.svg +3 -0
- package/icons/window-stack.svg +3 -0
- package/icons/window-x.svg +4 -0
- package/icons/window.svg +3 -0
- package/icons/x-circle-fill.svg +3 -0
- package/icons/x-circle.svg +3 -0
- package/icons/youtube.svg +3 -0
- package/icons/zoom-in.svg +3 -0
- package/icons/zoom-out.svg +3 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.umd.js +1338 -1119
- package/index.umd.js.map +1 -1
- package/internals/CloseButton/close-button.js +1 -1
- package/internals/CloseButton/sgds-close-button.js +1 -1
- package/internals/CloseButton/sgds-close-button.js.map +1 -1
- package/package.json +1 -1
- package/react/base/button.cjs.js +1 -1
- package/react/base/button.js +1 -1
- package/react/base/form-control-element.cjs.js +13 -23
- package/react/base/form-control-element.cjs.js.map +1 -1
- package/react/base/form-control-element.js +13 -23
- package/react/base/form-control-element.js.map +1 -1
- package/react/checkbox/index.cjs.js +2 -0
- package/react/checkbox/index.cjs.js.map +1 -1
- package/react/checkbox/index.d.ts +2 -0
- package/react/checkbox/index.js +2 -0
- package/react/checkbox/index.js.map +1 -1
- package/react/components/Accordion/accordion-item.cjs.js +1 -1
- package/react/components/Accordion/accordion-item.js +1 -1
- package/react/components/Accordion/sgds-accordion-item.cjs.js +6 -18
- package/react/components/Accordion/sgds-accordion-item.cjs.js.map +1 -1
- package/react/components/Accordion/sgds-accordion-item.js +6 -18
- package/react/components/Accordion/sgds-accordion-item.js.map +1 -1
- package/react/components/Alert/alert.cjs.js +1 -1
- package/react/components/Alert/alert.js +1 -1
- package/react/components/Alert/sgds-alert.cjs.js +5 -12
- package/react/components/Alert/sgds-alert.cjs.js.map +1 -1
- package/react/components/Alert/sgds-alert.js +6 -13
- package/react/components/Alert/sgds-alert.js.map +1 -1
- package/react/components/Badge/badge.cjs.js +1 -1
- package/react/components/Badge/badge.js +1 -1
- package/react/components/Badge/sgds-badge.cjs.js +5 -6
- package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
- package/react/components/Badge/sgds-badge.js +5 -6
- package/react/components/Badge/sgds-badge.js.map +1 -1
- package/react/components/Button/sgds-button.cjs.js +2 -2
- package/react/components/Button/sgds-button.cjs.js.map +1 -1
- package/react/components/Button/sgds-button.js +1 -1
- package/react/components/Button/sgds-button.js.map +1 -1
- package/react/components/Checkbox/checkbox.cjs.js +1 -1
- package/react/components/Checkbox/checkbox.js +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js +15 -4
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.js +15 -4
- package/react/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js +77 -60
- package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.js +77 -60
- package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/react/components/Datepicker/datepicker-input.cjs.js +24 -7
- package/react/components/Datepicker/datepicker-input.cjs.js.map +1 -1
- package/react/components/Datepicker/datepicker-input.js +24 -7
- package/react/components/Datepicker/datepicker-input.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/react/components/FileUpload/file-upload.cjs.js +1 -1
- package/react/components/FileUpload/file-upload.js +1 -1
- package/react/components/FileUpload/sgds-file-upload.cjs.js +145 -101
- package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
- package/react/components/FileUpload/sgds-file-upload.js +147 -103
- package/react/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/react/components/Footer/footer-item.cjs.js +11 -0
- package/react/components/Footer/footer-item.cjs.js.map +1 -0
- package/react/components/Footer/footer-item.js +7 -0
- package/react/components/Footer/footer-item.js.map +1 -0
- package/react/components/Footer/footer.cjs.js +1 -1
- package/react/components/Footer/footer.js +1 -1
- package/react/components/Footer/sgds-footer-item.cjs.js +33 -0
- package/react/components/Footer/sgds-footer-item.cjs.js.map +1 -0
- package/react/components/Footer/sgds-footer-item.js +28 -0
- package/react/components/Footer/sgds-footer-item.js.map +1 -0
- package/react/components/Footer/sgds-footer.cjs.js +65 -90
- package/react/components/Footer/sgds-footer.cjs.js.map +1 -1
- package/react/components/Footer/sgds-footer.js +65 -90
- package/react/components/Footer/sgds-footer.js.map +1 -1
- package/react/components/Icon/icon.cjs.js +11 -0
- package/react/components/Icon/icon.cjs.js.map +1 -0
- package/react/components/Icon/icon.js +7 -0
- package/react/components/Icon/icon.js.map +1 -0
- package/react/components/Icon/sgds-icon.cjs.js +70 -0
- package/react/components/Icon/sgds-icon.cjs.js.map +1 -0
- package/react/components/Icon/sgds-icon.js +65 -0
- package/react/components/Icon/sgds-icon.js.map +1 -0
- package/react/components/IconButton/icon-button.cjs.js +1 -1
- package/react/components/IconButton/icon-button.js +1 -1
- package/react/components/IconButton/sgds-icon-button.cjs.js +4 -9
- package/react/components/IconButton/sgds-icon-button.cjs.js.map +1 -1
- package/react/components/IconButton/sgds-icon-button.js +4 -9
- package/react/components/IconButton/sgds-icon-button.js.map +1 -1
- package/react/components/Input/sgds-input.cjs.js +101 -64
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +103 -66
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +128 -61
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js +129 -62
- package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.cjs.js +99 -83
- package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.js +100 -84
- package/react/components/Radio/sgds-radio-group.js.map +1 -1
- package/react/components/Radio/sgds-radio.cjs.js +1 -1
- package/react/components/Radio/sgds-radio.cjs.js.map +1 -1
- package/react/components/Radio/sgds-radio.js +1 -1
- package/react/components/Radio/sgds-radio.js.map +1 -1
- package/react/components/Stepper/sgds-stepper.cjs.js +1 -0
- package/react/components/Stepper/sgds-stepper.cjs.js.map +1 -1
- package/react/components/Stepper/sgds-stepper.js +1 -0
- package/react/components/Stepper/sgds-stepper.js.map +1 -1
- package/react/components/Switch/sgds-switch.cjs.js +1 -2
- package/react/components/Switch/sgds-switch.cjs.js.map +1 -1
- package/react/components/Switch/sgds-switch.js +1 -2
- package/react/components/Switch/sgds-switch.js.map +1 -1
- package/react/components/Textarea/sgds-textarea.cjs.js +76 -73
- package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -1
- package/react/components/Textarea/sgds-textarea.js +78 -75
- package/react/components/Textarea/sgds-textarea.js.map +1 -1
- package/react/components/Textarea/textarea.cjs.js +1 -1
- package/react/components/Textarea/textarea.js +1 -1
- package/react/components/Toast/sgds-toast.cjs.js +6 -18
- package/react/components/Toast/sgds-toast.cjs.js.map +1 -1
- package/react/components/Toast/sgds-toast.js +6 -18
- package/react/components/Toast/sgds-toast.js.map +1 -1
- package/react/components/Toast/toast.cjs.js +1 -1
- package/react/components/Toast/toast.js +1 -1
- package/react/components/Tooltip/sgds-tooltip.cjs.js +14 -14
- package/react/components/Tooltip/sgds-tooltip.cjs.js.map +1 -1
- package/react/components/Tooltip/sgds-tooltip.js +14 -14
- package/react/components/Tooltip/sgds-tooltip.js.map +1 -1
- package/react/footer-item/index.cjs.js +39 -0
- package/react/footer-item/index.cjs.js.map +1 -0
- package/react/footer-item/index.d.ts +3 -0
- package/react/footer-item/index.js +15 -0
- package/react/footer-item/index.js.map +1 -0
- package/react/icon/index.cjs.js +42 -0
- package/react/icon/index.cjs.js.map +1 -0
- package/react/icon/index.d.ts +6 -0
- package/react/icon/index.js +18 -0
- package/react/icon/index.js.map +1 -0
- package/react/index.cjs.js +64 -60
- package/react/index.cjs.js.map +1 -1
- package/react/index.d.ts +2 -0
- package/react/index.js +2 -0
- package/react/index.js.map +1 -1
- package/react/input/index.cjs.js +3 -1
- package/react/input/index.cjs.js.map +1 -1
- package/react/input/index.d.ts +2 -0
- package/react/input/index.js +3 -1
- package/react/input/index.js.map +1 -1
- package/react/internals/CloseButton/close-button.cjs.js +1 -1
- package/react/internals/CloseButton/close-button.js +1 -1
- package/react/internals/CloseButton/sgds-close-button.cjs.js +1 -1
- package/react/internals/CloseButton/sgds-close-button.cjs.js.map +1 -1
- package/react/internals/CloseButton/sgds-close-button.js +1 -1
- package/react/internals/CloseButton/sgds-close-button.js.map +1 -1
- package/react/styles/form-hint.cjs.js +1 -1
- package/react/styles/form-hint.js +1 -1
- package/react/styles/form-label.cjs.js +1 -1
- package/react/styles/form-label.js +1 -1
- package/react/utils/formSubmitController.cjs.js +64 -0
- package/react/utils/formSubmitController.cjs.js.map +1 -0
- package/react/utils/formSubmitController.js +60 -0
- package/react/utils/formSubmitController.js.map +1 -0
- package/react/utils/inputValidationController.cjs.js +130 -0
- package/react/utils/inputValidationController.cjs.js.map +1 -0
- package/react/utils/inputValidationController.js +126 -0
- package/react/utils/inputValidationController.js.map +1 -0
- package/react/utils/validatorMixin.cjs.js +108 -0
- package/react/utils/validatorMixin.cjs.js.map +1 -0
- package/react/utils/validatorMixin.js +104 -0
- package/react/utils/validatorMixin.js.map +1 -0
- package/styles/form-hint.js +1 -1
- package/styles/form-label.js +1 -1
- package/themes/day.css +1 -1
- package/themes/night.css +3 -2
- package/themes/root.css +1 -0
- package/utils/{form.d.ts → formSubmitController.d.ts} +10 -20
- package/utils/formSubmitController.js +59 -0
- package/utils/formSubmitController.js.map +1 -0
- package/utils/inputValidationController.d.ts +70 -0
- package/utils/inputValidationController.js +125 -0
- package/utils/inputValidationController.js.map +1 -0
- package/utils/validatorMixin.d.ts +24 -0
- package/utils/validatorMixin.js +103 -0
- package/utils/validatorMixin.js.map +1 -0
- package/base/form-check-element.d.ts +0 -50
- package/base/form-check-element.js +0 -169
- package/base/form-check-element.js.map +0 -1
- package/react/base/form-check-element.cjs.js +0 -175
- package/react/base/form-check-element.cjs.js.map +0 -1
- package/react/base/form-check-element.js +0 -170
- package/react/base/form-check-element.js.map +0 -1
- package/react/utils/form.cjs.js +0 -137
- package/react/utils/form.cjs.js.map +0 -1
- package/react/utils/form.js +0 -133
- package/react/utils/form.js.map +0 -1
- package/utils/form.js +0 -132
- 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
|
-
* @
|
|
16
|
-
* @
|
|
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="
|
|
68
|
-
<section class="footer-top"
|
|
69
|
-
<div class="
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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"
|
|
99
|
-
<div class="
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</
|
|
111
|
-
</
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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\";\
|
|
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;;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,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A,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
|
-
* @
|
|
12
|
-
* @
|
|
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="
|
|
64
|
-
<section class="footer-top"
|
|
65
|
-
<div class="
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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"
|
|
95
|
-
<div class="
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
</
|
|
107
|
-
</
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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\";\
|
|
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":";;;;;;;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|
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
|