@internetarchive/elements 1.11.0-webdev-9043.0 → 1.11.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/README.md +4 -43
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.js +39 -42
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.js +21 -27
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js +1 -2
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js +21 -25
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js +16 -20
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js +26 -30
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js +29 -33
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.d.ts +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.js +22 -28
- package/dist/src/elements/ia-book-actions/ia-book-actions.js.map +1 -1
- package/dist/src/elements/ia-button/ia-button.d.ts +34 -21
- package/dist/src/elements/ia-button/ia-button.d.ts.map +1 -1
- package/dist/src/elements/ia-button/ia-button.js +176 -277
- package/dist/src/elements/ia-button/ia-button.js.map +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.d.ts +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.d.ts.map +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js +102 -131
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js.map +1 -1
- package/dist/src/elements/ia-combo-box/ia-combo-box.d.ts.map +1 -1
- package/dist/src/elements/ia-combo-box/ia-combo-box.js +20 -40
- package/dist/src/elements/ia-combo-box/ia-combo-box.js.map +1 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js +3 -9
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts +0 -5
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js +5 -10
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js +4 -4
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts +0 -5
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js +3 -11
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js +16 -19
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js +11 -12
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js +5 -5
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts +0 -5
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js +6 -14
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form.js +4 -6
- package/dist/src/elements/ia-donation-form/ia-donation-form.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js +4 -4
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js +10 -10
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js.map +1 -1
- package/dist/src/elements/ia-donation-thermometer/ia-donation-thermometer.js +13 -13
- package/dist/src/elements/ia-donation-thermometer/ia-donation-thermometer.js.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-dropdown.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-dropdown.js +27 -113
- package/dist/src/elements/ia-dropdown/ia-dropdown.js.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-icon-label.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-icon-label.js +5 -11
- package/dist/src/elements/ia-dropdown/ia-icon-label.js.map +1 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js +35 -79
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js +141 -156
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.d.ts.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.js +43 -47
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.d.ts.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js +34 -39
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.d.ts.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js +112 -118
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.d.ts.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js +42 -45
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.d.ts.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js +239 -245
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js.map +1 -1
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.d.ts.map +1 -1
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.js +17 -24
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-image-viewer.js +1 -1
- package/dist/src/elements/ia-image-viewer/ia-image-viewer.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.d.ts.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js +7 -8
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js +7 -7
- package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.d.ts.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.js +65 -72
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.js.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/story-support/ia-infinite-scroller-demo-tile.js +1 -1
- package/dist/src/elements/ia-infinite-scroller/story-support/ia-infinite-scroller-demo-tile.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.js +5 -8
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-button.js +5 -5
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-button.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.js +6 -6
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.js +4 -5
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.js +13 -13
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.js +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js +11 -11
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js.map +1 -1
- package/dist/src/elements/ia-otp-form/ia-otp-form.js +4 -4
- package/dist/src/elements/ia-otp-form/ia-otp-form.js.map +1 -1
- package/dist/src/elements/ia-otp-input/ia-otp-input.d.ts.map +1 -1
- package/dist/src/elements/ia-otp-input/ia-otp-input.js +4 -21
- package/dist/src/elements/ia-otp-input/ia-otp-input.js.map +1 -1
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.d.ts.map +1 -1
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.js +81 -85
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.js.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-radio-player.d.ts.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-radio-player.js +140 -146
- package/dist/src/elements/ia-radio-player/ia-radio-player.js.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.d.ts.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js +30 -37
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review-form.d.ts.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review-form.js +21 -28
- package/dist/src/elements/ia-reviews/ia-review-form.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review.d.ts.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review.js +66 -70
- package/dist/src/elements/ia-reviews/ia-review.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-reviews.d.ts.map +1 -1
- package/dist/src/elements/ia-reviews/ia-reviews.js +12 -24
- package/dist/src/elements/ia-reviews/ia-reviews.js.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js +132 -155
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.d.ts.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js +56 -63
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js.map +1 -1
- package/dist/src/elements/ia-topnav/dropdown-menu.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/dropdown-menu.js +10 -41
- package/dist/src/elements/ia-topnav/dropdown-menu.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js +2 -3
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.d.ts +2 -2
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js +10 -23
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.js +4 -2
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.js +12 -18
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js +4 -2
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js +0 -2
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js +0 -2
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js +0 -2
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js +13 -12
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js +0 -2
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js +3 -10
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js +2 -2
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.js +42 -45
- package/dist/src/elements/ia-topnav/ia-topnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/lib/register-topnav-unit.d.ts +25 -13
- package/dist/src/elements/ia-topnav/lib/register-topnav-unit.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/lib/register-topnav-unit.js +32 -17
- package/dist/src/elements/ia-topnav/lib/register-topnav-unit.js.map +1 -1
- package/dist/src/elements/ia-topnav/subnav-list-styles.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/subnav-list-styles.js +1 -8
- package/dist/src/elements/ia-topnav/subnav-list-styles.js.map +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.d.ts.map +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.js +173 -192
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.js.map +1 -1
- package/dist/src/elements/ia-userlist-settings/ia-userlist-settings.d.ts +70 -0
- package/dist/src/elements/ia-userlist-settings/ia-userlist-settings.d.ts.map +1 -0
- package/dist/src/elements/ia-userlist-settings/ia-userlist-settings.js +314 -0
- package/dist/src/elements/ia-userlist-settings/ia-userlist-settings.js.map +1 -0
- package/dist/src/elements/ia-userlist-settings/mocks/mock-userlist-service.d.ts +37 -0
- package/dist/src/elements/ia-userlist-settings/mocks/mock-userlist-service.d.ts.map +1 -0
- package/dist/src/elements/ia-userlist-settings/mocks/mock-userlist-service.js +71 -0
- package/dist/src/elements/ia-userlist-settings/mocks/mock-userlist-service.js.map +1 -0
- package/dist/src/elements/ia-userlist-settings/models.d.ts +10 -0
- package/dist/src/elements/ia-userlist-settings/models.d.ts.map +1 -0
- package/dist/src/elements/ia-userlist-settings/models.js +2 -0
- package/dist/src/elements/ia-userlist-settings/models.js.map +1 -0
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.d.ts.map +1 -1
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.js +47 -56
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.js.map +1 -1
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.d.ts.map +1 -1
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js +27 -46
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js.map +1 -1
- package/dist/src/elements/modal-manager/ia-modal-manager-template.d.ts.map +1 -1
- package/dist/src/elements/modal-manager/ia-modal-manager-template.js +48 -66
- package/dist/src/elements/modal-manager/ia-modal-manager-template.js.map +1 -1
- package/dist/src/elements/modal-manager/modal-manager.d.ts.map +1 -1
- package/dist/src/elements/modal-manager/modal-manager.js +2 -7
- package/dist/src/elements/modal-manager/modal-manager.js.map +1 -1
- package/dist/src/services/userlist-service/mocks/sample-lists-backend.d.ts +29 -0
- package/dist/src/services/userlist-service/mocks/sample-lists-backend.d.ts.map +1 -0
- package/dist/src/services/userlist-service/mocks/sample-lists-backend.js +173 -0
- package/dist/src/services/userlist-service/mocks/sample-lists-backend.js.map +1 -0
- package/dist/src/themes/theme-styles.d.ts.map +1 -1
- package/dist/src/themes/theme-styles.js +50 -98
- package/dist/src/themes/theme-styles.js.map +1 -1
- package/package.json +5 -23
- package/dist/src/elements/ia-topnav/focus-styles.d.ts +0 -11
- package/dist/src/elements/ia-topnav/focus-styles.d.ts.map +0 -1
- package/dist/src/elements/ia-topnav/focus-styles.js +0 -22
- package/dist/src/elements/ia-topnav/focus-styles.js.map +0 -1
- package/dist/src/themes/tokens.d.ts +0 -14
- package/dist/src/themes/tokens.d.ts.map +0 -1
- package/dist/src/themes/tokens.js +0 -267
- package/dist/src/themes/tokens.js.map +0 -1
- package/dist/src/themes/unit.d.ts +0 -16
- package/dist/src/themes/unit.d.ts.map +0 -1
- package/dist/src/themes/unit.js +0 -70
- package/dist/src/themes/unit.js.map +0 -1
|
@@ -214,28 +214,28 @@ let IADonationThermometer = class IADonationThermometer extends LitElement {
|
|
|
214
214
|
:host {
|
|
215
215
|
--donation-thermometer-height--: var(
|
|
216
216
|
--ia-donation-thermometer-height,
|
|
217
|
-
|
|
217
|
+
20px
|
|
218
218
|
);
|
|
219
219
|
--donation-thermometer-fill-color--: var(
|
|
220
220
|
--ia-donation-thermometer-fill-color,
|
|
221
|
-
|
|
221
|
+
#23765d
|
|
222
222
|
);
|
|
223
223
|
--donation-thermometer-track-color--: var(
|
|
224
224
|
--ia-donation-thermometer-track-color,
|
|
225
|
-
|
|
225
|
+
#b8f5e2
|
|
226
226
|
);
|
|
227
227
|
--donation-thermometer-border--: var(
|
|
228
228
|
--ia-donation-thermometer-border,
|
|
229
|
-
var(--
|
|
230
|
-
var(--donation-thermometer-fill-color--)
|
|
229
|
+
1px solid var(--donation-thermometer-fill-color--)
|
|
231
230
|
);
|
|
231
|
+
/* Large enough to round any height into a pill */
|
|
232
232
|
--donation-thermometer-border-radius--: var(
|
|
233
233
|
--ia-donation-thermometer-border-radius,
|
|
234
|
-
|
|
234
|
+
9999px
|
|
235
235
|
);
|
|
236
236
|
--donation-thermometer-value-on-fill-color--: var(
|
|
237
237
|
--ia-donation-thermometer-value-on-fill-color,
|
|
238
|
-
var(--
|
|
238
|
+
var(--true-white)
|
|
239
239
|
);
|
|
240
240
|
--donation-thermometer-value-on-track-color--: var(
|
|
241
241
|
--ia-donation-thermometer-value-on-track-color,
|
|
@@ -244,7 +244,7 @@ let IADonationThermometer = class IADonationThermometer extends LitElement {
|
|
|
244
244
|
--donation-thermometer-goal-color--: var(--primary-text-color);
|
|
245
245
|
--donation-thermometer-goal-padding--: var(
|
|
246
246
|
--ia-donation-thermometer-goal-padding,
|
|
247
|
-
0
|
|
247
|
+
0 10px
|
|
248
248
|
);
|
|
249
249
|
|
|
250
250
|
display: block;
|
|
@@ -310,30 +310,30 @@ let IADonationThermometer = class IADonationThermometer extends LitElement {
|
|
|
310
310
|
width: max-content;
|
|
311
311
|
display: flex;
|
|
312
312
|
align-items: center;
|
|
313
|
-
font-weight:
|
|
313
|
+
font-weight: bold;
|
|
314
314
|
white-space: nowrap;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
/*
|
|
318
|
-
* Both paddings total
|
|
318
|
+
* Both paddings total 1.5rem, so changing sides leaves the label the
|
|
319
319
|
* same width and cannot feed back into the side it is placed on.
|
|
320
320
|
*/
|
|
321
321
|
.value-left .thermometer-value {
|
|
322
322
|
transform: translateX(-100%);
|
|
323
323
|
color: var(--donation-thermometer-value-on-fill-color--);
|
|
324
|
-
padding: 0
|
|
324
|
+
padding: 0 0.5rem 0 1rem;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
.value-right .thermometer-value {
|
|
328
328
|
color: var(--donation-thermometer-value-on-track-color--);
|
|
329
|
-
padding: 0
|
|
329
|
+
padding: 0 1rem 0 0.5rem;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
.donate-goal {
|
|
333
333
|
text-align: left;
|
|
334
334
|
padding: var(--donation-thermometer-goal-padding--);
|
|
335
335
|
text-transform: uppercase;
|
|
336
|
-
font-weight:
|
|
336
|
+
font-weight: bold;
|
|
337
337
|
color: var(--donation-thermometer-goal-color--);
|
|
338
338
|
}
|
|
339
339
|
`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-donation-thermometer.js","sourceRoot":"","sources":["../../../../src/elements/ia-donation-thermometer/ia-donation-thermometer.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,GAGR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAQnD;;;;;GAKG;AAGI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;IAA9C;;QACuB,oBAAe,GA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n html,\n LitElement,\n nothing,\n type CSSResultGroup,\n type TemplateResult,\n} from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\nimport { localized, msg, str } from '@lit/localize';\n\nimport themeStyles from '@src/themes/theme-styles';\n\n/** What the text beside the bar says: the goal amount, a message, or nothing. */\nexport type GoalMessageMode = 'off' | 'amount' | 'message';\n\n/** Whether the current amount is printed on the bar. */\nexport type CurrentAmountMode = 'on' | 'off';\n\n/**\n * A horizontal progress bar for a fundraising goal, as shown in the\n * archive.org donation banner. The fill grows with `currentAmount`, the amount\n * raised is printed on the fill when it fits and beside it when it doesn't,\n * and the goal (or a goal message) sits to the right of the bar.\n */\n@customElement('ia-donation-thermometer')\n@localized()\nexport class IADonationThermometer extends LitElement {\n @property({ type: String }) goalMessageMode: GoalMessageMode = 'amount';\n\n /**\n * The message shown when the goal is near. Empty shows the built-in message\n * in the current language.\n */\n @property({ type: String }) goalNearMessage = '';\n\n /**\n * The message shown when the goal is reached. Empty shows the built-in\n * message in the current language.\n */\n @property({ type: String }) goalReachedMessage = '';\n\n /**\n * The accessible name of the progress bar, for screen readers. Empty uses\n * the built-in name in the current language.\n */\n @property({ type: String }) label = '';\n\n @property({ type: Number }) goalAmount = 7_500_000;\n\n @property({ type: String }) currentAmountMode: CurrentAmountMode = 'on';\n\n @property({ type: Number }) currentAmount = 0;\n\n @query('.thermometer-value') private thermometerValue?: HTMLDivElement;\n\n @query('.thermometer-fill') private thermometerFill?: HTMLDivElement;\n\n @state() private thermometerValueWidth = 0;\n\n @state() private thermometerFillWidth = 0;\n\n /**\n * Watches the fill and the value label so the label can move to whichever\n * side of the fill has room for it.\n */\n private resizeObserver?: ResizeObserver;\n\n /**\n * The observed nodes are tracked so each is observed exactly once. Calling\n * `observe` on an already-observed target re-reports its size, which costs a\n * notification on every render. Lit also discards the value label when\n * `currentAmountMode` turns it off, so a replacement has to be picked up.\n */\n private observedFillElement: Element | null = null;\n\n private observedValueElement: Element | null = null;\n\n render(): TemplateResult {\n return html`\n <div class=\"thermometer-message-container\">\n <div class=\"thermometer-container\">\n <div\n class=\"thermometer-background ${this.thermometerValuePosition}\"\n style=\"--fill-end--: ${this.percentComplete}%\"\n role=\"progressbar\"\n aria-label=\"${this.label || msg('Donation progress')}\"\n aria-valuemin=\"0\"\n aria-valuemax=\"${this.progressMax}\"\n aria-valuenow=\"${this.progressValue}\"\n aria-valuetext=\"${this.currentAmountDisplayValue}\"\n >\n <div class=\"thermometer-clip\">\n <div class=\"thermometer-fill\"></div>\n </div>\n ${this.thermometerValueTemplate}\n </div>\n </div>\n ${this.goalMessageMode !== 'off'\n ? html`<div class=\"donate-goal\">${this.currentGoalMessage}</div>`\n : nothing}\n </div>\n `;\n }\n\n private get thermometerValueTemplate(): TemplateResult | typeof nothing {\n return this.currentAmountMode === 'off'\n ? nothing\n : html`\n <div class=\"thermometer-value\">${this.currentAmountDisplayValue}</div>\n `;\n }\n\n /**\n * Which side of the fill's end the value label sits on, as a class name for\n * the CSS that places it. The label sits over the fill when the fill is\n * wider than the label plus a little breathing room, and just past the\n * fill's right edge otherwise.\n */\n private get thermometerValuePosition(): 'value-left' | 'value-right' {\n const buffer = 10;\n return this.thermometerValueWidth + buffer < this.thermometerFillWidth\n ? 'value-left'\n : 'value-right';\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.resizeObserver = new ResizeObserver((entries) =>\n this.handleResize(entries),\n );\n // On a re-connect the fill already exists; on first connect it doesn't\n // until the first render, and `updated` picks it up then.\n this.observeParts();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.resizeObserver?.disconnect();\n this.resizeObserver = undefined;\n this.observedFillElement = null;\n this.observedValueElement = null;\n }\n\n updated(): void {\n this.observeParts();\n }\n\n /** Observes the fill and the value label, picking up either if it is replaced. */\n private observeParts(): void {\n const observer = this.resizeObserver;\n if (!observer) return;\n\n this.observedFillElement = this.observeInPlaceOf(\n observer,\n this.observedFillElement,\n this.thermometerFill ?? null,\n );\n this.observedValueElement = this.observeInPlaceOf(\n observer,\n this.observedValueElement,\n this.thermometerValue ?? null,\n );\n }\n\n /**\n * Swaps `observed` for `current` on the observer and returns whichever is\n * now being watched. A target that hasn't changed is left alone.\n */\n private observeInPlaceOf(\n observer: ResizeObserver,\n observed: Element | null,\n current: Element | null,\n ): Element | null {\n if (current === observed) return observed;\n if (observed) observer.unobserve(observed);\n if (current) observer.observe(current);\n return current;\n }\n\n private handleResize(entries: ResizeObserverEntry[]): void {\n for (const entry of entries) {\n const width =\n entry.borderBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;\n if (entry.target === this.observedFillElement) {\n this.thermometerFillWidth = width;\n } else if (entry.target === this.observedValueElement) {\n this.thermometerValueWidth = width;\n }\n }\n }\n\n private get goalMessage(): string {\n return this.currentAmount >= this.goalAmount\n ? this.goalReachedMessage || msg('We’ve reached our goal!')\n : this.goalNearMessage || msg('We’ve almost reached our goal!');\n }\n\n private get currentAmountDisplayValue(): string {\n return this.formatNumber(this.currentAmount);\n }\n\n private get goalAmountDisplayValue(): string {\n return this.formatNumber(this.goalAmount);\n }\n\n /**\n * Formats a dollar amount in millions, e.g. `$0.5MM` or `$35MM`. Amounts\n * under ten million keep one decimal place, larger ones round to a whole\n * number.\n */\n private formatNumber(number: number): string {\n if (!Number.isFinite(number) || number === 0) return '$0';\n const suffix = 'MM';\n const divisor = 1_000_000;\n const result = number / divisor;\n const roundToOne = result < 10;\n const rounded = roundToOne\n ? Math.round((result + Number.EPSILON) * 10) / 10\n : Math.round(result);\n return `$${rounded}${suffix}`;\n }\n\n private get currentGoalMessage(): string {\n switch (this.goalMessageMode) {\n case 'amount':\n return msg(str`${this.goalAmountDisplayValue} goal`);\n case 'message':\n return this.goalMessage;\n case 'off':\n return '';\n }\n }\n\n /**\n * The goal the bar measures against. A goal that isn't a positive, finite\n * number leaves the bar empty, since there is no range to report progress\n * against. Named clear of `ariaValueMax`, which `HTMLElement` declares as a\n * public string.\n */\n private get progressMax(): number {\n return Number.isFinite(this.goalAmount) && this.goalAmount > 0\n ? this.goalAmount\n : 0;\n }\n\n /**\n * The progress reported to screen readers, clamped into the\n * `aria-valuemin`/`aria-valuemax` range the spec requires.\n * `aria-valuetext` carries the amount as it is displayed.\n */\n private get progressValue(): number {\n if (!Number.isFinite(this.currentAmount)) return 0;\n return Math.min(Math.max(this.currentAmount, 0), this.progressMax);\n }\n\n /**\n * How much of the bar is filled, as a percentage, clamped to `0`-`100`. An\n * amount or goal that can't produce a usable percentage empties the bar.\n */\n private get percentComplete(): number {\n const goal = this.progressMax;\n if (goal === 0 || !Number.isFinite(this.currentAmount)) return 0;\n const percent = (this.currentAmount / goal) * 100;\n return Math.min(Math.max(percent, 0), 100);\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n css`\n :host {\n --donation-thermometer-height--: var(\n --ia-donation-thermometer-height,\n calc(20 * var(--ia-unit, 1px))\n );\n --donation-thermometer-fill-color--: var(\n --ia-donation-thermometer-fill-color,\n var(--ia-color-action-donate-fill--)\n );\n --donation-thermometer-track-color--: var(\n --ia-donation-thermometer-track-color,\n var(--ia-color-action-donate-subtle--)\n );\n --donation-thermometer-border--: var(\n --ia-donation-thermometer-border,\n var(--ia-size-border-width--) solid\n var(--donation-thermometer-fill-color--)\n );\n --donation-thermometer-border-radius--: var(\n --ia-donation-thermometer-border-radius,\n var(--ia-radius-pill--)\n );\n --donation-thermometer-value-on-fill-color--: var(\n --ia-donation-thermometer-value-on-fill-color,\n var(--ia-color-action-donate-text--)\n );\n --donation-thermometer-value-on-track-color--: var(\n --ia-donation-thermometer-value-on-track-color,\n var(--donation-thermometer-fill-color--)\n );\n --donation-thermometer-goal-color--: var(--primary-text-color);\n --donation-thermometer-goal-padding--: var(\n --ia-donation-thermometer-goal-padding,\n 0 var(--ia-space-2--)\n );\n\n display: block;\n height: var(--donation-thermometer-height--);\n }\n\n .thermometer-message-container {\n height: 100%;\n display: flex;\n align-items: center;\n }\n\n .thermometer-container {\n height: 100%;\n flex: 1;\n }\n\n .thermometer-background {\n box-sizing: border-box;\n position: relative;\n background-color: var(--donation-thermometer-track-color--);\n height: 100%;\n border-radius: var(--donation-thermometer-border-radius--);\n border: var(--donation-thermometer-border--);\n }\n\n /*\n * Clips the square-ended fill to the rounded track. It covers only the\n * fill, so the label is never cut off by it.\n */\n .thermometer-clip {\n position: absolute;\n inset: 0;\n overflow: hidden;\n border-radius: var(--donation-thermometer-border-radius--);\n }\n\n .thermometer-fill {\n background-color: var(--donation-thermometer-fill-color--);\n height: 100%;\n /*\n * The fallback matters: without it a missing --fill-end-- makes the\n * declaration invalid, width resolves to auto, and the bar paints as\n * a fully funded fundraiser.\n */\n width: var(--fill-end--, 0%);\n }\n\n /*\n * The label is placed by offset from the end of the fill, so it is one\n * node in one position in the DOM whichever side it shows on, and it\n * never counts towards the width of the fill it is measured against.\n */\n .thermometer-value {\n position: absolute;\n top: 0;\n bottom: 0;\n left: var(--fill-end--, 0%);\n /*\n * Without this, the left offset caps the shrink-to-fit width of a\n * translated label and it collapses to its padding.\n */\n width: max-content;\n display: flex;\n align-items: center;\n font-weight: var(--ia-font-weight-bold--);\n white-space: nowrap;\n }\n\n /*\n * Both paddings total 15px, so changing sides leaves the label the\n * same width and cannot feed back into the side it is placed on.\n */\n .value-left .thermometer-value {\n transform: translateX(-100%);\n color: var(--donation-thermometer-value-on-fill-color--);\n padding: 0 var(--ia-space-1--) 0 var(--ia-space-2--);\n }\n\n .value-right .thermometer-value {\n color: var(--donation-thermometer-value-on-track-color--);\n padding: 0 var(--ia-space-2--) 0 var(--ia-space-1--);\n }\n\n .donate-goal {\n text-align: left;\n padding: var(--donation-thermometer-goal-padding--);\n text-transform: uppercase;\n font-weight: var(--ia-font-weight-bold--);\n color: var(--donation-thermometer-goal-color--);\n }\n `,\n ];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-donation-thermometer': IADonationThermometer;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ia-donation-thermomet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AAY;AAEX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAAwB;AAEvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gEAA6C;AAE5C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAmB;AAET;IAApC,KAAK,CAAC,oBAAoB,CAAC;+DAA2C;AAEnC;IAAnC,KAAK,CAAC,mBAAmB,CAAC;8DAA0C;AAEpD;IAAhB,KAAK,EAAE;oEAAmC;AAE1B;IAAhB,KAAK,EAAE;mEAAkC;AAjC/B,qBAAqB;IAFjC,aAAa,CAAC,yBAAyB,CAAC;IACxC,SAAS,EAAE;GACC,qBAAqB,CAoXjC","sourcesContent":["import {\n css,\n html,\n LitElement,\n nothing,\n type CSSResultGroup,\n type TemplateResult,\n} from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\nimport { localized, msg, str } from '@lit/localize';\n\nimport themeStyles from '@src/themes/theme-styles';\n\n/** What the text beside the bar says: the goal amount, a message, or nothing. */\nexport type GoalMessageMode = 'off' | 'amount' | 'message';\n\n/** Whether the current amount is printed on the bar. */\nexport type CurrentAmountMode = 'on' | 'off';\n\n/**\n * A horizontal progress bar for a fundraising goal, as shown in the\n * archive.org donation banner. The fill grows with `currentAmount`, the amount\n * raised is printed on the fill when it fits and beside it when it doesn't,\n * and the goal (or a goal message) sits to the right of the bar.\n */\n@customElement('ia-donation-thermometer')\n@localized()\nexport class IADonationThermometer extends LitElement {\n @property({ type: String }) goalMessageMode: GoalMessageMode = 'amount';\n\n /**\n * The message shown when the goal is near. Empty shows the built-in message\n * in the current language.\n */\n @property({ type: String }) goalNearMessage = '';\n\n /**\n * The message shown when the goal is reached. Empty shows the built-in\n * message in the current language.\n */\n @property({ type: String }) goalReachedMessage = '';\n\n /**\n * The accessible name of the progress bar, for screen readers. Empty uses\n * the built-in name in the current language.\n */\n @property({ type: String }) label = '';\n\n @property({ type: Number }) goalAmount = 7_500_000;\n\n @property({ type: String }) currentAmountMode: CurrentAmountMode = 'on';\n\n @property({ type: Number }) currentAmount = 0;\n\n @query('.thermometer-value') private thermometerValue?: HTMLDivElement;\n\n @query('.thermometer-fill') private thermometerFill?: HTMLDivElement;\n\n @state() private thermometerValueWidth = 0;\n\n @state() private thermometerFillWidth = 0;\n\n /**\n * Watches the fill and the value label so the label can move to whichever\n * side of the fill has room for it.\n */\n private resizeObserver?: ResizeObserver;\n\n /**\n * The observed nodes are tracked so each is observed exactly once. Calling\n * `observe` on an already-observed target re-reports its size, which costs a\n * notification on every render. Lit also discards the value label when\n * `currentAmountMode` turns it off, so a replacement has to be picked up.\n */\n private observedFillElement: Element | null = null;\n\n private observedValueElement: Element | null = null;\n\n render(): TemplateResult {\n return html`\n <div class=\"thermometer-message-container\">\n <div class=\"thermometer-container\">\n <div\n class=\"thermometer-background ${this.thermometerValuePosition}\"\n style=\"--fill-end--: ${this.percentComplete}%\"\n role=\"progressbar\"\n aria-label=\"${this.label || msg('Donation progress')}\"\n aria-valuemin=\"0\"\n aria-valuemax=\"${this.progressMax}\"\n aria-valuenow=\"${this.progressValue}\"\n aria-valuetext=\"${this.currentAmountDisplayValue}\"\n >\n <div class=\"thermometer-clip\">\n <div class=\"thermometer-fill\"></div>\n </div>\n ${this.thermometerValueTemplate}\n </div>\n </div>\n ${this.goalMessageMode !== 'off'\n ? html`<div class=\"donate-goal\">${this.currentGoalMessage}</div>`\n : nothing}\n </div>\n `;\n }\n\n private get thermometerValueTemplate(): TemplateResult | typeof nothing {\n return this.currentAmountMode === 'off'\n ? nothing\n : html`\n <div class=\"thermometer-value\">${this.currentAmountDisplayValue}</div>\n `;\n }\n\n /**\n * Which side of the fill's end the value label sits on, as a class name for\n * the CSS that places it. The label sits over the fill when the fill is\n * wider than the label plus a little breathing room, and just past the\n * fill's right edge otherwise.\n */\n private get thermometerValuePosition(): 'value-left' | 'value-right' {\n const buffer = 10;\n return this.thermometerValueWidth + buffer < this.thermometerFillWidth\n ? 'value-left'\n : 'value-right';\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.resizeObserver = new ResizeObserver((entries) =>\n this.handleResize(entries),\n );\n // On a re-connect the fill already exists; on first connect it doesn't\n // until the first render, and `updated` picks it up then.\n this.observeParts();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.resizeObserver?.disconnect();\n this.resizeObserver = undefined;\n this.observedFillElement = null;\n this.observedValueElement = null;\n }\n\n updated(): void {\n this.observeParts();\n }\n\n /** Observes the fill and the value label, picking up either if it is replaced. */\n private observeParts(): void {\n const observer = this.resizeObserver;\n if (!observer) return;\n\n this.observedFillElement = this.observeInPlaceOf(\n observer,\n this.observedFillElement,\n this.thermometerFill ?? null,\n );\n this.observedValueElement = this.observeInPlaceOf(\n observer,\n this.observedValueElement,\n this.thermometerValue ?? null,\n );\n }\n\n /**\n * Swaps `observed` for `current` on the observer and returns whichever is\n * now being watched. A target that hasn't changed is left alone.\n */\n private observeInPlaceOf(\n observer: ResizeObserver,\n observed: Element | null,\n current: Element | null,\n ): Element | null {\n if (current === observed) return observed;\n if (observed) observer.unobserve(observed);\n if (current) observer.observe(current);\n return current;\n }\n\n private handleResize(entries: ResizeObserverEntry[]): void {\n for (const entry of entries) {\n const width =\n entry.borderBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;\n if (entry.target === this.observedFillElement) {\n this.thermometerFillWidth = width;\n } else if (entry.target === this.observedValueElement) {\n this.thermometerValueWidth = width;\n }\n }\n }\n\n private get goalMessage(): string {\n return this.currentAmount >= this.goalAmount\n ? this.goalReachedMessage || msg('We’ve reached our goal!')\n : this.goalNearMessage || msg('We’ve almost reached our goal!');\n }\n\n private get currentAmountDisplayValue(): string {\n return this.formatNumber(this.currentAmount);\n }\n\n private get goalAmountDisplayValue(): string {\n return this.formatNumber(this.goalAmount);\n }\n\n /**\n * Formats a dollar amount in millions, e.g. `$0.5MM` or `$35MM`. Amounts\n * under ten million keep one decimal place, larger ones round to a whole\n * number.\n */\n private formatNumber(number: number): string {\n if (!Number.isFinite(number) || number === 0) return '$0';\n const suffix = 'MM';\n const divisor = 1_000_000;\n const result = number / divisor;\n const roundToOne = result < 10;\n const rounded = roundToOne\n ? Math.round((result + Number.EPSILON) * 10) / 10\n : Math.round(result);\n return `$${rounded}${suffix}`;\n }\n\n private get currentGoalMessage(): string {\n switch (this.goalMessageMode) {\n case 'amount':\n return msg(str`${this.goalAmountDisplayValue} goal`);\n case 'message':\n return this.goalMessage;\n case 'off':\n return '';\n }\n }\n\n /**\n * The goal the bar measures against. A goal that isn't a positive, finite\n * number leaves the bar empty, since there is no range to report progress\n * against. Named clear of `ariaValueMax`, which `HTMLElement` declares as a\n * public string.\n */\n private get progressMax(): number {\n return Number.isFinite(this.goalAmount) && this.goalAmount > 0\n ? this.goalAmount\n : 0;\n }\n\n /**\n * The progress reported to screen readers, clamped into the\n * `aria-valuemin`/`aria-valuemax` range the spec requires.\n * `aria-valuetext` carries the amount as it is displayed.\n */\n private get progressValue(): number {\n if (!Number.isFinite(this.currentAmount)) return 0;\n return Math.min(Math.max(this.currentAmount, 0), this.progressMax);\n }\n\n /**\n * How much of the bar is filled, as a percentage, clamped to `0`-`100`. An\n * amount or goal that can't produce a usable percentage empties the bar.\n */\n private get percentComplete(): number {\n const goal = this.progressMax;\n if (goal === 0 || !Number.isFinite(this.currentAmount)) return 0;\n const percent = (this.currentAmount / goal) * 100;\n return Math.min(Math.max(percent, 0), 100);\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n css`\n :host {\n --donation-thermometer-height--: var(\n --ia-donation-thermometer-height,\n 20px\n );\n --donation-thermometer-fill-color--: var(\n --ia-donation-thermometer-fill-color,\n #23765d\n );\n --donation-thermometer-track-color--: var(\n --ia-donation-thermometer-track-color,\n #b8f5e2\n );\n --donation-thermometer-border--: var(\n --ia-donation-thermometer-border,\n 1px solid var(--donation-thermometer-fill-color--)\n );\n /* Large enough to round any height into a pill */\n --donation-thermometer-border-radius--: var(\n --ia-donation-thermometer-border-radius,\n 9999px\n );\n --donation-thermometer-value-on-fill-color--: var(\n --ia-donation-thermometer-value-on-fill-color,\n var(--true-white)\n );\n --donation-thermometer-value-on-track-color--: var(\n --ia-donation-thermometer-value-on-track-color,\n var(--donation-thermometer-fill-color--)\n );\n --donation-thermometer-goal-color--: var(--primary-text-color);\n --donation-thermometer-goal-padding--: var(\n --ia-donation-thermometer-goal-padding,\n 0 10px\n );\n\n display: block;\n height: var(--donation-thermometer-height--);\n }\n\n .thermometer-message-container {\n height: 100%;\n display: flex;\n align-items: center;\n }\n\n .thermometer-container {\n height: 100%;\n flex: 1;\n }\n\n .thermometer-background {\n box-sizing: border-box;\n position: relative;\n background-color: var(--donation-thermometer-track-color--);\n height: 100%;\n border-radius: var(--donation-thermometer-border-radius--);\n border: var(--donation-thermometer-border--);\n }\n\n /*\n * Clips the square-ended fill to the rounded track. It covers only the\n * fill, so the label is never cut off by it.\n */\n .thermometer-clip {\n position: absolute;\n inset: 0;\n overflow: hidden;\n border-radius: var(--donation-thermometer-border-radius--);\n }\n\n .thermometer-fill {\n background-color: var(--donation-thermometer-fill-color--);\n height: 100%;\n /*\n * The fallback matters: without it a missing --fill-end-- makes the\n * declaration invalid, width resolves to auto, and the bar paints as\n * a fully funded fundraiser.\n */\n width: var(--fill-end--, 0%);\n }\n\n /*\n * The label is placed by offset from the end of the fill, so it is one\n * node in one position in the DOM whichever side it shows on, and it\n * never counts towards the width of the fill it is measured against.\n */\n .thermometer-value {\n position: absolute;\n top: 0;\n bottom: 0;\n left: var(--fill-end--, 0%);\n /*\n * Without this, the left offset caps the shrink-to-fit width of a\n * translated label and it collapses to its padding.\n */\n width: max-content;\n display: flex;\n align-items: center;\n font-weight: bold;\n white-space: nowrap;\n }\n\n /*\n * Both paddings total 1.5rem, so changing sides leaves the label the\n * same width and cannot feed back into the side it is placed on.\n */\n .value-left .thermometer-value {\n transform: translateX(-100%);\n color: var(--donation-thermometer-value-on-fill-color--);\n padding: 0 0.5rem 0 1rem;\n }\n\n .value-right .thermometer-value {\n color: var(--donation-thermometer-value-on-track-color--);\n padding: 0 1rem 0 0.5rem;\n }\n\n .donate-goal {\n text-align: left;\n padding: var(--donation-thermometer-goal-padding--);\n text-transform: uppercase;\n font-weight: bold;\n color: var(--donation-thermometer-goal-color--);\n }\n `,\n ];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-donation-thermometer': IADonationThermometer;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-dropdown.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-dropdown/ia-dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,
|
|
1
|
+
{"version":3,"file":"ia-dropdown.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-dropdown/ia-dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACf,MAAM,KAAK,CAAC;AAWb,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,qBAEa,UAAW,SAAQ,UAAU;IACxC;;OAEG;IACyC,IAAI,UAAS;IAEzD;;OAEG;IACyC,UAAU,UAAS;IAE/D;;;OAGG;IAC0B,YAAY,UAAS;IAElD;;;;OAIG;IAC0B,aAAa,UAAS;IAEnD;;;;;;OAMG;IAC0B,aAAa,UAAQ;IAElD;;OAEG;IAC0B,UAAU,UAAS;IAEhD;;;;;;OAMG;IAC0B,qBAAqB,UAAS;IAE/B,cAAc,SAAM;IAEhB,OAAO,EAAE,eAAe,EAAE,CAAM;IAEhE;;;OAGG;IACyB,WAAW,CAA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,GAU3B;IAED;;;OAGG;IACH,OAAO,KAAK,uBAAuB,GAElC;IAED;;;OAGG;IACH,OAAO,KAAK,yBAAyB,GAEpC;IAED;;OAEG;IACH,OAAO,KAAK,WAAW,GAItB;IAED,MAAM;IAuCN,MAAM,KAAK,MAAM,IAAI,cAAc,CAwSlC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, LitElement,
|
|
2
|
+
import { html, css, LitElement, } from 'lit';
|
|
3
3
|
import { property, query, queryAssignedElements } from 'lit/decorators.js';
|
|
4
4
|
import { when } from 'lit/directives/when.js';
|
|
5
5
|
import { localized, msg, str } from '@lit/localize';
|
|
@@ -202,27 +202,18 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
202
202
|
* @returns
|
|
203
203
|
*/
|
|
204
204
|
renderOption(availableOption) {
|
|
205
|
-
const { url = undefined, id } = availableOption;
|
|
205
|
+
const { label, url = undefined, id } = availableOption;
|
|
206
206
|
let component;
|
|
207
207
|
const selected = this.selectedOption === id ? 'selected' : '';
|
|
208
|
-
// The option's padding sits on its first element, so a plain-text label
|
|
209
|
-
// gets an element of its own; otherwise it would run flush to the edge.
|
|
210
|
-
const isText = typeof availableOption.label === 'string';
|
|
211
|
-
const label = isText
|
|
212
|
-
? html `<span class="option-text">${availableOption.label}</span>`
|
|
213
|
-
: availableOption.label;
|
|
214
|
-
const optionClass = isText ? 'text-option' : nothing;
|
|
215
208
|
if (url) {
|
|
216
209
|
component = html `<a
|
|
217
210
|
href=${url}
|
|
218
|
-
class=${optionClass}
|
|
219
211
|
@click=${(e) => this.optionClicked(e, availableOption)}
|
|
220
212
|
>${label}</a
|
|
221
213
|
>`;
|
|
222
214
|
}
|
|
223
215
|
else {
|
|
224
216
|
component = html `<button
|
|
225
|
-
class=${optionClass}
|
|
226
217
|
@click=${(e) => this.optionClicked(e, availableOption)}
|
|
227
218
|
>
|
|
228
219
|
${label}
|
|
@@ -407,15 +398,12 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
407
398
|
}
|
|
408
399
|
static get styles() {
|
|
409
400
|
const dropdownBorderWidth = css `var(--dropdownBorderWidth, 1px)`;
|
|
410
|
-
|
|
411
|
-
const
|
|
412
|
-
const
|
|
413
|
-
const
|
|
414
|
-
const
|
|
415
|
-
const
|
|
416
|
-
// An overlay on the panel: #666 on the default one, and on a panel a host
|
|
417
|
-
// recolors, a lighter shade of it rather than a dark bar.
|
|
418
|
-
const dropdownSelectedBgColor = css `var(--dropdownSelectedBgColor, var(--ia-color-selected-soft-overlay-inverse--))`;
|
|
401
|
+
const dropdownBorderRadius = css `var(--dropdownBorderRadius, 4px)`;
|
|
402
|
+
const dropdownBorderColor = css `var(--dropdownBorderColor, #fff)`;
|
|
403
|
+
const dropdownBgColor = css `var(--dropdownBgColor, #333)`;
|
|
404
|
+
const dropdownTextColor = css `var(--dropdownTextColor, #fff)`;
|
|
405
|
+
const dropdownHoverBgColor = css `var(--dropdownHoverBgColor, rgba(255, 255, 255, 0.3))`;
|
|
406
|
+
const dropdownSelectedBgColor = css `var(--dropdownSelectedBgColor, #fff)`;
|
|
419
407
|
const dropdownMainButtonBgColor = css `var(--dropdownMainButtonBgColor, transparent)`;
|
|
420
408
|
const dropdownTextAlign = css `var(--dropdownTextAlign, inherit)`;
|
|
421
409
|
const dropdownBackdropZIndex = css `var(--dropdownBackdropZIndex, 1)`;
|
|
@@ -432,7 +420,7 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
432
420
|
svg.caret-down-svg,
|
|
433
421
|
::slotted(svg.caret-up-svg),
|
|
434
422
|
::slotted(svg.caret-down-svg) {
|
|
435
|
-
fill: var(--dropdownCaretColor,
|
|
423
|
+
fill: var(--dropdownCaretColor, #fff);
|
|
436
424
|
vertical-align: middle;
|
|
437
425
|
}
|
|
438
426
|
|
|
@@ -488,26 +476,6 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
488
476
|
);
|
|
489
477
|
}
|
|
490
478
|
|
|
491
|
-
/* The ring defaults to the dark-surface focus color, since the
|
|
492
|
-
trigger's own defaults (white text and caret) assume a dark host. A
|
|
493
|
-
host on a light surface sets --dropdownFocusRingColor to
|
|
494
|
-
--ia-color-border-focus. The ring is inside the trigger's edge, so
|
|
495
|
-
it lines up with the panel that opens under it, and carries its band.
|
|
496
|
-
The band follows the ring, so a host that sets
|
|
497
|
-
--dropdownFocusRingColor sets --dropdownFocusBand with it. */
|
|
498
|
-
button.click-main:focus-visible {
|
|
499
|
-
outline: var(--ia-size-focus-ring--) solid
|
|
500
|
-
var(
|
|
501
|
-
--dropdownFocusRingColor,
|
|
502
|
-
var(--ia-color-border-focus-inverse--)
|
|
503
|
-
);
|
|
504
|
-
outline-offset: calc(-1 * var(--ia-size-focus-ring--));
|
|
505
|
-
box-shadow: var(
|
|
506
|
-
--dropdownFocusBand,
|
|
507
|
-
var(--ia-shadow-focus-band-inverse--)
|
|
508
|
-
);
|
|
509
|
-
}
|
|
510
|
-
|
|
511
479
|
button.click-main:active {
|
|
512
480
|
background-color: var(
|
|
513
481
|
--dropdownMainButtonActiveBgColor,
|
|
@@ -517,7 +485,7 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
517
485
|
|
|
518
486
|
button slot[name='dropdown-label'] {
|
|
519
487
|
/* Set var to 0px for column layout */
|
|
520
|
-
padding-right: var(--buttonSlotPaddingRight,
|
|
488
|
+
padding-right: var(--buttonSlotPaddingRight, 5px);
|
|
521
489
|
display: inline-block;
|
|
522
490
|
}
|
|
523
491
|
|
|
@@ -559,8 +527,8 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
559
527
|
}
|
|
560
528
|
|
|
561
529
|
.caret svg {
|
|
562
|
-
height: var(--caretHeight,
|
|
563
|
-
width: var(--caretWidth,
|
|
530
|
+
height: var(--caretHeight, 10px);
|
|
531
|
+
width: var(--caretWidth, 20px);
|
|
564
532
|
}
|
|
565
533
|
|
|
566
534
|
#dropdown-backdrop {
|
|
@@ -586,12 +554,12 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
586
554
|
#dropdown-main {
|
|
587
555
|
position: var(--dropdownListPosition, absolute);
|
|
588
556
|
list-style: none;
|
|
589
|
-
margin: var(--dropdownOffsetTop,
|
|
557
|
+
margin: var(--dropdownOffsetTop, 5px) 0 0 0;
|
|
590
558
|
padding: var(--dropdownPadding, 0);
|
|
591
559
|
color: ${dropdownTextColor};
|
|
592
560
|
background: ${dropdownBgColor};
|
|
593
561
|
|
|
594
|
-
font-size: var(--dropdownFontSize,
|
|
562
|
+
font-size: var(--dropdownFontSize, inherit);
|
|
595
563
|
|
|
596
564
|
border-top: var(--dropdownBorderTopWidth, ${dropdownBorderWidth});
|
|
597
565
|
border-right: var(--dropdownBorderRightWidth, ${dropdownBorderWidth});
|
|
@@ -612,9 +580,7 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
612
580
|
var(--dropdownBorderBottomRightRadius, ${dropdownBorderRadius})
|
|
613
581
|
var(--dropdownBorderBottomLeftRadius, ${dropdownBorderRadius});
|
|
614
582
|
|
|
615
|
-
|
|
616
|
-
grows to its longest option instead of wrapping out of the row. */
|
|
617
|
-
white-space: var(--dropdownWhiteSpace, nowrap);
|
|
583
|
+
white-space: var(--dropdownWhiteSpace, normal);
|
|
618
584
|
|
|
619
585
|
/* Prevent top/bottom inner li from overlapping inner border */
|
|
620
586
|
overflow: hidden;
|
|
@@ -622,7 +588,7 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
622
588
|
|
|
623
589
|
#dropdown-main li:hover {
|
|
624
590
|
background-color: ${dropdownHoverBgColor};
|
|
625
|
-
color: var(--dropdownHoverTextColor,
|
|
591
|
+
color: var(--dropdownHoverTextColor, #fff);
|
|
626
592
|
list-style: none;
|
|
627
593
|
cursor: pointer;
|
|
628
594
|
}
|
|
@@ -636,18 +602,11 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
636
602
|
}
|
|
637
603
|
|
|
638
604
|
#dropdown-main li:hover:not(:first-child) {
|
|
639
|
-
border-top: 0.5px solid
|
|
640
|
-
var(
|
|
641
|
-
--dropdownHoverTopBottomBorderColor,
|
|
642
|
-
var(--ia-color-surface-inverse--)
|
|
643
|
-
);
|
|
605
|
+
border-top: 0.5px solid var(--dropdownHoverTopBottomBorderColor, #333);
|
|
644
606
|
}
|
|
645
607
|
#dropdown-main li:hover:not(:last-child) {
|
|
646
608
|
border-bottom: 0.5px solid
|
|
647
|
-
var(
|
|
648
|
-
--dropdownHoverTopBottomBorderColor,
|
|
649
|
-
var(--ia-color-surface-inverse--)
|
|
650
|
-
);
|
|
609
|
+
var(--dropdownHoverTopBottomBorderColor, #333);
|
|
651
610
|
}
|
|
652
611
|
|
|
653
612
|
#dropdown-main li.selected:last-child {
|
|
@@ -661,18 +620,18 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
661
620
|
#dropdown-main li:hover > *,
|
|
662
621
|
#dropdown-main li:focus-within > * {
|
|
663
622
|
background-color: ${dropdownHoverBgColor};
|
|
664
|
-
color: var(--dropdownHoverTextColor,
|
|
623
|
+
color: var(--dropdownHoverTextColor, #fff);
|
|
665
624
|
}
|
|
666
625
|
|
|
667
626
|
#dropdown-main li.selected > * {
|
|
668
627
|
background-color: ${dropdownSelectedBgColor};
|
|
669
|
-
color: var(--dropdownSelectedTextColor,
|
|
628
|
+
color: var(--dropdownSelectedTextColor, #2c2c2c);
|
|
670
629
|
}
|
|
671
630
|
|
|
672
631
|
#dropdown-main li {
|
|
673
632
|
background: ${dropdownBgColor};
|
|
674
633
|
list-style: none;
|
|
675
|
-
height:
|
|
634
|
+
height: 30px;
|
|
676
635
|
cursor: pointer;
|
|
677
636
|
border-bottom: 0.5px solid ${dropdownBgColor};
|
|
678
637
|
border-top: 0.5px solid ${dropdownBgColor};
|
|
@@ -687,23 +646,6 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
687
646
|
outline: inherit;
|
|
688
647
|
}
|
|
689
648
|
|
|
690
|
-
/* An option's focus: the trigger's ring, inside the row, with its
|
|
691
|
-
band, so it shows on any row fill. On the selected #666 row the
|
|
692
|
-
ring alone is 2.58:1. A host on a light panel sets the same two
|
|
693
|
-
hooks as for the trigger. */
|
|
694
|
-
#dropdown-main li > *:focus-visible {
|
|
695
|
-
outline: var(--ia-size-focus-ring--) solid
|
|
696
|
-
var(
|
|
697
|
-
--dropdownFocusRingColor,
|
|
698
|
-
var(--ia-color-border-focus-inverse--)
|
|
699
|
-
);
|
|
700
|
-
outline-offset: calc(-1 * var(--ia-size-focus-ring--));
|
|
701
|
-
box-shadow: var(
|
|
702
|
-
--dropdownFocusBand,
|
|
703
|
-
var(--ia-shadow-focus-band-inverse--)
|
|
704
|
-
);
|
|
705
|
-
}
|
|
706
|
-
|
|
707
649
|
#dropdown-main li a {
|
|
708
650
|
text-decoration: none;
|
|
709
651
|
display: block;
|
|
@@ -711,25 +653,16 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
711
653
|
}
|
|
712
654
|
|
|
713
655
|
#dropdown-main li:first-child {
|
|
714
|
-
border-top-left-radius: var(
|
|
715
|
-
|
|
716
|
-
var(--ia-radius-default--)
|
|
717
|
-
);
|
|
718
|
-
border-top-right-radius: var(
|
|
719
|
-
--dropdownBorderTopRightRadius,
|
|
720
|
-
var(--ia-radius-default--)
|
|
721
|
-
);
|
|
656
|
+
border-top-left-radius: var(--dropdownBorderTopLeftRadius, 4px);
|
|
657
|
+
border-top-right-radius: var(--dropdownBorderTopRightRadius, 4px);
|
|
722
658
|
}
|
|
723
659
|
|
|
724
660
|
#dropdown-main li:last-child {
|
|
725
661
|
border-bottom-right-radius: var(
|
|
726
662
|
--dropdownBorderBottomRightRadius,
|
|
727
|
-
|
|
728
|
-
);
|
|
729
|
-
border-bottom-left-radius: var(
|
|
730
|
-
--dropdownBorderBottomLeftRadius,
|
|
731
|
-
var(--ia-radius-default--)
|
|
663
|
+
4px
|
|
732
664
|
);
|
|
665
|
+
border-bottom-left-radius: var(--dropdownBorderBottomLeftRadius, 4px);
|
|
733
666
|
}
|
|
734
667
|
|
|
735
668
|
/* cover the list with the label */
|
|
@@ -741,12 +674,10 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
741
674
|
align-content: center;
|
|
742
675
|
flex-wrap: nowrap;
|
|
743
676
|
height: 100%;
|
|
744
|
-
/* The option's whole inset: 20px at the sides, from this padding
|
|
745
|
-
alone, so an override of --dropdownItemPadding* is exact. */
|
|
746
677
|
padding: var(--dropdownItemPaddingTop, 5px)
|
|
747
|
-
var(--dropdownItemPaddingRight,
|
|
678
|
+
var(--dropdownItemPaddingRight, 10px)
|
|
748
679
|
var(--dropdownItemPaddingBottom, 5px)
|
|
749
|
-
var(--dropdownItemPaddingLeft,
|
|
680
|
+
var(--dropdownItemPaddingLeft, 10px);
|
|
750
681
|
box-sizing: border-box;
|
|
751
682
|
}
|
|
752
683
|
|
|
@@ -758,23 +689,6 @@ let IADropdown = class IADropdown extends LitElement {
|
|
|
758
689
|
padding: var(--dropdownItemButtonPadding, 0);
|
|
759
690
|
text-align: ${dropdownTextAlign};
|
|
760
691
|
}
|
|
761
|
-
|
|
762
|
-
/* A plain-text option's inset is its text's alone. A host's
|
|
763
|
-
--dropdownItemButtonPadding sets it, as it did when the text had
|
|
764
|
-
no element of its own; otherwise the option padding applies. */
|
|
765
|
-
#dropdown-main li > .text-option {
|
|
766
|
-
padding: 0;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
#dropdown-main li > * > .option-text {
|
|
770
|
-
padding: var(
|
|
771
|
-
--dropdownItemButtonPadding,
|
|
772
|
-
var(--dropdownItemPaddingTop, 5px)
|
|
773
|
-
var(--dropdownItemPaddingRight, var(--ia-space-4--))
|
|
774
|
-
var(--dropdownItemPaddingBottom, 5px)
|
|
775
|
-
var(--dropdownItemPaddingLeft, var(--ia-space-4--))
|
|
776
|
-
);
|
|
777
|
-
}
|
|
778
692
|
`,
|
|
779
693
|
];
|
|
780
694
|
}
|