@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
|
@@ -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 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,23 +222,23 @@
|
|
|
223
222
|
font-size: var(--b2b-size-copy-100);
|
|
224
223
|
width: fit-content;
|
|
225
224
|
margin-bottom: var(--b2b-checkbox-margin-bottom);
|
|
226
|
-
margin-right: var(--b2b-size-60);
|
|
227
225
|
}
|
|
228
|
-
.b2b-
|
|
226
|
+
.b2b-checkbox__items {
|
|
229
227
|
display: flex;
|
|
230
228
|
justify-content: flex-start;
|
|
229
|
+
position: relative;
|
|
231
230
|
}
|
|
232
|
-
.b2b-
|
|
231
|
+
.b2b-checkbox__icon {
|
|
233
232
|
position: absolute;
|
|
234
233
|
fill: var(--b2b-color-white-100);
|
|
235
234
|
display: none;
|
|
236
|
-
margin-top:
|
|
235
|
+
margin-top: var(--b2b-size-7);
|
|
237
236
|
margin-left: var(--b2b-size-1);
|
|
238
237
|
width: var(--b2b-size-35);
|
|
239
238
|
height: var(--b2b-size-35);
|
|
240
239
|
z-index: 1000;
|
|
241
240
|
}
|
|
242
|
-
.b2b-
|
|
241
|
+
.b2b-checkbox__input {
|
|
243
242
|
margin: 2px 6px 3px 0;
|
|
244
243
|
appearance: none;
|
|
245
244
|
background-color: var(--b2b-color-white-100);
|
|
@@ -252,10 +251,10 @@
|
|
|
252
251
|
height: var(--b2b-size-40);
|
|
253
252
|
flex-shrink: 0;
|
|
254
253
|
}
|
|
255
|
-
.b2b-checkbox
|
|
254
|
+
.b2b-checkbox--checked .b2b-checkbox__icon {
|
|
256
255
|
display: inline-block;
|
|
257
256
|
}
|
|
258
|
-
.b2b-checkbox
|
|
257
|
+
.b2b-checkbox--checked .b2b-checkbox__input {
|
|
259
258
|
border-color: var(--b2b-color-black-100);
|
|
260
259
|
background-color: var(--b2b-color-black-100);
|
|
261
260
|
}
|
|
@@ -266,7 +265,7 @@
|
|
|
266
265
|
}
|
|
267
266
|
.b2b-checkbox span {
|
|
268
267
|
display: block;
|
|
269
|
-
font-size: var(--b2b-size-copy-
|
|
268
|
+
font-size: var(--b2b-size-copy-50);
|
|
270
269
|
color: var(--b2b-color-grey-300);
|
|
271
270
|
line-height: var(--b2b-size-copy-line-height-75);
|
|
272
271
|
user-select: none;
|
|
@@ -274,26 +273,47 @@
|
|
|
274
273
|
.b2b-checkbox--error {
|
|
275
274
|
/* When an input is both checked AND has an error */
|
|
276
275
|
}
|
|
277
|
-
.b2b-checkbox--error .b2b-
|
|
276
|
+
.b2b-checkbox--error .b2b-checkbox__input {
|
|
278
277
|
background-color: var(--b2b-color-error-50);
|
|
279
278
|
border: 1px solid var(--b2b-color-error-100);
|
|
280
279
|
}
|
|
281
280
|
.b2b-checkbox--error span {
|
|
282
281
|
color: var(--b2b-color-error-100);
|
|
283
282
|
}
|
|
284
|
-
.b2b-checkbox--error.b2b-checkbox
|
|
283
|
+
.b2b-checkbox--error.b2b-checkbox--checked .b2b-checkbox__input {
|
|
285
284
|
background-color: var(--b2b-color-error-100);
|
|
286
285
|
border-color: var(--b2b-color-error-100);
|
|
287
286
|
}
|
|
288
287
|
.b2b-checkbox--disabled {
|
|
289
288
|
pointer-events: none;
|
|
290
289
|
}
|
|
291
|
-
.b2b-checkbox--disabled .b2b-
|
|
290
|
+
.b2b-checkbox--disabled .b2b-checkbox__input {
|
|
292
291
|
background-color: var(--b2b-color-grey-25);
|
|
293
292
|
border-color: var(--b2b-color-grey-300);
|
|
294
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
|
+
}
|
|
295
315
|
/* stylelint-disable selector-class-pattern */
|
|
296
|
-
.b2b-checkbox.b2b-checkbox--disabled.b2b-checkbox
|
|
316
|
+
.b2b-checkbox.b2b-checkbox--disabled.b2b-checkbox--checked .b2b-checkbox__input {
|
|
297
317
|
background-color: var(--b2b-color-grey-300);
|
|
298
318
|
border-color: var(--b2b-color-grey-300);
|
|
299
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
|
+
});
|
|
@@ -28,18 +28,35 @@ export class CheckboxComponent {
|
|
|
28
28
|
if (this.disabled) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
else if (this.indeterminate) {
|
|
32
|
+
this.indeterminate = false;
|
|
33
|
+
this.checked = true;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.checked = !this.checked;
|
|
37
|
+
}
|
|
32
38
|
this.emitDetail();
|
|
33
39
|
};
|
|
40
|
+
this.renderIcon = () => {
|
|
41
|
+
if (this.indeterminate) {
|
|
42
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 11 1", class: "b2b-checkbox__icon" }, h("path", { d: "M8.5 0H0.5C0.223633 0 0 0.223633 0 0.5C0 0.776367 0.223633 1 0.5 1H8.5C8.77637 1 9 0.776367 9 0.5C9 0.223633 8.77637 0 8.5 0Z", fill: "white" })));
|
|
43
|
+
}
|
|
44
|
+
if (this.checked) {
|
|
45
|
+
return (h("svg", { class: "b2b-checkbox__icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { d: "M11.798 25.082c-.341 0-.681-.13-.942-.389l-7.132-7.115a1.334 1.334 0 0 1 1.884-1.888l6.19 6.175L26.391 7.307a1.334 1.334 0 0 1 1.884 1.888L12.74 24.693c-.26.259-.601.389-.942.389z" })));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
34
48
|
this.label = undefined;
|
|
35
49
|
this.required = false;
|
|
36
50
|
this.checked = false;
|
|
37
51
|
this.disabled = false;
|
|
52
|
+
this.indeterminate = undefined;
|
|
38
53
|
this.error = undefined;
|
|
39
54
|
this.hint = undefined;
|
|
40
55
|
this.name = undefined;
|
|
41
56
|
this.value = undefined;
|
|
42
57
|
this.invalid = false;
|
|
58
|
+
this.standalone = false;
|
|
59
|
+
this.groupDisabled = false;
|
|
43
60
|
}
|
|
44
61
|
connectedCallback() {
|
|
45
62
|
const form = this.hostElement.closest('form');
|
|
@@ -51,9 +68,11 @@ export class CheckboxComponent {
|
|
|
51
68
|
return (h(Host, { onClick: this.onClick }, h("div", { class: {
|
|
52
69
|
'b2b-checkbox': true,
|
|
53
70
|
'b2b-checkbox--error': this.invalid && !this.disabled,
|
|
54
|
-
'b2b-checkbox--disabled': this.disabled,
|
|
55
|
-
'b2b-checkbox
|
|
56
|
-
|
|
71
|
+
'b2b-checkbox--disabled': this.disabled || this.groupDisabled,
|
|
72
|
+
'b2b-checkbox--checked': this.checked,
|
|
73
|
+
'b2b-checkbox--standalone': this.standalone,
|
|
74
|
+
'b2b-checkbox--indeterminate': this.indeterminate,
|
|
75
|
+
} }, h("div", { class: "b2b-checkbox-items" }, this.renderIcon(), h("input", { class: "b2b-checkbox__input", "aria-labelledby": this.name, type: "checkbox", name: this.name, id: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.groupDisabled, onFocus: this.onFocus, onBlur: this.onBlur }), !this.standalone && (h("b2b-input-label", { id: this.name, required: this.required, disabled: this.disabled }, this.label))), (this.hint !== undefined && !this.invalid) ||
|
|
57
76
|
(this.hint !== undefined && this.disabled) ? (h("span", null, this.hint)) : (''), this.error !== undefined && this.invalid && !this.disabled ? (h("span", null, this.error)) : (''))));
|
|
58
77
|
}
|
|
59
78
|
static get is() { return "b2b-checkbox"; }
|
|
@@ -78,8 +97,8 @@ export class CheckboxComponent {
|
|
|
78
97
|
"resolved": "string",
|
|
79
98
|
"references": {}
|
|
80
99
|
},
|
|
81
|
-
"required":
|
|
82
|
-
"optional":
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": true,
|
|
83
102
|
"docs": {
|
|
84
103
|
"tags": [],
|
|
85
104
|
"text": "The checkbox label. This attribute is required."
|
|
@@ -141,6 +160,23 @@ export class CheckboxComponent {
|
|
|
141
160
|
"reflect": true,
|
|
142
161
|
"defaultValue": "false"
|
|
143
162
|
},
|
|
163
|
+
"indeterminate": {
|
|
164
|
+
"type": "boolean",
|
|
165
|
+
"mutable": true,
|
|
166
|
+
"complexType": {
|
|
167
|
+
"original": "boolean",
|
|
168
|
+
"resolved": "boolean",
|
|
169
|
+
"references": {}
|
|
170
|
+
},
|
|
171
|
+
"required": false,
|
|
172
|
+
"optional": false,
|
|
173
|
+
"docs": {
|
|
174
|
+
"tags": [],
|
|
175
|
+
"text": "If used in combination with other checkboxes, this state indicates that some checkboxes are checked, but not all. Per default, it is false."
|
|
176
|
+
},
|
|
177
|
+
"attribute": "indeterminate",
|
|
178
|
+
"reflect": false
|
|
179
|
+
},
|
|
144
180
|
"error": {
|
|
145
181
|
"type": "string",
|
|
146
182
|
"mutable": false,
|
|
@@ -226,6 +262,45 @@ export class CheckboxComponent {
|
|
|
226
262
|
"attribute": "invalid",
|
|
227
263
|
"reflect": false,
|
|
228
264
|
"defaultValue": "false"
|
|
265
|
+
},
|
|
266
|
+
"standalone": {
|
|
267
|
+
"type": "boolean",
|
|
268
|
+
"mutable": false,
|
|
269
|
+
"complexType": {
|
|
270
|
+
"original": "boolean",
|
|
271
|
+
"resolved": "boolean",
|
|
272
|
+
"references": {}
|
|
273
|
+
},
|
|
274
|
+
"required": false,
|
|
275
|
+
"optional": false,
|
|
276
|
+
"docs": {
|
|
277
|
+
"tags": [],
|
|
278
|
+
"text": "If true, renders a standalone inline checkbox with no label and hint/error."
|
|
279
|
+
},
|
|
280
|
+
"attribute": "standalone",
|
|
281
|
+
"reflect": false,
|
|
282
|
+
"defaultValue": "false"
|
|
283
|
+
},
|
|
284
|
+
"groupDisabled": {
|
|
285
|
+
"type": "boolean",
|
|
286
|
+
"mutable": false,
|
|
287
|
+
"complexType": {
|
|
288
|
+
"original": "boolean",
|
|
289
|
+
"resolved": "boolean",
|
|
290
|
+
"references": {}
|
|
291
|
+
},
|
|
292
|
+
"required": false,
|
|
293
|
+
"optional": false,
|
|
294
|
+
"docs": {
|
|
295
|
+
"tags": [{
|
|
296
|
+
"name": "internal",
|
|
297
|
+
"text": "whether the parent checkbox-group is disabled."
|
|
298
|
+
}],
|
|
299
|
+
"text": ""
|
|
300
|
+
},
|
|
301
|
+
"attribute": "group-disabled",
|
|
302
|
+
"reflect": false,
|
|
303
|
+
"defaultValue": "false"
|
|
229
304
|
}
|
|
230
305
|
};
|
|
231
306
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
import { CheckboxComponent } from './checkbox';
|
|
4
|
+
it('should render the checkbox', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [CheckboxComponent],
|
|
7
|
+
template: () => h("b2b-checkbox", { label: "test" }),
|
|
8
|
+
});
|
|
9
|
+
expect(page.root).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
it('should disable the checkbox', async () => {
|
|
12
|
+
const page = await newSpecPage({
|
|
13
|
+
components: [CheckboxComponent],
|
|
14
|
+
template: () => h("b2b-checkbox", { label: "test", disabled: true }),
|
|
15
|
+
});
|
|
16
|
+
expect(page.root).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
it('should render a hint message if a hint string is specified', async () => {
|
|
19
|
+
const page = await newSpecPage({
|
|
20
|
+
components: [CheckboxComponent],
|
|
21
|
+
template: () => (h("b2b-checkbox", { label: "test", hint: "this is a hint" })),
|
|
22
|
+
});
|
|
23
|
+
expect(page.root).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
it('should apply an error style if it is marked as invalid.', async () => {
|
|
26
|
+
const page = await newSpecPage({
|
|
27
|
+
components: [CheckboxComponent],
|
|
28
|
+
template: () => (h("b2b-checkbox", { label: "test", error: "this is an error", invalid: true })),
|
|
29
|
+
});
|
|
30
|
+
expect(page.root).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
it('should render an error message if an error is specified and it is marked as invalid', async () => {
|
|
33
|
+
const page = await newSpecPage({
|
|
34
|
+
components: [CheckboxComponent],
|
|
35
|
+
template: () => (h("b2b-checkbox", { label: "test", error: "this is an error", invalid: true })),
|
|
36
|
+
});
|
|
37
|
+
expect(page.root).toMatchSnapshot();
|
|
38
|
+
});
|
|
39
|
+
it('should render a hint if invalid and disabled are true at the same time', async () => {
|
|
40
|
+
const page = await newSpecPage({
|
|
41
|
+
components: [CheckboxComponent],
|
|
42
|
+
template: () => (h("b2b-checkbox", { label: "test", error: "This is a test error", hint: "this is a test hint", invalid: true, disabled: true })),
|
|
43
|
+
});
|
|
44
|
+
expect(page.root).toMatchSnapshot();
|
|
45
|
+
});
|
|
@@ -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 */
|
|
@@ -220,7 +219,7 @@
|
|
|
220
219
|
font-family: var(--b2b-font-family-default);
|
|
221
220
|
font-size: var(--b2b-size-copy-100);
|
|
222
221
|
}
|
|
223
|
-
.b2b-checkbox-
|
|
222
|
+
.b2b-checkbox-group__options {
|
|
224
223
|
display: flex;
|
|
225
224
|
flex-wrap: wrap;
|
|
226
225
|
align-items: stretch;
|
|
@@ -237,16 +236,16 @@
|
|
|
237
236
|
}
|
|
238
237
|
.b2b-checkbox-group span {
|
|
239
238
|
display: block;
|
|
240
|
-
font-size: var(--b2b-size-copy-
|
|
239
|
+
font-size: var(--b2b-size-copy-50);
|
|
241
240
|
color: var(--b2b-color-grey-300);
|
|
242
241
|
line-height: var(--b2b-size-copy-line-height-75);
|
|
243
242
|
}
|
|
244
243
|
.b2b-checkbox-group--error span {
|
|
245
244
|
color: var(--b2b-color-error-100);
|
|
246
245
|
}
|
|
247
|
-
.b2b-checkbox-group--vertical .b2b-checkbox-
|
|
246
|
+
.b2b-checkbox-group--vertical .b2b-checkbox-group__options {
|
|
248
247
|
flex-direction: column;
|
|
249
248
|
}
|
|
250
|
-
.b2b-checkbox-group--horizontal .b2b-checkbox-
|
|
249
|
+
.b2b-checkbox-group--horizontal .b2b-checkbox-group__options {
|
|
251
250
|
flex-direction: row;
|
|
252
251
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('B2B-Checkbox-Group', () => {
|
|
3
|
+
let page;
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
page = await newE2EPage();
|
|
6
|
+
await page.setContent(`
|
|
7
|
+
<b2b-checkbox-group label="test label">
|
|
8
|
+
<b2b-checkbox label="one" value="one" error="test" hint="test"></b2b-checkbox>
|
|
9
|
+
<b2b-checkbox id="disabled-checkbox" label="two" value="two" error="test" hint="test" disabled></b2b-checkbox>
|
|
10
|
+
</b2b-checkbox-group>
|
|
11
|
+
`);
|
|
12
|
+
});
|
|
13
|
+
it('should render the checkbox group component', async () => {
|
|
14
|
+
const element = await page.find('b2b-checkbox-group');
|
|
15
|
+
expect(element).not.toBeNull();
|
|
16
|
+
});
|
|
17
|
+
it('should have all checkboxes unchecked by default and check a checkbox', async () => {
|
|
18
|
+
const element = await page.find('b2b-checkbox >>> .b2b-checkbox');
|
|
19
|
+
await element.click();
|
|
20
|
+
await page.waitForChanges();
|
|
21
|
+
expect(element).toHaveClass('b2b-checkbox--checked');
|
|
22
|
+
});
|
|
23
|
+
it('should receive a custom event', async () => {
|
|
24
|
+
const element = await page.find('b2b-checkbox');
|
|
25
|
+
const b2bChange = await page.spyOnEvent('b2b-change');
|
|
26
|
+
element.triggerEvent('b2b-change', {
|
|
27
|
+
detail: {
|
|
28
|
+
value: '',
|
|
29
|
+
checked: true,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
await page.waitForChanges();
|
|
33
|
+
expect(b2bChange).toHaveReceivedEvent();
|
|
34
|
+
});
|
|
35
|
+
it('should emit a custom event when a checkbox is checked', async () => {
|
|
36
|
+
const element = await page.find('b2b-checkbox >>> .b2b-checkbox');
|
|
37
|
+
const b2bGroupChange = await page.spyOnEvent('b2b-group-change');
|
|
38
|
+
element.click();
|
|
39
|
+
await page.waitForChanges();
|
|
40
|
+
// currently a limitation of Puppeteer - no event details on custom events inside the shadow dom
|
|
41
|
+
expect(b2bGroupChange).toHaveReceivedEvent();
|
|
42
|
+
});
|
|
43
|
+
it('should disable all checkboxes when the property is specified', async () => {
|
|
44
|
+
const parentElement = await page.find('b2b-checkbox-group');
|
|
45
|
+
const element = await page.find('b2b-checkbox >>> .b2b-checkbox');
|
|
46
|
+
expect(element).not.toHaveClass('b2b-checkbox--disabled');
|
|
47
|
+
parentElement.setProperty('disabled', true);
|
|
48
|
+
await page.waitForChanges();
|
|
49
|
+
expect(element).toHaveClass('b2b-checkbox--disabled');
|
|
50
|
+
});
|
|
51
|
+
it('should set all checkboxes to invalid when the property is specified', async () => {
|
|
52
|
+
const parentElement = await page.find('b2b-checkbox-group');
|
|
53
|
+
const element = await page.find('b2b-checkbox >>> .b2b-checkbox');
|
|
54
|
+
expect(element).not.toHaveClass('b2b-checkbox--error');
|
|
55
|
+
parentElement.setProperty('invalid', true);
|
|
56
|
+
await page.waitForChanges();
|
|
57
|
+
expect(element).toHaveClass('b2b-checkbox--error');
|
|
58
|
+
});
|
|
59
|
+
it('should remove all children hint texts when the component is rendered', async () => {
|
|
60
|
+
const element = await page.find('b2b-checkbox');
|
|
61
|
+
const error = element.error;
|
|
62
|
+
const hint = element.hint;
|
|
63
|
+
expect(hint).not.toBeDefined;
|
|
64
|
+
expect(error).not.toBeDefined;
|
|
65
|
+
});
|
|
66
|
+
it('should disable individual elements of the group and keep their state when the group is dis- and enabled', async () => {
|
|
67
|
+
let checkbox = await page.find('#disabled-checkbox');
|
|
68
|
+
expect(await checkbox.getProperty('disabled')).toBe(true);
|
|
69
|
+
let group = await page.find('b2b-checkbox-group');
|
|
70
|
+
await group.setProperty('disabled', true);
|
|
71
|
+
await page.waitForChanges();
|
|
72
|
+
expect(await group.getProperty('disabled')).toBe(true);
|
|
73
|
+
await group.setProperty('disabled', false);
|
|
74
|
+
await page.waitForChanges();
|
|
75
|
+
expect(await group.getProperty('disabled')).toBe(false);
|
|
76
|
+
expect(await checkbox.getProperty('disabled')).toBe(true);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -13,7 +13,7 @@ export class CheckboxGroupComponent {
|
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
15
|
nodes.forEach(node => {
|
|
16
|
-
node.
|
|
16
|
+
node.groupDisabled = this.disabled;
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
};
|
|
@@ -59,15 +59,17 @@ export class CheckboxGroupComponent {
|
|
|
59
59
|
}
|
|
60
60
|
componentDidLoad() {
|
|
61
61
|
this.toggleAllError();
|
|
62
|
-
this.toggleAllDisabled();
|
|
63
62
|
this.removeChildText();
|
|
63
|
+
if (this.disabled) {
|
|
64
|
+
this.toggleAllDisabled();
|
|
65
|
+
}
|
|
64
66
|
}
|
|
65
67
|
render() {
|
|
66
68
|
return (h(Host, null, h("div", { class: {
|
|
67
69
|
'b2b-checkbox-group': true,
|
|
68
70
|
'b2b-checkbox-group--error': this.invalid && !this.disabled,
|
|
69
71
|
[`b2b-checkbox-group--${this.alignment}`]: true,
|
|
70
|
-
} }, this.label && (h("b2b-input-label", { required: this.required }, this.label)), h("fieldset", null, h("div", { class: "b2b-checkbox-
|
|
72
|
+
} }, this.label && (h("b2b-input-label", { required: this.required }, this.label)), h("fieldset", null, h("div", { class: "b2b-checkbox-group__options" }, h("slot", null))), (this.hint !== undefined && !this.invalid) ||
|
|
71
73
|
(this.hint !== undefined && this.disabled) ? (h("span", null, this.hint)) : (''), this.error !== undefined && this.invalid && !this.disabled ? (h("span", null, this.error)) : (''))));
|
|
72
74
|
}
|
|
73
75
|
static get is() { return "b2b-checkbox-group"; }
|