@brandsync/wc 0.0.7 → 0.0.9

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 (195) hide show
  1. package/custom-elements.json +1810 -355
  2. package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
  3. package/dist/brandsync-wc/p-0d64ea40.entry.js +1 -0
  4. package/dist/brandsync-wc/{p-c63d16e1.entry.js → p-1515498e.entry.js} +1 -1
  5. package/dist/brandsync-wc/p-16a54578.entry.js +1 -0
  6. package/dist/brandsync-wc/p-18af02df.entry.js +1 -0
  7. package/dist/brandsync-wc/p-30a0e168.entry.js +1 -0
  8. package/dist/brandsync-wc/p-3dacae70.entry.js +1 -0
  9. package/dist/brandsync-wc/p-5333bb5a.entry.js +1 -0
  10. package/dist/brandsync-wc/p-575ce905.entry.js +1 -0
  11. package/dist/brandsync-wc/{p-dd0fea0e.entry.js → p-7776b57b.entry.js} +1 -1
  12. package/dist/brandsync-wc/{p-bfd09c98.entry.js → p-805644e4.entry.js} +1 -1
  13. package/dist/brandsync-wc/{p-f88d9a6e.entry.js → p-8a78d6ea.entry.js} +1 -1
  14. package/dist/brandsync-wc/p-8d12ed96.entry.js +1 -0
  15. package/dist/brandsync-wc/p-94ed898a.entry.js +1 -0
  16. package/dist/brandsync-wc/{p-9e5d2211.entry.js → p-96f374be.entry.js} +1 -1
  17. package/dist/brandsync-wc/{p-ab5cc7af.entry.js → p-a34f460d.entry.js} +1 -1
  18. package/dist/brandsync-wc/p-bc72439a.entry.js +1 -0
  19. package/dist/brandsync-wc/{p-76eca100.entry.js → p-ce0914a7.entry.js} +1 -1
  20. package/dist/brandsync-wc/{p-5a0fe72e.entry.js → p-d682675e.entry.js} +1 -1
  21. package/dist/brandsync-wc/p-dad4a92c.entry.js +1 -0
  22. package/dist/brandsync-wc/{p-cfc3421b.entry.js → p-dd747a12.entry.js} +1 -1
  23. package/dist/brandsync-wc/{p-2742ecef.entry.js → p-eb4d87f0.entry.js} +1 -1
  24. package/dist/cjs/brandsync-wc.cjs.js +1 -1
  25. package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +17 -0
  26. package/dist/cjs/bs-ai-greeting.cjs.entry.js +24 -0
  27. package/dist/cjs/bs-ai-thinking.cjs.entry.js +2 -2
  28. package/dist/cjs/bs-attachment-list.cjs.entry.js +47 -0
  29. package/dist/cjs/bs-attachment.cjs.entry.js +46 -0
  30. package/dist/cjs/bs-badge.cjs.entry.js +1 -1
  31. package/dist/cjs/bs-button-skeleton.cjs.entry.js +1 -1
  32. package/dist/cjs/bs-button.cjs.entry.js +1 -1
  33. package/dist/cjs/bs-card.cjs.entry.js +1 -1
  34. package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +94 -0
  35. package/dist/cjs/bs-chatbot-header.cjs.entry.js +1 -1
  36. package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +1 -1
  37. package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +38 -0
  38. package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +1 -1
  39. package/dist/cjs/bs-composer-status-banner.cjs.entry.js +43 -0
  40. package/dist/cjs/bs-composer.cjs.entry.js +16 -2
  41. package/dist/cjs/bs-data-table.cjs.entry.js +2 -2
  42. package/dist/cjs/bs-input.cjs.entry.js +270 -4
  43. package/dist/cjs/{bs-menu-item.cjs.entry.js → bs-menu_2.cjs.entry.js} +14 -1
  44. package/dist/cjs/bs-source-link.cjs.entry.js +39 -0
  45. package/dist/cjs/bs-tooltip.cjs.entry.js +1 -1
  46. package/dist/cjs/loader.cjs.js +1 -1
  47. package/dist/collection/collection-manifest.json +8 -0
  48. package/dist/collection/components/bs-ai-chatbot/bs-ai-chatbot.stories.js +180 -0
  49. package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.cmp.test.js +14 -0
  50. package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.css +27 -0
  51. package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +41 -0
  52. package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.stories.js +15 -0
  53. package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.cmp.test.js +22 -0
  54. package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.css +53 -0
  55. package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +103 -0
  56. package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.stories.js +23 -0
  57. package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.css +31 -17
  58. package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +9 -11
  59. package/dist/collection/components/bs-attachment/bs-attachment.cmp.test.js +41 -0
  60. package/dist/collection/components/bs-attachment/bs-attachment.css +184 -0
  61. package/dist/collection/components/bs-attachment/bs-attachment.js +230 -0
  62. package/dist/collection/components/bs-attachment/bs-attachment.stories.js +58 -0
  63. package/dist/collection/components/bs-attachment-list/bs-attachment-list.cmp.test.js +28 -0
  64. package/dist/collection/components/bs-attachment-list/bs-attachment-list.css +56 -0
  65. package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +105 -0
  66. package/dist/collection/components/bs-attachment-list/bs-attachment-list.stories.js +47 -0
  67. package/dist/collection/components/bs-badge/bs-badge.js +1 -1
  68. package/dist/collection/components/bs-button/bs-button.js +1 -1
  69. package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
  70. package/dist/collection/components/bs-card/bs-card.js +1 -1
  71. package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.cmp.test.js +73 -0
  72. package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.css +253 -0
  73. package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +324 -0
  74. package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.stories.js +54 -0
  75. package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
  76. package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
  77. package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.cmp.test.js +34 -0
  78. package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.css +106 -0
  79. package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +142 -0
  80. package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.stories.js +44 -0
  81. package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
  82. package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +12 -0
  83. package/dist/collection/components/bs-composer/bs-composer.css +10 -0
  84. package/dist/collection/components/bs-composer/bs-composer.js +25 -1
  85. package/dist/collection/components/bs-composer/bs-composer.stories.js +13 -0
  86. package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.js +42 -0
  87. package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.css +173 -0
  88. package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +270 -0
  89. package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.stories.js +75 -0
  90. package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
  91. package/dist/collection/components/bs-input/bs-input.cmp.test.js +296 -0
  92. package/dist/collection/components/bs-input/bs-input.css +333 -23
  93. package/dist/collection/components/bs-input/bs-input.js +647 -11
  94. package/dist/collection/components/bs-input/bs-input.stories.js +128 -1
  95. package/dist/collection/components/bs-menu/bs-menu.js +1 -1
  96. package/dist/collection/components/bs-menu-item/bs-menu-item.js +1 -1
  97. package/dist/collection/components/bs-source-link/bs-source-link.cmp.test.js +42 -0
  98. package/dist/collection/components/bs-source-link/bs-source-link.css +114 -0
  99. package/dist/collection/components/bs-source-link/bs-source-link.js +192 -0
  100. package/dist/collection/components/bs-source-link/bs-source-link.stories.js +33 -0
  101. package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
  102. package/dist/components/bs-ai-disclaimer.d.ts +11 -0
  103. package/dist/components/bs-ai-disclaimer.js +1 -0
  104. package/dist/components/bs-ai-greeting.d.ts +11 -0
  105. package/dist/components/bs-ai-greeting.js +1 -0
  106. package/dist/components/bs-ai-thinking.js +1 -1
  107. package/dist/components/bs-attachment-list.d.ts +11 -0
  108. package/dist/components/bs-attachment-list.js +1 -0
  109. package/dist/components/bs-attachment.d.ts +11 -0
  110. package/dist/components/bs-attachment.js +1 -0
  111. package/dist/components/bs-badge.js +1 -1
  112. package/dist/components/bs-button-skeleton.js +1 -1
  113. package/dist/components/bs-button.js +1 -1
  114. package/dist/components/bs-card.js +1 -1
  115. package/dist/components/bs-chatbot-feedback.d.ts +11 -0
  116. package/dist/components/bs-chatbot-feedback.js +1 -0
  117. package/dist/components/bs-chatbot-header.js +1 -1
  118. package/dist/components/bs-chatbot-response-action.js +1 -1
  119. package/dist/components/bs-chatbot-sources-drawer.d.ts +11 -0
  120. package/dist/components/bs-chatbot-sources-drawer.js +1 -0
  121. package/dist/components/bs-chatbot-suggestion-button.js +1 -1
  122. package/dist/components/bs-composer-status-banner.d.ts +11 -0
  123. package/dist/components/bs-composer-status-banner.js +1 -0
  124. package/dist/components/bs-composer.js +1 -1
  125. package/dist/components/bs-data-table.js +1 -1
  126. package/dist/components/bs-input.js +1 -1
  127. package/dist/components/bs-menu-item.js +1 -1
  128. package/dist/components/bs-menu.js +1 -1
  129. package/dist/components/bs-source-link.d.ts +11 -0
  130. package/dist/components/bs-source-link.js +1 -0
  131. package/dist/components/bs-tooltip.js +1 -1
  132. package/dist/components/{p-CoC4LQCI.js → p-Cz2nfz2j.js} +1 -1
  133. package/dist/components/p-DndQiCMP.js +1 -0
  134. package/dist/components/p-_vXDfB3V.js +1 -0
  135. package/dist/esm/brandsync-wc.js +1 -1
  136. package/dist/esm/bs-ai-disclaimer.entry.js +15 -0
  137. package/dist/esm/bs-ai-greeting.entry.js +22 -0
  138. package/dist/esm/bs-ai-thinking.entry.js +2 -2
  139. package/dist/esm/bs-attachment-list.entry.js +45 -0
  140. package/dist/esm/bs-attachment.entry.js +44 -0
  141. package/dist/esm/bs-badge.entry.js +1 -1
  142. package/dist/esm/bs-button-skeleton.entry.js +1 -1
  143. package/dist/esm/bs-button.entry.js +1 -1
  144. package/dist/esm/bs-card.entry.js +1 -1
  145. package/dist/esm/bs-chatbot-feedback.entry.js +92 -0
  146. package/dist/esm/bs-chatbot-header.entry.js +1 -1
  147. package/dist/esm/bs-chatbot-response-action.entry.js +1 -1
  148. package/dist/esm/bs-chatbot-sources-drawer.entry.js +36 -0
  149. package/dist/esm/bs-chatbot-suggestion-button.entry.js +1 -1
  150. package/dist/esm/bs-composer-status-banner.entry.js +41 -0
  151. package/dist/esm/bs-composer.entry.js +17 -3
  152. package/dist/esm/bs-data-table.entry.js +2 -2
  153. package/dist/esm/bs-input.entry.js +271 -5
  154. package/dist/esm/{bs-menu-item.entry.js → bs-menu_2.entry.js} +15 -3
  155. package/dist/esm/bs-source-link.entry.js +37 -0
  156. package/dist/esm/bs-tooltip.entry.js +1 -1
  157. package/dist/esm/loader.js +1 -1
  158. package/dist/types/components/bs-ai-chatbot/bs-ai-chatbot.stories.d.ts +18 -0
  159. package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.cmp.test.d.ts +1 -0
  160. package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.d.ts +26 -0
  161. package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.stories.d.ts +8 -0
  162. package/dist/types/components/bs-ai-greeting/bs-ai-greeting.cmp.test.d.ts +1 -0
  163. package/dist/types/components/bs-ai-greeting/bs-ai-greeting.d.ts +42 -0
  164. package/dist/types/components/bs-ai-greeting/bs-ai-greeting.stories.d.ts +10 -0
  165. package/dist/types/components/bs-ai-thinking/bs-ai-thinking.d.ts +8 -10
  166. package/dist/types/components/bs-attachment/bs-attachment.cmp.test.d.ts +1 -0
  167. package/dist/types/components/bs-attachment/bs-attachment.d.ts +59 -0
  168. package/dist/types/components/bs-attachment/bs-attachment.stories.d.ts +17 -0
  169. package/dist/types/components/bs-attachment-list/bs-attachment-list.cmp.test.d.ts +1 -0
  170. package/dist/types/components/bs-attachment-list/bs-attachment-list.d.ts +42 -0
  171. package/dist/types/components/bs-attachment-list/bs-attachment-list.stories.d.ts +10 -0
  172. package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.cmp.test.d.ts +1 -0
  173. package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.d.ts +90 -0
  174. package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.stories.d.ts +16 -0
  175. package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.cmp.test.d.ts +1 -0
  176. package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.d.ts +54 -0
  177. package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.stories.d.ts +10 -0
  178. package/dist/types/components/bs-composer/bs-composer.d.ts +14 -0
  179. package/dist/types/components/bs-composer/bs-composer.stories.d.ts +1 -0
  180. package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.d.ts +1 -0
  181. package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.d.ts +88 -0
  182. package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.stories.d.ts +20 -0
  183. package/dist/types/components/bs-input/bs-input.d.ts +139 -6
  184. package/dist/types/components/bs-input/bs-input.stories.d.ts +19 -0
  185. package/dist/types/components/bs-source-link/bs-source-link.cmp.test.d.ts +1 -0
  186. package/dist/types/components/bs-source-link/bs-source-link.d.ts +51 -0
  187. package/dist/types/components/bs-source-link/bs-source-link.stories.d.ts +13 -0
  188. package/dist/types/components.d.ts +1778 -55
  189. package/package.json +1 -1
  190. package/dist/brandsync-wc/p-6abdfaf0.entry.js +0 -1
  191. package/dist/brandsync-wc/p-6c1fa4da.entry.js +0 -1
  192. package/dist/brandsync-wc/p-a12d0a60.entry.js +0 -1
  193. package/dist/brandsync-wc/p-f5f443e2.entry.js +0 -1
  194. package/dist/cjs/bs-menu.cjs.entry.js +0 -17
  195. package/dist/esm/bs-menu.entry.js +0 -15
