@xplortech/apollo-core 2.5.0 → 2.6.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/.typings/apollo-components.html-data.json +393 -26
- package/build/style.css +4224 -1016
- package/dist/apollo-core/apollo-core.css +18 -27
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-02167464.entry.js +1 -0
- package/dist/apollo-core/p-0bce3874.entry.js +1 -0
- package/dist/apollo-core/{p-0e1877a2.entry.js → p-1fd3dc87.entry.js} +1 -1
- package/dist/apollo-core/{p-0ac33b3a.entry.js → p-42016063.entry.js} +1 -1
- package/dist/apollo-core/p-5549756c.entry.js +1 -0
- package/dist/apollo-core/p-56fa4941.entry.js +1 -0
- package/dist/apollo-core/p-76c324da.entry.js +1 -0
- package/dist/apollo-core/p-7a3224b4.entry.js +1 -0
- package/dist/apollo-core/p-7e924697.entry.js +1 -0
- package/dist/apollo-core/{p-f4c2626d.entry.js → p-8a1affce.entry.js} +1 -1
- package/dist/apollo-core/p-9efca9e1.entry.js +1 -0
- package/dist/apollo-core/p-C_Z2nG0p.js +2 -0
- package/dist/apollo-core/p-b252b380.entry.js +1 -0
- package/dist/apollo-core/p-c91daac1.entry.js +1 -0
- package/dist/apollo-core/p-d9b62508.entry.js +1 -0
- package/dist/apollo-core/p-eaea16d1.entry.js +1 -0
- package/dist/apollo-core/p-eed13bca.entry.js +1 -0
- package/dist/apollo-core/{p-4fab8172.entry.js → p-f5af9539.entry.js} +1 -1
- package/dist/cjs/apollo-core.cjs.js +3 -3
- package/dist/cjs/{index-D__N_vw2.js → index-DH6pgWru.js} +137 -87
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xpl-accordion.cjs.entry.js +5 -5
- package/dist/cjs/xpl-application-shell.cjs.entry.js +4 -4
- package/dist/cjs/{xpl-avatar_41.cjs.entry.js → xpl-avatar_47.cjs.entry.js} +2802 -272
- package/dist/cjs/xpl-button-row.cjs.entry.js +4 -4
- package/dist/cjs/xpl-calendar.cjs.entry.js +4 -4
- package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +5 -5
- package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +5 -5
- package/dist/cjs/xpl-dynamic-table.cjs.entry.js +4 -4
- package/dist/cjs/xpl-grid-item.cjs.entry.js +4 -4
- package/dist/cjs/xpl-grid.cjs.entry.js +4 -4
- package/dist/cjs/xpl-large-card.cjs.entry.js +4 -4
- package/dist/cjs/xpl-list.cjs.entry.js +4 -4
- package/dist/cjs/xpl-main-nav.cjs.entry.js +4 -4
- package/dist/cjs/xpl-table-header-cell.cjs.entry.js +3 -3
- package/dist/cjs/xpl-table-header.cjs.entry.js +4 -4
- package/dist/cjs/xpl-toggle.cjs.entry.js +6 -6
- package/dist/cjs/xpl-toolbar.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +9 -2
- package/dist/collection/components/xpl-accordion/accordion.stories.js +4 -0
- package/dist/collection/components/xpl-accordion/xpl-accordion.js +3 -3
- package/dist/collection/components/xpl-application-shell/application-shell.stories.js +4 -0
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +2 -2
- package/dist/collection/components/xpl-avatar/avatar.stories.js +4 -0
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +3 -3
- package/dist/collection/components/xpl-backdrop/backdrop.stories.js +4 -0
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +2 -2
- package/dist/collection/components/xpl-badge/badge.stories.js +108 -33
- package/dist/collection/components/xpl-badge/xpl-badge.js +122 -14
- package/dist/collection/components/xpl-banner/banner.stories.js +64 -0
- package/dist/collection/components/xpl-banner/xpl-banner.js +295 -0
- package/dist/collection/components/xpl-breadcrumbs/breadcrumbs.stories.js +4 -0
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +2 -2
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +2 -2
- package/dist/collection/components/xpl-button/button.stories.js +102 -98
- package/dist/collection/components/xpl-button/xpl-button.js +183 -93
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +2 -2
- package/dist/collection/components/xpl-calendar/calendar.stories.js +4 -0
- package/dist/collection/components/xpl-calendar/xpl-calendar.js +2 -2
- package/dist/collection/components/xpl-checkbox/checkbox.stories.js +4 -0
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +4 -4
- package/dist/collection/components/xpl-choicelist/choicelist.stories.js +4 -0
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +2 -2
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +2 -2
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +2 -2
- package/dist/collection/components/xpl-data-card/data-card.stories.js +4 -0
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +3 -3
- package/dist/collection/components/xpl-divider/divider.stories.js +4 -0
- package/dist/collection/components/xpl-divider/xpl-divider.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +29 -4
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +120 -79
- package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +2 -2
- package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +3 -3
- package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +3 -3
- package/dist/collection/components/xpl-grid/xpl-grid.js +2 -2
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +2 -2
- package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +2 -2
- package/dist/collection/components/xpl-icon/xpl-icon.js +3 -3
- package/dist/collection/components/xpl-input/input.stories.js +75 -9
- package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +9 -9
- package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +55 -17
- package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +5 -5
- package/dist/collection/components/xpl-input/xpl-input-phone/phone-country-data.js +58 -0
- package/dist/collection/components/xpl-input/xpl-input-phone/phone-format.js +219 -0
- package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +469 -0
- package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +3 -3
- package/dist/collection/components/xpl-input/xpl-input.js +101 -7
- package/dist/collection/components/xpl-large-card/large-card.stories.js +4 -0
- package/dist/collection/components/xpl-large-card/xpl-large-card.js +2 -2
- package/dist/collection/components/xpl-list/xpl-list.js +2 -2
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +2 -2
- package/dist/collection/components/xpl-modal/modal.stories.js +4 -0
- package/dist/collection/components/xpl-modal/xpl-modal.js +2 -2
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +3 -3
- package/dist/collection/components/xpl-pagination/pagination.stories.js +4 -0
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +4 -4
- package/dist/collection/components/xpl-panel/panel.stories.js +51 -0
- package/dist/collection/components/xpl-panel/xpl-panel.js +60 -0
- package/dist/collection/components/xpl-popover/popover.stories.js +4 -0
- package/dist/collection/components/xpl-popover/xpl-popover.js +5 -5
- package/dist/collection/components/xpl-progress/xpl-progress.js +2 -2
- package/dist/collection/components/xpl-progress-bar/progress-bar.stories.js +96 -0
- package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +158 -0
- package/dist/collection/components/xpl-radio/xpl-radio.js +4 -4
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +2 -2
- package/dist/collection/components/xpl-select/xpl-select.js +7 -7
- package/dist/collection/components/xpl-side-nav/side-nav.stories.js +519 -0
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +259 -0
- package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +32 -0
- package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +2 -2
- package/dist/collection/components/xpl-slideout/xpl-slideout.js +2 -2
- package/dist/collection/components/xpl-tab/xpl-tab.js +3 -3
- package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +3 -3
- package/dist/collection/components/xpl-table/xpl-table.js +6 -6
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +2 -2
- package/dist/collection/components/xpl-table-header-cell/xpl-table-header-cell.js +1 -1
- package/dist/collection/components/xpl-tabs/xpl-tabs.js +6 -6
- package/dist/collection/components/xpl-tag/xpl-tag.js +3 -3
- package/dist/collection/components/xpl-toast/xpl-toast.js +3 -3
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +4 -4
- package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +3 -3
- package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +2 -2
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +2 -2
- package/dist/collection/utils/layout-ancestors.js +22 -0
- package/dist/components/index.js +1 -1
- package/dist/components/xpl-accordion.js +1 -1
- package/dist/components/xpl-application-shell.js +1 -1
- package/dist/components/xpl-avatar.js +1 -1
- package/dist/components/xpl-avatar2.js +1 -1
- package/dist/components/xpl-backdrop.js +1 -1
- package/dist/components/xpl-backdrop2.js +1 -1
- package/dist/components/xpl-badge.js +1 -1
- package/dist/components/xpl-badge2.js +1 -1
- package/dist/components/xpl-banner.d.ts +11 -0
- package/dist/components/xpl-banner.js +1 -0
- 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-button.js +1 -1
- package/dist/components/xpl-button2.js +1 -1
- package/dist/components/xpl-calendar.js +1 -1
- package/dist/components/xpl-checkbox.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-divider.js +1 -1
- package/dist/components/xpl-divider2.js +1 -1
- package/dist/components/xpl-dropdown-group.js +1 -1
- package/dist/components/xpl-dropdown-group2.js +1 -1
- package/dist/components/xpl-dropdown-heading.js +1 -1
- package/dist/components/xpl-dropdown-heading2.js +1 -1
- package/dist/components/xpl-dropdown-option.js +1 -1
- package/dist/components/xpl-dropdown-option2.js +1 -1
- package/dist/components/xpl-dropdown.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-icon.js +1 -1
- package/dist/components/xpl-icon2.js +1 -1
- package/dist/components/xpl-input-date.js +1 -1
- package/dist/components/xpl-input-date2.js +1 -1
- package/dist/components/xpl-input-file.js +1 -1
- package/dist/components/xpl-input-file2.js +1 -1
- package/dist/components/xpl-input-phone.d.ts +11 -0
- package/dist/components/xpl-input-phone.js +1 -0
- package/dist/components/xpl-input-time.js +1 -1
- package/dist/components/xpl-input.js +1 -1
- package/dist/components/xpl-input2.js +1 -1
- package/dist/components/xpl-large-card.js +1 -1
- 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-item.js +1 -1
- package/dist/components/xpl-pagination.js +1 -1
- package/dist/components/xpl-panel.d.ts +11 -0
- package/dist/components/xpl-panel.js +1 -0
- package/dist/components/xpl-popover.js +1 -1
- package/dist/components/xpl-popover2.js +1 -1
- package/dist/components/xpl-progress-bar.d.ts +11 -0
- package/dist/components/xpl-progress-bar.js +1 -0
- package/dist/components/xpl-progress.js +1 -1
- package/dist/components/xpl-radio.js +1 -1
- package/dist/components/xpl-radio2.js +1 -1
- package/dist/components/xpl-secondary-nav.js +1 -1
- package/dist/components/xpl-select.js +1 -1
- package/dist/components/xpl-select2.js +1 -1
- package/dist/components/xpl-side-nav-item.d.ts +11 -0
- package/dist/components/xpl-side-nav-item.js +1 -0
- package/dist/components/xpl-side-nav.d.ts +11 -0
- package/dist/components/xpl-side-nav.js +1 -0
- package/dist/components/xpl-skeleton.js +1 -1
- package/dist/components/xpl-slideout.js +1 -1
- 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-tag.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-tooltip.js +1 -1
- package/dist/components/xpl-tooltip2.js +1 -1
- package/dist/components/xpl-utility-bar.js +1 -1
- package/dist/docs/xpl-accordion/readme.md +4 -0
- package/dist/docs/xpl-avatar/readme.md +5 -0
- package/dist/docs/xpl-backdrop/readme.md +1 -1
- package/dist/docs/xpl-badge/readme.md +97 -4
- package/dist/docs/xpl-banner/readme.md +166 -0
- package/dist/docs/xpl-button/readme.md +151 -14
- package/dist/docs/xpl-button-row/readme.md +1 -0
- package/dist/docs/xpl-calendar/readme.md +2 -1
- package/dist/docs/xpl-checkbox/readme.md +2 -0
- package/dist/docs/xpl-choicelist/readme.md +1 -0
- package/dist/docs/xpl-data-card/readme.md +2 -2
- package/dist/docs/xpl-divider/readme.md +1 -1
- package/dist/docs/xpl-dropdown/readme.md +14 -11
- package/dist/docs/xpl-dropdown/xpl-dropdown-group/readme.md +1 -0
- package/dist/docs/xpl-dropdown/xpl-dropdown-option/readme.md +6 -0
- package/dist/docs/xpl-icon/readme.md +12 -0
- package/dist/docs/xpl-input/readme.md +41 -31
- package/dist/docs/xpl-input/xpl-input-color/readme.md +4 -0
- package/dist/docs/xpl-input/xpl-input-phone/readme.md +167 -0
- package/dist/docs/xpl-input/xpl-input-time/readme.md +4 -0
- package/dist/docs/xpl-large-card/readme.md +1 -1
- package/dist/docs/xpl-modal/readme.md +3 -0
- package/dist/docs/xpl-pagination/readme.md +3 -0
- package/dist/docs/xpl-panel/readme.md +83 -0
- package/dist/docs/xpl-popover/readme.md +1 -1
- package/dist/docs/xpl-progress-bar/readme.md +145 -0
- package/dist/docs/xpl-select/readme.md +1 -0
- package/dist/docs/xpl-side-nav/readme.md +71 -0
- package/dist/docs/xpl-side-nav/xpl-side-nav-item/readme.md +115 -0
- package/dist/docs/xpl-slideout/readme.md +1 -0
- package/dist/docs/xpl-tabs/readme.md +1 -0
- package/dist/docs/xpl-toast/readme.md +55 -0
- package/dist/esm/apollo-core.js +4 -4
- package/dist/esm/{index-DhZas3eX.js → index-C_Z2nG0p.js} +137 -87
- package/dist/esm/loader.js +3 -3
- package/dist/esm/xpl-accordion.entry.js +5 -5
- package/dist/esm/xpl-application-shell.entry.js +4 -4
- package/dist/esm/{xpl-avatar_41.entry.js → xpl-avatar_47.entry.js} +2753 -229
- package/dist/esm/xpl-button-row.entry.js +4 -4
- package/dist/esm/xpl-calendar.entry.js +4 -4
- package/dist/esm/xpl-dynamic-table-cell.entry.js +5 -5
- package/dist/esm/xpl-dynamic-table-row.entry.js +5 -5
- package/dist/esm/xpl-dynamic-table.entry.js +4 -4
- package/dist/esm/xpl-grid-item.entry.js +4 -4
- package/dist/esm/xpl-grid.entry.js +4 -4
- package/dist/esm/xpl-large-card.entry.js +4 -4
- package/dist/esm/xpl-list.entry.js +4 -4
- package/dist/esm/xpl-main-nav.entry.js +4 -4
- package/dist/esm/xpl-table-header-cell.entry.js +3 -3
- package/dist/esm/xpl-table-header.entry.js +4 -4
- package/dist/esm/xpl-toggle.entry.js +6 -6
- package/dist/esm/xpl-toolbar.entry.js +5 -5
- package/dist/types/components/xpl-accordion/xpl-accordion.d.ts +1 -1
- package/dist/types/components/xpl-application-shell/application-shell.stories.d.ts +4 -0
- package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +1 -1
- package/dist/types/components/xpl-avatar/avatar.stories.d.ts +4 -0
- package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +1 -1
- package/dist/types/components/xpl-backdrop/backdrop.stories.d.ts +4 -0
- package/dist/types/components/xpl-backdrop/xpl-backdrop.d.ts +1 -1
- package/dist/types/components/xpl-badge/badge.stories.d.ts +66 -11
- package/dist/types/components/xpl-badge/xpl-badge.d.ts +9 -2
- package/dist/types/components/xpl-banner/banner.stories.d.ts +77 -0
- package/dist/types/components/xpl-banner/xpl-banner.d.ts +20 -0
- package/dist/types/components/xpl-breadcrumbs/breadcrumbs.stories.d.ts +4 -0
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.d.ts +1 -1
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.d.ts +1 -1
- package/dist/types/components/xpl-button/button.stories.d.ts +68 -30
- package/dist/types/components/xpl-button/xpl-button.d.ts +14 -8
- package/dist/types/components/xpl-button-row/xpl-button-row.d.ts +1 -1
- package/dist/types/components/xpl-calendar/calendar.stories.d.ts +4 -0
- package/dist/types/components/xpl-calendar/xpl-calendar.d.ts +1 -1
- package/dist/types/components/xpl-checkbox/checkbox.stories.d.ts +4 -0
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +1 -1
- package/dist/types/components/xpl-choicelist/choicelist.stories.d.ts +4 -0
- package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +1 -1
- package/dist/types/components/xpl-content-area/xpl-content-area.d.ts +1 -1
- package/dist/types/components/xpl-dashboard/xpl-dashboard.d.ts +1 -1
- package/dist/types/components/xpl-data-card/data-card.stories.d.ts +4 -0
- package/dist/types/components/xpl-data-card/xpl-data-card.d.ts +1 -1
- package/dist/types/components/xpl-divider/divider.stories.d.ts +4 -0
- package/dist/types/components/xpl-divider/xpl-divider.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/dropdown-option.d.ts +1 -0
- package/dist/types/components/xpl-dropdown/dropdown.stories.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.d.ts +3 -2
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +11 -8
- package/dist/types/components/xpl-dynamic-table/xpl-dynamic-table.d.ts +1 -1
- package/dist/types/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.d.ts +1 -1
- package/dist/types/components/xpl-dynamic-table-row/xpl-dynamic-table-row.d.ts +1 -1
- package/dist/types/components/xpl-grid/xpl-grid.d.ts +1 -1
- package/dist/types/components/xpl-grid-item/xpl-grid-item.d.ts +1 -1
- package/dist/types/components/xpl-header-accordion/xpl-header-accordion.d.ts +1 -1
- package/dist/types/components/xpl-icon/xpl-icon.d.ts +1 -1
- package/dist/types/components/xpl-input/input.stories.d.ts +36 -7
- package/dist/types/components/xpl-input/xpl-input-color/xpl-input-color.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input-date/xpl-input-date.d.ts +10 -3
- package/dist/types/components/xpl-input/xpl-input-file/xpl-input-file.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input-phone/phone-country-data.d.ts +13 -0
- package/dist/types/components/xpl-input/xpl-input-phone/phone-format.d.ts +5 -0
- package/dist/types/components/xpl-input/xpl-input-phone/xpl-input-phone.d.ts +48 -0
- package/dist/types/components/xpl-input/xpl-input-time/xpl-input-time.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input.d.ts +12 -2
- package/dist/types/components/xpl-large-card/large-card.stories.d.ts +4 -0
- package/dist/types/components/xpl-large-card/xpl-large-card.d.ts +1 -1
- package/dist/types/components/xpl-list/xpl-list.d.ts +1 -1
- package/dist/types/components/xpl-main-nav/xpl-main-nav.d.ts +1 -1
- package/dist/types/components/xpl-modal/modal.stories.d.ts +4 -0
- package/dist/types/components/xpl-modal/xpl-modal.d.ts +1 -1
- package/dist/types/components/xpl-nav-item/xpl-nav-item.d.ts +1 -1
- package/dist/types/components/xpl-pagination/pagination.stories.d.ts +4 -0
- package/dist/types/components/xpl-pagination/xpl-pagination.d.ts +1 -1
- package/dist/types/components/xpl-panel/panel.stories.d.ts +20 -0
- package/dist/types/components/xpl-panel/xpl-panel.d.ts +5 -0
- package/dist/types/components/xpl-popover/xpl-popover.d.ts +1 -1
- package/dist/types/components/xpl-progress/xpl-progress.d.ts +1 -1
- package/dist/types/components/xpl-progress-bar/progress-bar.stories.d.ts +73 -0
- package/dist/types/components/xpl-progress-bar/xpl-progress-bar.d.ts +15 -0
- package/dist/types/components/xpl-radio/xpl-radio.d.ts +1 -1
- package/dist/types/components/xpl-secondary-nav/xpl-secondary-nav.d.ts +1 -1
- package/dist/types/components/xpl-select/xpl-select.d.ts +1 -1
- package/dist/types/components/xpl-side-nav/side-nav.stories.d.ts +80 -0
- package/dist/types/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.d.ts +20 -0
- package/dist/types/components/xpl-side-nav/xpl-side-nav.d.ts +4 -0
- package/dist/types/components/xpl-skeleton/xpl-skeleton.d.ts +1 -1
- package/dist/types/components/xpl-slideout/xpl-slideout.d.ts +1 -1
- package/dist/types/components/xpl-tab/xpl-tab.d.ts +1 -1
- package/dist/types/components/xpl-tab-panel/xpl-tab-panel.d.ts +1 -1
- package/dist/types/components/xpl-table/xpl-table.d.ts +1 -1
- package/dist/types/components/xpl-table-header/xpl-table-header.d.ts +1 -1
- package/dist/types/components/xpl-table-header-cell/xpl-table-header-cell.d.ts +1 -1
- package/dist/types/components/xpl-tabs/xpl-tabs.d.ts +2 -2
- package/dist/types/components/xpl-tag/xpl-tag.d.ts +1 -1
- package/dist/types/components/xpl-toast/xpl-toast.d.ts +1 -1
- package/dist/types/components/xpl-toggle/xpl-toggle.d.ts +1 -1
- package/dist/types/components/xpl-toolbar/xpl-toolbar.d.ts +1 -1
- package/dist/types/components/xpl-tooltip/xpl-tooltip.d.ts +1 -1
- package/dist/types/components/xpl-utility-bar/xpl-utility-bar.d.ts +1 -1
- package/dist/types/components.d.ts +1219 -178
- package/dist/types/stencil-public-runtime.d.ts +23 -2
- package/dist/types/utils/layout-ancestors.d.ts +2 -0
- package/package.json +41 -27
- package/dist/apollo-core/p-1c2e4034.entry.js +0 -1
- package/dist/apollo-core/p-3b5f8989.entry.js +0 -1
- package/dist/apollo-core/p-576ce90f.entry.js +0 -1
- package/dist/apollo-core/p-5ec45742.entry.js +0 -1
- package/dist/apollo-core/p-77f0fd4a.entry.js +0 -1
- package/dist/apollo-core/p-7b7db57a.entry.js +0 -1
- package/dist/apollo-core/p-7c22b842.entry.js +0 -1
- package/dist/apollo-core/p-7d245bf0.entry.js +0 -1
- package/dist/apollo-core/p-812bb0e4.entry.js +0 -1
- package/dist/apollo-core/p-845eef0d.entry.js +0 -1
- package/dist/apollo-core/p-9853028c.entry.js +0 -1
- package/dist/apollo-core/p-9d65ece7.entry.js +0 -1
- package/dist/apollo-core/p-DhZas3eX.js +0 -2
- package/dist/apollo-core/p-be292555.entry.js +0 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class Banner {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.appearance = 'information';
|
|
5
|
+
this.hasIcon = true;
|
|
6
|
+
this.isDismissible = true;
|
|
7
|
+
this.isSection = false;
|
|
8
|
+
this.truncateDesc = false;
|
|
9
|
+
}
|
|
10
|
+
getIcon() {
|
|
11
|
+
switch (this.appearance) {
|
|
12
|
+
case 'positive':
|
|
13
|
+
return 'circle-check';
|
|
14
|
+
case 'warning':
|
|
15
|
+
return 'triangle-warning';
|
|
16
|
+
case 'error':
|
|
17
|
+
return 'octagon-warning';
|
|
18
|
+
default:
|
|
19
|
+
return 'circle-info';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
getActionButtonState() {
|
|
23
|
+
if (this.isSection) {
|
|
24
|
+
if (this.appearance === 'positive') {
|
|
25
|
+
return 'success';
|
|
26
|
+
}
|
|
27
|
+
if (this.appearance === 'error') {
|
|
28
|
+
return 'warning';
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
return this.appearance === 'error' ? 'warning' : undefined;
|
|
33
|
+
}
|
|
34
|
+
getActionButtonVariant() {
|
|
35
|
+
if (this.isSection)
|
|
36
|
+
return 'subtle';
|
|
37
|
+
return this.appearance === 'error' ? 'primary' : 'subtle';
|
|
38
|
+
}
|
|
39
|
+
getAriaLabel() {
|
|
40
|
+
var _a;
|
|
41
|
+
if (this.isSection)
|
|
42
|
+
return ((_a = this.heading) === null || _a === void 0 ? void 0 : _a.trim()) || 'Section banner';
|
|
43
|
+
return {
|
|
44
|
+
information: 'Information banner',
|
|
45
|
+
positive: 'Positive banner',
|
|
46
|
+
warning: 'Warning banner',
|
|
47
|
+
error: 'Error banner',
|
|
48
|
+
}[this.appearance];
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
var _a, _b, _c, _d;
|
|
52
|
+
const hasAction = !!((_a = this.actionText) === null || _a === void 0 ? void 0 : _a.trim());
|
|
53
|
+
const hasSecondaryAction = !!((_b = this.secondaryActionText) === null || _b === void 0 ? void 0 : _b.trim());
|
|
54
|
+
const actionVariant = this.getActionButtonVariant();
|
|
55
|
+
const actionState = this.getActionButtonState();
|
|
56
|
+
const isHeadingPresent = !!((_c = this.heading) === null || _c === void 0 ? void 0 : _c.trim());
|
|
57
|
+
const isDescPresent = !!((_d = this.description) === null || _d === void 0 ? void 0 : _d.trim());
|
|
58
|
+
return (h(Host, { key: '746ce028bdc07d1a645251aecf524f427d1d695b', class: {
|
|
59
|
+
'xpl-banner': true,
|
|
60
|
+
'xpl-banner--section': this.isSection,
|
|
61
|
+
[`xpl-banner--${this.appearance}`]: true,
|
|
62
|
+
'xpl-banner--truncate-desc': this.truncateDesc,
|
|
63
|
+
'xpl-banner--no-icon': this.isSection && !this.hasIcon,
|
|
64
|
+
}, role: "region", "aria-label": this.getAriaLabel() }, (!this.isSection || this.hasIcon) && (h("div", { key: 'fec752fe9822b480c2140c9b4520c2fcf71e4077', class: "xpl-banner__icon", "aria-hidden": "true" }, h("xpl-icon", { key: '1ce49bf4735edf985eaf055312cbd0bec8c76e96', icon: this.getIcon(), size: 24 }))), h("div", { key: '9f1b38f386c4151d25ed7ddb4770d39ae915760d', class: "xpl-banner__body" }, isHeadingPresent && h("p", { key: 'd1e2301d3174bf9bddec53aec75760c2f18899b8', class: "xpl-banner__heading" }, this.heading), isDescPresent && (h("p", { key: '4d7104cb455bc6f000244c6a66d87fe642488a22', class: "xpl-banner__description", title: this.truncateDesc ? this.description : undefined }, this.description))), (hasAction || hasSecondaryAction) && (h("div", { key: 'e3d3dd32d98399be0c1ed702ccc67e65c9d12236', class: "xpl-banner__actions" }, hasAction && (h("xpl-button", { key: '2410dbb9ea6c910e4cb8ace3a40378e10971060d', size: "xs", variant: actionVariant, state: actionState, onClick: () => this.action.emit() }, this.actionText)), hasSecondaryAction && (h("xpl-button", { key: 'db600c5b7e955b466f5928c05dbd9da467317aaa', size: "xs", variant: actionVariant, state: actionState, onClick: () => this.secondaryAction.emit() }, this.secondaryActionText)))), this.isDismissible && (h("button", { key: 'fe896518f7f3544a60dd1a125d4139985817c0d2', class: "xpl-banner__dismiss", type: "button", "aria-label": `Dismiss ${this.isSection ? 'section ' : ''}banner`, onClick: () => this.dismiss.emit() }, h("xpl-icon", { key: '98453bbd9485027c030f4fdc7af349c0e23aa405', icon: "xmark", size: 24, "aria-hidden": "true" })))));
|
|
65
|
+
}
|
|
66
|
+
static get is() { return "xpl-banner"; }
|
|
67
|
+
static get properties() {
|
|
68
|
+
return {
|
|
69
|
+
"actionText": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"mutable": false,
|
|
72
|
+
"complexType": {
|
|
73
|
+
"original": "string",
|
|
74
|
+
"resolved": "string",
|
|
75
|
+
"references": {}
|
|
76
|
+
},
|
|
77
|
+
"required": false,
|
|
78
|
+
"optional": true,
|
|
79
|
+
"docs": {
|
|
80
|
+
"tags": [],
|
|
81
|
+
"text": "Primary action label. When provided, an action button is rendered."
|
|
82
|
+
},
|
|
83
|
+
"getter": false,
|
|
84
|
+
"setter": false,
|
|
85
|
+
"reflect": false,
|
|
86
|
+
"attribute": "action-text"
|
|
87
|
+
},
|
|
88
|
+
"appearance": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"mutable": false,
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "'information' | 'positive' | 'warning' | 'error'",
|
|
93
|
+
"resolved": "\"error\" | \"information\" | \"positive\" | \"warning\"",
|
|
94
|
+
"references": {}
|
|
95
|
+
},
|
|
96
|
+
"required": false,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": "Controls the visual appearance and semantic meaning of the banner.\nThese values map to messaging background/border token sets in `banner.css`.\nBanner icons use `--xpl-icon-default`, except `error` which uses inverse icon/text\ntokens for contrast on dark backgrounds."
|
|
101
|
+
},
|
|
102
|
+
"getter": false,
|
|
103
|
+
"setter": false,
|
|
104
|
+
"reflect": false,
|
|
105
|
+
"attribute": "appearance",
|
|
106
|
+
"defaultValue": "'information'"
|
|
107
|
+
},
|
|
108
|
+
"description": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"mutable": false,
|
|
111
|
+
"complexType": {
|
|
112
|
+
"original": "string",
|
|
113
|
+
"resolved": "string",
|
|
114
|
+
"references": {}
|
|
115
|
+
},
|
|
116
|
+
"required": false,
|
|
117
|
+
"optional": true,
|
|
118
|
+
"docs": {
|
|
119
|
+
"tags": [],
|
|
120
|
+
"text": "Optional supporting message shown after the heading.\nDescription text uses `--xpl-text-default`."
|
|
121
|
+
},
|
|
122
|
+
"getter": false,
|
|
123
|
+
"setter": false,
|
|
124
|
+
"reflect": false,
|
|
125
|
+
"attribute": "description"
|
|
126
|
+
},
|
|
127
|
+
"hasIcon": {
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"complexType": {
|
|
131
|
+
"original": "boolean",
|
|
132
|
+
"resolved": "boolean",
|
|
133
|
+
"references": {}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": false,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": "Whether to render the leading icon in section layout.\nIgnored in bar layout \u2014 bar banners always show the icon."
|
|
140
|
+
},
|
|
141
|
+
"getter": false,
|
|
142
|
+
"setter": false,
|
|
143
|
+
"reflect": false,
|
|
144
|
+
"attribute": "has-icon",
|
|
145
|
+
"defaultValue": "true"
|
|
146
|
+
},
|
|
147
|
+
"heading": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"mutable": false,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "string",
|
|
152
|
+
"resolved": "string",
|
|
153
|
+
"references": {}
|
|
154
|
+
},
|
|
155
|
+
"required": false,
|
|
156
|
+
"optional": true,
|
|
157
|
+
"docs": {
|
|
158
|
+
"tags": [],
|
|
159
|
+
"text": "Primary banner message shown with stronger title typography."
|
|
160
|
+
},
|
|
161
|
+
"getter": false,
|
|
162
|
+
"setter": false,
|
|
163
|
+
"reflect": false,
|
|
164
|
+
"attribute": "heading"
|
|
165
|
+
},
|
|
166
|
+
"isDismissible": {
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "boolean",
|
|
171
|
+
"resolved": "boolean",
|
|
172
|
+
"references": {}
|
|
173
|
+
},
|
|
174
|
+
"required": false,
|
|
175
|
+
"optional": false,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": "Whether to show the trailing dismiss control."
|
|
179
|
+
},
|
|
180
|
+
"getter": false,
|
|
181
|
+
"setter": false,
|
|
182
|
+
"reflect": false,
|
|
183
|
+
"attribute": "is-dismissible",
|
|
184
|
+
"defaultValue": "true"
|
|
185
|
+
},
|
|
186
|
+
"isSection": {
|
|
187
|
+
"type": "boolean",
|
|
188
|
+
"mutable": false,
|
|
189
|
+
"complexType": {
|
|
190
|
+
"original": "boolean",
|
|
191
|
+
"resolved": "boolean",
|
|
192
|
+
"references": {}
|
|
193
|
+
},
|
|
194
|
+
"required": false,
|
|
195
|
+
"optional": false,
|
|
196
|
+
"docs": {
|
|
197
|
+
"tags": [],
|
|
198
|
+
"text": "Renders the section-style banner layout when true."
|
|
199
|
+
},
|
|
200
|
+
"getter": false,
|
|
201
|
+
"setter": false,
|
|
202
|
+
"reflect": false,
|
|
203
|
+
"attribute": "is-section",
|
|
204
|
+
"defaultValue": "false"
|
|
205
|
+
},
|
|
206
|
+
"secondaryActionText": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"mutable": false,
|
|
209
|
+
"complexType": {
|
|
210
|
+
"original": "string",
|
|
211
|
+
"resolved": "string",
|
|
212
|
+
"references": {}
|
|
213
|
+
},
|
|
214
|
+
"required": false,
|
|
215
|
+
"optional": true,
|
|
216
|
+
"docs": {
|
|
217
|
+
"tags": [],
|
|
218
|
+
"text": "Secondary action label. When provided, a second action button is rendered."
|
|
219
|
+
},
|
|
220
|
+
"getter": false,
|
|
221
|
+
"setter": false,
|
|
222
|
+
"reflect": false,
|
|
223
|
+
"attribute": "secondary-action-text"
|
|
224
|
+
},
|
|
225
|
+
"truncateDesc": {
|
|
226
|
+
"type": "boolean",
|
|
227
|
+
"mutable": false,
|
|
228
|
+
"complexType": {
|
|
229
|
+
"original": "boolean",
|
|
230
|
+
"resolved": "boolean",
|
|
231
|
+
"references": {}
|
|
232
|
+
},
|
|
233
|
+
"required": false,
|
|
234
|
+
"optional": false,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": "When true, `description` is constrained to one line with ellipsis so banner height stays stable."
|
|
238
|
+
},
|
|
239
|
+
"getter": false,
|
|
240
|
+
"setter": false,
|
|
241
|
+
"reflect": false,
|
|
242
|
+
"attribute": "truncate-desc",
|
|
243
|
+
"defaultValue": "false"
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
static get events() {
|
|
248
|
+
return [{
|
|
249
|
+
"method": "action",
|
|
250
|
+
"name": "action",
|
|
251
|
+
"bubbles": true,
|
|
252
|
+
"cancelable": true,
|
|
253
|
+
"composed": true,
|
|
254
|
+
"docs": {
|
|
255
|
+
"tags": [],
|
|
256
|
+
"text": "Emitted when the primary action is clicked."
|
|
257
|
+
},
|
|
258
|
+
"complexType": {
|
|
259
|
+
"original": "void",
|
|
260
|
+
"resolved": "void",
|
|
261
|
+
"references": {}
|
|
262
|
+
}
|
|
263
|
+
}, {
|
|
264
|
+
"method": "dismiss",
|
|
265
|
+
"name": "dismiss",
|
|
266
|
+
"bubbles": true,
|
|
267
|
+
"cancelable": true,
|
|
268
|
+
"composed": true,
|
|
269
|
+
"docs": {
|
|
270
|
+
"tags": [],
|
|
271
|
+
"text": "Emitted when the dismiss button is clicked."
|
|
272
|
+
},
|
|
273
|
+
"complexType": {
|
|
274
|
+
"original": "void",
|
|
275
|
+
"resolved": "void",
|
|
276
|
+
"references": {}
|
|
277
|
+
}
|
|
278
|
+
}, {
|
|
279
|
+
"method": "secondaryAction",
|
|
280
|
+
"name": "secondaryAction",
|
|
281
|
+
"bubbles": true,
|
|
282
|
+
"cancelable": true,
|
|
283
|
+
"composed": true,
|
|
284
|
+
"docs": {
|
|
285
|
+
"tags": [],
|
|
286
|
+
"text": "Emitted when the secondary action is clicked."
|
|
287
|
+
},
|
|
288
|
+
"complexType": {
|
|
289
|
+
"original": "void",
|
|
290
|
+
"resolved": "void",
|
|
291
|
+
"references": {}
|
|
292
|
+
}
|
|
293
|
+
}];
|
|
294
|
+
}
|
|
295
|
+
}
|
package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
export class
|
|
2
|
+
export class BreadcrumbItem {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.chevron = `<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right" class="svg-inline--fa fa-chevron-right fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
|
5
5
|
<path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path>
|
|
@@ -7,7 +7,7 @@ export class XplBreadcrumbItem {
|
|
|
7
7
|
`;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: 'ea9a888676dc9f7ef3a8ebdb194905d1e4350e2a', class: "xpl-breadcrumb-item", role: "listitem" }, h("li", { key: '3de2d04b006232bcdeca19c8cd300939bdfd160d', role: "none" }, h("slot", { key: 'ce28e3cce466682d576e026978f2f715cc8f2c84' })), h("span", { key: '862d5979885f27e002852d0e933b0003a6a8c9f3', innerHTML: this.chevron })));
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "xpl-breadcrumb-item"; }
|
|
13
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
export class
|
|
2
|
+
export class Breadcrumbs {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: 'b2d3bc77d1cc55f20c15af6b3526c10ee5737d23' }, h("nav", { key: '576a7d126a4df07c275fef5a412b549f5fc7bf45', class: "xpl-breadcrumbs", "aria-label": "Breadcrumb" }, h("ol", { key: '000ab463d675d42a67f3f484fe3d38ac7be1d60e', role: "list" }, h("slot", { key: '5f5895a835a4d572bd5566c1e8a4b9b83373f372' })))));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "xpl-breadcrumbs"; }
|
|
7
7
|
}
|
|
@@ -1,122 +1,121 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
title: 'Components/Button',
|
|
3
3
|
argTypes: {
|
|
4
|
-
text: {
|
|
5
|
-
type: { name: 'string', required: false },
|
|
6
|
-
},
|
|
7
4
|
variant: {
|
|
8
|
-
options: ['primary', 'secondary', '
|
|
9
|
-
control: {
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
options: ['primary', 'secondary', 'tertiary'],
|
|
6
|
+
control: { type: 'select' },
|
|
7
|
+
description: `Button style (primary, secondary, tertiary). Subtle is deprecated and is now tertiary.`,
|
|
8
|
+
},
|
|
9
|
+
size: {
|
|
10
|
+
options: ['default', 'xs', 'sm'],
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
description: 'Button size.',
|
|
13
|
+
},
|
|
14
|
+
sentiment: {
|
|
15
|
+
options: ['neutral', 'negative', 'positive'],
|
|
16
|
+
control: { type: 'select' },
|
|
17
|
+
description: 'Semantic intent (color scheme).',
|
|
12
18
|
},
|
|
13
19
|
state: {
|
|
14
|
-
|
|
15
|
-
control:
|
|
16
|
-
type: 'select',
|
|
17
|
-
},
|
|
20
|
+
table: { disable: true },
|
|
21
|
+
control: false,
|
|
18
22
|
},
|
|
19
23
|
disabled: {
|
|
20
|
-
control: {
|
|
21
|
-
|
|
22
|
-
},
|
|
24
|
+
control: { type: 'boolean' },
|
|
25
|
+
description: 'Disables the button.',
|
|
23
26
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type: 'select',
|
|
28
|
-
},
|
|
27
|
+
isLoading: {
|
|
28
|
+
control: { type: 'boolean' },
|
|
29
|
+
description: 'Shows loading spinner and hides content; button is non-interactive.',
|
|
29
30
|
},
|
|
30
31
|
fullWidth: {
|
|
31
|
-
control: {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
control: { type: 'boolean' },
|
|
33
|
+
description: 'Whether the button should be of full width as per parent container.',
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
options: ['button', 'submit', 'reset'],
|
|
37
|
+
control: { type: 'select' },
|
|
38
|
+
description: 'Native button type.',
|
|
39
|
+
},
|
|
40
|
+
form: {
|
|
41
|
+
control: { type: 'text' },
|
|
42
|
+
description: 'Optional form id to associate (for type="submit"/"reset").',
|
|
43
|
+
},
|
|
44
|
+
name: {
|
|
45
|
+
control: { type: 'text' },
|
|
46
|
+
description: 'Name attribute for form submission.',
|
|
47
|
+
},
|
|
48
|
+
value: {
|
|
49
|
+
control: { type: 'text' },
|
|
50
|
+
description: 'Value attribute for form submission.',
|
|
34
51
|
},
|
|
35
52
|
icon: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
type: 'select',
|
|
39
|
-
},
|
|
53
|
+
control: { type: 'text' },
|
|
54
|
+
description: 'Icon name from xpl-icon (e.g. coffee, download). Empty = no icon.',
|
|
40
55
|
},
|
|
41
|
-
|
|
42
|
-
control: {
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
iconOnly: {
|
|
57
|
+
control: { type: 'boolean' },
|
|
58
|
+
description: 'When true, only the icon is shown (no slot content). Set icon as well.',
|
|
59
|
+
},
|
|
60
|
+
iconPosition: {
|
|
61
|
+
options: ['start', 'end'],
|
|
62
|
+
control: { type: 'radio' },
|
|
63
|
+
description: 'Icon position relative to label.',
|
|
64
|
+
},
|
|
65
|
+
label: {
|
|
66
|
+
control: { type: 'text' },
|
|
67
|
+
description: 'Button label (default slot content).',
|
|
45
68
|
},
|
|
46
|
-
form: { name: 'string', required: false },
|
|
47
69
|
},
|
|
48
70
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (variant
|
|
52
|
-
|
|
53
|
-
if (size
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</div>
|
|
85
|
-
`;
|
|
86
|
-
};
|
|
87
|
-
const HtmlButton = ({ variant, size, state, disabled, text, icon, link, fullWidth, form }) => {
|
|
88
|
-
const iconSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-coffee"><path d="M18 8h1a4 4 0 0 1 0 8h-1"/><path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z"/><line x1="6" y1="1" x2="6" y2="4"/><line x1="10" y1="1" x2="10" y2="4"/><line x1="14" y1="1" x2="14" y2="4"/></svg>`;
|
|
89
|
-
let className = `xpl-button
|
|
90
|
-
xpl-button--${size}
|
|
91
|
-
xpl-button--${state}
|
|
92
|
-
xpl-button--${variant} `;
|
|
93
|
-
let attrs = '';
|
|
94
|
-
if (disabled)
|
|
95
|
-
attrs += ' disabled';
|
|
96
|
-
if (fullWidth)
|
|
97
|
-
className += ' xpl-button--full-width';
|
|
98
|
-
const innerHtml = (isLink) => {
|
|
99
|
-
const textBlock = `
|
|
100
|
-
${icon === 'leading' ? iconSvg : ''}
|
|
101
|
-
${text}
|
|
102
|
-
${icon === 'trailing' ? iconSvg : ''}
|
|
103
|
-
`;
|
|
104
|
-
return isLink
|
|
105
|
-
? `<a href='javascript:;' ${attrs}>${textBlock}</a>`
|
|
106
|
-
: `<button form="${form}">${textBlock}</button>`;
|
|
107
|
-
};
|
|
108
|
-
return `<span class=${className}>${innerHtml(link)}</span>`;
|
|
71
|
+
function buildAttrs(args) {
|
|
72
|
+
const parts = [];
|
|
73
|
+
if (args.variant)
|
|
74
|
+
parts.push(`variant="${args.variant}"`);
|
|
75
|
+
if (args.size)
|
|
76
|
+
parts.push(`size="${args.size}"`);
|
|
77
|
+
if (args.sentiment && args.sentiment !== 'neutral')
|
|
78
|
+
parts.push(`sentiment="${args.sentiment}"`);
|
|
79
|
+
if (args.disabled)
|
|
80
|
+
parts.push('disabled');
|
|
81
|
+
if (args.isLoading)
|
|
82
|
+
parts.push('is-loading');
|
|
83
|
+
if (args.fullWidth)
|
|
84
|
+
parts.push('full-width');
|
|
85
|
+
if (args.type)
|
|
86
|
+
parts.push(`type="${args.type}"`);
|
|
87
|
+
if (args.form)
|
|
88
|
+
parts.push(`form="${String(args.form).replace(/"/g, '"')}"`);
|
|
89
|
+
if (args.name)
|
|
90
|
+
parts.push(`name="${String(args.name).replace(/"/g, '"')}"`);
|
|
91
|
+
if (args.value !== undefined && args.value !== '')
|
|
92
|
+
parts.push(`value="${String(args.value).replace(/"/g, '"')}"`);
|
|
93
|
+
if (args.iconOnly)
|
|
94
|
+
parts.push('icon-only');
|
|
95
|
+
if (args.icon)
|
|
96
|
+
parts.push(`icon="${String(args.icon).replace(/"/g, '"')}"`);
|
|
97
|
+
if (args.iconPosition)
|
|
98
|
+
parts.push(`icon-position="${args.iconPosition}"`);
|
|
99
|
+
return parts.length ? ` ${parts.join(' ')}` : '';
|
|
100
|
+
}
|
|
101
|
+
export const Button = (args) => {
|
|
102
|
+
const attrs = buildAttrs(args);
|
|
103
|
+
const content = args.iconOnly ? '' : args.label === undefined ? 'Button' : String(args.label);
|
|
104
|
+
const button = `<xpl-button${attrs}>${content}</xpl-button>`;
|
|
105
|
+
return args.fullWidth ? `<div style="width: 480px;">${button}</div>` : button;
|
|
109
106
|
};
|
|
110
107
|
Button.args = {
|
|
111
|
-
|
|
108
|
+
label: 'Button',
|
|
112
109
|
variant: 'primary',
|
|
113
110
|
size: 'default',
|
|
111
|
+
sentiment: 'neutral',
|
|
114
112
|
disabled: false,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
isLoading: false,
|
|
114
|
+
fullWidth: false,
|
|
115
|
+
type: 'button',
|
|
116
|
+
icon: '',
|
|
117
|
+
iconOnly: false,
|
|
118
|
+
iconPosition: 'start',
|
|
120
119
|
};
|
|
121
120
|
Button.parameters = {
|
|
122
121
|
layout: 'centered',
|
|
@@ -124,7 +123,12 @@ Button.parameters = {
|
|
|
124
123
|
render: Button(Button.args),
|
|
125
124
|
},
|
|
126
125
|
html: {
|
|
127
|
-
render:
|
|
126
|
+
render: `
|
|
127
|
+
<div class="xpl-button xpl-button--default xpl-button--primary xpl-button--neutral">
|
|
128
|
+
<button type="button">
|
|
129
|
+
Button
|
|
130
|
+
</button>
|
|
131
|
+
</div>`.trim(),
|
|
128
132
|
},
|
|
129
133
|
design: {
|
|
130
134
|
type: 'figma',
|