@otto-de/b2b-core-components 1.24.0 → 1.26.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.
Files changed (146) hide show
  1. package/dist/b2b-core-components/b2b-core-components.esm.js +1 -1
  2. package/dist/b2b-core-components/p-01a5c813.entry.js +1 -0
  3. package/dist/b2b-core-components/p-225e561a.entry.js +1 -0
  4. package/dist/b2b-core-components/p-4d96ee04.entry.js +1 -0
  5. package/dist/b2b-core-components/p-51dab4f2.entry.js +1 -0
  6. package/dist/b2b-core-components/p-5c576b32.entry.js +1 -0
  7. package/dist/b2b-core-components/p-9e3d9908.entry.js +1 -0
  8. package/dist/b2b-core-components/p-c305ae21.entry.js +1 -0
  9. package/dist/b2b-core-components/p-e73552ea.entry.js +1 -0
  10. package/dist/cjs/b2b-background-box.cjs.entry.js +5 -5
  11. package/dist/cjs/b2b-core-components.cjs.js +1 -1
  12. package/dist/cjs/b2b-date-picker.cjs.entry.js +2 -1
  13. package/dist/cjs/b2b-dropdown.cjs.entry.js +12 -3
  14. package/dist/cjs/b2b-grid-row.cjs.entry.js +77 -11
  15. package/dist/cjs/b2b-input-group_2.cjs.entry.js +1 -1
  16. package/dist/cjs/b2b-input_2.cjs.entry.js +27 -6
  17. package/dist/cjs/b2b-multiselect-dropdown.cjs.entry.js +4 -4
  18. package/dist/cjs/b2b-snackbar.cjs.entry.js +5 -4
  19. package/dist/cjs/loader.cjs.js +1 -1
  20. package/dist/collection/components/alert/alert.css +2 -2
  21. package/dist/collection/components/alert/alert.stories.js +1 -2
  22. package/dist/collection/components/anchor/anchor.css +2 -2
  23. package/dist/collection/components/background-box/background-box.css +6 -6
  24. package/dist/collection/components/background-box/background-box.e2e.js +3 -3
  25. package/dist/collection/components/background-box/background-box.js +7 -7
  26. package/dist/collection/components/background-box/background-box.spec.js +3 -3
  27. package/dist/collection/components/background-box/background-box.stories.js +18 -18
  28. package/dist/collection/components/breadcrumb/breadcrumb.css +2 -2
  29. package/dist/collection/components/button/button.css +2 -2
  30. package/dist/collection/components/button/button.stories.js +79 -79
  31. package/dist/collection/components/card/card.css +2 -2
  32. package/dist/collection/components/checkbox/checkbox.css +2 -2
  33. package/dist/collection/components/checkbox-group/checkbox-group.css +2 -2
  34. package/dist/collection/components/chip/chip.css +2 -2
  35. package/dist/collection/components/chip/chip.stories.js +15 -15
  36. package/dist/collection/components/date-picker/date-picker-days-header.css +2 -2
  37. package/dist/collection/components/date-picker/date-picker-days.css +2 -2
  38. package/dist/collection/components/date-picker/date-picker-header.css +2 -2
  39. package/dist/collection/components/date-picker/date-picker-months.css +2 -2
  40. package/dist/collection/components/date-picker/date-picker-years.css +2 -2
  41. package/dist/collection/components/date-picker/date-picker.css +2 -2
  42. package/dist/collection/components/date-picker/date-picker.js +20 -1
  43. package/dist/collection/components/date-picker/date-picker.stories.js +4 -1
  44. package/dist/collection/components/dropdown/dropdown.css +4 -4
  45. package/dist/collection/components/dropdown/dropdown.js +47 -2
  46. package/dist/collection/components/flyout-menu/flyout-menu-option.css +2 -2
  47. package/dist/collection/components/flyout-menu/flyout-menu.css +2 -2
  48. package/dist/collection/components/flyout-menu/flyout-menu.stories.js +44 -44
  49. package/dist/collection/components/grid/grid.stories.js +151 -148
  50. package/dist/collection/components/grid/row.js +77 -11
  51. package/dist/collection/components/headline/headline.css +2 -2
  52. package/dist/collection/components/icon/icon.css +2 -2
  53. package/dist/collection/components/icon-100/icon-100.css +2 -2
  54. package/dist/collection/components/icon-100/icon-100.stories.js +5 -5
  55. package/dist/collection/components/icon-50/icon-50.css +2 -2
  56. package/dist/collection/components/icon-50/icon-50.stories.js +4 -4
  57. package/dist/collection/components/input/input.css +3 -3
  58. package/dist/collection/components/input/input.e2e.js +28 -0
  59. package/dist/collection/components/input/input.js +26 -5
  60. package/dist/collection/components/input/input.stories.js +75 -55
  61. package/dist/collection/components/input-group/input-group.css +3 -3
  62. package/dist/collection/components/input-list/input-list.css +2 -2
  63. package/dist/collection/components/input-list/input-list.stories.js +50 -50
  64. package/dist/collection/components/label/label.css +2 -2
  65. package/dist/collection/components/modal/modal.css +2 -2
  66. package/dist/collection/components/modal/modal.stories.js +1 -1
  67. package/dist/collection/components/multiselect-dropdown/multiselect-dropdown.css +2 -2
  68. package/dist/collection/components/multiselect-dropdown/multiselect-dropdown.js +4 -4
  69. package/dist/collection/components/multiselect-dropdown/multiselect-dropdown.stories.js +19 -19
  70. package/dist/collection/components/pagination/pagination.css +2 -2
  71. package/dist/collection/components/paragraph/paragraph.css +2 -2
  72. package/dist/collection/components/paragraph/paragraph.stories.js +82 -78
  73. package/dist/collection/components/progress-bar/progress-bar.css +2 -2
  74. package/dist/collection/components/progress-bar/progress-bar.stories.js +4 -4
  75. package/dist/collection/components/radio/radio.css +2 -2
  76. package/dist/collection/components/radio-group/radio-group.css +2 -2
  77. package/dist/collection/components/required-separator/required-separator.css +2 -2
  78. package/dist/collection/components/rounded-icon/rounded-icon.css +2 -2
  79. package/dist/collection/components/scrollable-container/scrollable-container.css +2 -2
  80. package/dist/collection/components/separator/separator.css +2 -2
  81. package/dist/collection/components/shimmer/shimmer.css +2 -2
  82. package/dist/collection/components/snackbar/snackbar.css +2 -2
  83. package/dist/collection/components/snackbar/snackbar.js +22 -4
  84. package/dist/collection/components/snackbar/snackbar.stories.js +10 -2
  85. package/dist/collection/components/spinner/spinner.css +2 -2
  86. package/dist/collection/components/tab/tab.css +2 -2
  87. package/dist/collection/components/tab-panel/tab-panel.css +2 -2
  88. package/dist/collection/components/table/table-cell/table-cell.css +2 -2
  89. package/dist/collection/components/table/table-header/table-header.css +2 -2
  90. package/dist/collection/components/table/table-row/table-row.css +2 -2
  91. package/dist/collection/components/table/table-rowgroup/table-rowgroup.css +2 -2
  92. package/dist/collection/components/table/table.css +2 -2
  93. package/dist/collection/components/table/table.e2e.js +2 -1
  94. package/dist/collection/components/table/table.stories.js +157 -157
  95. package/dist/collection/components/textarea/textarea.css +2 -2
  96. package/dist/collection/components/toggle-button/toggle-button.css +2 -2
  97. package/dist/collection/components/toggle-chip/toggle-chip.css +2 -2
  98. package/dist/collection/components/toggle-chip/toggle-chip.stories.js +14 -2
  99. package/dist/collection/components/toggle-group/toggle-group.css +2 -2
  100. package/dist/collection/components/toggle-switch/toggle-switch.css +2 -2
  101. package/dist/collection/components/toggle-switch/toggle-switch.stories.js +4 -4
  102. package/dist/collection/components/tooltip/tooltip.css +2 -2
  103. package/dist/collection/components/wizard/wizard.css +2 -2
  104. package/dist/collection/components/wizard-icon/wizard-icon.css +2 -2
  105. package/dist/components/b2b-background-box.js +6 -6
  106. package/dist/components/b2b-date-picker.js +23 -15
  107. package/dist/components/b2b-dropdown.js +14 -3
  108. package/dist/components/b2b-grid-row.js +77 -11
  109. package/dist/components/b2b-multiselect-dropdown.js +4 -4
  110. package/dist/components/b2b-snackbar.js +7 -5
  111. package/dist/components/input-group.js +1 -1
  112. package/dist/components/input.js +27 -6
  113. package/dist/custom-elements.json +18 -2
  114. package/dist/esm/b2b-background-box.entry.js +5 -5
  115. package/dist/esm/b2b-core-components.js +1 -1
  116. package/dist/esm/b2b-date-picker.entry.js +2 -1
  117. package/dist/esm/b2b-dropdown.entry.js +12 -3
  118. package/dist/esm/b2b-grid-row.entry.js +77 -11
  119. package/dist/esm/b2b-input-group_2.entry.js +1 -1
  120. package/dist/esm/b2b-input_2.entry.js +27 -6
  121. package/dist/esm/b2b-multiselect-dropdown.entry.js +4 -4
  122. package/dist/esm/b2b-snackbar.entry.js +5 -4
  123. package/dist/esm/loader.js +1 -1
  124. package/dist/types/components/background-box/background-box.d.ts +2 -2
  125. package/dist/types/components/background-box/background-box.stories.d.ts +1 -1
  126. package/dist/types/components/button/button.stories.d.ts +2 -2
  127. package/dist/types/components/date-picker/date-picker.d.ts +2 -0
  128. package/dist/types/components/dropdown/dropdown.d.ts +4 -0
  129. package/dist/types/components/grid/row.d.ts +4 -0
  130. package/dist/types/components/icon/icon.stories.d.ts +3 -3
  131. package/dist/types/components/input/input.d.ts +4 -0
  132. package/dist/types/components/input/input.stories.d.ts +1 -0
  133. package/dist/types/components/snackbar/snackbar.d.ts +2 -0
  134. package/dist/types/components/snackbar/snackbar.stories.d.ts +1 -0
  135. package/dist/types/components/toggle-chip/toggle-chip.stories.d.ts +3 -2
  136. package/dist/types/components.d.ts +36 -4
  137. package/dist/web-types.json +42 -3
  138. package/package.json +21 -16
  139. package/dist/b2b-core-components/p-191b7d0b.entry.js +0 -1
  140. package/dist/b2b-core-components/p-2b5b4472.entry.js +0 -1
  141. package/dist/b2b-core-components/p-333969c9.entry.js +0 -1
  142. package/dist/b2b-core-components/p-339dd3ba.entry.js +0 -1
  143. package/dist/b2b-core-components/p-56293400.entry.js +0 -1
  144. package/dist/b2b-core-components/p-95d3519f.entry.js +0 -1
  145. package/dist/b2b-core-components/p-be5c3d5d.entry.js +0 -1
  146. package/dist/b2b-core-components/p-fdfdc92d.entry.js +0 -1
