@dropi/ui-components 1.0.0
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/.gitignore +13 -0
- package/CONTRIBUTING.md +188 -0
- package/MIGRATION_STEPS.md +39 -0
- package/PUBLISH_CHECKLIST.md +97 -0
- package/QUICK_START.md +108 -0
- package/README.md +146 -0
- package/jest.config.ts +21 -0
- package/ng-package.json +8 -0
- package/package.json +66 -0
- package/project.json +48 -0
- package/publish.sh +113 -0
- package/src/components-source/accordion/accordion-item/accordion-item.component.html +12 -0
- package/src/components-source/accordion/accordion-item/accordion-item.component.scss +47 -0
- package/src/components-source/accordion/accordion-item/accordion-item.component.spec.ts +122 -0
- package/src/components-source/accordion/accordion-item/accordion-item.component.ts +42 -0
- package/src/components-source/accordion/accordion.component.html +3 -0
- package/src/components-source/accordion/accordion.component.scss +5 -0
- package/src/components-source/accordion/accordion.component.spec.ts +243 -0
- package/src/components-source/accordion/accordion.component.stories.ts +111 -0
- package/src/components-source/accordion/accordion.component.ts +43 -0
- package/src/components-source/alert/alert.component.html +28 -0
- package/src/components-source/alert/alert.component.scss +154 -0
- package/src/components-source/alert/alert.component.spec.ts +185 -0
- package/src/components-source/alert/alert.component.stories.ts +310 -0
- package/src/components-source/alert/alert.component.ts +203 -0
- package/src/components-source/alert-legacy/alert.component.html +21 -0
- package/src/components-source/alert-legacy/alert.component.scss +42 -0
- package/src/components-source/alert-legacy/alert.component.spec.ts +159 -0
- package/src/components-source/alert-legacy/alert.component.ts +33 -0
- package/src/components-source/alert-modal/alert-modal.component.html +124 -0
- package/src/components-source/alert-modal/alert-modal.component.scss +203 -0
- package/src/components-source/alert-modal/alert-modal.component.spec.ts +557 -0
- package/src/components-source/alert-modal/alert-modal.component.stories.ts +295 -0
- package/src/components-source/alert-modal/alert-modal.component.ts +294 -0
- package/src/components-source/alert-modal/services/template-alert-modal.service.ts +75 -0
- package/src/components-source/badge/badge.component.html +49 -0
- package/src/components-source/badge/badge.component.scss +57 -0
- package/src/components-source/badge/badge.component.spec.ts +181 -0
- package/src/components-source/badge/badge.component.ts +21 -0
- package/src/components-source/breadcrumb/breadcrumb.component.html +5 -0
- package/src/components-source/breadcrumb/breadcrumb.component.scss +46 -0
- package/src/components-source/breadcrumb/breadcrumb.component.spec.ts +279 -0
- package/src/components-source/breadcrumb/breadcrumb.component.ts +24 -0
- package/src/components-source/card-product/card-product.component.html +173 -0
- package/src/components-source/card-product/card-product.component.spec.ts +601 -0
- package/src/components-source/card-product/card-product.component.stories.ts +322 -0
- package/src/components-source/card-product/card-product.component.ts +1101 -0
- package/src/components-source/card-section/card-section.component.html +22 -0
- package/src/components-source/card-section/card-section.component.scss +14 -0
- package/src/components-source/card-section/card-section.component.spec.ts +333 -0
- package/src/components-source/card-section/card-section.component.stories.ts +141 -0
- package/src/components-source/card-section/card-section.component.ts +35 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.html +38 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.scss +147 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.spec.ts +555 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.stories.ts +157 -0
- package/src/components-source/checkbox-selection-list/checkbox-selection-list.component.ts +219 -0
- package/src/components-source/city-selector/city-selector.component.html +22 -0
- package/src/components-source/city-selector/city-selector.component.scss +1 -0
- package/src/components-source/city-selector/city-selector.component.spec.ts +278 -0
- package/src/components-source/city-selector/city-selector.component.stories.ts +200 -0
- package/src/components-source/city-selector/city-selector.component.ts +151 -0
- package/src/components-source/color-picker/color-picker.component.html +54 -0
- package/src/components-source/color-picker/color-picker.component.scss +203 -0
- package/src/components-source/color-picker/color-picker.component.spec.ts +148 -0
- package/src/components-source/color-picker/color-picker.component.stories.ts +70 -0
- package/src/components-source/color-picker/color-picker.component.ts +353 -0
- package/src/components-source/country-flags/country-flags.component.html +10 -0
- package/src/components-source/country-flags/country-flags.component.scss +34 -0
- package/src/components-source/country-flags/country-flags.component.spec.ts +78 -0
- package/src/components-source/country-flags/country-flags.component.ts +18 -0
- package/src/components-source/date-picker/date-picker.component.html +35 -0
- package/src/components-source/date-picker/date-picker.component.scss +388 -0
- package/src/components-source/date-picker/date-picker.component.spec.ts +510 -0
- package/src/components-source/date-picker/date-picker.component.stories.ts +444 -0
- package/src/components-source/date-picker/date-picker.component.ts +313 -0
- package/src/components-source/date-picker/date-picker.stories.spec.ts +150 -0
- package/src/components-source/date-picker-range/date-picker-range.component.html +45 -0
- package/src/components-source/date-picker-range/date-picker-range.component.scss +229 -0
- package/src/components-source/date-picker-range/date-picker-range.component.spec.ts +555 -0
- package/src/components-source/date-picker-range/date-picker-range.component.ts +254 -0
- package/src/components-source/dropi-avatars/dropi-avatars.component.html +17 -0
- package/src/components-source/dropi-avatars/dropi-avatars.component.scss +58 -0
- package/src/components-source/dropi-avatars/dropi-avatars.component.spec.ts +403 -0
- package/src/components-source/dropi-avatars/dropi-avatars.component.ts +24 -0
- package/src/components-source/dropi-badge/dropi-badge.component.html +12 -0
- package/src/components-source/dropi-badge/dropi-badge.component.scss +50 -0
- package/src/components-source/dropi-badge/dropi-badge.component.spec.ts +108 -0
- package/src/components-source/dropi-badge/dropi-badge.component.stories.ts +140 -0
- package/src/components-source/dropi-badge/dropi-badge.component.ts +39 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.html +67 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.scss +46 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.spec.ts +170 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.stories.ts +203 -0
- package/src/components-source/dropi-banner-external/dropi-banner-external.component.ts +204 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.html +65 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.scss +65 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.spec.ts +125 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.component.ts +38 -0
- package/src/components-source/dropi-breadcrumb/dropi-breadcrumb.stories.ts +133 -0
- package/src/components-source/dropi-button/dropi-button.component.html +37 -0
- package/src/components-source/dropi-button/dropi-button.component.scss +266 -0
- package/src/components-source/dropi-button/dropi-button.component.spec.ts +264 -0
- package/src/components-source/dropi-button/dropi-button.component.stories.ts +221 -0
- package/src/components-source/dropi-button/dropi-button.component.ts +82 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.html +24 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.scss +85 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.spec.ts +157 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.stories.ts +209 -0
- package/src/components-source/dropi-card-checkbox/dropi-card-checkbox.component.ts +41 -0
- package/src/components-source/dropi-carousel/dropi-carousel.component.html +57 -0
- package/src/components-source/dropi-carousel/dropi-carousel.component.scss +156 -0
- package/src/components-source/dropi-carousel/dropi-carousel.component.spec.ts +224 -0
- package/src/components-source/dropi-carousel/dropi-carousel.component.ts +266 -0
- package/src/components-source/dropi-carousel/dropi-carousel.stories.ts +365 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.css +39 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.html +18 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.spec.ts +155 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.stories.ts +101 -0
- package/src/components-source/dropi-checkbox/dropi-checkbox.component.ts +25 -0
- package/src/components-source/dropi-chips/dropi-chips.component.html +10 -0
- package/src/components-source/dropi-chips/dropi-chips.component.scss +54 -0
- package/src/components-source/dropi-chips/dropi-chips.component.spec.ts +356 -0
- package/src/components-source/dropi-chips/dropi-chips.component.stories.ts +275 -0
- package/src/components-source/dropi-chips/dropi-chips.component.ts +100 -0
- package/src/components-source/dropi-country-selector/countries.data.ts +239 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.html +59 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.scss +126 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.spec.ts +244 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.stories.ts +117 -0
- package/src/components-source/dropi-country-selector/dropi-country-selector.component.ts +179 -0
- package/src/components-source/dropi-drawer/dropi-drawer.component.html +23 -0
- package/src/components-source/dropi-drawer/dropi-drawer.component.scss +88 -0
- package/src/components-source/dropi-drawer/dropi-drawer.component.spec.ts +84 -0
- package/src/components-source/dropi-drawer/dropi-drawer.component.ts +90 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.html +30 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.scss +58 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.spec.ts +213 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.stories.ts +143 -0
- package/src/components-source/dropi-dropdown/dropi-dropdown.component.ts +53 -0
- package/src/components-source/dropi-favorite-button/dropi-favorite-button.component.html +23 -0
- package/src/components-source/dropi-favorite-button/dropi-favorite-button.component.scss +21 -0
- package/src/components-source/dropi-favorite-button/dropi-favorite-button.component.spec.ts +240 -0
- package/src/components-source/dropi-favorite-button/dropi-favorite-button.component.ts +31 -0
- package/src/components-source/dropi-file-upload/card-view/card-view.component.html +154 -0
- package/src/components-source/dropi-file-upload/card-view/card-view.component.scss +118 -0
- package/src/components-source/dropi-file-upload/card-view/card-view.component.ts +72 -0
- package/src/components-source/dropi-file-upload/drop-zone/drop-zone.coment.stories.ts +179 -0
- package/src/components-source/dropi-file-upload/drop-zone/drop-zone.component.html +111 -0
- package/src/components-source/dropi-file-upload/drop-zone/drop-zone.component.scss +90 -0
- package/src/components-source/dropi-file-upload/drop-zone/drop-zone.component.ts +172 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.html +42 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.scss +31 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.spec.ts +398 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.stories.ts +139 -0
- package/src/components-source/dropi-file-upload/dropi-file-upload.component.ts +329 -0
- package/src/components-source/dropi-file-upload/file-list/file-list.component.html +51 -0
- package/src/components-source/dropi-file-upload/file-list/file-list.component.scss +60 -0
- package/src/components-source/dropi-file-upload/file-list/file-list.component.ts +84 -0
- package/src/components-source/dropi-file-upload/grid-view/grid-view.component.html +77 -0
- package/src/components-source/dropi-file-upload/grid-view/grid-view.component.scss +85 -0
- package/src/components-source/dropi-file-upload/grid-view/grid-view.component.ts +35 -0
- package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.html +38 -0
- package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.scss +59 -0
- package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.spec.ts +214 -0
- package/src/components-source/dropi-ilustration-icon/dropi-ilustration-icon.component.ts +65 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.html +54 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.scss +210 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.spec.ts +145 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.component.ts +76 -0
- package/src/components-source/dropi-image-overlay/dropi-image-overlay.stories.ts +267 -0
- package/src/components-source/dropi-languages-selector/dropi-languages-selector.component.html +17 -0
- package/src/components-source/dropi-languages-selector/dropi-languages-selector.component.scss +82 -0
- package/src/components-source/dropi-languages-selector/dropi-languages-selector.component.spec.ts +152 -0
- package/src/components-source/dropi-languages-selector/dropi-languages-selector.component.ts +41 -0
- package/src/components-source/dropi-logo/dropi-logo.component.html +3 -0
- package/src/components-source/dropi-logo/dropi-logo.component.scss +20 -0
- package/src/components-source/dropi-logo/dropi-logo.component.spec.ts +274 -0
- package/src/components-source/dropi-logo/dropi-logo.component.ts +24 -0
- package/src/components-source/dropi-modal/dropi-modal-stack.service.ts +75 -0
- package/src/components-source/dropi-modal/dropi-modal.component.html +55 -0
- package/src/components-source/dropi-modal/dropi-modal.component.scss +274 -0
- package/src/components-source/dropi-modal/dropi-modal.component.spec.ts +46 -0
- package/src/components-source/dropi-modal/dropi-modal.component.stories.ts +392 -0
- package/src/components-source/dropi-modal/dropi-modal.component.ts +392 -0
- package/src/components-source/dropi-modal/p-template.directive.ts +11 -0
- package/src/components-source/dropi-navbar/dropi-navbar.component.html +41 -0
- package/src/components-source/dropi-navbar/dropi-navbar.component.scss +227 -0
- package/src/components-source/dropi-navbar/dropi-navbar.component.spec.ts +110 -0
- package/src/components-source/dropi-navbar/dropi-navbar.component.ts +52 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.html +64 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.scss +43 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.spec.ts +285 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.stories.ts +345 -0
- package/src/components-source/dropi-paginator/dropi-paginator.component.ts +85 -0
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.html +93 -0
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.scss +224 -0
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.spec.ts +376 -0
- package/src/components-source/dropi-phone-input/dropi-phone-input.component.ts +203 -0
- package/src/components-source/dropi-phone-input/numeric-input.directive.ts +17 -0
- package/src/components-source/dropi-radio-button/dropi-radio-button.component.html +8 -0
- package/src/components-source/dropi-radio-button/dropi-radio-button.component.scss +33 -0
- package/src/components-source/dropi-radio-button/dropi-radio-button.component.spec.ts +225 -0
- package/src/components-source/dropi-radio-button/dropi-radio-button.component.ts +48 -0
- package/src/components-source/dropi-search/dropi-search.component.html +124 -0
- package/src/components-source/dropi-search/dropi-search.component.scss +116 -0
- package/src/components-source/dropi-search/dropi-search.component.spec.ts +483 -0
- package/src/components-source/dropi-search/dropi-search.component.stories.ts +267 -0
- package/src/components-source/dropi-search/dropi-search.component.ts +230 -0
- package/src/components-source/dropi-select/dropi-select.component.html +158 -0
- package/src/components-source/dropi-select/dropi-select.component.scss +275 -0
- package/src/components-source/dropi-select/dropi-select.component.spec.ts +386 -0
- package/src/components-source/dropi-select/dropi-select.component.stories.ts +686 -0
- package/src/components-source/dropi-select/dropi-select.component.ts +465 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.html +10 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.scss +28 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.spec.ts +273 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.stories.ts +145 -0
- package/src/components-source/dropi-skeleton/dropi-skeleton.component.ts +30 -0
- package/src/components-source/dropi-steps/dropi-steps.component.html +29 -0
- package/src/components-source/dropi-steps/dropi-steps.component.scss +110 -0
- package/src/components-source/dropi-steps/dropi-steps.component.spec.ts +228 -0
- package/src/components-source/dropi-steps/dropi-steps.component.stories.ts +231 -0
- package/src/components-source/dropi-steps/dropi-steps.component.ts +98 -0
- package/src/components-source/dropi-switch/dropi-switch.component.html +4 -0
- package/src/components-source/dropi-switch/dropi-switch.component.scss +50 -0
- package/src/components-source/dropi-switch/dropi-switch.component.spec.ts +105 -0
- package/src/components-source/dropi-switch/dropi-switch.component.stories.ts +106 -0
- package/src/components-source/dropi-switch/dropi-switch.component.ts +22 -0
- package/src/components-source/dropi-table/dropi-table.component.html +395 -0
- package/src/components-source/dropi-table/dropi-table.component.scss +506 -0
- package/src/components-source/dropi-table/dropi-table.component.spec.ts +578 -0
- package/src/components-source/dropi-table/dropi-table.component.stories.ts +313 -0
- package/src/components-source/dropi-table/dropi-table.component.ts +580 -0
- package/src/components-source/dropi-tag/dropi-tag.component.html +17 -0
- package/src/components-source/dropi-tag/dropi-tag.component.scss +50 -0
- package/src/components-source/dropi-tag/dropi-tag.component.spec.ts +267 -0
- package/src/components-source/dropi-tag/dropi-tag.component.stories.ts +290 -0
- package/src/components-source/dropi-tag/dropi-tag.component.ts +92 -0
- package/src/components-source/dropi-text-area/droip-text-area.component.stories.ts +138 -0
- package/src/components-source/dropi-text-area/dropi-text-area.component.html +63 -0
- package/src/components-source/dropi-text-area/dropi-text-area.component.scss +106 -0
- package/src/components-source/dropi-text-area/dropi-text-area.component.spec.ts +507 -0
- package/src/components-source/dropi-text-area/dropi-text-area.component.ts +80 -0
- package/src/components-source/dropi-tooltip/dropi-tooltip.component.html +70 -0
- package/src/components-source/dropi-tooltip/dropi-tooltip.component.scss +250 -0
- package/src/components-source/dropi-tooltip/dropi-tooltip.component.spec.ts +423 -0
- package/src/components-source/dropi-tooltip/dropi-tooltip.component.ts +153 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.html +20 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.scss +63 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.spec.ts +121 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.component.ts +43 -0
- package/src/components-source/dropi-youtube-lazy-video/dropi-youtube-lazy-video.stories.ts +125 -0
- package/src/components-source/empty-state/empty-state.component.html +30 -0
- package/src/components-source/empty-state/empty-state.component.scss +76 -0
- package/src/components-source/empty-state/empty-state.component.spec.ts +244 -0
- package/src/components-source/empty-state/empty-state.component.stories.ts +198 -0
- package/src/components-source/empty-state/empty-state.component.ts +34 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.html +81 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.scss +86 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.spec.ts +27 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.stories.ts +149 -0
- package/src/components-source/file-upload-progress-bar/file-upload-progress-bar.component.ts +89 -0
- package/src/components-source/foundations/dropi-border-radius-demo/dropi-border-radius-demo.component.scss +32 -0
- package/src/components-source/foundations/dropi-border-radius-demo/dropi-border-radius-demo.component.ts +17 -0
- package/src/components-source/foundations/foundations.component.html +183 -0
- package/src/components-source/foundations/foundations.component.scss +31 -0
- package/src/components-source/foundations/foundations.component.ts +26 -0
- package/src/components-source/icon/icon-names.const.ts +270 -0
- package/src/components-source/icon/icon.component.html +3 -0
- package/src/components-source/icon/icon.component.scss +4 -0
- package/src/components-source/icon/icon.component.spec.ts +304 -0
- package/src/components-source/icon/icon.component.ts +53 -0
- package/src/components-source/index.ts +89 -0
- package/src/components-source/input/input.component.html +97 -0
- package/src/components-source/input/input.component.scss +149 -0
- package/src/components-source/input/input.component.spec.ts +243 -0
- package/src/components-source/input/input.component.stories.ts +269 -0
- package/src/components-source/input/input.component.ts +119 -0
- package/src/components-source/lottie-loader/lottie-loader.component.html +16 -0
- package/src/components-source/lottie-loader/lottie-loader.component.scss +32 -0
- package/src/components-source/lottie-loader/lottie-loader.component.spec.ts +103 -0
- package/src/components-source/lottie-loader/lottie-loader.component.ts +20 -0
- package/src/components-source/otp-send-code/mock-otp-services.ts +214 -0
- package/src/components-source/otp-send-code/otp-send-code.component.html +151 -0
- package/src/components-source/otp-send-code/otp-send-code.component.scss +156 -0
- package/src/components-source/otp-send-code/otp-send-code.component.spec.ts +419 -0
- package/src/components-source/otp-send-code/otp-send-code.component.stories.ts +190 -0
- package/src/components-source/otp-send-code/otp-send-code.component.ts +659 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.html +107 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.scss +280 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.spec.ts +243 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.stories.ts +313 -0
- package/src/components-source/radio-selection-list/radio-selection-list.component.ts +143 -0
- package/src/components-source/read-more/read-more.component.html +14 -0
- package/src/components-source/read-more/read-more.component.scss +16 -0
- package/src/components-source/read-more/read-more.component.spec.ts +272 -0
- package/src/components-source/read-more/read-more.component.stories.ts +131 -0
- package/src/components-source/read-more/read-more.component.ts +88 -0
- package/src/components-source/sidebar/sidebar.component.html +42 -0
- package/src/components-source/sidebar/sidebar.component.scss +70 -0
- package/src/components-source/sidebar/sidebar.component.spec.ts +354 -0
- package/src/components-source/sidebar/sidebar.component.stories.ts +145 -0
- package/src/components-source/sidebar/sidebar.component.ts +105 -0
- package/src/components-source/simple-stepper/simple-stepper.component.html +17 -0
- package/src/components-source/simple-stepper/simple-stepper.component.scss +117 -0
- package/src/components-source/simple-stepper/simple-stepper.component.spec.ts +348 -0
- package/src/components-source/simple-stepper/simple-stepper.component.stories.ts +104 -0
- package/src/components-source/simple-stepper/simple-stepper.component.ts +69 -0
- package/src/components-source/storybook-doc-components/avatars-storybook/avatars-storybook.component.html +192 -0
- package/src/components-source/storybook-doc-components/avatars-storybook/avatars-storybook.component.scss +15 -0
- package/src/components-source/storybook-doc-components/avatars-storybook/avatars-storybook.component.ts +17 -0
- package/src/components-source/storybook-doc-components/border-radius-storybook/border-radius-storybook.component.html +22 -0
- package/src/components-source/storybook-doc-components/border-radius-storybook/border-radius-storybook.component.scss +0 -0
- package/src/components-source/storybook-doc-components/border-radius-storybook/border-radius-storybook.component.ts +54 -0
- package/src/components-source/storybook-doc-components/breakpoints-and-grids-storybook/breakpoints-and-grids-storybook.component.css +81 -0
- package/src/components-source/storybook-doc-components/breakpoints-and-grids-storybook/breakpoints-and-grids-storybook.component.html +143 -0
- package/src/components-source/storybook-doc-components/breakpoints-and-grids-storybook/breakpoints-and-grids-storybook.component.ts +97 -0
- package/src/components-source/storybook-doc-components/colors-storybook/colors-storybook.component.css +10 -0
- package/src/components-source/storybook-doc-components/colors-storybook/colors-storybook.component.html +63 -0
- package/src/components-source/storybook-doc-components/colors-storybook/colors-storybook.component.ts +542 -0
- package/src/components-source/storybook-doc-components/dropi-modal/dropi-modal.component.html +132 -0
- package/src/components-source/storybook-doc-components/dropi-modal/dropi-modal.component.scss +15 -0
- package/src/components-source/storybook-doc-components/dropi-modal/dropi-modal.component.ts +67 -0
- package/src/components-source/storybook-doc-components/dropi-toast/dropi-toast.component.html +156 -0
- package/src/components-source/storybook-doc-components/dropi-toast/dropi-toast.component.scss +13 -0
- package/src/components-source/storybook-doc-components/dropi-toast/dropi-toast.component.ts +55 -0
- package/src/components-source/storybook-doc-components/flags-storybook/flags-storybook.component.css +0 -0
- package/src/components-source/storybook-doc-components/flags-storybook/flags-storybook.component.html +99 -0
- package/src/components-source/storybook-doc-components/flags-storybook/flags-storybook.component.ts +19 -0
- package/src/components-source/storybook-doc-components/icons-storybook/icons-storybook.component.css +82 -0
- package/src/components-source/storybook-doc-components/icons-storybook/icons-storybook.component.html +111 -0
- package/src/components-source/storybook-doc-components/icons-storybook/icons-storybook.component.ts +196 -0
- package/src/components-source/storybook-doc-components/logo-storybook/logo-foundations.component.ts +19 -0
- package/src/components-source/storybook-doc-components/logo-storybook/logo-storybook.component.css +0 -0
- package/src/components-source/storybook-doc-components/logo-storybook/logo-storybook.component.html +104 -0
- package/src/components-source/storybook-doc-components/lustration-storybook/lustration-storybook.component.css +0 -0
- package/src/components-source/storybook-doc-components/lustration-storybook/lustration-storybook.component.html +218 -0
- package/src/components-source/storybook-doc-components/lustration-storybook/lustration-storybook.component.ts +20 -0
- package/src/components-source/storybook-doc-components/shadow-storybook/shadow-storybook.component.html +21 -0
- package/src/components-source/storybook-doc-components/shadow-storybook/shadow-storybook.component.scss +0 -0
- package/src/components-source/storybook-doc-components/shadow-storybook/shadow-storybook.component.ts +66 -0
- package/src/components-source/storybook-doc-components/spacing-storybook/spacing-storybook.component.html +33 -0
- package/src/components-source/storybook-doc-components/spacing-storybook/spacing-storybook.component.scss +0 -0
- package/src/components-source/storybook-doc-components/spacing-storybook/spacing-storybook.component.ts +37 -0
- package/src/components-source/storybook-doc-components/story-page/story-page.component.html +74 -0
- package/src/components-source/storybook-doc-components/story-page/story-page.component.scss +103 -0
- package/src/components-source/storybook-doc-components/story-page/story-page.component.ts +424 -0
- package/src/components-source/storybook-doc-components/template-breakpoint-storybook/template-breakpoint-storybook.component.html +35 -0
- package/src/components-source/storybook-doc-components/template-breakpoint-storybook/template-breakpoint-storybook.component.scss +64 -0
- package/src/components-source/storybook-doc-components/template-breakpoint-storybook/template-breakpoint-storybook.component.ts +71 -0
- package/src/components-source/storybook-doc-components/tillte-table-documentation/tillte-table-documentation.component.html +44 -0
- package/src/components-source/storybook-doc-components/tillte-table-documentation/tillte-table-documentation.component.scss +270 -0
- package/src/components-source/storybook-doc-components/tillte-table-documentation/tillte-table-documentation.component.ts +153 -0
- package/src/components-source/tabs/tabs.component.html +26 -0
- package/src/components-source/tabs/tabs.component.scss +62 -0
- package/src/components-source/tabs/tabs.component.spec.ts +212 -0
- package/src/components-source/tabs/tabs.component.stories.ts +203 -0
- package/src/components-source/tabs/tabs.component.ts +138 -0
- package/src/components-source/tag-type-product/tag-type-product.component.html +1 -0
- package/src/components-source/tag-type-product/tag-type-product.component.scss +10 -0
- package/src/components-source/tag-type-product/tag-type-product.component.spec.ts +38 -0
- package/src/components-source/tag-type-product/tag-type-product.component.ts +9 -0
- package/src/components-source/toast/toast.component.html +37 -0
- package/src/components-source/toast/toast.component.scss +142 -0
- package/src/components-source/toast/toast.component.spec.ts +368 -0
- package/src/components-source/toast/toast.component.ts +59 -0
- package/src/components-source/toast/toast.stories.ts +69 -0
- package/src/components-source/tooltip/tooltip.component.html +46 -0
- package/src/components-source/tooltip/tooltip.component.scss +44 -0
- package/src/components-source/tooltip/tooltip.component.spec.ts +327 -0
- package/src/components-source/tooltip/tooltip.component.ts +24 -0
- package/src/components-source/ui-dropi.module.ts +125 -0
- package/src/components-source/ui-inventory.json +1138 -0
- package/src/components-source/vertical-steps/vertical-steps.component.html +35 -0
- package/src/components-source/vertical-steps/vertical-steps.component.scss +143 -0
- package/src/components-source/vertical-steps/vertical-steps.component.spec.ts +121 -0
- package/src/components-source/vertical-steps/vertical-steps.component.stories.ts +216 -0
- package/src/components-source/vertical-steps/vertical-steps.component.ts +151 -0
- package/src/index.ts +31 -0
- package/src/lib/bootstrap.ts +28 -0
- package/src/lib/dropi-ui-elements/dropi-ui-elements.component.html +1 -0
- package/src/lib/dropi-ui-elements/dropi-ui-elements.component.scss +0 -0
- package/src/lib/dropi-ui-elements/dropi-ui-elements.component.spec.ts +21 -0
- package/src/lib/dropi-ui-elements/dropi-ui-elements.component.ts +9 -0
- package/src/lib/elements-registry.ts +66 -0
- package/src/lib/elements.module.ts +22 -0
- package/src/styles.scss +152 -0
- package/src/test-setup.ts +6 -0
- package/tsconfig.json +28 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +12 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/angular';
|
|
2
|
+
import { action } from '@storybook/addon-actions';
|
|
3
|
+
import { AlertComponent } from './alert.component';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* # Alert Component
|
|
7
|
+
*
|
|
8
|
+
* A notification component for displaying important messages to users.
|
|
9
|
+
* Alerts can convey success, error, warning, or informational messages.
|
|
10
|
+
*
|
|
11
|
+
* ## Features
|
|
12
|
+
* - **Multiple states**: success, error, warning, info
|
|
13
|
+
* - **Types**: default (inline) or flag (prominent)
|
|
14
|
+
* - **Dismissable**: Optional close button
|
|
15
|
+
* - **Action button**: Optional button for user actions
|
|
16
|
+
* - **HTML support**: Message can contain HTML for rich formatting
|
|
17
|
+
*
|
|
18
|
+
* ## Usage
|
|
19
|
+
* ```html
|
|
20
|
+
* <app-alert
|
|
21
|
+
* message="Operation completed successfully"
|
|
22
|
+
* state="success"
|
|
23
|
+
* [dismissable]="true"
|
|
24
|
+
* (onClose)="handleClose()">
|
|
25
|
+
* </app-alert>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
const meta: Meta<AlertComponent> = {
|
|
29
|
+
title: 'UI Dropi/Alert',
|
|
30
|
+
component: AlertComponent,
|
|
31
|
+
tags: ['autodocs'],
|
|
32
|
+
parameters: {
|
|
33
|
+
layout: 'centered',
|
|
34
|
+
docs: {
|
|
35
|
+
description: {
|
|
36
|
+
component: `
|
|
37
|
+
A notification component for displaying important messages to users.
|
|
38
|
+
Alerts can convey success, error, warning, or informational messages.
|
|
39
|
+
|
|
40
|
+
### Key Features
|
|
41
|
+
- **Multiple states**: success, error, warning, info
|
|
42
|
+
- **Types**: default (inline) or flag (prominent)
|
|
43
|
+
- **Dismissable**: Optional close button
|
|
44
|
+
- **Action button**: Optional button for user actions
|
|
45
|
+
- **HTML support**: Message can contain HTML for rich formatting
|
|
46
|
+
`,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
argTypes: {
|
|
51
|
+
message: {
|
|
52
|
+
description: 'The alert message text. Supports HTML tags for formatting.',
|
|
53
|
+
control: 'text',
|
|
54
|
+
table: {
|
|
55
|
+
type: { summary: 'string' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
type: {
|
|
59
|
+
description: 'Alert display type. "default" for inline, "flag" for prominent display.',
|
|
60
|
+
control: 'radio',
|
|
61
|
+
options: ['default', 'flag'],
|
|
62
|
+
table: {
|
|
63
|
+
type: { summary: 'string' },
|
|
64
|
+
defaultValue: { summary: 'default' },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
state: {
|
|
68
|
+
description: 'Visual state indicating the alert severity or meaning.',
|
|
69
|
+
control: 'radio',
|
|
70
|
+
options: ['success', 'error', 'warning', 'info'],
|
|
71
|
+
table: {
|
|
72
|
+
type: { summary: 'string' },
|
|
73
|
+
defaultValue: { summary: 'success' },
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
dismissable: {
|
|
77
|
+
description: 'Whether the alert can be closed by the user.',
|
|
78
|
+
control: 'boolean',
|
|
79
|
+
table: {
|
|
80
|
+
type: { summary: 'boolean' },
|
|
81
|
+
defaultValue: { summary: 'true' },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
showButton: {
|
|
85
|
+
description: 'Whether to show an action button.',
|
|
86
|
+
control: 'boolean',
|
|
87
|
+
table: {
|
|
88
|
+
type: { summary: 'boolean' },
|
|
89
|
+
defaultValue: { summary: 'false' },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
buttonText: {
|
|
93
|
+
description: 'Text displayed on the action button.',
|
|
94
|
+
control: 'text',
|
|
95
|
+
table: {
|
|
96
|
+
type: { summary: 'string' },
|
|
97
|
+
defaultValue: { summary: 'Close' },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
showAlert: {
|
|
101
|
+
description: 'Controls the visibility of the alert.',
|
|
102
|
+
control: 'boolean',
|
|
103
|
+
table: {
|
|
104
|
+
type: { summary: 'boolean' },
|
|
105
|
+
defaultValue: { summary: 'true' },
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
args: {
|
|
110
|
+
onClose: action('onClose'),
|
|
111
|
+
onButtonClick: action('onButtonClick'),
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export default meta;
|
|
116
|
+
type Story = StoryObj<AlertComponent>;
|
|
117
|
+
|
|
118
|
+
/** Default success alert */
|
|
119
|
+
export const Default: Story = {
|
|
120
|
+
args: {
|
|
121
|
+
message: 'This is an alert message',
|
|
122
|
+
type: 'default',
|
|
123
|
+
state: 'success',
|
|
124
|
+
dismissable: true,
|
|
125
|
+
showButton: false,
|
|
126
|
+
buttonText: 'Close',
|
|
127
|
+
showAlert: true,
|
|
128
|
+
},
|
|
129
|
+
parameters: {
|
|
130
|
+
design: {
|
|
131
|
+
type: 'figma',
|
|
132
|
+
url: 'https://www.figma.com/design/ONiVQJJ2qrJ6tmJnpNrrKE/%5BWEB%5D-components?node-id=26-199&p=f&m=dev',
|
|
133
|
+
},
|
|
134
|
+
docs: {
|
|
135
|
+
description: {
|
|
136
|
+
story: 'Default inline alert with success state. Use for positive feedback messages.',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/** Alert with HTML formatted message */
|
|
143
|
+
export const DefaultAlertWithHtml: Story = {
|
|
144
|
+
args: {
|
|
145
|
+
...Default.args,
|
|
146
|
+
message:
|
|
147
|
+
'<b>Request created successfully</b> Your order is <b>on its way</b> to your delivery address.',
|
|
148
|
+
},
|
|
149
|
+
parameters: {
|
|
150
|
+
docs: {
|
|
151
|
+
description: {
|
|
152
|
+
story: 'Alert supporting HTML content for rich text formatting like bold, links, etc.',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
/** Flag-style alert with prominent display */
|
|
159
|
+
export const FlagAlertWithHtml: Story = {
|
|
160
|
+
args: {
|
|
161
|
+
...Default.args,
|
|
162
|
+
type: 'flag',
|
|
163
|
+
message:
|
|
164
|
+
'<b>Request created successfully</b> Your order is <b>on its way</b> to your delivery address.',
|
|
165
|
+
},
|
|
166
|
+
parameters: {
|
|
167
|
+
docs: {
|
|
168
|
+
description: {
|
|
169
|
+
story:
|
|
170
|
+
'Flag-type alert with more prominent visual display. Use for important notifications.',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/** Error alert for failure messages */
|
|
177
|
+
export const DefaultErrorAlert: Story = {
|
|
178
|
+
args: {
|
|
179
|
+
...Default.args,
|
|
180
|
+
state: 'error',
|
|
181
|
+
message: 'An unexpected error occurred',
|
|
182
|
+
},
|
|
183
|
+
parameters: {
|
|
184
|
+
docs: {
|
|
185
|
+
description: {
|
|
186
|
+
story: 'Error state alert for displaying failure or error messages.',
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/** Warning alert for caution messages */
|
|
193
|
+
export const DefaultWarningAlert: Story = {
|
|
194
|
+
args: {
|
|
195
|
+
...Default.args,
|
|
196
|
+
state: 'warning',
|
|
197
|
+
message: 'Warning: This action cannot be undone',
|
|
198
|
+
},
|
|
199
|
+
parameters: {
|
|
200
|
+
docs: {
|
|
201
|
+
description: {
|
|
202
|
+
story: 'Warning state alert for cautionary messages that require user attention.',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/** Informational alert */
|
|
209
|
+
export const DefaultInfoAlert: Story = {
|
|
210
|
+
args: {
|
|
211
|
+
...Default.args,
|
|
212
|
+
state: 'info',
|
|
213
|
+
message: 'Important information for the user',
|
|
214
|
+
},
|
|
215
|
+
parameters: {
|
|
216
|
+
docs: {
|
|
217
|
+
description: {
|
|
218
|
+
story: 'Info state alert for neutral informational messages.',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
/** Alert with action button */
|
|
225
|
+
export const DefaultAlertWithButton: Story = {
|
|
226
|
+
args: {
|
|
227
|
+
...Default.args,
|
|
228
|
+
showButton: true,
|
|
229
|
+
},
|
|
230
|
+
parameters: {
|
|
231
|
+
docs: {
|
|
232
|
+
description: {
|
|
233
|
+
story: 'Alert with an action button that can trigger custom actions.',
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
/** Alert with custom button text */
|
|
240
|
+
export const DefaultAlertWithButtonAndProvidedButtonText: Story = {
|
|
241
|
+
args: {
|
|
242
|
+
...Default.args,
|
|
243
|
+
showButton: true,
|
|
244
|
+
buttonText: 'Accept',
|
|
245
|
+
},
|
|
246
|
+
parameters: {
|
|
247
|
+
docs: {
|
|
248
|
+
description: {
|
|
249
|
+
story: 'Alert with customized button text for specific call-to-actions.',
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
export const DefaultAlertWithoutDismiss: Story = {
|
|
256
|
+
args: {
|
|
257
|
+
...Default.args,
|
|
258
|
+
dismissable: false,
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
export const DefaultLinkInfo: Story = {
|
|
263
|
+
args: {
|
|
264
|
+
...Default.args,
|
|
265
|
+
state: 'info',
|
|
266
|
+
message: 'Información importante para el usuario',
|
|
267
|
+
textLink: 'Ir a dropi',
|
|
268
|
+
linkUrl: 'https://dropi.co/',
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export const FlagSuccessAlert: Story = {
|
|
273
|
+
args: {
|
|
274
|
+
...Default.args,
|
|
275
|
+
type: 'flag',
|
|
276
|
+
state: 'success',
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export const FlagErrorAlert: Story = {
|
|
281
|
+
args: {
|
|
282
|
+
...Default.args,
|
|
283
|
+
type: 'flag',
|
|
284
|
+
state: 'error',
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
export const FlagWarningAlert: Story = {
|
|
289
|
+
args: {
|
|
290
|
+
...Default.args,
|
|
291
|
+
type: 'flag',
|
|
292
|
+
state: 'warning',
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
export const FlagInfoAlert: Story = {
|
|
297
|
+
args: {
|
|
298
|
+
...Default.args,
|
|
299
|
+
type: 'flag',
|
|
300
|
+
state: 'info',
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
export const FlagAlertWithoutDismiss: Story = {
|
|
305
|
+
args: {
|
|
306
|
+
...Default.args,
|
|
307
|
+
type: 'flag',
|
|
308
|
+
dismissable: false,
|
|
309
|
+
},
|
|
310
|
+
};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
EventEmitter,
|
|
4
|
+
Input,
|
|
5
|
+
OnChanges,
|
|
6
|
+
OnInit,
|
|
7
|
+
Output,
|
|
8
|
+
SimpleChanges,
|
|
9
|
+
} from '@angular/core';
|
|
10
|
+
import { CommonModule } from '@angular/common';
|
|
11
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
12
|
+
import { animate, keyframes, style, transition, trigger } from '@angular/animations';
|
|
13
|
+
|
|
14
|
+
import { IconComponent } from '../icon/icon.component';
|
|
15
|
+
import { ButtonComponent } from '../dropi-button/dropi-button.component';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Componente que muestra una alerta en la pantalla.
|
|
19
|
+
*
|
|
20
|
+
* Basado en: https://www.figma.com/design/ONiVQJJ2qrJ6tmJnpNrrKE/%5BWEB%5D-components?node-id=26-199&p=f&m=dev
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <app-alert
|
|
24
|
+
* [message]="'Este es un mensaje de alerta'"
|
|
25
|
+
* [type]="'default'"
|
|
26
|
+
* [state]="'success'"
|
|
27
|
+
* [dismissable]="true"
|
|
28
|
+
* [showButton]="true"
|
|
29
|
+
* [buttonText]="'Cerrar'"
|
|
30
|
+
* ></app-alert>
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <app-alert
|
|
34
|
+
* [message]="'Este es un <b>mensaje</b> de alerta'"
|
|
35
|
+
* [type]="'flag'"
|
|
36
|
+
* [state]="'error'"
|
|
37
|
+
* [dismissable]="false"
|
|
38
|
+
* [showButton]="false"
|
|
39
|
+
* [buttonText]="'Cerrar'"
|
|
40
|
+
* ></app-alert>
|
|
41
|
+
*
|
|
42
|
+
* @param message Texto del mensaje que se mostrar, puede contener etiquetas HTML.
|
|
43
|
+
* @param type Tipo de alerta que se mostrar (default o flag).
|
|
44
|
+
* @param state Estado de la alerta (success, error, warning o info).
|
|
45
|
+
* @param dismissable Si se puede cerrar la alerta.
|
|
46
|
+
* @param showButton Si se mostrar el bot n de cierre.
|
|
47
|
+
* @param buttonText Texto del bot n de cierre.
|
|
48
|
+
* @param textLink Texto del link
|
|
49
|
+
* @param linkUrl Url del link
|
|
50
|
+
*/
|
|
51
|
+
@Component({
|
|
52
|
+
selector: 'app-alert',
|
|
53
|
+
standalone: true,
|
|
54
|
+
imports: [CommonModule, IconComponent, ButtonComponent],
|
|
55
|
+
templateUrl: './alert.component.html',
|
|
56
|
+
styleUrls: ['./alert.component.scss'],
|
|
57
|
+
animations: [
|
|
58
|
+
trigger('fade', [
|
|
59
|
+
transition(':enter', [
|
|
60
|
+
animate(
|
|
61
|
+
'300ms ease-out',
|
|
62
|
+
keyframes([
|
|
63
|
+
style({ opacity: 0, transform: 'translateY(-20px)', offset: 0 }),
|
|
64
|
+
style({ opacity: 0.5, transform: 'translateY(-10px)', offset: 0.5 }),
|
|
65
|
+
style({ opacity: 1, transform: 'translateY(0)', offset: 1 }),
|
|
66
|
+
]),
|
|
67
|
+
),
|
|
68
|
+
]),
|
|
69
|
+
transition(':leave', [
|
|
70
|
+
animate(
|
|
71
|
+
'300ms ease-in',
|
|
72
|
+
keyframes([
|
|
73
|
+
style({ opacity: 1, transform: 'translateY(0)', offset: 0 }),
|
|
74
|
+
style({ opacity: 0.5, transform: 'translateY(-10px)', offset: 0.5 }),
|
|
75
|
+
style({ opacity: 0, transform: 'translateY(-20px)', offset: 1 }),
|
|
76
|
+
]),
|
|
77
|
+
),
|
|
78
|
+
]),
|
|
79
|
+
]),
|
|
80
|
+
],
|
|
81
|
+
})
|
|
82
|
+
export class AlertComponent implements OnInit, OnChanges {
|
|
83
|
+
/** Texto del mensaje que se mostrará en la alerta. Puede contener etiquetas HTML */
|
|
84
|
+
@Input() message: string = '';
|
|
85
|
+
|
|
86
|
+
/** Tipo de alerta que se mostrar (default o flag) */
|
|
87
|
+
@Input() type: 'default' | 'flag' = 'default';
|
|
88
|
+
|
|
89
|
+
/** Estado de la alerta (success, error, warning o info) */
|
|
90
|
+
@Input() state: 'success' | 'error' | 'warning' | 'info' = 'success';
|
|
91
|
+
|
|
92
|
+
/** Si se puede cerrar la alerta */
|
|
93
|
+
@Input() dismissable: boolean = true;
|
|
94
|
+
|
|
95
|
+
/** Si se mostrar el botón de cierre */
|
|
96
|
+
@Input() showButton: boolean = false;
|
|
97
|
+
|
|
98
|
+
/** Texto del botón de cierre */
|
|
99
|
+
@Input() buttonText: string = 'Close';
|
|
100
|
+
|
|
101
|
+
@Input() anchorText: string = 'none';
|
|
102
|
+
|
|
103
|
+
@Input() anchorUrl: string = 'none';
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Indica si la alerta debe ser visible.
|
|
107
|
+
* Por defecto es `true`.
|
|
108
|
+
*/
|
|
109
|
+
@Input() showAlert = true;
|
|
110
|
+
|
|
111
|
+
/** Texto del link */
|
|
112
|
+
@Input() textLink: string;
|
|
113
|
+
|
|
114
|
+
/** funcion clickeable del texto */
|
|
115
|
+
@Input() clickedText: string = '';
|
|
116
|
+
|
|
117
|
+
/** Url del link */
|
|
118
|
+
@Input() linkUrl: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Emite un evento cuando se cierra la alerta.
|
|
122
|
+
*/
|
|
123
|
+
@Output() onClose = new EventEmitter<void>();
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Emite un evento cuando se hace click en el botón opcional.
|
|
127
|
+
*/
|
|
128
|
+
@Output() onButtonClick = new EventEmitter<void>();
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Emite un evento cuando se hace click en el botón opcional.
|
|
132
|
+
*/
|
|
133
|
+
@Output() onClickLink = new EventEmitter<void>();
|
|
134
|
+
|
|
135
|
+
sanitinezedMessage: SafeHtml;
|
|
136
|
+
alertState = {
|
|
137
|
+
success: {
|
|
138
|
+
icon: 'Check-circle',
|
|
139
|
+
color: 'Success-Success-500',
|
|
140
|
+
anchorStyle: 'color: var(--Success-Success-500);',
|
|
141
|
+
},
|
|
142
|
+
error: {
|
|
143
|
+
icon: 'Cross-circle',
|
|
144
|
+
color: 'Error-Error-500',
|
|
145
|
+
anchorStyle: 'color: var(--Error-Error-500);',
|
|
146
|
+
},
|
|
147
|
+
warning: {
|
|
148
|
+
icon: 'Warning-circle',
|
|
149
|
+
color: 'Warning-Warning-500',
|
|
150
|
+
anchorStyle: 'color: var(--Warning-Warning-500);',
|
|
151
|
+
},
|
|
152
|
+
info: {
|
|
153
|
+
icon: 'Info',
|
|
154
|
+
color: 'Info-Info-500',
|
|
155
|
+
anchorStyle: 'color: var(--Info-Info-500);',
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
constructor(private readonly sanitizer: DomSanitizer) {}
|
|
160
|
+
|
|
161
|
+
ngOnInit() {
|
|
162
|
+
this.sanitizeMessage();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
166
|
+
if (!changes.firstChange) this.sanitizeMessage();
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Sanitiza el mensaje de la alerta para que pueda incluir una etiqueta <a> con un enlace
|
|
171
|
+
* y un texto de enlace. Si no se proporciona texto de enlace ni url, se devuelve el
|
|
172
|
+
* mensaje sanitizado.
|
|
173
|
+
*/
|
|
174
|
+
sanitizeMessage() {
|
|
175
|
+
if (!this.textLink || !this.linkUrl) {
|
|
176
|
+
this.sanitinezedMessage = this.sanitizer.bypassSecurityTrustHtml(this.message);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const message = `${this.message} <a style="${this.alertState[this.state].anchorStyle}" href="${this.linkUrl}" target="_blank"> ${this.textLink} </a>`;
|
|
181
|
+
this.sanitinezedMessage = this.sanitizer.bypassSecurityTrustHtml(message);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Cierra la alerta.
|
|
186
|
+
* Llama a la función closeAlert() y cambia el valor de showAlert a false.
|
|
187
|
+
*/
|
|
188
|
+
closeAlert() {
|
|
189
|
+
this.showAlert = false;
|
|
190
|
+
this.onClose.emit();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Emite un evento cuando se hace click en el botón opcional.
|
|
195
|
+
*/
|
|
196
|
+
buttonClick() {
|
|
197
|
+
this.onButtonClick.emit();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
emitClickLink(e) {
|
|
201
|
+
this.onClickLink.emit(e);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div
|
|
2
|
+
*ngIf="visible"
|
|
3
|
+
class="alert-base"
|
|
4
|
+
[ngClass]="{ success: type === 'success', error: type === 'error', warning: type === 'warning' }"
|
|
5
|
+
>
|
|
6
|
+
<div class="content-type">
|
|
7
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
8
|
+
<path
|
|
9
|
+
d="M13.2048 7.23238L14.2516 8.29488L9.93225 12.5501C9.6437 12.8387 9.26418 12.9826 8.88317 12.9826C8.50216 12.9826 8.11892 12.8372 7.82738 12.5464L5.75309 10.5362L6.79173 9.46475L8.87423 11.4831L13.2048 7.23238ZM18.9475 10.0001C18.9475 14.9338 14.9338 18.9475 10.0001 18.9475C5.06637 18.9475 1.05273 14.9338 1.05273 10.0001C1.05273 5.06637 5.06637 1.05273 10.0001 1.05273C14.9338 1.05273 18.9475 5.06637 18.9475 10.0001ZM17.4562 10.0001C17.4562 5.88879 14.1114 2.54396 10.0001 2.54396C5.88879 2.54396 2.54396 5.88879 2.54396 10.0001C2.54396 14.1114 5.88879 17.4562 10.0001 17.4562C14.1114 17.4562 17.4562 14.1114 17.4562 10.0001Z"
|
|
10
|
+
fill="#078560"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
<p>
|
|
14
|
+
{{ message }}
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="close">
|
|
19
|
+
<i class="pi pi-times" (click)="closeAlert()" style="color: #708090; cursor: pointer"></i>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.alert-base {
|
|
2
|
+
display: flex;
|
|
3
|
+
padding: 8px 12px;
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
align-self: stretch;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
&.success {
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
border: 1px solid var(--Success-success-400, #3bc99f);
|
|
13
|
+
background: var(--Success-success-50, #e7f8f3);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.content-type {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 8px;
|
|
20
|
+
p {
|
|
21
|
+
color: var(--Gray-gray-900, #495057);
|
|
22
|
+
font-family: Inter;
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
line-height: 20px;
|
|
27
|
+
margin: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.close {
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
|
|
38
|
+
svg {
|
|
39
|
+
fill: #7b8190;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|