@carbon/web-components 2.62.0 → 2.63.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 +26 -0
- package/bin/create-prefixed-build.js +157 -0
- package/custom-elements.json +2074 -360
- package/es/components/accordion/accordion.scss.js +1 -1
- package/es/components/action-set/action-set.scss.js +1 -1
- package/es/components/ai-label/ai-label-action-button.d.ts +1 -1
- package/es/components/ai-label/ai-label-action-button.d.ts.map +1 -1
- package/es/components/ai-label/ai-label-action-button.js +4 -3
- package/es/components/ai-label/ai-label-action-button.js.map +1 -1
- package/es/components/ai-label/ai-label.scss.js +1 -1
- package/es/components/ai-label/ai-label.scss.js.map +1 -1
- package/es/components/ai-label/index.d.ts +1 -0
- package/es/components/ai-label/index.d.ts.map +1 -1
- package/es/components/ai-label/index.js +1 -0
- package/es/components/ai-skeleton/ai-skeleton.scss.js +1 -1
- package/es/components/big-number/big-number-skeleton.d.ts +21 -0
- package/es/components/big-number/big-number-skeleton.d.ts.map +1 -0
- package/es/components/big-number/big-number-skeleton.js +62 -0
- package/es/components/big-number/big-number-skeleton.js.map +1 -0
- package/es/components/big-number/big-number-skeleton.scss.js +14 -0
- package/es/components/big-number/big-number-skeleton.scss.js.map +1 -0
- package/es/components/big-number/big-number.d.ts +35 -0
- package/es/components/big-number/big-number.d.ts.map +1 -0
- package/es/components/big-number/big-number.js +171 -0
- package/es/components/big-number/big-number.js.map +1 -0
- package/es/components/big-number/big-number.scss.js +14 -0
- package/es/components/big-number/big-number.scss.js.map +1 -0
- package/es/components/big-number/constants.d.ts +20 -0
- package/es/components/big-number/constants.d.ts.map +1 -0
- package/es/components/big-number/constants.js +32 -0
- package/es/components/big-number/constants.js.map +1 -0
- package/es/components/big-number/index.d.ts +8 -0
- package/es/components/big-number/index.d.ts.map +1 -0
- package/es/components/big-number/index.js +8 -0
- package/es/components/breadcrumb/breadcrumb-item.d.ts.map +1 -1
- package/es/components/breadcrumb/breadcrumb-item.js +2 -1
- package/es/components/breadcrumb/breadcrumb-item.js.map +1 -1
- package/es/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/es/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/es/components/breadcrumb/breadcrumb.js +2 -2
- package/es/components/breadcrumb/breadcrumb.js.map +1 -1
- package/es/components/breadcrumb/breadcrumb.scss.js +1 -1
- package/es/components/button/button.d.ts.map +1 -1
- package/es/components/button/button.js +1 -1
- package/es/components/button/button.js.map +1 -1
- package/es/components/button/button.scss.js +1 -1
- package/es/components/card/card-action.d.ts +27 -0
- package/es/components/card/card-action.d.ts.map +1 -0
- package/es/components/card/card-action.js +52 -0
- package/es/components/card/card-action.js.map +1 -0
- package/es/components/card/card-actions.d.ts +36 -0
- package/es/components/card/card-actions.d.ts.map +1 -0
- package/es/components/card/card-actions.js +171 -0
- package/es/components/card/card-actions.js.map +1 -0
- package/es/components/card/card-body.d.ts +23 -0
- package/es/components/card/card-body.d.ts.map +1 -0
- package/es/components/card/card-body.js +54 -0
- package/es/components/card/card-body.js.map +1 -0
- package/es/components/card/card-context.d.ts +20 -0
- package/es/components/card/card-context.d.ts.map +1 -0
- package/es/components/card/card-context.js +29 -0
- package/es/components/card/card-context.js.map +1 -0
- package/es/components/card/card-footer.d.ts +34 -0
- package/es/components/card/card-footer.d.ts.map +1 -0
- package/es/components/card/card-footer.js +75 -0
- package/es/components/card/card-footer.js.map +1 -0
- package/es/components/card/card-header-media.d.ts +19 -0
- package/es/components/card/card-header-media.d.ts.map +1 -0
- package/es/components/card/card-header-media.js +39 -0
- package/es/components/card/card-header-media.js.map +1 -0
- package/es/components/card/card-header.d.ts +23 -0
- package/es/components/card/card-header.d.ts.map +1 -0
- package/es/components/card/card-header.js +70 -0
- package/es/components/card/card-header.js.map +1 -0
- package/es/components/card/card-media.d.ts +37 -0
- package/es/components/card/card-media.d.ts.map +1 -0
- package/es/components/card/card-media.js +79 -0
- package/es/components/card/card-media.js.map +1 -0
- package/es/components/card/card-title-media.d.ts +19 -0
- package/es/components/card/card-title-media.d.ts.map +1 -0
- package/es/components/card/card-title-media.js +39 -0
- package/es/components/card/card-title-media.js.map +1 -0
- package/es/components/card/card-title.d.ts +52 -0
- package/es/components/card/card-title.d.ts.map +1 -0
- package/es/components/card/card-title.js +144 -0
- package/es/components/card/card-title.js.map +1 -0
- package/es/components/card/card.d.ts +69 -0
- package/es/components/card/card.d.ts.map +1 -0
- package/es/components/card/card.js +185 -0
- package/es/components/card/card.js.map +1 -0
- package/es/components/card/card.scss.js +14 -0
- package/es/components/card/card.scss.js.map +1 -0
- package/es/components/card/defs.d.ts +33 -0
- package/es/components/card/defs.d.ts.map +1 -0
- package/es/components/card/defs.js +46 -0
- package/es/components/card/defs.js.map +1 -0
- package/es/components/card/index.d.ts +17 -0
- package/es/components/card/index.d.ts.map +1 -0
- package/es/components/card/index.js +17 -0
- package/es/components/checkbox/checkbox.scss.js +1 -1
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.d.ts +67 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.d.ts.map +1 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.js +120 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.js.map +1 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.scss.js +14 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.scss.js.map +1 -0
- package/es/components/coachmark/coachmark-beacon/defs.d.ts +13 -0
- package/es/components/coachmark/coachmark-beacon/defs.d.ts.map +1 -0
- package/es/components/coachmark/coachmark-beacon/defs.js +25 -0
- package/es/components/coachmark/coachmark-beacon/defs.js.map +1 -0
- package/es/components/coachmark/coachmark-beacon/index.d.ts +8 -0
- package/es/components/coachmark/coachmark-beacon/index.d.ts.map +1 -0
- package/es/components/coachmark/coachmark-beacon/index.js +8 -0
- package/es/components/coachmark/coachmark-body.d.ts +31 -0
- package/es/components/coachmark/coachmark-body.d.ts.map +1 -0
- package/es/components/coachmark/coachmark-body.js +39 -0
- package/es/components/coachmark/coachmark-body.js.map +1 -0
- package/es/components/coachmark/coachmark-body.scss.js +14 -0
- package/es/components/coachmark/coachmark-body.scss.js.map +1 -0
- package/es/components/coachmark/coachmark-context.d.ts +12 -0
- package/es/components/coachmark/coachmark-context.d.ts.map +1 -0
- package/es/components/coachmark/coachmark-context.js +39 -0
- package/es/components/coachmark/coachmark-context.js.map +1 -0
- package/es/components/coachmark/coachmark-header.d.ts +41 -0
- package/es/components/coachmark/coachmark-header.d.ts.map +1 -0
- package/es/components/coachmark/coachmark-header.js +95 -0
- package/es/components/coachmark/coachmark-header.js.map +1 -0
- package/es/components/coachmark/coachmark-header.scss.js +14 -0
- package/es/components/coachmark/coachmark-header.scss.js.map +1 -0
- package/es/components/coachmark/coachmark-helpers.d.ts +10 -0
- package/es/components/coachmark/coachmark-helpers.d.ts.map +1 -0
- package/es/components/coachmark/coachmark-helpers.js +33 -0
- package/es/components/coachmark/coachmark-helpers.js.map +1 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.d.ts +72 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.d.ts.map +1 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.js +130 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.js.map +1 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.scss.js +14 -0
- package/es/components/coachmark/coachmark-tagline/coachmark-tagline.scss.js.map +1 -0
- package/es/components/coachmark/coachmark-tagline/index.d.ts +8 -0
- package/es/components/coachmark/coachmark-tagline/index.d.ts.map +1 -0
- package/es/components/coachmark/coachmark-tagline/index.js +8 -0
- package/es/components/coachmark/coachmark.d.ts +97 -0
- package/es/components/coachmark/coachmark.d.ts.map +1 -0
- package/es/components/coachmark/coachmark.js +290 -0
- package/es/components/coachmark/coachmark.js.map +1 -0
- package/es/components/coachmark/coachmark.scss.js +14 -0
- package/es/components/coachmark/coachmark.scss.js.map +1 -0
- package/es/components/coachmark/index.d.ts +10 -0
- package/es/components/coachmark/index.d.ts.map +1 -0
- package/es/components/coachmark/index.js +10 -0
- package/es/components/code-snippet/code-snippet.scss.js +1 -1
- package/es/components/combo-box/combo-box.d.ts.map +1 -1
- package/es/components/combo-box/combo-box.js +5 -12
- package/es/components/combo-box/combo-box.js.map +1 -1
- package/es/components/combo-box/combo-box.scss.js +1 -1
- package/es/components/combo-box/combo-box.scss.js.map +1 -1
- package/es/components/combo-button/combo-button.scss.js +1 -1
- package/es/components/contained-list/contained-list.scss.js +1 -1
- package/es/components/content-switcher/content-switcher.scss.js +1 -1
- package/es/components/copy/index.d.ts +9 -0
- package/es/components/copy/index.d.ts.map +1 -0
- package/es/components/copy/index.js +9 -0
- package/es/components/copy-button/copy-button.scss.js +1 -1
- package/es/components/data-table/data-table.scss.js +1 -1
- package/es/components/date-picker/date-picker.scss.js +1 -1
- package/es/components/date-picker/date-picker.scss.js.map +1 -1
- package/es/components/date-picker/next/components/date-picker.scss.js +1 -1
- package/es/components/date-picker/next/components/date-picker.scss.js.map +1 -1
- package/es/components/dialog/dialog.scss.js +1 -1
- package/es/components/dropdown/dropdown.d.ts +2 -1
- package/es/components/dropdown/dropdown.d.ts.map +1 -1
- package/es/components/dropdown/dropdown.js +13 -15
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/dropdown/dropdown.scss.js +1 -1
- package/es/components/dropdown/dropdown.scss.js.map +1 -1
- package/es/components/edit-in-place/defs.d.ts +30 -0
- package/es/components/edit-in-place/defs.d.ts.map +1 -0
- package/es/components/edit-in-place/defs.js +43 -0
- package/es/components/edit-in-place/defs.js.map +1 -0
- package/es/components/edit-in-place/edit-in-place-helpers.d.ts +47 -0
- package/es/components/edit-in-place/edit-in-place-helpers.d.ts.map +1 -0
- package/es/components/edit-in-place/edit-in-place-helpers.js +59 -0
- package/es/components/edit-in-place/edit-in-place-helpers.js.map +1 -0
- package/es/components/edit-in-place/edit-in-place.d.ts +214 -0
- package/es/components/edit-in-place/edit-in-place.d.ts.map +1 -0
- package/es/components/edit-in-place/edit-in-place.js +453 -0
- package/es/components/edit-in-place/edit-in-place.js.map +1 -0
- package/es/components/edit-in-place/edit-in-place.scss.js +14 -0
- package/es/components/edit-in-place/edit-in-place.scss.js.map +1 -0
- package/es/components/edit-in-place/index.d.ts +10 -0
- package/es/components/edit-in-place/index.d.ts.map +1 -0
- package/es/components/edit-in-place/index.js +20 -0
- package/es/components/edit-in-place/index.js.map +1 -0
- package/es/components/file-uploader/file-uploader.scss.js +1 -1
- package/es/components/fluid-combo-box/fluid-combo-box.scss.js +1 -1
- package/es/components/fluid-combo-box/fluid-combo-box.scss.js.map +1 -1
- package/es/components/fluid-date-picker/fluid-date-picker.d.ts +5 -1
- package/es/components/fluid-date-picker/fluid-date-picker.d.ts.map +1 -1
- package/es/components/fluid-date-picker/fluid-date-picker.js +27 -1
- package/es/components/fluid-date-picker/fluid-date-picker.js.map +1 -1
- package/es/components/fluid-date-picker/fluid-date-picker.scss.js +1 -1
- package/es/components/fluid-date-picker/fluid-date-picker.scss.js.map +1 -1
- package/es/components/fluid-dropdown/fluid-dropdown.scss.js +1 -1
- package/es/components/fluid-dropdown/fluid-dropdown.scss.js.map +1 -1
- package/es/components/fluid-form/fluid-form.scss.js +1 -1
- package/es/components/fluid-multi-select/fluid-multi-select.scss.js +1 -1
- package/es/components/fluid-multi-select/fluid-multi-select.scss.js.map +1 -1
- package/es/components/fluid-number-input/fluid-number-input.scss.js +1 -1
- package/es/components/fluid-number-input/fluid-number-input.scss.js.map +1 -1
- package/es/components/fluid-password-input/fluid-password-input.scss.js +1 -1
- package/es/components/fluid-search/fluid-search.scss.js +1 -1
- package/es/components/fluid-search/fluid-search.scss.js.map +1 -1
- package/es/components/fluid-select/fluid-select.scss.js +1 -1
- package/es/components/fluid-text-input/fluid-text-input.scss.js +1 -1
- package/es/components/fluid-textarea/fluid-textarea.scss.js +1 -1
- package/es/components/fluid-time-picker/fluid-time-picker.scss.js +1 -1
- package/es/components/form/form-item.scss.js +1 -1
- package/es/components/form/form.scss.js +1 -1
- package/es/components/form-group/form-group.scss.js +1 -1
- package/es/components/grid/column-hang.scss.js +1 -1
- package/es/components/grid/grid.scss.js +1 -1
- package/es/components/icon-button/icon-button.d.ts +1 -1
- package/es/components/icon-button/icon-button.js +1 -1
- package/es/components/icon-button/icon-button.js.map +1 -1
- package/es/components/inline-loading/inline-loading.scss.js +1 -1
- package/es/components/layer/layer.scss.js +1 -1
- package/es/components/layout/layout.scss.js +1 -1
- package/es/components/link/link.d.ts +2 -1
- package/es/components/link/link.d.ts.map +1 -1
- package/es/components/link/link.js +1 -1
- package/es/components/link/link.js.map +1 -1
- package/es/components/loading/loading.scss.js +1 -1
- package/es/components/menu/menu-item.d.ts.map +1 -1
- package/es/components/menu/menu-item.js +2 -6
- package/es/components/menu/menu-item.js.map +1 -1
- package/es/components/menu/menu-item.scss.js +1 -1
- package/es/components/menu/menu-item.scss.js.map +1 -1
- package/es/components/menu/menu.d.ts +10 -0
- package/es/components/menu/menu.d.ts.map +1 -1
- package/es/components/menu/menu.js +17 -11
- package/es/components/menu/menu.js.map +1 -1
- package/es/components/menu/menu.scss.js +1 -1
- package/es/components/menu/menu.scss.js.map +1 -1
- package/es/components/menu-button/menu-button.scss.js +1 -1
- package/es/components/modal/modal.scss.js +1 -1
- package/es/components/multi-select/multi-select-item.d.ts +1 -1
- package/es/components/multi-select/multi-select-item.d.ts.map +1 -1
- package/es/components/multi-select/multi-select-item.js +5 -1
- package/es/components/multi-select/multi-select-item.js.map +1 -1
- package/es/components/multi-select/multi-select.d.ts +2 -1
- package/es/components/multi-select/multi-select.d.ts.map +1 -1
- package/es/components/multi-select/multi-select.js +15 -14
- package/es/components/multi-select/multi-select.js.map +1 -1
- package/es/components/multi-select/multi-select.scss.js +1 -1
- package/es/components/multi-select/multi-select.scss.js.map +1 -1
- package/es/components/notification/actionable-notification-button.d.ts +1 -1
- package/es/components/notification/actionable-notification-button.d.ts.map +1 -1
- package/es/components/notification/actionable-notification-button.js +2 -2
- package/es/components/notification/actionable-notification-button.js.map +1 -1
- package/es/components/notification/actionable-notification.d.ts.map +1 -1
- package/es/components/notification/actionable-notification.js +4 -4
- package/es/components/notification/actionable-notification.js.map +1 -1
- package/es/components/notification/actionable-notification.scss.js +1 -1
- package/es/components/notification/inline-notification.scss.js +1 -1
- package/es/components/notification/toast-notification.scss.js +1 -1
- package/es/components/number-input/number-input.scss.js +1 -1
- package/es/components/number-input/number-input.scss.js.map +1 -1
- package/es/components/options-tile/index.d.ts +8 -0
- package/es/components/options-tile/index.d.ts.map +1 -0
- package/es/components/options-tile/index.js +8 -0
- package/es/components/options-tile/option-tile-helpers.d.ts +16 -0
- package/es/components/options-tile/option-tile-helpers.d.ts.map +1 -0
- package/es/components/options-tile/option-tile-helpers.js +163 -0
- package/es/components/options-tile/option-tile-helpers.js.map +1 -0
- package/es/components/options-tile/options-tile.d.ts +91 -0
- package/es/components/options-tile/options-tile.d.ts.map +1 -0
- package/es/components/options-tile/options-tile.js +208 -0
- package/es/components/options-tile/options-tile.js.map +1 -0
- package/es/components/options-tile/options-tile.scss.js +14 -0
- package/es/components/options-tile/options-tile.scss.js.map +1 -0
- package/es/components/overflow-menu/overflow-menu.js +1 -1
- package/es/components/overflow-menu/overflow-menu.scss.js +1 -1
- package/es/components/page-header/index.d.ts +1 -0
- package/es/components/page-header/index.d.ts.map +1 -1
- package/es/components/page-header/index.js +1 -0
- package/es/components/page-header/page-header-tabs.d.ts +1 -1
- package/es/components/page-header/page-header-tabs.d.ts.map +1 -1
- package/es/components/page-header/page-header-tabs.js +1 -2
- package/es/components/page-header/page-header-tabs.js.map +1 -1
- package/es/components/page-header/page-header.d.ts +1 -1
- package/es/components/page-header/page-header.d.ts.map +1 -1
- package/es/components/page-header/page-header.js +1 -2
- package/es/components/page-header/page-header.js.map +1 -1
- package/es/components/page-header/page-header.scss.js +1 -1
- package/es/components/pagination/pagination.scss.js +1 -1
- package/es/components/pagination-nav/pagination-nav.scss.js +1 -1
- package/es/components/password-input/password-input.scss.js +1 -1
- package/es/components/popover/popover.scss.js +1 -1
- package/es/components/progress-bar/progress-bar.scss.js +1 -1
- package/es/components/progress-indicator/progress-indicator.scss.js +1 -1
- package/es/components/radio-button/radio-button.scss.js +1 -1
- package/es/components/resizer/resizer-handle-pivot.scss.js +1 -1
- package/es/components/search/search.d.ts.map +1 -1
- package/es/components/search/search.js +2 -0
- package/es/components/search/search.js.map +1 -1
- package/es/components/search/search.scss.js +1 -1
- package/es/components/search/search.scss.js.map +1 -1
- package/es/components/select/select.scss.js +1 -1
- package/es/components/select/select.scss.js.map +1 -1
- package/es/components/side-panel/side-panel.js +2 -2
- package/es/components/side-panel/side-panel.js.map +1 -1
- package/es/components/side-panel/side-panel.scss.js +1 -1
- package/es/components/skeleton-icon/skeleton-icon.scss.js +1 -1
- package/es/components/skeleton-placeholder/skeleton-placeholder.scss.js +1 -1
- package/es/components/skeleton-text/skeleton-text.scss.js +1 -1
- package/es/components/skip-to-content/skip-to-content.scss.js +1 -1
- package/es/components/slider/slider.scss.js +1 -1
- package/es/components/slider/slider.scss.js.map +1 -1
- package/es/components/slug/index.d.ts +1 -0
- package/es/components/slug/index.d.ts.map +1 -1
- package/es/components/slug/index.js +1 -0
- package/es/components/slug/slug.scss.js +1 -1
- package/es/components/structured-list/structured-list.scss.js +1 -1
- package/es/components/tabs/tabs.scss.js +1 -1
- package/es/components/tabs/tabs.scss.js.map +1 -1
- package/es/components/tag/dismissible-tag.d.ts +1 -1
- package/es/components/tag/dismissible-tag.d.ts.map +1 -1
- package/es/components/tag/dismissible-tag.js +24 -15
- package/es/components/tag/dismissible-tag.js.map +1 -1
- package/es/components/tag/tag.d.ts.map +1 -1
- package/es/components/tag/tag.js +1 -1
- package/es/components/tag/tag.js.map +1 -1
- package/es/components/tag/tag.scss.js +1 -1
- package/es/components/tag/tag.scss.js.map +1 -1
- package/es/components/text-input/text-input.scss.js +1 -1
- package/es/components/text-input/text-input.scss.js.map +1 -1
- package/es/components/textarea/textarea.scss.js +1 -1
- package/es/components/tile/clickable-tile.d.ts +2 -1
- package/es/components/tile/clickable-tile.d.ts.map +1 -1
- package/es/components/tile/clickable-tile.js +1 -1
- package/es/components/tile/clickable-tile.js.map +1 -1
- package/es/components/tile/tile.scss.js +1 -1
- package/es/components/time-picker/time-picker.scss.js +1 -1
- package/es/components/toggle-tip/toggletip.scss.js +1 -1
- package/es/components/tooltip/tooltip.scss.js +1 -1
- package/es/components/tree-view/tree-view.scss.js +1 -1
- package/es/components/ui-shell/header.scss.js +1 -1
- package/es/components/ui-shell/side-nav.scss.js +1 -1
- package/es/components/user-avatar/index.d.ts +8 -0
- package/es/components/user-avatar/index.d.ts.map +1 -0
- package/es/components/user-avatar/index.js +8 -0
- package/es/components/user-avatar/user-avatar.d.ts +84 -0
- package/es/components/user-avatar/user-avatar.d.ts.map +1 -0
- package/es/components/user-avatar/user-avatar.js +151 -0
- package/es/components/user-avatar/user-avatar.js.map +1 -0
- package/es/components/user-avatar/user-avatar.scss.js +14 -0
- package/es/components/user-avatar/user-avatar.scss.js.map +1 -0
- package/es/globals/controllers/floating-controller.d.ts.map +1 -1
- package/es/globals/controllers/floating-controller.js.map +1 -1
- package/es/globals/decorators/carbon-element.d.ts +8 -0
- package/es/globals/decorators/carbon-element.d.ts.map +1 -1
- package/es/globals/decorators/carbon-element.js +8 -0
- package/es/globals/decorators/carbon-element.js.map +1 -1
- package/es/globals/internal/collection-helpers.d.ts +5 -5
- package/es/globals/internal/collection-helpers.d.ts.map +1 -1
- package/es/globals/internal/collection-helpers.js +1 -1
- package/es/globals/internal/collection-helpers.js.map +1 -1
- package/es/globals/internal/getSupportedLocale.d.ts +12 -0
- package/es/globals/internal/getSupportedLocale.d.ts.map +1 -0
- package/es/globals/internal/getSupportedLocale.js +29 -0
- package/es/globals/internal/getSupportedLocale.js.map +1 -0
- package/es/globals/mixins/on.d.ts +2 -2
- package/es/globals/mixins/on.d.ts.map +1 -1
- package/es/globals/mixins/on.js +4 -4
- package/es/globals/mixins/on.js.map +1 -1
- package/es/globals/register.d.ts +89 -0
- package/es/globals/register.d.ts.map +1 -0
- package/es/globals/register.js +56 -0
- package/es/globals/register.js.map +1 -0
- package/es/globals/settings.d.ts +1 -1
- package/es/globals/settings.d.ts.map +1 -1
- package/es/globals/settings.js +1 -0
- package/es/globals/settings.js.map +1 -1
- package/es/index.d.ts +10 -0
- package/es/index.d.ts.map +1 -1
- package/es/index.js +13 -3
- package/es-custom/components/accordion/accordion.scss.js +1 -1
- package/es-custom/components/action-set/action-set.scss.js +1 -1
- package/es-custom/components/ai-label/ai-label-action-button.d.ts +1 -1
- package/es-custom/components/ai-label/ai-label-action-button.d.ts.map +1 -1
- package/es-custom/components/ai-label/ai-label-action-button.js +4 -3
- package/es-custom/components/ai-label/ai-label-action-button.js.map +1 -1
- package/es-custom/components/ai-label/ai-label.scss.js +1 -1
- package/es-custom/components/ai-label/ai-label.scss.js.map +1 -1
- package/es-custom/components/ai-label/index.d.ts +1 -0
- package/es-custom/components/ai-label/index.d.ts.map +1 -1
- package/es-custom/components/ai-label/index.js +1 -0
- package/es-custom/components/ai-skeleton/ai-skeleton.scss.js +1 -1
- package/es-custom/components/big-number/big-number-skeleton.d.ts +21 -0
- package/es-custom/components/big-number/big-number-skeleton.d.ts.map +1 -0
- package/es-custom/components/big-number/big-number-skeleton.js +62 -0
- package/es-custom/components/big-number/big-number-skeleton.js.map +1 -0
- package/es-custom/components/big-number/big-number-skeleton.scss.js +14 -0
- package/es-custom/components/big-number/big-number-skeleton.scss.js.map +1 -0
- package/es-custom/components/big-number/big-number.d.ts +35 -0
- package/es-custom/components/big-number/big-number.d.ts.map +1 -0
- package/es-custom/components/big-number/big-number.js +171 -0
- package/es-custom/components/big-number/big-number.js.map +1 -0
- package/es-custom/components/big-number/big-number.scss.js +14 -0
- package/es-custom/components/big-number/big-number.scss.js.map +1 -0
- package/es-custom/components/big-number/constants.d.ts +20 -0
- package/es-custom/components/big-number/constants.d.ts.map +1 -0
- package/es-custom/components/big-number/constants.js +32 -0
- package/es-custom/components/big-number/constants.js.map +1 -0
- package/es-custom/components/big-number/index.d.ts +8 -0
- package/es-custom/components/big-number/index.d.ts.map +1 -0
- package/es-custom/components/big-number/index.js +8 -0
- package/es-custom/components/breadcrumb/breadcrumb-item.d.ts.map +1 -1
- package/es-custom/components/breadcrumb/breadcrumb-item.js +2 -1
- package/es-custom/components/breadcrumb/breadcrumb-item.js.map +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.js +2 -2
- package/es-custom/components/breadcrumb/breadcrumb.js.map +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.scss.js +1 -1
- package/es-custom/components/button/button.d.ts.map +1 -1
- package/es-custom/components/button/button.js +1 -1
- package/es-custom/components/button/button.js.map +1 -1
- package/es-custom/components/button/button.scss.js +1 -1
- package/es-custom/components/card/card-action.d.ts +27 -0
- package/es-custom/components/card/card-action.d.ts.map +1 -0
- package/es-custom/components/card/card-action.js +52 -0
- package/es-custom/components/card/card-action.js.map +1 -0
- package/es-custom/components/card/card-actions.d.ts +36 -0
- package/es-custom/components/card/card-actions.d.ts.map +1 -0
- package/es-custom/components/card/card-actions.js +171 -0
- package/es-custom/components/card/card-actions.js.map +1 -0
- package/es-custom/components/card/card-body.d.ts +23 -0
- package/es-custom/components/card/card-body.d.ts.map +1 -0
- package/es-custom/components/card/card-body.js +54 -0
- package/es-custom/components/card/card-body.js.map +1 -0
- package/es-custom/components/card/card-context.d.ts +20 -0
- package/es-custom/components/card/card-context.d.ts.map +1 -0
- package/es-custom/components/card/card-context.js +29 -0
- package/es-custom/components/card/card-context.js.map +1 -0
- package/es-custom/components/card/card-footer.d.ts +34 -0
- package/es-custom/components/card/card-footer.d.ts.map +1 -0
- package/es-custom/components/card/card-footer.js +75 -0
- package/es-custom/components/card/card-footer.js.map +1 -0
- package/es-custom/components/card/card-header-media.d.ts +19 -0
- package/es-custom/components/card/card-header-media.d.ts.map +1 -0
- package/es-custom/components/card/card-header-media.js +39 -0
- package/es-custom/components/card/card-header-media.js.map +1 -0
- package/es-custom/components/card/card-header.d.ts +23 -0
- package/es-custom/components/card/card-header.d.ts.map +1 -0
- package/es-custom/components/card/card-header.js +70 -0
- package/es-custom/components/card/card-header.js.map +1 -0
- package/es-custom/components/card/card-media.d.ts +37 -0
- package/es-custom/components/card/card-media.d.ts.map +1 -0
- package/es-custom/components/card/card-media.js +79 -0
- package/es-custom/components/card/card-media.js.map +1 -0
- package/es-custom/components/card/card-title-media.d.ts +19 -0
- package/es-custom/components/card/card-title-media.d.ts.map +1 -0
- package/es-custom/components/card/card-title-media.js +39 -0
- package/es-custom/components/card/card-title-media.js.map +1 -0
- package/es-custom/components/card/card-title.d.ts +52 -0
- package/es-custom/components/card/card-title.d.ts.map +1 -0
- package/es-custom/components/card/card-title.js +144 -0
- package/es-custom/components/card/card-title.js.map +1 -0
- package/es-custom/components/card/card.d.ts +69 -0
- package/es-custom/components/card/card.d.ts.map +1 -0
- package/es-custom/components/card/card.js +185 -0
- package/es-custom/components/card/card.js.map +1 -0
- package/es-custom/components/card/card.scss.js +14 -0
- package/es-custom/components/card/card.scss.js.map +1 -0
- package/es-custom/components/card/defs.d.ts +33 -0
- package/es-custom/components/card/defs.d.ts.map +1 -0
- package/es-custom/components/card/defs.js +46 -0
- package/es-custom/components/card/defs.js.map +1 -0
- package/es-custom/components/card/index.d.ts +17 -0
- package/es-custom/components/card/index.d.ts.map +1 -0
- package/es-custom/components/card/index.js +17 -0
- package/es-custom/components/checkbox/checkbox.scss.js +1 -1
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.d.ts +67 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.js +120 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.scss.js +14 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.scss.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/defs.d.ts +13 -0
- package/es-custom/components/coachmark/coachmark-beacon/defs.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/defs.js +25 -0
- package/es-custom/components/coachmark/coachmark-beacon/defs.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/index.d.ts +8 -0
- package/es-custom/components/coachmark/coachmark-beacon/index.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/index.js +8 -0
- package/es-custom/components/coachmark/coachmark-body.d.ts +31 -0
- package/es-custom/components/coachmark/coachmark-body.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark-body.js +39 -0
- package/es-custom/components/coachmark/coachmark-body.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-body.scss.js +14 -0
- package/es-custom/components/coachmark/coachmark-body.scss.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-context.d.ts +12 -0
- package/es-custom/components/coachmark/coachmark-context.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark-context.js +39 -0
- package/es-custom/components/coachmark/coachmark-context.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-header.d.ts +41 -0
- package/es-custom/components/coachmark/coachmark-header.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark-header.js +95 -0
- package/es-custom/components/coachmark/coachmark-header.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-header.scss.js +14 -0
- package/es-custom/components/coachmark/coachmark-header.scss.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-helpers.d.ts +10 -0
- package/es-custom/components/coachmark/coachmark-helpers.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark-helpers.js +33 -0
- package/es-custom/components/coachmark/coachmark-helpers.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.d.ts +72 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.js +130 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.scss.js +14 -0
- package/es-custom/components/coachmark/coachmark-tagline/coachmark-tagline.scss.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-tagline/index.d.ts +8 -0
- package/es-custom/components/coachmark/coachmark-tagline/index.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark-tagline/index.js +8 -0
- package/es-custom/components/coachmark/coachmark.d.ts +97 -0
- package/es-custom/components/coachmark/coachmark.d.ts.map +1 -0
- package/es-custom/components/coachmark/coachmark.js +290 -0
- package/es-custom/components/coachmark/coachmark.js.map +1 -0
- package/es-custom/components/coachmark/coachmark.scss.js +14 -0
- package/es-custom/components/coachmark/coachmark.scss.js.map +1 -0
- package/es-custom/components/coachmark/index.d.ts +10 -0
- package/es-custom/components/coachmark/index.d.ts.map +1 -0
- package/es-custom/components/coachmark/index.js +10 -0
- package/es-custom/components/code-snippet/code-snippet.scss.js +1 -1
- package/es-custom/components/combo-box/combo-box.d.ts.map +1 -1
- package/es-custom/components/combo-box/combo-box.js +5 -12
- package/es-custom/components/combo-box/combo-box.js.map +1 -1
- package/es-custom/components/combo-box/combo-box.scss.js +1 -1
- package/es-custom/components/combo-box/combo-box.scss.js.map +1 -1
- package/es-custom/components/combo-button/combo-button.scss.js +1 -1
- package/es-custom/components/contained-list/contained-list.scss.js +1 -1
- package/es-custom/components/content-switcher/content-switcher.scss.js +1 -1
- package/es-custom/components/copy/index.d.ts +9 -0
- package/es-custom/components/copy/index.d.ts.map +1 -0
- package/es-custom/components/copy/index.js +9 -0
- package/es-custom/components/copy-button/copy-button.scss.js +1 -1
- package/es-custom/components/data-table/data-table.scss.js +1 -1
- package/es-custom/components/date-picker/date-picker.scss.js +1 -1
- package/es-custom/components/date-picker/date-picker.scss.js.map +1 -1
- package/es-custom/components/date-picker/next/components/date-picker.scss.js +1 -1
- package/es-custom/components/date-picker/next/components/date-picker.scss.js.map +1 -1
- package/es-custom/components/dialog/dialog.scss.js +1 -1
- package/es-custom/components/dropdown/dropdown.d.ts +2 -1
- package/es-custom/components/dropdown/dropdown.d.ts.map +1 -1
- package/es-custom/components/dropdown/dropdown.js +13 -15
- package/es-custom/components/dropdown/dropdown.js.map +1 -1
- package/es-custom/components/dropdown/dropdown.scss.js +1 -1
- package/es-custom/components/dropdown/dropdown.scss.js.map +1 -1
- package/es-custom/components/edit-in-place/defs.d.ts +30 -0
- package/es-custom/components/edit-in-place/defs.d.ts.map +1 -0
- package/es-custom/components/edit-in-place/defs.js +43 -0
- package/es-custom/components/edit-in-place/defs.js.map +1 -0
- package/es-custom/components/edit-in-place/edit-in-place-helpers.d.ts +47 -0
- package/es-custom/components/edit-in-place/edit-in-place-helpers.d.ts.map +1 -0
- package/es-custom/components/edit-in-place/edit-in-place-helpers.js +59 -0
- package/es-custom/components/edit-in-place/edit-in-place-helpers.js.map +1 -0
- package/es-custom/components/edit-in-place/edit-in-place.d.ts +214 -0
- package/es-custom/components/edit-in-place/edit-in-place.d.ts.map +1 -0
- package/es-custom/components/edit-in-place/edit-in-place.js +453 -0
- package/es-custom/components/edit-in-place/edit-in-place.js.map +1 -0
- package/es-custom/components/edit-in-place/edit-in-place.scss.js +14 -0
- package/es-custom/components/edit-in-place/edit-in-place.scss.js.map +1 -0
- package/es-custom/components/edit-in-place/index.d.ts +10 -0
- package/es-custom/components/edit-in-place/index.d.ts.map +1 -0
- package/es-custom/components/edit-in-place/index.js +20 -0
- package/es-custom/components/edit-in-place/index.js.map +1 -0
- package/es-custom/components/file-uploader/file-uploader.scss.js +1 -1
- package/es-custom/components/fluid-combo-box/fluid-combo-box.scss.js +1 -1
- package/es-custom/components/fluid-combo-box/fluid-combo-box.scss.js.map +1 -1
- package/es-custom/components/fluid-date-picker/fluid-date-picker.d.ts +5 -1
- package/es-custom/components/fluid-date-picker/fluid-date-picker.d.ts.map +1 -1
- package/es-custom/components/fluid-date-picker/fluid-date-picker.js +27 -1
- package/es-custom/components/fluid-date-picker/fluid-date-picker.js.map +1 -1
- package/es-custom/components/fluid-date-picker/fluid-date-picker.scss.js +1 -1
- package/es-custom/components/fluid-date-picker/fluid-date-picker.scss.js.map +1 -1
- package/es-custom/components/fluid-dropdown/fluid-dropdown.scss.js +1 -1
- package/es-custom/components/fluid-dropdown/fluid-dropdown.scss.js.map +1 -1
- package/es-custom/components/fluid-form/fluid-form.scss.js +1 -1
- package/es-custom/components/fluid-multi-select/fluid-multi-select.scss.js +1 -1
- package/es-custom/components/fluid-multi-select/fluid-multi-select.scss.js.map +1 -1
- package/es-custom/components/fluid-number-input/fluid-number-input.scss.js +1 -1
- package/es-custom/components/fluid-number-input/fluid-number-input.scss.js.map +1 -1
- package/es-custom/components/fluid-password-input/fluid-password-input.scss.js +1 -1
- package/es-custom/components/fluid-search/fluid-search.scss.js +1 -1
- package/es-custom/components/fluid-search/fluid-search.scss.js.map +1 -1
- package/es-custom/components/fluid-select/fluid-select.scss.js +1 -1
- package/es-custom/components/fluid-text-input/fluid-text-input.scss.js +1 -1
- package/es-custom/components/fluid-textarea/fluid-textarea.scss.js +1 -1
- package/es-custom/components/fluid-time-picker/fluid-time-picker.scss.js +1 -1
- package/es-custom/components/form/form-item.scss.js +1 -1
- package/es-custom/components/form/form.scss.js +1 -1
- package/es-custom/components/form-group/form-group.scss.js +1 -1
- package/es-custom/components/grid/column-hang.scss.js +1 -1
- package/es-custom/components/grid/grid.scss.js +1 -1
- package/es-custom/components/icon-button/icon-button.d.ts +1 -1
- package/es-custom/components/icon-button/icon-button.js +1 -1
- package/es-custom/components/icon-button/icon-button.js.map +1 -1
- package/es-custom/components/inline-loading/inline-loading.scss.js +1 -1
- package/es-custom/components/layer/layer.scss.js +1 -1
- package/es-custom/components/layout/layout.scss.js +1 -1
- package/es-custom/components/link/link.d.ts +2 -1
- package/es-custom/components/link/link.d.ts.map +1 -1
- package/es-custom/components/link/link.js +1 -1
- package/es-custom/components/link/link.js.map +1 -1
- package/es-custom/components/loading/loading.scss.js +1 -1
- package/es-custom/components/menu/menu-item.d.ts.map +1 -1
- package/es-custom/components/menu/menu-item.js +2 -6
- package/es-custom/components/menu/menu-item.js.map +1 -1
- package/es-custom/components/menu/menu-item.scss.js +1 -1
- package/es-custom/components/menu/menu-item.scss.js.map +1 -1
- package/es-custom/components/menu/menu.d.ts +10 -0
- package/es-custom/components/menu/menu.d.ts.map +1 -1
- package/es-custom/components/menu/menu.js +17 -11
- package/es-custom/components/menu/menu.js.map +1 -1
- package/es-custom/components/menu/menu.scss.js +1 -1
- package/es-custom/components/menu/menu.scss.js.map +1 -1
- package/es-custom/components/menu-button/menu-button.scss.js +1 -1
- package/es-custom/components/modal/modal.scss.js +1 -1
- package/es-custom/components/multi-select/multi-select-item.d.ts +1 -1
- package/es-custom/components/multi-select/multi-select-item.d.ts.map +1 -1
- package/es-custom/components/multi-select/multi-select-item.js +5 -1
- package/es-custom/components/multi-select/multi-select-item.js.map +1 -1
- package/es-custom/components/multi-select/multi-select.d.ts +2 -1
- package/es-custom/components/multi-select/multi-select.d.ts.map +1 -1
- package/es-custom/components/multi-select/multi-select.js +15 -14
- package/es-custom/components/multi-select/multi-select.js.map +1 -1
- package/es-custom/components/multi-select/multi-select.scss.js +1 -1
- package/es-custom/components/multi-select/multi-select.scss.js.map +1 -1
- package/es-custom/components/notification/actionable-notification-button.d.ts +1 -1
- package/es-custom/components/notification/actionable-notification-button.d.ts.map +1 -1
- package/es-custom/components/notification/actionable-notification-button.js +2 -2
- package/es-custom/components/notification/actionable-notification-button.js.map +1 -1
- package/es-custom/components/notification/actionable-notification.d.ts.map +1 -1
- package/es-custom/components/notification/actionable-notification.js +4 -4
- package/es-custom/components/notification/actionable-notification.js.map +1 -1
- package/es-custom/components/notification/actionable-notification.scss.js +1 -1
- package/es-custom/components/notification/inline-notification.scss.js +1 -1
- package/es-custom/components/notification/toast-notification.scss.js +1 -1
- package/es-custom/components/number-input/number-input.scss.js +1 -1
- package/es-custom/components/number-input/number-input.scss.js.map +1 -1
- package/es-custom/components/options-tile/index.d.ts +8 -0
- package/es-custom/components/options-tile/index.d.ts.map +1 -0
- package/es-custom/components/options-tile/index.js +8 -0
- package/es-custom/components/options-tile/option-tile-helpers.d.ts +16 -0
- package/es-custom/components/options-tile/option-tile-helpers.d.ts.map +1 -0
- package/es-custom/components/options-tile/option-tile-helpers.js +163 -0
- package/es-custom/components/options-tile/option-tile-helpers.js.map +1 -0
- package/es-custom/components/options-tile/options-tile.d.ts +91 -0
- package/es-custom/components/options-tile/options-tile.d.ts.map +1 -0
- package/es-custom/components/options-tile/options-tile.js +208 -0
- package/es-custom/components/options-tile/options-tile.js.map +1 -0
- package/es-custom/components/options-tile/options-tile.scss.js +14 -0
- package/es-custom/components/options-tile/options-tile.scss.js.map +1 -0
- package/es-custom/components/overflow-menu/overflow-menu.js +1 -1
- package/es-custom/components/overflow-menu/overflow-menu.scss.js +1 -1
- package/es-custom/components/page-header/index.d.ts +1 -0
- package/es-custom/components/page-header/index.d.ts.map +1 -1
- package/es-custom/components/page-header/index.js +1 -0
- package/es-custom/components/page-header/page-header-tabs.d.ts +1 -1
- package/es-custom/components/page-header/page-header-tabs.d.ts.map +1 -1
- package/es-custom/components/page-header/page-header-tabs.js +1 -2
- package/es-custom/components/page-header/page-header-tabs.js.map +1 -1
- package/es-custom/components/page-header/page-header.d.ts +1 -1
- package/es-custom/components/page-header/page-header.d.ts.map +1 -1
- package/es-custom/components/page-header/page-header.js +1 -2
- package/es-custom/components/page-header/page-header.js.map +1 -1
- package/es-custom/components/page-header/page-header.scss.js +1 -1
- package/es-custom/components/pagination/pagination.scss.js +1 -1
- package/es-custom/components/pagination-nav/pagination-nav.scss.js +1 -1
- package/es-custom/components/password-input/password-input.scss.js +1 -1
- package/es-custom/components/popover/popover.scss.js +1 -1
- package/es-custom/components/progress-bar/progress-bar.scss.js +1 -1
- package/es-custom/components/progress-indicator/progress-indicator.scss.js +1 -1
- package/es-custom/components/radio-button/radio-button.scss.js +1 -1
- package/es-custom/components/resizer/resizer-handle-pivot.scss.js +1 -1
- package/es-custom/components/search/search.d.ts.map +1 -1
- package/es-custom/components/search/search.js +2 -0
- package/es-custom/components/search/search.js.map +1 -1
- package/es-custom/components/search/search.scss.js +1 -1
- package/es-custom/components/search/search.scss.js.map +1 -1
- package/es-custom/components/select/select.scss.js +1 -1
- package/es-custom/components/select/select.scss.js.map +1 -1
- package/es-custom/components/side-panel/side-panel.js +2 -2
- package/es-custom/components/side-panel/side-panel.js.map +1 -1
- package/es-custom/components/side-panel/side-panel.scss.js +1 -1
- package/es-custom/components/skeleton-icon/skeleton-icon.scss.js +1 -1
- package/es-custom/components/skeleton-placeholder/skeleton-placeholder.scss.js +1 -1
- package/es-custom/components/skeleton-text/skeleton-text.scss.js +1 -1
- package/es-custom/components/skip-to-content/skip-to-content.scss.js +1 -1
- package/es-custom/components/slider/slider.scss.js +1 -1
- package/es-custom/components/slider/slider.scss.js.map +1 -1
- package/es-custom/components/slug/index.d.ts +1 -0
- package/es-custom/components/slug/index.d.ts.map +1 -1
- package/es-custom/components/slug/index.js +1 -0
- package/es-custom/components/slug/slug.scss.js +1 -1
- package/es-custom/components/structured-list/structured-list.scss.js +1 -1
- package/es-custom/components/tabs/tabs.scss.js +1 -1
- package/es-custom/components/tabs/tabs.scss.js.map +1 -1
- package/es-custom/components/tag/dismissible-tag.d.ts +1 -1
- package/es-custom/components/tag/dismissible-tag.d.ts.map +1 -1
- package/es-custom/components/tag/dismissible-tag.js +24 -15
- package/es-custom/components/tag/dismissible-tag.js.map +1 -1
- package/es-custom/components/tag/tag.d.ts.map +1 -1
- package/es-custom/components/tag/tag.js +1 -1
- package/es-custom/components/tag/tag.js.map +1 -1
- package/es-custom/components/tag/tag.scss.js +1 -1
- package/es-custom/components/tag/tag.scss.js.map +1 -1
- package/es-custom/components/text-input/text-input.scss.js +1 -1
- package/es-custom/components/text-input/text-input.scss.js.map +1 -1
- package/es-custom/components/textarea/textarea.scss.js +1 -1
- package/es-custom/components/tile/clickable-tile.d.ts +2 -1
- package/es-custom/components/tile/clickable-tile.d.ts.map +1 -1
- package/es-custom/components/tile/clickable-tile.js +1 -1
- package/es-custom/components/tile/clickable-tile.js.map +1 -1
- package/es-custom/components/tile/tile.scss.js +1 -1
- package/es-custom/components/time-picker/time-picker.scss.js +1 -1
- package/es-custom/components/toggle-tip/toggletip.scss.js +1 -1
- package/es-custom/components/tooltip/tooltip.scss.js +1 -1
- package/es-custom/components/tree-view/tree-view.scss.js +1 -1
- package/es-custom/components/ui-shell/header.scss.js +1 -1
- package/es-custom/components/ui-shell/side-nav.scss.js +1 -1
- package/es-custom/components/user-avatar/index.d.ts +8 -0
- package/es-custom/components/user-avatar/index.d.ts.map +1 -0
- package/es-custom/components/user-avatar/index.js +8 -0
- package/es-custom/components/user-avatar/user-avatar.d.ts +84 -0
- package/es-custom/components/user-avatar/user-avatar.d.ts.map +1 -0
- package/es-custom/components/user-avatar/user-avatar.js +151 -0
- package/es-custom/components/user-avatar/user-avatar.js.map +1 -0
- package/es-custom/components/user-avatar/user-avatar.scss.js +14 -0
- package/es-custom/components/user-avatar/user-avatar.scss.js.map +1 -0
- package/es-custom/globals/controllers/floating-controller.d.ts.map +1 -1
- package/es-custom/globals/controllers/floating-controller.js.map +1 -1
- package/es-custom/globals/decorators/carbon-element.d.ts +8 -0
- package/es-custom/globals/decorators/carbon-element.d.ts.map +1 -1
- package/es-custom/globals/decorators/carbon-element.js +18 -1
- package/es-custom/globals/decorators/carbon-element.js.map +1 -1
- package/es-custom/globals/internal/collection-helpers.d.ts +5 -5
- package/es-custom/globals/internal/collection-helpers.d.ts.map +1 -1
- package/es-custom/globals/internal/collection-helpers.js +1 -1
- package/es-custom/globals/internal/collection-helpers.js.map +1 -1
- package/es-custom/globals/internal/getSupportedLocale.d.ts +12 -0
- package/es-custom/globals/internal/getSupportedLocale.d.ts.map +1 -0
- package/es-custom/globals/internal/getSupportedLocale.js +29 -0
- package/es-custom/globals/internal/getSupportedLocale.js.map +1 -0
- package/es-custom/globals/mixins/on.d.ts +2 -2
- package/es-custom/globals/mixins/on.d.ts.map +1 -1
- package/es-custom/globals/mixins/on.js +4 -4
- package/es-custom/globals/mixins/on.js.map +1 -1
- package/es-custom/globals/register.d.ts +89 -0
- package/es-custom/globals/register.d.ts.map +1 -0
- package/es-custom/globals/register.js +56 -0
- package/es-custom/globals/register.js.map +1 -0
- package/es-custom/globals/settings.d.ts +1 -1
- package/es-custom/globals/settings.d.ts.map +1 -1
- package/es-custom/globals/settings.js +1 -0
- package/es-custom/globals/settings.js.map +1 -1
- package/es-custom/index.d.ts +10 -0
- package/es-custom/index.d.ts.map +1 -1
- package/es-custom/index.js +13 -3
- package/lib/components/ai-label/ai-label-action-button.d.ts +1 -1
- package/lib/components/ai-label/ai-label-action-button.d.ts.map +1 -1
- package/lib/components/ai-label/index.d.ts +1 -0
- package/lib/components/ai-label/index.d.ts.map +1 -1
- package/lib/components/big-number/big-number-skeleton.d.ts +21 -0
- package/lib/components/big-number/big-number-skeleton.d.ts.map +1 -0
- package/lib/components/big-number/big-number.d.ts +35 -0
- package/lib/components/big-number/big-number.d.ts.map +1 -0
- package/lib/components/big-number/constants.d.ts +20 -0
- package/lib/components/big-number/constants.d.ts.map +1 -0
- package/lib/components/big-number/index.d.ts +8 -0
- package/lib/components/big-number/index.d.ts.map +1 -0
- package/lib/components/breadcrumb/breadcrumb-item.d.ts.map +1 -1
- package/lib/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/lib/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/lib/components/button/button.d.ts.map +1 -1
- package/lib/components/card/card-action.d.ts +27 -0
- package/lib/components/card/card-action.d.ts.map +1 -0
- package/lib/components/card/card-actions.d.ts +36 -0
- package/lib/components/card/card-actions.d.ts.map +1 -0
- package/lib/components/card/card-body.d.ts +23 -0
- package/lib/components/card/card-body.d.ts.map +1 -0
- package/lib/components/card/card-context.d.ts +20 -0
- package/lib/components/card/card-context.d.ts.map +1 -0
- package/lib/components/card/card-footer.d.ts +34 -0
- package/lib/components/card/card-footer.d.ts.map +1 -0
- package/lib/components/card/card-header-media.d.ts +19 -0
- package/lib/components/card/card-header-media.d.ts.map +1 -0
- package/lib/components/card/card-header.d.ts +23 -0
- package/lib/components/card/card-header.d.ts.map +1 -0
- package/lib/components/card/card-media.d.ts +37 -0
- package/lib/components/card/card-media.d.ts.map +1 -0
- package/lib/components/card/card-title-media.d.ts +19 -0
- package/lib/components/card/card-title-media.d.ts.map +1 -0
- package/lib/components/card/card-title.d.ts +52 -0
- package/lib/components/card/card-title.d.ts.map +1 -0
- package/lib/components/card/card.d.ts +69 -0
- package/lib/components/card/card.d.ts.map +1 -0
- package/lib/components/card/defs.d.ts +33 -0
- package/lib/components/card/defs.d.ts.map +1 -0
- package/lib/components/card/defs.js +48 -0
- package/lib/components/card/defs.js.map +1 -0
- package/lib/components/card/index.d.ts +17 -0
- package/lib/components/card/index.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark-beacon/coachmark-beacon.d.ts +67 -0
- package/lib/components/coachmark/coachmark-beacon/coachmark-beacon.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark-beacon/defs.d.ts +13 -0
- package/lib/components/coachmark/coachmark-beacon/defs.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark-beacon/defs.js +26 -0
- package/lib/components/coachmark/coachmark-beacon/defs.js.map +1 -0
- package/lib/components/coachmark/coachmark-beacon/index.d.ts +8 -0
- package/lib/components/coachmark/coachmark-beacon/index.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark-body.d.ts +31 -0
- package/lib/components/coachmark/coachmark-body.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark-context.d.ts +12 -0
- package/lib/components/coachmark/coachmark-context.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark-header.d.ts +41 -0
- package/lib/components/coachmark/coachmark-header.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark-helpers.d.ts +10 -0
- package/lib/components/coachmark/coachmark-helpers.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark-tagline/coachmark-tagline.d.ts +72 -0
- package/lib/components/coachmark/coachmark-tagline/coachmark-tagline.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark-tagline/index.d.ts +8 -0
- package/lib/components/coachmark/coachmark-tagline/index.d.ts.map +1 -0
- package/lib/components/coachmark/coachmark.d.ts +97 -0
- package/lib/components/coachmark/coachmark.d.ts.map +1 -0
- package/lib/components/coachmark/index.d.ts +10 -0
- package/lib/components/coachmark/index.d.ts.map +1 -0
- package/lib/components/combo-box/combo-box.d.ts.map +1 -1
- package/lib/components/copy/index.d.ts +9 -0
- package/lib/components/copy/index.d.ts.map +1 -0
- package/lib/components/dropdown/dropdown.d.ts +2 -1
- package/lib/components/dropdown/dropdown.d.ts.map +1 -1
- package/lib/components/edit-in-place/defs.d.ts +30 -0
- package/lib/components/edit-in-place/defs.d.ts.map +1 -0
- package/lib/components/edit-in-place/defs.js +45 -0
- package/lib/components/edit-in-place/defs.js.map +1 -0
- package/lib/components/edit-in-place/edit-in-place-helpers.d.ts +47 -0
- package/lib/components/edit-in-place/edit-in-place-helpers.d.ts.map +1 -0
- package/lib/components/edit-in-place/edit-in-place.d.ts +214 -0
- package/lib/components/edit-in-place/edit-in-place.d.ts.map +1 -0
- package/lib/components/edit-in-place/index.d.ts +10 -0
- package/lib/components/edit-in-place/index.d.ts.map +1 -0
- package/lib/components/fluid-date-picker/fluid-date-picker.d.ts +5 -1
- package/lib/components/fluid-date-picker/fluid-date-picker.d.ts.map +1 -1
- package/lib/components/icon-button/icon-button.d.ts +1 -1
- package/lib/components/link/link.d.ts +2 -1
- package/lib/components/link/link.d.ts.map +1 -1
- package/lib/components/menu/menu-item.d.ts.map +1 -1
- package/lib/components/menu/menu.d.ts +10 -0
- package/lib/components/menu/menu.d.ts.map +1 -1
- package/lib/components/multi-select/multi-select-item.d.ts +1 -1
- package/lib/components/multi-select/multi-select-item.d.ts.map +1 -1
- package/lib/components/multi-select/multi-select.d.ts +2 -1
- package/lib/components/multi-select/multi-select.d.ts.map +1 -1
- package/lib/components/notification/actionable-notification-button.d.ts +1 -1
- package/lib/components/notification/actionable-notification-button.d.ts.map +1 -1
- package/lib/components/notification/actionable-notification.d.ts.map +1 -1
- package/lib/components/options-tile/index.d.ts +8 -0
- package/lib/components/options-tile/index.d.ts.map +1 -0
- package/lib/components/options-tile/option-tile-helpers.d.ts +16 -0
- package/lib/components/options-tile/option-tile-helpers.d.ts.map +1 -0
- package/lib/components/options-tile/options-tile.d.ts +91 -0
- package/lib/components/options-tile/options-tile.d.ts.map +1 -0
- package/lib/components/page-header/index.d.ts +1 -0
- package/lib/components/page-header/index.d.ts.map +1 -1
- package/lib/components/page-header/page-header-tabs.d.ts +1 -1
- package/lib/components/page-header/page-header-tabs.d.ts.map +1 -1
- package/lib/components/page-header/page-header.d.ts +1 -1
- package/lib/components/page-header/page-header.d.ts.map +1 -1
- package/lib/components/search/search.d.ts.map +1 -1
- package/lib/components/slug/index.d.ts +1 -0
- package/lib/components/slug/index.d.ts.map +1 -1
- package/lib/components/tag/dismissible-tag.d.ts +1 -1
- package/lib/components/tag/dismissible-tag.d.ts.map +1 -1
- package/lib/components/tag/tag.d.ts.map +1 -1
- package/lib/components/tile/clickable-tile.d.ts +2 -1
- package/lib/components/tile/clickable-tile.d.ts.map +1 -1
- package/lib/components/user-avatar/index.d.ts +8 -0
- package/lib/components/user-avatar/index.d.ts.map +1 -0
- package/lib/components/user-avatar/user-avatar.d.ts +84 -0
- package/lib/components/user-avatar/user-avatar.d.ts.map +1 -0
- package/lib/globals/controllers/floating-controller.d.ts.map +1 -1
- package/lib/globals/controllers/floating-controller.js.map +1 -1
- package/lib/globals/decorators/carbon-element.d.ts +8 -0
- package/lib/globals/decorators/carbon-element.d.ts.map +1 -1
- package/lib/globals/internal/collection-helpers.d.ts +5 -5
- package/lib/globals/internal/collection-helpers.d.ts.map +1 -1
- package/lib/globals/internal/getSupportedLocale.d.ts +12 -0
- package/lib/globals/internal/getSupportedLocale.d.ts.map +1 -0
- package/lib/globals/mixins/on.d.ts +2 -2
- package/lib/globals/mixins/on.d.ts.map +1 -1
- package/lib/globals/register.d.ts +89 -0
- package/lib/globals/register.d.ts.map +1 -0
- package/lib/globals/register.js +61 -0
- package/lib/globals/register.js.map +1 -0
- package/lib/globals/settings.d.ts +1 -1
- package/lib/globals/settings.d.ts.map +1 -1
- package/lib/globals/settings.js +1 -0
- package/lib/globals/settings.js.map +1 -1
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -1
- package/package.json +16 -10
- package/scss/components/ai-label/ai-label.scss +24 -33
- package/scss/components/big-number/big-number-skeleton.scss +58 -0
- package/scss/components/big-number/big-number.scss +29 -0
- package/scss/components/big-number/story-styles.scss +48 -0
- package/scss/components/card/card-story.scss +29 -0
- package/scss/components/card/card.scss +212 -0
- package/scss/components/coachmark/coachmark-beacon/coachmark-beacon.scss +89 -0
- package/scss/components/coachmark/coachmark-body.scss +16 -0
- package/scss/components/coachmark/coachmark-header.scss +28 -0
- package/scss/components/coachmark/coachmark-tagline/coachmark-tagline.scss +42 -0
- package/scss/components/coachmark/coachmark.scss +42 -0
- package/scss/components/coachmark/story-styles.scss +37 -0
- package/scss/components/combo-box/combo-box.scss +63 -6
- package/scss/components/data-table/_table-action.scss +5 -3
- package/scss/components/date-picker/date-picker.scss +70 -2
- package/scss/components/date-picker/next/components/date-picker.scss +28 -2
- package/scss/components/dropdown/dropdown.scss +39 -4
- package/scss/components/edit-in-place/edit-in-place.scss +127 -0
- package/scss/components/edit-in-place/story-styles.scss +61 -0
- package/scss/components/fluid-combo-box/fluid-combo-box.scss +68 -5
- package/scss/components/fluid-date-picker/fluid-date-picker.scss +109 -12
- package/scss/components/fluid-dropdown/fluid-dropdown.scss +56 -6
- package/scss/components/fluid-multi-select/fluid-multi-select.scss +75 -2
- package/scss/components/fluid-number-input/fluid-number-input.scss +32 -1
- package/scss/components/fluid-search/fluid-search.scss +6 -3
- package/scss/components/menu/menu-item.scss +9 -1
- package/scss/components/menu/menu.scss +32 -1
- package/scss/components/multi-select/multi-select.scss +130 -28
- package/scss/components/number-input/number-input.scss +35 -1
- package/scss/components/options-tile/options-tile.scss +157 -0
- package/scss/components/options-tile/story-styles.scss +32 -0
- package/scss/components/search/search.scss +7 -0
- package/scss/components/select/select.scss +7 -3
- package/scss/components/slider/slider.scss +9 -2
- package/scss/components/tabs/tabs.scss +9 -2
- package/scss/components/tag/tag-story.scss +19 -0
- package/scss/components/tag/tag.scss +15 -11
- package/scss/components/text-input/text-input.scss +22 -0
- package/scss/components/user-avatar/story-styles.scss +53 -0
- package/scss/components/user-avatar/user-avatar.scss +113 -0
- package/telemetry.yml +67 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import "../../globals/settings.js";
|
|
9
|
+
import { carbonElement } from "../../globals/decorators/carbon-element.js";
|
|
10
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
|
|
11
|
+
import iconLoader from "../../globals/internal/icon-loader.js";
|
|
12
|
+
import HostListenerMixin from "../../globals/mixins/host-listener.js";
|
|
13
|
+
import "../tooltip/index.js";
|
|
14
|
+
import user_avatar_default$1 from "./user-avatar.scss.js";
|
|
15
|
+
import { LitElement, html } from "lit";
|
|
16
|
+
import { property, state } from "lit/decorators.js";
|
|
17
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
18
|
+
import User from "@carbon/icons/es/user/16";
|
|
19
|
+
//#region src/components/user-avatar/user-avatar.ts
|
|
20
|
+
/**
|
|
21
|
+
* Copyright IBM Corp. 2025, 2026
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/
|
|
26
|
+
const blockClass = `cds--user-avatar`;
|
|
27
|
+
/**
|
|
28
|
+
* User Avatar.
|
|
29
|
+
*
|
|
30
|
+
* @element cds-user-avatar
|
|
31
|
+
*/
|
|
32
|
+
let CDSUserAvatar = class CDSUserAvatar extends HostListenerMixin(LitElement) {
|
|
33
|
+
constructor(..._args) {
|
|
34
|
+
super(..._args);
|
|
35
|
+
this.tooltipAlignment = "bottom";
|
|
36
|
+
this.size = "md";
|
|
37
|
+
this.backgroundColor = "order-1-cyan";
|
|
38
|
+
this._hasRenderIcon = false;
|
|
39
|
+
this._observerMutation = null;
|
|
40
|
+
this._handleMutation = () => {
|
|
41
|
+
this._hasRenderIcon = Boolean(this.querySelector("[slot=\"rendericon\"]"));
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
connectedCallback() {
|
|
45
|
+
super.connectedCallback();
|
|
46
|
+
this._hasRenderIcon = Boolean(this.querySelector("[slot=\"rendericon\"]"));
|
|
47
|
+
this._observerMutation = new MutationObserver(this._handleMutation);
|
|
48
|
+
this._observerMutation.observe(this, {
|
|
49
|
+
childList: true,
|
|
50
|
+
subtree: true,
|
|
51
|
+
attributes: true,
|
|
52
|
+
attributeFilter: ["slot"]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
disconnectedCallback() {
|
|
56
|
+
if (this._observerMutation) {
|
|
57
|
+
this._observerMutation.disconnect();
|
|
58
|
+
this._observerMutation = null;
|
|
59
|
+
}
|
|
60
|
+
super.disconnectedCallback();
|
|
61
|
+
}
|
|
62
|
+
_onSlotChange() {
|
|
63
|
+
this._hasRenderIcon = Boolean(this.querySelector("[slot=\"rendericon\"]"));
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
const getItem = () => {
|
|
67
|
+
if (this.image) {
|
|
68
|
+
const imageClasses = classMap({
|
|
69
|
+
[`${blockClass}__photo`]: true,
|
|
70
|
+
[`${blockClass}__photo--${this.size}`]: this.size
|
|
71
|
+
});
|
|
72
|
+
return html` <img
|
|
73
|
+
alt="${this.imageDescription ?? ""}"
|
|
74
|
+
src="${this.image}"
|
|
75
|
+
class="${imageClasses}" />`;
|
|
76
|
+
}
|
|
77
|
+
if (this._hasRenderIcon) return html`<slot
|
|
78
|
+
name="rendericon"
|
|
79
|
+
@slotchange=${this._onSlotChange}></slot>`;
|
|
80
|
+
if (this.name) {
|
|
81
|
+
const parts = this.name?.split(" ") || [];
|
|
82
|
+
const firstChar = parts[0].charAt(0).toUpperCase();
|
|
83
|
+
const secondChar = parts[0].charAt(1).toUpperCase();
|
|
84
|
+
if (parts.length === 1) return firstChar + secondChar;
|
|
85
|
+
const lastChar = parts[parts.length - 1].charAt(0).toUpperCase();
|
|
86
|
+
const initials = [firstChar];
|
|
87
|
+
if (lastChar) initials.push(lastChar);
|
|
88
|
+
return "".concat(...initials);
|
|
89
|
+
}
|
|
90
|
+
return html`${iconLoader(User, { slot: "rendericon" })} `;
|
|
91
|
+
};
|
|
92
|
+
const { tooltipText, tooltipAlignment, size, backgroundColor, theme } = this;
|
|
93
|
+
const classes = classMap({
|
|
94
|
+
[`${blockClass}`]: true,
|
|
95
|
+
[`${blockClass}--${size}`]: size,
|
|
96
|
+
[`${blockClass}--${backgroundColor}`]: backgroundColor,
|
|
97
|
+
[`${blockClass}--${theme}`]: theme
|
|
98
|
+
});
|
|
99
|
+
const Avatar = () => html`<div class="${classes}">${getItem()}</div>`;
|
|
100
|
+
if (tooltipText) return html`<cds-tooltip
|
|
101
|
+
align=${tooltipAlignment}
|
|
102
|
+
class=${`${blockClass}__tooltip cds--icon-tooltip`}>
|
|
103
|
+
<button
|
|
104
|
+
class=${`${blockClass}__tooltip-trigger`}
|
|
105
|
+
type="button"
|
|
106
|
+
aria-label=${tooltipText}>
|
|
107
|
+
${Avatar()}
|
|
108
|
+
</button>
|
|
109
|
+
<cds-tooltip-content class=${`${blockClass}__tooltip-content`}>
|
|
110
|
+
${tooltipText}
|
|
111
|
+
</cds-tooltip-content>
|
|
112
|
+
</cds-tooltip>`;
|
|
113
|
+
else return html` ${Avatar()}`;
|
|
114
|
+
}
|
|
115
|
+
static {
|
|
116
|
+
this.shadowRootOptions = {
|
|
117
|
+
...LitElement.shadowRootOptions,
|
|
118
|
+
delegatesFocus: true
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
static {
|
|
122
|
+
this.styles = user_avatar_default$1;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
__decorate([property({
|
|
126
|
+
reflect: true,
|
|
127
|
+
attribute: "tooltip-text"
|
|
128
|
+
})], CDSUserAvatar.prototype, "tooltipText", void 0);
|
|
129
|
+
__decorate([property({
|
|
130
|
+
reflect: true,
|
|
131
|
+
attribute: "tooltip-alignment"
|
|
132
|
+
})], CDSUserAvatar.prototype, "tooltipAlignment", void 0);
|
|
133
|
+
__decorate([property({ reflect: true })], CDSUserAvatar.prototype, "name", void 0);
|
|
134
|
+
__decorate([property({ reflect: true })], CDSUserAvatar.prototype, "size", void 0);
|
|
135
|
+
__decorate([property({ reflect: true })], CDSUserAvatar.prototype, "image", void 0);
|
|
136
|
+
__decorate([property({
|
|
137
|
+
reflect: true,
|
|
138
|
+
attribute: "image-description"
|
|
139
|
+
})], CDSUserAvatar.prototype, "imageDescription", void 0);
|
|
140
|
+
__decorate([property({
|
|
141
|
+
reflect: true,
|
|
142
|
+
attribute: "background-color"
|
|
143
|
+
})], CDSUserAvatar.prototype, "backgroundColor", void 0);
|
|
144
|
+
__decorate([property({ reflect: true })], CDSUserAvatar.prototype, "theme", void 0);
|
|
145
|
+
__decorate([state()], CDSUserAvatar.prototype, "_hasRenderIcon", void 0);
|
|
146
|
+
CDSUserAvatar = __decorate([carbonElement(`cds-user-avatar`)], CDSUserAvatar);
|
|
147
|
+
var user_avatar_default = CDSUserAvatar;
|
|
148
|
+
//#endregion
|
|
149
|
+
export { user_avatar_default as default };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=user-avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-avatar.js","names":["styles","customElement"],"sources":["../../../src/components/user-avatar/user-avatar.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2025, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { prefix } from '../../globals/settings';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport styles from './user-avatar.scss?lit';\nimport '../tooltip/index';\nimport User from '@carbon/icons/es/user/16';\nimport { iconLoader } from '../../globals/internal/icon-loader';\n\nconst blockClass = `${prefix}--user-avatar`;\n\n/**\n * User Avatar.\n *\n * @element cds-user-avatar\n */\n\n@customElement(`${prefix}-user-avatar`)\nclass CDSUserAvatar extends HostListenerMixin(LitElement) {\n /**\n * Specify the text of the tooltip.\n * Can be string\n */\n @property({ reflect: true, attribute: 'tooltip-text' })\n tooltipText;\n\n /**\n * Specify the alignment of the tooltip.\n */\n @property({ reflect: true, attribute: 'tooltip-alignment' })\n tooltipAlignment = 'bottom';\n\n /**\n * When passing the name prop, either send the initials to be used or the\n * user's full name. The first two capital letters of the user's name will be\n * used as the name.\n */\n @property({ reflect: true })\n name;\n\n /**\n * Set the size of the avatar circle.\n */\n @property({ reflect: true })\n size = 'md';\n\n /**\n * When passing the image prop, supply a full path to the image to be\n * displayed.\n */\n @property({ reflect: true })\n image;\n\n /**\n * When passing the image prop use the imageDescription prop to describe the\n * image for screen reader.\n */\n @property({ reflect: true, attribute: 'image-description' })\n imageDescription;\n\n /**\n * Specify the background color for UserAvatar.\n */\n @property({ reflect: true, attribute: 'background-color' })\n backgroundColor = 'order-1-cyan';\n\n /**\n * Set theme in which the component will be rendered.\n */\n @property({ reflect: true })\n theme;\n\n @state()\n private _hasRenderIcon = false;\n\n private _observerMutation: MutationObserver | null = null;\n\n private _handleMutation = () => {\n this._hasRenderIcon = Boolean(this.querySelector('[slot=\"rendericon\"]'));\n };\n\n connectedCallback() {\n super.connectedCallback();\n this._hasRenderIcon = Boolean(this.querySelector('[slot=\"rendericon\"]'));\n this._observerMutation = new MutationObserver(this._handleMutation);\n this._observerMutation.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n disconnectedCallback() {\n if (this._observerMutation) {\n this._observerMutation.disconnect();\n this._observerMutation = null;\n }\n super.disconnectedCallback();\n }\n\n private _onSlotChange() {\n this._hasRenderIcon = Boolean(this.querySelector('[slot=\"rendericon\"]'));\n }\n\n render() {\n const getItem = () => {\n if (this.image) {\n const imageClasses = classMap({\n [`${blockClass}__photo`]: true,\n [`${blockClass}__photo--${this.size}`]: this.size,\n });\n return html` <img\n alt=\"${this.imageDescription ?? ''}\"\n src=\"${this.image}\"\n class=\"${imageClasses}\" />`;\n }\n if (this._hasRenderIcon) {\n return html`<slot\n name=\"rendericon\"\n @slotchange=${this._onSlotChange}></slot>`;\n }\n if (this.name) {\n const parts = this.name?.split(' ') || [];\n const firstChar = parts[0].charAt(0).toUpperCase();\n const secondChar = parts[0].charAt(1).toUpperCase();\n if (parts.length === 1) {\n return firstChar + secondChar;\n }\n const lastChar = parts[parts.length - 1].charAt(0).toUpperCase();\n const initials = [firstChar];\n if (lastChar) {\n initials.push(lastChar);\n }\n\n return ''.concat(...initials);\n }\n return html`${iconLoader(User, { slot: 'rendericon' })} `;\n };\n\n const { tooltipText, tooltipAlignment, size, backgroundColor, theme } =\n this;\n const classes = classMap({\n [`${blockClass}`]: true,\n [`${blockClass}--${size}`]: size,\n [`${blockClass}--${backgroundColor}`]: backgroundColor,\n [`${blockClass}--${theme}`]: theme,\n });\n\n const Avatar = () => html`<div class=\"${classes}\">${getItem()}</div>`;\n\n if (tooltipText) {\n return html`<cds-tooltip\n align=${tooltipAlignment}\n class=${`${blockClass}__tooltip ${prefix}--icon-tooltip`}>\n <button\n class=${`${blockClass}__tooltip-trigger`}\n type=\"button\"\n aria-label=${tooltipText}>\n ${Avatar()}\n </button>\n <cds-tooltip-content class=${`${blockClass}__tooltip-content`}>\n ${tooltipText}\n </cds-tooltip-content>\n </cds-tooltip>`;\n } else {\n return html` ${Avatar()}`;\n }\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static styles = styles;\n}\n\nexport default CDSUserAvatar;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { css } from "lit";
|
|
9
|
+
//#region src/components/user-avatar/user-avatar.scss?lit
|
|
10
|
+
var user_avatar_default = css(["a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{padding:0;border:0;margin:0;font:inherit;font-feature-settings:\"liga\" 1;font-size:100%;vertical-align:baseline}button,input,select,textarea{border-radius:0;font-family:inherit}:root{color-scheme:var(--cds-color-scheme,light)}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{background-color:var(--cds-background,#fff);color:var(--cds-text-primary,#161616);line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:none}table{border-collapse:collapse;border-spacing:0}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}html{font-size:100%}body{font-weight:400;font-family:IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,\\.SFNSText-Regular,sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}code{font-family:IBM Plex Mono,system-ui,-apple-system,BlinkMacSystemFont,\\.SFNSText-Regular,monospace}strong{font-weight:600}@media screen and (-ms-high-contrast:active){svg{fill:ButtonText}}h1{font-size:var(--cds-heading-06-font-size,2.625rem);font-weight:var(--cds-heading-06-font-weight,300);line-height:var(--cds-heading-06-line-height,1.199);letter-spacing:var(--cds-heading-06-letter-spacing,0)}h2{font-size:var(--cds-heading-05-font-size,2rem);font-weight:var(--cds-heading-05-font-weight,400);line-height:var(--cds-heading-05-line-height,1.25);letter-spacing:var(--cds-heading-05-letter-spacing,0)}h3{font-size:var(--cds-heading-04-font-size,1.75rem);font-weight:var(--cds-heading-04-font-weight,400);line-height:var(--cds-heading-04-line-height,1.28572);letter-spacing:var(--cds-heading-04-letter-spacing,0)}h4{font-size:var(--cds-heading-03-font-size,1.25rem);font-weight:var(--cds-heading-03-font-weight,400);line-height:var(--cds-heading-03-line-height,1.4);letter-spacing:var(--cds-heading-03-letter-spacing,0)}h5{font-size:var(--cds-heading-02-font-size,1rem);font-weight:var(--cds-heading-02-font-weight,600);line-height:var(--cds-heading-02-line-height,1.5);letter-spacing:var(--cds-heading-02-letter-spacing,0)}h6{font-size:var(--cds-heading-01-font-size,.875rem);font-weight:var(--cds-heading-01-font-weight,600);line-height:var(--cds-heading-01-line-height,1.42857);letter-spacing:var(--cds-heading-01-letter-spacing,.16px)}p{font-size:var(--cds-body-02-font-size,1rem);font-weight:var(--cds-body-02-font-weight,400);line-height:var(--cds-body-02-line-height,1.5);letter-spacing:var(--cds-body-02-letter-spacing,0)}a{color:var(--cds-link-primary,#0062fe)}em{font-style:italic}.cds--user-avatar{position:relative;display:flex;align-items:center;justify-content:center;border:.5px solid transparent;border-radius:100%;block-size:4rem;color:var(--cds-text-inverse,#fff);inline-size:4rem;outline:none;outline-offset:3px}.cds--user-avatar svg{color:var(--cds-icon-inverse,#fff)}.cds--user-avatar__tooltip-trigger{display:flex;box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:0;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;block-size:100%;cursor:pointer;inline-size:100%;outline:none}.cds--user-avatar__tooltip:focus-within .cds--user-avatar{outline:2px solid var(--cds-focus,#0f62fe);outline-offset:1px}.cds--user-avatar__photo{border-radius:100%;-o-object-fit:contain;object-fit:contain}.cds--user-avatar--xl{block-size:4rem;inline-size:4rem}.cds--user-avatar--lg{block-size:3rem;inline-size:3rem}.cds--user-avatar--md{block-size:2rem;inline-size:2rem}.cds--user-avatar--sm{block-size:1.5rem;inline-size:1.5rem}.cds--user-avatar--xl{font-size:var(--cds-heading-04-font-size,1.75rem);font-weight:var(--cds-heading-04-font-weight,400);line-height:var(--cds-heading-04-line-height,1.28572);letter-spacing:var(--cds-heading-04-letter-spacing,0)}.cds--user-avatar--lg{font-size:var(--cds-heading-03-font-size,1.25rem);font-weight:var(--cds-heading-03-font-weight,400);line-height:var(--cds-heading-03-line-height,1.4);letter-spacing:var(--cds-heading-03-letter-spacing,0)}.cds--user-avatar--md{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px)}.cds--user-avatar--sm{font-size:var(--cds-label-01-font-size,.75rem);font-weight:var(--cds-label-01-font-weight,400);line-height:var(--cds-label-01-line-height,1.33333);letter-spacing:var(--cds-label-01-letter-spacing,.32px)}.cds--user-avatar__photo--xl{border-radius:100%;block-size:4rem;inline-size:4rem;-o-object-fit:fill;object-fit:fill}.cds--user-avatar__photo--lg{border-radius:100%;block-size:3rem;inline-size:3rem;-o-object-fit:fill;object-fit:fill}.cds--user-avatar__photo--md{border-radius:100%;block-size:2rem;inline-size:2rem;-o-object-fit:fill;object-fit:fill}.cds--user-avatar__photo--sm{border-radius:100%;block-size:1.5rem;inline-size:1.5rem;-o-object-fit:fill;object-fit:fill}.cds--g10 .cds--user-avatar--order-1-cyan,.cds--white .cds--user-avatar--order-1-cyan,:root .cds--user-avatar--order-1-cyan{background-color:#0072c3}.cds--g10 .cds--user-avatar--order-2-gray,.cds--white .cds--user-avatar--order-2-gray,:root .cds--user-avatar--order-2-gray{background-color:#6f6f6f}.cds--g10 .cds--user-avatar--order-3-green,.cds--white .cds--user-avatar--order-3-green,:root .cds--user-avatar--order-3-green{background-color:#198038}.cds--g10 .cds--user-avatar--order-4-magenta,.cds--white .cds--user-avatar--order-4-magenta,:root .cds--user-avatar--order-4-magenta{background-color:#d02670}.cds--g10 .cds--user-avatar--order-5-purple,.cds--white .cds--user-avatar--order-5-purple,:root .cds--user-avatar--order-5-purple{background-color:#8a3ffc}.cds--g10 .cds--user-avatar--order-6-teal,.cds--white .cds--user-avatar--order-6-teal,:root .cds--user-avatar--order-6-teal{background-color:#007d79}.cds--g10 .cds--user-avatar--order-7-cyan,.cds--white .cds--user-avatar--order-7-cyan,:root .cds--user-avatar--order-7-cyan{background-color:#003a6d}.cds--g10 .cds--user-avatar--order-8-gray,.cds--white .cds--user-avatar--order-8-gray,:root .cds--user-avatar--order-8-gray{background-color:#393939}.cds--g10 .cds--user-avatar--order-9-green,.cds--white .cds--user-avatar--order-9-green,:root .cds--user-avatar--order-9-green{background-color:#044317}.cds--g10 .cds--user-avatar--order-10-magenta,.cds--white .cds--user-avatar--order-10-magenta,:root .cds--user-avatar--order-10-magenta{background-color:#740937}.cds--g10 .cds--user-avatar--order-11-purple,.cds--white .cds--user-avatar--order-11-purple,:root .cds--user-avatar--order-11-purple{background-color:#491d8b}.cds--g10 .cds--user-avatar--order-12-teal,.cds--white .cds--user-avatar--order-12-teal,:root .cds--user-avatar--order-12-teal{background-color:#004144}.cds--g100 .cds--user-avatar--order-1-cyan,.cds--g90 .cds--user-avatar--order-1-cyan{background-color:#1192e8}.cds--g100 .cds--user-avatar--order-2-gray,.cds--g90 .cds--user-avatar--order-2-gray{background-color:#8d8d8d}.cds--g100 .cds--user-avatar--order-3-green,.cds--g90 .cds--user-avatar--order-3-green{background-color:#24a148}.cds--g100 .cds--user-avatar--order-4-magenta,.cds--g90 .cds--user-avatar--order-4-magenta{background-color:#ee5396}.cds--g100 .cds--user-avatar--order-5-purple,.cds--g90 .cds--user-avatar--order-5-purple{background-color:#a56eff}.cds--g100 .cds--user-avatar--order-6-teal,.cds--g90 .cds--user-avatar--order-6-teal{background-color:#009d9a}.cds--g100 .cds--user-avatar--order-7-cyan,.cds--g90 .cds--user-avatar--order-7-cyan{background-color:#82cfff}.cds--g100 .cds--user-avatar--order-8-gray,.cds--g90 .cds--user-avatar--order-8-gray{background-color:#c6c6c6}.cds--g100 .cds--user-avatar--order-9-green,.cds--g90 .cds--user-avatar--order-9-green{background-color:#6fdc8c}.cds--g100 .cds--user-avatar--order-10-magenta,.cds--g90 .cds--user-avatar--order-10-magenta{background-color:#ffafd2}.cds--g100 .cds--user-avatar--order-11-purple,.cds--g90 .cds--user-avatar--order-11-purple{background-color:#d4bbff}.cds--g100 .cds--user-avatar--order-12-teal,.cds--g90 .cds--user-avatar--order-12-teal{background-color:#3ddbd9}:host(cds-user-avatar){display:inline-block}:host(cds-user-avatar) .cds--user-avatar{box-sizing:border-box}:host(cds-user-avatar) .cds--user-avatar--xl ::slotted([slot=rendericon]){block-size:2rem;inline-size:2rem}:host(cds-user-avatar) .cds--user-avatar--lg ::slotted([slot=rendericon]){block-size:1.5rem;inline-size:1.5rem}:host(cds-user-avatar) .cds--user-avatar--md ::slotted([slot=rendericon]){block-size:1.25rem;inline-size:1.25rem}:host(cds-user-avatar) .cds--user-avatar--sm ::slotted([slot=rendericon]){block-size:1rem;inline-size:1rem}:host(cds-user-avatar) .cds--user-avatar__tooltip-trigger{padding:0;border:0;background:none;outline:none}:host(cds-user-avatar) .cds--user-avatar__tooltip-content{--cds-tooltip-padding-block:0.125rem}:host(cds-user-avatar) .cds--user-avatar__tooltip-content:focus-within{outline:.125rem solid var(--cds-focus,#0f62fe);outline-offset:1px}:host(cds-user-avatar) .cds--user-avatar--order-1-cyan,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-1-cyan{background-color:#0072c3}:host(cds-user-avatar) .cds--user-avatar--order-2-gray,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-2-gray{background-color:#6f6f6f}:host(cds-user-avatar) .cds--user-avatar--order-3-green,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-3-green{background-color:#198038}:host(cds-user-avatar) .cds--user-avatar--order-4-magenta,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-4-magenta{background-color:#d02670}:host(cds-user-avatar) .cds--user-avatar--order-5-purple,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-5-purple{background-color:#8a3ffc}:host(cds-user-avatar) .cds--user-avatar--order-6-teal,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-6-teal{background-color:#007d79}:host(cds-user-avatar) .cds--user-avatar--order-7-cyan,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-7-cyan{background-color:#003a6d}:host(cds-user-avatar) .cds--user-avatar--order-8-gray,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-8-gray{background-color:#393939}:host(cds-user-avatar) .cds--user-avatar--order-9-green,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-9-green{background-color:#044317}:host(cds-user-avatar) .cds--user-avatar--order-10-magenta,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-10-magenta{background-color:#740937}:host(cds-user-avatar) .cds--user-avatar--order-11-purple,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-11-purple{background-color:#491d8b}:host(cds-user-avatar) .cds--user-avatar--order-12-teal,:host(cds-user-avatar[theme=light]) .cds--user-avatar--order-12-teal{background-color:#004144}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-1-cyan{background-color:#1192e8}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-2-gray{background-color:#8d8d8d}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-3-green{background-color:#24a148}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-4-magenta{background-color:#ee5396}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-5-purple{background-color:#a56eff}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-6-teal{background-color:#009d9a}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-7-cyan{background-color:#82cfff}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-8-gray{background-color:#c6c6c6}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-9-green{background-color:#6fdc8c}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-10-magenta{background-color:#ffafd2}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-11-purple{background-color:#d4bbff}:host(cds-user-avatar[theme=dark]) .cds--user-avatar--order-12-teal{background-color:#3ddbd9}"]);
|
|
11
|
+
//#endregion
|
|
12
|
+
export { user_avatar_default as default };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=user-avatar.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-avatar.scss.js","names":[],"sources":["../../../src/components/user-avatar/user-avatar.scss?lit"],"sourcesContent":["/*\n * Copyright IBM Corp. 2025, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n$css--plex: true !default;\n\n@use '@carbon/styles/scss/reset';\n@use '@carbon/styles/scss/config' as *;\n@use '@carbon/styles/scss/spacing' as *;\n@use '@carbon/styles/scss/theme' as *;\n@use '@carbon/styles/scss/type';\n@use '@carbon/styles/scss/colors' as *;\n\n@use '@carbon/styles/scss/components/user-avatar' as *;\n$block-class: #{$prefix}--user-avatar;\n\n:host(#{$prefix}-user-avatar) {\n display: inline-block;\n\n .#{$block-class} {\n box-sizing: border-box;\n }\n}\n\n:host(#{$prefix}-user-avatar) .#{$block-class}--xl {\n ::slotted([slot='rendericon']) {\n block-size: $spacing-07;\n inline-size: $spacing-07;\n }\n}\n\n:host(#{$prefix}-user-avatar) .#{$block-class}--lg {\n ::slotted([slot='rendericon']) {\n block-size: $spacing-06;\n inline-size: $spacing-06;\n }\n}\n\n:host(#{$prefix}-user-avatar) .#{$block-class}--md {\n ::slotted([slot='rendericon']) {\n block-size: $spacing-04 + $spacing-03;\n inline-size: $spacing-04 + $spacing-03;\n }\n}\n\n:host(#{$prefix}-user-avatar) .#{$block-class}--sm {\n ::slotted([slot='rendericon']) {\n block-size: $spacing-05;\n inline-size: $spacing-05;\n }\n}\n\n:host(#{$prefix}-user-avatar) .#{$block-class}__tooltip-trigger {\n padding: 0;\n border: 0;\n background: none;\n outline: none;\n}\n\n:host(#{$prefix}-user-avatar) .#{$block-class}__tooltip-content {\n --cds-tooltip-padding-block: #{$spacing-01};\n\n &:focus-within {\n outline: $spacing-01 solid $focus;\n outline-offset: 1px;\n }\n}\n\n@mixin setBgColor($color) {\n background-color: $color;\n}\n\n// this mixin allows you to set background color based on the lighter themes such as g10 and white\n@mixin setLightBg($order, $color) {\n :host(#{$prefix}-user-avatar) .#{$block-class}--#{$order},\n :host(#{$prefix}-user-avatar[theme='light']) .#{$block-class}--#{$order} {\n @include setBgColor($color);\n }\n}\n\n@mixin setDarkBg($order, $color) {\n :host(#{$prefix}-user-avatar[theme='dark']) .#{$block-class}--#{$order} {\n @include setBgColor($color);\n }\n}\n\n@include setLightBg(order-1-cyan, $cyan-60);\n@include setLightBg(order-2-gray, $gray-60);\n@include setLightBg(order-3-green, $green-60);\n@include setLightBg(order-4-magenta, $magenta-60);\n@include setLightBg(order-5-purple, $purple-60);\n@include setLightBg(order-6-teal, $teal-60);\n@include setLightBg(order-7-cyan, $cyan-80);\n@include setLightBg(order-8-gray, $gray-80);\n@include setLightBg(order-9-green, $green-80);\n@include setLightBg(order-10-magenta, $magenta-80);\n@include setLightBg(order-11-purple, $purple-80);\n@include setLightBg(order-12-teal, $teal-80);\n@include setDarkBg(order-1-cyan, $cyan-50);\n@include setDarkBg(order-2-gray, $gray-50);\n@include setDarkBg(order-3-green, $green-50);\n@include setDarkBg(order-4-magenta, $magenta-50);\n@include setDarkBg(order-5-purple, $purple-50);\n@include setDarkBg(order-6-teal, $teal-50);\n@include setDarkBg(order-7-cyan, $cyan-30);\n@include setDarkBg(order-8-gray, $gray-30);\n@include setDarkBg(order-9-green, $green-30);\n@include setDarkBg(order-10-magenta, $magenta-30);\n@include setDarkBg(order-11-purple, $purple-30);\n@include setDarkBg(order-12-teal, $teal-30);\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-controller.d.ts","sourceRoot":"","sources":["../../../src/globals/controllers/floating-controller.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAEL,IAAI,EAOJ,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAE1B,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAElB,YAAY,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,kBAAkB;IACnE;;OAEG;IACH,OAAO,CAAC,IAAI,CAAkB;IAC9B;;OAEG;IACH,OAAO,CAAC,OAAO,CAA6B;IAC5C;;OAEG;IACH,OAAO,CAAC,OAAO,CAAC,CAAa;IAE7B;;;OAGG;gBACS,IAAI,EAAE,eAAe;IAK3B,YAAY,CAAC,OAAO,GAAE,yBAAwC;IAOpE,eAAe,QAAO,IAAI,CAExB;IAEI,gBAAgB;
|
|
1
|
+
{"version":3,"file":"floating-controller.d.ts","sourceRoot":"","sources":["../../../src/globals/controllers/floating-controller.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAEL,IAAI,EAOJ,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAE1B,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAElB,YAAY,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,kBAAkB;IACnE;;OAEG;IACH,OAAO,CAAC,IAAI,CAAkB;IAC9B;;OAEG;IACH,OAAO,CAAC,OAAO,CAA6B;IAC5C;;OAEG;IACH,OAAO,CAAC,OAAO,CAAC,CAAa;IAE7B;;;OAGG;gBACS,IAAI,EAAE,eAAe;IAK3B,YAAY,CAAC,OAAO,GAAE,yBAAwC;IAOpE,eAAe,QAAO,IAAI,CAExB;IAEI,gBAAgB;IA4LtB,WAAW,IAAI,IAAI;IAOnB,gBAAgB,IAAI,IAAI;CAIzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-controller.js","names":[],"sources":["../../../src/globals/controllers/floating-controller.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2024, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { ReactiveController, ReactiveElement } from 'lit';\nimport {\n computePosition,\n flip,\n size,\n offset,\n arrow,\n autoUpdate,\n hide,\n Placement,\n type Boundary,\n} from '@floating-ui/dom';\n\ntype FloatingControllerOptions = {\n target: HTMLElement;\n trigger: HTMLElement;\n alignment: string;\n\n arrowElement?: HTMLElement | undefined;\n flipArguments?: Parameters<typeof flip>[0];\n caret?: boolean;\n\n styleElement?: HTMLElement;\n matchWidth?: boolean;\n open: boolean;\n alignmentAxisOffset?: number;\n mainAxisOffset?: number;\n autoAlignBoundary?: Boundary;\n isTabTip?: boolean;\n};\n\n/**\n * Controller for positioning the menu using Floating UI.\n */\nexport default class FloatingController implements ReactiveController {\n /**\n * Host component\n */\n private host: ReactiveElement;\n /**\n * Floating-ui options to pass to `computePlacement()`\n */\n private options!: FloatingControllerOptions;\n /**\n * cleanup function to stop auto updates\n */\n private cleanup?: () => void;\n\n /**\n * register with host component\n * @param host host component\n */\n constructor(host: ReactiveElement) {\n this.host = host;\n host.addController(this);\n }\n\n async setPlacement(options: FloatingControllerOptions = this.options) {\n this.options = options;\n const { trigger, target } = options;\n this.cleanup?.();\n this.cleanup = autoUpdate(trigger, target, this.updatePlacement);\n }\n\n updatePlacement = (): void => {\n this.computePlacement();\n };\n\n async computePlacement() {\n const {\n arrowElement,\n alignment,\n caret,\n trigger,\n target,\n styleElement,\n matchWidth,\n open,\n alignmentAxisOffset,\n mainAxisOffset,\n autoAlignBoundary,\n isTabTip,\n flipArguments,\n } = this.options;\n\n const isListBox = target?.role === 'listbox';\n const isMenu = target?.localName === 'cds-menu';\n\n const element = styleElement ?? target;\n\n if (!element) return;\n\n let shimmedAlign;\n switch (alignment) {\n case 'top-left':\n shimmedAlign = 'top-start';\n break;\n case 'top-right':\n shimmedAlign = 'top-end';\n break;\n case 'bottom-left':\n shimmedAlign = 'bottom-start';\n break;\n case 'bottom-right':\n shimmedAlign = 'bottom-end';\n break;\n case 'left-bottom':\n shimmedAlign = 'left-end';\n break;\n case 'left-top':\n shimmedAlign = 'left-start';\n break;\n case 'right-bottom':\n shimmedAlign = 'right-end';\n break;\n case 'right-top':\n shimmedAlign = 'right-start';\n break;\n default:\n shimmedAlign = alignment;\n break;\n }\n const cs = getComputedStyle(element);\n const toPx = (val: string) => {\n const raw = parseFloat(val);\n return val.trim().endsWith('rem') ? raw * 16 : raw;\n };\n const offsetPx = !isTabTip\n ? (toPx(cs.getPropertyValue('--cds-popover-offset').trim()) ?? 10)\n : 0;\n\n const middleware = [\n offset(\n !isTabTip\n ? {\n alignmentAxis: alignmentAxisOffset,\n // Allow callers to override default trigger-to-surface spacing.\n // Fallback remains 4px for non-caret overlays.\n mainAxis: mainAxisOffset ?? (caret ? offsetPx : 4),\n }\n : 0\n ),\n flip({\n fallbackPlacements: isTabTip\n ? shimmedAlign.includes('bottom')\n ? ['bottom-start', 'bottom-end', 'top-start', 'top-end']\n : ['top-start', 'top-end', 'bottom-start', 'bottom-end']\n : isListBox || isMenu\n ? ['top', 'bottom']\n : shimmedAlign.includes('bottom')\n ? [\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'right',\n 'right-start',\n 'right-end',\n 'left',\n 'left-start',\n 'left-end',\n 'top',\n 'top-start',\n 'top-end',\n ]\n : [\n 'top',\n 'top-start',\n 'top-end',\n 'left',\n 'left-start',\n 'left-end',\n 'right',\n 'right-start',\n 'right-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n ],\n\n fallbackStrategy: 'initialPlacement',\n fallbackAxisSideDirection: 'start',\n boundary: autoAlignBoundary,\n ...flipArguments,\n }),\n ...(matchWidth && (shimmedAlign === 'bottom' || shimmedAlign === 'top')\n ? [\n size({\n apply({ rects, elements }) {\n elements.floating.style.width = `${rects.reference.width}px`;\n },\n }),\n ]\n : [\n size({\n apply({ elements }) {\n elements.floating.style.removeProperty('width');\n },\n }),\n ]),\n\n ...(caret && arrowElement\n ? [arrow({ element: arrowElement, padding: 15 })]\n : []),\n\n ...[hide()],\n ];\n\n if (open) {\n const { x, y, placement, middlewareData, strategy } =\n await computePosition(trigger, element, {\n strategy: 'fixed',\n middleware,\n placement: shimmedAlign as Placement,\n });\n\n element.setAttribute('align', placement);\n\n element.style.left = `${x}px`;\n element.style.top = `${y}px`;\n element.style.position = `${strategy}`;\n\n element.style.visibility = middlewareData.hide?.referenceHidden\n ? 'hidden'\n : 'visible';\n\n if (arrowElement) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452\n const staticSide: any = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[placement.split('-')[0]];\n\n arrowElement.style.left = arrowX != null ? `${arrowX}px` : '';\n arrowElement.style.top = arrowY != null ? `${arrowY}px` : '';\n arrowElement.style.right = '';\n arrowElement.style.bottom = '';\n arrowElement.style[staticSide] = `${-arrowElement.offsetWidth / 2}px`;\n }\n\n // adding specific case here where the style of the caret/arrow\n // is dependent on the placement\n // TODO: remove reference to slug in v12\n if (\n this.host.tagName === 'CDS-AI-LABEL' ||\n this.host.tagName === 'CDS-SLUG'\n ) {\n this.host?.setAttribute('alignment', placement);\n }\n }\n }\n\n hostUpdated(): void {\n if (!this.host.hasAttribute('open')) {\n this.cleanup?.();\n this.cleanup = undefined;\n }\n }\n\n hostDisconnected(): void {\n this.cleanup?.();\n this.cleanup = undefined;\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"floating-controller.js","names":[],"sources":["../../../src/globals/controllers/floating-controller.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2024, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { ReactiveController, ReactiveElement } from 'lit';\nimport {\n computePosition,\n flip,\n size,\n offset,\n arrow,\n autoUpdate,\n hide,\n Placement,\n type Boundary,\n} from '@floating-ui/dom';\n\ntype FloatingControllerOptions = {\n target: HTMLElement;\n trigger: HTMLElement;\n alignment: string;\n\n arrowElement?: HTMLElement | undefined;\n flipArguments?: Parameters<typeof flip>[0];\n caret?: boolean;\n\n styleElement?: HTMLElement;\n matchWidth?: boolean;\n open: boolean;\n alignmentAxisOffset?: number;\n mainAxisOffset?: number;\n autoAlignBoundary?: Boundary;\n isTabTip?: boolean;\n};\n\n/**\n * Controller for positioning the menu using Floating UI.\n */\nexport default class FloatingController implements ReactiveController {\n /**\n * Host component\n */\n private host: ReactiveElement;\n /**\n * Floating-ui options to pass to `computePlacement()`\n */\n private options!: FloatingControllerOptions;\n /**\n * cleanup function to stop auto updates\n */\n private cleanup?: () => void;\n\n /**\n * register with host component\n * @param host host component\n */\n constructor(host: ReactiveElement) {\n this.host = host;\n host.addController(this);\n }\n\n async setPlacement(options: FloatingControllerOptions = this.options) {\n this.options = options;\n const { trigger, target } = options;\n this.cleanup?.();\n this.cleanup = autoUpdate(trigger, target, this.updatePlacement);\n }\n\n updatePlacement = (): void => {\n this.computePlacement();\n };\n\n async computePlacement() {\n const {\n arrowElement,\n alignment,\n caret,\n trigger,\n target,\n styleElement,\n matchWidth,\n open,\n alignmentAxisOffset,\n mainAxisOffset,\n autoAlignBoundary,\n isTabTip,\n flipArguments,\n } = this.options;\n\n const isListBox = target?.role === 'listbox';\n const isMenu = target?.localName === 'cds-menu';\n\n const element = styleElement ?? target;\n\n if (!element) return;\n\n let shimmedAlign;\n switch (alignment) {\n case 'top-left':\n shimmedAlign = 'top-start';\n break;\n case 'top-right':\n shimmedAlign = 'top-end';\n break;\n case 'bottom-left':\n shimmedAlign = 'bottom-start';\n break;\n case 'bottom-right':\n shimmedAlign = 'bottom-end';\n break;\n case 'left-bottom':\n shimmedAlign = 'left-end';\n break;\n case 'left-top':\n shimmedAlign = 'left-start';\n break;\n case 'right-bottom':\n shimmedAlign = 'right-end';\n break;\n case 'right-top':\n shimmedAlign = 'right-start';\n break;\n default:\n shimmedAlign = alignment;\n break;\n }\n const cs = getComputedStyle(element);\n const toPx = (val: string) => {\n const raw = parseFloat(val);\n return val.trim().endsWith('rem') ? raw * 16 : raw;\n };\n const offsetPx = !isTabTip\n ? (toPx(cs.getPropertyValue('--cds-popover-offset').trim()) ?? 10)\n : 0;\n\n const middleware = [\n offset(\n !isTabTip\n ? {\n alignmentAxis: alignmentAxisOffset,\n // Allow callers to override default trigger-to-surface spacing.\n // Fallback remains 4px for non-caret overlays.\n mainAxis: mainAxisOffset ?? (caret ? offsetPx : 4),\n }\n : 0\n ),\n flip({\n fallbackPlacements: isTabTip\n ? shimmedAlign.includes('bottom')\n ? ['bottom-start', 'bottom-end', 'top-start', 'top-end']\n : ['top-start', 'top-end', 'bottom-start', 'bottom-end']\n : isListBox || isMenu\n ? ['top', 'bottom']\n : shimmedAlign.includes('bottom')\n ? [\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'right',\n 'right-start',\n 'right-end',\n 'left',\n 'left-start',\n 'left-end',\n 'top',\n 'top-start',\n 'top-end',\n ]\n : [\n 'top',\n 'top-start',\n 'top-end',\n 'left',\n 'left-start',\n 'left-end',\n 'right',\n 'right-start',\n 'right-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n ],\n\n fallbackStrategy: 'initialPlacement',\n fallbackAxisSideDirection: 'start',\n boundary: autoAlignBoundary,\n ...flipArguments,\n }),\n ...(matchWidth && (shimmedAlign === 'bottom' || shimmedAlign === 'top')\n ? [\n size({\n apply({ rects, elements }) {\n elements.floating.style.width = `${rects.reference.width}px`;\n },\n }),\n ]\n : [\n size({\n apply({ elements }) {\n elements.floating.style.removeProperty('width');\n },\n }),\n ]),\n\n ...(caret && arrowElement\n ? [arrow({ element: arrowElement, padding: 15 })]\n : []),\n\n ...[hide()],\n ];\n\n if (open) {\n const { x, y, placement, middlewareData, strategy } =\n await computePosition(trigger, element, {\n strategy: 'fixed',\n middleware,\n placement: shimmedAlign as Placement,\n });\n\n element.setAttribute('align', placement);\n\n element.style.left = `${x}px`;\n element.style.top = `${y}px`;\n element.style.position = `${strategy}`;\n\n element.style.visibility = middlewareData.hide?.referenceHidden\n ? 'hidden'\n : 'visible';\n\n if (arrowElement) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n const staticSide = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[placement.split('-')[0] as 'top' | 'right' | 'bottom' | 'left'];\n\n arrowElement.style.left = arrowX != null ? `${arrowX}px` : '';\n arrowElement.style.top = arrowY != null ? `${arrowY}px` : '';\n arrowElement.style.right = '';\n arrowElement.style.bottom = '';\n arrowElement.style[staticSide] = `${-arrowElement.offsetWidth / 2}px`;\n }\n\n // adding specific case here where the style of the caret/arrow\n // is dependent on the placement\n // TODO: remove reference to slug in v12\n if (\n this.host.tagName === 'CDS-AI-LABEL' ||\n this.host.tagName === 'CDS-SLUG'\n ) {\n this.host?.setAttribute('alignment', placement);\n }\n }\n }\n\n hostUpdated(): void {\n if (!this.host.hasAttribute('open')) {\n this.cleanup?.();\n this.cleanup = undefined;\n }\n }\n\n hostDisconnected(): void {\n this.cleanup?.();\n this.cleanup = undefined;\n }\n}\n"],"mappings":"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"}
|
|
@@ -38,6 +38,14 @@ type CustomElementClass = Omit<typeof HTMLElement, 'new'>;
|
|
|
38
38
|
* }
|
|
39
39
|
* ```
|
|
40
40
|
*
|
|
41
|
+
* @deprecated The `carbonElement` decorator is deprecated and will be removed in
|
|
42
|
+
* v3. In v3, `@carbon/web-components` moves to pure component
|
|
43
|
+
* classes (`static is = '${prefix}-name'`) with opt-in registration via
|
|
44
|
+
* `defineCustomElement`, and this self-registering decorator is removed. If you
|
|
45
|
+
* author your own custom elements with it, migrate to Lit's `customElement`
|
|
46
|
+
* (`import { customElement } from 'lit/decorators.js'`). See the v3 migration
|
|
47
|
+
* guide:
|
|
48
|
+
* https://github.com/carbon-design-system/carbon/blob/main/docs/guides/cwc-v3-migration.md#the-carbonelement-decorator-is-removed
|
|
41
49
|
* @category Decorator
|
|
42
50
|
* @param tagName The tag name of the custom element to define.
|
|
43
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carbon-element.d.ts","sourceRoot":"","sources":["../../../src/globals/decorators/carbon-element.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,CAAC,OAAO,MAAM,WAAW,CAAC,CAAC,IAAI;IAEnC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB,CAAC;AAEF,KAAK,QAAQ,GACT,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,GAAG,EAAE,WAAW,CAAC;IACjB,SAAS,EAAE,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC;AAED;;GAEG;AACH,KAAK,kBAAkB,GAAG,IAAI,CAAC,OAAO,WAAW,EAAE,KAAK,CAAC,CAAC;AAsC1D
|
|
1
|
+
{"version":3,"file":"carbon-element.d.ts","sourceRoot":"","sources":["../../../src/globals/decorators/carbon-element.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,CAAC,OAAO,MAAM,WAAW,CAAC,CAAC,IAAI;IAEnC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB,CAAC;AAEF,KAAK,QAAQ,GACT,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,GAAG,EAAE,WAAW,CAAC;IACjB,SAAS,EAAE,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC;AAED;;GAEG;AACH,KAAK,kBAAkB,GAAG,IAAI,CAAC,OAAO,WAAW,EAAE,KAAK,CAAC,CAAC;AAsC1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,GACvB,SAAS,MAAM,MACf,mBAAmB,kBAAkB,GAAG,eAAe,QAGkB,CAAC"}
|
|
@@ -40,6 +40,14 @@ const standardCustomElement = (tagName, descriptor) => {
|
|
|
40
40
|
* }
|
|
41
41
|
* ```
|
|
42
42
|
*
|
|
43
|
+
* @deprecated The `carbonElement` decorator is deprecated and will be removed in
|
|
44
|
+
* v3. In v3, `@carbon/web-components` moves to pure component
|
|
45
|
+
* classes (`static is = '${prefix}-name'`) with opt-in registration via
|
|
46
|
+
* `defineCustomElement`, and this self-registering decorator is removed. If you
|
|
47
|
+
* author your own custom elements with it, migrate to Lit's `customElement`
|
|
48
|
+
* (`import { customElement } from 'lit/decorators.js'`). See the v3 migration
|
|
49
|
+
* guide:
|
|
50
|
+
* https://github.com/carbon-design-system/carbon/blob/main/docs/guides/cwc-v3-migration.md#the-carbonelement-decorator-is-removed
|
|
43
51
|
* @category Decorator
|
|
44
52
|
* @param tagName The tag name of the custom element to define.
|
|
45
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carbon-element.js","names":[],"sources":["../../../src/globals/decorators/carbon-element.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\nexport declare type Constructor<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452\n new (...args: any[]): T;\n};\n\ntype Finisher =\n | (<T>(clazz: Constructor<T>) => Constructor<T>)\n | (<T>(clazz: Constructor<T>) => void);\n\nexport interface ClassDescriptor {\n kind: 'class';\n elements: ClassElement[];\n finisher?: Finisher;\n}\n\nexport interface ClassElement {\n kind: 'field' | 'method';\n key: PropertyKey;\n placement: 'static' | 'prototype' | 'own';\n initializer?: () => unknown;\n extras?: ClassElement[];\n finisher?: Finisher;\n descriptor?: PropertyDescriptor;\n}\n\n/**\n * Allow for custom element classes with private constructors\n */\ntype CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nconst legacyCustomElement = (tagName: string, clazz: CustomElementClass) => {\n try {\n customElements.define(tagName, clazz as CustomElementConstructor);\n } catch {\n // eslint-disable-next-line no-console\n console.warn(`Attempting to re-define ${tagName}`);\n }\n // Cast as any because TS doesn't recognize the return type as being a\n // subtype of the decorated class when clazz is typed as\n // `Constructor<HTMLElement>` for some reason.\n // `Constructor<HTMLElement>` is helpful to make sure the decorator is\n // applied to elements however.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return clazz as any;\n};\n\nconst standardCustomElement = (\n tagName: string,\n descriptor: ClassDescriptor\n) => {\n const { kind, elements } = descriptor;\n return {\n kind,\n elements,\n // This callback is called once the class is otherwise fully defined\n finisher(clazz: Constructor<HTMLElement>) {\n try {\n customElements.define(tagName, clazz);\n } catch {\n // eslint-disable-next-line no-console\n console.warn(`Attempting to re-define ${tagName}`);\n }\n },\n };\n};\n\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * ```js\n * @customElement('my-element')\n * class MyElement extends LitElement {\n * render() {\n * return html``;\n * }\n * }\n * ```\n *\n * @category Decorator\n * @param tagName The tag name of the custom element to define.\n */\nexport const carbonElement =\n (tagName: string) =>\n (classOrDescriptor: CustomElementClass | ClassDescriptor) =>\n typeof classOrDescriptor === 'function'\n ? legacyCustomElement(tagName, classOrDescriptor)\n : standardCustomElement(tagName, classOrDescriptor as ClassDescriptor);\n"],"mappings":";;;;;;;;AA2CA,MAAM,uBAAuB,SAAiB,UAA8B;CAC1E,IAAI;EACF,eAAe,OAAO,SAAS,KAAiC;CAClE,QAAQ;EAEN,QAAQ,KAAK,2BAA2B,SAAS;CACnD;CAOA,OAAO;AACT;AAEA,MAAM,yBACJ,SACA,eACG;CACH,MAAM,EAAE,MAAM,aAAa;CAC3B,OAAO;EACL;EACA;EAEA,SAAS,OAAiC;GACxC,IAAI;IACF,eAAe,OAAO,SAAS,KAAK;GACtC,QAAQ;IAEN,QAAQ,KAAK,2BAA2B,SAAS;GACnD;EACF;CACF;AACF
|
|
1
|
+
{"version":3,"file":"carbon-element.js","names":[],"sources":["../../../src/globals/decorators/carbon-element.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\nexport declare type Constructor<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452\n new (...args: any[]): T;\n};\n\ntype Finisher =\n | (<T>(clazz: Constructor<T>) => Constructor<T>)\n | (<T>(clazz: Constructor<T>) => void);\n\nexport interface ClassDescriptor {\n kind: 'class';\n elements: ClassElement[];\n finisher?: Finisher;\n}\n\nexport interface ClassElement {\n kind: 'field' | 'method';\n key: PropertyKey;\n placement: 'static' | 'prototype' | 'own';\n initializer?: () => unknown;\n extras?: ClassElement[];\n finisher?: Finisher;\n descriptor?: PropertyDescriptor;\n}\n\n/**\n * Allow for custom element classes with private constructors\n */\ntype CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nconst legacyCustomElement = (tagName: string, clazz: CustomElementClass) => {\n try {\n customElements.define(tagName, clazz as CustomElementConstructor);\n } catch {\n // eslint-disable-next-line no-console\n console.warn(`Attempting to re-define ${tagName}`);\n }\n // Cast as any because TS doesn't recognize the return type as being a\n // subtype of the decorated class when clazz is typed as\n // `Constructor<HTMLElement>` for some reason.\n // `Constructor<HTMLElement>` is helpful to make sure the decorator is\n // applied to elements however.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return clazz as any;\n};\n\nconst standardCustomElement = (\n tagName: string,\n descriptor: ClassDescriptor\n) => {\n const { kind, elements } = descriptor;\n return {\n kind,\n elements,\n // This callback is called once the class is otherwise fully defined\n finisher(clazz: Constructor<HTMLElement>) {\n try {\n customElements.define(tagName, clazz);\n } catch {\n // eslint-disable-next-line no-console\n console.warn(`Attempting to re-define ${tagName}`);\n }\n },\n };\n};\n\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * ```js\n * @customElement('my-element')\n * class MyElement extends LitElement {\n * render() {\n * return html``;\n * }\n * }\n * ```\n *\n * @deprecated The `carbonElement` decorator is deprecated and will be removed in\n * v3. In v3, `@carbon/web-components` moves to pure component\n * classes (`static is = '${prefix}-name'`) with opt-in registration via\n * `defineCustomElement`, and this self-registering decorator is removed. If you\n * author your own custom elements with it, migrate to Lit's `customElement`\n * (`import { customElement } from 'lit/decorators.js'`). See the v3 migration\n * guide:\n * https://github.com/carbon-design-system/carbon/blob/main/docs/guides/cwc-v3-migration.md#the-carbonelement-decorator-is-removed\n * @category Decorator\n * @param tagName The tag name of the custom element to define.\n */\nexport const carbonElement =\n (tagName: string) =>\n (classOrDescriptor: CustomElementClass | ClassDescriptor) =>\n typeof classOrDescriptor === 'function'\n ? legacyCustomElement(tagName, classOrDescriptor)\n : standardCustomElement(tagName, classOrDescriptor as ClassDescriptor);\n"],"mappings":";;;;;;;;AA2CA,MAAM,uBAAuB,SAAiB,UAA8B;CAC1E,IAAI;EACF,eAAe,OAAO,SAAS,KAAiC;CAClE,QAAQ;EAEN,QAAQ,KAAK,2BAA2B,SAAS;CACnD;CAOA,OAAO;AACT;AAEA,MAAM,yBACJ,SACA,eACG;CACH,MAAM,EAAE,MAAM,aAAa;CAC3B,OAAO;EACL;EACA;EAEA,SAAS,OAAiC;GACxC,IAAI;IACF,eAAe,OAAO,SAAS,KAAK;GACtC,QAAQ;IAEN,QAAQ,KAAK,2BAA2B,SAAS;GACnD;EACF;CACF;AACF;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,iBACV,aACA,sBACC,OAAO,sBAAsB,aACzB,oBAAoB,SAAS,iBAAiB,IAC9C,sBAAsB,SAAS,iBAAoC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2019,
|
|
2
|
+
* Copyright IBM Corp. 2019, 2026
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
* @param [thisObject] The context object for the given callback function.
|
|
11
11
|
* @returns A new array with all elements where `predicate` returns truthy.
|
|
12
12
|
*/
|
|
13
|
-
export declare const filter: (a: NodeListOf<Node> | HTMLCollectionOf<Element>, predicate: (search: Node, index?: number) => boolean, thisObject?:
|
|
13
|
+
export declare const filter: (a: NodeListOf<Node> | HTMLCollectionOf<Element>, predicate: (search: Node, index?: number) => boolean, thisObject?: unknown) => any[];
|
|
14
14
|
/**
|
|
15
15
|
* @param a A DOM collection.
|
|
16
16
|
* @param predicate The callback function.
|
|
17
17
|
* @param [thisObject] The context object for the given callback function.
|
|
18
18
|
* @returns The index of the first item in the given collection where `predicate` returns `true`. `-1` if no such item is found.
|
|
19
19
|
*/
|
|
20
|
-
export declare const findIndex: (a: NodeListOf<Node> | HTMLCollectionOf<Element>, predicate: (search: Node, index?: number) => boolean, thisObject?:
|
|
20
|
+
export declare const findIndex: (a: NodeListOf<Node> | HTMLCollectionOf<Element>, predicate: (search: Node, index?: number) => boolean, thisObject?: unknown) => number;
|
|
21
21
|
/**
|
|
22
22
|
* @param a A DOM collection.
|
|
23
23
|
* @param predicate The callback function.
|
|
24
24
|
* @param [thisObject] The context object for the given callback function.
|
|
25
25
|
* @returns The first item in the given collection where `predicate` returns `true`. `null` if no such item is found.
|
|
26
26
|
*/
|
|
27
|
-
export declare const find: (a: NodeListOf<Node> | HTMLCollectionOf<Element>, predicate: (search: Node, index?: number) => boolean, thisObject?:
|
|
27
|
+
export declare const find: (a: NodeListOf<Node> | HTMLCollectionOf<Element>, predicate: (search: Node, index?: number) => boolean, thisObject?: unknown) => any;
|
|
28
28
|
/**
|
|
29
29
|
* Walks through the given DOM collection and runs the given callback.
|
|
30
30
|
*
|
|
@@ -32,7 +32,7 @@ export declare const find: (a: NodeListOf<Node> | HTMLCollectionOf<Element>, pre
|
|
|
32
32
|
* @param predicate The callback function.
|
|
33
33
|
* @param [thisObject] The context object for the given callback function.
|
|
34
34
|
*/
|
|
35
|
-
export declare const forEach: (a: NodeListOf<Node> | HTMLCollectionOf<Element>, predicate: (search: Element, index?: number) => void, thisObject?:
|
|
35
|
+
export declare const forEach: (a: NodeListOf<Node> | HTMLCollectionOf<Element>, predicate: (search: Element, index?: number) => void, thisObject?: unknown) => void;
|
|
36
36
|
/**
|
|
37
37
|
* @param a A DOM collection.
|
|
38
38
|
* @param item An item in the DOM collection.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-helpers.d.ts","sourceRoot":"","sources":["../../../src/globals/internal/collection-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,EAC/C,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"collection-helpers.d.ts","sourceRoot":"","sources":["../../../src/globals/internal/collection-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,EAC/C,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,EACpD,aAAa,OAAO,UACoC,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GACpB,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,EAC/C,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,EACpD,aAAa,OAAO,WACuC,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GACf,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,EAC/C,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,EACpD,aAAa,OAAO,QACkC,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,GAClB,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,EAC/C,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,EACpD,aAAa,OAAO,SACqC,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAClB,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,EAC/C,MAAM,IAAI,WAC8B,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
//#region src/globals/internal/collection-helpers.ts
|
|
9
9
|
/**
|
|
10
|
-
* Copyright IBM Corp. 2019,
|
|
10
|
+
* Copyright IBM Corp. 2019, 2026
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-helpers.js","names":[],"sources":["../../../src/globals/internal/collection-helpers.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019,
|
|
1
|
+
{"version":3,"file":"collection-helpers.js","names":[],"sources":["../../../src/globals/internal/collection-helpers.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * @param a A DOM collection.\n * @param predicate The callback function.\n * @param [thisObject] The context object for the given callback function.\n * @returns A new array with all elements where `predicate` returns truthy.\n */\nexport const filter = (\n a: NodeListOf<Node> | HTMLCollectionOf<Element>,\n predicate: (search: Node, index?: number) => boolean,\n thisObject?: unknown\n) => Array.prototype.filter.call(a, predicate, thisObject);\n\n/**\n * @param a A DOM collection.\n * @param predicate The callback function.\n * @param [thisObject] The context object for the given callback function.\n * @returns The index of the first item in the given collection where `predicate` returns `true`. `-1` if no such item is found.\n */\nexport const findIndex = (\n a: NodeListOf<Node> | HTMLCollectionOf<Element>,\n predicate: (search: Node, index?: number) => boolean,\n thisObject?: unknown\n) => Array.prototype.findIndex.call(a, predicate, thisObject);\n\n/**\n * @param a A DOM collection.\n * @param predicate The callback function.\n * @param [thisObject] The context object for the given callback function.\n * @returns The first item in the given collection where `predicate` returns `true`. `null` if no such item is found.\n */\nexport const find = (\n a: NodeListOf<Node> | HTMLCollectionOf<Element>,\n predicate: (search: Node, index?: number) => boolean,\n thisObject?: unknown\n) => Array.prototype.find.call(a, predicate, thisObject);\n\n/**\n * Walks through the given DOM collection and runs the given callback.\n *\n * @param a A DOM collection.\n * @param predicate The callback function.\n * @param [thisObject] The context object for the given callback function.\n */\nexport const forEach = (\n a: NodeListOf<Node> | HTMLCollectionOf<Element>,\n predicate: (search: Element, index?: number) => void,\n thisObject?: unknown\n) => Array.prototype.forEach.call(a, predicate, thisObject);\n\n/**\n * @param a A DOM collection.\n * @param item An item in the DOM collection.\n * @returns The index of the first occurence of the given item in the given collection. `-1` if no such item is found.\n */\nexport const indexOf = (\n a: NodeListOf<Node> | HTMLCollectionOf<Element>,\n item: Node\n) => Array.prototype.indexOf.call(a, item);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAaA,MAAa,UACX,GACA,WACA,eACG,MAAM,UAAU,OAAO,KAAK,GAAG,WAAW,UAAU;;;;;;;AAQzD,MAAa,aACX,GACA,WACA,eACG,MAAM,UAAU,UAAU,KAAK,GAAG,WAAW,UAAU;;;;;;;AAQ5D,MAAa,QACX,GACA,WACA,eACG,MAAM,UAAU,KAAK,KAAK,GAAG,WAAW,UAAU;;;;;;;;AASvD,MAAa,WACX,GACA,WACA,eACG,MAAM,UAAU,QAAQ,KAAK,GAAG,WAAW,UAAU;;;;;;AAO1D,MAAa,WACX,GACA,SACG,MAAM,UAAU,QAAQ,KAAK,GAAG,IAAI"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025, 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Returns `locale` if it is supported by `Intl.NumberFormat`, otherwise
|
|
9
|
+
* returns `defaultLocale`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getSupportedLocale(locale: Intl.LocalesArgument, defaultLocale: string): Intl.LocalesArgument;
|
|
12
|
+
//# sourceMappingURL=getSupportedLocale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSupportedLocale.d.ts","sourceRoot":"","sources":["../../../src/globals/internal/getSupportedLocale.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,IAAI,CAAC,eAAe,EAC5B,aAAa,EAAE,MAAM,GACpB,IAAI,CAAC,eAAe,CAStB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
//#region src/globals/internal/getSupportedLocale.ts
|
|
9
|
+
/**
|
|
10
|
+
* Copyright IBM Corp. 2025, 2026
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Returns `locale` if it is supported by `Intl.NumberFormat`, otherwise
|
|
17
|
+
* returns `defaultLocale`.
|
|
18
|
+
*/
|
|
19
|
+
function getSupportedLocale(locale, defaultLocale) {
|
|
20
|
+
try {
|
|
21
|
+
return Intl.NumberFormat.supportedLocalesOf(locale).length > 0 ? locale : defaultLocale;
|
|
22
|
+
} catch {
|
|
23
|
+
return defaultLocale;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getSupportedLocale };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=getSupportedLocale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSupportedLocale.js","names":[],"sources":["../../../src/globals/internal/getSupportedLocale.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2025, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Returns `locale` if it is supported by `Intl.NumberFormat`, otherwise\n * returns `defaultLocale`.\n */\nexport function getSupportedLocale(\n locale: Intl.LocalesArgument,\n defaultLocale: string\n): Intl.LocalesArgument {\n try {\n const supported = Intl.NumberFormat.supportedLocalesOf(\n locale as string | string[]\n );\n return supported.length > 0 ? locale : defaultLocale;\n } catch {\n return defaultLocale;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAWA,SAAgB,mBACd,QACA,eACsB;CACtB,IAAI;EAIF,OAHkB,KAAK,aAAa,mBAClC,MAEa,CAAC,CAAC,SAAS,IAAI,SAAS;CACzC,QAAQ;EACN,OAAO;CACT;AACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
export default function on(element:
|
|
7
|
+
export default function on<TEvent extends Event = Event>(element: EventTarget, type: string, listener: EventListenerObject | ((event: TEvent) => void), options?: boolean | AddEventListenerOptions): {
|
|
8
8
|
release(): null;
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=on.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on.d.ts","sourceRoot":"","sources":["../../../src/globals/mixins/on.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"on.d.ts","sourceRoot":"","sources":["../../../src/globals/mixins/on.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,OAAO,UAAU,EAAE,CAAC,MAAM,SAAS,KAAK,GAAG,KAAK,EACrD,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,mBAAmB,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,EACzD,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB;;EAiB5C"}
|
package/es/globals/mixins/on.js
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
//#region src/globals/mixins/on.ts
|
|
9
9
|
/**
|
|
10
|
-
* Copyright IBM Corp. 2016,
|
|
10
|
+
* Copyright IBM Corp. 2016, 2026
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
function on(element,
|
|
16
|
-
element.addEventListener(
|
|
15
|
+
function on(element, type, listener, options) {
|
|
16
|
+
element.addEventListener(type, listener, options);
|
|
17
17
|
return { release() {
|
|
18
|
-
element.removeEventListener(
|
|
18
|
+
element.removeEventListener(type, listener, options);
|
|
19
19
|
return null;
|
|
20
20
|
} };
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on.js","names":[],"sources":["../../../src/globals/mixins/on.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2016,
|
|
1
|
+
{"version":3,"file":"on.js","names":[],"sources":["../../../src/globals/mixins/on.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2016, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport default function on<TEvent extends Event = Event>(\n element: EventTarget,\n type: string,\n listener: EventListenerObject | ((event: TEvent) => void),\n options?: boolean | AddEventListenerOptions\n) {\n element.addEventListener(\n type,\n listener as EventListenerOrEventListenerObject,\n options\n );\n return {\n release() {\n element.removeEventListener(\n type,\n listener as EventListenerOrEventListenerObject,\n options\n );\n return null;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAOA,SAAwB,GACtB,SACA,MACA,UACA,SACA;CACA,QAAQ,iBACN,MACA,UACA,OACF;CACA,OAAO,EACL,UAAU;EACR,QAAQ,oBACN,MACA,UACA,OACF;EACA,OAAO;CACT,EACF;AACF"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Public registration API for `@carbon/web-components`
|
|
9
|
+
*
|
|
10
|
+
* Component classes are side-effect free; importing a class does not
|
|
11
|
+
* register it. Registration is opt-in, using `defineCustomElement`.
|
|
12
|
+
* By default, Carbon web components auto-register via their import barrels.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Custom element constructor that carries the registered tag name as a
|
|
16
|
+
* static `is` property instead of baking the tag name into a decorator.
|
|
17
|
+
*/
|
|
18
|
+
export interface CarbonCustomElementConstructor extends CustomElementConstructor {
|
|
19
|
+
/**
|
|
20
|
+
* the tag name this element registers under
|
|
21
|
+
*/
|
|
22
|
+
is: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Options for {@link defineCustomElement}
|
|
26
|
+
*/
|
|
27
|
+
export interface DefineCustomElementOptions {
|
|
28
|
+
/**
|
|
29
|
+
* The tag name to register under. Defaults to the class's static `is`.
|
|
30
|
+
* Pass custom name to avoid global-registry collisions.
|
|
31
|
+
*
|
|
32
|
+
* ```js
|
|
33
|
+
* import CDSButton from '@carbon/web-components/es/components/button/button.js';
|
|
34
|
+
* import { defineCustomElement } from '@carbon/web-components/es/globals/register.js';
|
|
35
|
+
*
|
|
36
|
+
* // <cwc-button>
|
|
37
|
+
* defineCustomElement(CDSButton, { name: 'cwc-button' });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
name?: string;
|
|
41
|
+
/**
|
|
42
|
+
* A custom registry to define the element in. Defaults to the global
|
|
43
|
+
* `customElements`. Pass a scoped `CustomElementRegistry` to keep registration
|
|
44
|
+
* out of global namespace.
|
|
45
|
+
*
|
|
46
|
+
* ```js
|
|
47
|
+
* import CDSButton from '@carbon/web-components/es/components/button/button.js';
|
|
48
|
+
* import { defineCustomElement } from '@carbon/web-components/es/globals/register.js';
|
|
49
|
+
*
|
|
50
|
+
* // Requires native support or the
|
|
51
|
+
* // `@webcomponents/scoped-custom-element-registry` polyfill.
|
|
52
|
+
* const registry = new CustomElementRegistry();
|
|
53
|
+
* defineCustomElement(CDSButton, { registry });
|
|
54
|
+
*
|
|
55
|
+
* // <cds-button> resolves to this registry, not the global one
|
|
56
|
+
* host.attachShadow({ mode: 'open', customElementRegistry: registry });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
registry?: CustomElementRegistry;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Register a custom element class, under `options.name` in `options.registry`.
|
|
63
|
+
*
|
|
64
|
+
* `clazz` only needs to be a custom element constructor. `static is` is how a
|
|
65
|
+
* class carries its own tag (see {@link CarbonCustomElementConstructor}), but a
|
|
66
|
+
* class without one can still be registered by passing `options.name` — which
|
|
67
|
+
* is how an existing class is put on a second tag.
|
|
68
|
+
* Called by the registering barrels so importing a class stays pure.
|
|
69
|
+
*
|
|
70
|
+
* Re-registering the same class under the same tag is a no-op. If the tag is
|
|
71
|
+
* registered by a different class, i.e. two copies on the same page, the first
|
|
72
|
+
* definition wins and a warning is emitted in development.
|
|
73
|
+
*
|
|
74
|
+
* Classes can only be registered once per registry. If the tag is free but
|
|
75
|
+
* `clazz` is already registered under another name, e.g. a custom name call
|
|
76
|
+
* after the default tag was defined, a subclass is registered under the new name
|
|
77
|
+
* instead as `instanceof clazz`.
|
|
78
|
+
*
|
|
79
|
+
* @param clazz The custom element class to register
|
|
80
|
+
* @param options Registration options
|
|
81
|
+
* @returns The registered class, for re-export. This is `clazz` itself,
|
|
82
|
+
* except in the subclass case above, where it is the subclass that was
|
|
83
|
+
* actually registered under `options.name`.
|
|
84
|
+
*/
|
|
85
|
+
export declare const defineCustomElement: <T extends CustomElementConstructor & {
|
|
86
|
+
is?: string;
|
|
87
|
+
}>(clazz: T, options?: DefineCustomElementOptions) => T;
|
|
88
|
+
export default defineCustomElement;
|
|
89
|
+
//# sourceMappingURL=register.d.ts.map
|