@otto-de/b2b-core-components 1.4.0 → 1.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/dist/b2b-core-components/b2b-core-components.css +1 -1
- package/dist/b2b-core-components/b2b-core-components.esm.js +1 -1
- package/dist/b2b-core-components/p-01fd54a1.entry.js +1 -0
- package/dist/b2b-core-components/p-04fc18cd.entry.js +1 -0
- package/dist/b2b-core-components/p-06aa96a8.entry.js +1 -0
- package/dist/b2b-core-components/p-077217b3.entry.js +1 -0
- package/dist/b2b-core-components/p-0965b990.entry.js +1 -0
- package/dist/b2b-core-components/p-0beabdb4.entry.js +1 -0
- package/dist/b2b-core-components/p-163466cf.entry.js +1 -0
- package/dist/b2b-core-components/{p-c2bcf0a8.entry.js → p-197c1a6d.entry.js} +1 -1
- package/dist/b2b-core-components/p-1d007eea.entry.js +1 -0
- package/dist/b2b-core-components/{p-400b3111.entry.js → p-1e2752b2.entry.js} +1 -1
- package/dist/b2b-core-components/p-2328144b.entry.js +1 -0
- package/dist/b2b-core-components/{p-9184036b.entry.js → p-2ad8bdb6.entry.js} +1 -1
- package/dist/b2b-core-components/p-2d01e68a.entry.js +1 -0
- package/dist/b2b-core-components/{p-34f6555e.entry.js → p-3c0671ef.entry.js} +1 -1
- package/dist/b2b-core-components/p-42e7f397.entry.js +1 -0
- package/dist/b2b-core-components/p-44ccd8f4.entry.js +1 -0
- package/dist/b2b-core-components/p-542a358a.entry.js +1 -0
- package/dist/b2b-core-components/p-54fd68eb.entry.js +1 -0
- package/dist/b2b-core-components/p-60badad5.entry.js +1 -0
- package/dist/b2b-core-components/p-6140304e.entry.js +1 -0
- package/dist/b2b-core-components/{p-f0aa5e83.entry.js → p-681d6880.entry.js} +1 -1
- package/dist/b2b-core-components/p-8ad1bb92.entry.js +1 -0
- package/dist/b2b-core-components/p-90a3ffed.entry.js +1 -0
- package/dist/b2b-core-components/p-97ef9805.entry.js +1 -0
- package/dist/b2b-core-components/{p-48d4d224.entry.js → p-a50ea33f.entry.js} +1 -1
- package/dist/b2b-core-components/p-b3ccfc58.entry.js +1 -0
- package/dist/b2b-core-components/p-b6a8a06f.entry.js +1 -0
- package/dist/b2b-core-components/p-b8049234.entry.js +1 -0
- package/dist/b2b-core-components/p-bb5e7c53.js +1 -0
- package/dist/b2b-core-components/p-c294dd0c.entry.js +1 -0
- package/dist/b2b-core-components/p-d07210e2.entry.js +1 -0
- package/dist/b2b-core-components/p-d7bb8aa1.entry.js +1 -0
- package/dist/b2b-core-components/p-d83c2084.entry.js +1 -0
- package/dist/b2b-core-components/p-db7d2ec3.entry.js +1 -0
- package/dist/b2b-core-components/{p-9facba86.entry.js → p-dd79ab5b.entry.js} +1 -1
- package/dist/b2b-core-components/p-e5b78075.entry.js +1 -0
- package/dist/b2b-core-components/p-e811411a.entry.js +1 -0
- package/dist/b2b-core-components/p-f190bf79.entry.js +1 -0
- package/dist/b2b-core-components/p-f24515bf.entry.js +1 -0
- package/dist/b2b-core-components/p-f3ce95bf.js +2 -0
- package/dist/b2b-core-components/p-f7e9f889.entry.js +1 -0
- package/dist/cjs/b2b-alert.cjs.entry.js +4 -4
- package/dist/cjs/b2b-anchor.cjs.entry.js +2 -2
- package/dist/cjs/b2b-button_2.cjs.entry.js +13 -9
- package/dist/cjs/b2b-card.cjs.entry.js +2 -2
- package/dist/cjs/b2b-checkbox-group.cjs.entry.js +7 -5
- package/dist/cjs/b2b-checkbox_3.cjs.entry.js +206 -0
- package/dist/cjs/b2b-core-components.cjs.js +3 -3
- package/dist/cjs/b2b-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/b2b-grid-col.cjs.entry.js +1 -1
- package/dist/cjs/b2b-grid-row.cjs.entry.js +2 -2
- package/dist/cjs/b2b-grid.cjs.entry.js +1 -1
- package/dist/cjs/b2b-headline.cjs.entry.js +2 -2
- package/dist/cjs/b2b-icon.cjs.entry.js +4 -4
- package/dist/cjs/b2b-input-group_2.cjs.entry.js +12 -9
- package/dist/cjs/b2b-input-label.cjs.entry.js +1 -1
- package/dist/cjs/b2b-input_2.cjs.entry.js +8 -7
- package/dist/cjs/b2b-label.cjs.entry.js +2 -2
- package/dist/cjs/b2b-modal.cjs.entry.js +5 -5
- package/dist/cjs/b2b-pagination.cjs.entry.js +5 -5
- package/dist/cjs/b2b-paragraph.cjs.entry.js +5 -5
- package/dist/cjs/b2b-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/b2b-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/b2b-required-separator.cjs.entry.js +3 -3
- package/dist/cjs/b2b-rounded-icon.cjs.entry.js +4 -2
- package/dist/cjs/b2b-scrollable-container.cjs.entry.js +2 -2
- package/dist/cjs/b2b-search.cjs.entry.js +6 -1
- package/dist/cjs/b2b-separator.cjs.entry.js +2 -2
- package/dist/cjs/b2b-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/b2b-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/b2b-tab.cjs.entry.js +2 -2
- package/dist/cjs/b2b-table-row.cjs.entry.js +78 -23
- package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +87 -26
- package/dist/cjs/b2b-table.cjs.entry.js +13 -13
- package/dist/cjs/b2b-textarea.cjs.entry.js +2 -2
- package/dist/cjs/b2b-toggle-button.cjs.entry.js +7 -7
- package/dist/cjs/b2b-toggle-group.cjs.entry.js +3 -3
- package/dist/cjs/b2b-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/b2b-wizard-icon.cjs.entry.js +6 -4
- package/dist/cjs/b2b-wizard-step.cjs.entry.js +26 -0
- package/dist/cjs/b2b-wizard.cjs.entry.js +61 -0
- package/dist/cjs/{index-496aa5dd.js → index-04e07a00.js} +100 -35
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{types-ef85a0bf.js → table.types-00c8228a.js} +4 -4
- package/dist/cjs/wizard.types-690c64bb.js +10 -0
- package/dist/collection/collection-manifest.json +4 -2
- package/dist/collection/components/alert/alert.css +8 -9
- package/dist/collection/components/alert/alert.e2e.js +67 -0
- package/dist/collection/components/alert/alert.js +2 -2
- package/dist/collection/components/anchor/anchor.css +3 -4
- package/dist/collection/components/anchor/anchor.spec.js +68 -0
- package/dist/collection/components/button/button.css +36 -41
- package/dist/collection/components/button/button.e2e.js +80 -0
- package/dist/collection/components/button/button.js +31 -6
- package/dist/collection/components/card/card.css +3 -4
- package/dist/collection/components/card/card.e2e.js +110 -0
- package/dist/collection/components/card/card.spec.js +32 -0
- package/dist/collection/components/checkbox/checkbox.css +36 -16
- package/dist/collection/components/checkbox/checkbox.e2e.js +30 -0
- package/dist/collection/components/checkbox/checkbox.js +81 -6
- package/dist/collection/components/checkbox/checkbox.spec.js +45 -0
- package/dist/collection/components/checkbox-group/checkbox-group.css +7 -8
- package/dist/collection/components/checkbox-group/checkbox-group.e2e.js +78 -0
- package/dist/collection/components/checkbox-group/checkbox-group.js +5 -3
- package/dist/collection/components/checkbox-group/checkbox-group.spec.js +38 -0
- package/dist/collection/components/dropdown/dropdown.css +9 -10
- package/dist/collection/components/dropdown/dropdown.e2e.js +48 -0
- package/dist/collection/components/dropdown/dropdown.js +1 -1
- package/dist/collection/components/dropdown/dropdown.spec.js +52 -0
- package/dist/collection/components/grid/grid.e2e.js +17 -0
- package/dist/collection/components/grid/row.js +1 -1
- package/dist/collection/components/headline/headline.css +3 -4
- package/dist/collection/components/headline/headline.e2e.js +13 -0
- package/dist/collection/components/headline/headline.spec.js +67 -0
- package/dist/collection/components/icon/icon.css +10 -11
- package/dist/collection/components/icon/icon.js +2 -2
- package/dist/collection/components/icon/icon.spec.js +21 -0
- package/dist/collection/components/input/input.css +16 -17
- package/dist/collection/components/input/input.e2e.js +43 -0
- package/dist/collection/components/input/input.js +26 -4
- package/dist/collection/components/input/input.spec.js +45 -0
- package/dist/collection/components/input-group/input-group.css +6 -7
- package/dist/collection/components/input-group/input-group.e2e.js +76 -0
- package/dist/collection/components/input-group/input-group.js +6 -4
- package/dist/collection/components/input-group/input-group.spec.js +56 -0
- package/dist/collection/components/input-label/input-label.e2e.js +10 -0
- package/dist/collection/components/input-list/input-list.css +8 -9
- package/dist/collection/components/input-list/input-list.e2e.js +227 -0
- package/dist/collection/components/input-list/input-list.js +24 -2
- package/dist/collection/components/label/label.css +4 -5
- package/dist/collection/components/label/label.e2e.js +17 -0
- package/dist/collection/components/label/label.spec.js +58 -0
- package/dist/collection/components/modal/modal.css +14 -20
- package/dist/collection/components/modal/modal.e2e.js +115 -0
- package/dist/collection/components/modal/modal.js +3 -3
- package/dist/collection/components/pagination/pagination.css +8 -9
- package/dist/collection/components/pagination/pagination.e2e.js +256 -0
- package/dist/collection/components/pagination/pagination.js +3 -3
- package/dist/collection/components/pagination/pagination.spec.js +104 -0
- package/dist/collection/components/paragraph/paragraph.css +11 -12
- package/dist/collection/components/paragraph/paragraph.e2e.js +13 -0
- package/dist/collection/components/paragraph/paragraph.js +3 -3
- package/dist/collection/components/radio/radio.css +4 -5
- package/dist/collection/components/radio/radio.e2e.js +36 -0
- package/dist/collection/components/radio/radio.spec.js +38 -0
- package/dist/collection/components/radio-group/radio-group.css +4 -5
- package/dist/collection/components/radio-group/radio-group.e2e.js +71 -0
- package/dist/collection/components/radio-group/radio-group.spec.js +31 -0
- package/dist/collection/components/required-separator/required-separator.css +5 -6
- package/dist/collection/components/required-separator/required-separator.e2e.js +17 -0
- package/dist/collection/components/required-separator/required-separator.js +1 -1
- package/dist/collection/components/rounded-icon/rounded-icon.css +4 -5
- package/dist/collection/components/rounded-icon/rounded-icon.js +19 -0
- package/dist/collection/components/scrollable-container/scrollable-container.css +3 -4
- package/dist/collection/components/search/search.e2e.js +97 -0
- package/dist/collection/components/search/search.js +14 -0
- package/dist/collection/components/separator/separator.css +3 -4
- package/dist/collection/components/separator/separator.e2e.js +22 -0
- package/dist/collection/components/spinner/spinner.css +3 -4
- package/dist/collection/components/spinner/spinner.e2e.js +12 -0
- package/dist/collection/components/spinner/spinner.spec.js +41 -0
- package/dist/collection/components/tab/tab.css +3 -4
- package/dist/collection/components/tab/tab.e2e.js +35 -0
- package/dist/collection/components/tab/tab.spec.js +31 -0
- package/dist/collection/components/tab-group/tab-group.e2e.js +98 -0
- package/dist/collection/components/tab-panel/tab-panel.css +3 -4
- package/dist/collection/components/tab-panel/tab-panel.e2e.js +12 -0
- package/dist/collection/components/tab-panel/tab-panel.spec.js +10 -0
- package/dist/collection/components/table/stories.data.js +6 -6
- package/dist/collection/components/table/table-cell/table-cell.css +3 -4
- package/dist/collection/components/table/table-cell/table-cell.js +4 -4
- package/dist/collection/components/table/table-header/table-header.css +18 -19
- package/dist/collection/components/table/table-header/table-header.js +7 -7
- package/dist/collection/components/table/table-row/table-row.css +4 -5
- package/dist/collection/components/table/table-row/table-row.js +187 -28
- package/dist/collection/components/table/table-rowgroup/table-rowgroup.css +4 -5
- package/dist/collection/components/table/table-rowgroup/table-rowgroup.js +119 -24
- package/dist/collection/components/table/table.css +3 -4
- package/dist/collection/components/table/table.e2e.js +370 -0
- package/dist/collection/components/table/table.js +10 -10
- package/dist/collection/components/table/table.stories.js +17 -8
- package/dist/collection/components/table/utils.js +18 -0
- package/dist/collection/components/textarea/textarea.css +4 -5
- package/dist/collection/components/textarea/textarea.e2e.js +91 -0
- package/dist/collection/components/toggle-button/toggle-button.css +10 -11
- package/dist/collection/components/toggle-button/toggle-button.e2e.js +44 -0
- package/dist/collection/components/toggle-button/toggle-button.js +5 -5
- package/dist/collection/components/toggle-group/toggle-group.css +4 -5
- package/dist/collection/components/toggle-group/toggle-group.e2e.js +65 -0
- package/dist/collection/components/toggle-group/toggle-group.js +1 -1
- package/dist/collection/components/tooltip/tooltip.css +16 -17
- package/dist/collection/components/tooltip/tooltip.e2e.js +64 -0
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/components/wizard/wizard-step.js +95 -0
- package/dist/collection/components/wizard/wizard.css +240 -0
- package/dist/collection/components/wizard/wizard.e2e.js +149 -0
- package/dist/collection/components/wizard/wizard.js +125 -0
- package/dist/collection/components/wizard/wizard.stories.js +44 -0
- package/dist/collection/components/wizard-icon/wizard-icon.css +3 -4
- package/dist/collection/components/wizard-icon/wizard-icon.js +38 -8
- package/dist/collection/components/wizard-icon/wizard-icon.stories.js +14 -3
- package/dist/collection/docs/config/replace-prop-controls.spec.js +32 -0
- package/dist/collection/{components/table/types.js → utils/types/table.types.js} +7 -3
- package/dist/collection/utils/types/wizard.types.js +6 -0
- package/dist/collection/utils/utils.spec.js +15 -0
- package/dist/components/b2b-alert.js +4 -4
- package/dist/components/b2b-anchor.js +2 -2
- package/dist/components/b2b-card.js +2 -2
- package/dist/components/b2b-checkbox-group.js +7 -5
- package/dist/components/b2b-checkbox.js +1 -99
- package/dist/components/b2b-dropdown.js +3 -3
- package/dist/components/b2b-grid-col.js +1 -1
- package/dist/components/b2b-grid-row.js +2 -2
- package/dist/components/b2b-grid.js +1 -1
- package/dist/components/b2b-label.js +2 -2
- package/dist/components/b2b-modal.js +5 -5
- package/dist/components/b2b-pagination.js +5 -5
- package/dist/components/b2b-paragraph.js +5 -5
- package/dist/components/b2b-radio-button.js +2 -2
- package/dist/components/b2b-radio-group.js +2 -2
- package/dist/components/b2b-required-separator.js +3 -3
- package/dist/components/b2b-scrollable-container.js +2 -2
- package/dist/components/b2b-search.js +7 -2
- package/dist/components/b2b-tab-group.js +1 -1
- package/dist/components/b2b-tab-panel.js +2 -2
- package/dist/components/b2b-tab.js +2 -2
- package/dist/components/b2b-table-row.js +97 -26
- package/dist/components/b2b-table-rowgroup.js +91 -27
- package/dist/components/b2b-table.js +11 -11
- package/dist/components/b2b-textarea.js +2 -2
- package/dist/components/b2b-toggle-button.js +7 -7
- package/dist/components/b2b-toggle-group.js +3 -3
- package/dist/components/b2b-tooltip.js +4 -4
- package/dist/components/b2b-wizard-icon.js +1 -47
- package/dist/components/b2b-wizard-step.d.ts +11 -0
- package/dist/components/b2b-wizard-step.js +62 -0
- package/dist/components/b2b-wizard.d.ts +11 -0
- package/dist/components/b2b-wizard.js +79 -0
- package/dist/components/button.js +13 -8
- package/dist/components/checkbox.js +123 -0
- package/dist/components/headline.js +2 -2
- package/dist/components/icon.js +4 -4
- package/dist/components/input-group.js +8 -6
- package/dist/components/input-label.js +1 -1
- package/dist/components/input-list-option.js +2 -2
- package/dist/components/input-list.js +6 -4
- package/dist/components/input.js +8 -6
- package/dist/components/rounded-icon.js +5 -2
- package/dist/components/separator.js +2 -2
- package/dist/components/spinner.js +2 -2
- package/dist/components/table-cell.js +3 -3
- package/dist/components/table-header.js +7 -7
- package/dist/components/{types.js → table.types.js} +4 -4
- package/dist/components/wizard-icon.js +52 -0
- package/dist/components/wizard.types.js +8 -0
- package/dist/custom-elements.json +132 -13
- package/dist/esm/b2b-alert.entry.js +4 -4
- package/dist/esm/b2b-anchor.entry.js +2 -2
- package/dist/esm/b2b-button_2.entry.js +13 -9
- package/dist/esm/b2b-card.entry.js +2 -2
- package/dist/esm/b2b-checkbox-group.entry.js +7 -5
- package/dist/esm/b2b-checkbox_3.entry.js +200 -0
- package/dist/esm/b2b-core-components.js +4 -4
- package/dist/esm/b2b-dropdown.entry.js +3 -3
- package/dist/esm/b2b-grid-col.entry.js +1 -1
- package/dist/esm/b2b-grid-row.entry.js +2 -2
- package/dist/esm/b2b-grid.entry.js +1 -1
- package/dist/esm/b2b-headline.entry.js +2 -2
- package/dist/esm/b2b-icon.entry.js +4 -4
- package/dist/esm/b2b-input-group_2.entry.js +12 -9
- package/dist/esm/b2b-input-label.entry.js +1 -1
- package/dist/esm/b2b-input_2.entry.js +8 -7
- package/dist/esm/b2b-label.entry.js +2 -2
- package/dist/esm/b2b-modal.entry.js +5 -5
- package/dist/esm/b2b-pagination.entry.js +5 -5
- package/dist/esm/b2b-paragraph.entry.js +5 -5
- package/dist/esm/b2b-radio-button.entry.js +2 -2
- package/dist/esm/b2b-radio-group.entry.js +2 -2
- package/dist/esm/b2b-required-separator.entry.js +3 -3
- package/dist/esm/b2b-rounded-icon.entry.js +4 -2
- package/dist/esm/b2b-scrollable-container.entry.js +2 -2
- package/dist/esm/b2b-search.entry.js +6 -1
- package/dist/esm/b2b-separator.entry.js +2 -2
- package/dist/esm/b2b-tab-group.entry.js +1 -1
- package/dist/esm/b2b-tab-panel.entry.js +2 -2
- package/dist/esm/b2b-tab.entry.js +2 -2
- package/dist/esm/b2b-table-row.entry.js +77 -22
- package/dist/esm/b2b-table-rowgroup.entry.js +85 -24
- package/dist/esm/b2b-table.entry.js +11 -11
- package/dist/esm/b2b-textarea.entry.js +2 -2
- package/dist/esm/b2b-toggle-button.entry.js +7 -7
- package/dist/esm/b2b-toggle-group.entry.js +3 -3
- package/dist/esm/b2b-tooltip.entry.js +4 -4
- package/dist/esm/b2b-wizard-icon.entry.js +6 -4
- package/dist/esm/b2b-wizard-step.entry.js +22 -0
- package/dist/esm/b2b-wizard.entry.js +57 -0
- package/dist/esm/{index-026605c2.js → index-dfdbf4b9.js} +100 -35
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{types-5aa59787.js → table.types-dd829d83.js} +4 -4
- package/dist/esm/wizard.types-2a03b8e0.js +8 -0
- package/dist/types/components/alert/alert.stories.d.ts +1 -1
- package/dist/types/components/anchor/anchor.stories.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +2 -0
- package/dist/types/components/button/button.stories.d.ts +1 -1
- package/dist/types/components/card/card.stories.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +8 -1
- package/dist/types/components/checkbox/checkbox.stories.d.ts +1 -1
- package/dist/types/components/checkbox-group/checkbox-group.stories.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.stories.d.ts +1 -1
- package/dist/types/components/grid/grid.stories.d.ts +1 -1
- package/dist/types/components/headline/headline.stories.d.ts +1 -1
- package/dist/types/components/icon/icon.stories.d.ts +1 -1
- package/dist/types/components/input/input.d.ts +2 -0
- package/dist/types/components/input/input.stories.d.ts +1 -1
- package/dist/types/components/input-group/input-group.stories.d.ts +1 -1
- package/dist/types/components/input-list/input-list.d.ts +2 -0
- package/dist/types/components/input-list/input-list.stories.d.ts +1 -1
- package/dist/types/components/label/label.stories.d.ts +1 -1
- package/dist/types/components/modal/modal.stories.d.ts +1 -1
- package/dist/types/components/pagination/pagination.stories.d.ts +1 -1
- package/dist/types/components/paragraph/paragraph.stories.d.ts +1 -1
- package/dist/types/components/radio/radio.stories.d.ts +1 -1
- package/dist/types/components/radio-group/radio-group.stories.d.ts +1 -1
- package/dist/types/components/required-separator/required-separator.stories.d.ts +1 -1
- package/dist/types/components/rounded-icon/rounded-icon.d.ts +4 -0
- package/dist/types/components/rounded-icon/rounded-icon.stories.d.ts +1 -1
- package/dist/types/components/scrollable-container/scrollable-container.stories.d.ts +1 -1
- package/dist/types/components/search/search.d.ts +1 -0
- package/dist/types/components/search/search.stories.d.ts +1 -1
- package/dist/types/components/separator/separator.stories.d.ts +1 -1
- package/dist/types/components/spinner/spinner.stories.d.ts +1 -1
- package/dist/types/components/tab-group/tab-group.stories.d.ts +1 -1
- package/dist/types/components/table/table-cell/table-cell.d.ts +1 -1
- package/dist/types/components/table/table-header/table-header.d.ts +1 -1
- package/dist/types/components/table/table-row/table-row.d.ts +23 -7
- package/dist/types/components/table/table-rowgroup/table-rowgroup.d.ts +13 -3
- package/dist/types/components/table/table.d.ts +2 -2
- package/dist/types/components/table/table.stories.d.ts +2 -1
- package/dist/types/components/table/utils.d.ts +4 -0
- package/dist/types/components/textarea/textarea.stories.d.ts +1 -1
- package/dist/types/components/toggle-group/toggle-group.stories.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.stories.d.ts +1 -1
- package/dist/types/components/wizard/wizard-step.d.ts +11 -0
- package/dist/types/components/wizard/wizard.d.ts +19 -0
- package/dist/types/components/wizard/wizard.stories.d.ts +5 -0
- package/dist/types/components/wizard-icon/wizard-icon.d.ts +6 -2
- package/dist/types/components/wizard-icon/wizard-icon.stories.d.ts +3 -1
- package/dist/types/components.d.ts +167 -13
- package/dist/types/docs/tokens/color.stories.d.ts +1 -1
- package/dist/types/docs/tokens/font.stories.d.ts +1 -1
- package/dist/types/docs/tokens/size.stories.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +3 -0
- package/dist/types/utils/interfaces/content.interface.d.ts +4 -0
- package/dist/types/utils/interfaces/form.interface.d.ts +1 -0
- package/dist/types/{components/table/types.d.ts → utils/types/table.types.d.ts} +7 -2
- package/dist/types/utils/types/wizard.types.d.ts +8 -0
- package/dist/web-types.json +184 -9
- package/loader/index.d.ts +1 -1
- package/package.json +5 -5
- package/dist/b2b-core-components/p-08a50b6c.entry.js +0 -1
- package/dist/b2b-core-components/p-10414c0b.entry.js +0 -1
- package/dist/b2b-core-components/p-144a3c59.entry.js +0 -1
- package/dist/b2b-core-components/p-1493f7df.entry.js +0 -1
- package/dist/b2b-core-components/p-14f1b674.entry.js +0 -1
- package/dist/b2b-core-components/p-15a499b0.entry.js +0 -1
- package/dist/b2b-core-components/p-22dab2b4.entry.js +0 -1
- package/dist/b2b-core-components/p-4b25559c.entry.js +0 -1
- package/dist/b2b-core-components/p-515eb49e.entry.js +0 -1
- package/dist/b2b-core-components/p-541ffefb.entry.js +0 -1
- package/dist/b2b-core-components/p-5572aab3.entry.js +0 -1
- package/dist/b2b-core-components/p-5c316460.entry.js +0 -1
- package/dist/b2b-core-components/p-686d6598.entry.js +0 -1
- package/dist/b2b-core-components/p-6e0e6acc.entry.js +0 -1
- package/dist/b2b-core-components/p-6e3b27cd.entry.js +0 -1
- package/dist/b2b-core-components/p-7af1b977.entry.js +0 -1
- package/dist/b2b-core-components/p-7ca9b704.entry.js +0 -1
- package/dist/b2b-core-components/p-81a52d1a.entry.js +0 -1
- package/dist/b2b-core-components/p-8970ae74.entry.js +0 -1
- package/dist/b2b-core-components/p-925e40af.entry.js +0 -1
- package/dist/b2b-core-components/p-965ae161.entry.js +0 -1
- package/dist/b2b-core-components/p-99f8cf34.entry.js +0 -1
- package/dist/b2b-core-components/p-a6248754.entry.js +0 -1
- package/dist/b2b-core-components/p-a7417890.js +0 -2
- package/dist/b2b-core-components/p-b6e0a6ea.entry.js +0 -1
- package/dist/b2b-core-components/p-ba74cde5.entry.js +0 -1
- package/dist/b2b-core-components/p-bf4c58dc.entry.js +0 -1
- package/dist/b2b-core-components/p-d6ce3259.entry.js +0 -1
- package/dist/b2b-core-components/p-da6a1f55.entry.js +0 -1
- package/dist/b2b-core-components/p-f0c565ef.entry.js +0 -1
- package/dist/b2b-core-components/p-fc639b29.entry.js +0 -1
- package/dist/b2b-core-components/p-ff49e330.entry.js +0 -1
- package/dist/cjs/b2b-checkbox.cjs.entry.js +0 -74
- package/dist/cjs/b2b-table-cell_2.cjs.entry.js +0 -119
- package/dist/esm/b2b-checkbox.entry.js +0 -70
- package/dist/esm/b2b-table-cell_2.entry.js +0 -114
- /package/dist/b2b-core-components/{p-4130f1ae.js → p-34eb99cb.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getArgTypes } from '../../docs/config/utils';
|
|
2
2
|
import { html } from 'lit-html';
|
|
3
3
|
import tableDocs from './table.docs.mdx';
|
|
4
|
-
import { ContentAlignment, TableRowgroupTypes, TableSizes } from '
|
|
4
|
+
import { ContentAlignment, TableRowgroupTypes, TableSizes, } from '../../utils/types/table.types';
|
|
5
5
|
import { sampleData, smallSampleData, longSampleData, userSampleData, } from './stories.data';
|
|
6
6
|
import { useArgs } from '@storybook/client-api';
|
|
7
7
|
const Template = ({ data, parentWidth, firstColumnWidth, firstRowHeight, size, textWrap, align, highlight, withDividers, color, }) => {
|
|
@@ -191,11 +191,11 @@ const TemplateSorting = ({ data, firstColumnWidth, size, textWrap, align, highli
|
|
|
191
191
|
export const story110Sorting = TemplateSorting.bind({});
|
|
192
192
|
story110Sorting.args = Object.assign(Object.assign({}, defaultArgs), { withDividers: true, size: 'expand', data: userSampleData });
|
|
193
193
|
story110Sorting.storyName = 'Table with Sorting';
|
|
194
|
-
const TemplateAccordion = ({ data, firstColumnWidth, size, textWrap, align, highlight, withDividers, color, }) => {
|
|
194
|
+
const TemplateAccordion = ({ data, firstColumnWidth, size, textWrap, align, highlight, withDividers, color, selectable, }) => {
|
|
195
195
|
return html `
|
|
196
196
|
<div>
|
|
197
197
|
<b2b-table size="${size}">
|
|
198
|
-
<b2b-table-rowgroup type="header" accordion>
|
|
198
|
+
<b2b-table-rowgroup type="header" accordion selectable="${selectable}">
|
|
199
199
|
<b2b-table-row>
|
|
200
200
|
${data.columns.map((columnName, index) => {
|
|
201
201
|
return html ` <b2b-table-header
|
|
@@ -206,11 +206,12 @@ const TemplateAccordion = ({ data, firstColumnWidth, size, textWrap, align, high
|
|
|
206
206
|
})}
|
|
207
207
|
</b2b-table-row>
|
|
208
208
|
</b2b-table-rowgroup>
|
|
209
|
-
<b2b-table-rowgroup type="body" accordion>
|
|
209
|
+
<b2b-table-rowgroup type="body" accordion selectable="${selectable}">
|
|
210
210
|
${data.rows.map((row, index) => {
|
|
211
211
|
return html `<b2b-table-row
|
|
212
212
|
highlight="${highlight}"
|
|
213
|
-
color=${index === 0 ? color : 'default'}
|
|
213
|
+
color=${index === 0 ? color : 'default'}
|
|
214
|
+
value="${row[0]}">
|
|
214
215
|
${row.map(data => html `<b2b-table-cell
|
|
215
216
|
?divider=${withDividers}
|
|
216
217
|
align="${align}"
|
|
@@ -220,11 +221,16 @@ const TemplateAccordion = ({ data, firstColumnWidth, size, textWrap, align, high
|
|
|
220
221
|
</b2b-table-row>`;
|
|
221
222
|
})}
|
|
222
223
|
</b2b-table-rowgroup>
|
|
223
|
-
<b2b-table-rowgroup
|
|
224
|
+
<b2b-table-rowgroup
|
|
225
|
+
type="body"
|
|
226
|
+
accordion
|
|
227
|
+
opened
|
|
228
|
+
selectable="${selectable}">
|
|
224
229
|
${data.rows.map((row, index) => {
|
|
225
230
|
return html `<b2b-table-row
|
|
226
231
|
highlight="${highlight}"
|
|
227
|
-
color=${index === 0 ? color : 'default'}
|
|
232
|
+
color=${index === 0 ? color : 'default'}
|
|
233
|
+
value="${row[0]}">
|
|
228
234
|
${row.map(data => html `<b2b-table-cell
|
|
229
235
|
?divider=${withDividers}
|
|
230
236
|
align="${align}"
|
|
@@ -239,8 +245,11 @@ const TemplateAccordion = ({ data, firstColumnWidth, size, textWrap, align, high
|
|
|
239
245
|
`;
|
|
240
246
|
};
|
|
241
247
|
export const story120Accordion = TemplateAccordion.bind({});
|
|
242
|
-
story120Accordion.args = Object.assign(Object.assign({}, defaultArgs), { data: sampleData });
|
|
248
|
+
story120Accordion.args = Object.assign(Object.assign({}, defaultArgs), { data: sampleData, selectable: false });
|
|
243
249
|
story120Accordion.storyName = 'Accordion Table';
|
|
250
|
+
export const story130Selectable = TemplateAccordion.bind({});
|
|
251
|
+
story130Selectable.args = Object.assign(Object.assign({}, defaultArgs), { data: sampleData, selectable: true });
|
|
252
|
+
story130Selectable.storyName = 'Selectable Table';
|
|
244
253
|
const tableArgs = getArgTypes('b2b-table');
|
|
245
254
|
const rowGroupArgs = getArgTypes('b2b-table-rowgroup');
|
|
246
255
|
const rowArgs = getArgTypes('b2b-table-row');
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function updateCheckboxState(rows, header) {
|
|
2
|
+
let someSelected = rows.some(item => item.checked === true);
|
|
3
|
+
let everySelected = rows.every(item => item.checked === true);
|
|
4
|
+
header.checked = everySelected;
|
|
5
|
+
header.indeterminate = someSelected && !everySelected;
|
|
6
|
+
}
|
|
7
|
+
export function getAllRows(hostEl) {
|
|
8
|
+
return Array.from(hostEl.querySelectorAll('b2b-table-row'));
|
|
9
|
+
}
|
|
10
|
+
export function getRemainingRows(hostEl) {
|
|
11
|
+
return Array.from(hostEl.querySelectorAll('b2b-table-row')).slice(1);
|
|
12
|
+
}
|
|
13
|
+
export function getFirstRow(hostEl) {
|
|
14
|
+
const firstRow = hostEl.querySelector('b2b-table-row');
|
|
15
|
+
if (firstRow != null) {
|
|
16
|
+
return firstRow;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on Tue,
|
|
3
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
4
4
|
*/
|
|
5
5
|
:root, :host {
|
|
6
6
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -76,8 +76,7 @@
|
|
|
76
76
|
--b2b-size-copy-200: var(--b2b-size-45);
|
|
77
77
|
--b2b-size-copy-125: var(--b2b-size-40);
|
|
78
78
|
--b2b-size-copy-100: var(--b2b-size-35);
|
|
79
|
-
--b2b-size-copy-
|
|
80
|
-
--b2b-size-copy-50: var(--b2b-size-25);
|
|
79
|
+
--b2b-size-copy-50: var(--b2b-size-30);
|
|
81
80
|
--b2b-size-border-no-radius-bottom: var(--b2b-size-7) var(--b2b-size-7) 0 0;
|
|
82
81
|
--b2b-size-border-no-radius-top: 0 0 var(--b2b-size-7) var(--b2b-size-7);
|
|
83
82
|
--b2b-size-border-no-radius-right: var(--b2b-size-7) 0 0 var(--b2b-size-7);
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
124
|
* Do not edit directly
|
|
126
|
-
* Generated on Tue,
|
|
125
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
127
126
|
*/
|
|
128
127
|
:root [data-theme="dark"] {
|
|
129
128
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -249,7 +248,7 @@
|
|
|
249
248
|
}
|
|
250
249
|
:host(.b2b-textarea) span {
|
|
251
250
|
display: block;
|
|
252
|
-
font-size: var(--b2b-size-copy-
|
|
251
|
+
font-size: var(--b2b-size-copy-50);
|
|
253
252
|
line-height: var(--b2b-size-copy-line-height-75);
|
|
254
253
|
color: var(--b2b-color-grey-300);
|
|
255
254
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('B2B-Textarea', () => {
|
|
3
|
+
let page;
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
page = await newE2EPage();
|
|
6
|
+
await page.setContent(`<b2b-textarea label="Test"></b2b-textarea>`);
|
|
7
|
+
});
|
|
8
|
+
it('should render the textarea component', async () => {
|
|
9
|
+
const element = await page.find('b2b-textarea');
|
|
10
|
+
expect(element).not.toBeNull();
|
|
11
|
+
});
|
|
12
|
+
it('should render the label', async () => {
|
|
13
|
+
const label = await page.find({ text: 'Test' });
|
|
14
|
+
expect(label).not.toBeNull();
|
|
15
|
+
});
|
|
16
|
+
it('should emit when the user types', async () => {
|
|
17
|
+
const element = await page.find('b2b-textarea >>> textarea');
|
|
18
|
+
const inputSpy = await page.spyOnEvent('b2b-input');
|
|
19
|
+
await element.type('ABC');
|
|
20
|
+
page.waitForChanges();
|
|
21
|
+
expect(inputSpy).toHaveReceivedEvent();
|
|
22
|
+
});
|
|
23
|
+
it('should not allow typing when disabled', async () => {
|
|
24
|
+
const textarea = `<b2b-textarea label="Test" disabled></b2b-textarea>`;
|
|
25
|
+
page = await newE2EPage();
|
|
26
|
+
await page.setContent(textarea);
|
|
27
|
+
const element = await page.find('b2b-textarea >>> textarea');
|
|
28
|
+
const inputSpy = await page.spyOnEvent('b2b-input');
|
|
29
|
+
await element.type('ABC');
|
|
30
|
+
expect(inputSpy).not.toHaveReceivedEvent();
|
|
31
|
+
});
|
|
32
|
+
it('should autofocus', async () => {
|
|
33
|
+
const textarea = `<b2b-textarea label="Test" autofocus></b2b-textarea>`;
|
|
34
|
+
page = await newE2EPage();
|
|
35
|
+
await page.setContent(textarea);
|
|
36
|
+
const element = await page.find('b2b-textarea');
|
|
37
|
+
expect(element).toHaveAttribute('autofocus');
|
|
38
|
+
});
|
|
39
|
+
it('should display a hint text', async () => {
|
|
40
|
+
const textarea = `<b2b-textarea label="Test" hint="A test hint"></b2b-textarea>`;
|
|
41
|
+
page = await newE2EPage();
|
|
42
|
+
await page.setContent(textarea);
|
|
43
|
+
const hint = await page.find('b2b-textarea >>> span');
|
|
44
|
+
expect(hint).toEqualText('A test hint');
|
|
45
|
+
});
|
|
46
|
+
it('should display an error text when the textarea is invalid', async () => {
|
|
47
|
+
const textarea = `<b2b-textarea label="Test" error="A test error" invalid></b2b-textarea>`;
|
|
48
|
+
page = await newE2EPage();
|
|
49
|
+
await page.setContent(textarea);
|
|
50
|
+
const error = await page.find('b2b-textarea >>> span');
|
|
51
|
+
expect(error).toEqualText('A test error');
|
|
52
|
+
});
|
|
53
|
+
it('should not display a hint when an error message is present and the textarea is invalid', async () => {
|
|
54
|
+
const textarea = `<b2b-textarea label="Test" error="A test error" hint="A test hint" invalid></b2b-textarea>`;
|
|
55
|
+
page = await newE2EPage();
|
|
56
|
+
await page.setContent(textarea);
|
|
57
|
+
const error = await page.find('b2b-textarea >>> span');
|
|
58
|
+
expect(error).toEqualText('A test error');
|
|
59
|
+
});
|
|
60
|
+
it('should not display an error if the textarea is invalid and disabled', async () => {
|
|
61
|
+
const textarea = `<b2b-textarea label="Test" error="A test error" hint="A test hint" invalid disabled></b2b-textarea>`;
|
|
62
|
+
page = await newE2EPage();
|
|
63
|
+
await page.setContent(textarea);
|
|
64
|
+
const hint = await page.find('b2b-textarea >>> span');
|
|
65
|
+
expect(hint).toEqualText('A test hint');
|
|
66
|
+
});
|
|
67
|
+
it('should accept a maximum length', async () => {
|
|
68
|
+
const textarea = `<b2b-textarea label="Test" max-length="10"></b2b-textarea>`;
|
|
69
|
+
const input = 'An input with 27 characters';
|
|
70
|
+
page = await newE2EPage();
|
|
71
|
+
await page.setContent(textarea);
|
|
72
|
+
const element = await page.find('b2b-textarea >>> textarea');
|
|
73
|
+
await element.type(input);
|
|
74
|
+
const value = await element.getProperty('value');
|
|
75
|
+
expect(value).toEqual('An input w');
|
|
76
|
+
});
|
|
77
|
+
it('should support form building from the shadow DOM', async () => {
|
|
78
|
+
const form = `<form>
|
|
79
|
+
<b2b-textarea label="Test"></textarea>
|
|
80
|
+
<button type="submit">Submit</button>
|
|
81
|
+
</form>`;
|
|
82
|
+
page = await newE2EPage();
|
|
83
|
+
await page.setContent(form);
|
|
84
|
+
const handleFormData = jest.fn();
|
|
85
|
+
const formdataEventSpy = await page.spyOnEvent('formdata', handleFormData);
|
|
86
|
+
await page.evaluate(() => {
|
|
87
|
+
document.querySelector('button').click();
|
|
88
|
+
});
|
|
89
|
+
expect(formdataEventSpy).toHaveReceivedEvent();
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on Tue,
|
|
3
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
4
4
|
*/
|
|
5
5
|
:root, :host {
|
|
6
6
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -76,8 +76,7 @@
|
|
|
76
76
|
--b2b-size-copy-200: var(--b2b-size-45);
|
|
77
77
|
--b2b-size-copy-125: var(--b2b-size-40);
|
|
78
78
|
--b2b-size-copy-100: var(--b2b-size-35);
|
|
79
|
-
--b2b-size-copy-
|
|
80
|
-
--b2b-size-copy-50: var(--b2b-size-25);
|
|
79
|
+
--b2b-size-copy-50: var(--b2b-size-30);
|
|
81
80
|
--b2b-size-border-no-radius-bottom: var(--b2b-size-7) var(--b2b-size-7) 0 0;
|
|
82
81
|
--b2b-size-border-no-radius-top: 0 0 var(--b2b-size-7) var(--b2b-size-7);
|
|
83
82
|
--b2b-size-border-no-radius-right: var(--b2b-size-7) 0 0 var(--b2b-size-7);
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
124
|
* Do not edit directly
|
|
126
|
-
* Generated on Tue,
|
|
125
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
127
126
|
*/
|
|
128
127
|
:root [data-theme="dark"] {
|
|
129
128
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -223,7 +222,7 @@
|
|
|
223
222
|
position: relative;
|
|
224
223
|
margin: 0;
|
|
225
224
|
}
|
|
226
|
-
:host .b2b-toggle-
|
|
225
|
+
:host .b2b-toggle-button__input {
|
|
227
226
|
border: 0;
|
|
228
227
|
clip: rect(0, 0, 0, 0);
|
|
229
228
|
height: 1px;
|
|
@@ -231,7 +230,7 @@
|
|
|
231
230
|
position: absolute !important;
|
|
232
231
|
width: 1px;
|
|
233
232
|
}
|
|
234
|
-
:host .b2b-toggle-
|
|
233
|
+
:host .b2b-toggle-button__label {
|
|
235
234
|
display: inline-block;
|
|
236
235
|
position: relative;
|
|
237
236
|
box-sizing: border-box;
|
|
@@ -247,23 +246,23 @@
|
|
|
247
246
|
text-decoration: none;
|
|
248
247
|
padding: 0 var(--b2b-size-20);
|
|
249
248
|
}
|
|
250
|
-
:host .b2b-toggle-
|
|
249
|
+
:host .b2b-toggle-button__label:hover {
|
|
251
250
|
background-color: var(--b2b-color-grey-200);
|
|
252
251
|
}
|
|
253
|
-
:host .b2b-toggle-
|
|
252
|
+
:host .b2b-toggle-button__input:focus + label {
|
|
254
253
|
outline: 2px solid -webkit-focus-ring-color;
|
|
255
254
|
z-index: 1;
|
|
256
255
|
transition: none;
|
|
257
256
|
}
|
|
258
|
-
:host .b2b-toggle-
|
|
257
|
+
:host .b2b-toggle-button__input--disabled:focus + label {
|
|
259
258
|
outline: none;
|
|
260
259
|
}
|
|
261
|
-
:host .b2b-toggle-
|
|
260
|
+
:host .b2b-toggle-button__label--checked, :host .b2b-toggle-button__label--checked:hover {
|
|
262
261
|
color: var(--b2b-color-white-100);
|
|
263
262
|
background-color: var(--b2b-color-black-50);
|
|
264
263
|
border-color: var(--b2b-color-black-50);
|
|
265
264
|
}
|
|
266
|
-
:host .b2b-toggle-
|
|
265
|
+
:host .b2b-toggle-button__label--disabled, :host .b2b-toggle-button__label--disabled:hover {
|
|
267
266
|
pointer-events: none;
|
|
268
267
|
color: var(--b2b-color-grey-250);
|
|
269
268
|
border-color: var(--b2b-color-grey-100);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('b2b-toggle-button', () => {
|
|
3
|
+
let page;
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
page = await newE2EPage();
|
|
6
|
+
await page.setContent(`<b2b-toggle-button checked="false" name="toggle-1" label="Unselected" value="1"></b2b-toggle-button>`);
|
|
7
|
+
});
|
|
8
|
+
it('renders', async () => {
|
|
9
|
+
const element = await page.find('b2b-toggle-button');
|
|
10
|
+
expect(element).not.toBeNull();
|
|
11
|
+
});
|
|
12
|
+
it('checks the button when selected', async () => {
|
|
13
|
+
const element = await page.find('b2b-toggle-button');
|
|
14
|
+
await element.click();
|
|
15
|
+
await page.waitForChanges();
|
|
16
|
+
const check = await element.getProperty('checked');
|
|
17
|
+
expect(check).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
it('emits its value when selected', async () => {
|
|
20
|
+
const element = await page.find('b2b-toggle-button');
|
|
21
|
+
const spy = await page.spyOnEvent('b2b-change');
|
|
22
|
+
await element.click();
|
|
23
|
+
await page.waitForChanges();
|
|
24
|
+
expect(spy).toHaveReceivedEvent();
|
|
25
|
+
expect(spy).toHaveReceivedEventDetail({ value: '1' });
|
|
26
|
+
});
|
|
27
|
+
it('should not emit when a button is disabled', async () => {
|
|
28
|
+
const element = await page.find('b2b-toggle-button');
|
|
29
|
+
await element.setProperty('disabled', true);
|
|
30
|
+
await page.waitForChanges();
|
|
31
|
+
const spy = await page.spyOnEvent('b2b-change');
|
|
32
|
+
await element.click();
|
|
33
|
+
await page.waitForChanges();
|
|
34
|
+
expect(spy).not.toHaveReceivedEvent();
|
|
35
|
+
});
|
|
36
|
+
it('should not emit when a button is already selected', async () => {
|
|
37
|
+
const element = await page.find('b2b-toggle-button');
|
|
38
|
+
const spy = await page.spyOnEvent('b2b-change');
|
|
39
|
+
await element.click();
|
|
40
|
+
await element.click();
|
|
41
|
+
await page.waitForChanges();
|
|
42
|
+
expect(spy).toHaveReceivedEventTimes(1);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -35,12 +35,12 @@ export class B2bToggleButtonComponent {
|
|
|
35
35
|
'b2b-toggle-button': true,
|
|
36
36
|
'b2b-toggle-button--disabled': this.disabled,
|
|
37
37
|
} }, h("input", { tabindex: 0, class: {
|
|
38
|
-
'b2b-toggle-
|
|
39
|
-
'b2b-toggle-
|
|
38
|
+
'b2b-toggle-button__input': true,
|
|
39
|
+
'b2b-toggle-button__input--disabled': this.disabled,
|
|
40
40
|
}, "aria-labelledby": this.name, type: "radio", checked: this.checked && !this.disabled, disabled: this.disabled, name: this.name, value: this.value }), h("label", { id: this.name, tabindex: -1, class: {
|
|
41
|
-
'b2b-toggle-
|
|
42
|
-
'b2b-toggle-
|
|
43
|
-
'b2b-toggle-
|
|
41
|
+
'b2b-toggle-button__label': true,
|
|
42
|
+
'b2b-toggle-button__label--disabled': this.disabled,
|
|
43
|
+
'b2b-toggle-button__label--checked': this.checked && !this.disabled,
|
|
44
44
|
} }, this.label))));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "b2b-toggle-button"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on Tue,
|
|
3
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
4
4
|
*/
|
|
5
5
|
:root, :host {
|
|
6
6
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -76,8 +76,7 @@
|
|
|
76
76
|
--b2b-size-copy-200: var(--b2b-size-45);
|
|
77
77
|
--b2b-size-copy-125: var(--b2b-size-40);
|
|
78
78
|
--b2b-size-copy-100: var(--b2b-size-35);
|
|
79
|
-
--b2b-size-copy-
|
|
80
|
-
--b2b-size-copy-50: var(--b2b-size-25);
|
|
79
|
+
--b2b-size-copy-50: var(--b2b-size-30);
|
|
81
80
|
--b2b-size-border-no-radius-bottom: var(--b2b-size-7) var(--b2b-size-7) 0 0;
|
|
82
81
|
--b2b-size-border-no-radius-top: 0 0 var(--b2b-size-7) var(--b2b-size-7);
|
|
83
82
|
--b2b-size-border-no-radius-right: var(--b2b-size-7) 0 0 var(--b2b-size-7);
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
124
|
* Do not edit directly
|
|
126
|
-
* Generated on Tue,
|
|
125
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
127
126
|
*/
|
|
128
127
|
:root [data-theme="dark"] {
|
|
129
128
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -240,6 +239,6 @@
|
|
|
240
239
|
::slotted(b2b-toggle-button[disabled]:first-child) {
|
|
241
240
|
--b2b-border-left: 1px solid var(--b2b-color-grey-100);
|
|
242
241
|
}
|
|
243
|
-
.b2b-toggle-group
|
|
242
|
+
.b2b-toggle-group--disabled ::slotted(b2b-toggle-button[disabled]) {
|
|
244
243
|
--b2b-border-left: 1px solid var(--b2b-color-grey-100);
|
|
245
244
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('b2b-toggle-group', () => {
|
|
3
|
+
let page;
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
page = await newE2EPage();
|
|
6
|
+
await page.setContent(`<b2b-toggle-group name="toggle-group-1">
|
|
7
|
+
<b2b-toggle-button name="toggle-group-1" value="1" label="One"></b2b-toggle-button>
|
|
8
|
+
<b2b-toggle-button name="toggle-group-1" value="2" label="Two"></b2b-toggle-button>
|
|
9
|
+
</b2b-toggle-group>`);
|
|
10
|
+
});
|
|
11
|
+
it('should render the toggle group', async () => {
|
|
12
|
+
const element = await page.find('b2b-toggle-group');
|
|
13
|
+
expect(element).not.toBeNull();
|
|
14
|
+
});
|
|
15
|
+
it('should emit an event when a button is checked', async () => {
|
|
16
|
+
const firstButton = await page.find({ text: 'Two' });
|
|
17
|
+
const changeSpy = await page.spyOnEvent('b2b-group-change');
|
|
18
|
+
await firstButton.click();
|
|
19
|
+
await page.waitForChanges();
|
|
20
|
+
expect(changeSpy).toHaveReceivedEvent();
|
|
21
|
+
expect(changeSpy).toHaveReceivedEventDetail({ value: '2' });
|
|
22
|
+
});
|
|
23
|
+
it('should not emit an event when the checked button is already selected', async () => {
|
|
24
|
+
const firstButton = await page.find({ text: 'Two' });
|
|
25
|
+
const changeSpy = await page.spyOnEvent('b2b-group-change');
|
|
26
|
+
await firstButton.click();
|
|
27
|
+
await firstButton.click();
|
|
28
|
+
await page.waitForChanges();
|
|
29
|
+
expect(changeSpy).toHaveReceivedEventTimes(1);
|
|
30
|
+
});
|
|
31
|
+
it('should not select any buttons if the group is disabled', async () => {
|
|
32
|
+
const element = await page.find('b2b-toggle-group');
|
|
33
|
+
const changeSpy = await page.spyOnEvent('b2b-group-change');
|
|
34
|
+
await element.setProperty('disabled', true);
|
|
35
|
+
await page.waitForChanges();
|
|
36
|
+
const button = await page.find({ text: 'One' });
|
|
37
|
+
await button.click();
|
|
38
|
+
await page.waitForChanges();
|
|
39
|
+
expect(changeSpy).not.toHaveReceivedEvent();
|
|
40
|
+
});
|
|
41
|
+
it('should navigate and select a button by using a keyboard', async () => {
|
|
42
|
+
await page.keyboard.press('Tab');
|
|
43
|
+
await page.waitForChanges();
|
|
44
|
+
await page.keyboard.press('Space');
|
|
45
|
+
await page.waitForChanges();
|
|
46
|
+
const element = await page.find('b2b-toggle-button');
|
|
47
|
+
const checked = await element.getProperty('checked');
|
|
48
|
+
expect(checked).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
it('should select first element if none other is pre-selected ', async () => {
|
|
51
|
+
const firstButton = await page.find('b2b-toggle-button');
|
|
52
|
+
const isSelected = await firstButton.getProperty('checked');
|
|
53
|
+
expect(isSelected).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
it('should not select first element if any element is pre-selected ', async () => {
|
|
56
|
+
page = await newE2EPage();
|
|
57
|
+
await page.setContent(`<b2b-toggle-group name="toggle-group-1">
|
|
58
|
+
<b2b-toggle-button name="toggle-group-1" value="1" label="One"></b2b-toggle-button>
|
|
59
|
+
<b2b-toggle-button checked name="toggle-group-1" value="2" label="Two"></b2b-toggle-button>
|
|
60
|
+
</b2b-toggle-group>`);
|
|
61
|
+
const firstButton = await page.find('b2b-toggle-button');
|
|
62
|
+
const isSelected = await firstButton.getProperty('checked');
|
|
63
|
+
expect(isSelected).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -47,7 +47,7 @@ export class B2BToggleGroup {
|
|
|
47
47
|
render() {
|
|
48
48
|
return (h(Host, null, h("div", { class: {
|
|
49
49
|
'b2b-toggle-group': true,
|
|
50
|
-
'b2b-toggle-group
|
|
50
|
+
'b2b-toggle-group--disabled': this.disabled,
|
|
51
51
|
} }, h("fieldset", null, h("slot", null)))));
|
|
52
52
|
}
|
|
53
53
|
static get is() { return "b2b-toggle-group"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on Tue,
|
|
3
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
4
4
|
*/
|
|
5
5
|
:root, :host {
|
|
6
6
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -76,8 +76,7 @@
|
|
|
76
76
|
--b2b-size-copy-200: var(--b2b-size-45);
|
|
77
77
|
--b2b-size-copy-125: var(--b2b-size-40);
|
|
78
78
|
--b2b-size-copy-100: var(--b2b-size-35);
|
|
79
|
-
--b2b-size-copy-
|
|
80
|
-
--b2b-size-copy-50: var(--b2b-size-25);
|
|
79
|
+
--b2b-size-copy-50: var(--b2b-size-30);
|
|
81
80
|
--b2b-size-border-no-radius-bottom: var(--b2b-size-7) var(--b2b-size-7) 0 0;
|
|
82
81
|
--b2b-size-border-no-radius-top: 0 0 var(--b2b-size-7) var(--b2b-size-7);
|
|
83
82
|
--b2b-size-border-no-radius-right: var(--b2b-size-7) 0 0 var(--b2b-size-7);
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
124
|
* Do not edit directly
|
|
126
|
-
* Generated on Tue,
|
|
125
|
+
* Generated on Tue, 22 Aug 2023 11:28:34 GMT
|
|
127
126
|
*/
|
|
128
127
|
:root [data-theme="dark"] {
|
|
129
128
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -214,15 +213,15 @@
|
|
|
214
213
|
font-family: ObcIcons;
|
|
215
214
|
src: url("https://pattern-library.portal.otto.market/static/assets/fonts/obc-icons.woff");
|
|
216
215
|
}
|
|
217
|
-
.b2b-
|
|
216
|
+
.b2b-tooltip__trigger {
|
|
218
217
|
position: relative;
|
|
219
218
|
}
|
|
220
|
-
.b2b-tooltip--visible.b2b-
|
|
219
|
+
.b2b-tooltip--visible.b2b-tooltip__content, .b2b-tooltip--visible.b2b-tooltip__content::before {
|
|
221
220
|
opacity: 1;
|
|
222
221
|
visibility: visible;
|
|
223
222
|
transition-delay: 100ms;
|
|
224
223
|
}
|
|
225
|
-
.b2b-
|
|
224
|
+
.b2b-tooltip__content {
|
|
226
225
|
background-color: var(--b2b-color-black-100);
|
|
227
226
|
white-space: pre-wrap;
|
|
228
227
|
color: var(--b2b-color-white-100);
|
|
@@ -230,7 +229,7 @@
|
|
|
230
229
|
border-radius: var(--b2b-size-7);
|
|
231
230
|
position: absolute;
|
|
232
231
|
line-height: var(--b2b-size-copy-line-height-75);
|
|
233
|
-
font-size: var(--b2b-size-copy-
|
|
232
|
+
font-size: var(--b2b-size-copy-50);
|
|
234
233
|
box-sizing: border-box;
|
|
235
234
|
text-align: start;
|
|
236
235
|
width: max-content;
|
|
@@ -240,7 +239,7 @@
|
|
|
240
239
|
z-index: 1000001;
|
|
241
240
|
transition: opacity 0.4s ease;
|
|
242
241
|
}
|
|
243
|
-
.b2b-
|
|
242
|
+
.b2b-tooltip__content::before {
|
|
244
243
|
content: "";
|
|
245
244
|
position: absolute;
|
|
246
245
|
z-index: 1000001;
|
|
@@ -252,40 +251,40 @@
|
|
|
252
251
|
visibility: hidden;
|
|
253
252
|
transition: opacity 0.4s ease;
|
|
254
253
|
}
|
|
255
|
-
.b2b-tooltip--left .b2b-
|
|
254
|
+
.b2b-tooltip--left .b2b-tooltip__content {
|
|
256
255
|
inset: 50% calc(100% + 8px) auto auto;
|
|
257
256
|
transform: translateY(-50%);
|
|
258
257
|
}
|
|
259
|
-
.b2b-tooltip--left .b2b-
|
|
258
|
+
.b2b-tooltip--left .b2b-tooltip__content::before {
|
|
260
259
|
top: calc(50% - 0.375rem);
|
|
261
260
|
transform: rotate(270deg);
|
|
262
261
|
left: 100%;
|
|
263
262
|
margin-right: -0.75rem;
|
|
264
263
|
}
|
|
265
|
-
.b2b-tooltip--right .b2b-
|
|
264
|
+
.b2b-tooltip--right .b2b-tooltip__content {
|
|
266
265
|
inset: 50% auto auto calc(100% + 8px);
|
|
267
266
|
transform: translateY(-50%);
|
|
268
267
|
}
|
|
269
|
-
.b2b-tooltip--right .b2b-
|
|
268
|
+
.b2b-tooltip--right .b2b-tooltip__content::before {
|
|
270
269
|
top: calc(50% - 0.375rem);
|
|
271
270
|
transform: rotate(90deg);
|
|
272
271
|
margin-left: -0.75rem;
|
|
273
272
|
right: 100%;
|
|
274
273
|
}
|
|
275
|
-
.b2b-tooltip--bottom .b2b-
|
|
274
|
+
.b2b-tooltip--bottom .b2b-tooltip__content {
|
|
276
275
|
inset: calc(150% + 0.375rem) auto auto 50%;
|
|
277
276
|
transform: translateX(-50%) translateY(-0.5rem);
|
|
278
277
|
}
|
|
279
|
-
.b2b-tooltip--bottom .b2b-
|
|
278
|
+
.b2b-tooltip--bottom .b2b-tooltip__content::before {
|
|
280
279
|
left: calc(50% - 0.375rem);
|
|
281
280
|
margin-top: -0.7rem;
|
|
282
281
|
transform: rotate(180deg) translateY(0.35rem);
|
|
283
282
|
}
|
|
284
|
-
.b2b-tooltip--top .b2b-
|
|
283
|
+
.b2b-tooltip--top .b2b-tooltip__content {
|
|
285
284
|
inset: auto auto 100% 50%;
|
|
286
285
|
transform: translateX(-50%) translateY(-0.5rem);
|
|
287
286
|
}
|
|
288
|
-
.b2b-tooltip--top .b2b-
|
|
287
|
+
.b2b-tooltip--top .b2b-tooltip__content::before {
|
|
289
288
|
left: calc(50% - 0.375rem);
|
|
290
289
|
margin-bottom: -0.75rem;
|
|
291
290
|
top: 100%;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('B2B Tooltip', () => {
|
|
3
|
+
const expectToBeVisibleAfterTransition = async (page, tooltipDiv) => {
|
|
4
|
+
await page.$eval('b2b-tooltip', el => {
|
|
5
|
+
const tooltipElm = el.shadowRoot.querySelector('div');
|
|
6
|
+
tooltipElm.addEventListener('transitionend', () => {
|
|
7
|
+
expect(tooltipDiv.isVisible()).toBe(true);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
it('renders', async () => {
|
|
12
|
+
const page = await newE2EPage();
|
|
13
|
+
await page.setContent('<b2b-tooltip content="I am a tooltip">trigger</b2b-tooltip>');
|
|
14
|
+
const element = await page.find('b2b-tooltip');
|
|
15
|
+
expect(element).toHaveClass('hydrated');
|
|
16
|
+
const tooltipDiv = await page.find('b2b-tooltip >>> div');
|
|
17
|
+
expect(await tooltipDiv.isVisible()).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
it('appears on hover when no trigger is specified', async () => {
|
|
20
|
+
const page = await newE2EPage();
|
|
21
|
+
await page.setContent('<b2b-tooltip content="I am a tooltip">trigger</b2b-tooltip>');
|
|
22
|
+
const trigger = await page.find('b2b-tooltip >>> span');
|
|
23
|
+
await trigger.hover();
|
|
24
|
+
await page.waitForChanges();
|
|
25
|
+
const tooltipDiv = await page.find('b2b-tooltip >>> div');
|
|
26
|
+
expect(await tooltipDiv.isVisible()).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
it('appears on focus when a focusable element is slotted and the trigger is set to focus', async () => {
|
|
29
|
+
const page = await newE2EPage();
|
|
30
|
+
await page.setContent('<b2b-tooltip content="I am a tooltip" trigger="focus"><button>Focus me</button></b2b-tooltip>');
|
|
31
|
+
const tooltipDiv = await page.find('b2b-tooltip >>> div');
|
|
32
|
+
expect(await tooltipDiv.isVisible()).toBe(false);
|
|
33
|
+
await page.keyboard.press('Tab');
|
|
34
|
+
await page.waitForChanges();
|
|
35
|
+
await expectToBeVisibleAfterTransition(page, tooltipDiv);
|
|
36
|
+
});
|
|
37
|
+
it('does not appear on hover when the trigger is set to focus', async () => {
|
|
38
|
+
const page = await newE2EPage();
|
|
39
|
+
await page.setContent('<b2b-tooltip content="I am a tooltip" trigger="focus"><button>Focus me</button></b2b-tooltip>');
|
|
40
|
+
const tooltipDiv = await page.find('b2b-tooltip >>> div');
|
|
41
|
+
const trigger = await page.find('b2b-tooltip >>> span');
|
|
42
|
+
await trigger.hover();
|
|
43
|
+
await page.waitForChanges();
|
|
44
|
+
expect(await tooltipDiv.isVisible()).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
it('does not appear on hover when the trigger is set to custom', async () => {
|
|
47
|
+
const page = await newE2EPage();
|
|
48
|
+
await page.setContent('<b2b-tooltip content="I am a tooltip" trigger="custom"><button>Focus me</button></b2b-tooltip>');
|
|
49
|
+
const tooltipDiv = await page.find('b2b-tooltip >>> div');
|
|
50
|
+
const trigger = await page.find('b2b-tooltip >>> span');
|
|
51
|
+
await trigger.hover();
|
|
52
|
+
await page.waitForChanges();
|
|
53
|
+
expect(await tooltipDiv.isVisible()).toBe(false);
|
|
54
|
+
});
|
|
55
|
+
it('appears when the trigger is set to custom and the opened property changes', async () => {
|
|
56
|
+
const page = await newE2EPage();
|
|
57
|
+
await page.setContent('<b2b-tooltip content="I am a tooltip" trigger="custom" opened="false"><button>Focus me</button></b2b-tooltip>');
|
|
58
|
+
const element = await page.find('b2b-tooltip');
|
|
59
|
+
const tooltipDiv = await page.find('b2b-tooltip >>> div');
|
|
60
|
+
element.setAttribute('opened', true);
|
|
61
|
+
await page.waitForChanges();
|
|
62
|
+
await expectToBeVisibleAfterTransition(page, tooltipDiv);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -61,9 +61,9 @@ export class B2BTooltipComponent {
|
|
|
61
61
|
render() {
|
|
62
62
|
return (h(Host, { onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave }, h("span", { class: {
|
|
63
63
|
[`b2b-tooltip--${this.position}`]: true,
|
|
64
|
-
'b2b-
|
|
64
|
+
'b2b-tooltip__trigger': true,
|
|
65
65
|
} }, h("slot", null), h("div", { class: {
|
|
66
|
-
'b2b-
|
|
66
|
+
'b2b-tooltip__content': true,
|
|
67
67
|
'b2b-tooltip--visible': this.opened,
|
|
68
68
|
} }, h("slot", { name: "content" }, this.content)))));
|
|
69
69
|
}
|