@otto-de/b2b-core-components 1.6.0 → 1.7.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.
Files changed (191) hide show
  1. package/dist/b2b-core-components/b2b-core-components.esm.js +1 -1
  2. package/dist/b2b-core-components/icons/b2b_icon-error-hint.svg +3 -0
  3. package/dist/b2b-core-components/p-03e21565.entry.js +1 -0
  4. package/dist/b2b-core-components/p-1c0df04b.entry.js +1 -0
  5. package/dist/b2b-core-components/p-1dc70300.js +1 -0
  6. package/dist/b2b-core-components/{p-a50ea33f.entry.js → p-33e66446.entry.js} +1 -1
  7. package/dist/b2b-core-components/{p-90a3ffed.entry.js → p-7a879329.entry.js} +1 -1
  8. package/dist/b2b-core-components/p-8bad814b.entry.js +1 -0
  9. package/dist/b2b-core-components/{p-db7d2ec3.entry.js → p-98b563a9.entry.js} +1 -1
  10. package/dist/b2b-core-components/p-9c0e419e.entry.js +1 -0
  11. package/dist/b2b-core-components/p-c60253d2.entry.js +1 -0
  12. package/dist/b2b-core-components/p-c885a630.entry.js +1 -0
  13. package/dist/b2b-core-components/p-cf0999e2.entry.js +1 -0
  14. package/dist/b2b-core-components/p-e31915cf.entry.js +1 -0
  15. package/dist/b2b-core-components/{p-0beabdb4.entry.js → p-f8ed569f.entry.js} +1 -1
  16. package/dist/cjs/b2b-breadcrumb-item.cjs.entry.js +40 -0
  17. package/dist/cjs/b2b-breadcrumb.cjs.entry.js +34 -0
  18. package/dist/cjs/b2b-button_2.cjs.entry.js +1 -1
  19. package/dist/cjs/b2b-checkbox_3.cjs.entry.js +24 -8
  20. package/dist/cjs/b2b-chip-component.cjs.entry.js +37 -0
  21. package/dist/cjs/b2b-core-components.cjs.js +1 -1
  22. package/dist/cjs/b2b-dropdown.cjs.entry.js +2 -2
  23. package/dist/cjs/b2b-icon.cjs.entry.js +1 -0
  24. package/dist/cjs/b2b-tab-group.cjs.entry.js +3 -1
  25. package/dist/cjs/b2b-table-row.cjs.entry.js +5 -8
  26. package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +1 -1
  27. package/dist/cjs/b2b-table.cjs.entry.js +1 -1
  28. package/dist/cjs/b2b-textarea.cjs.entry.js +2 -1
  29. package/dist/cjs/index-04e07a00.js +12 -0
  30. package/dist/cjs/loader.cjs.js +1 -1
  31. package/dist/cjs/{table.types-00c8228a.js → table.types-196dc690.js} +6 -0
  32. package/dist/collection/collection-manifest.json +3 -0
  33. package/dist/collection/components/alert/alert.css +2 -2
  34. package/dist/collection/components/alert/alert.stories.js +1 -8
  35. package/dist/collection/components/anchor/anchor.css +2 -2
  36. package/dist/collection/components/anchor/anchor.stories.js +0 -6
  37. package/dist/collection/components/breadcrumb/breadcrumb-item.js +123 -0
  38. package/dist/collection/components/breadcrumb/breadcrumb.css +250 -0
  39. package/dist/collection/components/breadcrumb/breadcrumb.e2e.js +50 -0
  40. package/dist/collection/components/breadcrumb/breadcrumb.js +66 -0
  41. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +22 -0
  42. package/dist/collection/components/button/button.css +10 -6
  43. package/dist/collection/components/button/button.stories.js +136 -80
  44. package/dist/collection/components/card/card.css +2 -2
  45. package/dist/collection/components/card/card.stories.js +0 -6
  46. package/dist/collection/components/checkbox/checkbox.css +5 -5
  47. package/dist/collection/components/checkbox/checkbox.js +1 -1
  48. package/dist/collection/components/checkbox/checkbox.stories.js +0 -6
  49. package/dist/collection/components/checkbox-group/checkbox-group.css +2 -2
  50. package/dist/collection/components/checkbox-group/checkbox-group.stories.js +0 -6
  51. package/dist/collection/components/chip/chip.css +249 -0
  52. package/dist/collection/components/chip/chip.e2e.js +19 -0
  53. package/dist/collection/components/chip/chip.js +134 -0
  54. package/dist/collection/components/chip/chip.stories.js +30 -0
  55. package/dist/collection/components/dropdown/dropdown.css +2 -2
  56. package/dist/collection/components/dropdown/dropdown.js +2 -2
  57. package/dist/collection/components/dropdown/dropdown.stories.js +0 -6
  58. package/dist/collection/components/grid/grid.stories.js +0 -4
  59. package/dist/collection/components/headline/headline.css +2 -2
  60. package/dist/collection/components/headline/headline.stories.js +0 -6
  61. package/dist/collection/components/icon/icon.css +2 -2
  62. package/dist/collection/components/icon/icon.js +1 -1
  63. package/dist/collection/components/icon/icon.stories.js +0 -6
  64. package/dist/collection/components/icon/icons/b2b_icon-error-hint.svg +3 -0
  65. package/dist/collection/components/icon/types.js +1 -0
  66. package/dist/collection/components/input/input.css +2 -2
  67. package/dist/collection/components/input/input.stories.js +124 -75
  68. package/dist/collection/components/input-group/input-group.css +2 -2
  69. package/dist/collection/components/input-group/input-group.stories.js +0 -6
  70. package/dist/collection/components/input-list/input-list.css +2 -2
  71. package/dist/collection/components/input-list/input-list.stories.js +74 -58
  72. package/dist/collection/components/label/label.css +2 -2
  73. package/dist/collection/components/label/label.stories.js +0 -6
  74. package/dist/collection/components/modal/modal.css +2 -2
  75. package/dist/collection/components/modal/modal.stories.js +1 -7
  76. package/dist/collection/components/pagination/pagination.css +2 -2
  77. package/dist/collection/components/pagination/pagination.stories.js +0 -4
  78. package/dist/collection/components/paragraph/paragraph.css +2 -2
  79. package/dist/collection/components/paragraph/paragraph.stories.js +0 -9
  80. package/dist/collection/components/radio/radio.css +2 -2
  81. package/dist/collection/components/radio/radio.stories.js +0 -6
  82. package/dist/collection/components/radio-group/radio-group.css +2 -2
  83. package/dist/collection/components/radio-group/radio-group.stories.js +0 -6
  84. package/dist/collection/components/required-separator/required-separator.css +2 -2
  85. package/dist/collection/components/required-separator/required-separator.stories.js +0 -6
  86. package/dist/collection/components/rounded-icon/rounded-icon.css +2 -2
  87. package/dist/collection/components/rounded-icon/rounded-icon.stories.js +0 -4
  88. package/dist/collection/components/scrollable-container/scrollable-container.css +2 -2
  89. package/dist/collection/components/scrollable-container/scrollable-container.stories.js +0 -4
  90. package/dist/collection/components/search/search.stories.js +2 -8
  91. package/dist/collection/components/separator/separator.css +2 -2
  92. package/dist/collection/components/separator/separator.stories.js +0 -6
  93. package/dist/collection/components/spinner/spinner.css +2 -2
  94. package/dist/collection/components/spinner/spinner.stories.js +0 -6
  95. package/dist/collection/components/tab/tab.css +2 -2
  96. package/dist/collection/components/tab-group/tab-group.e2e.js +1 -0
  97. package/dist/collection/components/tab-group/tab-group.js +3 -1
  98. package/dist/collection/components/tab-group/tab-group.stories.js +0 -6
  99. package/dist/collection/components/tab-panel/tab-panel.css +2 -2
  100. package/dist/collection/components/table/stories.data.js +4 -26
  101. package/dist/collection/components/table/table-cell/table-cell.css +2 -2
  102. package/dist/collection/components/table/table-header/table-header.css +27 -4
  103. package/dist/collection/components/table/table-header/table-header.js +46 -6
  104. package/dist/collection/components/table/table-row/table-row.css +2 -2
  105. package/dist/collection/components/table/table-row/table-row.js +4 -7
  106. package/dist/collection/components/table/table-rowgroup/table-rowgroup.css +2 -2
  107. package/dist/collection/components/table/table.css +2 -2
  108. package/dist/collection/components/table/table.e2e.js +7 -3
  109. package/dist/collection/components/table/table.stories.js +334 -275
  110. package/dist/collection/components/textarea/textarea.css +2 -2
  111. package/dist/collection/components/textarea/textarea.js +19 -1
  112. package/dist/collection/components/textarea/textarea.stories.js +5 -7
  113. package/dist/collection/components/toggle-button/toggle-button.css +2 -2
  114. package/dist/collection/components/toggle-group/toggle-group.css +2 -2
  115. package/dist/collection/components/toggle-group/toggle-group.stories.js +0 -6
  116. package/dist/collection/components/tooltip/tooltip.css +2 -2
  117. package/dist/collection/components/tooltip/tooltip.stories.js +1 -7
  118. package/dist/collection/components/wizard/wizard.css +2 -2
  119. package/dist/collection/components/wizard/wizard.stories.js +0 -4
  120. package/dist/collection/components/wizard-icon/wizard-icon.css +2 -2
  121. package/dist/collection/components/wizard-icon/wizard-icon.stories.js +9 -7
  122. package/dist/collection/docs/tokens/color.stories.js +1 -5
  123. package/dist/collection/docs/tokens/font.stories.js +1 -6
  124. package/dist/collection/docs/tokens/size.stories.js +1 -5
  125. package/dist/collection/utils/types/table.types.js +5 -0
  126. package/dist/components/b2b-breadcrumb-item.d.ts +11 -0
  127. package/dist/components/b2b-breadcrumb-item.js +58 -0
  128. package/dist/components/b2b-breadcrumb.d.ts +11 -0
  129. package/dist/components/b2b-breadcrumb.js +48 -0
  130. package/dist/components/b2b-chip-component.d.ts +11 -0
  131. package/dist/components/b2b-chip-component.js +56 -0
  132. package/dist/components/b2b-dropdown.js +2 -2
  133. package/dist/components/b2b-tab-group.js +3 -1
  134. package/dist/components/b2b-table-row.js +4 -7
  135. package/dist/components/b2b-textarea.js +4 -2
  136. package/dist/components/button.js +1 -1
  137. package/dist/components/checkbox.js +2 -2
  138. package/dist/components/icon.js +1 -0
  139. package/dist/components/table-header.js +25 -7
  140. package/dist/components/table.types.js +6 -1
  141. package/dist/custom-elements.json +76 -0
  142. package/dist/esm/b2b-breadcrumb-item.entry.js +36 -0
  143. package/dist/esm/b2b-breadcrumb.entry.js +30 -0
  144. package/dist/esm/b2b-button_2.entry.js +1 -1
  145. package/dist/esm/b2b-checkbox_3.entry.js +24 -8
  146. package/dist/esm/b2b-chip-component.entry.js +33 -0
  147. package/dist/esm/b2b-core-components.js +1 -1
  148. package/dist/esm/b2b-dropdown.entry.js +2 -2
  149. package/dist/esm/b2b-icon.entry.js +1 -0
  150. package/dist/esm/b2b-tab-group.entry.js +3 -1
  151. package/dist/esm/b2b-table-row.entry.js +5 -8
  152. package/dist/esm/b2b-table-rowgroup.entry.js +1 -1
  153. package/dist/esm/b2b-table.entry.js +1 -1
  154. package/dist/esm/b2b-textarea.entry.js +2 -1
  155. package/dist/esm/index-dfdbf4b9.js +12 -0
  156. package/dist/esm/loader.js +1 -1
  157. package/dist/esm/{table.types-dd829d83.js → table.types-46c5a83a.js} +6 -1
  158. package/{loader → dist/loader}/cdn.js +1 -1
  159. package/{loader → dist/loader}/index.cjs.js +1 -1
  160. package/{loader → dist/loader}/index.d.ts +1 -1
  161. package/dist/loader/index.es2017.js +3 -0
  162. package/{loader → dist/loader}/index.js +2 -2
  163. package/dist/types/components/breadcrumb/breadcrumb-item.d.ts +15 -0
  164. package/dist/types/components/breadcrumb/breadcrumb.d.ts +11 -0
  165. package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +4 -0
  166. package/dist/types/components/button/button.stories.d.ts +14 -12
  167. package/dist/types/components/chip/chip.d.ts +17 -0
  168. package/dist/types/components/chip/chip.stories.d.ts +6 -0
  169. package/dist/types/components/icon/types.d.ts +1 -1
  170. package/dist/types/components/input/input.stories.d.ts +14 -13
  171. package/dist/types/components/input-list/input-list.stories.d.ts +8 -7
  172. package/dist/types/components/paragraph/paragraph.stories.d.ts +0 -1
  173. package/dist/types/components/table/stories.data.d.ts +3 -3
  174. package/dist/types/components/table/table-header/table-header.d.ts +5 -2
  175. package/dist/types/components/table/table.stories.d.ts +18 -16
  176. package/dist/types/components/textarea/textarea.d.ts +2 -0
  177. package/dist/types/components/textarea/textarea.stories.d.ts +1 -0
  178. package/dist/types/components.d.ts +135 -4
  179. package/dist/types/utils/interfaces/form.interface.d.ts +3 -0
  180. package/dist/types/utils/interfaces/interaction.interface.d.ts +4 -0
  181. package/dist/types/utils/types/table.types.d.ts +6 -0
  182. package/dist/web-types.json +149 -3
  183. package/package.json +26 -21
  184. package/dist/b2b-core-components/p-01fd54a1.entry.js +0 -1
  185. package/dist/b2b-core-components/p-06aa96a8.entry.js +0 -1
  186. package/dist/b2b-core-components/p-077217b3.entry.js +0 -1
  187. package/dist/b2b-core-components/p-163466cf.entry.js +0 -1
  188. package/dist/b2b-core-components/p-34eb99cb.js +0 -1
  189. package/dist/b2b-core-components/p-d7bb8aa1.entry.js +0 -1
  190. package/loader/index.es2017.js +0 -3
  191. /package/{loader → dist/loader}/package.json +0 -0
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -1,6 +1,5 @@
1
1
  import { getArgTypes } from '../../docs/config/utils';
