@otto-de/b2b-core-components 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-b95089a7.entry.js → p-04fc18cd.entry.js} +1 -1
- package/dist/b2b-core-components/{p-c20baf90.entry.js → p-077217b3.entry.js} +1 -1
- package/dist/b2b-core-components/{p-03beebf5.entry.js → p-0965b990.entry.js} +1 -1
- 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-197c1a6d.entry.js +1 -0
- package/dist/b2b-core-components/{p-75f84f53.entry.js → p-1d007eea.entry.js} +1 -1
- package/dist/b2b-core-components/{p-6997ceb0.entry.js → p-1e2752b2.entry.js} +1 -1
- package/dist/b2b-core-components/{p-06ef4c5e.entry.js → p-2328144b.entry.js} +1 -1
- 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-60c7f6f7.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-163fe245.entry.js → p-44ccd8f4.entry.js} +1 -1
- package/dist/b2b-core-components/{p-38791fb9.entry.js → p-542a358a.entry.js} +1 -1
- 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-e1622cb8.entry.js → p-6140304e.entry.js} +1 -1
- package/dist/b2b-core-components/p-62e43f91.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-bcf36531.entry.js → p-8ad1bb92.entry.js} +1 -1
- 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-c8294029.entry.js → p-b3ccfc58.entry.js} +1 -1
- package/dist/b2b-core-components/{p-2b3a67db.entry.js → p-b6a8a06f.entry.js} +1 -1
- package/dist/b2b-core-components/{p-5c2db521.entry.js → p-b8049234.entry.js} +1 -1
- package/dist/b2b-core-components/p-c294dd0c.entry.js +1 -0
- package/dist/b2b-core-components/{p-5d7866e8.entry.js → p-d07210e2.entry.js} +1 -1
- package/dist/b2b-core-components/p-d7bb8aa1.entry.js +1 -0
- package/dist/b2b-core-components/{p-76e240f8.entry.js → p-d83c2084.entry.js} +1 -1
- package/dist/b2b-core-components/{p-dcd80266.entry.js → p-db7d2ec3.entry.js} +1 -1
- package/dist/b2b-core-components/{p-9facba86.entry.js → p-dd79ab5b.entry.js} +1 -1
- package/dist/b2b-core-components/{p-bda69b9a.entry.js → p-e5b78075.entry.js} +1 -1
- package/dist/b2b-core-components/{p-7b04f40b.entry.js → p-e811411a.entry.js} +1 -1
- package/dist/b2b-core-components/p-f190bf79.entry.js +1 -0
- package/dist/b2b-core-components/{p-1e1bdb50.entry.js → p-f24515bf.entry.js} +1 -1
- 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 +1 -1
- package/dist/cjs/b2b-button_2.cjs.entry.js +12 -8
- package/dist/cjs/b2b-card.cjs.entry.js +1 -1
- package/dist/cjs/b2b-checkbox-group.cjs.entry.js +7 -5
- package/dist/cjs/{b2b-table-cell_2.cjs.entry.js → b2b-checkbox_3.cjs.entry.js} +94 -7
- 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 +1 -1
- package/dist/cjs/b2b-icon.cjs.entry.js +4 -4
- package/dist/cjs/b2b-input-group_2.cjs.entry.js +10 -21
- 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 +1 -1
- 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 +1 -1
- package/dist/cjs/b2b-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/b2b-required-separator.cjs.entry.js +3 -3
- package/dist/cjs/b2b-rounded-icon.cjs.entry.js +1 -1
- package/dist/cjs/b2b-scrollable-container.cjs.entry.js +1 -1
- package/dist/cjs/b2b-search.cjs.entry.js +1 -1
- package/dist/cjs/b2b-separator.cjs.entry.js +1 -1
- package/dist/cjs/b2b-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/b2b-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/b2b-tab.cjs.entry.js +1 -1
- package/dist/cjs/b2b-table-row.cjs.entry.js +77 -21
- package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +85 -24
- package/dist/cjs/b2b-table.cjs.entry.js +10 -10
- package/dist/cjs/b2b-textarea.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/b2b-wizard-step.cjs.entry.js +4 -4
- package/dist/cjs/b2b-wizard.cjs.entry.js +2 -2
- package/dist/cjs/{index-496aa5dd.js → index-04e07a00.js} +88 -31
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{table.types-bb0926c7.js → table.types-00c8228a.js} +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/alert/alert.css +7 -7
- 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 +2 -2
- package/dist/collection/components/anchor/anchor.spec.js +68 -0
- package/dist/collection/components/button/button.css +35 -39
- 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 +2 -2
- 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 +34 -13
- 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 +5 -5
- 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 +7 -7
- 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 +2 -2
- 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 +9 -9
- 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 +14 -14
- 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 +4 -4
- package/dist/collection/components/input-group/input-group.e2e.js +76 -0
- package/dist/collection/components/input-group/input-group.js +4 -21
- 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 +7 -7
- 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 +2 -2
- 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 +13 -18
- 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 +7 -7
- 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 +9 -9
- 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 +2 -2
- 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 +2 -2
- 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 +4 -4
- 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 +2 -2
- package/dist/collection/components/scrollable-container/scrollable-container.css +2 -2
- package/dist/collection/components/search/search.e2e.js +97 -0
- package/dist/collection/components/separator/separator.css +2 -2
- package/dist/collection/components/separator/separator.e2e.js +22 -0
- package/dist/collection/components/spinner/spinner.css +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/collection/components/table/table-header/table-header.css +17 -17
- package/dist/collection/components/table/table-header/table-header.js +4 -4
- package/dist/collection/components/table/table-row/table-row.css +3 -3
- package/dist/collection/components/table/table-row/table-row.js +185 -25
- package/dist/collection/components/table/table-rowgroup/table-rowgroup.css +3 -3
- package/dist/collection/components/table/table-rowgroup/table-rowgroup.js +118 -23
- package/dist/collection/components/table/table.css +2 -2
- package/dist/collection/components/table/table.e2e.js +370 -0
- package/dist/collection/components/table/table.js +8 -8
- package/dist/collection/components/table/table.stories.js +16 -7
- package/dist/collection/components/table/utils.js +18 -0
- package/dist/collection/components/textarea/textarea.css +2 -2
- package/dist/collection/components/textarea/textarea.e2e.js +91 -0
- package/dist/collection/components/toggle-button/toggle-button.css +9 -9
- 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 +3 -3
- 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 +14 -14
- 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 +2 -2
- package/dist/collection/components/wizard/wizard.css +3 -3
- package/dist/collection/components/wizard/wizard.e2e.js +149 -0
- package/dist/collection/components/wizard-icon/wizard-icon.css +2 -2
- package/dist/collection/docs/config/replace-prop-controls.spec.js +32 -0
- package/dist/collection/utils/types/table.types.js +5 -1
- package/dist/collection/utils/utils.spec.js +15 -0
- package/dist/components/b2b-alert.js +4 -4
- package/dist/components/b2b-anchor.js +1 -1
- package/dist/components/b2b-card.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/components/b2b-radio-group.js +1 -1
- package/dist/components/b2b-required-separator.js +3 -3
- package/dist/components/b2b-scrollable-container.js +1 -1
- package/dist/components/b2b-search.js +1 -1
- package/dist/components/b2b-tab-group.js +1 -1
- package/dist/components/b2b-tab-panel.js +1 -1
- package/dist/components/b2b-tab.js +1 -1
- package/dist/components/b2b-table-row.js +97 -25
- package/dist/components/b2b-table-rowgroup.js +91 -27
- package/dist/components/b2b-table.js +9 -9
- package/dist/components/b2b-textarea.js +1 -1
- 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-step.js +4 -4
- package/dist/components/b2b-wizard.js +2 -2
- package/dist/components/button.js +13 -8
- package/dist/{esm/b2b-checkbox.entry.js → components/checkbox.js} +66 -13
- package/dist/components/headline.js +1 -1
- package/dist/components/icon.js +4 -4
- package/dist/components/input-group.js +7 -20
- 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 +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/table-cell.js +1 -1
- package/dist/components/table-header.js +6 -6
- package/dist/components/table.types.js +2 -2
- package/dist/components/wizard-icon.js +1 -1
- package/dist/custom-elements.json +22 -13
- package/dist/esm/b2b-alert.entry.js +4 -4
- package/dist/esm/b2b-anchor.entry.js +1 -1
- package/dist/esm/b2b-button_2.entry.js +12 -8
- package/dist/esm/b2b-card.entry.js +1 -1
- package/dist/esm/b2b-checkbox-group.entry.js +7 -5
- package/dist/esm/{b2b-table-cell_2.entry.js → b2b-checkbox_3.entry.js} +94 -8
- 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 +1 -1
- package/dist/esm/b2b-icon.entry.js +4 -4
- package/dist/esm/b2b-input-group_2.entry.js +10 -21
- 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 +1 -1
- 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 +1 -1
- package/dist/esm/b2b-radio-group.entry.js +1 -1
- package/dist/esm/b2b-required-separator.entry.js +3 -3
- package/dist/esm/b2b-rounded-icon.entry.js +1 -1
- package/dist/esm/b2b-scrollable-container.entry.js +1 -1
- package/dist/esm/b2b-search.entry.js +1 -1
- package/dist/esm/b2b-separator.entry.js +1 -1
- package/dist/esm/b2b-tab-group.entry.js +1 -1
- package/dist/esm/b2b-tab-panel.entry.js +1 -1
- package/dist/esm/b2b-tab.entry.js +1 -1
- package/dist/esm/b2b-table-row.entry.js +77 -21
- package/dist/esm/b2b-table-rowgroup.entry.js +85 -24
- package/dist/esm/b2b-table.entry.js +10 -10
- package/dist/esm/b2b-textarea.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/b2b-wizard-step.entry.js +4 -4
- package/dist/esm/b2b-wizard.entry.js +2 -2
- package/dist/esm/{index-026605c2.js → index-dfdbf4b9.js} +88 -31
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{table.types-9943c937.js → table.types-dd829d83.js} +2 -2
- 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.d.ts +0 -4
- 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.stories.d.ts +1 -1
- package/dist/types/components/scrollable-container/scrollable-container.stories.d.ts +1 -1
- 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-row/table-row.d.ts +23 -7
- package/dist/types/components/table/table-rowgroup/table-rowgroup.d.ts +12 -2
- package/dist/types/components/table/table.d.ts +1 -1
- 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.stories.d.ts +1 -1
- package/dist/types/components/wizard-icon/wizard-icon.stories.d.ts +1 -1
- package/dist/types/components.d.ts +71 -9
- 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/utils/types/table.types.d.ts +7 -2
- package/dist/web-types.json +76 -6
- package/loader/index.d.ts +1 -1
- package/package.json +4 -4
- package/dist/b2b-core-components/p-0675225a.entry.js +0 -1
- package/dist/b2b-core-components/p-080a0741.entry.js +0 -1
- package/dist/b2b-core-components/p-0f8bd310.entry.js +0 -1
- package/dist/b2b-core-components/p-14f1b674.entry.js +0 -1
- package/dist/b2b-core-components/p-1eb784f9.entry.js +0 -1
- package/dist/b2b-core-components/p-21bfe96a.entry.js +0 -1
- package/dist/b2b-core-components/p-3cd9088a.entry.js +0 -1
- package/dist/b2b-core-components/p-42da7a57.entry.js +0 -1
- package/dist/b2b-core-components/p-4fc894c8.entry.js +0 -1
- package/dist/b2b-core-components/p-710600ca.entry.js +0 -1
- package/dist/b2b-core-components/p-83cb9d03.entry.js +0 -1
- package/dist/b2b-core-components/p-a7417890.js +0 -2
- package/dist/b2b-core-components/p-c9dcb35a.entry.js +0 -1
- package/dist/b2b-core-components/p-cf010e88.entry.js +0 -1
- package/dist/b2b-core-components/p-e3cd216c.entry.js +0 -1
- package/dist/b2b-core-components/p-fa6cd2ac.entry.js +0 -1
- package/dist/b2b-core-components/p-fe96d81a.entry.js +0 -1
- package/dist/cjs/b2b-checkbox.cjs.entry.js +0 -74
- /package/dist/b2b-core-components/{p-de2c1003.js → p-34eb99cb.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Tue, 22 Aug 2023 12:55:37 GMT
|
|
4
4
|
*/
|
|
5
5
|
:root, :host {
|
|
6
6
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Do not edit directly
|
|
125
|
-
* Generated on
|
|
125
|
+
* Generated on Tue, 22 Aug 2023 12:55:37 GMT
|
|
126
126
|
*/
|
|
127
127
|
:root [data-theme="dark"] {
|
|
128
128
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -253,40 +253,39 @@
|
|
|
253
253
|
display: flex;
|
|
254
254
|
align-items: center;
|
|
255
255
|
}
|
|
256
|
-
:host button.primary,
|
|
257
|
-
:host a.primary {
|
|
256
|
+
:host button.b2b-button--primary,
|
|
257
|
+
:host a.b2b-button--primary {
|
|
258
258
|
color: var(--b2b-color-white-100);
|
|
259
259
|
background-color: var(--b2b-color-red-100);
|
|
260
260
|
border: 1px solid var(--b2b-color-red-100);
|
|
261
261
|
}
|
|
262
|
-
:host button.primary:hover,
|
|
263
|
-
:host a.primary:hover {
|
|
262
|
+
:host button.b2b-button--primary:hover,
|
|
263
|
+
:host a.b2b-button--primary:hover {
|
|
264
264
|
background-color: var(--b2b-color-red-200);
|
|
265
265
|
}
|
|
266
|
-
:host button.primary.loading::after,
|
|
267
|
-
:host a.primary.loading::after {
|
|
266
|
+
:host button.b2b-button--primary.loading::after,
|
|
267
|
+
:host a.b2b-button--primary.loading::after {
|
|
268
268
|
border: 0.125rem solid rgba(255, 255, 255, 0.5);
|
|
269
269
|
border-top: 0.125rem solid var(--b2b-color-red-100);
|
|
270
270
|
}
|
|
271
|
-
:host button.secondary,
|
|
272
|
-
:host a.secondary {
|
|
271
|
+
:host button.b2b-button--secondary,
|
|
272
|
+
:host a.b2b-button--secondary {
|
|
273
273
|
color: var(--b2b-color-copy-default);
|
|
274
274
|
background-color: var(--b2b-button-secondary-background-color);
|
|
275
275
|
border: 1px solid var(--b2b-button-secondary-border-color);
|
|
276
276
|
border-right: var(--b2b-border-right);
|
|
277
277
|
}
|
|
278
|
-
:host button.secondary:hover,
|
|
279
|
-
:host a.secondary:hover {
|
|
278
|
+
:host button.b2b-button--secondary:hover,
|
|
279
|
+
:host a.b2b-button--secondary:hover {
|
|
280
280
|
background-color: var(--b2b-button-secondary-hover-background-color);
|
|
281
281
|
}
|
|
282
|
-
:host button.secondary.loading::after,
|
|
283
|
-
:host a.secondary.loading::after {
|
|
282
|
+
:host button.b2b-button--secondary.loading::after,
|
|
283
|
+
:host a.b2b-button--secondary.loading::after {
|
|
284
284
|
border: 0.125rem solid rgba(51, 51, 51, 0.2);
|
|
285
285
|
border-top: 0.125rem solid var(--b2b-color-copy-default);
|
|
286
286
|
}
|
|
287
|
-
:host button:disabled,
|
|
288
|
-
:host a:disabled
|
|
289
|
-
:host a.disabled {
|
|
287
|
+
:host button:disabled,
|
|
288
|
+
:host a:disabled {
|
|
290
289
|
cursor: default;
|
|
291
290
|
pointer-events: none;
|
|
292
291
|
background-color: var(--b2b-color-grey-50);
|
|
@@ -295,32 +294,29 @@
|
|
|
295
294
|
color: var(--b2b-color-grey-250);
|
|
296
295
|
}
|
|
297
296
|
:host button:disabled [slot=start],
|
|
298
|
-
:host button:disabled [slot=end],
|
|
299
|
-
:host button.disabled [slot=end],
|
|
297
|
+
:host button:disabled [slot=end],
|
|
300
298
|
:host a:disabled [slot=start],
|
|
301
|
-
:host a:disabled [slot=end]
|
|
302
|
-
:host a.disabled [slot=start],
|
|
303
|
-
:host a.disabled [slot=end] {
|
|
299
|
+
:host a:disabled [slot=end] {
|
|
304
300
|
fill: var(--b2b-color-grey-250);
|
|
305
301
|
}
|
|
306
302
|
:host button:focus,
|
|
307
303
|
:host a:focus {
|
|
308
304
|
z-index: 10;
|
|
309
305
|
}
|
|
310
|
-
:host(.loading) button,
|
|
311
|
-
:host(.loading) a {
|
|
306
|
+
:host(.b2b-button--loading) button,
|
|
307
|
+
:host(.b2b-button--loading) a {
|
|
312
308
|
color: transparent;
|
|
313
309
|
position: relative;
|
|
314
310
|
cursor: default;
|
|
315
311
|
pointer-events: none;
|
|
316
312
|
}
|
|
317
|
-
:host(.loading).primary::after, :host(.loading).primary:hover {
|
|
313
|
+
:host(.b2b-button--loading).b2b-button--primary::after, :host(.b2b-button--loading).b2b-button--primary:hover {
|
|
318
314
|
color: var(--b2b-color-white-100);
|
|
319
315
|
}
|
|
320
|
-
:host(.loading).secondary::after, :host(.loading).secondary:hover {
|
|
316
|
+
:host(.b2b-button--loading).b2b-button--secondary::after, :host(.b2b-button--loading).b2b-button--secondary:hover {
|
|
321
317
|
color: var(--b2b-color-copy-default);
|
|
322
318
|
}
|
|
323
|
-
:host(.loading) .
|
|
319
|
+
:host(.b2b-button--loading) .b2b-button__spinner {
|
|
324
320
|
box-sizing: border-box;
|
|
325
321
|
display: inline;
|
|
326
322
|
position: absolute !important;
|
|
@@ -329,32 +325,32 @@
|
|
|
329
325
|
margin-top: -0.625rem;
|
|
330
326
|
margin-left: -0.625rem;
|
|
331
327
|
}
|
|
332
|
-
:host(.loading) [slot=start],
|
|
333
|
-
:host(.loading) [slot=end] {
|
|
328
|
+
:host(.b2b-button--loading) [slot=start],
|
|
329
|
+
:host(.b2b-button--loading) [slot=end] {
|
|
334
330
|
visibility: hidden;
|
|
335
331
|
}
|
|
336
|
-
:host(.button
|
|
337
|
-
:host(.button
|
|
332
|
+
:host(.b2b-button--50) button,
|
|
333
|
+
:host(.b2b-button--50) a {
|
|
338
334
|
height: 1.875rem;
|
|
339
335
|
max-width: 100%;
|
|
340
336
|
}
|
|
341
|
-
:host(.button
|
|
342
|
-
:host(.button
|
|
337
|
+
:host(.b2b-button--100) button,
|
|
338
|
+
:host(.b2b-button--100) a {
|
|
343
339
|
height: 2.25rem;
|
|
344
340
|
}
|
|
345
|
-
:host(.button
|
|
346
|
-
:host(.button
|
|
341
|
+
:host(.b2b-button--active) button,
|
|
342
|
+
:host(.b2b-button--active) a {
|
|
347
343
|
background-color: var(--b2b-color-black-100);
|
|
348
344
|
color: var(--b2b-color-white-100);
|
|
349
345
|
border: 1px solid var(--b2b-button-secondary-border-color);
|
|
350
346
|
border-right: var(--b2b-border-right);
|
|
351
347
|
}
|
|
352
|
-
:host(.button
|
|
353
|
-
:host(.button
|
|
348
|
+
:host(.b2b-button--active) button:hover,
|
|
349
|
+
:host(.b2b-button--active) a:hover {
|
|
354
350
|
background-color: var(--b2b-color-black-100);
|
|
355
351
|
}
|
|
356
|
-
:host(.icon-only) button,
|
|
357
|
-
:host(.icon-only) a {
|
|
352
|
+
:host(.b2b-button--icon-only) button,
|
|
353
|
+
:host(.b2b-button--icon-only) a {
|
|
358
354
|
padding: 0 var(--b2b-size-20);
|
|
359
355
|
}
|
|
360
356
|
::slotted(*[slot=start]) {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('B2B-Button', () => {
|
|
3
|
+
let page;
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
page = await newE2EPage();
|
|
6
|
+
await page.setContent(`<b2b-button>Hello World</b2b-button>`);
|
|
7
|
+
});
|
|
8
|
+
it('should render the button component', async () => {
|
|
9
|
+
const element = await page.find('b2b-button');
|
|
10
|
+
expect(element).not.toBeNull();
|
|
11
|
+
});
|
|
12
|
+
it('should display text', async () => {
|
|
13
|
+
const element = await page.find('b2b-button');
|
|
14
|
+
expect(element).toEqualText('Hello World');
|
|
15
|
+
});
|
|
16
|
+
it('should emit click event when clicked', async () => {
|
|
17
|
+
const eventSpy = await page.spyOnEvent('click');
|
|
18
|
+
await page.click('b2b-button');
|
|
19
|
+
expect(eventSpy).toHaveReceivedEvent();
|
|
20
|
+
});
|
|
21
|
+
it('should not be able to click when disabled', async () => {
|
|
22
|
+
page = await newE2EPage();
|
|
23
|
+
await page.setContent(`<b2b-button disabled={true}>Hello World</b2b-button>`);
|
|
24
|
+
const eventSpy = await page.spyOnEvent('click');
|
|
25
|
+
await page.click('b2b-button');
|
|
26
|
+
expect(eventSpy).not.toHaveReceivedEvent();
|
|
27
|
+
});
|
|
28
|
+
it('should not be able to click when loading', async () => {
|
|
29
|
+
page = await newE2EPage();
|
|
30
|
+
await page.setContent(`<b2b-button loading={true}>Hello World</b2b-button>`);
|
|
31
|
+
const eventSpy = await page.spyOnEvent('click');
|
|
32
|
+
await page.click('b2b-button');
|
|
33
|
+
expect(eventSpy).not.toHaveReceivedEvent();
|
|
34
|
+
});
|
|
35
|
+
it('should support form submission from shadow dom', async () => {
|
|
36
|
+
const form = `
|
|
37
|
+
<form>
|
|
38
|
+
<b2b-button type='submit'>Hello World</b2b-button>
|
|
39
|
+
</form>
|
|
40
|
+
`;
|
|
41
|
+
page = await newE2EPage();
|
|
42
|
+
await page.setContent(form);
|
|
43
|
+
const submitEventSpy = await page.spyOnEvent('submit');
|
|
44
|
+
const formdataEventSpy = await page.spyOnEvent('formdata');
|
|
45
|
+
await page.click('b2b-button');
|
|
46
|
+
expect(submitEventSpy).toHaveReceivedEvent();
|
|
47
|
+
expect(formdataEventSpy).toHaveReceivedEvent();
|
|
48
|
+
});
|
|
49
|
+
it('should reduce padding on the button if there is only an icon', async () => {
|
|
50
|
+
page = await newE2EPage();
|
|
51
|
+
await page.setContent(`<b2b-button variant="primary" size="100">
|
|
52
|
+
<b2b-icon slot="end" icon="b2b_icon-check" size="100"></b2b-icon>
|
|
53
|
+
</b2b-button>`);
|
|
54
|
+
const button = await page.find('b2b-button');
|
|
55
|
+
expect(button).toHaveClass('b2b-button--icon-only');
|
|
56
|
+
});
|
|
57
|
+
it('should not reduce padding on the button if there is text', async () => {
|
|
58
|
+
page = await newE2EPage();
|
|
59
|
+
await page.setContent(`<b2b-button variant="primary" size="100">
|
|
60
|
+
<span>Hello World</span>
|
|
61
|
+
<b2b-icon slot="end" icon="b2b_icon-check" size="100"></b2b-icon>
|
|
62
|
+
</b2b-button>`);
|
|
63
|
+
const button = await page.find('b2b-button');
|
|
64
|
+
expect(button).not.toHaveClass('b2b-button--icon-only');
|
|
65
|
+
});
|
|
66
|
+
it('should not submit a form when the button is not of type submit', async () => {
|
|
67
|
+
const form = `
|
|
68
|
+
<form>
|
|
69
|
+
<b2b-button>Hello World</b2b-button>
|
|
70
|
+
</form>
|
|
71
|
+
`;
|
|
72
|
+
page = await newE2EPage();
|
|
73
|
+
await page.setContent(form);
|
|
74
|
+
const submitEventSpy = await page.spyOnEvent('submit');
|
|
75
|
+
const button = await page.find({ text: 'Hello World' });
|
|
76
|
+
await button.click();
|
|
77
|
+
page.waitForChanges();
|
|
78
|
+
expect(submitEventSpy).not.toHaveReceivedEvent();
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -28,6 +28,7 @@ export class ButtonComponent {
|
|
|
28
28
|
this.href = undefined;
|
|
29
29
|
this.target = 'self';
|
|
30
30
|
this.download = undefined;
|
|
31
|
+
this.groupDisabled = false;
|
|
31
32
|
}
|
|
32
33
|
/** Manually set focus to button element */
|
|
33
34
|
async setFocus() {
|
|
@@ -54,15 +55,18 @@ export class ButtonComponent {
|
|
|
54
55
|
}
|
|
55
56
|
spinner() {
|
|
56
57
|
const spinnerColor = this.variant === 'primary' ? 'inverse' : 'secondary';
|
|
57
|
-
return (h("div", { class: "
|
|
58
|
+
return (h("div", { class: "b2b-button__spinner" }, h("b2b-spinner", { color: spinnerColor, size: "50" })));
|
|
58
59
|
}
|
|
59
60
|
render() {
|
|
60
61
|
return (h(Host, { class: {
|
|
61
|
-
loading: this.canLoad(),
|
|
62
|
-
[`button
|
|
63
|
-
[`button
|
|
64
|
-
[`icon-only`]: this.checkIcon(),
|
|
65
|
-
} }, this.href !== undefined ? (h("a", { href: this.href, target: `_${this.target}`, download: this.download, class: {
|
|
62
|
+
[`b2b-button--loading`]: this.canLoad(),
|
|
63
|
+
[`b2b-button--${this.size}`]: true,
|
|
64
|
+
[`b2b-button--active`]: this.active,
|
|
65
|
+
[`b2b-button--icon-only`]: this.checkIcon(),
|
|
66
|
+
} }, this.href !== undefined ? (h("a", { href: this.href, target: `_${this.target}`, download: this.download, class: {
|
|
67
|
+
disabled: this.disabled || this.groupDisabled,
|
|
68
|
+
[`b2b-button--${this.variant}`]: true,
|
|
69
|
+
}, ref: el => (this.focusableElement = el) }, h("span", null, h("slot", { name: "start" }), h("slot", null), h("slot", { name: "end" })), this.canLoad() ? this.spinner() : null)) : (h("button", { disabled: this.disabled || this.groupDisabled, class: { [`b2b-button--${this.variant}`]: true }, type: this.type, ref: el => (this.focusableElement = el) }, h("span", null, h("slot", { name: "start" }), h("slot", null), h("slot", { name: "end" })), this.canLoad() ? this.spinner() : null))));
|
|
66
70
|
}
|
|
67
71
|
static get is() { return "b2b-button"; }
|
|
68
72
|
static get encapsulation() { return "shadow"; }
|
|
@@ -237,6 +241,27 @@ export class ButtonComponent {
|
|
|
237
241
|
},
|
|
238
242
|
"attribute": "download",
|
|
239
243
|
"reflect": false
|
|
244
|
+
},
|
|
245
|
+
"groupDisabled": {
|
|
246
|
+
"type": "boolean",
|
|
247
|
+
"mutable": false,
|
|
248
|
+
"complexType": {
|
|
249
|
+
"original": "boolean",
|
|
250
|
+
"resolved": "boolean",
|
|
251
|
+
"references": {}
|
|
252
|
+
},
|
|
253
|
+
"required": false,
|
|
254
|
+
"optional": false,
|
|
255
|
+
"docs": {
|
|
256
|
+
"tags": [{
|
|
257
|
+
"name": "internal",
|
|
258
|
+
"text": "Whether the parent input group is disabled. Per default, it is false."
|
|
259
|
+
}],
|
|
260
|
+
"text": ""
|
|
261
|
+
},
|
|
262
|
+
"attribute": "group-disabled",
|
|
263
|
+
"reflect": false,
|
|
264
|
+
"defaultValue": "false"
|
|
240
265
|
}
|
|
241
266
|
};
|
|
242
267
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Tue, 22 Aug 2023 12:55:37 GMT
|
|
4
4
|
*/
|
|
5
5
|
:root, :host {
|
|
6
6
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Do not edit directly
|
|
125
|
-
* Generated on
|
|
125
|
+
* Generated on Tue, 22 Aug 2023 12:55:37 GMT
|
|
126
126
|
*/
|
|
127
127
|
:root [data-theme="dark"] {
|
|
128
128
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('B2B-Card', () => {
|
|
3
|
+
let page;
|
|
4
|
+
it('should render the card component', async () => {
|
|
5
|
+
page = await newE2EPage();
|
|
6
|
+
await page.setContent(`<b2b-card>Hello World</b2b-card>`);
|
|
7
|
+
const element = await page.find('b2b-card');
|
|
8
|
+
expect(element).not.toBeNull();
|
|
9
|
+
});
|
|
10
|
+
it('should display content', async () => {
|
|
11
|
+
page = await newE2EPage();
|
|
12
|
+
await page.setContent(`<b2b-card>Hello World</b2b-card>`);
|
|
13
|
+
const element = await page.find('b2b-card');
|
|
14
|
+
expect(element).toEqualText('Hello World');
|
|
15
|
+
});
|
|
16
|
+
it('should disable the card', async () => {
|
|
17
|
+
page = await newE2EPage();
|
|
18
|
+
await page.setContent(`<b2b-card disabled="true">Hello World</b2b-card>`);
|
|
19
|
+
const element = await page.find('b2b-card');
|
|
20
|
+
const style = await element.getComputedStyle();
|
|
21
|
+
expect(style.pointerEvents).toBe('none');
|
|
22
|
+
expect(style.color).toBe('rgb(119, 119, 119)');
|
|
23
|
+
});
|
|
24
|
+
it('should pop up when hovered', async () => {
|
|
25
|
+
page = await newE2EPage();
|
|
26
|
+
await page.setContent(`<b2b-card>Hello World</b2b-card>`);
|
|
27
|
+
const element = await page.find('b2b-card');
|
|
28
|
+
await element.hover();
|
|
29
|
+
await page.waitForChanges();
|
|
30
|
+
await page.waitForTimeout(400);
|
|
31
|
+
const style = await element.getComputedStyle();
|
|
32
|
+
expect(style.boxShadow).toBe('rgba(0, 0, 0, 0.15) 5px 5px 6px 0px');
|
|
33
|
+
});
|
|
34
|
+
it('should pop up when focused', async () => {
|
|
35
|
+
page = await newE2EPage();
|
|
36
|
+
await page.setContent(`<b2b-card>Hello World</b2b-card>`);
|
|
37
|
+
const element = await page.find('b2b-card');
|
|
38
|
+
await element.focus();
|
|
39
|
+
await page.waitForChanges();
|
|
40
|
+
await page.waitForTimeout(400);
|
|
41
|
+
const style = await element.getComputedStyle();
|
|
42
|
+
expect(style.boxShadow).toBe('rgba(0, 0, 0, 0.15) 5px 5px 6px 0px');
|
|
43
|
+
});
|
|
44
|
+
it('should not pop up when hovered on disabled card', async () => {
|
|
45
|
+
page = await newE2EPage();
|
|
46
|
+
await page.setContent(`<b2b-card disabled="true">Hello World</b2b-card>`);
|
|
47
|
+
const element = await page.find('b2b-card');
|
|
48
|
+
await element.hover();
|
|
49
|
+
await page.waitForChanges();
|
|
50
|
+
const style = await element.getComputedStyle();
|
|
51
|
+
expect(style.boxShadow).toBe('rgba(0, 0, 0, 0.15) 2px 2px 5px 0px');
|
|
52
|
+
});
|
|
53
|
+
it('should emit on click', async () => {
|
|
54
|
+
page = await newE2EPage();
|
|
55
|
+
await page.setContent(`<b2b-card>Hello World</b2b-card>`);
|
|
56
|
+
const element = await page.find('b2b-card');
|
|
57
|
+
const clickSpy = await page.spyOnEvent('b2b-selected');
|
|
58
|
+
await element.click();
|
|
59
|
+
await page.waitForChanges();
|
|
60
|
+
expect(clickSpy).toHaveReceivedEvent();
|
|
61
|
+
});
|
|
62
|
+
it('should emit on enter press', async () => {
|
|
63
|
+
page = await newE2EPage();
|
|
64
|
+
await page.setContent(`<b2b-card>Hello World</b2b-card>`);
|
|
65
|
+
const clickSpy = await page.spyOnEvent('b2b-selected');
|
|
66
|
+
await page.keyboard.press('Tab');
|
|
67
|
+
await page.keyboard.press('Enter');
|
|
68
|
+
await page.waitForChanges();
|
|
69
|
+
expect(clickSpy).toHaveReceivedEvent();
|
|
70
|
+
});
|
|
71
|
+
it('should not emit when disabled', async () => {
|
|
72
|
+
page = await newE2EPage();
|
|
73
|
+
await page.setContent(`<b2b-card disabled>Hello World</b2b-card>`);
|
|
74
|
+
const element = await page.find('b2b-card');
|
|
75
|
+
const clickSpy = await page.spyOnEvent('b2b-selected');
|
|
76
|
+
await page.keyboard.press('Tab');
|
|
77
|
+
await page.keyboard.press('Enter');
|
|
78
|
+
await element.click();
|
|
79
|
+
await page.waitForChanges();
|
|
80
|
+
expect(clickSpy).not.toHaveReceivedEvent();
|
|
81
|
+
});
|
|
82
|
+
// it seems we cannot redirect within the context of stencil's e2e testing library
|
|
83
|
+
it('should redirect when a href is passed', async () => {
|
|
84
|
+
page = await newE2EPage();
|
|
85
|
+
const link = 'https://www.otto.de/';
|
|
86
|
+
await page.setContent(`<b2b-card href="${link}">Hello World</b2b-card>`);
|
|
87
|
+
const element = await page.find('b2b-card >>> a');
|
|
88
|
+
const href = await element.getProperty('href');
|
|
89
|
+
expect(href).toEqualText(link);
|
|
90
|
+
});
|
|
91
|
+
it('should focus on next card when navigating with keyboard and first card has a href value', async () => {
|
|
92
|
+
page = await newE2EPage();
|
|
93
|
+
await page.setContent(`<div>
|
|
94
|
+
<b2b-card id='card1' href="www.something.com"></b2b-card>
|
|
95
|
+
<b2b-card id='card2'>Hello World</b2b-card>
|
|
96
|
+
</div>`);
|
|
97
|
+
await page.keyboard.press('Tab');
|
|
98
|
+
await page.waitForChanges();
|
|
99
|
+
let activeElId = await page.evaluate(() => {
|
|
100
|
+
return document.activeElement.id;
|
|
101
|
+
});
|
|
102
|
+
expect(activeElId).toEqualText('card1');
|
|
103
|
+
await page.keyboard.press('Tab');
|
|
104
|
+
await page.waitForChanges();
|
|
105
|
+
activeElId = await page.evaluate(() => {
|
|
106
|
+
return document.activeElement.id;
|
|
107
|
+
});
|
|
108
|
+
expect(activeElId).toEqualText('card2');
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
import { CardComponent } from './card';
|
|
4
|
+
it('should render the card with default values', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [CardComponent],
|
|
7
|
+
template: () => h("b2b-card", null, "B2B Card"),
|
|
8
|
+
});
|
|
9
|
+
expect(page.root).toEqualHtml(`
|
|
10
|
+
<b2b-card class="b2b-card" tabindex="0">
|
|
11
|
+
<mock:shadow-root>
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</mock:shadow-root>
|
|
14
|
+
B2B Card
|
|
15
|
+
</b2b-card>
|
|
16
|
+
`);
|
|
17
|
+
});
|
|
18
|
+
it('should disable the card', async () => {
|
|
19
|
+
const page = await newSpecPage({
|
|
20
|
+
components: [CardComponent],
|
|
21
|
+
template: () => h("b2b-card", { disabled: true }, "B2B Card"),
|
|
22
|
+
});
|
|
23
|
+
expect(page.root).toEqualHtml(`
|
|
24
|
+
<b2b-card tabindex="-1" aria-disabled="true" class="b2b-card b2b-card--disabled">
|
|
25
|
+
<mock:shadow-root>
|
|
26
|
+
<div class="b2b-card--disabled-overlay"></div>
|
|
27
|
+
<slot></slot>
|
|
28
|
+
</mock:shadow-root>
|
|
29
|
+
B2B Card
|
|
30
|
+
</b2b-card>
|
|
31
|
+
`);
|
|
32
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Tue, 22 Aug 2023 12:55:37 GMT
|
|
4
4
|
*/
|
|
5
5
|
:root, :host {
|
|
6
6
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Do not edit directly
|
|
125
|
-
* Generated on
|
|
125
|
+
* Generated on Tue, 22 Aug 2023 12:55:37 GMT
|
|
126
126
|
*/
|
|
127
127
|
:root [data-theme="dark"] {
|
|
128
128
|
--b2b-size-200: 5rem; /* 80px */
|
|
@@ -222,23 +222,23 @@
|
|
|
222
222
|
font-size: var(--b2b-size-copy-100);
|
|
223
223
|
width: fit-content;
|
|
224
224
|
margin-bottom: var(--b2b-checkbox-margin-bottom);
|
|
225
|
-
margin-right: var(--b2b-size-60);
|
|
226
225
|
}
|
|
227
|
-
.b2b-
|
|
226
|
+
.b2b-checkbox__items {
|
|
228
227
|
display: flex;
|
|
229
228
|
justify-content: flex-start;
|
|
229
|
+
position: relative;
|
|
230
230
|
}
|
|
231
|
-
.b2b-
|
|
231
|
+
.b2b-checkbox__icon {
|
|
232
232
|
position: absolute;
|
|
233
233
|
fill: var(--b2b-color-white-100);
|
|
234
234
|
display: none;
|
|
235
|
-
margin-top:
|
|
235
|
+
margin-top: var(--b2b-size-7);
|
|
236
236
|
margin-left: var(--b2b-size-1);
|
|
237
237
|
width: var(--b2b-size-35);
|
|
238
238
|
height: var(--b2b-size-35);
|
|
239
239
|
z-index: 1000;
|
|
240
240
|
}
|
|
241
|
-
.b2b-
|
|
241
|
+
.b2b-checkbox__input {
|
|
242
242
|
margin: 2px 6px 3px 0;
|
|
243
243
|
appearance: none;
|
|
244
244
|
background-color: var(--b2b-color-white-100);
|
|
@@ -251,10 +251,10 @@
|
|
|
251
251
|
height: var(--b2b-size-40);
|
|
252
252
|
flex-shrink: 0;
|
|
253
253
|
}
|
|
254
|
-
.b2b-checkbox
|
|
254
|
+
.b2b-checkbox--checked .b2b-checkbox__icon {
|
|
255
255
|
display: inline-block;
|
|
256
256
|
}
|
|
257
|
-
.b2b-checkbox
|
|
257
|
+
.b2b-checkbox--checked .b2b-checkbox__input {
|
|
258
258
|
border-color: var(--b2b-color-black-100);
|
|
259
259
|
background-color: var(--b2b-color-black-100);
|
|
260
260
|
}
|
|
@@ -273,26 +273,47 @@
|
|
|
273
273
|
.b2b-checkbox--error {
|
|
274
274
|
/* When an input is both checked AND has an error */
|
|
275
275
|
}
|
|
276
|
-
.b2b-checkbox--error .b2b-
|
|
276
|
+
.b2b-checkbox--error .b2b-checkbox__input {
|
|
277
277
|
background-color: var(--b2b-color-error-50);
|
|
278
278
|
border: 1px solid var(--b2b-color-error-100);
|
|
279
279
|
}
|
|
280
280
|
.b2b-checkbox--error span {
|
|
281
281
|
color: var(--b2b-color-error-100);
|
|
282
282
|
}
|
|
283
|
-
.b2b-checkbox--error.b2b-checkbox
|
|
283
|
+
.b2b-checkbox--error.b2b-checkbox--checked .b2b-checkbox__input {
|
|
284
284
|
background-color: var(--b2b-color-error-100);
|
|
285
285
|
border-color: var(--b2b-color-error-100);
|
|
286
286
|
}
|
|
287
287
|
.b2b-checkbox--disabled {
|
|
288
288
|
pointer-events: none;
|
|
289
289
|
}
|
|
290
|
-
.b2b-checkbox--disabled .b2b-
|
|
290
|
+
.b2b-checkbox--disabled .b2b-checkbox__input {
|
|
291
291
|
background-color: var(--b2b-color-grey-25);
|
|
292
292
|
border-color: var(--b2b-color-grey-300);
|
|
293
293
|
}
|
|
294
|
+
.b2b-checkbox--standalone {
|
|
295
|
+
margin: 0;
|
|
296
|
+
}
|
|
297
|
+
.b2b-checkbox--standalone .b2b-checkbox__input {
|
|
298
|
+
margin: 0;
|
|
299
|
+
}
|
|
300
|
+
.b2b-checkbox--standalone .b2b-checkbox__icon {
|
|
301
|
+
margin-top: var(--b2b-size-1);
|
|
302
|
+
}
|
|
303
|
+
.b2b-checkbox--indeterminate .b2b-checkbox__input {
|
|
304
|
+
border-color: var(--b2b-color-black-100);
|
|
305
|
+
background-color: var(--b2b-color-black-100);
|
|
306
|
+
}
|
|
307
|
+
.b2b-checkbox--indeterminate .b2b-checkbox__icon {
|
|
308
|
+
margin-top: var(--b2b-size-5);
|
|
309
|
+
margin-left: var(--b2b-size-5);
|
|
310
|
+
display: inline-block;
|
|
311
|
+
}
|
|
312
|
+
.b2b-checkbox--indeterminate.b2b-checkbox--standalone .b2b-checkbox__icon {
|
|
313
|
+
margin-top: var(--b2b-size-1);
|
|
314
|
+
}
|
|
294
315
|
/* stylelint-disable selector-class-pattern */
|
|
295
|
-
.b2b-checkbox.b2b-checkbox--disabled.b2b-checkbox
|
|
316
|
+
.b2b-checkbox.b2b-checkbox--disabled.b2b-checkbox--checked .b2b-checkbox__input {
|
|
296
317
|
background-color: var(--b2b-color-grey-300);
|
|
297
318
|
border-color: var(--b2b-color-grey-300);
|
|
298
319
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('b2b-checkbox', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<b2b-checkbox label="test"></b2b-checkbox>');
|
|
6
|
+
const element = await page.find('b2b-checkbox');
|
|
7
|
+
expect(element).toBeDefined();
|
|
8
|
+
expect(element).not.toHaveAttribute('checked');
|
|
9
|
+
});
|
|
10
|
+
it('can be checked', async () => {
|
|
11
|
+
const page = await newE2EPage();
|
|
12
|
+
await page.setContent('<b2b-checkbox label="test"></b2b-checkbox>');
|
|
13
|
+
const container = await page.find('b2b-checkbox');
|
|
14
|
+
const element = await page.find('b2b-checkbox >>> .b2b-checkbox');
|
|
15
|
+
expect(element).not.toHaveClass('b2b-checkbox--checked');
|
|
16
|
+
await container.click();
|
|
17
|
+
await page.waitForChanges();
|
|
18
|
+
expect(element).toHaveClass('b2b-checkbox--checked');
|
|
19
|
+
});
|
|
20
|
+
it('can be indeterminate and will change to checked once clicked', async () => {
|
|
21
|
+
const page = await newE2EPage();
|
|
22
|
+
await page.setContent('<b2b-checkbox label="test" indeterminate></b2b-checkbox>');
|
|
23
|
+
const container = await page.find('b2b-checkbox');
|
|
24
|
+
const element = await page.find('b2b-checkbox >>> .b2b-checkbox');
|
|
25
|
+
expect(element).toHaveClass('b2b-checkbox--indeterminate');
|
|
26
|
+
await container.click();
|
|
27
|
+
await page.waitForChanges();
|
|
28
|
+
expect(element).toHaveClass('b2b-checkbox--checked');
|
|
29
|
+
});
|
|
30
|
+
});
|