@@ -0,0 +1,47 @@
1
+ import { html } from "lit";
2
+ import { componentDescription, propDescription } from "../../stories-utils";
3
+ const SAMPLE_IMAGE = 'https://images.unsplash.com/photo-1512917774080-9991f1c4c750?w=200&h=200&fit=crop';
4
+ const meta = {
5
+ title: 'Genie AI Components/bs-attachment-list',
6
+ parameters: { docs: { description: { component: componentDescription('bs-attachment-list') } } },
7
+ argTypes: {
8
+ ariaLabel: { control: 'text', description: propDescription('bs-attachment-list', 'ariaLabel') },
9
+ },
10
+ args: {
11
+ ariaLabel: 'Attachments',
12
+ },
13
+ };
14
+ export default meta;
15
+ export const OneAttachment = {
16
+ name: 'One attachment',
17
+ render: args => html `
18
+ <bs-attachment-list aria-label=${args.ariaLabel}>
19
+ <bs-attachment type="image" image-src=${SAMPLE_IMAGE}></bs-attachment>
20
+ </bs-attachment-list>
21
+ `,
22
+ };
23
+ export const ThreeAttachments = {
24
+ name: 'Three attachments',
25
+ render: args => html `
26
+ <bs-attachment-list aria-label=${args.ariaLabel}>
27
+ <bs-attachment type="image" image-src=${SAMPLE_IMAGE}></bs-attachment>
28
+ <bs-attachment type="pdf" file-name="Dummy-pdf-in-here"></bs-attachment>
29
+ <bs-attachment type="document" file-name="Dummy-pdf-in-here"></bs-attachment>
30
+ </bs-attachment-list>
31
+ `,
32
+ };
33
+ export const ManyAttachments = {
34
+ name: 'Many attachments (scrollable)',
35
+ render: args => html `
36
+ <div style="max-width: 400px; border: 1px dashed #c2c7d3;">
37
+ <bs-attachment-list aria-label=${args.ariaLabel}>
38
+ <bs-attachment type="pdf" file-name="Dummy-pdf-in-here"></bs-attachment>
39
+ <bs-attachment type="pdf" file-name="Dummy-pdf-in-here"></bs-attachment>
40
+ <bs-attachment type="document" file-name="Dummy-pdf-in-here"></bs-attachment>
41
+ <bs-attachment type="document" file-name="Dummy-pdf-in-here"></bs-attachment>
42
+ <bs-attachment type="document" file-name="Dummy-pdf-in-here"></bs-attachment>
43
+ <bs-attachment type="image" image-src=${SAMPLE_IMAGE}></bs-attachment>
44
+ </bs-attachment-list>
45
+ </div>
46
+ `,
47
+ };
@@ -17,7 +17,7 @@ export class BsBadge {
17
17
  /** Maps directly to the brandsync-tokens `--bs-badge-bg-*` / `--bs-badge-text-*` sets. */
18
18
  variant = 'default';
19
19
  render() {
20
- return (h("span", { key: '9cc06bddba11f57edf97209456e25141a3b80bea', part: "container", class: `bs-badge bs-badge--${this.variant}` }, h("slot", { key: '7c0e4054e99a3dedc94f2a7250075fcb76c115b6' })));
20
+ return (h("span", { key: '33a4103fad2c535c1eeb787a4ba8e7633ef92082', part: "container", class: `bs-badge bs-badge--${this.variant}` }, h("slot", { key: '68c95c6e9dd8a90fbec5853f7274f5ff2859faa3' })));
21
21
  }
22
22
  static get is() { return "bs-badge"; }
23
23
  static get encapsulation() { return "shadow"; }
@@ -100,7 +100,7 @@ export class BsButton {
100
100
  };
101
101
  render() {
102
102
  const iconOnly = (this.hasIcon || this.hasEndIcon) && !this.hasLabel;
103
- return (h("button", { key: 'eae5915f036d18b43b9b1ff94272fe27aa119d0e', class: `bs-button bs-button--${this.variant} bs-button--${this.size} ${iconOnly ? 'bs-button--icon-only' : ''}`, type: this.type, disabled: this.disabled, "aria-label": this.ariaLabel }, h("span", { key: 'ee58ccc6f8390663e67a7d7a03fe6113782805e7', part: "icon", class: `bs-button__icon ${this.hasIcon ? 'bs-button__icon--visible' : ''}` }, h("slot", { key: '526ec7b4fd274bbdb6dc1edb38c33917c26337ee', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '3e0121dc4dc975b449b03e5ac5f55d1f6001e806', part: "label", class: "bs-button__label" }, h("slot", { key: '4ab00b8b91f0513af74faac4ae7b39f9a975dde5', onSlotchange: this.onLabelSlotchange })), h("span", { key: '3f64f1122c5ed1da1bb9cb869490395f1e11b3fb', part: "end-icon", class: `bs-button__end-icon ${this.hasEndIcon ? 'bs-button__end-icon--visible' : ''}` }, h("slot", { key: 'ca79d7ed3cd80c6abc3f17c4f9d215ed69c13059', name: "end-icon", onSlotchange: this.onEndIconSlotchange }))));
103
+ return (h("button", { key: '8fe88c418417a4b2f8944c282aa97dbc98aaeb06', class: `bs-button bs-button--${this.variant} bs-button--${this.size} ${iconOnly ? 'bs-button--icon-only' : ''}`, type: this.type, disabled: this.disabled, "aria-label": this.ariaLabel }, h("span", { key: '85b3a07595c93cbe3113204315669c3b087f216d', part: "icon", class: `bs-button__icon ${this.hasIcon ? 'bs-button__icon--visible' : ''}` }, h("slot", { key: '53740a910449f215229686fa9c506cce6d399b52', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '3a3b133d9386d0d2044d44cdf0b47bd3e100c6d2', part: "label", class: "bs-button__label" }, h("slot", { key: '9c7c0e468651c0d93aafa53afb3fcab60ab7f311', onSlotchange: this.onLabelSlotchange })), h("span", { key: 'fa5b7afa82c697cfa7cf1a0f564e743832c9c039', part: "end-icon", class: `bs-button__end-icon ${this.hasEndIcon ? 'bs-button__end-icon--visible' : ''}` }, h("slot", { key: '20bf73485fbd7c30e524e380ec291ac3939c3ba1', name: "end-icon", onSlotchange: this.onEndIconSlotchange }))));
104
104
  }
105
105
  static get is() { return "bs-button"; }
106
106
  static get encapsulation() { return "shadow"; }
@@ -25,7 +25,7 @@ export class BsButtonSkeleton {
25
25
  /** Sizing scale, matching the `bs-button` size it stands in for. */
26
26
  size = 'md';
27
27
  render() {
28
- return h("span", { key: '34febfe9aa1e20130b62b7884e766cd5285848d7', part: "container", class: `bs-button-skeleton bs-button-skeleton--${this.size}`, role: "status", "aria-label": "Loading" });
28
+ return h("span", { key: '3d08a657337abf1db82ab85d3ef6c6a15a23010a', part: "container", class: `bs-button-skeleton bs-button-skeleton--${this.size}`, role: "status", "aria-label": "Loading" });
29
29
  }
30
30
  static get is() { return "bs-button-skeleton"; }
31
31
  static get encapsulation() { return "shadow"; }
@@ -23,7 +23,7 @@ export class BsCard {
23
23
  * dedicated "card" component yet, so this reuses the existing Paper surface tokens. */
24
24
  surface = 'raised';
25
25
  render() {
26
- return (h("div", { key: '6c74e846c97f02a39ce1f2b215c87fbb9cd42055', part: "container", class: `bs-card bs-card--${this.surface}` }, h("div", { key: 'ef89eb6ea19be13daf403b010a93e1f5a82691d4', part: "header", class: "bs-card__header" }, h("slot", { key: '4627d1f598def9298e0b7d251a523892bb0b97cf', name: "header" })), h("div", { key: 'a599746c11f92d2a535985abdcadbc9cc3036fdd', part: "body", class: "bs-card__body" }, h("slot", { key: 'f8d46c5f6aefeb870796c4efa37663e698fdd5c7' })), h("div", { key: '7f928a259fb159b6eb7d742cbfe6c1aacbef6e36', part: "footer", class: "bs-card__footer" }, h("slot", { key: 'fddc69aedbc10f4397bb1db62265c657ec2642ab', name: "footer" }))));
26
+ return (h("div", { key: 'c8f95e45c3aa78315341d5ef5f7aa53b33f289cc', part: "container", class: `bs-card bs-card--${this.surface}` }, h("div", { key: 'b0787524f4b874e4e47459ef5325f2494ea8bf59', part: "header", class: "bs-card__header" }, h("slot", { key: '41ee7852c3ea215f9b6fbc72ccd13283b58afc50', name: "header" })), h("div", { key: 'e4537f5ec7e11af4518cfae464ee6f65120355cc', part: "body", class: "bs-card__body" }, h("slot", { key: 'b6ceecfa3ad173f43811ae7c24b70822879f89f4' })), h("div", { key: '31bc782bb46991e1db5718ff9690140965810572', part: "footer", class: "bs-card__footer" }, h("slot", { key: 'f2530ea24aab67ea5f3f575ef251419b5565b5bc', name: "footer" }))));
27
27
  }
28
28
  static get is() { return "bs-card"; }
29
29
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,73 @@
1
+ import { render, h, describe, it, expect } from "@stencil/vitest";
2
+ describe('bs-chatbot-feedback', () => {
3
+ it('renders the default heading/subtitle and the editable form before submitting', async () => {
4
+ const { root } = await render(h("bs-chatbot-feedback", null));
5
+ expect(root.shadowRoot.querySelector('[part="heading"]')).toHaveTextContent('How was your experience with us?');
6
+ expect(root.shadowRoot.querySelector('[part="textarea"]')).not.toBeNull();
7
+ expect(root.shadowRoot.querySelector('[part="submit"]')).not.toBeNull();
8
+ expect(root.shadowRoot.querySelector('[part="comment"]')).toBeNull();
9
+ });
10
+ it('disables the submit button until a star is clicked', async () => {
11
+ const { root } = await render(h("bs-chatbot-feedback", null));
12
+ expect(root.shadowRoot.querySelector('[part="submit"]')).toHaveAttribute('disabled');
13
+ });
14
+ it('emits bsRatingChange and updates aria-checked when a star is clicked', async () => {
15
+ const { root, spyOnEvent, waitForChanges } = await render(h("bs-chatbot-feedback", null));
16
+ const spy = spyOnEvent('bsRatingChange');
17
+ const stars = root.shadowRoot.querySelectorAll('[part="star"]');
18
+ stars[2].click(); // 3rd star -> rating 3
19
+ await waitForChanges();
20
+ expect(spy).toHaveReceivedEventDetail(3);
21
+ expect(stars[0]).toEqualAttribute('aria-checked', 'true');
22
+ expect(stars[2]).toEqualAttribute('aria-checked', 'true');
23
+ expect(stars[3]).toEqualAttribute('aria-checked', 'false');
24
+ });
25
+ it('enables the submit button once a star is selected, and emits bsSubmit with rating + comment', async () => {
26
+ const { root, spyOnEvent, waitForChanges } = await render(h("bs-chatbot-feedback", null));
27
+ const submitSpy = spyOnEvent('bsSubmit');
28
+ root.shadowRoot.querySelectorAll('[part="star"]')[3].click(); // rating 4
29
+ await waitForChanges();
30
+ const textarea = root.shadowRoot.querySelector('[part="textarea"]');
31
+ textarea.value = 'Great answer';
32
+ textarea.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
33
+ await waitForChanges();
34
+ const submit = root.shadowRoot.querySelector('[part="submit"]');
35
+ expect(submit).not.toHaveAttribute('disabled');
36
+ submit.click();
37
+ expect(submitSpy).toHaveReceivedEventDetail({ rating: 4, comment: 'Great answer' });
38
+ });
39
+ it('switches to the rating-specific heading/subtitle and read-only comment after submitting', async () => {
40
+ const { root } = await render(h("bs-chatbot-feedback", { rating: 5, submitted: true, comment: "Loved it" }));
41
+ expect(root.shadowRoot.querySelector('[part="heading"]')).toHaveTextContent('Thanks for the great rating!');
42
+ expect(root.shadowRoot.querySelector('[part="textarea"]')).toBeNull();
43
+ expect(root.shadowRoot.querySelector('[part="submit"]')).toBeNull();
44
+ expect(root.shadowRoot.querySelector('[part="comment"]')).toHaveTextContent('Loved it');
45
+ });
46
+ it('does not render the comment part when submitted with no comment', async () => {
47
+ const { root } = await render(h("bs-chatbot-feedback", { rating: 5, submitted: true }));
48
+ expect(root.shadowRoot.querySelector('[part="comment"]')).toBeNull();
49
+ });
50
+ it('disables stars and ignores clicks once submitted', async () => {
51
+ const { root, spyOnEvent } = await render(h("bs-chatbot-feedback", { rating: 2, submitted: true }));
52
+ const spy = spyOnEvent('bsRatingChange');
53
+ const stars = root.shadowRoot.querySelectorAll('[part="star"]');
54
+ expect(stars[0]).toHaveAttribute('disabled');
55
+ stars[4].click();
56
+ expect(spy).toHaveReceivedEventTimes(0);
57
+ });
58
+ it('renders "Start new chat" as outlined before submitting and primary after', async () => {
59
+ const { root: before } = await render(h("bs-chatbot-feedback", null));
60
+ expect(before.shadowRoot.querySelector('[part="new-chat"]').className).toContain('--outlined');
61
+ const { root: after } = await render(h("bs-chatbot-feedback", { rating: 5, submitted: true }));
62
+ expect(after.shadowRoot.querySelector('[part="new-chat"]').className).toContain('--primary');
63
+ });
64
+ it('emits bsNewChat and bsClose when their buttons are clicked', async () => {
65
+ const { root, spyOnEvent } = await render(h("bs-chatbot-feedback", null));
66
+ const newChatSpy = spyOnEvent('bsNewChat');
67
+ const closeSpy = spyOnEvent('bsClose');
68
+ root.shadowRoot.querySelector('[part="new-chat"]').click();
69
+ root.shadowRoot.querySelector('[part="close"]').click();
70
+ expect(newChatSpy).toHaveReceivedEventTimes(1);
71
+ expect(closeSpy).toHaveReceivedEventTimes(1);
72
+ });
73
+ });
@@ -0,0 +1,253 @@
1
+ :host {
2
+ display: block;
3
+ --bs-chatbot-feedback-bg: var(--bs-surface-raised);
4
+ --bs-chatbot-feedback-border: var(--bs-border-default);
5
+ --bs-chatbot-feedback-radius: var(--bs-border-radius-200);
6
+ --bs-chatbot-feedback-padding-x: var(--bs-spacing-250);
7
+ --bs-chatbot-feedback-padding-y: var(--bs-spacing-550);
8
+ --bs-chatbot-feedback-max-width: 762px;
9
+ --bs-chatbot-feedback-gap: var(--bs-spacing-300);
10
+ --bs-chatbot-feedback-top-gap: var(--bs-spacing-250);
11
+ --bs-chatbot-feedback-heading-color: var(--bs-text-default);
12
+ --bs-chatbot-feedback-subtitle-color: var(--bs-text-secondary);
13
+ --bs-chatbot-feedback-star-filled: var(--bs-color-primary-default);
14
+ --bs-chatbot-feedback-star-empty: var(--bs-border-neutral-container);
15
+ --bs-chatbot-feedback-comment-color: var(--bs-text-default);
16
+ --bs-chatbot-feedback-close-hover: var(--bs-surface-hover);
17
+ --bs-chatbot-feedback-primary-bg: var(--bs-button-primary-default);
18
+ --bs-chatbot-feedback-primary-bg-hover: var(--bs-button-primary-hover);
19
+ --bs-chatbot-feedback-primary-bg-disabled: var(--bs-button-primary-disabled);
20
+ --bs-chatbot-feedback-outlined-border: var(--bs-border-primary);
21
+ --bs-chatbot-feedback-outlined-hover: var(--bs-color-primary-container-hover);
22
+ --bs-chatbot-feedback-outlined-text: var(--bs-text-action);
23
+ }
24
+
25
+ .bs-chatbot-feedback {
26
+ box-sizing: border-box;
27
+ position: relative;
28
+ display: flex;
29
+ flex-direction: column;
30
+ align-items: center;
31
+ gap: var(--bs-chatbot-feedback-gap);
32
+ max-width: var(--bs-chatbot-feedback-max-width);
33
+ padding: var(--bs-chatbot-feedback-padding-y) var(--bs-chatbot-feedback-padding-x);
34
+ background: var(--bs-chatbot-feedback-bg);
35
+ border: 1px solid var(--bs-chatbot-feedback-border);
36
+ border-radius: var(--bs-chatbot-feedback-radius);
37
+ font-family: inherit;
38
+ }
39
+
40
+ .bs-chatbot-feedback__close {
41
+ box-sizing: border-box;
42
+ position: absolute;
43
+ top: var(--bs-spacing-100);
44
+ right: var(--bs-spacing-100);
45
+ display: inline-flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ width: 32px;
49
+ height: 32px;
50
+ padding: 0;
51
+ background: transparent;
52
+ border: none;
53
+ border-radius: var(--bs-border-radius-100);
54
+ color: var(--bs-icon-default);
55
+ cursor: pointer;
56
+ transition: background-color var(--bs-duration-fast) var(--bs-easing-standard);
57
+ }
58
+
59
+ .bs-chatbot-feedback__close svg {
60
+ width: 20px;
61
+ height: 20px;
62
+ }
63
+
64
+ .bs-chatbot-feedback__close:hover {
65
+ background: var(--bs-chatbot-feedback-close-hover);
66
+ }
67
+
68
+ .bs-chatbot-feedback__top {
69
+ box-sizing: border-box;
70
+ display: flex;
71
+ flex-direction: column;
72
+ align-items: center;
73
+ gap: var(--bs-chatbot-feedback-top-gap);
74
+ width: 100%;
75
+ }
76
+
77
+ .bs-chatbot-feedback__text {
78
+ display: flex;
79
+ flex-direction: column;
80
+ gap: var(--bs-spacing-50);
81
+ width: 100%;
82
+ text-align: center;
83
+ }
84
+
85
+ .bs-chatbot-feedback__heading {
86
+ margin: 0;
87
+ color: var(--bs-chatbot-feedback-heading-color);
88
+ font-size: var(--bs-font-size-xl);
89
+ font-weight: var(--bs-font-weight-bold);
90
+ line-height: calc(var(--bs-line-height-heading-h5) * 1px);
91
+ }
92
+
93
+ .bs-chatbot-feedback__subtitle {
94
+ margin: 0;
95
+ color: var(--bs-chatbot-feedback-subtitle-color);
96
+ font-size: var(--bs-font-size-md);
97
+ line-height: calc(var(--bs-line-height-body-md) * 1px);
98
+ }
99
+
100
+ .bs-chatbot-feedback__stars {
101
+ display: flex;
102
+ gap: var(--bs-spacing-350);
103
+ }
104
+
105
+ .bs-chatbot-feedback__star {
106
+ box-sizing: border-box;
107
+ display: inline-flex;
108
+ width: 36px;
109
+ height: 36px;
110
+ padding: 0;
111
+ background: transparent;
112
+ border: none;
113
+ color: var(--bs-chatbot-feedback-star-empty);
114
+ cursor: pointer;
115
+ }
116
+
117
+ .bs-chatbot-feedback__star[aria-checked='true'] {
118
+ color: var(--bs-chatbot-feedback-star-filled);
119
+ }
120
+
121
+ .bs-chatbot-feedback__star:disabled {
122
+ cursor: default;
123
+ }
124
+
125
+ .bs-chatbot-feedback__star:focus-visible {
126
+ outline: 2px solid var(--bs-border-neutral-focus);
127
+ outline-offset: 2px;
128
+ border-radius: var(--bs-border-radius-50);
129
+ }
130
+
131
+ .bs-chatbot-feedback__field {
132
+ display: flex;
133
+ flex-direction: column;
134
+ gap: var(--bs-spacing-50);
135
+ width: 100%;
136
+ }
137
+
138
+ .bs-chatbot-feedback__label {
139
+ color: var(--bs-input-label);
140
+ font-size: var(--bs-font-size-md);
141
+ font-weight: var(--bs-font-weight-semibold);
142
+ line-height: calc(var(--bs-line-height-body-md) * 1px);
143
+ }
144
+
145
+ .bs-chatbot-feedback__textarea {
146
+ box-sizing: border-box;
147
+ width: 100%;
148
+ /* Matches Figma's 103px Input Field height -- not tied to the spacing scale. */
149
+ min-height: 103px;
150
+ padding: var(--bs-spacing-100) var(--bs-spacing-150);
151
+ border: 1px solid var(--bs-input-border-default);
152
+ border-radius: var(--bs-border-radius-100);
153
+ background: var(--bs-input-bg-default);
154
+ color: var(--bs-input-text);
155
+ font-family: inherit;
156
+ font-size: var(--bs-font-size-md);
157
+ line-height: calc(var(--bs-line-height-body-md) * 1px);
158
+ resize: vertical;
159
+ }
160
+
161
+ .bs-chatbot-feedback__textarea::placeholder {
162
+ color: var(--bs-input-placeholder);
163
+ }
164
+
165
+ .bs-chatbot-feedback__textarea:hover {
166
+ border-color: var(--bs-input-border-hover);
167
+ }
168
+
169
+ .bs-chatbot-feedback__textarea:focus-visible {
170
+ outline: none;
171
+ border-color: var(--bs-input-border-focus);
172
+ }
173
+
174
+ .bs-chatbot-feedback__comment {
175
+ box-sizing: border-box;
176
+ width: 100%;
177
+ min-height: 103px;
178
+ margin: 0;
179
+ padding: var(--bs-spacing-100) var(--bs-spacing-150);
180
+ border: 1px solid var(--bs-input-border-default);
181
+ border-radius: var(--bs-border-radius-100);
182
+ background: var(--bs-input-bg-filled);
183
+ color: var(--bs-chatbot-feedback-comment-color);
184
+ font-size: var(--bs-font-size-md);
185
+ line-height: calc(var(--bs-line-height-body-md) * 1px);
186
+ word-break: break-word;
187
+ }
188
+
189
+ .bs-chatbot-feedback__actions {
190
+ display: flex;
191
+ flex-direction: column;
192
+ gap: var(--bs-spacing-150);
193
+ width: 100%;
194
+ }
195
+
196
+ .bs-chatbot-feedback__submit,
197
+ .bs-chatbot-feedback__new-chat {
198
+ box-sizing: border-box;
199
+ display: inline-flex;
200
+ align-items: center;
201
+ justify-content: center;
202
+ gap: var(--bs-spacing-50);
203
+ width: 100%;
204
+ height: 44px;
205
+ padding: 0 var(--bs-spacing-250) 0 var(--bs-spacing-150);
206
+ border-radius: var(--bs-border-radius-100);
207
+ font-family: inherit;
208
+ font-size: var(--bs-font-size-md);
209
+ font-weight: var(--bs-font-weight-medium);
210
+ cursor: pointer;
211
+ transition: background-color var(--bs-duration-fast) var(--bs-easing-standard);
212
+ }
213
+
214
+ .bs-chatbot-feedback__submit svg,
215
+ .bs-chatbot-feedback__new-chat svg {
216
+ width: 24px;
217
+ height: 24px;
218
+ flex-shrink: 0;
219
+ }
220
+
221
+ .bs-chatbot-feedback__submit,
222
+ .bs-chatbot-feedback__new-chat--primary {
223
+ background: var(--bs-chatbot-feedback-primary-bg);
224
+ border: none;
225
+ color: var(--bs-text-on-action);
226
+ }
227
+
228
+ .bs-chatbot-feedback__submit:hover:not(:disabled),
229
+ .bs-chatbot-feedback__new-chat--primary:hover {
230
+ background: var(--bs-chatbot-feedback-primary-bg-hover);
231
+ }
232
+
233
+ .bs-chatbot-feedback__submit:disabled {
234
+ background: var(--bs-chatbot-feedback-primary-bg-disabled);
235
+ color: var(--bs-text-on-disabled);
236
+ cursor: not-allowed;
237
+ }
238
+
239
+ .bs-chatbot-feedback__new-chat--outlined {
240
+ background: transparent;
241
+ border: 1px solid var(--bs-chatbot-feedback-outlined-border);
242
+ color: var(--bs-chatbot-feedback-outlined-text);
243
+ }
244
+
245
+ .bs-chatbot-feedback__new-chat--outlined:hover {
246
+ background: var(--bs-chatbot-feedback-outlined-hover);
247
+ }
248
+
249
+ .bs-chatbot-feedback__submit:focus-visible,
250
+ .bs-chatbot-feedback__new-chat:focus-visible {
251
+ outline: 2px solid var(--bs-border-neutral-focus);
252
+ outline-offset: 2px;
253
+ }