2
2
  import { html } from 'lit-html';
3
- import RoundedIconDocs from './rounded-icon.docs.mdx';
4
3
  const TemplateIcon = ({ color, contentColor, iconName }) => {
5
4
  return html `<div>
6
5
  <b2b-rounded-icon color="${color}" content-color="${contentColor}">
@@ -37,8 +36,5 @@ export default {
37
36
  viewmode: 'docs',
38
37
  parameters: {
39
38
  controls: { expanded: true },
40
- docs: {
41
- page: RoundedIconDocs,
42
- },
43
39
  },
44
40
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -1,6 +1,5 @@
1
1
  import { getArgTypes } from '../../docs/config/utils';
2
2
  import { html } from 'lit-html';
3
- import componentDocs from './scrollable-container.docs.mdx';
4
3
  const Template = ({ testWidth, testHeight, testWhiteSpace }) => {
5
4
  return html `
6
5
  <b2b-scrollable-container
@@ -53,9 +52,6 @@ export default {
53
52
  viewmode: 'docs',
54
53
  parameters: {
55
54
  controls: { expanded: true },
56
- docs: {
57
- page: componentDocs,
58
- },
59
55
  backgrounds: {
60
56
  default: 'docsBackground',
61
57
  values: [{ name: 'docsBackground', value: '#fff' }],
@@ -1,8 +1,7 @@
1
1
  import { getArgTypes } from '../../docs/config/utils';
2
2
  import { html } from 'lit-html';
3
- import { useArgs } from '@storybook/client-api';
3
+ import { useArgs } from '@storybook/preview-api';
4
4
  import dedent from 'ts-dedent';
5
- import searchDocs from './search.docs.mdx';
6
5
  import fruits from './stories.data.json';
7
6
  const Template = ({ placeholder, optionsList, disabled }) => {
8
7
  const [_, updateArgs] = useArgs();
@@ -89,11 +88,6 @@ const searchArgs = getArgTypes('b2b-search', controls);
89
88
  searchArgs.optionsList = Object.assign(Object.assign({}, searchArgs.optionsList), { control: false });
90
89
  export default {
91
90
  title: 'Components/Form/Search',
92
- argTypes: Object.assign({}, searchArgs),
91
+ argTypes: Object.assign(Object.assign({}, searchArgs), { optionsList: { table: { disable: true } }, value: { table: { disable: true } } }),
93
92
  viewmode: 'docs',
94
- parameters: {
95
- docs: {
96
- page: searchDocs,
97
- },
98
- },
99
93
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -1,5 +1,4 @@
1
1
  import { html } from 'lit-html';
2
- import docs from './separator.docs.mdx';
3
2
  import { getArgTypes } from '../../docs/config/utils';
4
3
  const Template = ({ alignment }) => {
5
4
  const content = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse massa urna, accumsan id viverra et, mollis sit amet sem.`;
@@ -34,9 +33,4 @@ export default {
34
33
  title: 'Components/Utilities/Separator',
35
34
  argTypes: argTypes,
36
35
  viewMode: 'docs',
37
- parameters: {
38
- docs: {
39
- page: docs,
40
- },
41
- },
42
36
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -1,5 +1,4 @@
1
1
  import { getArgTypes } from '../../docs/config/utils';
2
- import spinnerDocs from './spinner.docs.mdx';
3
2
  import { html } from 'lit-html';
4
3
  const Template = ({ size, color }) => {
5
4
  return html ` <b2b-spinner size="${size}" color="${color}"></b2b-spinner>`;
@@ -34,9 +33,4 @@ export default {
34
33
  title: 'Components/Status & Feedback/Spinner',
35
34
  argTypes: spinnerArgs,
36
35
  viewmode: 'docs',
37
- parameters: {
38
- docs: {
39
- page: spinnerDocs,
40
- },
41
- },
42
36
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -89,6 +89,7 @@ describe('B2B Tab Group', () => {
89
89
  await page.waitForChanges();
90
90
  const tabs = await page.findAll('b2b-tab');
91
91
  expect(await tabs[0].getProperty('selected')).toBe(true);
92
+ expect(await tabs[0].getAttribute('aria-controls')).not.toBeDefined;
92
93
  await page.keyboard.press('ArrowRight');
93
94
  await page.waitForChanges();
94
95
  await tabs[1].click();
@@ -115,7 +115,9 @@ export class B2bTabGroupComponent {
115
115
  customElements.whenDefined('b2b-tab'),
116
116
  customElements.whenDefined('b2b-tab-panel'),
117
117
  ]).then(() => {
118
- this.linkPanels();
118
+ if (!this.useRouter) {
119
+ this.linkPanels();
120
+ }
119
121
  });
120
122
  }
121
123
  render() {
@@ -1,6 +1,5 @@
1
1
  import { getArgTypes } from '../../docs/config/utils';
2
2
  import { html } from 'lit-html';
3
- import tabGroupDocs from './tab-group.docs.mdx';
4
3
  const Template = ({ useRouter }) => {
5
4
  return html ` <b2b-tab-group use-router="${useRouter}">
6
5
  <b2b-tab slot="tab">First Tab</b2b-tab>
@@ -50,9 +49,4 @@ export default {
50
49
  title: 'Components/Interaction/Tab Group',
51
50
  argTypes: tabGroupArgs,
52
51
  viewMode: 'docs',
53
- parameters: {
54
- docs: {
55
- page: tabGroupDocs,
56
- },
57
- },
58
52
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -1,41 +1,23 @@
1
- import { html } from 'lit-html';
2
1
  export const sampleData = {
3
2
  columns: ['Name', 'Column 1', 'Column 2', 'Column 3'],
4
3
  rows: [
5
- [
6
- 'Name A',
7
- 'Content 1',
8
- 'Content 1',
9
- html ` <b2b-button size="50">Action</b2b-button>`,
10
- ],
11
- [
12
- 'Name B',
13
- 'Content 2',
14
- 'Content 2',
15
- html ` <b2b-button size="50">Action</b2b-button>`,
16
- ],
17
- [
18
- 'Name C',
19
- 'Content 3',
20
- 'Content 3',
21
- html ` <b2b-button size="50">Action</b2b-button>`,
22
- ],
4
+ ['Name A', 'Content 1', 'Content 1'],
5
+ ['Name B', 'Content 2', 'Content 2'],
6
+ ['Name C', 'Content 3', 'Content 3'],
23
7
  [
24
8
  'Name D',
25
9
  'Content 4',
26
10
  'Very, very, long, long data text that wraps over to next line',
27
- html ` <b2b-button size="50">Action</b2b-button>`,
28
11
  ],
29
12
  ],
30
13
  };
31
14
  export const smallSampleData = {
32
15
  columns: ['Column 1', 'Column 2', 'Column 3'],
33
16
  rows: [
34
- ['Name A', 'Content 1', html ` <b2b-button size="50">Action</b2b-button>`],
17
+ ['Name A', 'Content 1'],
35
18
  [
36
19
  'Name D',
37
20
  'Very long data text that wraps over to next line, Very long data text that wraps over to next line',
38
- html ` <b2b-button size="50">Action</b2b-button>`,
39
21
  ],
40
22
  ],
41
23
  };
@@ -55,7 +37,6 @@ export const longSampleData = {
55
37
  'Name A',
56
38
  'Content 1',
57
39
  'Content 1',
58
- html ` <b2b-button>Action</b2b-button>`,
59
40
  'Content 1',
60
41
  'Content 1',
61
42
  'Content 1',
@@ -65,7 +46,6 @@ export const longSampleData = {
65
46
  'Name B',
66
47
  'Content 2',
67
48
  'Content 2',
68
- html ` <b2b-button>Action</b2b-button>`,
69
49
  'Content 2',
70
50
  'Content 2',
71
51
  'Content 2',
@@ -75,7 +55,6 @@ export const longSampleData = {
75
55
  'Name C',
76
56
  'Content 3',
77
57
  'Content 3',
78
- html ` <b2b-button>Action</b2b-button>`,
79
58
  'Content 3',
80
59
  'Content 3',
81
60
  'Content 3',
@@ -85,7 +64,6 @@ export const longSampleData = {
85
64
  'Name D',
86
65
  'Content 4',
87
66
  'Very, very, long, long data text that wraps over to next line',
88
- html ` <b2b-button>Action</b2b-button>`,
89
67
  'Content 4',
90
68
  'Content 4',
91
69
  'Content 4',
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -224,6 +224,7 @@
224
224
  font-weight: bold;
225
225
  border-top: 1px solid var(--b2b-color-grey-200);
226
226
  border-bottom: 2px solid var(--b2b-color-grey-300);
227
+ vertical-align: middle;
227
228
  }
228
229
  :host .b2b-table-header__heading {
229
230
  cursor: pointer;
@@ -232,6 +233,16 @@
232
233
  height: var(--b2b-size-icon-100);
233
234
  line-height: var(--b2b-size-icon-100);
234
235
  }
236
+ :host .b2b-table-header__heading--left {
237
+ justify-content: start;
238
+ }
239
+ :host .b2b-table-header__heading--right {
240
+ justify-content: end;
241
+ flex-direction: row-reverse;
242
+ }
243
+ :host .b2b-table-header__heading--center {
244
+ justify-content: center;
245
+ }
235
246
  :host .b2b-table-header__heading:hover, :host .b2b-table-header__heading:focus-visible {
236
247
  outline: none;
237
248
  }
@@ -249,6 +260,12 @@
249
260
  transform: rotate(180deg);
250
261
  transition: transform 0.4s ease;
251
262
  }
263
+ :host .b2b-table-header__heading:hover .b2b-table-header__sort--left, :host .b2b-table-header__heading:focus-visible .b2b-table-header__sort--left {
264
+ float: right;
265
+ }
266
+ :host .b2b-table-header__heading:hover .b2b-table-header__sort--right, :host .b2b-table-header__heading:focus-visible .b2b-table-header__sort--right {
267
+ float: right;
268
+ }
252
269
  :host .b2b-table-header__heading.b2b-table-header__sort--active .b2b-table-header__sort,
253
270
  :host .b2b-table-header__heading .b2b-table-header__sort--active:hover .b2b-table-header__sort {
254
271
  fill: var(--b2b-color-black-100);
@@ -257,8 +274,8 @@
257
274
  :host .b2b-table-header__heading .b2b-table-header__sort--active:hover .b2b-table-header__sort--descending {
258
275
  transform: rotate(180deg);
259
276
  }
260
- :host .b2b-table-header__heading.b2b-table-header__sort--active .b2b-table-header__sort-ascending,
261
- :host .b2b-table-header__heading .b2b-table-header__sort--active:hover .b2b-table-header__sort-ascending {
277
+ :host .b2b-table-header__heading.b2b-table-header__sort--active .b2b-table-header__sort--ascending,
278
+ :host .b2b-table-header__heading .b2b-table-header__sort--active:hover .b2b-table-header__sort--ascending {
262
279
  transform: initial;
263
280
  }
264
281
  :host .b2b-table-header__sort {
@@ -274,6 +291,12 @@
274
291
  :host(.b2b-table-header--divider) {
275
292
  border-right: 1px solid var(--b2b-color-grey-200);
276
293
  }
294
+ :host(.b2b-table-header--left) {
295
+ padding-left: var(--b2b-size-15);
296
+ }
297
+ :host(.b2b-table-header--right) {
298
+ padding-right: var(--b2b-size-15);
299
+ }
277
300
  :host(.b2b-table-header--fixed) {
278
301
  position: sticky;
279
302
  top: 0;
@@ -1,8 +1,7 @@
1
1
  import { h, Host, } from '@stencil/core';
2
- import { TableSortDirections } from '../../../utils/types/table.types';
2
+ import { ContentAlignment, TableSortDirections, SortIconAlignment, } from '../../../utils/types/table.types';
3
3
  export class TableHeaderComponent {
4
4
  constructor() {
5
- this.sortIcon = (h("svg", { viewBox: "0 0 24 24", height: "24px", width: "24px", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M19.1831 8.47552L12.8541 2.14703C12.8079 2.10065 12.7524 2.06384 12.6909 2.03839C12.5687 1.98785 12.4313 1.98785 12.3091 2.03839C12.2476 2.06384 12.1921 2.10065 12.1459 2.14703L5.81689 8.47552C5.62158 8.67084 5.62158 8.98724 5.81689 9.18256C6.01221 9.37787 6.32861 9.37787 6.52393 9.18256L12 3.70691V21.4999C12 21.7763 12.2236 21.9999 12.5 21.9999C12.7764 21.9999 13 21.7763 13 21.4999V3.70691L18.4761 9.18256C18.5737 9.28021 18.7017 9.32904 18.8296 9.32904C18.9575 9.32904 19.0854 9.28021 19.1831 9.18256C19.3784 8.98724 19.3784 8.67084 19.1831 8.47552Z" })));
6
5
  this.changeSortDirection = (e) => {
7
6
  if ((e.type === 'keydown' && e.key === 'Enter') || e.type === 'click') {
8
7
  this.unSortSiblings();
@@ -42,11 +41,26 @@ export class TableHeaderComponent {
42
41
  this.fixed = false;
43
42
  this.sortDirection = undefined;
44
43
  this.sortId = undefined;
44
+ this.contentAlign = ContentAlignment.LEFT;
45
45
  this.active = false;
46
+ this.iconAlign = undefined;
47
+ }
48
+ componentWillRender() {
49
+ switch (this.contentAlign) {
50
+ case ContentAlignment.LEFT:
51
+ this.iconAlign = SortIconAlignment.RIGHT;
52
+ break;
53
+ case ContentAlignment.RIGHT:
54
+ this.iconAlign = SortIconAlignment.LEFT;
55
+ break;
56
+ case ContentAlignment.CENTER:
57
+ this.iconAlign = SortIconAlignment.RIGHT;
58
+ break;
59
+ }
46
60
  }
47
61
  render() {
48
62
  return (h(Host, { class: {
49
- 'b2b-table-header': true,
63
+ [`b2b-table-header--${this.sortDirection && this.iconAlign}`]: true,
50
64
  'b2b-table-header--divider': this.divider,
51
65
  'b2b-table-header--fixed': this.fixed,
52
66
  }, role: "columnheader", "aria-sort": this.sortDirection === 'not-sorted' ||
@@ -54,11 +68,13 @@ export class TableHeaderComponent {
54
68
  ? 'other'
55
69
  : this.sortDirection }, this.sortDirection !== undefined ? (h("div", { tabIndex: 0, class: {
56
70
  'b2b-table-header__heading': true,
71
+ [`b2b-table-header__heading--${this.contentAlign}`]: true,
57
72
  'b2b-table-header__sort--active': this.active,
58
- }, onClick: this.changeSortDirection, onKeyDown: this.changeSortDirection, onMouseLeave: this.setInactive, onBlur: this.setInactive }, h("slot", null), h("span", { class: {
73
+ }, onClick: this.changeSortDirection, onKeyDown: this.changeSortDirection, onMouseLeave: this.setInactive, onBlur: this.setInactive }, h("slot", null), h("svg", { class: {
59
74
  'b2b-table-header__sort': true,
60
75
  [`b2b-table-header__sort--${this.sortDirection}`]: true,
61
- } }, this.sortIcon))) : (h("slot", null))));
76
+ [`b2b-table-header__sort--${this.iconAlign}`]: true,
77
+ }, viewBox: "0 0 24 24", height: "24px", width: "24px", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M19.1831 8.47552L12.8541 2.14703C12.8079 2.10065 12.7524 2.06384 12.6909 2.03839C12.5687 1.98785 12.4313 1.98785 12.3091 2.03839C12.2476 2.06384 12.1921 2.10065 12.1459 2.14703L5.81689 8.47552C5.62158 8.67084 5.62158 8.98724 5.81689 9.18256C6.01221 9.37787 6.32861 9.37787 6.52393 9.18256L12 3.70691V21.4999C12 21.7763 12.2236 21.9999 12.5 21.9999C12.7764 21.9999 13 21.7763 13 21.4999V3.70691L18.4761 9.18256C18.5737 9.28021 18.7017 9.32904 18.8296 9.32904C18.9575 9.32904 19.0854 9.28021 19.1831 9.18256C19.3784 8.98724 19.3784 8.67084 19.1831 8.47552Z" })))) : (h("slot", null))));
62
78
  }
63
79
  static get is() { return "b2b-table-header"; }
64
80
  static get encapsulation() { return "shadow"; }
@@ -148,12 +164,36 @@ export class TableHeaderComponent {
148
164
  },
149
165
  "attribute": "sort-id",
150
166
  "reflect": false
167
+ },
168
+ "contentAlign": {
169
+ "type": "string",
170
+ "mutable": false,
171
+ "complexType": {
172
+ "original": "ContentAlignment",
173
+ "resolved": "\"center\" | \"left\" | \"right\"",
174
+ "references": {
175
+ "ContentAlignment": {
176
+ "location": "import",
177
+ "path": "../../../utils/types/table.types"
178
+ }
179
+ }
180
+ },
181
+ "required": false,
182
+ "optional": false,
183
+ "docs": {
184
+ "tags": [],
185
+ "text": "Alignment of the content of the cell, by default is to the left. *"
186
+ },
187
+ "attribute": "content-align",
188
+ "reflect": false,
189
+ "defaultValue": "ContentAlignment.LEFT"
151
190
  }
152
191
  };
153
192
  }
154
193
  static get states() {
155
194
  return {
156
- "active": {}
195
+ "active": {},
196
+ "iconAlign": {}
157
197
  };
158
198
  }
159
199
  static get events() {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -12,16 +12,13 @@ export class TableRowComponent {
12
12
  return this.color;
13
13
  };
14
14
  this.getRowWidth = () => {
15
- const accordionIconSize = '24px';
15
+ const accordionSize = '24px';
16
16
  const checkboxSize = '16px';
17
- if (Boolean(this.accordionType)) {
18
- return accordionIconSize;
19
- }
20
- else if (Boolean(this.selectable)) {
17
+ if (Boolean(this.selectable)) {
21
18
  return checkboxSize;
22
19
  }
23
- else if (Boolean(this.accordionType && this.selectable)) {
24
- return accordionIconSize + checkboxSize;
20
+ else if (Boolean(this.accordionType)) {
21
+ return accordionSize;
25
22
  }
26
23
  else {
27
24
  return;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 22 Aug 2023 11:28:34 GMT
3
+ * Generated on Thu, 26 Oct 2023 14:16:21 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 Tue, 22 Aug 2023 11:28:34 GMT
125
+ * Generated on Thu, 26 Oct 2023 14:16:22 GMT
126
126
  */
127
127
  :root [data-theme="dark"] {
128
128
  --b2b-size-200: 5rem; /* 80px */
@@ -7,9 +7,9 @@ describe('B2B-Table', () => {
7
7
  <b2b-table size='equal'>
8
8
  <b2b-table-rowgroup type='header'>
9
9
  <b2b-table-row>
10
- <b2b-table-header sort-direction="not-sorted">Title 1</b2b-table-header>
10
+ <b2b-table-header sort-direction="not-sorted" sort-icon-align="left">Title 1</b2b-table-header>
11
11
  <b2b-table-header>Title 2</b2b-table-header>
12
- <b2b-table-header sort-direction="descending" sort-id='title3'>Title 3</b2b-table-header>
12
+ <b2b-table-header sort-direction="descending" sort-id='title3' sort-icon-align="right">Title 3</b2b-table-header>
13
13
  </b2b-table-row>
14
14
  </b2b-table-rowgroup>
15
15
  <b2b-table-rowgroup type='body'>
@@ -119,8 +119,12 @@ describe('B2B-Table', () => {
119
119
  it('should emit the sort direction when a column header is clicked', async () => {
120
120
  const headerCol = await page.find({ text: 'Title 1' });
121
121
  const b2bChange = await page.spyOnEvent('b2b-change');
122
+ const sortArrow = await page.find('b2b-table-header >>> svg');
123
+ let ariaState = await headerCol.getAttribute('aria-sort');
124
+ expect(sortArrow).toHaveClass('b2b-table-header__sort--right');
125
+ expect(ariaState).toEqualText('other');
122
126
  await headerCol.click();
123
- const ariaState = await headerCol.getAttribute('aria-sort');
127
+ ariaState = await headerCol.getAttribute('aria-sort');
124
128
  expect(ariaState).toEqualText('ascending');
125
129
  expect(b2bChange).toHaveReceivedEvent();
126
130
  });