@ongov/ontario-design-system-component-library 6.0.0-alpha.5 → 6.0.0-alpha.8
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/components/index.d.ts +43 -0
- package/components/index.js +2169 -0
- package/components/index.js.map +1 -0
- package/components/ontario-accordion.d.ts +11 -0
- package/components/ontario-accordion.js +378 -0
- package/components/ontario-accordion.js.map +1 -0
- package/components/ontario-aside.d.ts +11 -0
- package/components/ontario-aside.js +171 -0
- package/components/ontario-aside.js.map +1 -0
- package/components/ontario-back-to-top.d.ts +11 -0
- package/components/ontario-back-to-top.js +119 -0
- package/components/ontario-back-to-top.js.map +1 -0
- package/components/ontario-badge.d.ts +11 -0
- package/components/ontario-badge.js +9 -0
- package/components/ontario-badge.js.map +1 -0
- package/components/ontario-blockquote.d.ts +11 -0
- package/components/ontario-blockquote.js +145 -0
- package/components/ontario-blockquote.js.map +1 -0
- package/components/ontario-button.d.ts +11 -0
- package/components/ontario-button.js +237 -0
- package/components/ontario-button.js.map +1 -0
- package/components/ontario-callout.d.ts +11 -0
- package/components/ontario-callout.js +170 -0
- package/components/ontario-callout.js.map +1 -0
- package/components/ontario-card-collection.d.ts +11 -0
- package/components/ontario-card-collection.js +111 -0
- package/components/ontario-card-collection.js.map +1 -0
- package/components/ontario-card.d.ts +11 -0
- package/components/ontario-card.js +389 -0
- package/components/ontario-card.js.map +1 -0
- package/components/ontario-checkboxes.d.ts +11 -0
- package/components/ontario-checkboxes.js +428 -0
- package/components/ontario-checkboxes.js.map +1 -0
- package/components/ontario-critical-alert.d.ts +11 -0
- package/components/ontario-critical-alert.js +128 -0
- package/components/ontario-critical-alert.js.map +1 -0
- package/components/ontario-date-input.d.ts +11 -0
- package/components/ontario-date-input.js +623 -0
- package/components/ontario-date-input.js.map +1 -0
- package/components/ontario-dropdown-list.d.ts +11 -0
- package/components/ontario-dropdown-list.js +449 -0
- package/components/ontario-dropdown-list.js.map +1 -0
- package/components/ontario-fieldset.d.ts +11 -0
- package/components/ontario-fieldset.js +167 -0
- package/components/ontario-fieldset.js.map +1 -0
- package/components/ontario-footer.d.ts +11 -0
- package/components/ontario-footer.js +455 -0
- package/components/ontario-footer.js.map +1 -0
- package/components/ontario-form-container.d.ts +11 -0
- package/components/ontario-form-container.js +74 -0
- package/components/ontario-form-container.js.map +1 -0
- package/components/ontario-header-overflow-menu.d.ts +11 -0
- package/components/ontario-header-overflow-menu.js +9 -0
- package/components/ontario-header-overflow-menu.js.map +1 -0
- package/components/ontario-header.d.ts +11 -0
- package/components/ontario-header.js +900 -0
- package/components/ontario-header.js.map +1 -0
- package/components/ontario-hint-expander.d.ts +11 -0
- package/components/ontario-hint-expander.js +9 -0
- package/components/ontario-hint-expander.js.map +1 -0
- package/components/ontario-hint-text.d.ts +11 -0
- package/components/ontario-hint-text.js +9 -0
- package/components/ontario-hint-text.js.map +1 -0
- package/components/ontario-icon-accessibility.d.ts +11 -0
- package/components/ontario-icon-accessibility.js +170 -0
- package/components/ontario-icon-accessibility.js.map +1 -0
- package/components/ontario-icon-account.d.ts +11 -0
- package/components/ontario-icon-account.js +170 -0
- package/components/ontario-icon-account.js.map +1 -0
- package/components/ontario-icon-add-alt.d.ts +11 -0
- package/components/ontario-icon-add-alt.js +171 -0
- package/components/ontario-icon-add-alt.js.map +1 -0
- package/components/ontario-icon-add.d.ts +11 -0
- package/components/ontario-icon-add.js +171 -0
- package/components/ontario-icon-add.js.map +1 -0
- package/components/ontario-icon-alert-error.d.ts +11 -0
- package/components/ontario-icon-alert-error.js +9 -0
- package/components/ontario-icon-alert-error.js.map +1 -0
- package/components/ontario-icon-alert-information.d.ts +11 -0
- package/components/ontario-icon-alert-information.js +9 -0
- package/components/ontario-icon-alert-information.js.map +1 -0
- package/components/ontario-icon-alert-success.d.ts +11 -0
- package/components/ontario-icon-alert-success.js +9 -0
- package/components/ontario-icon-alert-success.js.map +1 -0
- package/components/ontario-icon-alert-warning.d.ts +11 -0
- package/components/ontario-icon-alert-warning.js +9 -0
- package/components/ontario-icon-alert-warning.js.map +1 -0
- package/components/ontario-icon-arrow-up.d.ts +11 -0
- package/components/ontario-icon-arrow-up.js +171 -0
- package/components/ontario-icon-arrow-up.js.map +1 -0
- package/components/ontario-icon-attach.d.ts +11 -0
- package/components/ontario-icon-attach.js +172 -0
- package/components/ontario-icon-attach.js.map +1 -0
- package/components/ontario-icon-bookmark-off.d.ts +11 -0
- package/components/ontario-icon-bookmark-off.js +170 -0
- package/components/ontario-icon-bookmark-off.js.map +1 -0
- package/components/ontario-icon-bookmark-on.d.ts +11 -0
- package/components/ontario-icon-bookmark-on.js +170 -0
- package/components/ontario-icon-bookmark-on.js.map +1 -0
- package/components/ontario-icon-calendar.d.ts +11 -0
- package/components/ontario-icon-calendar.js +170 -0
- package/components/ontario-icon-calendar.js.map +1 -0
- package/components/ontario-icon-camera.d.ts +11 -0
- package/components/ontario-icon-camera.js +170 -0
- package/components/ontario-icon-camera.js.map +1 -0
- package/components/ontario-icon-chevron-down.d.ts +11 -0
- package/components/ontario-icon-chevron-down.js +9 -0
- package/components/ontario-icon-chevron-down.js.map +1 -0
- package/components/ontario-icon-chevron-left.d.ts +11 -0
- package/components/ontario-icon-chevron-left.js +9 -0
- package/components/ontario-icon-chevron-left.js.map +1 -0
- package/components/ontario-icon-chevron-right.d.ts +11 -0
- package/components/ontario-icon-chevron-right.js +171 -0
- package/components/ontario-icon-chevron-right.js.map +1 -0
- package/components/ontario-icon-chevron-up.d.ts +11 -0
- package/components/ontario-icon-chevron-up.js +9 -0
- package/components/ontario-icon-chevron-up.js.map +1 -0
- package/components/ontario-icon-clock.d.ts +11 -0
- package/components/ontario-icon-clock.js +170 -0
- package/components/ontario-icon-clock.js.map +1 -0
- package/components/ontario-icon-close-header.d.ts +11 -0
- package/components/ontario-icon-close-header.js +171 -0
- package/components/ontario-icon-close-header.js.map +1 -0
- package/components/ontario-icon-close.d.ts +11 -0
- package/components/ontario-icon-close.js +171 -0
- package/components/ontario-icon-close.js.map +1 -0
- package/components/ontario-icon-cloud.d.ts +11 -0
- package/components/ontario-icon-cloud.js +170 -0
- package/components/ontario-icon-cloud.js.map +1 -0
- package/components/ontario-icon-collapse.d.ts +11 -0
- package/components/ontario-icon-collapse.js +168 -0
- package/components/ontario-icon-collapse.js.map +1 -0
- package/components/ontario-icon-credit-card.d.ts +11 -0
- package/components/ontario-icon-credit-card.js +171 -0
- package/components/ontario-icon-credit-card.js.map +1 -0
- package/components/ontario-icon-critical-alert-warning.d.ts +11 -0
- package/components/ontario-icon-critical-alert-warning.js +188 -0
- package/components/ontario-icon-critical-alert-warning.js.map +1 -0
- package/components/ontario-icon-delete.d.ts +11 -0
- package/components/ontario-icon-delete.js +170 -0
- package/components/ontario-icon-delete.js.map +1 -0
- package/components/ontario-icon-document.d.ts +11 -0
- package/components/ontario-icon-document.js +170 -0
- package/components/ontario-icon-document.js.map +1 -0
- package/components/ontario-icon-download.d.ts +11 -0
- package/components/ontario-icon-download.js +170 -0
- package/components/ontario-icon-download.js.map +1 -0
- package/components/ontario-icon-dropdown-arrow.d.ts +11 -0
- package/components/ontario-icon-dropdown-arrow.js +142 -0
- package/components/ontario-icon-dropdown-arrow.js.map +1 -0
- package/components/ontario-icon-edit.d.ts +11 -0
- package/components/ontario-icon-edit.js +170 -0
- package/components/ontario-icon-edit.js.map +1 -0
- package/components/ontario-icon-email.d.ts +11 -0
- package/components/ontario-icon-email.js +171 -0
- package/components/ontario-icon-email.js.map +1 -0
- package/components/ontario-icon-expand.d.ts +11 -0
- package/components/ontario-icon-expand.js +168 -0
- package/components/ontario-icon-expand.js.map +1 -0
- package/components/ontario-icon-export.d.ts +11 -0
- package/components/ontario-icon-export.js +170 -0
- package/components/ontario-icon-export.js.map +1 -0
- package/components/ontario-icon-facebook-alt.d.ts +11 -0
- package/components/ontario-icon-facebook-alt.js +170 -0
- package/components/ontario-icon-facebook-alt.js.map +1 -0
- package/components/ontario-icon-facebook.d.ts +11 -0
- package/components/ontario-icon-facebook.js +170 -0
- package/components/ontario-icon-facebook.js.map +1 -0
- package/components/ontario-icon-favourite-off.d.ts +11 -0
- package/components/ontario-icon-favourite-off.js +170 -0
- package/components/ontario-icon-favourite-off.js.map +1 -0
- package/components/ontario-icon-favourite-on.d.ts +11 -0
- package/components/ontario-icon-favourite-on.js +170 -0
- package/components/ontario-icon-favourite-on.js.map +1 -0
- package/components/ontario-icon-filter.d.ts +11 -0
- package/components/ontario-icon-filter.js +170 -0
- package/components/ontario-icon-filter.js.map +1 -0
- package/components/ontario-icon-flickr.d.ts +11 -0
- package/components/ontario-icon-flickr.js +170 -0
- package/components/ontario-icon-flickr.js.map +1 -0
- package/components/ontario-icon-grid.d.ts +11 -0
- package/components/ontario-icon-grid.js +170 -0
- package/components/ontario-icon-grid.js.map +1 -0
- package/components/ontario-icon-help.d.ts +11 -0
- package/components/ontario-icon-help.js +171 -0
- package/components/ontario-icon-help.js.map +1 -0
- package/components/ontario-icon-instagram.d.ts +11 -0
- package/components/ontario-icon-instagram.js +170 -0
- package/components/ontario-icon-instagram.js.map +1 -0
- package/components/ontario-icon-interac-en-alt.d.ts +11 -0
- package/components/ontario-icon-interac-en-alt.js +203 -0
- package/components/ontario-icon-interac-en-alt.js.map +1 -0
- package/components/ontario-icon-interac-en.d.ts +11 -0
- package/components/ontario-icon-interac-en.js +202 -0
- package/components/ontario-icon-interac-en.js.map +1 -0
- package/components/ontario-icon-interac-fr-alt.d.ts +11 -0
- package/components/ontario-icon-interac-fr-alt.js +203 -0
- package/components/ontario-icon-interac-fr-alt.js.map +1 -0
- package/components/ontario-icon-interac-fr.d.ts +11 -0
- package/components/ontario-icon-interac-fr.js +183 -0
- package/components/ontario-icon-interac-fr.js.map +1 -0
- package/components/ontario-icon-linkedin-alt.d.ts +11 -0
- package/components/ontario-icon-linkedin-alt.js +170 -0
- package/components/ontario-icon-linkedin-alt.js.map +1 -0
- package/components/ontario-icon-linkedin.d.ts +11 -0
- package/components/ontario-icon-linkedin.js +170 -0
- package/components/ontario-icon-linkedin.js.map +1 -0
- package/components/ontario-icon-list.d.ts +11 -0
- package/components/ontario-icon-list.js +170 -0
- package/components/ontario-icon-list.js.map +1 -0
- package/components/ontario-icon-live-chat.d.ts +11 -0
- package/components/ontario-icon-live-chat.js +170 -0
- package/components/ontario-icon-live-chat.js.map +1 -0
- package/components/ontario-icon-location-off.d.ts +11 -0
- package/components/ontario-icon-location-off.js +170 -0
- package/components/ontario-icon-location-off.js.map +1 -0
- package/components/ontario-icon-location-on.d.ts +11 -0
- package/components/ontario-icon-location-on.js +170 -0
- package/components/ontario-icon-location-on.js.map +1 -0
- package/components/ontario-icon-lock-off.d.ts +11 -0
- package/components/ontario-icon-lock-off.js +170 -0
- package/components/ontario-icon-lock-off.js.map +1 -0
- package/components/ontario-icon-lock-on.d.ts +11 -0
- package/components/ontario-icon-lock-on.js +170 -0
- package/components/ontario-icon-lock-on.js.map +1 -0
- package/components/ontario-icon-map.d.ts +11 -0
- package/components/ontario-icon-map.js +170 -0
- package/components/ontario-icon-map.js.map +1 -0
- package/components/ontario-icon-mastercard-alt.d.ts +11 -0
- package/components/ontario-icon-mastercard-alt.js +161 -0
- package/components/ontario-icon-mastercard-alt.js.map +1 -0
- package/components/ontario-icon-mastercard.d.ts +11 -0
- package/components/ontario-icon-mastercard.js +173 -0
- package/components/ontario-icon-mastercard.js.map +1 -0
- package/components/ontario-icon-media-fast-forward.d.ts +11 -0
- package/components/ontario-icon-media-fast-forward.js +167 -0
- package/components/ontario-icon-media-fast-forward.js.map +1 -0
- package/components/ontario-icon-media-fast-rewind.d.ts +11 -0
- package/components/ontario-icon-media-fast-rewind.js +170 -0
- package/components/ontario-icon-media-fast-rewind.js.map +1 -0
- package/components/ontario-icon-media-pause.d.ts +11 -0
- package/components/ontario-icon-media-pause.js +167 -0
- package/components/ontario-icon-media-pause.js.map +1 -0
- package/components/ontario-icon-media-play.d.ts +11 -0
- package/components/ontario-icon-media-play.js +167 -0
- package/components/ontario-icon-media-play.js.map +1 -0
- package/components/ontario-icon-media-stop.d.ts +11 -0
- package/components/ontario-icon-media-stop.js +167 -0
- package/components/ontario-icon-media-stop.js.map +1 -0
- package/components/ontario-icon-menu-header.d.ts +11 -0
- package/components/ontario-icon-menu-header.js +171 -0
- package/components/ontario-icon-menu-header.js.map +1 -0
- package/components/ontario-icon-menu.d.ts +11 -0
- package/components/ontario-icon-menu.js +171 -0
- package/components/ontario-icon-menu.js.map +1 -0
- package/components/ontario-icon-microphone-off.d.ts +11 -0
- package/components/ontario-icon-microphone-off.js +170 -0
- package/components/ontario-icon-microphone-off.js.map +1 -0
- package/components/ontario-icon-microphone-on.d.ts +11 -0
- package/components/ontario-icon-microphone-on.js +170 -0
- package/components/ontario-icon-microphone-on.js.map +1 -0
- package/components/ontario-icon-more-vertical.d.ts +11 -0
- package/components/ontario-icon-more-vertical.js +170 -0
- package/components/ontario-icon-more-vertical.js.map +1 -0
- package/components/ontario-icon-new-window.d.ts +11 -0
- package/components/ontario-icon-new-window.js +171 -0
- package/components/ontario-icon-new-window.js.map +1 -0
- package/components/ontario-icon-next.d.ts +11 -0
- package/components/ontario-icon-next.js +170 -0
- package/components/ontario-icon-next.js.map +1 -0
- package/components/ontario-icon-notification.d.ts +11 -0
- package/components/ontario-icon-notification.js +170 -0
- package/components/ontario-icon-notification.js.map +1 -0
- package/components/ontario-icon-password-hide.d.ts +11 -0
- package/components/ontario-icon-password-hide.js +170 -0
- package/components/ontario-icon-password-hide.js.map +1 -0
- package/components/ontario-icon-password-show.d.ts +11 -0
- package/components/ontario-icon-password-show.js +170 -0
- package/components/ontario-icon-password-show.js.map +1 -0
- package/components/ontario-icon-phone.d.ts +11 -0
- package/components/ontario-icon-phone.js +171 -0
- package/components/ontario-icon-phone.js.map +1 -0
- package/components/ontario-icon-photo.d.ts +11 -0
- package/components/ontario-icon-photo.js +170 -0
- package/components/ontario-icon-photo.js.map +1 -0
- package/components/ontario-icon-pin-location-off.d.ts +11 -0
- package/components/ontario-icon-pin-location-off.js +170 -0
- package/components/ontario-icon-pin-location-off.js.map +1 -0
- package/components/ontario-icon-pin-location-on.d.ts +11 -0
- package/components/ontario-icon-pin-location-on.js +170 -0
- package/components/ontario-icon-pin-location-on.js.map +1 -0
- package/components/ontario-icon-previous.d.ts +11 -0
- package/components/ontario-icon-previous.js +170 -0
- package/components/ontario-icon-previous.js.map +1 -0
- package/components/ontario-icon-print.d.ts +11 -0
- package/components/ontario-icon-print.js +170 -0
- package/components/ontario-icon-print.js.map +1 -0
- package/components/ontario-icon-remove-alt.d.ts +11 -0
- package/components/ontario-icon-remove-alt.js +171 -0
- package/components/ontario-icon-remove-alt.js.map +1 -0
- package/components/ontario-icon-remove.d.ts +11 -0
- package/components/ontario-icon-remove.js +171 -0
- package/components/ontario-icon-remove.js.map +1 -0
- package/components/ontario-icon-replay.d.ts +11 -0
- package/components/ontario-icon-replay.js +170 -0
- package/components/ontario-icon-replay.js.map +1 -0
- package/components/ontario-icon-rss-feed.d.ts +11 -0
- package/components/ontario-icon-rss-feed.js +170 -0
- package/components/ontario-icon-rss-feed.js.map +1 -0
- package/components/ontario-icon-save.d.ts +11 -0
- package/components/ontario-icon-save.js +170 -0
- package/components/ontario-icon-save.js.map +1 -0
- package/components/ontario-icon-search-white.d.ts +11 -0
- package/components/ontario-icon-search-white.js +173 -0
- package/components/ontario-icon-search-white.js.map +1 -0
- package/components/ontario-icon-search.d.ts +11 -0
- package/components/ontario-icon-search.js +171 -0
- package/components/ontario-icon-search.js.map +1 -0
- package/components/ontario-icon-sentiment-1.d.ts +11 -0
- package/components/ontario-icon-sentiment-1.js +170 -0
- package/components/ontario-icon-sentiment-1.js.map +1 -0
- package/components/ontario-icon-sentiment-2.d.ts +11 -0
- package/components/ontario-icon-sentiment-2.js +170 -0
- package/components/ontario-icon-sentiment-2.js.map +1 -0
- package/components/ontario-icon-sentiment-3.d.ts +11 -0
- package/components/ontario-icon-sentiment-3.js +170 -0
- package/components/ontario-icon-sentiment-3.js.map +1 -0
- package/components/ontario-icon-sentiment-4.d.ts +11 -0
- package/components/ontario-icon-sentiment-4.js +170 -0
- package/components/ontario-icon-sentiment-4.js.map +1 -0
- package/components/ontario-icon-sentiment-5.d.ts +11 -0
- package/components/ontario-icon-sentiment-5.js +170 -0
- package/components/ontario-icon-sentiment-5.js.map +1 -0
- package/components/ontario-icon-settings.d.ts +11 -0
- package/components/ontario-icon-settings.js +170 -0
- package/components/ontario-icon-settings.js.map +1 -0
- package/components/ontario-icon-share.d.ts +11 -0
- package/components/ontario-icon-share.js +170 -0
- package/components/ontario-icon-share.js.map +1 -0
- package/components/ontario-icon-sort-alphabetical-ascending.d.ts +11 -0
- package/components/ontario-icon-sort-alphabetical-ascending.js +170 -0
- package/components/ontario-icon-sort-alphabetical-ascending.js.map +1 -0
- package/components/ontario-icon-sort-alphabetical-descending.d.ts +11 -0
- package/components/ontario-icon-sort-alphabetical-descending.js +170 -0
- package/components/ontario-icon-sort-alphabetical-descending.js.map +1 -0
- package/components/ontario-icon-sort-ascending.d.ts +11 -0
- package/components/ontario-icon-sort-ascending.js +170 -0
- package/components/ontario-icon-sort-ascending.js.map +1 -0
- package/components/ontario-icon-sort-descending.d.ts +11 -0
- package/components/ontario-icon-sort-descending.js +170 -0
- package/components/ontario-icon-sort-descending.js.map +1 -0
- package/components/ontario-icon-sort-variant.d.ts +11 -0
- package/components/ontario-icon-sort-variant.js +167 -0
- package/components/ontario-icon-sort-variant.js.map +1 -0
- package/components/ontario-icon-sort.d.ts +11 -0
- package/components/ontario-icon-sort.js +170 -0
- package/components/ontario-icon-sort.js.map +1 -0
- package/components/ontario-icon-tag.d.ts +11 -0
- package/components/ontario-icon-tag.js +170 -0
- package/components/ontario-icon-tag.js.map +1 -0
- package/components/ontario-icon-text-message.d.ts +11 -0
- package/components/ontario-icon-text-message.js +170 -0
- package/components/ontario-icon-text-message.js.map +1 -0
- package/components/ontario-icon-timer.d.ts +11 -0
- package/components/ontario-icon-timer.js +170 -0
- package/components/ontario-icon-timer.js.map +1 -0
- package/components/ontario-icon-transport-bicycle.d.ts +11 -0
- package/components/ontario-icon-transport-bicycle.js +170 -0
- package/components/ontario-icon-transport-bicycle.js.map +1 -0
- package/components/ontario-icon-transport-bus.d.ts +11 -0
- package/components/ontario-icon-transport-bus.js +170 -0
- package/components/ontario-icon-transport-bus.js.map +1 -0
- package/components/ontario-icon-transport-car.d.ts +11 -0
- package/components/ontario-icon-transport-car.js +170 -0
- package/components/ontario-icon-transport-car.js.map +1 -0
- package/components/ontario-icon-transport-walk.d.ts +11 -0
- package/components/ontario-icon-transport-walk.js +170 -0
- package/components/ontario-icon-transport-walk.js.map +1 -0
- package/components/ontario-icon-tty.d.ts +11 -0
- package/components/ontario-icon-tty.js +171 -0
- package/components/ontario-icon-tty.js.map +1 -0
- package/components/ontario-icon-twitter-alt.d.ts +11 -0
- package/components/ontario-icon-twitter-alt.js +170 -0
- package/components/ontario-icon-twitter-alt.js.map +1 -0
- package/components/ontario-icon-twitter.d.ts +11 -0
- package/components/ontario-icon-twitter.js +170 -0
- package/components/ontario-icon-twitter.js.map +1 -0
- package/components/ontario-icon-upload.d.ts +11 -0
- package/components/ontario-icon-upload.js +170 -0
- package/components/ontario-icon-upload.js.map +1 -0
- package/components/ontario-icon-video.d.ts +11 -0
- package/components/ontario-icon-video.js +170 -0
- package/components/ontario-icon-video.js.map +1 -0
- package/components/ontario-icon-visa.d.ts +11 -0
- package/components/ontario-icon-visa.js +148 -0
- package/components/ontario-icon-visa.js.map +1 -0
- package/components/ontario-icon-vote-dislike.d.ts +11 -0
- package/components/ontario-icon-vote-dislike.js +170 -0
- package/components/ontario-icon-vote-dislike.js.map +1 -0
- package/components/ontario-icon-vote-like.d.ts +11 -0
- package/components/ontario-icon-vote-like.js +170 -0
- package/components/ontario-icon-vote-like.js.map +1 -0
- package/components/ontario-icon-vpn-key.d.ts +11 -0
- package/components/ontario-icon-vpn-key.js +170 -0
- package/components/ontario-icon-vpn-key.js.map +1 -0
- package/components/ontario-icon-wheelchair.d.ts +11 -0
- package/components/ontario-icon-wheelchair.js +170 -0
- package/components/ontario-icon-wheelchair.js.map +1 -0
- package/components/ontario-icon-wifi.d.ts +11 -0
- package/components/ontario-icon-wifi.js +170 -0
- package/components/ontario-icon-wifi.js.map +1 -0
- package/components/ontario-icon-youtube.d.ts +11 -0
- package/components/ontario-icon-youtube.js +170 -0
- package/components/ontario-icon-youtube.js.map +1 -0
- package/components/ontario-input.d.ts +11 -0
- package/components/ontario-input.js +419 -0
- package/components/ontario-input.js.map +1 -0
- package/components/ontario-language-toggle.d.ts +11 -0
- package/components/ontario-language-toggle.js +9 -0
- package/components/ontario-language-toggle.js.map +1 -0
- package/components/ontario-loading-indicator.d.ts +11 -0
- package/components/ontario-loading-indicator.js +181 -0
- package/components/ontario-loading-indicator.js.map +1 -0
- package/components/ontario-page-alert.d.ts +11 -0
- package/components/ontario-page-alert.js +172 -0
- package/components/ontario-page-alert.js.map +1 -0
- package/components/ontario-radio-buttons.d.ts +11 -0
- package/components/ontario-radio-buttons.js +430 -0
- package/components/ontario-radio-buttons.js.map +1 -0
- package/components/ontario-search-box.d.ts +11 -0
- package/components/ontario-search-box.js +283 -0
- package/components/ontario-search-box.js.map +1 -0
- package/components/ontario-step-indicator.d.ts +11 -0
- package/components/ontario-step-indicator.js +172 -0
- package/components/ontario-step-indicator.js.map +1 -0
- package/components/ontario-table.d.ts +11 -0
- package/components/ontario-table.js +392 -0
- package/components/ontario-table.js.map +1 -0
- package/components/ontario-task-list.d.ts +11 -0
- package/components/ontario-task-list.js +211 -0
- package/components/ontario-task-list.js.map +1 -0
- package/components/ontario-task.d.ts +11 -0
- package/components/ontario-task.js +327 -0
- package/components/ontario-task.js.map +1 -0
- package/components/ontario-textarea.d.ts +11 -0
- package/components/ontario-textarea.js +327 -0
- package/components/ontario-textarea.js.map +1 -0
- package/components/p-6uqsTY-M.js +171 -0
- package/components/p-6uqsTY-M.js.map +1 -0
- package/components/p-A8xwC5QP.js +24 -0
- package/components/p-A8xwC5QP.js.map +1 -0
- package/components/p-BBhl-3u7.js +169 -0
- package/components/p-BBhl-3u7.js.map +1 -0
- package/components/p-BF0_OXTe.js +64 -0
- package/components/p-BF0_OXTe.js.map +1 -0
- package/components/p-BHTls9cv.js +286 -0
- package/components/p-BHTls9cv.js.map +1 -0
- package/components/p-BOcd5PoR.js +330 -0
- package/components/p-BOcd5PoR.js.map +1 -0
- package/components/p-BxXM4eur.js +29 -0
- package/components/p-BxXM4eur.js.map +1 -0
- package/components/p-C-t5TNzY.js +10 -0
- package/components/p-C-t5TNzY.js.map +1 -0
- package/components/p-C0Xvjp7G.js +282 -0
- package/components/p-C0Xvjp7G.js.map +1 -0
- package/components/p-C73HZQcq.js +89 -0
- package/components/p-C73HZQcq.js.map +1 -0
- package/components/p-CI209psv.js +271 -0
- package/components/p-CI209psv.js.map +1 -0
- package/components/p-CIdZS10A.js +20 -0
- package/components/p-CIdZS10A.js.map +1 -0
- package/components/p-CNDrx73J.js +145 -0
- package/components/p-CNDrx73J.js.map +1 -0
- package/components/p-CNqFEifG.js +34 -0
- package/components/p-CNqFEifG.js.map +1 -0
- package/components/p-CRMogYVY.js +168 -0
- package/components/p-CRMogYVY.js.map +1 -0
- package/components/p-CXTm9jmr.js +141 -0
- package/components/p-CXTm9jmr.js.map +1 -0
- package/components/p-CXfntdg5.js +7 -0
- package/components/p-CXfntdg5.js.map +1 -0
- package/components/p-C__FBxsY.js +145 -0
- package/components/p-C__FBxsY.js.map +1 -0
- package/components/p-Cdm-Ot0O.js +95 -0
- package/components/p-Cdm-Ot0O.js.map +1 -0
- package/components/p-CeFeBwzQ.js +331 -0
- package/components/p-CeFeBwzQ.js.map +1 -0
- package/components/p-DGFFJaKo.js +168 -0
- package/components/p-DGFFJaKo.js.map +1 -0
- package/components/p-DIe1tcOp.js +197 -0
- package/components/p-DIe1tcOp.js.map +1 -0
- package/components/p-DJOzeqZ-.js +168 -0
- package/components/p-DJOzeqZ-.js.map +1 -0
- package/components/p-DMH_JI3w.js +6 -0
- package/components/p-DMH_JI3w.js.map +1 -0
- package/components/p-DgMhpSmi.js +324 -0
- package/components/p-DgMhpSmi.js.map +1 -0
- package/components/p-TS9NoIOc.js +11 -0
- package/components/p-TS9NoIOc.js.map +1 -0
- package/components/p-V_1wpeJe.js +17 -0
- package/components/p-V_1wpeJe.js.map +1 -0
- package/components/p-dXtLd1df.js +63 -0
- package/components/p-dXtLd1df.js.map +1 -0
- package/components/p-vdzS-daB.js +145 -0
- package/components/p-vdzS-daB.js.map +1 -0
- package/package.json +11 -9
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './index.js';
|
|
2
|
+
import { a as validatePropExists } from './p-CNqFEifG.js';
|
|
3
|
+
import { C as ConsoleMessageClass } from './p-Cdm-Ot0O.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './p-DJOzeqZ-.js';
|
|
5
|
+
import { d as defineCustomElement$1 } from './p-CRMogYVY.js';
|
|
6
|
+
import { v as v4 } from './p-BF0_OXTe.js';
|
|
7
|
+
|
|
8
|
+
const ontarioHintExpanderCss =
|
|
9
|
+
'.ontario-hint-expander__button:focus,.ontario-hint-expander__button:active{box-shadow:0 0 0 4px #009ADB;outline:4px solid transparent;transition:box-shadow 0.1s ease-in-out}.ontario-hint-expander__container{max-width:48rem}.ontario-hint-expander__button{color:#0066CC;cursor:pointer;background:none;border:none;display:flex;align-items:center;font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;font-weight:400;font-size:1rem;text-align:left;margin:0 0 1rem 0;padding:0 0.25rem 0 0}.ontario-hint-expander__button-icon--close{display:none;margin-right:0.25rem}.ontario-hint-expander__button-icon--open{display:inline-block;margin-right:0.25rem}.ontario-hint-expander__button:hover{color:#00478F}.ontario-hint-expander__button:active{color:#002142}.ontario-hint-expander__button>*{pointer-events:none}.ontario-hint-expander__content{border-left:4px solid #cccccc;color:rgb(25.5, 25.5, 25.5);background-color:rgb(242.25, 242.25, 242.25);display:none;padding:1rem 1rem 1rem calc(1rem + 0.25rem);margin:0 0 1rem 0.25rem}.ontario-hint-expander__content *:first-child{margin-top:0}.ontario-hint-expander__content *:last-child{margin-bottom:0}.ontario-hint-expander__content img{width:100%}@media screen and (min-width: 40em){.ontario-hint-expander__content img{width:50%}}.ontario-hint-expander__content.ontario-expander__content--opened{display:block}.ontario-hint-expander__container.ontario-expander--active .ontario-hint-expander__button-icon--close{display:inline-block}.ontario-hint-expander__container.ontario-expander--active .ontario-hint-expander__button-icon--open{display:none}.ontario-hint-expander__checkbox-exists-true{margin:0.75rem 0 0 0.5rem}@media screen and (max-width: 40em){.ontario-hint-expander__checkbox-exists-true{margin-top:1rem}}.ontario-input+.ontario-hint-expander__container{margin-top:-1.5rem !important}.ontario-checkboxes__item .ontario-hint-expander__container,.ontario-radios__item .ontario-hint-expander__container{margin-left:0.5rem}.ontario-checkboxes__label+.ontario-hint-expander__container,.ontario-radios__label+.ontario-hint-expander__container{margin-top:0.75rem}@media screen and (max-width: 40em){.ontario-checkboxes__label+.ontario-hint-expander__container,.ontario-radios__label+.ontario-hint-expander__container{margin-top:1rem}}';
|
|
10
|
+
|
|
11
|
+
const OntarioHintExpander = /*@__PURE__*/ proxyCustomElement(
|
|
12
|
+
class OntarioHintExpander extends H {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.__registerHost();
|
|
16
|
+
this.__attachShadow();
|
|
17
|
+
this.toggleExpanderEvent = createEvent(this, 'toggleExpanderEvent');
|
|
18
|
+
/**
|
|
19
|
+
* The content type of the hint.
|
|
20
|
+
* If no prop is passed, it will default to a string.
|
|
21
|
+
* If the hint requires multiple lines or HTML, the `hintContentType` prop should be set to `html`.
|
|
22
|
+
*/
|
|
23
|
+
this.hintContentType = 'string';
|
|
24
|
+
this.onClick = (ev) => {
|
|
25
|
+
const hintExpander = ev.target;
|
|
26
|
+
const hintExpanderParent =
|
|
27
|
+
hintExpander === null || hintExpander === void 0 ? void 0 : hintExpander.parentElement;
|
|
28
|
+
hintExpanderParent === null || hintExpanderParent === void 0
|
|
29
|
+
? void 0
|
|
30
|
+
: hintExpanderParent.classList.toggle('ontario-expander--active');
|
|
31
|
+
let content =
|
|
32
|
+
hintExpanderParent === null || hintExpanderParent === void 0
|
|
33
|
+
? void 0
|
|
34
|
+
: hintExpanderParent.querySelector("[data-toggle='ontario-expander-content']");
|
|
35
|
+
content === null || content === void 0 ? void 0 : content.classList.toggle('ontario-expander__content--opened');
|
|
36
|
+
(
|
|
37
|
+
content === null || content === void 0
|
|
38
|
+
? void 0
|
|
39
|
+
: content.classList.contains('ontario-expander__content--opened')
|
|
40
|
+
)
|
|
41
|
+
? content.setAttribute('aria-hidden', 'false')
|
|
42
|
+
: content === null || content === void 0
|
|
43
|
+
? void 0
|
|
44
|
+
: content.setAttribute('aria-hidden', 'true');
|
|
45
|
+
(
|
|
46
|
+
hintExpanderParent === null || hintExpanderParent === void 0
|
|
47
|
+
? void 0
|
|
48
|
+
: hintExpanderParent.classList.contains('ontario-expander--active')
|
|
49
|
+
)
|
|
50
|
+
? hintExpanderParent === null || hintExpanderParent === void 0
|
|
51
|
+
? void 0
|
|
52
|
+
: hintExpanderParent.setAttribute('aria-expanded', 'true')
|
|
53
|
+
: hintExpanderParent === null || hintExpanderParent === void 0
|
|
54
|
+
? void 0
|
|
55
|
+
: hintExpanderParent.setAttribute('aria-expanded', 'false');
|
|
56
|
+
this.toggleExpanderEvent.emit(ev);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Watch for changes to the `hintContentType` prop for validation purposes.
|
|
61
|
+
* If none is provided, or the wrong type is provided, it will default to `string`.
|
|
62
|
+
*/
|
|
63
|
+
checkHintContentType() {
|
|
64
|
+
if (this.hintContentType !== 'string' && this.hintContentType !== 'html') {
|
|
65
|
+
const message = new ConsoleMessageClass();
|
|
66
|
+
message
|
|
67
|
+
.addDesignSystemTag()
|
|
68
|
+
.addMonospaceText(' hintContentType ')
|
|
69
|
+
.addRegularText('for')
|
|
70
|
+
.addMonospaceText(' <ontario-hint-text> ')
|
|
71
|
+
.addRegularText('was not one of the permitted types. A default type of `string` will be applied.')
|
|
72
|
+
.printMessage();
|
|
73
|
+
return (this.hintContentType = 'string');
|
|
74
|
+
}
|
|
75
|
+
return this.hintContentType;
|
|
76
|
+
}
|
|
77
|
+
/*
|
|
78
|
+
* Watch for changes in the `hint` prop for validation purposes.
|
|
79
|
+
* If no `hint` prop is provided, the `hint` will be set to the host element textContent (if it exists).
|
|
80
|
+
*/
|
|
81
|
+
updateHintContent() {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
this.hintState =
|
|
84
|
+
(_b = (_a = this.hint) !== null && _a !== void 0 ? _a : this.host.textContent) !== null && _b !== void 0
|
|
85
|
+
? _b
|
|
86
|
+
: '';
|
|
87
|
+
this.validateHint(this.hintState);
|
|
88
|
+
}
|
|
89
|
+
/*
|
|
90
|
+
* Watch for changes to the `content` prop for validation purposes.
|
|
91
|
+
*
|
|
92
|
+
* Validate the `content` and make sure the `content` has a value.
|
|
93
|
+
* Log a warning if user doesn't input a value for the `content` or element content.
|
|
94
|
+
*/
|
|
95
|
+
validateContent(newValue) {
|
|
96
|
+
if (validatePropExists(newValue)) {
|
|
97
|
+
const message = new ConsoleMessageClass();
|
|
98
|
+
message
|
|
99
|
+
.addDesignSystemTag()
|
|
100
|
+
.addMonospaceText(' content ')
|
|
101
|
+
.addRegularText('for')
|
|
102
|
+
.addMonospaceText(' <ontario-hint-expander> ')
|
|
103
|
+
.addRegularText('was not provided')
|
|
104
|
+
.printMessage();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/*
|
|
108
|
+
* Watch for changes in the `hint` prop for validation purposes.
|
|
109
|
+
*
|
|
110
|
+
* Validate the `hint` and make sure the `hint` has a value.
|
|
111
|
+
* Log a warning if user doesn't input a value for the `hint`.
|
|
112
|
+
*/
|
|
113
|
+
validateHint(newValue) {
|
|
114
|
+
if (validatePropExists(newValue)) {
|
|
115
|
+
const message = new ConsoleMessageClass();
|
|
116
|
+
message
|
|
117
|
+
.addDesignSystemTag()
|
|
118
|
+
.addMonospaceText(' hint ')
|
|
119
|
+
.addRegularText('for')
|
|
120
|
+
.addMonospaceText(' <ontario-hint-expander> ')
|
|
121
|
+
.addRegularText('was not provided')
|
|
122
|
+
.printMessage();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Set `hint` using internal component logic
|
|
127
|
+
*/
|
|
128
|
+
componentWillLoad() {
|
|
129
|
+
var _a;
|
|
130
|
+
this.elementId = (_a = this.elementId) !== null && _a !== void 0 ? _a : v4();
|
|
131
|
+
this.updateHintContent();
|
|
132
|
+
this.checkHintContentType();
|
|
133
|
+
this.validateContent(this.content);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* This helper is used to help load translations for any slots + text content passed in by the user.
|
|
137
|
+
*/
|
|
138
|
+
componentDidLoad() {
|
|
139
|
+
const observer = new MutationObserver((mutations) => {
|
|
140
|
+
mutations.forEach((mutation) => {
|
|
141
|
+
if (mutation.type === 'attributes') {
|
|
142
|
+
this.updateHintContent();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
const options = { attributes: true };
|
|
147
|
+
observer.observe(this.host, options);
|
|
148
|
+
}
|
|
149
|
+
getId() {
|
|
150
|
+
var _a;
|
|
151
|
+
return (_a = this.elementId) !== null && _a !== void 0 ? _a : '';
|
|
152
|
+
}
|
|
153
|
+
render() {
|
|
154
|
+
return h(
|
|
155
|
+
'div',
|
|
156
|
+
{ key: '9f18296bf5ede4a16d648b0821f1e26acb813fde', class: 'ontario-hint-expander__container' },
|
|
157
|
+
h(
|
|
158
|
+
'button',
|
|
159
|
+
{
|
|
160
|
+
'key': '3e5c2325098f5b8e77a580e394601f666994ad2a',
|
|
161
|
+
'class': 'ontario-hint-expander__button',
|
|
162
|
+
'onClick': this.onClick,
|
|
163
|
+
'id': `hint-expander-button-${this.getId()}`,
|
|
164
|
+
'aria-controls': `hint-expander-content-${this.getId()}`,
|
|
165
|
+
'aria-expanded': 'false',
|
|
166
|
+
'data-toggle': 'ontario-collapse',
|
|
167
|
+
},
|
|
168
|
+
h(
|
|
169
|
+
'span',
|
|
170
|
+
{
|
|
171
|
+
key: 'f77bd6008272beb4646b70616c1d16d13d8e2722',
|
|
172
|
+
class: 'ontario-hint-expander__button-icon--close ontario-icon',
|
|
173
|
+
},
|
|
174
|
+
h('ontario-icon-chevron-up', {
|
|
175
|
+
'key': '09fe2a1d2d5e68cb7237ed23daf18f4d5d524afc',
|
|
176
|
+
'colour': 'inherit',
|
|
177
|
+
'aria-hidden': 'true',
|
|
178
|
+
}),
|
|
179
|
+
),
|
|
180
|
+
h(
|
|
181
|
+
'span',
|
|
182
|
+
{ key: '66934abdf7d3f29f20a4a966370bfb7ae2ec487c', class: 'ontario-hint-expander__button-icon--open' },
|
|
183
|
+
h('ontario-icon-chevron-down', {
|
|
184
|
+
'key': 'ea41b4ce0d21f9c9f315ec86f82dd26528cd220e',
|
|
185
|
+
'colour': 'inherit',
|
|
186
|
+
'aria-hidden': 'true',
|
|
187
|
+
}),
|
|
188
|
+
),
|
|
189
|
+
this.hint,
|
|
190
|
+
),
|
|
191
|
+
h(
|
|
192
|
+
'div',
|
|
193
|
+
{
|
|
194
|
+
'key': '488bcbb0a0ad44edac9d02f4304c19df6e7d4acf',
|
|
195
|
+
'class': 'ontario-hint-expander__content',
|
|
196
|
+
'id': `hint-expander-content-${this.getId()}`,
|
|
197
|
+
'aria-labelledby': `hint-expander-button-${this.getId()}`,
|
|
198
|
+
'aria-hidden': 'true',
|
|
199
|
+
'data-toggle': 'ontario-expander-content',
|
|
200
|
+
},
|
|
201
|
+
this.hintContentType === 'string' && this.content
|
|
202
|
+
? this.content
|
|
203
|
+
: this.hintContentType === 'html' && this.content
|
|
204
|
+
? h('span', { innerHTML: this.content })
|
|
205
|
+
: h('slot', null),
|
|
206
|
+
),
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
get host() {
|
|
210
|
+
return this;
|
|
211
|
+
}
|
|
212
|
+
static get watchers() {
|
|
213
|
+
return {
|
|
214
|
+
hintContentType: ['checkHintContentType'],
|
|
215
|
+
hint: ['updateHintContent'],
|
|
216
|
+
content: ['validateContent'],
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
static get style() {
|
|
220
|
+
return ontarioHintExpanderCss;
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
[
|
|
224
|
+
257,
|
|
225
|
+
'ontario-hint-expander',
|
|
226
|
+
{
|
|
227
|
+
hintContentType: [1025, 'hint-content-type'],
|
|
228
|
+
hint: [1],
|
|
229
|
+
content: [1025],
|
|
230
|
+
elementId: [1025, 'element-id'],
|
|
231
|
+
hintState: [32],
|
|
232
|
+
},
|
|
233
|
+
undefined,
|
|
234
|
+
{
|
|
235
|
+
hintContentType: ['checkHintContentType'],
|
|
236
|
+
hint: ['updateHintContent'],
|
|
237
|
+
content: ['validateContent'],
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
);
|
|
241
|
+
function defineCustomElement() {
|
|
242
|
+
if (typeof customElements === 'undefined') {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const components = ['ontario-hint-expander', 'ontario-icon-chevron-down', 'ontario-icon-chevron-up'];
|
|
246
|
+
components.forEach((tagName) => {
|
|
247
|
+
switch (tagName) {
|
|
248
|
+
case 'ontario-hint-expander':
|
|
249
|
+
if (!customElements.get(tagName)) {
|
|
250
|
+
customElements.define(tagName, OntarioHintExpander);
|
|
251
|
+
}
|
|
252
|
+
break;
|
|
253
|
+
case 'ontario-icon-chevron-down':
|
|
254
|
+
if (!customElements.get(tagName)) {
|
|
255
|
+
defineCustomElement$2();
|
|
256
|
+
}
|
|
257
|
+
break;
|
|
258
|
+
case 'ontario-icon-chevron-up':
|
|
259
|
+
if (!customElements.get(tagName)) {
|
|
260
|
+
defineCustomElement$1();
|
|
261
|
+
}
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
defineCustomElement();
|
|
267
|
+
|
|
268
|
+
export { OntarioHintExpander as O, defineCustomElement as d };
|
|
269
|
+
//# sourceMappingURL=p-CI209psv.js.map
|
|
270
|
+
|
|
271
|
+
//# sourceMappingURL=p-CI209psv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-CI209psv.js","mappings":"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","names":["__stencil_proxyCustomElement","HTMLElement","uuid"],"sources":["src/components/ontario-hint-expander/ontario-hint-expander.scss?tag=ontario-hint-expander&encapsulation=shadow","src/components/ontario-hint-expander/ontario-hint-expander.tsx"],"sourcesContent":["@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/global.variables' as globalVariables;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/spacing.variables' as spacing;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/colours.variables' as colours;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/breakpoints.variables' as breakpoints;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/fonts.variables' as fonts;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/2-tools/placeholder/focus.placeholders' as\n\tplaceholders;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-sizes.variables' as fontSizes;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-weights.variables' as fontWeights;\n\n.ontario-hint-expander__container {\n\tmax-width: globalVariables.$standard-width;\n}\n\n.ontario-hint-expander__button {\n\tcolor: colours.$ontario-colour-link;\n\tcursor: pointer;\n\tbackground: none;\n\tborder: none;\n\tdisplay: flex;\n\talign-items: center;\n\tfont-family: fonts.$ontario-font-open-sans;\n\tfont-weight: fontWeights.$ontario-font-weights-normal;\n\tfont-size: fontSizes.$ontario-font-size-standard-body-text;\n\ttext-align: left;\n\tmargin: spacing.$spacing-0 spacing.$spacing-0 spacing.$spacing-4 spacing.$spacing-0;\n\tpadding: spacing.$spacing-0 spacing.$spacing-1 spacing.$spacing-0 spacing.$spacing-0;\n\n\t&-icon--close {\n\t\tdisplay: none;\n\t\tmargin-right: spacing.$spacing-1;\n\t}\n\n\t&-icon--open {\n\t\tdisplay: inline-block;\n\t\tmargin-right: spacing.$spacing-1;\n\t}\n\n\t&:hover {\n\t\tcolor: colours.$ontario-colour-link--hover;\n\t}\n\n\t&:active {\n\t\tcolor: colours.$ontario-colour-link--active;\n\t}\n\n\t&:focus,\n\t&:active {\n\t\t@extend %ontario-focus;\n\t}\n\n\t& > * {\n\t\tpointer-events: none;\n\t}\n}\n\n.ontario-hint-expander__content {\n\tborder-left: 4px solid colours.$ontario-greyscale-20;\n\tcolor: colours.$ontario-colour-black;\n\tbackground-color: colours.$ontario-greyscale-5;\n\tdisplay: none;\n\tpadding: spacing.$spacing-4 spacing.$spacing-4 spacing.$spacing-4 calc(#{spacing.$spacing-4} + #{spacing.$spacing-1});\n\tmargin: spacing.$spacing-0 spacing.$spacing-0 spacing.$spacing-4 spacing.$spacing-1;\n\n\t& *:first-child {\n\t\tmargin-top: spacing.$spacing-0;\n\t}\n\n\t& *:last-child {\n\t\tmargin-bottom: spacing.$spacing-0;\n\t}\n\n\t& img {\n\t\twidth: globalVariables.$full-width;\n\n\t\t@media screen and (min-width: breakpoints.$small-breakpoint) {\n\t\t\twidth: 50%;\n\t\t}\n\t}\n}\n\n.ontario-hint-expander__content.ontario-expander__content--opened {\n\tdisplay: block;\n}\n\n.ontario-hint-expander__container.ontario-expander--active {\n\t.ontario-hint-expander__button-icon--close {\n\t\tdisplay: inline-block;\n\t}\n\n\t.ontario-hint-expander__button-icon--open {\n\t\tdisplay: none;\n\t}\n}\n\n.ontario-hint-expander__checkbox-exists-true {\n\tmargin: spacing.$spacing-3 spacing.$spacing-0 spacing.$spacing-0 spacing.$spacing-2;\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\tmargin-top: spacing.$spacing-4;\n\t}\n}\n\n// Fractal component style coverage ↓\n.ontario-input + .ontario-hint-expander__container {\n\tmargin-top: -1 * spacing.$spacing-5 !important;\n}\n\n.ontario-checkboxes__item .ontario-hint-expander__container,\n.ontario-radios__item .ontario-hint-expander__container {\n\tmargin-left: spacing.$spacing-2;\n}\n\n.ontario-checkboxes__label + .ontario-hint-expander__container,\n.ontario-radios__label + .ontario-hint-expander__container {\n\tmargin-top: spacing.$spacing-3;\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\tmargin-top: spacing.$spacing-4;\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, Watch, State } from '@stencil/core';\nimport { v4 as uuid } from 'uuid';\n\nimport { HintExpander } from './hint-expander.interface';\nimport { HintContentType } from '../../utils/common/common.interface';\n\nimport { validatePropExists } from '../../utils/validation/validation-functions';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\n\n@Component({\n\ttag: 'ontario-hint-expander',\n\tstyleUrl: 'ontario-hint-expander.scss',\n\tshadow: true,\n})\nexport class OntarioHintExpander implements HintExpander {\n\t@Element() host: HTMLElement;\n\n\t/**\n\t * The content type of the hint.\n\t * If no prop is passed, it will default to a string.\n\t * If the hint requires multiple lines or HTML, the `hintContentType` prop should be set to `html`.\n\t */\n\t@Prop({ mutable: true }) hintContentType?: HintContentType = 'string';\n\n\t/**\n\t * Text to display as the hint expander question/statement\n\t */\n\t@Prop() hint: string;\n\n\t/**\n\t * Content to display as the hint, once the expander is toggled open.\n\t * Please note that any content that is passed into this prop will only be displayed as a string.\n\t * If you would like to add HTML content, supply child content to the component.\n\t *\n\t * @example\n\t * <ontario-hint-expander hint=\"This is the hint\"\n\t * <img src=\"https://www.jquery-az.com/html/images/banana.jpg\" title=\"Title of image\" alt=\"alt text here\"/>\n\t * <p> Here is the content beside the image </p>\n\t * </ontario-hint-expander>\n\t */\n\t@Prop({ mutable: true }) content: string;\n\n\t/**\n\t * Used to used to establish a relationship between hint text content and elements using aria-describedby. This is optional - if no ID is passed, one will be generated.\n\t */\n\t@Prop({ mutable: true }) elementId?: string;\n\n\t@State() hintState: string;\n\n\t/**\n\t * Emitted when a keyboard input or mouse event occurs.\n\t */\n\t@Event() toggleExpanderEvent!: EventEmitter<MouseEvent | KeyboardEvent>;\n\n\t/**\n\t * Watch for changes to the `hintContentType` prop for validation purposes.\n\t * If none is provided, or the wrong type is provided, it will default to `string`.\n\t */\n\t@Watch('hintContentType')\n\tprivate checkHintContentType() {\n\t\tif (this.hintContentType !== 'string' && this.hintContentType !== 'html') {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' hintContentType ')\n\t\t\t\t.addRegularText('for')\n\t\t\t\t.addMonospaceText(' <ontario-hint-text> ')\n\t\t\t\t.addRegularText('was not one of the permitted types. A default type of `string` will be applied.')\n\t\t\t\t.printMessage();\n\n\t\t\treturn (this.hintContentType = 'string');\n\t\t}\n\n\t\treturn this.hintContentType;\n\t}\n\n\t/*\n\t * Watch for changes in the `hint` prop for validation purposes.\n\t * If no `hint` prop is provided, the `hint` will be set to the host element textContent (if it exists).\n\t */\n\t@Watch('hint')\n\tprivate updateHintContent() {\n\t\tthis.hintState = this.hint ?? this.host.textContent ?? '';\n\t\tthis.validateHint(this.hintState);\n\t}\n\n\t/*\n\t * Watch for changes to the `content` prop for validation purposes.\n\t *\n\t * Validate the `content` and make sure the `content` has a value.\n\t * Log a warning if user doesn't input a value for the `content` or element content.\n\t */\n\t@Watch('content')\n\tvalidateContent(newValue: string) {\n\t\tif (validatePropExists(newValue)) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' content ')\n\t\t\t\t.addRegularText('for')\n\t\t\t\t.addMonospaceText(' <ontario-hint-expander> ')\n\t\t\t\t.addRegularText('was not provided')\n\t\t\t\t.printMessage();\n\t\t}\n\t}\n\n\tprivate onClick = (ev: Event) => {\n\t\tconst hintExpander = ev.target as HTMLButtonElement | null;\n\t\tconst hintExpanderParent = hintExpander?.parentElement;\n\n\t\thintExpanderParent?.classList.toggle('ontario-expander--active');\n\t\tlet content = hintExpanderParent?.querySelector(\"[data-toggle='ontario-expander-content']\");\n\t\tcontent?.classList.toggle('ontario-expander__content--opened');\n\t\tcontent?.classList.contains('ontario-expander__content--opened')\n\t\t\t? content.setAttribute('aria-hidden', 'false')\n\t\t\t: content?.setAttribute('aria-hidden', 'true');\n\t\thintExpanderParent?.classList.contains('ontario-expander--active')\n\t\t\t? hintExpanderParent?.setAttribute('aria-expanded', 'true')\n\t\t\t: hintExpanderParent?.setAttribute('aria-expanded', 'false');\n\n\t\tthis.toggleExpanderEvent.emit(ev as MouseEvent);\n\t};\n\n\t/*\n\t * Watch for changes in the `hint` prop for validation purposes.\n\t *\n\t * Validate the `hint` and make sure the `hint` has a value.\n\t * Log a warning if user doesn't input a value for the `hint`.\n\t */\n\tvalidateHint(newValue: string) {\n\t\tif (validatePropExists(newValue)) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' hint ')\n\t\t\t\t.addRegularText('for')\n\t\t\t\t.addMonospaceText(' <ontario-hint-expander> ')\n\t\t\t\t.addRegularText('was not provided')\n\t\t\t\t.printMessage();\n\t\t}\n\t}\n\n\t/**\n\t * Set `hint` using internal component logic\n\t */\n\tcomponentWillLoad() {\n\t\tthis.elementId = this.elementId ?? uuid();\n\t\tthis.updateHintContent();\n\t\tthis.checkHintContentType();\n\t\tthis.validateContent(this.content);\n\t}\n\n\t/**\n\t * This helper is used to help load translations for any slots + text content passed in by the user.\n\t */\n\tcomponentDidLoad() {\n\t\tconst observer = new MutationObserver((mutations) => {\n\t\t\tmutations.forEach((mutation) => {\n\t\t\t\tif (mutation.type === 'attributes') {\n\t\t\t\t\tthis.updateHintContent();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tconst options = { attributes: true };\n\t\tobserver.observe(this.host, options);\n\t}\n\n\tpublic getId(): string {\n\t\treturn this.elementId ?? '';\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div class=\"ontario-hint-expander__container\">\n\t\t\t\t<button\n\t\t\t\t\tclass=\"ontario-hint-expander__button\"\n\t\t\t\t\tonClick={this.onClick}\n\t\t\t\t\tid={`hint-expander-button-${this.getId()}`}\n\t\t\t\t\taria-controls={`hint-expander-content-${this.getId()}`}\n\t\t\t\t\taria-expanded=\"false\"\n\t\t\t\t\tdata-toggle=\"ontario-collapse\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"ontario-hint-expander__button-icon--close ontario-icon\">\n\t\t\t\t\t\t<ontario-icon-chevron-up colour=\"inherit\" aria-hidden=\"true\"></ontario-icon-chevron-up>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"ontario-hint-expander__button-icon--open\">\n\t\t\t\t\t\t<ontario-icon-chevron-down colour=\"inherit\" aria-hidden=\"true\"></ontario-icon-chevron-down>\n\t\t\t\t\t</span>\n\t\t\t\t\t{this.hint}\n\t\t\t\t</button>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ontario-hint-expander__content\"\n\t\t\t\t\tid={`hint-expander-content-${this.getId()}`}\n\t\t\t\t\taria-labelledby={`hint-expander-button-${this.getId()}`}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdata-toggle=\"ontario-expander-content\"\n\t\t\t\t>\n\t\t\t\t\t{this.hintContentType === 'string' && this.content ? (\n\t\t\t\t\t\tthis.content\n\t\t\t\t\t) : this.hintContentType === 'html' && this.content ? (\n\t\t\t\t\t\t<span innerHTML={this.content}></span>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const constructHintTextObject = (hintText) => {
|
|
2
|
+
let hintTextObject = { hint: '', hintContentType: 'string' };
|
|
3
|
+
if (hintText) {
|
|
4
|
+
if (typeof hintText === 'string') {
|
|
5
|
+
try {
|
|
6
|
+
hintTextObject = JSON.parse(hintText);
|
|
7
|
+
} catch (_a) {
|
|
8
|
+
hintTextObject = { hint: hintText, hintContentType: 'string' };
|
|
9
|
+
}
|
|
10
|
+
} else {
|
|
11
|
+
hintTextObject = hintText;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return hintTextObject;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { constructHintTextObject as c };
|
|
18
|
+
//# sourceMappingURL=p-CIdZS10A.js.map
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=p-CIdZS10A.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-CIdZS10A.js","mappings":"AAEa,MAAA,uBAAuB,GAAG,CAAC,QAAuB,KAAI;IAClE,IAAI,cAAc,GAAS,EAAE,IAAI,EAAE,EAAE,EAAE,eAAe,EAAE,QAAQ,EAAE;IAElE,IAAI,QAAQ,EAAE;AACb,QAAA,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AACjC,YAAA,IAAI;AACH,gBAAA,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAS;;AAC5C,YAAA,OAAA,EAAA,EAAM;gBACP,cAAc,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE;;;aAEzD;YACN,cAAc,GAAG,QAAQ;;;AAI3B,IAAA,OAAO,cAAc;AACtB;;;;","names":[],"sources":["src/utils/components/hints/hints.ts"],"sourcesContent":["import { Hint } from '../../common/common.interface';\n\nexport const constructHintTextObject = (hintText: string | Hint) => {\n\tlet hintTextObject: Hint = { hint: '', hintContentType: 'string' };\n\n\tif (hintText) {\n\t\tif (typeof hintText === 'string') {\n\t\t\ttry {\n\t\t\t\thintTextObject = JSON.parse(hintText) as Hint;\n\t\t\t} catch {\n\t\t\t\thintTextObject = { hint: hintText, hintContentType: 'string' };\n\t\t\t}\n\t\t} else {\n\t\t\thintTextObject = hintText;\n\t\t}\n\t}\n\n\treturn hintTextObject;\n};\n"],"version":3}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './index.js';
|
|
2
|
+
import { C as ConsoleMessageClass } from './p-Cdm-Ot0O.js';
|
|
3
|
+
|
|
4
|
+
const ontarioIconCss =
|
|
5
|
+
'.ontario-icon svg,.ontario-icon{display:inline-block;stroke-width:0;stroke:currentColor;fill:currentColor;vertical-align:middle;overflow:hidden}.ontario-icon--blue svg{stroke:#0066CC;fill:#0066CC}.ontario-icon--grey svg{stroke:#666666;fill:#666666}.ontario-icon--black svg{stroke:#1A1A1A;fill:#1A1A1A}.ontario-icon--white svg{stroke:#FFFFFF;fill:#FFFFFF}.ontario-icon--white svg{stroke:#FFFFFF;fill:#FFFFFF}';
|
|
6
|
+
|
|
7
|
+
const OntarioIconAlertSuccess = /*@__PURE__*/ proxyCustomElement(
|
|
8
|
+
class OntarioIconAlertSuccess extends H {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
/**
|
|
14
|
+
* The icon width will autogenerate the height since the icons are in square format, thus preserving
|
|
15
|
+
* the aspect ratio.
|
|
16
|
+
*/
|
|
17
|
+
this.iconWidth = 24;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Watch for changes in the `iconWidth` variable for validation purpose.
|
|
21
|
+
* If the user input is not a number or is a negative number then `iconWidth` will be set to its default (24).
|
|
22
|
+
*/
|
|
23
|
+
validateWidth() {
|
|
24
|
+
if (isNaN(this.iconWidth) || (!isNaN(this.iconWidth) && this.iconWidth <= 0)) {
|
|
25
|
+
const message = new ConsoleMessageClass();
|
|
26
|
+
message
|
|
27
|
+
.addDesignSystemTag()
|
|
28
|
+
.addMonospaceText(' icon-width ')
|
|
29
|
+
.addRegularText('on')
|
|
30
|
+
.addMonospaceText(' <ontario-icon-alert-success> ')
|
|
31
|
+
.addRegularText(
|
|
32
|
+
`${isNaN(this.iconWidth) ? 'was set to a non-numeric value' : 'was set to a negative number'}; only a positive number is allowed. The default size of`,
|
|
33
|
+
)
|
|
34
|
+
.addMonospaceText(' 24px ')
|
|
35
|
+
.addRegularText('was assumed.')
|
|
36
|
+
.printMessage();
|
|
37
|
+
this.iconWidthState = 24;
|
|
38
|
+
} else {
|
|
39
|
+
this.iconWidthState = this.iconWidth;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Validate that the `colour` attribute is not set by users
|
|
44
|
+
* Prints a warning message if the `colour` attribute is set
|
|
45
|
+
*/
|
|
46
|
+
validateColour() {
|
|
47
|
+
if (this.host.hasAttribute('colour')) {
|
|
48
|
+
const message = new ConsoleMessageClass();
|
|
49
|
+
message
|
|
50
|
+
.addDesignSystemTag()
|
|
51
|
+
.addMonospaceText(' colour ')
|
|
52
|
+
.addRegularText('on')
|
|
53
|
+
.addMonospaceText(' <ontario-icon-alert-success> ')
|
|
54
|
+
.addRegularText('cannot be set. The provided colour is ignored.')
|
|
55
|
+
.printMessage();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Stencil component lifecycle method that is called once after the component is first connected to the DOM.
|
|
60
|
+
*/
|
|
61
|
+
componentWillLoad() {
|
|
62
|
+
this.validateColour();
|
|
63
|
+
this.validateWidth();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns the HTML code to be rendered into a custom element.
|
|
67
|
+
*/
|
|
68
|
+
render() {
|
|
69
|
+
return h(
|
|
70
|
+
'div',
|
|
71
|
+
{
|
|
72
|
+
key: '4555775fd1afc998fa19ca9363015c3f5f13a78f',
|
|
73
|
+
class: `ontario-icon ontario-icon--width-${this.iconWidthState}`,
|
|
74
|
+
style: { width: `${this.iconWidthState}px` },
|
|
75
|
+
},
|
|
76
|
+
h(
|
|
77
|
+
'svg',
|
|
78
|
+
{
|
|
79
|
+
key: '1c45e63acb87f983a596876e0af83cb8ca98b17e',
|
|
80
|
+
class: 'svg-icon',
|
|
81
|
+
role: 'img',
|
|
82
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
83
|
+
fill: 'none',
|
|
84
|
+
viewBox: '0 0 24 24',
|
|
85
|
+
id: 'alert-success',
|
|
86
|
+
},
|
|
87
|
+
h('path', {
|
|
88
|
+
key: '97854a5f82264ddba5800e462ae4ab5dcd1008c7',
|
|
89
|
+
d: 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.4-1.4 3.6 3.58L17.17 7l1.4 1.42L10 17z',
|
|
90
|
+
fill: '#118847',
|
|
91
|
+
}),
|
|
92
|
+
h('path', {
|
|
93
|
+
key: 'c6787bbe00231808d3e7e1632b5a4d32f35b8b53',
|
|
94
|
+
d: 'M5 12l5 5 8.58-8.58L17.17 7 10 14.17 6.4 10.6 5 12z',
|
|
95
|
+
fill: '#fff',
|
|
96
|
+
}),
|
|
97
|
+
),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
get host() {
|
|
101
|
+
return this;
|
|
102
|
+
}
|
|
103
|
+
static get watchers() {
|
|
104
|
+
return {
|
|
105
|
+
iconWidth: ['validateWidth'],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
static get style() {
|
|
109
|
+
return ontarioIconCss;
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
[
|
|
113
|
+
257,
|
|
114
|
+
'ontario-icon-alert-success',
|
|
115
|
+
{
|
|
116
|
+
iconWidth: [2, 'icon-width'],
|
|
117
|
+
iconWidthState: [32],
|
|
118
|
+
},
|
|
119
|
+
undefined,
|
|
120
|
+
{
|
|
121
|
+
iconWidth: ['validateWidth'],
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
);
|
|
125
|
+
function defineCustomElement() {
|
|
126
|
+
if (typeof customElements === 'undefined') {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const components = ['ontario-icon-alert-success'];
|
|
130
|
+
components.forEach((tagName) => {
|
|
131
|
+
switch (tagName) {
|
|
132
|
+
case 'ontario-icon-alert-success':
|
|
133
|
+
if (!customElements.get(tagName)) {
|
|
134
|
+
customElements.define(tagName, OntarioIconAlertSuccess);
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
defineCustomElement();
|
|
141
|
+
|
|
142
|
+
export { OntarioIconAlertSuccess as O, defineCustomElement as d };
|
|
143
|
+
//# sourceMappingURL=p-CNDrx73J.js.map
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=p-CNDrx73J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-CNDrx73J.js","mappings":";;;AAAA,MAAM,cAAc,GAAG,yZAAyZ;;MCWna,uBAAuB,iBAAAA,kBAAA,CAAA,MAAA,uBAAA,SAAAC,CAAA,CAAA;AALpC,IAAA,WAAA,GAAA;;;;AAMC;;;AAGG;AACK,QAAA,IAAS,CAAA,SAAA,GAAa,EAAE;AA4FhC;AApFA;;;AAGG;IAEH,aAAa,GAAA;QACZ,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,EAAE;AAC7E,YAAA,MAAM,OAAO,GAAG,IAAI,mBAAmB,EAAE;YACzC;AACE,iBAAA,kBAAkB;iBAClB,gBAAgB,CAAC,cAAc;iBAC/B,cAAc,CAAC,IAAI;iBACnB,gBAAgB,CAAC,gCAAgC;AACjD,iBAAA,cAAc,CACd,CACC,EAAA,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,gCAAgC,GAAG,8BAC5D,0DAA0D;iBAE1D,gBAAgB,CAAC,QAAQ;iBACzB,cAAc,CAAC,cAAc;AAC7B,iBAAA,YAAY,EAAE;AAChB,YAAA,IAAI,CAAC,cAAc,GAAG,EAAE;;aAClB;AACN,YAAA,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS;;;AAUtC;;;AAGG;IACH,cAAc,GAAA;QACb,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE;AACrC,YAAA,MAAM,OAAO,GAAG,IAAI,mBAAmB,EAAE;YACzC;AACE,iBAAA,kBAAkB;iBAClB,gBAAgB,CAAC,UAAU;iBAC3B,cAAc,CAAC,IAAI;iBACnB,gBAAgB,CAAC,gCAAgC;iBACjD,cAAc,CAAC,gDAAgD;AAC/D,iBAAA,YAAY,EAAE;;;AAIlB;;AAEG;IACH,iBAAiB,GAAA;QAChB,IAAI,CAAC,cAAc,EAAE;QACrB,IAAI,CAAC,aAAa,EAAE;;AAGrB;;AAEG;IACH,MAAM,GAAA;QACL,QACC,4DACC,KAAK,EAAE,CAAoC,iCAAA,EAAA,IAAI,CAAC,cAAc,CAAE,CAAA,EAChE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAG,EAAA,IAAI,CAAC,cAAc,CAAA,EAAA,CAAI,EAAE,EAAA,EAE5C,CACC,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,UAAU,EAChB,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,EACnB,EAAE,EAAC,eAAe,EAAA,EAElB,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACC,CAAC,EAAC,wHAAwH,EAC1H,IAAI,EAAC,SAAS,EACb,CAAA,EACF,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAC,EAAC,qDAAqD,EAAC,IAAI,EAAC,MAAM,EAAG,CAAA,CACvE,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/ontario-icon/ontario-icon.scss?tag=ontario-icon-alert-success&encapsulation=shadow","src/components/ontario-icon/ontario-icon-alert-success.tsx"],"sourcesContent":["@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/colours.variables' as colours;\n\n.ontario-icon svg,\n// Fractal component style coverage ↓\n.ontario-icon {\n\tdisplay: inline-block;\n\tstroke-width: 0;\n\tstroke: currentColor;\n\tfill: currentColor;\n\t/* The default vertical-align is `baseline`, which leaves a few pixels of space below the icon. Using `center` prevents this. For icons shown alongside text, you may want to use a more precise value, e.g. `vertical-align: -4px` or `vertical-align: -0.15em`. */\n\tvertical-align: middle;\n\t/* Paths and strokes that overflow the viewBox can show in IE11. */\n\toverflow: hidden;\n}\n\n.ontario-icon--blue svg {\n\tstroke: colours.$ontario-colour-icon-blue;\n\tfill: colours.$ontario-colour-icon-blue;\n}\n\n.ontario-icon--grey svg {\n\tstroke: colours.$ontario-colour-icon-grey;\n\tfill: colours.$ontario-colour-icon-grey;\n}\n\n.ontario-icon--black svg {\n\tstroke: colours.$ontario-colour-icon-black;\n\tfill: colours.$ontario-colour-icon-black;\n}\n\n.ontario-icon--white svg {\n\tstroke: colours.$ontario-colour-icon-white;\n\tfill: colours.$ontario-colour-icon-white;\n}\n\n.ontario-icon--white svg {\n\tstroke: colours.$ontario-colour-white;\n\tfill: colours.$ontario-colour-white;\n}\n","// content automatically generated by `generate-icons.js` begins\nimport { Component, Prop, h, Watch, State, Element } from '@stencil/core';\nimport { Icon } from './icon.interface';\nimport { IconSize } from './icon.types';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\n\n@Component({\n\ttag: 'ontario-icon-alert-success',\n\tstyleUrl: 'ontario-icon.scss',\n\tshadow: true,\n})\nexport class OntarioIconAlertSuccess implements Icon {\n\t/**\n\t * The icon width will autogenerate the height since the icons are in square format, thus preserving\n\t * the aspect ratio.\n\t */\n\t@Prop() iconWidth: IconSize = 24;\n\n\t/**\n\t * Mutable variable, for internal use only.\n\t * Set the icon's width depending on validation result.\n\t */\n\t@State() iconWidthState: number;\n\n\t/**\n\t * Watch for changes in the `iconWidth` variable for validation purpose.\n\t * If the user input is not a number or is a negative number then `iconWidth` will be set to its default (24).\n\t */\n\t@Watch('iconWidth')\n\tvalidateWidth() {\n\t\tif (isNaN(this.iconWidth) || (!isNaN(this.iconWidth) && this.iconWidth <= 0)) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' icon-width ')\n\t\t\t\t.addRegularText('on')\n\t\t\t\t.addMonospaceText(' <ontario-icon-alert-success> ')\n\t\t\t\t.addRegularText(\n\t\t\t\t\t`${\n\t\t\t\t\t\tisNaN(this.iconWidth) ? 'was set to a non-numeric value' : 'was set to a negative number'\n\t\t\t\t\t}; only a positive number is allowed. The default size of`,\n\t\t\t\t)\n\t\t\t\t.addMonospaceText(' 24px ')\n\t\t\t\t.addRegularText('was assumed.')\n\t\t\t\t.printMessage();\n\t\t\tthis.iconWidthState = 24;\n\t\t} else {\n\t\t\tthis.iconWidthState = this.iconWidth;\n\t\t}\n\t}\n\n\t/**\n\t * Reference to the host element\n\t * Use to check if the host element has the `colour` attribute set\n\t */\n\t@Element() host: HTMLElement;\n\n\t/**\n\t * Validate that the `colour` attribute is not set by users\n\t * Prints a warning message if the `colour` attribute is set\n\t */\n\tvalidateColour() {\n\t\tif (this.host.hasAttribute('colour')) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' colour ')\n\t\t\t\t.addRegularText('on')\n\t\t\t\t.addMonospaceText(' <ontario-icon-alert-success> ')\n\t\t\t\t.addRegularText('cannot be set. The provided colour is ignored.')\n\t\t\t\t.printMessage();\n\t\t}\n\t}\n\n\t/**\n\t * Stencil component lifecycle method that is called once after the component is first connected to the DOM.\n\t */\n\tcomponentWillLoad() {\n\t\tthis.validateColour();\n\t\tthis.validateWidth();\n\t}\n\n\t/**\n\t * Returns the HTML code to be rendered into a custom element.\n\t */\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={`ontario-icon ontario-icon--width-${this.iconWidthState}`}\n\t\t\t\tstyle={{ width: `${this.iconWidthState}px` }}\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"svg-icon\"\n\t\t\t\t\trole=\"img\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tid=\"alert-success\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.4-1.4 3.6 3.58L17.17 7l1.4 1.42L10 17z\"\n\t\t\t\t\t\tfill=\"#118847\"\n\t\t\t\t\t/>\n\t\t\t\t\t<path d=\"M5 12l5 5 8.58-8.58L17.17 7 10 14.17 6.4 10.6 5 12z\" fill=\"#fff\" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t);\n\t}\n}\n// content automatically generated by `generate-icons.js` ends\n"],"version":3}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function validatePropExists(newValue) {
|
|
2
|
+
// Check if new value that is passed in is a string and is not empty
|
|
3
|
+
const isNewValueBlank = typeof newValue !== 'string' || newValue === '';
|
|
4
|
+
// Return true if new value is both a string and is not empty
|
|
5
|
+
return isNewValueBlank;
|
|
6
|
+
}
|
|
7
|
+
function validateObjectExists(newValue) {
|
|
8
|
+
// Check if new value that is passed in is a string and is not empty
|
|
9
|
+
const isNewValueBlank = typeof newValue !== 'object';
|
|
10
|
+
// Return true if new value is both a string and is not empty
|
|
11
|
+
return isNewValueBlank;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Validate value against keys
|
|
15
|
+
* @param value value to be compared against keys
|
|
16
|
+
* @param keys of values provided by caller
|
|
17
|
+
* @returns true if a match is found or false if no matches are found
|
|
18
|
+
*/
|
|
19
|
+
function validateValueAgainstArray(value, keys) {
|
|
20
|
+
return keys.includes(value);
|
|
21
|
+
}
|
|
22
|
+
function validateLanguage(language) {
|
|
23
|
+
if (language) {
|
|
24
|
+
const toggledLanguage = typeof language !== 'string' ? language.detail : language;
|
|
25
|
+
if (toggledLanguage && (toggledLanguage === 'en' || toggledLanguage === 'fr')) return toggledLanguage;
|
|
26
|
+
else return 'en';
|
|
27
|
+
}
|
|
28
|
+
return 'en';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { validatePropExists as a, validateLanguage as b, validateObjectExists as c, validateValueAgainstArray as v };
|
|
32
|
+
//# sourceMappingURL=p-CNqFEifG.js.map
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=p-CNqFEifG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-CNqFEifG.js","mappings":"AAEM,SAAU,kBAAkB,CAAC,QAA8B,EAAA;;IAEhE,MAAM,eAAe,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,EAAE;;AAGvE,IAAA,OAAO,eAAe;AACvB;AAaM,SAAU,oBAAoB,CAAC,QAAgB,EAAA;;AAEpD,IAAA,MAAM,eAAe,GAAG,OAAO,QAAQ,KAAK,QAAQ;;AAGpD,IAAA,OAAO,eAAe;AACvB;AAEA;;;;;AAKG;AACa,SAAA,yBAAyB,CAAmB,KAAQ,EAAE,IAA2B,EAAA;AAChG,IAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC5B;AAEM,SAAU,gBAAgB,CAAC,QAAoD,EAAA;IACpF,IAAI,QAAQ,EAAE;AACb,QAAA,MAAM,eAAe,GAAG,OAAO,QAAQ,KAAK,QAAQ,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ;QACjF,IAAI,eAAe,KAAK,eAAe,KAAK,IAAI,IAAI,eAAe,KAAK,IAAI,CAAC;AAAE,YAAA,OAAO,eAAe;;AAChG,YAAA,OAAO,IAAI;;AAGjB,IAAA,OAAO,IAAI;AACZ;;;;","names":[],"sources":["src/utils/validation/validation-functions.ts"],"sourcesContent":["import { Language } from '../common/language-types';\n\nexport function validatePropExists(newValue: string | HTMLElement): boolean {\n\t// Check if new value that is passed in is a string and is not empty\n\tconst isNewValueBlank = typeof newValue !== 'string' || newValue === '';\n\n\t// Return true if new value is both a string and is not empty\n\treturn isNewValueBlank;\n}\n\n/**\n * Validate value against enumType\n * T must extends String to gain access to the `toLowerCase()` function\n * @param value value to be compared against enumType\n * @param enumType list of enum values provided by caller\n * @returns enum value if a match is found or undefined if no matches are found\n */\nexport function validateValueAgainstEnum<T extends String, E extends Object>(value: T, enumType: E): T {\n\treturn Object.values(enumType).find((type) => type === value.toLowerCase());\n}\n\nexport function validateObjectExists(newValue: object): boolean {\n\t// Check if new value that is passed in is a string and is not empty\n\tconst isNewValueBlank = typeof newValue !== 'object';\n\n\t// Return true if new value is both a string and is not empty\n\treturn isNewValueBlank;\n}\n\n/**\n * Validate value against keys\n * @param value value to be compared against keys\n * @param keys of values provided by caller\n * @returns true if a match is found or false if no matches are found\n */\nexport function validateValueAgainstArray<T extends string>(value: T, keys: ReadonlyArray<string>): boolean {\n\treturn keys.includes(value);\n}\n\nexport function validateLanguage(language: CustomEvent<Language> | string | undefined) {\n\tif (language) {\n\t\tconst toggledLanguage = typeof language !== 'string' ? language.detail : language;\n\t\tif (toggledLanguage && (toggledLanguage === 'en' || toggledLanguage === 'fr')) return toggledLanguage;\n\t\telse return 'en';\n\t}\n\n\treturn 'en';\n}\n"],"version":3}
|