@xplortech/apollo-core 2.6.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.typings/apollo-components.html-data.json +626 -35
- package/build/style.css +5949 -3070
- package/dist/apollo-core/apollo-core.css +29 -19
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-0bf50890.entry.js +1 -0
- package/dist/apollo-core/p-1947e7a8.entry.js +1 -0
- package/dist/apollo-core/p-27928cb0.entry.js +1 -0
- package/dist/apollo-core/{p-5549756c.entry.js → p-34438721.entry.js} +1 -1
- package/dist/apollo-core/p-35c2f72d.entry.js +1 -0
- package/dist/apollo-core/p-368c81f1.entry.js +1 -0
- package/dist/apollo-core/{p-f5af9539.entry.js → p-36ba29da.entry.js} +1 -1
- package/dist/apollo-core/p-406b27a8.entry.js +1 -0
- package/dist/apollo-core/p-5d63b4ce.entry.js +1 -0
- package/dist/apollo-core/{p-02167464.entry.js → p-6a15f1e0.entry.js} +1 -1
- package/dist/apollo-core/p-8d692d05.entry.js +1 -0
- package/dist/apollo-core/{p-C_Z2nG0p.js → p-C7bgJs6C.js} +2 -2
- package/dist/apollo-core/{p-42016063.entry.js → p-b61d7952.entry.js} +1 -1
- package/dist/apollo-core/{p-8a1affce.entry.js → p-ca127ee8.entry.js} +1 -1
- package/dist/apollo-core/p-d1c9c233.entry.js +1 -0
- package/dist/apollo-core/p-dc205893.entry.js +1 -0
- package/dist/apollo-core/p-e2a5d41c.entry.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +3 -3
- package/dist/cjs/{index-DH6pgWru.js → index-BQ97-AWw.js} +18 -7
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xpl-accordion.cjs.entry.js +3 -3
- package/dist/cjs/xpl-application-shell.cjs.entry.js +2 -2
- package/dist/cjs/{xpl-avatar_47.cjs.entry.js → xpl-avatar_54.cjs.entry.js} +3726 -536
- package/dist/cjs/xpl-button-row.cjs.entry.js +2 -2
- package/dist/cjs/xpl-calendar.cjs.entry.js +2 -2
- package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +3 -3
- package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +3 -3
- package/dist/cjs/xpl-dynamic-table.cjs.entry.js +2 -2
- package/dist/cjs/xpl-grid-item.cjs.entry.js +2 -2
- package/dist/cjs/xpl-grid.cjs.entry.js +2 -2
- package/dist/cjs/xpl-large-card.cjs.entry.js +2 -2
- package/dist/cjs/xpl-main-nav.cjs.entry.js +2 -2
- package/dist/cjs/xpl-table-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/xpl-table-header.cjs.entry.js +2 -2
- package/dist/cjs/xpl-toggle.cjs.entry.js +4 -4
- package/dist/cjs/xpl-toolbar.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +11 -5
- package/dist/collection/components/xpl-accordion/xpl-accordion.js +2 -2
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +1 -1
- package/dist/collection/components/xpl-avatar/avatar.stories.js +122 -107
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +249 -15
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
- package/dist/collection/components/xpl-badge/badge.stories.js +1 -33
- package/dist/collection/components/xpl-badge/xpl-badge.js +1 -1
- package/dist/collection/components/xpl-banner/xpl-banner.js +4 -3
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +1 -1
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +1 -1
- package/dist/collection/components/xpl-button/xpl-button.js +21 -3
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +1 -1
- package/dist/collection/components/xpl-calendar/xpl-calendar.js +1 -1
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +25 -3
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +1 -1
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +1 -1
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +1 -1
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +2 -2
- package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +77 -7
- package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +1 -1
- package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +2 -2
- package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +2 -2
- package/dist/collection/components/xpl-grid/xpl-grid.js +1 -1
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
- package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +1 -1
- package/dist/collection/components/xpl-icon/xpl-icon.js +2 -2
- package/dist/collection/components/xpl-input/input.stories.js +96 -1
- package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +8 -8
- package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +3 -3
- package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +4 -4
- package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +5 -5
- package/dist/collection/components/xpl-input/xpl-input-search/xpl-input-search.js +485 -0
- package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +2 -2
- package/dist/collection/components/xpl-input/xpl-input.js +130 -18
- package/dist/collection/components/xpl-large-card/xpl-large-card.js +1 -1
- package/dist/collection/components/xpl-list/list.stories.js +300 -63
- package/dist/collection/components/xpl-list/xpl-list-item/xpl-list-item.js +818 -0
- package/dist/collection/components/xpl-list/xpl-list.js +579 -21
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +1 -1
- package/dist/collection/components/xpl-modal/xpl-modal.js +1 -1
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +2 -2
- package/dist/collection/components/xpl-pagination/pagination.stories.js +18 -0
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +7 -3
- package/dist/collection/components/xpl-panel/panel.stories.js +5 -3
- package/dist/collection/components/xpl-panel/xpl-panel.js +3 -3
- package/dist/collection/components/xpl-popover/xpl-popover.js +4 -4
- package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +2 -2
- package/dist/collection/components/xpl-progress-indicator/progress-indicator.stories.js +118 -0
- package/dist/collection/components/xpl-progress-indicator/xpl-progress-indicator.js +171 -0
- package/dist/collection/components/xpl-radio/xpl-radio.js +3 -3
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +1 -1
- package/dist/collection/components/xpl-select/xpl-select.js +58 -6
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +2 -2
- package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +2 -2
- package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +1 -1
- package/dist/collection/components/xpl-slideout/xpl-slideout.js +1 -1
- package/dist/collection/components/xpl-spotlight/spotlight.stories.js +385 -0
- package/dist/collection/components/xpl-spotlight/xpl-spotlight.js +1085 -0
- package/dist/collection/components/xpl-tab/xpl-tab.js +261 -8
- package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +22 -15
- package/dist/collection/components/xpl-table/xpl-table.js +5 -5
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +1 -1
- package/dist/collection/components/xpl-tabs/segment-control.stories.js +31 -0
- package/dist/collection/components/xpl-tabs/tabs.shared.js +156 -0
- package/dist/collection/components/xpl-tabs/tabs.stories.js +10 -60
- package/dist/collection/components/xpl-tabs/xpl-tabs.js +338 -62
- package/dist/collection/components/xpl-tag/tag.stories.js +153 -0
- package/dist/collection/components/xpl-tag/xpl-tag.js +312 -9
- package/dist/collection/components/xpl-toast/xpl-toast.js +2 -2
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +3 -3
- package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +2 -2
- package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +1 -1
- package/dist/collection/components/xpl-top-nav/top-nav.stories.js +625 -0
- package/dist/collection/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.js +122 -0
- package/dist/collection/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.js +481 -0
- package/dist/collection/components/xpl-top-nav/xpl-top-nav.js +433 -0
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +1 -1
- package/dist/collection/utils/lifecycle.js +79 -0
- package/dist/collection/utils/tab-a11y-ids.js +22 -0
- package/dist/components/floating-ui.dom.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/tab-a11y-ids.js +1 -0
- package/dist/components/xpl-accordion.js +1 -1
- package/dist/components/xpl-application-shell.js +1 -1
- package/dist/components/xpl-avatar2.js +1 -1
- package/dist/components/xpl-backdrop2.js +1 -1
- package/dist/components/xpl-badge2.js +1 -1
- package/dist/components/xpl-banner.js +1 -1
- package/dist/components/xpl-breadcrumb-item.js +1 -1
- package/dist/components/xpl-breadcrumbs.js +1 -1
- package/dist/components/xpl-button-row.js +1 -1
- package/dist/components/xpl-button2.js +1 -1
- package/dist/components/xpl-calendar.js +1 -1
- package/dist/components/xpl-checkbox2.js +1 -1
- package/dist/components/xpl-choicelist.js +1 -1
- package/dist/components/xpl-content-area.js +1 -1
- package/dist/components/xpl-dashboard.js +1 -1
- package/dist/components/xpl-data-card.js +1 -1
- package/dist/components/xpl-divider2.js +1 -1
- package/dist/components/xpl-dropdown-group2.js +1 -1
- package/dist/components/xpl-dropdown-heading2.js +1 -1
- package/dist/components/xpl-dropdown-option2.js +1 -1
- package/dist/components/xpl-dropdown2.js +1 -1
- package/dist/components/xpl-dynamic-table-cell.js +1 -1
- package/dist/components/xpl-dynamic-table-row.js +1 -1
- package/dist/components/xpl-dynamic-table.js +1 -1
- package/dist/components/xpl-grid-item.js +1 -1
- package/dist/components/xpl-grid.js +1 -1
- package/dist/components/xpl-header-accordion.js +1 -1
- package/dist/components/xpl-icon2.js +1 -1
- package/dist/components/xpl-input-date2.js +1 -1
- package/dist/components/xpl-input-file2.js +1 -1
- package/dist/components/xpl-input-search.d.ts +11 -0
- package/dist/components/xpl-input-search.js +1 -0
- package/dist/components/xpl-input-search2.js +1 -0
- package/dist/components/xpl-input2.js +1 -1
- package/dist/components/xpl-large-card.js +1 -1
- package/dist/components/{xpl-progress.d.ts → xpl-list-item.d.ts} +4 -4
- package/dist/components/xpl-list-item.js +1 -0
- package/dist/components/xpl-list-item2.js +1 -0
- package/dist/components/xpl-list.js +1 -1
- package/dist/components/xpl-main-nav.js +1 -1
- package/dist/components/xpl-modal.js +1 -1
- package/dist/components/xpl-nav-header-menu.d.ts +11 -0
- package/dist/components/xpl-nav-header-menu.js +1 -0
- package/dist/components/xpl-nav-item.js +1 -1
- package/dist/components/xpl-pagination.js +1 -1
- package/dist/components/xpl-panel.js +1 -1
- package/dist/components/xpl-popover2.js +1 -1
- package/dist/components/xpl-progress-bar.js +1 -1
- package/dist/components/xpl-progress-indicator.d.ts +11 -0
- package/dist/components/xpl-progress-indicator.js +1 -0
- package/dist/components/xpl-radio2.js +1 -1
- package/dist/components/xpl-secondary-nav.js +1 -1
- package/dist/components/xpl-select2.js +1 -1
- package/dist/components/xpl-side-nav-item.js +1 -1
- package/dist/components/xpl-side-nav.js +1 -1
- package/dist/components/xpl-skeleton.js +1 -1
- package/dist/components/xpl-slideout.js +1 -1
- package/dist/components/xpl-spotlight.d.ts +11 -0
- package/dist/components/xpl-spotlight.js +1 -0
- package/dist/components/xpl-tab-panel.js +1 -1
- package/dist/components/xpl-tab.js +1 -1
- package/dist/components/xpl-table-header.js +1 -1
- package/dist/components/xpl-table.js +1 -1
- package/dist/components/xpl-tabs.js +1 -1
- package/dist/components/xpl-tag2.js +1 -1
- package/dist/components/xpl-toast.js +1 -1
- package/dist/components/xpl-toggle.js +1 -1
- package/dist/components/xpl-toolbar.js +1 -1
- package/dist/components/xpl-tooltip2.js +1 -1
- package/dist/components/xpl-top-nav-item.d.ts +11 -0
- package/dist/components/xpl-top-nav-item.js +1 -0
- package/dist/components/xpl-top-nav-item2.js +1 -0
- package/dist/components/xpl-top-nav.d.ts +11 -0
- package/dist/components/xpl-top-nav.js +1 -0
- package/dist/components/xpl-utility-bar.js +1 -1
- package/dist/docs/xpl-avatar/readme.md +289 -15
- package/dist/docs/xpl-badge/readme.md +14 -9
- package/dist/docs/xpl-banner/readme.md +48 -11
- package/dist/docs/xpl-button/readme.md +28 -18
- package/dist/docs/xpl-calendar/readme.md +1 -1
- package/dist/docs/xpl-checkbox/readme.md +12 -11
- package/dist/docs/xpl-divider/readme.md +6 -4
- package/dist/docs/xpl-dropdown/readme.md +14 -12
- package/dist/docs/xpl-icon/readme.md +14 -2
- package/dist/docs/xpl-input/readme.md +66 -41
- package/dist/docs/xpl-input/xpl-input-color/readme.md +1 -0
- package/dist/docs/xpl-input/xpl-input-phone/readme.md +1 -0
- package/dist/docs/xpl-input/xpl-input-search/readme.md +175 -0
- package/dist/docs/xpl-input/xpl-input-time/readme.md +1 -0
- package/dist/docs/xpl-list/readme.md +320 -10
- package/dist/docs/xpl-list/xpl-list-item/readme.md +99 -0
- package/dist/docs/xpl-pagination/readme.md +1 -0
- package/dist/docs/xpl-panel/readme.md +108 -17
- package/dist/docs/xpl-popover/readme.md +2 -0
- package/dist/docs/xpl-progress-indicator/readme.md +234 -0
- package/dist/docs/xpl-radio/readme.md +6 -4
- package/dist/docs/xpl-select/readme.md +19 -16
- package/dist/docs/xpl-side-nav/readme.md +2 -2
- package/dist/docs/xpl-slideout/readme.md +1 -1
- package/dist/docs/xpl-spotlight/readme.md +235 -0
- package/dist/docs/xpl-tab/readme.md +43 -7
- package/dist/docs/xpl-tab-panel/readme.md +42 -0
- package/dist/docs/xpl-tabs/readme.md +62 -8
- package/dist/docs/xpl-tag/readme.md +379 -4
- package/dist/docs/xpl-toast/readme.md +1 -1
- package/dist/docs/xpl-top-nav/readme.md +179 -0
- package/dist/docs/xpl-top-nav/xpl-nav-header-menu/readme.md +81 -0
- package/dist/docs/xpl-top-nav/xpl-top-nav-item/readme.md +87 -0
- package/dist/esm/apollo-core.js +4 -4
- package/dist/esm/{index-C_Z2nG0p.js → index-C7bgJs6C.js} +18 -8
- package/dist/esm/loader.js +3 -3
- package/dist/esm/xpl-accordion.entry.js +3 -3
- package/dist/esm/xpl-application-shell.entry.js +2 -2
- package/dist/esm/{xpl-avatar_47.entry.js → xpl-avatar_54.entry.js} +3719 -536
- package/dist/esm/xpl-button-row.entry.js +2 -2
- package/dist/esm/xpl-calendar.entry.js +2 -2
- package/dist/esm/xpl-dynamic-table-cell.entry.js +3 -3
- package/dist/esm/xpl-dynamic-table-row.entry.js +3 -3
- package/dist/esm/xpl-dynamic-table.entry.js +2 -2
- package/dist/esm/xpl-grid-item.entry.js +2 -2
- package/dist/esm/xpl-grid.entry.js +2 -2
- package/dist/esm/xpl-large-card.entry.js +2 -2
- package/dist/esm/xpl-main-nav.entry.js +2 -2
- package/dist/esm/xpl-table-header-cell.entry.js +1 -1
- package/dist/esm/xpl-table-header.entry.js +2 -2
- package/dist/esm/xpl-toggle.entry.js +4 -4
- package/dist/esm/xpl-toolbar.entry.js +3 -3
- package/dist/types/components/xpl-avatar/avatar.stories.d.ts +88 -29
- package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +29 -2
- package/dist/types/components/xpl-badge/badge.stories.d.ts +0 -19
- package/dist/types/components/xpl-button/xpl-button.d.ts +7 -0
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +2 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +5 -0
- package/dist/types/components/xpl-input/input.stories.d.ts +1 -0
- package/dist/types/components/xpl-input/xpl-input-search/xpl-input-search.d.ts +39 -0
- package/dist/types/components/xpl-input/xpl-input.d.ts +13 -5
- package/dist/types/components/xpl-list/list.stories.d.ts +299 -13
- package/dist/types/components/xpl-list/listitem.d.ts +13 -0
- package/dist/types/components/xpl-list/xpl-list-item/xpl-list-item.d.ts +71 -0
- package/dist/types/components/xpl-list/xpl-list.d.ts +55 -2
- package/dist/types/components/xpl-pagination/pagination.stories.d.ts +13 -0
- package/dist/types/components/xpl-panel/panel.stories.d.ts +2 -0
- package/dist/types/components/xpl-progress-indicator/progress-indicator.stories.d.ts +62 -0
- package/dist/types/components/xpl-progress-indicator/xpl-progress-indicator.d.ts +11 -0
- package/dist/types/components/xpl-select/xpl-select.d.ts +3 -0
- package/dist/types/components/xpl-spotlight/spotlight.stories.d.ts +197 -0
- package/dist/types/components/xpl-spotlight/xpl-spotlight.d.ts +101 -0
- package/dist/types/components/xpl-tab/xpl-tab.d.ts +14 -1
- package/dist/types/components/xpl-tab-panel/xpl-tab-panel.d.ts +2 -1
- package/dist/types/components/xpl-tabs/segment-control.stories.d.ts +112 -0
- package/dist/types/components/xpl-tabs/tabs.shared.d.ts +156 -0
- package/dist/types/components/xpl-tabs/tabs.stories.d.ts +65 -12
- package/dist/types/components/xpl-tabs/xpl-tabs.d.ts +37 -18
- package/dist/types/components/xpl-tag/tag.stories.d.ts +65 -0
- package/dist/types/components/xpl-tag/xpl-tag.d.ts +36 -1
- package/dist/types/components/xpl-top-nav/top-nav.stories.d.ts +471 -0
- package/dist/types/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.d.ts +18 -0
- package/dist/types/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.d.ts +48 -0
- package/dist/types/components/xpl-top-nav/xpl-top-nav.d.ts +51 -0
- package/dist/types/components.d.ts +1521 -83
- package/dist/types/utils/lifecycle.d.ts +16 -0
- package/dist/types/utils/tab-a11y-ids.d.ts +4 -0
- package/package.json +12 -3
- package/dist/apollo-core/p-0bce3874.entry.js +0 -1
- package/dist/apollo-core/p-1fd3dc87.entry.js +0 -1
- package/dist/apollo-core/p-56fa4941.entry.js +0 -1
- package/dist/apollo-core/p-76c324da.entry.js +0 -1
- package/dist/apollo-core/p-7a3224b4.entry.js +0 -1
- package/dist/apollo-core/p-7e924697.entry.js +0 -1
- package/dist/apollo-core/p-9efca9e1.entry.js +0 -1
- package/dist/apollo-core/p-b252b380.entry.js +0 -1
- package/dist/apollo-core/p-c91daac1.entry.js +0 -1
- package/dist/apollo-core/p-d9b62508.entry.js +0 -1
- package/dist/apollo-core/p-eaea16d1.entry.js +0 -1
- package/dist/apollo-core/p-eed13bca.entry.js +0 -1
- package/dist/cjs/xpl-list.cjs.entry.js +0 -32
- package/dist/collection/components/xpl-progress/progress.stories.js +0 -106
- package/dist/collection/components/xpl-progress/xpl-progress.js +0 -60
- package/dist/components/xpl-progress.js +0 -1
- package/dist/docs/xpl-progress/readme.md +0 -22
- package/dist/esm/xpl-list.entry.js +0 -30
- package/dist/types/components/xpl-progress/progress.stories.d.ts +0 -38
- package/dist/types/components/xpl-progress/xpl-progress.d.ts +0 -6
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# xpl-spotlight
|
|
2
|
+
|
|
3
|
+
`xpl-spotlight` renders a guided-tour callout with an anchor dot, optional media, step messaging, and prop-driven footer actions. It can either render inline using the requested `anchorPosition` or attach to a target element with Floating UI when `target` is provided.
|
|
4
|
+
|
|
5
|
+
## Usage Examples
|
|
6
|
+
|
|
7
|
+
Use the built-in title/body props and default actions for a simple tour step:
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<xpl-spotlight
|
|
11
|
+
heading="Review recent activity"
|
|
12
|
+
body="Check status updates here before moving to the next step."
|
|
13
|
+
action-layout="default"
|
|
14
|
+
anchor-position="top-right"
|
|
15
|
+
current-step="2"
|
|
16
|
+
total-steps="5"
|
|
17
|
+
is-dismissible="true"
|
|
18
|
+
is-open="true"
|
|
19
|
+
primary-action-label="Next"
|
|
20
|
+
secondary-action-label="Back"
|
|
21
|
+
show-actions="true"
|
|
22
|
+
show-image="true"
|
|
23
|
+
show-steps="true"
|
|
24
|
+
target=""
|
|
25
|
+
></xpl-spotlight>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Anchor the spotlight to a specific element and provide custom media content:
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<button id="dashboard-filter-button" type="button">Filters</button>
|
|
32
|
+
|
|
33
|
+
<xpl-spotlight
|
|
34
|
+
target="#dashboard-filter-button"
|
|
35
|
+
heading="Narrow the results"
|
|
36
|
+
body="Use filters to focus on the accounts or activity that matter most."
|
|
37
|
+
current-step="1"
|
|
38
|
+
total-steps="3"
|
|
39
|
+
primary-action-label="Next"
|
|
40
|
+
secondary-action-label="Skip"
|
|
41
|
+
>
|
|
42
|
+
<div slot="image">
|
|
43
|
+
<img src="/assets/spotlight-filter-preview.png" alt="Preview of filter controls" />
|
|
44
|
+
</div>
|
|
45
|
+
</xpl-spotlight>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
Control visibility from the parent with `is-open` and close it by responding to `dismiss`:
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<xpl-spotlight
|
|
53
|
+
id="guided-tour-step"
|
|
54
|
+
is-open="true"
|
|
55
|
+
heading="Review recent activity"
|
|
56
|
+
body="Check status updates here before moving to the next step."
|
|
57
|
+
></xpl-spotlight>
|
|
58
|
+
|
|
59
|
+
<script>
|
|
60
|
+
const spotlight = document.getElementById('guided-tour-step');
|
|
61
|
+
|
|
62
|
+
spotlight?.addEventListener('dismiss', () => {
|
|
63
|
+
spotlight.setAttribute('is-open', 'false');
|
|
64
|
+
});
|
|
65
|
+
</script>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Mirror the same layout in plain HTML when documenting or prototyping the component structure outside the custom element:
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<div class="xpl-spotlight xpl-spotlight--top-left xpl-spotlight--visible"
|
|
72
|
+
role="dialog" aria-modal="false" aria-labelledby="spotlight-title" tabindex="-1">
|
|
73
|
+
<button type="button" class="xpl-spotlight__target" aria-label="Spotlight indicator">
|
|
74
|
+
<div class="xpl-spotlight__target-outer"></div>
|
|
75
|
+
<div class="xpl-spotlight__target-inner"></div>
|
|
76
|
+
</button>
|
|
77
|
+
<div class="xpl-spotlight__dismiss">
|
|
78
|
+
<xpl-button variant="secondary" size="sm" icon-only aria-label="Dismiss tour step">
|
|
79
|
+
<xpl-icon icon="xmark" size="16"></xpl-icon>
|
|
80
|
+
</xpl-button>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="xpl-spotlight__frame">
|
|
83
|
+
<div class="xpl-spotlight__image-container">
|
|
84
|
+
<img src="/assets/spotlight-preview.png" alt="Feature preview" />
|
|
85
|
+
</div>
|
|
86
|
+
<div class="xpl-spotlight__content">
|
|
87
|
+
<div class="xpl-spotlight__header">
|
|
88
|
+
<span class="xpl-spotlight__title" id="spotlight-title">Tour Title</span>
|
|
89
|
+
<p class="xpl-spotlight__body">Copy about the feature and/or functionality the dot is pointing to.</p>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="xpl-spotlight__actions xpl-spotlight__actions--dual xpl-spotlight__actions--with-steps">
|
|
92
|
+
<div class="xpl-spotlight__action-slot xpl-spotlight__action-slot--secondary">
|
|
93
|
+
<xpl-button variant="secondary">Back</xpl-button>
|
|
94
|
+
</div>
|
|
95
|
+
<span class="xpl-spotlight__step-text">2 of 5</span>
|
|
96
|
+
<div class="xpl-spotlight__action-slot xpl-spotlight__action-slot--primary">
|
|
97
|
+
<xpl-button variant="primary">Next</xpl-button>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Accessibility
|
|
106
|
+
|
|
107
|
+
`xpl-spotlight` renders with `role="dialog"` and `aria-modal="false"` so assistive technologies treat it as a **non-modal** tour callout: focus is not trapped inside the card, and users can tab to the rest of the page while the step is open. The accessible name comes from the title region:
|
|
108
|
+
|
|
109
|
+
- When the default title is used, the generated heading element receives the internal `aria-labelledby` id.
|
|
110
|
+
- When a custom `title` slot is provided, the component assigns that same id to the first slotted title element if it does not already have one. If the slotted element already has an `id`, that value is kept and `aria-labelledby` references it (the host does not point at a missing id).
|
|
111
|
+
- When neither a `heading` prop nor a `title` slot is provided, the dialog falls back to `aria-label="Tour step"` so that assistive technologies always have an accessible name.
|
|
112
|
+
|
|
113
|
+
### Keyboard navigation
|
|
114
|
+
|
|
115
|
+
| Key | Behavior |
|
|
116
|
+
|-----|----------|
|
|
117
|
+
| `Tab` / `Shift+Tab` | Moves focus between interactive controls (dismiss button, secondary action, primary action). Focus is **not** trapped — users can tab out of the spotlight to the rest of the page. |
|
|
118
|
+
| `Escape` | Emits `dismiss` when `isDismissible` is true and focus is inside the spotlight. Does nothing when focus is outside the component or the spotlight is closed. |
|
|
119
|
+
| `Enter` / `Space` | Activates the focused button (dismiss, primary, or secondary action) via standard `xpl-button` behavior. |
|
|
120
|
+
|
|
121
|
+
### Focus management
|
|
122
|
+
|
|
123
|
+
- **On open:** focus moves automatically to the dismiss button (if `isDismissible` is true) or the first action button. When neither a dismiss button nor action buttons are rendered, the host element itself receives focus via `tabindex="-1"`.
|
|
124
|
+
- **On close:** focus returns to the element that was focused before the spotlight opened, provided that element is still in the DOM.
|
|
125
|
+
- The decorative anchor dot (`.xpl-spotlight__target`) is marked `aria-hidden="true"` so it is not announced or focusable.
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
## Design Tokens
|
|
129
|
+
|
|
130
|
+
The component relies on Foundation purpose tokens in `spotlight.css` so light/dark mode works without component-level `.dark` overrides.
|
|
131
|
+
|
|
132
|
+
| Property | Token |
|
|
133
|
+
|----------|-------|
|
|
134
|
+
| Card width | `var(--xpl-spotlight-width)` on the host (defined in `spotlight.css`; design-specific width until shared layout tokens exist — see `TECH_DEBT.md`) |
|
|
135
|
+
| Image region min-height | `var(--xpl-spotlight-image-min-height)` on `.xpl-spotlight__image-container` (same note as card width) |
|
|
136
|
+
| Card background | `var(--xpl-background-surface-default)` |
|
|
137
|
+
| Host stacking | `var(--xpl-z-index-800)` |
|
|
138
|
+
| Placeholder pattern | `var(--xpl-background-surface-subtle)` |
|
|
139
|
+
| Heading text | `var(--xpl-text-default)` |
|
|
140
|
+
| Body text | `var(--xpl-text-default)` |
|
|
141
|
+
| Step text | `var(--xpl-text-subdued)` |
|
|
142
|
+
| Open/closed visibility | `opacity` transition on `.xpl-spotlight--visible` |
|
|
143
|
+
| Anchor outer ring | `var(--xpl-background-surface-information-bold)` |
|
|
144
|
+
| Anchor inner dot | `var(--xpl-background-accent-default)` |
|
|
145
|
+
| Image placeholder icon/text | `var(--xpl-icon-subtle)` |
|
|
146
|
+
| Focus outline | `var(--xpl-border-focus)` |
|
|
147
|
+
| Anchored host (when `target` is set) | `position: fixed` via `.xpl-spotlight--anchored`; `left` / `top` set from Floating UI (`strategy: 'fixed'`) |
|
|
148
|
+
|
|
149
|
+
## Icon Mapping
|
|
150
|
+
|
|
151
|
+
`xpl-spotlight` uses Apollo icons for fixed controls and fallback media placeholders:
|
|
152
|
+
|
|
153
|
+
| UI area | `xpl-icon` name |
|
|
154
|
+
|---------|------------------|
|
|
155
|
+
| Dismiss button | `xmark` |
|
|
156
|
+
| Empty image placeholder, image affordance | `photo` |
|
|
157
|
+
| Empty image placeholder, video affordance | `video` |
|
|
158
|
+
|
|
159
|
+
## Deprecated props
|
|
160
|
+
|
|
161
|
+
None.
|
|
162
|
+
|
|
163
|
+
## Notes
|
|
164
|
+
|
|
165
|
+
- `showImage="false"` hides the media region even if `slot="image"` content is present.
|
|
166
|
+
- When `showImage` is left enabled and no `slot="image"` content is provided, the component renders the built-in placeholder instead of collapsing the media region.
|
|
167
|
+
- `showActions="false"` removes the default actions row entirely.
|
|
168
|
+
- `is-open="false"` keeps the host element mounted but renders no spotlight UI until it is opened again.
|
|
169
|
+
- `action-layout` defaults to `"default"`. `action-layout="default"` renders the Back/Next pair with **disabled** edge buttons at step boundaries (Back disabled on step 1, Next disabled on the last step). `action-layout="dual"` renders the Back/Next pair with **hidden** edge buttons at step boundaries. `action-layout="single"` renders a single primary action.
|
|
170
|
+
- `primary-action-label` and `secondary-action-label` control the default button text without needing action slots.
|
|
171
|
+
- `target` enables Floating UI positioning with `offset`, `flip`, `shift`, and `autoUpdate` so the spotlight follows the referenced element on resize and scroll. Default offset and shift padding match Foundation spacing (`--xpl-space-12` / `--xpl-space-8`).
|
|
172
|
+
- If `target` is missing or contains an invalid CSS selector, the component safely falls back to the requested `anchor-position` instead of throwing.
|
|
173
|
+
- **Storybook:** open **Components → Spotlight** to adjust props via controls. Set `target` to `#spotlight-story-anchor` to preview Floating UI anchoring against the demo button on the canvas. The **Design** addon links to the Apollo Web Figma file (replace the `node-id` in Storybook with the Spotlight frame when Design publishes a dedicated link).
|
|
174
|
+
|
|
175
|
+
<!-- Auto Generated Below -->
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## Properties
|
|
179
|
+
|
|
180
|
+
| Property | Attribute | Description | Type | Default |
|
|
181
|
+
| ---------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------ |
|
|
182
|
+
| `actionLayout` | `action-layout` | Footer action layout. `default` and `dual` both render the standard Back/Next layout, while `single` renders a single acknowledgement CTA (e.g. "Got it!"). Only applies when `showActions` is `true`. | `"default" \| "dual" \| "single"` | `'default'` |
|
|
183
|
+
| `anchorPosition` | `anchor-position` | Which corner of the card the anchor dot uses when not using `target`, or as the preferred side for Floating UI. | `"bottom-left" \| "bottom-right" \| "top-left" \| "top-right"` | `'top-left'` |
|
|
184
|
+
| `body` | `body` | Body copy when the `body` slot has no slotted content. Whitespace-only values are treated as empty (no fallback paragraph). | `string` | `undefined` |
|
|
185
|
+
| `currentStep` | `current-step` | Current step index (1-based). Used with `totalSteps` for the step label and for disabling default Back/Next when `showSteps` is true. | `number` | `1` |
|
|
186
|
+
| `heading` | `heading` | Heading when the `title` slot has no slotted content. Whitespace-only values are treated as empty (no fallback title span). | `string` | `undefined` |
|
|
187
|
+
| `isDismissible` | `is-dismissible` | Whether to show the dismiss (close) control. | `boolean` | `true` |
|
|
188
|
+
| `isOpen` | `is-open` | Controls whether the spotlight is rendered. When false, the host remains in the DOM but the spotlight UI is hidden. | `boolean` | `true` |
|
|
189
|
+
| `primaryActionLabel` | `primary-action-label` | Label used for the default primary action button. Only applies when `showActions` is `true`. | `string` | `'Next'` |
|
|
190
|
+
| `secondaryActionLabel` | `secondary-action-label` | Label used for the default secondary action button. Only applies when `showActions` is `true`. | `string` | `'Back'` |
|
|
191
|
+
| `showActions` | `show-actions` | Whether to show the actions row (primary / secondary and optional step counter). When `false`, the spotlight has no action buttons — useful for single-step informational callouts that rely solely on the dismiss control. | `boolean` | `true` |
|
|
192
|
+
| `showImage` | `show-image` | When true, the media region is shown. Slotted `image` content is rendered when present; otherwise the built-in placeholder UI is shown. When false, the entire media block is hidden. | `boolean` | `true` |
|
|
193
|
+
| `showSteps` | `show-steps` | Whether to show the step counter between actions (`currentStep` of `totalSteps`) and whether default Back/Next use step-based disabled state. | `boolean` | `true` |
|
|
194
|
+
| `target` | `target` | CSS selector for the element this spotlight anchors to. When set, placement uses Floating UI (`computePosition` with `strategy: 'fixed'`, plus `flip`, `shift`, `offset`) and `autoUpdate` for scroll/resize. The host receives `left` / `top` and the `xpl-spotlight--anchored` class. Invalid selectors are ignored; layout falls back to `anchor-position`. | `string` | `undefined` |
|
|
195
|
+
| `totalSteps` | `total-steps` | Total number of steps (1-based upper bound). Used with `currentStep` for the step label and for disabling default Back/Next when `showSteps` is true. | `number` | `1` |
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## Events
|
|
199
|
+
|
|
200
|
+
| Event | Description | Type |
|
|
201
|
+
| ----------------- | ---------------------------------------------------------------------------------------------- | ------------------- |
|
|
202
|
+
| `dismiss` | Emitted when the dismiss control is activated or Escape is pressed (when dismissible). | `CustomEvent<void>` |
|
|
203
|
+
| `primaryAction` | Emitted when the primary action control is activated (default: Next). | `CustomEvent<void>` |
|
|
204
|
+
| `secondaryAction` | Emitted when the secondary action control is activated (default: Back). | `CustomEvent<void>` |
|
|
205
|
+
| `targetClick` | Emitted when the target indicator is clicked. Consumers typically toggle `isOpen` in response. | `CustomEvent<void>` |
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
## Slots
|
|
209
|
+
|
|
210
|
+
| Slot | Description |
|
|
211
|
+
| --------- | -------------------------------------------------------------------------------------------------------------- |
|
|
212
|
+
| `"body"` | Main description; falls back to the `body` prop when the slot is empty and `body` has non-whitespace text |
|
|
213
|
+
| `"image"` | Optional media slot. When empty and `showImage` is true, the component renders a built-in placeholder instead. |
|
|
214
|
+
| `"title"` | Step title; falls back to the `heading` prop when the slot is empty and `heading` has non-whitespace text |
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
## Dependencies
|
|
218
|
+
|
|
219
|
+
### Depends on
|
|
220
|
+
|
|
221
|
+
- [xpl-button](../xpl-button)
|
|
222
|
+
- [xpl-icon](../xpl-icon)
|
|
223
|
+
|
|
224
|
+
### Graph
|
|
225
|
+
```mermaid
|
|
226
|
+
graph TD;
|
|
227
|
+
xpl-spotlight --> xpl-button
|
|
228
|
+
xpl-spotlight --> xpl-icon
|
|
229
|
+
xpl-button --> xpl-icon
|
|
230
|
+
style xpl-spotlight fill:#f9f,stroke:#333,stroke-width:4px
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
----------------------------------------------
|
|
234
|
+
|
|
235
|
+
*Built with [StencilJS](https://stenciljs.com/)*
|
|
@@ -1,24 +1,60 @@
|
|
|
1
1
|
# xpl-tab
|
|
2
2
|
|
|
3
|
+
`xpl-tab` is the **label / trigger** for one tab in an `xpl-tabs` group. Place each instance in the **`heading`** slot of `xpl-tabs`. The **`target`** string links this tab to the matching **`xpl-tab-panel`** (same `target` value). The parent sets **`selected`** and syncs **`value`**; you normally do not set `selected` by hand.
|
|
3
4
|
|
|
5
|
+
Underline tabs render a native **`<button role="tab">`**; segment tabs render **`xpl-button`** with the same tab semantics on the inner control. For variant-specific examples, icon usage, and token tables, see the matching section on the **Tabs** or **Segment control** Storybook page.
|
|
6
|
+
|
|
7
|
+
**`group-disabled`** is applied by `xpl-tabs` when the group has **`disabled`**; it keeps pills and underline buttons in a disabled state together with the parent.
|
|
8
|
+
|
|
9
|
+
## Accessibility
|
|
10
|
+
|
|
11
|
+
- **IDs and ARIA:** With a parent **`xpl-tabs`**, the tab control and matching **`xpl-tab-panel`** share scoped DOM ids derived from **`data-tabs-instance-id`** on the group and each pair’s **`target`** (see **`xpl-tabs`** accessibility notes). Underline tabs set **`id`**, **`role="tab"`**, **`aria-controls`**, and **`aria-selected`** on the native `<button>`. Segment tabs wrap **`xpl-button`**, which forwards **`id`**, **`role`**, and **`aria-*`** attributes to its inner `<button>` so focus and **`aria-labelledby`** stay correct.
|
|
12
|
+
- Underline tabs expose a **single focusable button** per tab.
|
|
13
|
+
- Segment tabs delegate rendering to **`xpl-button`** with the same tab semantics as underline mode; activation follows the same **`tabChange`** event.
|
|
14
|
+
- Disabled tabs are skipped when moving with arrow keys.
|
|
4
15
|
|
|
5
16
|
<!-- Auto Generated Below -->
|
|
6
17
|
|
|
7
18
|
|
|
8
19
|
## Properties
|
|
9
20
|
|
|
10
|
-
| Property
|
|
11
|
-
|
|
|
12
|
-
| `
|
|
13
|
-
| `
|
|
21
|
+
| Property | Attribute | Description | Type | Default |
|
|
22
|
+
| --------------- | --------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------ | ----------- |
|
|
23
|
+
| `disabled` | `disabled` | Disables this tab (pill or underline). | `boolean` | `false` |
|
|
24
|
+
| `groupDisabled` | `data-group-disabled` | Set when the parent `xpl-tabs` has `disabled` (group-disabled). | `boolean` | `false` |
|
|
25
|
+
| `icon` | `icon` | Optional icon name for segment-style pills (`type="segment"` on parent `xpl-tabs`). Ignored for default tabs. | `string` | `undefined` |
|
|
26
|
+
| `iconPosition` | `icon-position` | Icon position for segment-style pills. | `"end" \| "start"` | `'start'` |
|
|
27
|
+
| `selected` | `selected` | Whether the tab is selected | `boolean` | `false` |
|
|
28
|
+
| `target` | `target` | The target of the tab, required for the tab to be selected | `string` | `undefined` |
|
|
14
29
|
|
|
15
30
|
|
|
16
31
|
## Events
|
|
17
32
|
|
|
18
|
-
| Event | Description
|
|
19
|
-
| ----------- |
|
|
20
|
-
| `tabChange` |
|
|
33
|
+
| Event | Description | Type |
|
|
34
|
+
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
|
|
35
|
+
| `tabChange` | Emitted when this tab is activated (if not disabled). The event `detail` is this tab’s `target` string. Parent `xpl-tabs` listens and updates selection; use `tabChange` on `xpl-tabs` for the group-level event. | `CustomEvent<string>` |
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Slots
|
|
39
|
+
|
|
40
|
+
| Slot | Description |
|
|
41
|
+
| ---- | ---------------------------------------------------------------------------------- |
|
|
42
|
+
| | The label for the tab (or pill label when parent `xpl-tabs` has `type="segment"`). |
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Dependencies
|
|
46
|
+
|
|
47
|
+
### Depends on
|
|
48
|
+
|
|
49
|
+
- [xpl-button](../xpl-button)
|
|
21
50
|
|
|
51
|
+
### Graph
|
|
52
|
+
```mermaid
|
|
53
|
+
graph TD;
|
|
54
|
+
xpl-tab --> xpl-button
|
|
55
|
+
xpl-button --> xpl-icon
|
|
56
|
+
style xpl-tab fill:#f9f,stroke:#333,stroke-width:4px
|
|
57
|
+
```
|
|
22
58
|
|
|
23
59
|
----------------------------------------------
|
|
24
60
|
|
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
# xpl-tab-panel
|
|
2
2
|
|
|
3
|
+
`xpl-tab-panel` is the **content region** for one tab. Place each panel in the **`panel`** slot of `xpl-tabs` and set **`target`** to the same string as its paired **`xpl-tab`**. Only the panel whose `target` matches the group’s selection is visible; others stay hidden via CSS until selected.
|
|
3
4
|
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- One panel per tab in the same `xpl-tabs` as the corresponding `xpl-tab`.
|
|
8
|
+
- Put any markup or other components in the **default slot** (panel body).
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```html
|
|
13
|
+
<xpl-tabs value="overview">
|
|
14
|
+
<xpl-tab slot="heading" target="overview">Overview</xpl-tab>
|
|
15
|
+
<xpl-tab slot="heading" target="activity">Activity</xpl-tab>
|
|
16
|
+
<xpl-tab-panel slot="panel" target="overview">
|
|
17
|
+
<p class="xpl-text-body">Overview content.</p>
|
|
18
|
+
</xpl-tab-panel>
|
|
19
|
+
<xpl-tab-panel slot="panel" target="activity">
|
|
20
|
+
<p class="xpl-text-body">Activity content.</p>
|
|
21
|
+
</xpl-tab-panel>
|
|
22
|
+
</xpl-tabs>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The parent **`xpl-tabs`** updates each panel’s **`selected`** state from **`value`** / user interaction; consumers typically only set **`target`** and slot content.
|
|
26
|
+
|
|
27
|
+
## Accessibility
|
|
28
|
+
|
|
29
|
+
- The host sets **`role="tabpanel"`**, a stable **`id`** (`…-panel-<target>` scoped by the parent **`xpl-tabs`** instance), and **`aria-labelledby`** referencing the paired tab control’s **`id`**. Use the same **`target`** on **`xpl-tab`** and **`xpl-tab-panel`** so the references stay aligned (see **`xpl-tabs`** accessibility section for the full id pattern).
|
|
30
|
+
- Hidden panels use display toggling (`xpl-tab-panel` / `--selected` in `tabs.css`), not `aria-hidden` on the host; panel content stays in the DOM for simpler state sync.
|
|
31
|
+
|
|
32
|
+
## Token use
|
|
33
|
+
|
|
34
|
+
| Part | Token / approach |
|
|
35
|
+
| ---- | ---------------- |
|
|
36
|
+
| Panel visibility | `tabs.css`: hidden unless `xpl-tab-panel--selected` (`display` via Tailwind `@apply`) |
|
|
37
|
+
| Default padding | `py-6` in `tabs.css` on `.xpl-tab-panel` |
|
|
38
|
+
| Inner content | Use typography classes (`xpl-text-body`, etc.) and Foundation tokens as elsewhere in Apollo |
|
|
4
39
|
|
|
5
40
|
<!-- Auto Generated Below -->
|
|
6
41
|
|
|
@@ -13,6 +48,13 @@
|
|
|
13
48
|
| `target` | `target` | The target of the tab, required for the tab to be selected | `string` | `undefined` |
|
|
14
49
|
|
|
15
50
|
|
|
51
|
+
## Slots
|
|
52
|
+
|
|
53
|
+
| Slot | Description |
|
|
54
|
+
| ---- | ------------------------------------- |
|
|
55
|
+
| | Content rendered inside of the panel. |
|
|
56
|
+
|
|
57
|
+
|
|
16
58
|
----------------------------------------------
|
|
17
59
|
|
|
18
60
|
*Built with [StencilJS](https://stenciljs.com/)*
|
|
@@ -1,23 +1,76 @@
|
|
|
1
1
|
# xpl-tabs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`xpl-tabs` groups related views into a single surface: users pick a **tab** to show the matching **panel**. It implements the WAI-ARIA tabs pattern with a horizontal tab list, optional full-width layout, and two visual styles—**underline** (`type="tabs"`, default) and **segment** (`type="segment"`, pill controls in a bordered track)—selected with the **`type`** prop. On narrow viewports the heading row is replaced by an `xpl-select` so the same targets and keyboard behavior stay consistent.
|
|
4
|
+
|
|
5
|
+
The **Tabs** and **Segment control** Storybook entries document this **one component** with different defaults and Figma references. Each page adds variant-specific guidance (when to use, examples, tokens); the sections below describe behavior that is **the same for both** styles.
|
|
6
|
+
|
|
7
|
+
Pair **`xpl-tab` (slot `heading`)** with **`xpl-tab-panel` (slot `panel`)** and use the same **`target`** string on each pair so selection stays in sync.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
### Web component (`<xpl-tabs>`)
|
|
12
|
+
|
|
13
|
+
Minimal group with two tabs: each `xpl-tab` and `xpl-tab-panel` shares a `target` value. Set `value` on `xpl-tabs` to control the selected tab (defaults to the first tab’s `target` if omitted).
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<xpl-tabs value="one">
|
|
17
|
+
<xpl-tab slot="heading" target="one">First</xpl-tab>
|
|
18
|
+
<xpl-tab slot="heading" target="two">Second</xpl-tab>
|
|
19
|
+
<xpl-tab-panel slot="panel" target="one">Content for first tab.</xpl-tab-panel>
|
|
20
|
+
<xpl-tab-panel slot="panel" target="two">Content for second tab.</xpl-tab-panel>
|
|
21
|
+
</xpl-tabs>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Listen for selection changes with the **`tabChange`** event (detail is the selected `target` string):
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<xpl-tabs id="demo" value="a">
|
|
28
|
+
<xpl-tab slot="heading" target="a">A</xpl-tab>
|
|
29
|
+
<xpl-tab slot="heading" target="b">B</xpl-tab>
|
|
30
|
+
<xpl-tab-panel slot="panel" target="a">…</xpl-tab-panel>
|
|
31
|
+
<xpl-tab-panel slot="panel" target="b">…</xpl-tab-panel>
|
|
32
|
+
</xpl-tabs>
|
|
33
|
+
<script>
|
|
34
|
+
document.getElementById('demo').addEventListener('tabChange', (e) => {
|
|
35
|
+
console.log(e.detail); // "a" | "b"
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Disable the entire group (headings, mobile select, and segment pills) with **`disabled`** on `xpl-tabs`. Disable individual tabs with **`disabled`** on `xpl-tab`.
|
|
41
|
+
|
|
42
|
+
### Plain HTML (BEM classes)
|
|
43
|
+
|
|
44
|
+
When styling with `tabs.css` without the Stencil component, mirror the structure: `xpl-tabs`, `xpl-tabs__headings` with `role="tablist"` and `aria-orientation="horizontal"`, `xpl-tabs__active-bar` for the underline variant (position/size normally set by JS), **`button.xpl-tab__button`** with **`role="tab"`** (not links), and **`xpl-tab-panel`** for panels. For **segment** (`xpl-tabs--segment`), each heading is **`xpl-tab.xpl-tab--segment`** wrapping **`xpl-button`** (not `.xpl-tab__button`). On small viewports, include **`xpl-tabs__mobile-select`** with **`xpl-select`** for parity with the component.
|
|
45
|
+
|
|
46
|
+
## Accessibility
|
|
47
|
+
|
|
48
|
+
- Each **`xpl-tabs`** root gets a unique **`data-tabs-instance-id`** (for example `xpl-tg-1`). **`xpl-tab`** and **`xpl-tab-panel`** derive matching DOM **`id`** values from that id plus the shared **`target`** string: the tab control is **`…-tab-<target>`**, the panel is **`…-panel-<target>`** (with `target` sanitized for HTML `id` rules). The tab exposes **`aria-controls`** pointing at the panel id, **`aria-selected`**, and the panel uses **`aria-labelledby`** pointing at the tab id. **Segment (pill) tabs** render **`xpl-button`**; because **`xpl-button`** does not forward **`id`** / **`role`** / **`aria-*`** to its inner `<button>`, **`xpl-tab`** sets those on the native button after render so focus order and **`aria-labelledby`** stay correct (same pattern as underline tabs, different host element).
|
|
49
|
+
- The tab list container is **`role="tablist"`** with **`aria-orientation="horizontal"`**. Underline tabs use **`role="tab"`** on the inner `<button>`; panels use **`role="tabpanel"`** on **`xpl-tab-panel`**.
|
|
50
|
+
- **Roving tabindex:** only the active tab’s control is in the tab order (`tabindex="0"`); others use `tabindex="-1"` until focused with arrows.
|
|
51
|
+
- **Keyboard:** **Arrow Left/Right** (and **Arrow Up/Down** as next/previous), **Home**, and **End** move between enabled tabs; **Enter** and **Space** activate (via `xpl-button` in segment mode). Direction mirrors in **RTL**.
|
|
52
|
+
- When **`disabled`** is set on `xpl-tabs`, tab keyboard navigation and selection are suppressed for the group.
|
|
53
|
+
|
|
54
|
+
Variant-specific Foundation mappings for underline vs. segment live in the **Tabs** and **Segment control** Storybook pages. The **`xpl-select`** mobile row reuses **`xpl-select`** / **`xpl-dropdown`** tokens from those components.
|
|
4
55
|
|
|
5
56
|
<!-- Auto Generated Below -->
|
|
6
57
|
|
|
7
58
|
|
|
8
59
|
## Properties
|
|
9
60
|
|
|
10
|
-
| Property | Attribute | Description
|
|
11
|
-
| ----------- | ------------ |
|
|
12
|
-
| `
|
|
13
|
-
| `
|
|
61
|
+
| Property | Attribute | Description | Type | Default |
|
|
62
|
+
| ----------- | ------------ | ----------------------------------------------------------------------------- | --------------------- | ----------- |
|
|
63
|
+
| `disabled` | `disabled` | Disables the whole tab group (headings, mobile select, and segment pills). | `boolean` | `false` |
|
|
64
|
+
| `fullWidth` | `full-width` | Whether to make the tabs full width | `boolean` | `false` |
|
|
65
|
+
| `type` | `type` | Visual and layout variant: classic underline tabs or segment (pill) controls. | `"segment" \| "tabs"` | `'tabs'` |
|
|
66
|
+
| `value` | `value` | The selected tab target value, defaults to the first tab | `string` | `undefined` |
|
|
14
67
|
|
|
15
68
|
|
|
16
69
|
## Events
|
|
17
70
|
|
|
18
|
-
| Event | Description
|
|
19
|
-
| ----------- |
|
|
20
|
-
| `tabChange` |
|
|
71
|
+
| Event | Description | Type |
|
|
72
|
+
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
|
|
73
|
+
| `tabChange` | Emitted when the selected tab changes (click, keyboard, or mobile `xpl-select`). The event `detail` is the selected tab’s `target` string. Always dispatched from this host (including after heading clicks) so `event.target` is consistent for listeners on `xpl-tabs` or bubbling ancestors. | `CustomEvent<string>` |
|
|
21
74
|
|
|
22
75
|
|
|
23
76
|
## Slots
|
|
@@ -41,6 +94,7 @@ graph TD;
|
|
|
41
94
|
xpl-select --> xpl-tag
|
|
42
95
|
xpl-select --> xpl-icon
|
|
43
96
|
xpl-select --> xpl-dropdown
|
|
97
|
+
xpl-tag --> xpl-icon
|
|
44
98
|
xpl-dropdown --> xpl-dropdown-group
|
|
45
99
|
xpl-dropdown --> xpl-dropdown-option
|
|
46
100
|
xpl-dropdown-group --> xpl-dropdown-group
|