@@ -9,36 +9,102 @@ export class B2bGridRowComponent {
9
9
  componentDidLoad() {
10
10
  this.adjustColumnFlex();
11
11
  }
12
+ calculateRowsAndsSpaceForColumnsWithSpan(columns, currentRowTotal, rows, currentRow) {
13
+ columns.forEach(column => {
14
+ let span = parseInt(column.getAttribute('span'), 10);
15
+ if (currentRowTotal + span > 12) {
16
+ rows.push(currentRow);
17
+ currentRow = [];
18
+ currentRowTotal = 0;
19
+ }
20
+ currentRow.push(column);
21
+ currentRowTotal += span;
22
+ });
23
+ if (currentRow.length > 0) {
24
+ rows.push(currentRow);
25
+ }
26
+ }
12
27
  adjustColumnFlex() {
13
28
  const columns = this.hostElement.querySelectorAll(':scope > b2b-grid-col');
14
29
  let totalSpan = 0;
15
30
  let columnsWithoutSpan = [];
31
+ let columnsWithSpan = [];
16
32
  columns.forEach((column) => {
17
33
  const span = column.getAttribute('span');
18
34
  if (span) {
19
35
  totalSpan += parseInt(span, 10);
36
+ columnsWithSpan.push(column);
20
37
  }
21
38
  else {
22
39
  columnsWithoutSpan.push(column);
23
40
  }
24
41
  });
25
- const remainingSpan = 12 - totalSpan;
26
- if (remainingSpan == 0) {
27
- columnsWithoutSpan.forEach(column => {
28
- column.style.width = '100%';
29
- });
42
+ if (totalSpan > 12 && columnsWithoutSpan.length === 0) {
43
+ this.handleOverflowingColumns(columnsWithSpan);
30
44
  return;
31
45
  }
32
46
  if (columnsWithoutSpan.length > 0) {
33
- const spanPerColumn = Math.floor(remainingSpan / columnsWithoutSpan.length);
34
- columnsWithoutSpan.forEach(column => {
35
- column.setAttribute('span', spanPerColumn.toString());
36
- column.style.width = `${(spanPerColumn / 12) * 100}%`;
47
+ this.handleRowsWithColumnsWithoutSpan(columnsWithoutSpan, columnsWithSpan, totalSpan);
48
+ return;
49
+ }
50
+ if (totalSpan < 12 && columnsWithoutSpan.length === 0) {
51
+ this.handleNonOverflowingColumnsWithSpan(columnsWithSpan);
52
+ return;
53
+ }
54
+ }
55
+ handleNonOverflowingColumnsWithSpan(columnsWithSpan) {
56
+ columnsWithSpan.forEach(column => {
57
+ let span = parseInt(column.getAttribute('span'), 10);
58
+ let widthPercentage = (span / 12) * 100;
59
+ column.style.flex = `0 0 calc(${widthPercentage}% - ${this.columnGap}px)`;
60
+ column.style.maxWidth = `calc(${widthPercentage}% - ${this.columnGap}px)`;
61
+ });
62
+ }
63
+ handleOverflowingColumns(columns) {
64
+ let rows = [];
65
+ let currentRow = [];
66
+ let currentRowTotal = 0;
67
+ this.calculateRowsAndsSpaceForColumnsWithSpan(columns, currentRowTotal, rows, currentRow);
68
+ rows.forEach(row => {
69
+ row.forEach(column => {
70
+ let span = parseInt(column.getAttribute('span'), 10);
71
+ let widthPercentage = (span / 12) * 100;
72
+ column.style.flex = `0 0 calc(${widthPercentage}% - ${this.columnGap}px)`;
73
+ column.style.maxWidth = `calc(${widthPercentage}% - ${this.columnGap}px)`;
37
74
  });
75
+ });
76
+ }
77
+ handleRowsWithColumnsWithoutSpan(columnsWithoutSpan, columnsWithSpan, totalSpan) {
78
+ let remainingSpan = 12 - totalSpan <= 0 ? 12 : 12 - totalSpan;
79
+ let rows = [];
80
+ let currentRow = [];
81
+ let currentRowTotal = 0;
82
+ this.calculateRowsAndsSpaceForColumnsWithSpan(columnsWithSpan, currentRowTotal, rows, currentRow);
83
+ columnsWithoutSpan.forEach(column => {
84
+ let spanPerColumn = Math.max(1, Math.floor(remainingSpan / columnsWithoutSpan.length));
85
+ if (currentRowTotal + spanPerColumn > 12) {
86
+ rows.push(currentRow);
87
+ currentRow = [];
88
+ currentRowTotal = 0;
89
+ }
90
+ column.setAttribute('span', spanPerColumn.toString());
91
+ currentRow.push(column);
92
+ currentRowTotal += spanPerColumn;
93
+ });
94
+ if (currentRow.length > 0) {
95
+ rows.push(currentRow);
38
96
  }
97
+ rows.forEach(row => {
98
+ row.forEach(column => {
99
+ let span = parseInt(column.getAttribute('span'), 10) || 1;
100
+ let widthPercentage = (span / 12) * 100;
101
+ column.style.flex = `0 0 calc(${widthPercentage}% - ${this.columnGap}px)`;
102
+ column.style.maxWidth = `calc(${widthPercentage}% - ${this.columnGap}px)`;
103
+ });
104
+ });
39
105
  }
40
106
  render() {
41
- return (h(Host, { key: 'f77863071f40aef68345792802a1170b59d6bd30', style: {
107
+ return (h(Host, { key: 'da13d7265983cb9a8e70b43c0f7e152912b8e353', style: {
42
108
  ['justify-content']: `${this.justify}`,
43
109
  ['gap']: `${this.columnGap}px`,
44
110
  ['margin']: `${this.rowGap}px 0`,
@@ -46,7 +112,7 @@ export class B2bGridRowComponent {
46
112
  ['display']: 'flex',
47
113
  ['flex-wrap']: 'wrap',
48
114
  ['box-sizing']: 'border-box',
49
- } }, h("slot", { key: '1cb248539477e9fc94a604e43200aa5e391b3ed7' })));
115
+ } }, h("slot", { key: 'b0be12c2eeda9cf109875a17e1509755960f1e65' })));
50
116
  }
51
117
  static get is() { return "b2b-grid-row"; }
52
118
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
3
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
4
4
  */
5
5
  :root, :host {
6
6
  --b2b-size-200: 5rem; /* 80px */
@@ -123,7 +123,7 @@
123
123
  }
124
124
  /**
125
125
  * Do not edit directly
126
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
126
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
127
127
  */
128
128
  :root [data-theme="dark"] {
129
129
  --b2b-size-200: 5rem; /* 80px */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
3
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
4
4
  */
5
5
  :root, :host {
6
6
  --b2b-size-200: 5rem; /* 80px */
@@ -123,7 +123,7 @@
123
123
  }
124
124
  /**
125
125
  * Do not edit directly
126
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
126
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
127
127
  */
128
128
  :root [data-theme="dark"] {
129
129
  --b2b-size-200: 5rem; /* 80px */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
3
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
4
4
  */
5
5
  :root, :host {
6
6
  --b2b-size-200: 5rem; /* 80px */
@@ -123,7 +123,7 @@
123
123
  }
124
124
  /**
125
125
  * Do not edit directly
126
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
126
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
127
127
  */
128
128
  :root [data-theme="dark"] {
129
129
  --b2b-size-200: 5rem; /* 80px */
@@ -33,11 +33,11 @@ const meta = {
33
33
  render: (_a) => {
34
34
  var args = __rest(_a, []);
35
35
  return html `<b2b-icon-100
36
- icon="${args.icon}"
37
- color="${args.color}"
38
- size="${args.size}"
39
- clickable="${args.clickable}"
40
- focusable="${args.focusable}"></b2b-icon-100>`;
36
+ icon="${args.icon}"
37
+ color="${args.color}"
38
+ size="${args.size}"
39
+ clickable="${args.clickable}"
40
+ focusable="${args.focusable}"></b2b-icon-100>`;
41
41
  },
42
42
  };
43
43
  export default meta;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
3
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
4
4
  */
5
5
  :root, :host {
6
6
  --b2b-size-200: 5rem; /* 80px */
@@ -123,7 +123,7 @@
123
123
  }
124
124
  /**
125
125
  * Do not edit directly
126
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
126
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
127
127
  */
128
128
  :root [data-theme="dark"] {
129
129
  --b2b-size-200: 5rem; /* 80px */
@@ -32,10 +32,10 @@ const meta = {
32
32
  render: (_a) => {
33
33
  var args = __rest(_a, []);
34
34
  return html `<b2b-icon-50
35
- icon="${args.icon}"
36
- color="${args.color}"
37
- clickable="${args.clickable}"
38
- focusable="${args.focusable}"></b2b-icon-50>`;
35
+ icon="${args.icon}"
36
+ color="${args.color}"
37
+ clickable="${args.clickable}"
38
+ focusable="${args.focusable}"></b2b-icon-50>`;
39
39
  },
40
40
  };
41
41
  export default meta;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
3
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
4
4
  */
5
5
  :root, :host {
6
6
  --b2b-size-200: 5rem; /* 80px */
@@ -123,7 +123,7 @@
123
123
  }
124
124
  /**
125
125
  * Do not edit directly
126
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
126
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
127
127
  */
128
128
  :root [data-theme="dark"] {
129
129
  --b2b-size-200: 5rem; /* 80px */
@@ -315,7 +315,7 @@
315
315
  :host(.b2b-input--error) span {
316
316
  color: var(--b2b-color-error-100);
317
317
  }
318
- ::slotted(span) {
318
+ ::slotted(span:not([slot=hint], [slot=label])) {
319
319
  font-size: var(--b2b-size-copy-100);
320
320
  cursor: default;
321
321
  user-select: none;
@@ -50,4 +50,32 @@ describe('B2B-Input', () => {
50
50
  const labelElement = await slotPage.find('span');
51
51
  expect(labelElement).toEqualText('Label Slot');
52
52
  });
53
+ it('should use hint slot when provided', async () => {
54
+ const slotPage = await newE2EPage();
55
+ await slotPage.setContent(`
56
+ <b2b-input>
57
+ <span slot="hint">Hint Slot<b2b-anchor href="https://example.com">Hello World!</b2b-anchor></span>
58
+ </b2b-input>
59
+ `);
60
+ await slotPage.waitForChanges();
61
+ const outerHTML = await slotPage.evaluate(() => {
62
+ const span = document.querySelector('span[slot="hint"]');
63
+ return span.outerHTML;
64
+ });
65
+ expect(outerHTML).toBe('<span slot="hint">Hint Slot<b2b-anchor href="https://example.com" class="hydrated">Hello World!</b2b-anchor></span>');
66
+ });
67
+ it('should not display unsupported elements in the hint slot', async () => {
68
+ const slotPage = await newE2EPage();
69
+ await slotPage.setContent(`
70
+ <b2b-input>
71
+ <span slot="hint">Hint Slot<div>This should be removed</div></span>
72
+ </b2b-input>
73
+ `);
74
+ await slotPage.waitForChanges();
75
+ const outerHTML = await slotPage.evaluate(() => {
76
+ const span = document.querySelector('span[slot="hint"]');
77
+ return span.outerHTML;
78
+ });
79
+ expect(outerHTML).toBe('<span slot="hint">Hint Slot</span>');
80
+ });
53
81
  });
@@ -75,23 +75,44 @@ export class InputComponent {
75
75
  }
76
76
  this.getSlottedText();
77
77
  }
78
+ processHintSlotContent() {
79
+ if (this.hintSlot === null || this.hintSlot === undefined)
80
+ return;
81
+ const disallowedElements = this.hintSlot.querySelectorAll(':not(b2b-anchor, b, strong, i, em, span)');
82
+ disallowedElements.forEach(element => {
83
+ if (element.nodeType === Node.ELEMENT_NODE) {
84
+ element.remove();
85
+ }
86
+ });
87
+ }
88
+ filterHintSlotContent() {
89
+ this.processHintSlotContent();
90
+ if (this.hintSlot !== null && this.hintSlot !== undefined) {
91
+ const observer = new MutationObserver(() => this.processHintSlotContent());
92
+ observer.observe(this.hintSlot, { childList: true, subtree: true });
93
+ }
94
+ }
78
95
  componentWillLoad() {
79
96
  this.labelSlot = this.hostElement.querySelector('[slot="label"]');
97
+ this.hintSlot = this.hostElement.querySelector('[slot="hint"]');
98
+ }
99
+ componentDidLoad() {
100
+ this.filterHintSlotContent();
80
101
  }
81
102
  render() {
82
- return (h(Host, { key: '48398c9027d0dbe9a62bbc806357842fcf12fab6', class: {
103
+ return (h(Host, { key: '8d1ca422e0a614f9fdd808c5be225c1e5f20393d', class: {
83
104
  'b2b-input': true,
84
105
  'b2b-input--error': this.invalid && !this.disabled,
85
- } }, (this.label || this.labelSlot) && (h("b2b-input-label", { id: this.name, required: this.required }, h("slot", { name: "label" }, this.label))), h("div", { key: 'd6a7e8ab3e20a1ea02252c4968d0043afb91518d', class: {
106
+ } }, (this.label || this.labelSlot) && (h("b2b-input-label", { id: this.name, required: this.required }, h("slot", { name: "label" }, this.label))), h("div", { key: '9a0881a2659bd4cd165be43b62e082c6e54d78d4', class: {
86
107
  'b2b-input__wrapper': true,
87
108
  'b2b-input__wrapper--focused': this.hasFocus,
88
109
  'b2b-input__wrapper--disabled': this.disabled || this.groupDisabled,
89
- } }, h("slot", { key: 'fb82b2d7c98250248c2991840896251a28368a31', name: "start" }), this.hasTextPrefix && h("div", { class: "border" }), h("input", { key: '4b3e7be8d07c0abf3ed11f3ce13c9f9f43672927', class: {
110
+ } }, h("slot", { key: '5e64fdbdf8c4f2c206f2796510b4a91af4cc0b4d', name: "start" }), this.hasTextPrefix && h("div", { class: "border" }), h("input", { key: 'a661e9b0e1553aa28bb0151f917041b57b42f07a', class: {
90
111
  'b2b-input__native-input': true,
91
112
  ['b2b-input__native-input--align-' + this.inputTextAlign]: true,
92
113
  'b2b-input__native-input--disabled': this.disabled,
93
- }, "aria-labelledby": this.name, type: this.type, placeholder: this.placeholder, value: this.value, name: this.name, disabled: this.disabled || this.groupDisabled, autoFocus: this.autofocus, onFocus: this.onFocus, onBlur: this.onBlur, onInput: this.onInput, ref: el => (this.focusableElement = el) }), this.hasTextSuffix && h("div", { class: "border" }), h("slot", { key: '96d37a29b8b01c63d1cd4b913a83a1240f6efcbf', name: "end" })), (this.hint !== undefined && !this.invalid) ||
94
- (this.hint !== undefined && this.disabled) ? (h("span", null, this.hint)) : (''), this.error !== undefined && this.invalid && !this.disabled ? (h("span", null, this.error)) : ('')));
114
+ }, "aria-labelledby": this.name, type: this.type, placeholder: this.placeholder, value: this.value, name: this.name, disabled: this.disabled || this.groupDisabled, autoFocus: this.autofocus, onFocus: this.onFocus, onBlur: this.onBlur, onInput: this.onInput, ref: el => (this.focusableElement = el) }), this.hasTextSuffix && h("div", { class: "border" }), h("slot", { key: 'cb32fe135408274018be0b800d0b2321756c0c9c', name: "end" })), (this.hint !== undefined || this.hintSlot) &&
115
+ (!this.invalid || this.disabled) ? (h("span", null, h("slot", { name: "hint" }, this.hint))) : (''), this.error !== undefined && this.invalid && !this.disabled ? (h("span", null, this.error)) : ('')));
95
116
  }
96
117
  static get is() { return "b2b-input"; }
97
118
  static get encapsulation() { return "shadow"; }
@@ -32,19 +32,19 @@ const meta = {
32
32
  render: (_a) => {
33
33
  var args = __rest(_a, []);
34
34
  return html `<div style="width: 400px;">
35
- <b2b-input
36
- label="${args.label}"
37
- required="${args.required}"
38
- type="${args.defaultType}"
39
- disabled="${args.disabled}"
40
- placeholder="${args.placeholder}"
41
- value="${args.value}"
42
- hint="${args.hint}"
43
- error="${args.error}"
44
- autofocus="${args.autofocus}"
45
- invalid=${args.invalid}
46
- input-text-align="${args.inputTextAlign}"></b2b-input>
47
- </div>`;
35
+ <b2b-input
36
+ label="${args.label}"
37
+ required="${args.required}"
38
+ type="${args.defaultType}"
39
+ disabled="${args.disabled}"
40
+ placeholder="${args.placeholder}"
41
+ value="${args.value}"
42
+ hint="${args.hint}"
43
+ error="${args.error}"
44
+ autofocus="${args.autofocus}"
45
+ invalid=${args.invalid}
46
+ input-text-align="${args.inputTextAlign}"></b2b-input>
47
+ </div>`;
48
48
  },
49
49
  };
50
50
  export default meta;
@@ -71,20 +71,20 @@ export const Prefix = {
71
71
  render: (_a) => {
72
72
  var args = __rest(_a, []);
73
73
  return html `<div style="width: 400px;">
74
- <b2b-input
75
- label="${args.label}"
76
- required="${args.required}"
77
- type="${args.type}"
78
- disabled="${args.disabled}"
79
- placeholder="${args.placeholder}"
80
- value="${args.value}"
81
- hint="${args.hint}"
82
- error="${args.error}"
83
- autofocus="${args.autofocus}"
84
- invalid=${args.invalid}
85
- ><span slot="start">Registration Number</span></b2b-input
86
- >
87
- </div>`;
74
+ <b2b-input
75
+ label="${args.label}"
76
+ required="${args.required}"
77
+ type="${args.type}"
78
+ disabled="${args.disabled}"
79
+ placeholder="${args.placeholder}"
80
+ value="${args.value}"
81
+ hint="${args.hint}"
82
+ error="${args.error}"
83
+ autofocus="${args.autofocus}"
84
+ invalid=${args.invalid}
85
+ ><span slot="start">Registration Number</span></b2b-input
86
+ >
87
+ </div>`;
88
88
  },
89
89
  };
90
90
  export const Suffix = {
@@ -113,21 +113,21 @@ export const PrefixAndSuffix = {
113
113
  render: (_a) => {
114
114
  var args = __rest(_a, []);
115
115
  return html `<div style="width: 400px;">
116
- <b2b-input
117
- label="${args.label}"
118
- required="${args.required}"
119
- type="${args.type}"
120
- disabled="${args.disabled}"
121
- placeholder="${args.placeholder}"
122
- value="${args.value}"
123
- hint="${args.hint}"
124
- error="${args.error}"
125
- autofocus="${args.autofocus}"
126
- invalid=${args.invalid}>
127
- <b2b-icon-100 icon="b2b_icon-search" slot="start"></b2b-icon-100
128
- ><span slot="end">Registration Number</span></b2b-input
129
- >
130
- </div>`;
116
+ <b2b-input
117
+ label="${args.label}"
118
+ required="${args.required}"
119
+ type="${args.type}"
120
+ disabled="${args.disabled}"
121
+ placeholder="${args.placeholder}"
122
+ value="${args.value}"
123
+ hint="${args.hint}"
124
+ error="${args.error}"
125
+ autofocus="${args.autofocus}"
126
+ invalid=${args.invalid}>
127
+ <b2b-icon-100 icon="b2b_icon-search" slot="start"></b2b-icon-100
128
+ ><span slot="end">Registration Number</span></b2b-input
129
+ >
130
+ </div>`;
131
131
  },
132
132
  };
133
133
  export const Label = {
@@ -135,19 +135,39 @@ export const Label = {
135
135
  render: (_a) => {
136
136
  var args = __rest(_a, []);
137
137
  return html `<div style="width: 400px;">
138
- <b2b-input
139
- required="${args.required}"
140
- type="${args.type}"
141
- disabled="${args.disabled}"
142
- placeholder="${args.placeholder}"
143
- value="${args.value}"
144
- hint="${args.hint}"
145
- error="${args.error}"
146
- autofocus="${args.autofocus}"
147
- invalid=${args.invalid}
148
- ><span slot="label">Custom label</span></b2b-input
149
- >
150
- </div>`;
138
+ <b2b-input
139
+ required="${args.required}"
140
+ type="${args.type}"
141
+ disabled="${args.disabled}"
142
+ placeholder="${args.placeholder}"
143
+ value="${args.value}"
144
+ hint="${args.hint}"
145
+ error="${args.error}"
146
+ autofocus="${args.autofocus}"
147
+ invalid=${args.invalid}
148
+ ><span slot="label">Custom label</span></b2b-input
149
+ >
150
+ </div>`;
151
+ },
152
+ };
153
+ export const HintSlot = {
154
+ args: Object.assign({}, meta.args),
155
+ render: (_a) => {
156
+ var args = __rest(_a, []);
157
+ return html `<div style="width: 400px;">
158
+ <b2b-input
159
+ label="${args.label}"
160
+ required="${args.required}"
161
+ type="${args.type}"
162
+ disabled="${args.disabled}"
163
+ placeholder="${args.placeholder}"
164
+ value="${args.value}"
165
+ error="${args.error}"
166
+ autofocus="${args.autofocus}"
167
+ invalid=${args.invalid}
168
+ ><span slot="hint">Custom hint</span></b2b-input
169
+ >
170
+ </div>`;
151
171
  },
152
172
  };
153
173
  export const AllPropertiesSpecified = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
3
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
4
4
  */
5
5
  :root, :host {
6
6
  --b2b-size-200: 5rem; /* 80px */
@@ -123,7 +123,7 @@
123
123
  }
124
124
  /**
125
125
  * Do not edit directly
126
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
126
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
127
127
  */
128
128
  :root [data-theme="dark"] {
129
129
  --b2b-size-200: 5rem; /* 80px */
@@ -227,7 +227,7 @@
227
227
  font-size: var(--b2b-size-copy-50);
228
228
  line-height: var(--b2b-size-copy-line-height-75);
229
229
  display: block;
230
- margin-top: var(--b2b-size-10);
230
+ margin-top: var(--b2b-size-7);
231
231
  color: var(--b2b-color-grey-300);
232
232
  }
233
233
  :host .b2b-input-wrapper__hint--error {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
3
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
4
4
  */
5
5
  :root, :host {
6
6
  --b2b-size-200: 5rem; /* 80px */
@@ -123,7 +123,7 @@
123
123
  }
124
124
  /**
125
125
  * Do not edit directly
126
- * Generated on Thu, 27 Feb 2025 06:22:03 GMT
126
+ * Generated on Thu, 20 Mar 2025 12:45:50 GMT
127
127
  */
128
128
  :root [data-theme="dark"] {
129
129
  --b2b-size-200: 5rem; /* 80px */