@pine-ds/icons 2.0.1
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/LICENSE +21 -0
- package/components/index.cjs.js +1 -0
- package/components/index.d.ts +33 -0
- package/components/index.js +4 -0
- package/components/index.js.map +1 -0
- package/components/package.json +8 -0
- package/components/pds-icon.d.ts +11 -0
- package/components/pds-icon.js +213 -0
- package/components/pds-icon.js.map +1 -0
- package/components/utils.js +75 -0
- package/components/utils.js.map +1 -0
- package/dist/cheatsheet.html +574 -0
- package/dist/pds-icons/svg/access-key.svg +1 -0
- package/dist/pds-icons/svg/add-circle.svg +1 -0
- package/dist/pds-icons/svg/add-image.svg +1 -0
- package/dist/pds-icons/svg/add-small.svg +1 -0
- package/dist/pds-icons/svg/add.svg +1 -0
- package/dist/pds-icons/svg/ai-sparkle.svg +1 -0
- package/dist/pds-icons/svg/ai-writer-filled.svg +1 -0
- package/dist/pds-icons/svg/ai-writer.svg +1 -0
- package/dist/pds-icons/svg/align-center.svg +1 -0
- package/dist/pds-icons/svg/align-justify.svg +1 -0
- package/dist/pds-icons/svg/align-left.svg +1 -0
- package/dist/pds-icons/svg/align-right.svg +1 -0
- package/dist/pds-icons/svg/analytics-filled.svg +1 -0
- package/dist/pds-icons/svg/analytics-outline.svg +1 -0
- package/dist/pds-icons/svg/app-store.svg +1 -0
- package/dist/pds-icons/svg/archive.svg +1 -0
- package/dist/pds-icons/svg/arrow-corner.svg +1 -0
- package/dist/pds-icons/svg/arrow-down.svg +1 -0
- package/dist/pds-icons/svg/arrow-left.svg +1 -0
- package/dist/pds-icons/svg/arrow-right.svg +1 -0
- package/dist/pds-icons/svg/arrow-up.svg +1 -0
- package/dist/pds-icons/svg/assessment.svg +1 -0
- package/dist/pds-icons/svg/at-sign.svg +1 -0
- package/dist/pds-icons/svg/attach.svg +1 -0
- package/dist/pds-icons/svg/automations.svg +1 -0
- package/dist/pds-icons/svg/ban.svg +1 -0
- package/dist/pds-icons/svg/bank.svg +1 -0
- package/dist/pds-icons/svg/bell.svg +1 -0
- package/dist/pds-icons/svg/blog.svg +1 -0
- package/dist/pds-icons/svg/bold.svg +1 -0
- package/dist/pds-icons/svg/broadcast.svg +1 -0
- package/dist/pds-icons/svg/calendar-date.svg +1 -0
- package/dist/pds-icons/svg/calendar-schedule.svg +1 -0
- package/dist/pds-icons/svg/calendar-simple.svg +1 -0
- package/dist/pds-icons/svg/card-bw-amex.svg +1 -0
- package/dist/pds-icons/svg/card-bw-apple-card.svg +1 -0
- package/dist/pds-icons/svg/card-bw-diners-club.svg +1 -0
- package/dist/pds-icons/svg/card-bw-discover.svg +1 -0
- package/dist/pds-icons/svg/card-bw-gpay-card.svg +1 -0
- package/dist/pds-icons/svg/card-bw-mastercard.svg +1 -0
- package/dist/pds-icons/svg/card-bw-paypal.svg +1 -0
- package/dist/pds-icons/svg/card-bw-stripe.svg +1 -0
- package/dist/pds-icons/svg/card-bw-visa.svg +1 -0
- package/dist/pds-icons/svg/card-update.svg +1 -0
- package/dist/pds-icons/svg/caret-down.svg +1 -0
- package/dist/pds-icons/svg/caret-left.svg +1 -0
- package/dist/pds-icons/svg/caret-right.svg +1 -0
- package/dist/pds-icons/svg/caret-up.svg +1 -0
- package/dist/pds-icons/svg/cart-add.svg +1 -0
- package/dist/pds-icons/svg/cart.svg +1 -0
- package/dist/pds-icons/svg/certificate.svg +1 -0
- package/dist/pds-icons/svg/check-circle-filled.svg +1 -0
- package/dist/pds-icons/svg/check-circle.svg +1 -0
- package/dist/pds-icons/svg/check.svg +1 -0
- package/dist/pds-icons/svg/circle-1.svg +1 -0
- package/dist/pds-icons/svg/circle-2.svg +1 -0
- package/dist/pds-icons/svg/circle-3.svg +1 -0
- package/dist/pds-icons/svg/circle-4.svg +1 -0
- package/dist/pds-icons/svg/circle-5.svg +1 -0
- package/dist/pds-icons/svg/circle-6.svg +1 -0
- package/dist/pds-icons/svg/circle-7.svg +1 -0
- package/dist/pds-icons/svg/circle-8.svg +1 -0
- package/dist/pds-icons/svg/circle-9.svg +1 -0
- package/dist/pds-icons/svg/clock.svg +1 -0
- package/dist/pds-icons/svg/closed-captions.svg +1 -0
- package/dist/pds-icons/svg/code.svg +1 -0
- package/dist/pds-icons/svg/color.svg +1 -0
- package/dist/pds-icons/svg/columns.svg +1 -0
- package/dist/pds-icons/svg/comment.svg +1 -0
- package/dist/pds-icons/svg/connect.svg +1 -0
- package/dist/pds-icons/svg/contact.svg +1 -0
- package/dist/pds-icons/svg/contacts-filled.svg +1 -0
- package/dist/pds-icons/svg/contacts-outline.svg +1 -0
- package/dist/pds-icons/svg/conversation.svg +1 -0
- package/dist/pds-icons/svg/copy.svg +1 -0
- package/dist/pds-icons/svg/coupon.svg +1 -0
- package/dist/pds-icons/svg/course.svg +1 -0
- package/dist/pds-icons/svg/creator-studio-filled.svg +1 -0
- package/dist/pds-icons/svg/creator-studio.svg +1 -0
- package/dist/pds-icons/svg/credit-card.svg +1 -0
- package/dist/pds-icons/svg/custom-field.svg +1 -0
- package/dist/pds-icons/svg/customize.svg +1 -0
- package/dist/pds-icons/svg/danger-filled.svg +1 -0
- package/dist/pds-icons/svg/danger.svg +1 -0
- package/dist/pds-icons/svg/dashboard-filled.svg +1 -0
- package/dist/pds-icons/svg/dashboard-outline.svg +1 -0
- package/dist/pds-icons/svg/delete-circle.svg +1 -0
- package/dist/pds-icons/svg/delete-key.svg +1 -0
- package/dist/pds-icons/svg/delete-x.svg +1 -0
- package/dist/pds-icons/svg/dollar-sign.svg +1 -0
- package/dist/pds-icons/svg/dot-menu-horizontal.svg +1 -0
- package/dist/pds-icons/svg/down-small.svg +1 -0
- package/dist/pds-icons/svg/download.svg +1 -0
- package/dist/pds-icons/svg/downsell.svg +1 -0
- package/dist/pds-icons/svg/draft.svg +1 -0
- package/dist/pds-icons/svg/drop.svg +1 -0
- package/dist/pds-icons/svg/duplicate.svg +1 -0
- package/dist/pds-icons/svg/email-activity.svg +1 -0
- package/dist/pds-icons/svg/emoji.svg +1 -0
- package/dist/pds-icons/svg/enlarge-vertical.svg +1 -0
- package/dist/pds-icons/svg/enlarge.svg +1 -0
- package/dist/pds-icons/svg/expand.svg +1 -0
- package/dist/pds-icons/svg/facebook-2.svg +1 -0
- package/dist/pds-icons/svg/facebook.svg +1 -0
- package/dist/pds-icons/svg/favorite.svg +1 -0
- package/dist/pds-icons/svg/feedback.svg +1 -0
- package/dist/pds-icons/svg/file-money.svg +1 -0
- package/dist/pds-icons/svg/file.svg +1 -0
- package/dist/pds-icons/svg/filter.svg +1 -0
- package/dist/pds-icons/svg/flag.svg +1 -0
- package/dist/pds-icons/svg/folder-group.svg +1 -0
- package/dist/pds-icons/svg/folder.svg +1 -0
- package/dist/pds-icons/svg/form-field.svg +1 -0
- package/dist/pds-icons/svg/form.svg +1 -0
- package/dist/pds-icons/svg/fullscreen.svg +1 -0
- package/dist/pds-icons/svg/funnel.svg +1 -0
- package/dist/pds-icons/svg/grant-offer.svg +1 -0
- package/dist/pds-icons/svg/handle-2-vertical.svg +1 -0
- package/dist/pds-icons/svg/handle-2.svg +1 -0
- package/dist/pds-icons/svg/handle.svg +1 -0
- package/dist/pds-icons/svg/hashtag.svg +1 -0
- package/dist/pds-icons/svg/heading-large.svg +1 -0
- package/dist/pds-icons/svg/heading-small.svg +1 -0
- package/dist/pds-icons/svg/headset.svg +1 -0
- package/dist/pds-icons/svg/help-filled.svg +1 -0
- package/dist/pds-icons/svg/help-outline.svg +1 -0
- package/dist/pds-icons/svg/home-alt.svg +1 -0
- package/dist/pds-icons/svg/horizontal-line.svg +1 -0
- package/dist/pds-icons/svg/image.svg +1 -0
- package/dist/pds-icons/svg/info-circle-filled.svg +1 -0
- package/dist/pds-icons/svg/info-circle.svg +1 -0
- package/dist/pds-icons/svg/instagram.svg +1 -0
- package/dist/pds-icons/svg/ios-battery.svg +1 -0
- package/dist/pds-icons/svg/ios-data.svg +1 -0
- package/dist/pds-icons/svg/ios-wifi.svg +1 -0
- package/dist/pds-icons/svg/italic.svg +1 -0
- package/dist/pds-icons/svg/kajabi-filled.svg +1 -0
- package/dist/pds-icons/svg/kajabi-outlined.svg +1 -0
- package/dist/pds-icons/svg/lab.svg +1 -0
- package/dist/pds-icons/svg/launch.svg +1 -0
- package/dist/pds-icons/svg/layout-grid.svg +1 -0
- package/dist/pds-icons/svg/layout-list.svg +1 -0
- package/dist/pds-icons/svg/left-small.svg +1 -0
- package/dist/pds-icons/svg/linkedin.svg +1 -0
- package/dist/pds-icons/svg/list-bullet.svg +1 -0
- package/dist/pds-icons/svg/list-numbers.svg +1 -0
- package/dist/pds-icons/svg/location.svg +1 -0
- package/dist/pds-icons/svg/lock-alt.svg +1 -0
- package/dist/pds-icons/svg/lock.svg +1 -0
- package/dist/pds-icons/svg/logo-afterpay.svg +1 -0
- package/dist/pds-icons/svg/loop.svg +1 -0
- package/dist/pds-icons/svg/mail.svg +1 -0
- package/dist/pds-icons/svg/mapped.svg +1 -0
- package/dist/pds-icons/svg/margin-left.svg +1 -0
- package/dist/pds-icons/svg/margin-right.svg +1 -0
- package/dist/pds-icons/svg/marker-filled.svg +1 -0
- package/dist/pds-icons/svg/marker.svg +1 -0
- package/dist/pds-icons/svg/marketing-filled.svg +1 -0
- package/dist/pds-icons/svg/marketing-outline.svg +1 -0
- package/dist/pds-icons/svg/menu-2.svg +1 -0
- package/dist/pds-icons/svg/menu-alt.svg +1 -0
- package/dist/pds-icons/svg/menu.svg +1 -0
- package/dist/pds-icons/svg/merge.svg +1 -0
- package/dist/pds-icons/svg/microphone-off.svg +1 -0
- package/dist/pds-icons/svg/microphone.svg +1 -0
- package/dist/pds-icons/svg/move-left.svg +1 -0
- package/dist/pds-icons/svg/move-right.svg +1 -0
- package/dist/pds-icons/svg/multi-pay.svg +1 -0
- package/dist/pds-icons/svg/newsletter.svg +1 -0
- package/dist/pds-icons/svg/one-off-session.svg +1 -0
- package/dist/pds-icons/svg/one-time.svg +1 -0
- package/dist/pds-icons/svg/partners-filled.svg +1 -0
- package/dist/pds-icons/svg/partners-outline.svg +1 -0
- package/dist/pds-icons/svg/pause-circle.svg +1 -0
- package/dist/pds-icons/svg/pause.svg +1 -0
- package/dist/pds-icons/svg/payout.svg +1 -0
- package/dist/pds-icons/svg/pen.svg +1 -0
- package/dist/pds-icons/svg/phone-portrait.svg +1 -0
- package/dist/pds-icons/svg/phone-toolbar.svg +1 -0
- package/dist/pds-icons/svg/play-circle.svg +1 -0
- package/dist/pds-icons/svg/play-outline.svg +1 -0
- package/dist/pds-icons/svg/play-store.svg +1 -0
- package/dist/pds-icons/svg/play.svg +1 -0
- package/dist/pds-icons/svg/plug.svg +1 -0
- package/dist/pds-icons/svg/present.svg +1 -0
- package/dist/pds-icons/svg/preview-off.svg +1 -0
- package/dist/pds-icons/svg/preview-on.svg +1 -0
- package/dist/pds-icons/svg/products-filled.svg +1 -0
- package/dist/pds-icons/svg/products-outline.svg +1 -0
- package/dist/pds-icons/svg/question-circle.svg +1 -0
- package/dist/pds-icons/svg/quote.svg +1 -0
- package/dist/pds-icons/svg/redo.svg +1 -0
- package/dist/pds-icons/svg/refresh.svg +1 -0
- package/dist/pds-icons/svg/remove-circle.svg +1 -0
- package/dist/pds-icons/svg/remove.svg +1 -0
- package/dist/pds-icons/svg/rename.svg +1 -0
- package/dist/pds-icons/svg/reset-password.svg +1 -0
- package/dist/pds-icons/svg/restore.svg +1 -0
- package/dist/pds-icons/svg/right-small.svg +1 -0
- package/dist/pds-icons/svg/round-dollar.svg +1 -0
- package/dist/pds-icons/svg/rows.svg +1 -0
- package/dist/pds-icons/svg/sales-filled.svg +1 -0
- package/dist/pds-icons/svg/sales-outline.svg +1 -0
- package/dist/pds-icons/svg/scissor.svg +1 -0
- package/dist/pds-icons/svg/screen-share-off.svg +1 -0
- package/dist/pds-icons/svg/screen-share-on.svg +1 -0
- package/dist/pds-icons/svg/search-small.svg +1 -0
- package/dist/pds-icons/svg/search.svg +1 -0
- package/dist/pds-icons/svg/send-message.svg +1 -0
- package/dist/pds-icons/svg/sequences.svg +1 -0
- package/dist/pds-icons/svg/series.svg +1 -0
- package/dist/pds-icons/svg/settings-filled.svg +1 -0
- package/dist/pds-icons/svg/settings-outline.svg +1 -0
- package/dist/pds-icons/svg/share.svg +1 -0
- package/dist/pds-icons/svg/skipped.svg +1 -0
- package/dist/pds-icons/svg/slash-divider.svg +1 -0
- package/dist/pds-icons/svg/sparkle-filled.svg +1 -0
- package/dist/pds-icons/svg/sparkle.svg +1 -0
- package/dist/pds-icons/svg/speaker.svg +1 -0
- package/dist/pds-icons/svg/stack.svg +1 -0
- package/dist/pds-icons/svg/star.svg +1 -0
- package/dist/pds-icons/svg/stop.svg +1 -0
- package/dist/pds-icons/svg/stopwatch.svg +1 -0
- package/dist/pds-icons/svg/strikethrough.svg +1 -0
- package/dist/pds-icons/svg/subscript.svg +1 -0
- package/dist/pds-icons/svg/subscriptions.svg +1 -0
- package/dist/pds-icons/svg/super-admin.svg +1 -0
- package/dist/pds-icons/svg/superscript.svg +1 -0
- package/dist/pds-icons/svg/sync.svg +1 -0
- package/dist/pds-icons/svg/tablet-landscape.svg +1 -0
- package/dist/pds-icons/svg/tablet-portrait.svg +1 -0
- package/dist/pds-icons/svg/text-styles.svg +1 -0
- package/dist/pds-icons/svg/theme-store.svg +1 -0
- package/dist/pds-icons/svg/thumbs-down-filled.svg +1 -0
- package/dist/pds-icons/svg/thumbs-down.svg +1 -0
- package/dist/pds-icons/svg/thumbs-up-filled.svg +1 -0
- package/dist/pds-icons/svg/thumbs-up.svg +1 -0
- package/dist/pds-icons/svg/tiktok.svg +1 -0
- package/dist/pds-icons/svg/trash.svg +1 -0
- package/dist/pds-icons/svg/twitter.svg +1 -0
- package/dist/pds-icons/svg/underline.svg +1 -0
- package/dist/pds-icons/svg/undo.svg +1 -0
- package/dist/pds-icons/svg/unlock.svg +1 -0
- package/dist/pds-icons/svg/unmapped.svg +1 -0
- package/dist/pds-icons/svg/up-small.svg +1 -0
- package/dist/pds-icons/svg/upload.svg +1 -0
- package/dist/pds-icons/svg/url.svg +1 -0
- package/dist/pds-icons/svg/user-filled.svg +1 -0
- package/dist/pds-icons/svg/user.svg +1 -0
- package/dist/pds-icons/svg/users-wm.svg +1 -0
- package/dist/pds-icons/svg/users.svg +1 -0
- package/dist/pds-icons/svg/video-off.svg +1 -0
- package/dist/pds-icons/svg/video-on.svg +1 -0
- package/dist/pds-icons/svg/warning-filled.svg +1 -0
- package/dist/pds-icons/svg/warning.svg +1 -0
- package/dist/pds-icons/svg/website-filled.svg +1 -0
- package/dist/pds-icons/svg/website-outline.svg +1 -0
- package/dist/pds-icons/svg/window-paragraph.svg +1 -0
- package/dist/pds-icons/svg/world.svg +1 -0
- package/dist/pds-icons/svg/youtube.svg +1 -0
- package/dist/pds-icons.json +4216 -0
- package/dist/pds-icons.symbols.svg +273 -0
- package/dist/svg/access-key.svg +1 -0
- package/dist/svg/add-circle.svg +1 -0
- package/dist/svg/add-image.svg +1 -0
- package/dist/svg/add-small.svg +1 -0
- package/dist/svg/add.svg +1 -0
- package/dist/svg/ai-sparkle.svg +1 -0
- package/dist/svg/ai-writer-filled.svg +1 -0
- package/dist/svg/ai-writer.svg +1 -0
- package/dist/svg/align-center.svg +1 -0
- package/dist/svg/align-justify.svg +1 -0
- package/dist/svg/align-left.svg +1 -0
- package/dist/svg/align-right.svg +1 -0
- package/dist/svg/analytics-filled.svg +1 -0
- package/dist/svg/analytics-outline.svg +1 -0
- package/dist/svg/app-store.svg +1 -0
- package/dist/svg/archive.svg +1 -0
- package/dist/svg/arrow-corner.svg +1 -0
- package/dist/svg/arrow-down.svg +1 -0
- package/dist/svg/arrow-left.svg +1 -0
- package/dist/svg/arrow-right.svg +1 -0
- package/dist/svg/arrow-up.svg +1 -0
- package/dist/svg/assessment.svg +1 -0
- package/dist/svg/at-sign.svg +1 -0
- package/dist/svg/attach.svg +1 -0
- package/dist/svg/automations.svg +1 -0
- package/dist/svg/ban.svg +1 -0
- package/dist/svg/bank.svg +1 -0
- package/dist/svg/bell.svg +1 -0
- package/dist/svg/blog.svg +1 -0
- package/dist/svg/bold.svg +1 -0
- package/dist/svg/broadcast.svg +1 -0
- package/dist/svg/calendar-date.svg +1 -0
- package/dist/svg/calendar-schedule.svg +1 -0
- package/dist/svg/calendar-simple.svg +1 -0
- package/dist/svg/card-bw-amex.svg +1 -0
- package/dist/svg/card-bw-apple-card.svg +1 -0
- package/dist/svg/card-bw-diners-club.svg +1 -0
- package/dist/svg/card-bw-discover.svg +1 -0
- package/dist/svg/card-bw-gpay-card.svg +1 -0
- package/dist/svg/card-bw-mastercard.svg +1 -0
- package/dist/svg/card-bw-paypal.svg +1 -0
- package/dist/svg/card-bw-stripe.svg +1 -0
- package/dist/svg/card-bw-visa.svg +1 -0
- package/dist/svg/card-update.svg +1 -0
- package/dist/svg/caret-down.svg +1 -0
- package/dist/svg/caret-left.svg +1 -0
- package/dist/svg/caret-right.svg +1 -0
- package/dist/svg/caret-up.svg +1 -0
- package/dist/svg/cart-add.svg +1 -0
- package/dist/svg/cart.svg +1 -0
- package/dist/svg/certificate.svg +1 -0
- package/dist/svg/check-circle-filled.svg +1 -0
- package/dist/svg/check-circle.svg +1 -0
- package/dist/svg/check.svg +1 -0
- package/dist/svg/circle-1.svg +1 -0
- package/dist/svg/circle-2.svg +1 -0
- package/dist/svg/circle-3.svg +1 -0
- package/dist/svg/circle-4.svg +1 -0
- package/dist/svg/circle-5.svg +1 -0
- package/dist/svg/circle-6.svg +1 -0
- package/dist/svg/circle-7.svg +1 -0
- package/dist/svg/circle-8.svg +1 -0
- package/dist/svg/circle-9.svg +1 -0
- package/dist/svg/clock.svg +1 -0
- package/dist/svg/closed-captions.svg +1 -0
- package/dist/svg/code.svg +1 -0
- package/dist/svg/color.svg +1 -0
- package/dist/svg/columns.svg +1 -0
- package/dist/svg/comment.svg +1 -0
- package/dist/svg/connect.svg +1 -0
- package/dist/svg/contact.svg +1 -0
- package/dist/svg/contacts-filled.svg +1 -0
- package/dist/svg/contacts-outline.svg +1 -0
- package/dist/svg/conversation.svg +1 -0
- package/dist/svg/copy.svg +1 -0
- package/dist/svg/coupon.svg +1 -0
- package/dist/svg/course.svg +1 -0
- package/dist/svg/creator-studio-filled.svg +1 -0
- package/dist/svg/creator-studio.svg +1 -0
- package/dist/svg/credit-card.svg +1 -0
- package/dist/svg/custom-field.svg +1 -0
- package/dist/svg/customize.svg +1 -0
- package/dist/svg/danger-filled.svg +1 -0
- package/dist/svg/danger.svg +1 -0
- package/dist/svg/dashboard-filled.svg +1 -0
- package/dist/svg/dashboard-outline.svg +1 -0
- package/dist/svg/delete-circle.svg +1 -0
- package/dist/svg/delete-key.svg +1 -0
- package/dist/svg/delete-x.svg +1 -0
- package/dist/svg/dollar-sign.svg +1 -0
- package/dist/svg/dot-menu-horizontal.svg +1 -0
- package/dist/svg/down-small.svg +1 -0
- package/dist/svg/download.svg +1 -0
- package/dist/svg/downsell.svg +1 -0
- package/dist/svg/draft.svg +1 -0
- package/dist/svg/drop.svg +1 -0
- package/dist/svg/duplicate.svg +1 -0
- package/dist/svg/email-activity.svg +1 -0
- package/dist/svg/emoji.svg +1 -0
- package/dist/svg/enlarge-vertical.svg +1 -0
- package/dist/svg/enlarge.svg +1 -0
- package/dist/svg/expand.svg +1 -0
- package/dist/svg/facebook-2.svg +1 -0
- package/dist/svg/facebook.svg +1 -0
- package/dist/svg/favorite.svg +1 -0
- package/dist/svg/feedback.svg +1 -0
- package/dist/svg/file-money.svg +1 -0
- package/dist/svg/file.svg +1 -0
- package/dist/svg/filter.svg +1 -0
- package/dist/svg/flag.svg +1 -0
- package/dist/svg/folder-group.svg +1 -0
- package/dist/svg/folder.svg +1 -0
- package/dist/svg/form-field.svg +1 -0
- package/dist/svg/form.svg +1 -0
- package/dist/svg/fullscreen.svg +1 -0
- package/dist/svg/funnel.svg +1 -0
- package/dist/svg/grant-offer.svg +1 -0
- package/dist/svg/handle-2-vertical.svg +1 -0
- package/dist/svg/handle-2.svg +1 -0
- package/dist/svg/handle.svg +1 -0
- package/dist/svg/hashtag.svg +1 -0
- package/dist/svg/heading-large.svg +1 -0
- package/dist/svg/heading-small.svg +1 -0
- package/dist/svg/headset.svg +1 -0
- package/dist/svg/help-filled.svg +1 -0
- package/dist/svg/help-outline.svg +1 -0
- package/dist/svg/home-alt.svg +1 -0
- package/dist/svg/horizontal-line.svg +1 -0
- package/dist/svg/image.svg +1 -0
- package/dist/svg/info-circle-filled.svg +1 -0
- package/dist/svg/info-circle.svg +1 -0
- package/dist/svg/instagram.svg +1 -0
- package/dist/svg/ios-battery.svg +1 -0
- package/dist/svg/ios-data.svg +1 -0
- package/dist/svg/ios-wifi.svg +1 -0
- package/dist/svg/italic.svg +1 -0
- package/dist/svg/kajabi-filled.svg +1 -0
- package/dist/svg/kajabi-outlined.svg +1 -0
- package/dist/svg/lab.svg +1 -0
- package/dist/svg/launch.svg +1 -0
- package/dist/svg/layout-grid.svg +1 -0
- package/dist/svg/layout-list.svg +1 -0
- package/dist/svg/left-small.svg +1 -0
- package/dist/svg/linkedin.svg +1 -0
- package/dist/svg/list-bullet.svg +1 -0
- package/dist/svg/list-numbers.svg +1 -0
- package/dist/svg/location.svg +1 -0
- package/dist/svg/lock-alt.svg +1 -0
- package/dist/svg/lock.svg +1 -0
- package/dist/svg/logo-afterpay.svg +1 -0
- package/dist/svg/loop.svg +1 -0
- package/dist/svg/mail.svg +1 -0
- package/dist/svg/mapped.svg +1 -0
- package/dist/svg/margin-left.svg +1 -0
- package/dist/svg/margin-right.svg +1 -0
- package/dist/svg/marker-filled.svg +1 -0
- package/dist/svg/marker.svg +1 -0
- package/dist/svg/marketing-filled.svg +1 -0
- package/dist/svg/marketing-outline.svg +1 -0
- package/dist/svg/menu-2.svg +1 -0
- package/dist/svg/menu-alt.svg +1 -0
- package/dist/svg/menu.svg +1 -0
- package/dist/svg/merge.svg +1 -0
- package/dist/svg/microphone-off.svg +1 -0
- package/dist/svg/microphone.svg +1 -0
- package/dist/svg/move-left.svg +1 -0
- package/dist/svg/move-right.svg +1 -0
- package/dist/svg/multi-pay.svg +1 -0
- package/dist/svg/newsletter.svg +1 -0
- package/dist/svg/one-off-session.svg +1 -0
- package/dist/svg/one-time.svg +1 -0
- package/dist/svg/partners-filled.svg +1 -0
- package/dist/svg/partners-outline.svg +1 -0
- package/dist/svg/pause-circle.svg +1 -0
- package/dist/svg/pause.svg +1 -0
- package/dist/svg/payout.svg +1 -0
- package/dist/svg/pen.svg +1 -0
- package/dist/svg/phone-portrait.svg +1 -0
- package/dist/svg/phone-toolbar.svg +1 -0
- package/dist/svg/play-circle.svg +1 -0
- package/dist/svg/play-outline.svg +1 -0
- package/dist/svg/play-store.svg +1 -0
- package/dist/svg/play.svg +1 -0
- package/dist/svg/plug.svg +1 -0
- package/dist/svg/present.svg +1 -0
- package/dist/svg/preview-off.svg +1 -0
- package/dist/svg/preview-on.svg +1 -0
- package/dist/svg/products-filled.svg +1 -0
- package/dist/svg/products-outline.svg +1 -0
- package/dist/svg/question-circle.svg +1 -0
- package/dist/svg/quote.svg +1 -0
- package/dist/svg/redo.svg +1 -0
- package/dist/svg/refresh.svg +1 -0
- package/dist/svg/remove-circle.svg +1 -0
- package/dist/svg/remove.svg +1 -0
- package/dist/svg/rename.svg +1 -0
- package/dist/svg/reset-password.svg +1 -0
- package/dist/svg/restore.svg +1 -0
- package/dist/svg/right-small.svg +1 -0
- package/dist/svg/round-dollar.svg +1 -0
- package/dist/svg/rows.svg +1 -0
- package/dist/svg/sales-filled.svg +1 -0
- package/dist/svg/sales-outline.svg +1 -0
- package/dist/svg/scissor.svg +1 -0
- package/dist/svg/screen-share-off.svg +1 -0
- package/dist/svg/screen-share-on.svg +1 -0
- package/dist/svg/search-small.svg +1 -0
- package/dist/svg/search.svg +1 -0
- package/dist/svg/send-message.svg +1 -0
- package/dist/svg/sequences.svg +1 -0
- package/dist/svg/series.svg +1 -0
- package/dist/svg/settings-filled.svg +1 -0
- package/dist/svg/settings-outline.svg +1 -0
- package/dist/svg/share.svg +1 -0
- package/dist/svg/skipped.svg +1 -0
- package/dist/svg/slash-divider.svg +1 -0
- package/dist/svg/sparkle-filled.svg +1 -0
- package/dist/svg/sparkle.svg +1 -0
- package/dist/svg/speaker.svg +1 -0
- package/dist/svg/stack.svg +1 -0
- package/dist/svg/star.svg +1 -0
- package/dist/svg/stop.svg +1 -0
- package/dist/svg/stopwatch.svg +1 -0
- package/dist/svg/strikethrough.svg +1 -0
- package/dist/svg/subscript.svg +1 -0
- package/dist/svg/subscriptions.svg +1 -0
- package/dist/svg/super-admin.svg +1 -0
- package/dist/svg/superscript.svg +1 -0
- package/dist/svg/sync.svg +1 -0
- package/dist/svg/tablet-landscape.svg +1 -0
- package/dist/svg/tablet-portrait.svg +1 -0
- package/dist/svg/text-styles.svg +1 -0
- package/dist/svg/theme-store.svg +1 -0
- package/dist/svg/thumbs-down-filled.svg +1 -0
- package/dist/svg/thumbs-down.svg +1 -0
- package/dist/svg/thumbs-up-filled.svg +1 -0
- package/dist/svg/thumbs-up.svg +1 -0
- package/dist/svg/tiktok.svg +1 -0
- package/dist/svg/trash.svg +1 -0
- package/dist/svg/twitter.svg +1 -0
- package/dist/svg/underline.svg +1 -0
- package/dist/svg/undo.svg +1 -0
- package/dist/svg/unlock.svg +1 -0
- package/dist/svg/unmapped.svg +1 -0
- package/dist/svg/up-small.svg +1 -0
- package/dist/svg/upload.svg +1 -0
- package/dist/svg/url.svg +1 -0
- package/dist/svg/user-filled.svg +1 -0
- package/dist/svg/user.svg +1 -0
- package/dist/svg/users-wm.svg +1 -0
- package/dist/svg/users.svg +1 -0
- package/dist/svg/video-off.svg +1 -0
- package/dist/svg/video-on.svg +1 -0
- package/dist/svg/warning-filled.svg +1 -0
- package/dist/svg/warning.svg +1 -0
- package/dist/svg/website-filled.svg +1 -0
- package/dist/svg/website-outline.svg +1 -0
- package/dist/svg/window-paragraph.svg +1 -0
- package/dist/svg/world.svg +1 -0
- package/dist/svg/youtube.svg +1 -0
- package/icons/index.d.ts +262 -0
- package/icons/index.js +262 -0
- package/icons/index.mjs +262 -0
- package/icons/package.json +8 -0
- package/package.json +104 -0
- package/readme.md +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*empty cjs*/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the base path to where the assets can be found. Use "setAssetPath(path)"
|
|
3
|
+
* if the path needs to be customized.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAssetPath: (path: string) => string;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Used to manually set the base path where assets can be found.
|
|
9
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
10
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
11
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
12
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
13
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
14
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
15
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
16
|
+
*/
|
|
17
|
+
export declare const setAssetPath: (path: string) => void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
21
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
22
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
23
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
24
|
+
* will result in the same behavior.
|
|
25
|
+
*/
|
|
26
|
+
export declare const setNonce: (nonce: string) => void
|
|
27
|
+
|
|
28
|
+
export interface SetPlatformOptions {
|
|
29
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
30
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
31
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"index.js","mappings":";","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface PdsIcon extends Components.PdsIcon, HTMLElement {}
|
|
4
|
+
export const PdsIcon: {
|
|
5
|
+
prototype: PdsIcon;
|
|
6
|
+
new (): PdsIcon;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, Build, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { i as isStr, b as inheritAttributes, g as getUrl, c as getName } from './utils.js';
|
|
3
|
+
|
|
4
|
+
const validateContent = (svgContent) => {
|
|
5
|
+
const div = document.createElement('div');
|
|
6
|
+
div.innerHTML = svgContent;
|
|
7
|
+
// setup this way to ensure it works on our buddy IE
|
|
8
|
+
for (let i = div.childNodes.length - 1; i >= 0; i--) {
|
|
9
|
+
if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
|
|
10
|
+
div.removeChild(div.childNodes[i]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
// must only have 1 root element
|
|
14
|
+
const svgElm = div.firstElementChild;
|
|
15
|
+
if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
|
|
16
|
+
const svgClass = svgElm.getAttribute('class') || '';
|
|
17
|
+
svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
|
|
18
|
+
// root element must be an svg
|
|
19
|
+
// lets double check we've got valid elements
|
|
20
|
+
// do not allow scripts
|
|
21
|
+
if (isValid(svgElm)) {
|
|
22
|
+
return div.innerHTML;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return '';
|
|
26
|
+
};
|
|
27
|
+
const isValid = (elm) => {
|
|
28
|
+
if (elm.nodeType === 1) {
|
|
29
|
+
if (elm.nodeName.toLowerCase() === 'script') {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
for (let i = 0; i < elm.attributes.length; i++) {
|
|
33
|
+
const name = elm.attributes[i].name;
|
|
34
|
+
if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (let i = 0; i < elm.childNodes.length; i++) {
|
|
39
|
+
if (!isValid(elm.childNodes[i])) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const pdsIconContent = new Map();
|
|
48
|
+
const requests = new Map(); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
49
|
+
const getSvgContent = (url, sanitize = false) => {
|
|
50
|
+
let req = requests.get(url);
|
|
51
|
+
if (!req) {
|
|
52
|
+
if (typeof fetch != 'undefined' && typeof document !== 'undefined') {
|
|
53
|
+
// we don't have a request
|
|
54
|
+
req = fetch(url).then((rsp) => {
|
|
55
|
+
if (rsp.ok) {
|
|
56
|
+
return rsp.text().then((svgContent) => {
|
|
57
|
+
if (svgContent && sanitize !== false) {
|
|
58
|
+
svgContent = validateContent(svgContent);
|
|
59
|
+
}
|
|
60
|
+
pdsIconContent.set(url, svgContent || '');
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
pdsIconContent.set(url, '');
|
|
64
|
+
});
|
|
65
|
+
requests.set(url, req);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
pdsIconContent.set(url, '');
|
|
69
|
+
return Promise.resolve();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return req;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const pdsIconCss = ":host{contain:strict;display:inline-block;fill:currentColor;height:1em;width:1em}:host .pdsicon{fill:currentColor}.pds-icon-fill-none{fill:none}.icon-inner,.pds-icon,svg{display:block;height:100%;width:100%}";
|
|
76
|
+
|
|
77
|
+
const PdsIcon$1 = /*@__PURE__*/ proxyCustomElement(class PdsIcon extends HTMLElement {
|
|
78
|
+
constructor() {
|
|
79
|
+
super();
|
|
80
|
+
this.__registerHost();
|
|
81
|
+
this.__attachShadow();
|
|
82
|
+
this.inheritedAttributes = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
83
|
+
this.hasAriaHidden = () => {
|
|
84
|
+
const { el } = this;
|
|
85
|
+
return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';
|
|
86
|
+
};
|
|
87
|
+
this.ariaLabel = undefined;
|
|
88
|
+
this.isVisible = false;
|
|
89
|
+
this.svgContent = undefined;
|
|
90
|
+
this.color = undefined;
|
|
91
|
+
this.name = undefined;
|
|
92
|
+
this.size = 'regular';
|
|
93
|
+
}
|
|
94
|
+
iconSize() {
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
|
+
const sizes = {
|
|
97
|
+
small: '12px',
|
|
98
|
+
regular: '16px',
|
|
99
|
+
medium: '20px',
|
|
100
|
+
large: '24px',
|
|
101
|
+
};
|
|
102
|
+
if (sizes[this.size]) {
|
|
103
|
+
return sizes[this.size];
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return this.size;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
componentWillLoad() {
|
|
110
|
+
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
|
111
|
+
}
|
|
112
|
+
connectedCallback() {
|
|
113
|
+
this.waitUntilVisible(this.el, '50px', () => {
|
|
114
|
+
this.isVisible = true;
|
|
115
|
+
this.loadIcon();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
disconnectedCallback() {
|
|
119
|
+
if (this.io) {
|
|
120
|
+
this.io.disconnect();
|
|
121
|
+
this.io = undefined;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
loadIcon() {
|
|
125
|
+
if (Build.isBrowser && this.isVisible) {
|
|
126
|
+
const url = getUrl(this);
|
|
127
|
+
if (url) {
|
|
128
|
+
if (pdsIconContent.has(url)) {
|
|
129
|
+
this.svgContent = pdsIconContent.get(url);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
getSvgContent(url).then(() => (this.svgContent = pdsIconContent.get(url)));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const label = getName(this.name);
|
|
137
|
+
if (label) {
|
|
138
|
+
this.ariaLabel = label.replace(/\-/g, ' ');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
render() {
|
|
142
|
+
const { ariaLabel, inheritedAttributes } = this;
|
|
143
|
+
const style = {
|
|
144
|
+
height: this.iconSize(),
|
|
145
|
+
width: this.iconSize(),
|
|
146
|
+
color: this.color,
|
|
147
|
+
};
|
|
148
|
+
return (h(Host, Object.assign({ "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, role: "img", style: style, class: Object.assign({}, createColorClasses(this.color)) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
|
|
149
|
+
}
|
|
150
|
+
/*****
|
|
151
|
+
* Private Methods
|
|
152
|
+
****/
|
|
153
|
+
waitUntilVisible(el, rootMargin, cb) {
|
|
154
|
+
if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {
|
|
155
|
+
const io = (this.io = new (window).IntersectionObserver((data) => {
|
|
156
|
+
if (data[0].isIntersecting) {
|
|
157
|
+
io.disconnect();
|
|
158
|
+
this.io = undefined;
|
|
159
|
+
cb();
|
|
160
|
+
}
|
|
161
|
+
}, { rootMargin }));
|
|
162
|
+
io.observe(el);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
// browser doesn't support IntersectionObserver
|
|
166
|
+
// so just fallback to always show it
|
|
167
|
+
cb();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
static get assetsDirs() { return ["svg"]; }
|
|
171
|
+
get el() { return this; }
|
|
172
|
+
static get watchers() { return {
|
|
173
|
+
"name": ["loadIcon"]
|
|
174
|
+
}; }
|
|
175
|
+
static get style() { return pdsIconCss; }
|
|
176
|
+
}, [1, "pds-icon", {
|
|
177
|
+
"color": [1],
|
|
178
|
+
"name": [513],
|
|
179
|
+
"size": [513],
|
|
180
|
+
"ariaLabel": [32],
|
|
181
|
+
"isVisible": [32],
|
|
182
|
+
"svgContent": [32]
|
|
183
|
+
}, undefined, {
|
|
184
|
+
"name": ["loadIcon"]
|
|
185
|
+
}]);
|
|
186
|
+
const createColorClasses = (color) => {
|
|
187
|
+
return color
|
|
188
|
+
? {
|
|
189
|
+
'pds-color': true,
|
|
190
|
+
[`pds-color-${color}`]: true,
|
|
191
|
+
}
|
|
192
|
+
: null;
|
|
193
|
+
};
|
|
194
|
+
function defineCustomElement$1() {
|
|
195
|
+
if (typeof customElements === "undefined") {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const components = ["pds-icon"];
|
|
199
|
+
components.forEach(tagName => { switch (tagName) {
|
|
200
|
+
case "pds-icon":
|
|
201
|
+
if (!customElements.get(tagName)) {
|
|
202
|
+
customElements.define(tagName, PdsIcon$1);
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
} });
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const PdsIcon = PdsIcon$1;
|
|
209
|
+
const defineCustomElement = defineCustomElement$1;
|
|
210
|
+
|
|
211
|
+
export { PdsIcon, defineCustomElement };
|
|
212
|
+
|
|
213
|
+
//# sourceMappingURL=pds-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"pds-icon.js","mappings":";;;AAEO,MAAM,eAAe,GAAG,CAAC,UAAkB;EAChD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;EAC1C,GAAG,CAAC,SAAS,GAAG,UAAU,CAAC;;EAG3B,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;IACnD,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,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AAiC;QAChC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE;UAC1B,EAAE,CAAC,UAAU,EAAE,CAAC;UAChB,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC;UACpB,EAAE,EAAE,CAAC;SACN;OACF,EACD,EAAE,UAAU,EAAE,CACf,CAAC,CAAC;MAEH,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;KAChB;SAAM;;;MAGL,EAAE,EAAE,CAAC;KACN;GACF;;;;;;;;;;;;;;;;;AASH,MAAM,kBAAkB,GAAG,CAAC,KAAyB;EACnD,OAAO,KAAK;MACT;MACE,WAAW,EAAE,IAAI;MACjB,CAAC,aAAa,KAAK,EAAE,GAAG,IAAI;KAC7B;MACD,IAAI,CAAC;AACT,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;","names":["PdsIcon"],"sources":["src/components/pds-icon/validate.ts","src/components/pds-icon/request.ts","src/components/pds-icon/pds-icon.scss?tag=pds-icon&encapsulation=shadow","src/components/pds-icon/pds-icon.tsx"],"sourcesContent":["import { isStr } from './utils';\n\nexport const validateContent = (svgContent: string) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) {\n return div.innerHTML;\n }\n }\n return '';\n};\n\nexport const isValid = (elm: HTMLElement) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i] as HTMLElement)) {\n return false;\n }\n }\n }\n return true;\n};\n","import { validateContent } from './validate';\n\nexport const pdsIconContent = new Map<string, string>();\nconst requests = new Map<string, Promise<any>>(); // eslint-disable-line @typescript-eslint/no-explicit-any\n\nexport const getSvgContent = (url: string, sanitize = false) => {\n let req = requests.get(url);\n\n if(!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n svgContent = validateContent(svgContent);\n }\n pdsIconContent.set(url, svgContent || '');\n });\n }\n pdsIconContent.set(url, '');\n });\n\n requests.set(url, req);\n } else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n return req;\n}\n",":host {\n contain: strict;\n display: inline-block;\n fill: currentColor;\n height: 1em;\n width: 1em;\n\n .pdsicon {\n fill: currentColor;\n }\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}\n","import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, pdsIconContent } from './request';\nimport { getName, getUrl, inheritAttributes } from './utils';\n\n@Component({\n tag: 'pds-icon',\n assetsDirs: ['svg'],\n styleUrl: 'pds-icon.scss',\n shadow: true,\n})\nexport class PdsIcon {\n private io?: IntersectionObserver;\n private inheritedAttributes: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n @Element() el!: HTMLPdsIconElement;\n\n @State() private ariaLabel?: string;\n @State() private isVisible = false;\n @State() private svgContent?: string;\n\n /**\n *\n * The color of the icon\n *\n */\n @Prop() color?: string;\n\n /**\n * The name of the icon to use from\n * the built-in set.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', large, or a\n * custom value (40px, 1rem, etc)\n *\n */\n @Prop({ reflect: true }) size?:\n | 'small' // 12px\n | 'regular' // 16px\n | 'medium' // 20px\n | 'large' // 24px\n | 'auto'\n | string = 'regular'\n\n private iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes: { [key: string]: any } = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size;\n }\n }\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n }\n\n connectedCallback() {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n })\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n @Watch('name')\n loadIcon() {\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n } else {\n getSvgContent(url).then(() => (this.svgContent = pdsIconContent.get(url)));\n }\n }\n }\n\n const label = getName(this.name);\n\n if (label) {\n this.ariaLabel = label.replace(/\\-/g, ' ');\n }\n }\n\n render() {\n const { ariaLabel, inheritedAttributes } = this;\n\n const style = {\n height: this.iconSize(),\n width: this.iconSize(),\n color: this.color,\n }\n\n return (\n\n <Host\n aria-label={ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null }\n role=\"img\"\n style={style}\n class={{\n ...createColorClasses(this.color),\n }}\n {...inheritedAttributes}\n >\n {Build.isBrowser && this.svgContent ? (\n <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n ) : (\n <div class=\"icon-inner\"></div>\n )}\n </Host>\n )\n }\n\n /*****\n * Private Methods\n ****/\n\n private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n },\n { rootMargin },\n ));\n\n io.observe(el);\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n private hasAriaHidden = () => {\n const { el } = this;\n\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n }\n}\n\nconst createColorClasses = (color: string | undefined) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n };\n"],"version":3}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { getAssetPath } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
let CACHED_MAP;
|
|
4
|
+
const addIcons = (icons) => {
|
|
5
|
+
const map = getIconMap();
|
|
6
|
+
Object.keys(icons).forEach(name => map.set(name, icons[name]));
|
|
7
|
+
};
|
|
8
|
+
const getIconMap = () => {
|
|
9
|
+
if (typeof window === 'undefined') {
|
|
10
|
+
return new Map();
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
if (!CACHED_MAP) {
|
|
14
|
+
const win = window; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
15
|
+
win.PdsIcons = win.PdsIcons || {};
|
|
16
|
+
CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();
|
|
17
|
+
}
|
|
18
|
+
return CACHED_MAP;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const getName = (iconName) => {
|
|
22
|
+
if (isStr(iconName)) {
|
|
23
|
+
iconName = toLower(iconName);
|
|
24
|
+
}
|
|
25
|
+
if (!isStr(iconName) || iconName.trim() === '') {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
|
|
29
|
+
if (invalidChars != '') {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return iconName;
|
|
33
|
+
};
|
|
34
|
+
const getNamedUrl = (iconName) => {
|
|
35
|
+
const url = getIconMap().get(iconName);
|
|
36
|
+
if (url) {
|
|
37
|
+
return url;
|
|
38
|
+
}
|
|
39
|
+
return getAssetPath(`svg/${iconName}.svg`);
|
|
40
|
+
};
|
|
41
|
+
const getUrl = (icon) => {
|
|
42
|
+
const url = getName(icon.name);
|
|
43
|
+
if (url) {
|
|
44
|
+
return getNamedUrl(url);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const isStr = (val) => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
48
|
+
const toLower = (val) => val.toLowerCase();
|
|
49
|
+
/**
|
|
50
|
+
* Elements inside of web components sometimes need to inherit global attributes
|
|
51
|
+
* set on the host. For example, the inner input in `ion-input` should inherit
|
|
52
|
+
* the `title` attribute that developers set directly on `ion-input`. This
|
|
53
|
+
* helper function should be called in componentWillLoad and assigned to a variable
|
|
54
|
+
* that is later used in the render function.
|
|
55
|
+
*
|
|
56
|
+
* This does not need to be reactive as changing attributes on the host element
|
|
57
|
+
* does not trigger a re-render.
|
|
58
|
+
*/
|
|
59
|
+
const inheritAttributes = (el, attributes = []) => {
|
|
60
|
+
const attributeObject = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
61
|
+
attributes.forEach(attr => {
|
|
62
|
+
if (el.hasAttribute(attr)) {
|
|
63
|
+
const value = el.getAttribute(attr);
|
|
64
|
+
if (value !== null) {
|
|
65
|
+
attributeObject[attr] = el.getAttribute(attr);
|
|
66
|
+
}
|
|
67
|
+
el.removeAttribute(attr);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return attributeObject;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { addIcons as a, inheritAttributes as b, getName as c, getUrl as g, isStr as i };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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QAAQ,CAAC,CAAC;EACvC,IAAI,GAAG,EAAE;IACP,OAAO,GAAG,CAAC;GACZ;EAED,OAAO,YAAY,CAAC,OAAO,QAAQ,MAAM,CAAC,CAAC;AAC7C,CAAC,CAAC;MAcW,MAAM,GAAG,CAAC,IAAa;EAClC,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAC/B,IAAI,GAAG,EAAE;IACP,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;GACzB;AACH,EAAE;MAIW,KAAK,GAAG,CAAC,GAAQ,KAAoB,OAAO,GAAG,KAAK,SAAS;AACnE,MAAM,OAAO,GAAG,CAAC,GAAW,KAAK,GAAG,CAAC,WAAW,EAAE,CAAC;AAE1D;;;;;;;;;;MAUc,iBAAiB,GAAG,CAAC,EAAe,EAAE,aAAuB,EAAE;EAC3E,MAAM,eAAe,GAAyB,EAAE,CAAC;EAEjD,UAAU,CAAC,OAAO,CAAC,IAAI;IACrB,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;MACzB,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;MACpC,IAAI,KAAK,KAAK,IAAI,EAAE;QAClB,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;OAC/C;MACD,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;KAC1B;GACF,CAAC,CAAC;EAEH,OAAO,eAAe,CAAC;AACzB;;;;","names":[],"sources":["src/components/pds-icon/utils.ts"],"sourcesContent":["import { getAssetPath } from '@stencil/core';\nimport { PdsIcon } from './pds-icon';\n\nlet CACHED_MAP: Map<string, string>;\n\nexport const addIcons = (icons: { [name: string]: string; }) => {\n const map = getIconMap();\n Object.keys(icons).forEach(name => map.set(name, icons[name]));\n}\n\nexport const getIconMap = (): Map<string, string> => {\n if (typeof window === 'undefined') {\n return new Map();\n } else {\n if (!CACHED_MAP) {\n const win = window as any; // eslint-disable-line @typescript-eslint/no-explicit-any\n win.PdsIcons = win.PdsIcons || {};\n CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();\n }\n\n return CACHED_MAP;\n }\n}\n\nexport const getName = (iconName: string | undefined) => {\n if (isStr(iconName)) {\n iconName = toLower(iconName);\n }\n\n if (!isStr(iconName) || iconName.trim() === '') {\n return null;\n }\n\n const invalidChars = iconName.replace(/[a-z]|-|\\d/gi,'');\n if (invalidChars != '') { return null; }\n\n return iconName;\n}\n\nconst getNamedUrl = (iconName: string) => {\n const url = getIconMap().get(iconName);\n if (url) {\n return url;\n }\n\n return getAssetPath(`svg/${iconName}.svg`);\n};\n\nexport const getSrc = (src: string | undefined) => {\n if (isStr(src)) {\n src = src.trim();\n\n if (isSrc(src)) {\n return src;\n }\n }\n\n return null;\n}\n\nexport const getUrl = (icon: PdsIcon) => {\n const url = getName(icon.name);\n if (url) {\n return getNamedUrl(url);\n }\n};\n\n\nexport const isSrc = (str: string) => str.length > 0 && /(\\/|\\.)/.test(str);\nexport const isStr = (val: any): val is string => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport const toLower = (val: string) => val.toLowerCase();\n\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `ion-input` should inherit\n * the `title` attribute that developers set directly on `ion-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\n export const inheritAttributes = (el: HTMLElement, attributes: string[] = []) => {\n const attributeObject: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n}\n"],"version":3}
|