@brandsync/wc 0.0.9 → 0.0.11

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 (145) hide show
  1. package/custom-elements.json +310 -0
  2. package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
  3. package/dist/brandsync-wc/{p-8d12ed96.entry.js → p-030a8ba7.entry.js} +1 -1
  4. package/dist/brandsync-wc/p-073e5fee.entry.js +1 -0
  5. package/dist/brandsync-wc/{p-ce0914a7.entry.js → p-0b858120.entry.js} +1 -1
  6. package/dist/brandsync-wc/{p-575ce905.entry.js → p-1bf0b2d5.entry.js} +1 -1
  7. package/dist/brandsync-wc/{p-bc72439a.entry.js → p-2598ca88.entry.js} +1 -1
  8. package/dist/brandsync-wc/p-3c8fbaa8.entry.js +1 -0
  9. package/dist/brandsync-wc/p-3dd9b814.entry.js +1 -0
  10. package/dist/brandsync-wc/{p-94ed898a.entry.js → p-41edb0a2.entry.js} +1 -1
  11. package/dist/brandsync-wc/{p-3dacae70.entry.js → p-4ca15322.entry.js} +1 -1
  12. package/dist/brandsync-wc/p-6254dcbe.entry.js +1 -0
  13. package/dist/brandsync-wc/{p-880ea3f8.entry.js → p-7131d0a1.entry.js} +1 -1
  14. package/dist/brandsync-wc/{p-a34f460d.entry.js → p-74a4dd91.entry.js} +1 -1
  15. package/dist/brandsync-wc/{p-30a0e168.entry.js → p-7a605d98.entry.js} +1 -1
  16. package/dist/brandsync-wc/{p-8a78d6ea.entry.js → p-84ae4420.entry.js} +1 -1
  17. package/dist/brandsync-wc/{p-16a54578.entry.js → p-8c302968.entry.js} +1 -1
  18. package/dist/brandsync-wc/{p-dd747a12.entry.js → p-8d78171b.entry.js} +1 -1
  19. package/dist/brandsync-wc/{p-7776b57b.entry.js → p-8dff4f24.entry.js} +1 -1
  20. package/dist/brandsync-wc/{p-dad4a92c.entry.js → p-93e44903.entry.js} +1 -1
  21. package/dist/brandsync-wc/{p-nLORuTUY.js → p-DP_bvuvB.js} +2 -2
  22. package/dist/brandsync-wc/{p-eb4d87f0.entry.js → p-aa45d877.entry.js} +1 -1
  23. package/dist/brandsync-wc/{p-805644e4.entry.js → p-b174403d.entry.js} +1 -1
  24. package/dist/brandsync-wc/{p-d682675e.entry.js → p-c6d330c3.entry.js} +1 -1
  25. package/dist/brandsync-wc/{p-1515498e.entry.js → p-d1dc2ced.entry.js} +1 -1
  26. package/dist/brandsync-wc/{p-18af02df.entry.js → p-dd224cb3.entry.js} +1 -1
  27. package/dist/cjs/brandsync-wc.cjs.js +2 -2
  28. package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +2 -2
  29. package/dist/cjs/bs-ai-greeting.cjs.entry.js +2 -2
  30. package/dist/cjs/bs-ai-thinking.cjs.entry.js +2 -2
  31. package/dist/cjs/bs-attachment-list.cjs.entry.js +2 -2
  32. package/dist/cjs/bs-attachment.cjs.entry.js +1 -1
  33. package/dist/cjs/bs-badge.cjs.entry.js +1 -1
  34. package/dist/cjs/bs-button-skeleton.cjs.entry.js +2 -2
  35. package/dist/cjs/bs-button.cjs.entry.js +1 -1
  36. package/dist/cjs/bs-card.cjs.entry.js +1 -1
  37. package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +2 -2
  38. package/dist/cjs/bs-chatbot-header.cjs.entry.js +2 -2
  39. package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +2 -2
  40. package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +2 -2
  41. package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +2 -2
  42. package/dist/cjs/bs-checkbox.cjs.entry.js +83 -0
  43. package/dist/cjs/bs-composer-status-banner.cjs.entry.js +2 -2
  44. package/dist/cjs/bs-composer.cjs.entry.js +2 -2
  45. package/dist/cjs/bs-data-table.cjs.entry.js +3 -3
  46. package/dist/cjs/bs-input.cjs.entry.js +3 -3
  47. package/dist/cjs/bs-menu_2.cjs.entry.js +9 -4
  48. package/dist/cjs/bs-modal.cjs.entry.js +1 -1
  49. package/dist/cjs/bs-source-link.cjs.entry.js +3 -3
  50. package/dist/cjs/bs-tooltip.cjs.entry.js +2 -2
  51. package/dist/cjs/{index-CVh-sqA_.js → index-CGrdFg95.js} +73 -1
  52. package/dist/cjs/loader.cjs.js +2 -2
  53. package/dist/collection/collection-manifest.json +1 -0
  54. package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +1 -1
  55. package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +1 -1
  56. package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +1 -1
  57. package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +1 -1
  58. package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
  59. package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +1 -1
  60. package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
  61. package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
  62. package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +1 -1
  63. package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
  64. package/dist/collection/components/bs-checkbox/bs-checkbox.cmp.test.js +107 -0
  65. package/dist/collection/components/bs-checkbox/bs-checkbox.css +193 -0
  66. package/dist/collection/components/bs-checkbox/bs-checkbox.js +234 -0
  67. package/dist/collection/components/bs-checkbox/bs-checkbox.stories.js +65 -0
  68. package/dist/collection/components/bs-composer/bs-composer.js +1 -1
  69. package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +1 -1
  70. package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
  71. package/dist/collection/components/bs-input/bs-input.js +2 -2
  72. package/dist/collection/components/bs-menu/bs-menu.js +1 -1
  73. package/dist/collection/components/bs-menu-item/bs-menu-item.cmp.test.js +18 -0
  74. package/dist/collection/components/bs-menu-item/bs-menu-item.css +19 -1
  75. package/dist/collection/components/bs-menu-item/bs-menu-item.js +34 -2
  76. package/dist/collection/components/bs-menu-item/bs-menu-item.stories.js +3 -0
  77. package/dist/collection/components/bs-source-link/bs-source-link.js +2 -2
  78. package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
  79. package/dist/components/bs-ai-disclaimer.js +1 -1
  80. package/dist/components/bs-ai-greeting.js +1 -1
  81. package/dist/components/bs-ai-thinking.js +1 -1
  82. package/dist/components/bs-attachment-list.js +1 -1
  83. package/dist/components/bs-attachment.js +1 -1
  84. package/dist/components/bs-badge.js +1 -1
  85. package/dist/components/bs-button-skeleton.js +1 -1
  86. package/dist/components/bs-button.js +1 -1
  87. package/dist/components/bs-card.js +1 -1
  88. package/dist/components/bs-chatbot-feedback.js +1 -1
  89. package/dist/components/bs-chatbot-header.js +1 -1
  90. package/dist/components/bs-chatbot-response-action.js +1 -1
  91. package/dist/components/bs-chatbot-sources-drawer.js +1 -1
  92. package/dist/components/bs-chatbot-suggestion-button.js +1 -1
  93. package/dist/components/bs-checkbox.d.ts +11 -0
  94. package/dist/components/bs-checkbox.js +1 -0
  95. package/dist/components/bs-composer-status-banner.js +1 -1
  96. package/dist/components/bs-composer.js +1 -1
  97. package/dist/components/bs-data-table.js +1 -1
  98. package/dist/components/bs-input.js +1 -1
  99. package/dist/components/bs-menu-item.js +1 -1
  100. package/dist/components/bs-menu.js +1 -1
  101. package/dist/components/bs-modal.js +1 -1
  102. package/dist/components/bs-source-link.js +1 -1
  103. package/dist/components/bs-tooltip.js +1 -1
  104. package/dist/components/index.js +1 -1
  105. package/dist/components/{p-Cz2nfz2j.js → p-B9PrXIl_.js} +1 -1
  106. package/dist/components/{p-DndQiCMP.js → p-BUbGEXL7.js} +1 -1
  107. package/dist/components/{p-BpvhHQSw.js → p-D1cYtKyN.js} +1 -1
  108. package/dist/components/p-D2HDHZjz.js +1 -0
  109. package/dist/esm/brandsync-wc.js +3 -3
  110. package/dist/esm/bs-ai-disclaimer.entry.js +2 -2
  111. package/dist/esm/bs-ai-greeting.entry.js +2 -2
  112. package/dist/esm/bs-ai-thinking.entry.js +2 -2
  113. package/dist/esm/bs-attachment-list.entry.js +2 -2
  114. package/dist/esm/bs-attachment.entry.js +1 -1
  115. package/dist/esm/bs-badge.entry.js +1 -1
  116. package/dist/esm/bs-button-skeleton.entry.js +2 -2
  117. package/dist/esm/bs-button.entry.js +1 -1
  118. package/dist/esm/bs-card.entry.js +1 -1
  119. package/dist/esm/bs-chatbot-feedback.entry.js +2 -2
  120. package/dist/esm/bs-chatbot-header.entry.js +2 -2
  121. package/dist/esm/bs-chatbot-response-action.entry.js +2 -2
  122. package/dist/esm/bs-chatbot-sources-drawer.entry.js +2 -2
  123. package/dist/esm/bs-chatbot-suggestion-button.entry.js +2 -2
  124. package/dist/esm/bs-checkbox.entry.js +81 -0
  125. package/dist/esm/bs-composer-status-banner.entry.js +2 -2
  126. package/dist/esm/bs-composer.entry.js +2 -2
  127. package/dist/esm/bs-data-table.entry.js +3 -3
  128. package/dist/esm/bs-input.entry.js +3 -3
  129. package/dist/esm/bs-menu_2.entry.js +9 -4
  130. package/dist/esm/bs-modal.entry.js +1 -1
  131. package/dist/esm/bs-source-link.entry.js +3 -3
  132. package/dist/esm/bs-tooltip.entry.js +2 -2
  133. package/dist/esm/{index-nLORuTUY.js → index-DP_bvuvB.js} +73 -1
  134. package/dist/esm/loader.js +3 -3
  135. package/dist/types/components/bs-checkbox/bs-checkbox.cmp.test.d.ts +1 -0
  136. package/dist/types/components/bs-checkbox/bs-checkbox.d.ts +53 -0
  137. package/dist/types/components/bs-checkbox/bs-checkbox.stories.d.ts +23 -0
  138. package/dist/types/components/bs-menu-item/bs-menu-item.d.ts +7 -1
  139. package/dist/types/components/bs-menu-item/bs-menu-item.stories.d.ts +1 -0
  140. package/dist/types/components.d.ts +165 -5
  141. package/package.json +1 -1
  142. package/dist/brandsync-wc/p-0d64ea40.entry.js +0 -1
  143. package/dist/brandsync-wc/p-5333bb5a.entry.js +0 -1
  144. package/dist/brandsync-wc/p-96f374be.entry.js +0 -1
  145. package/dist/components/p-_vXDfB3V.js +0 -1
@@ -123,7 +123,7 @@ export class BsChatbotFeedback {
123
123
  }
124
124
  render() {
125
125
  const stars = [1, 2, 3, 4, 5];
126
- return (h("div", { key: 'e509feb04a65ee7908c9021befe43ddb0727fd00', class: "bs-chatbot-feedback", role: "region", "aria-label": this.computedHeading() }, h("button", { key: '3c1e7f84bb1a2e0e6f89323f2c45102c3714c0f6', type: "button", part: "close", class: "bs-chatbot-feedback__close", "aria-label": "Close", onClick: this.onCloseClick }, h(CloseIcon, { key: '30202380a79f55d4187ff6f50fc0a11d7a282b81' })), h("div", { key: '228f8195087f1d6d3ec6ba53f954ab722cae2971', class: "bs-chatbot-feedback__top" }, h("div", { key: 'd7fb1f58d21aed4fa9b0e5da83a5506e8082c5ff', class: "bs-chatbot-feedback__text" }, h("p", { key: '7e275ebb91562a2f3b4eaf8076a7238f82260bcf', part: "heading", class: "bs-chatbot-feedback__heading" }, this.computedHeading()), h("p", { key: '0bd022e0594dee0a084a83fcce90abeb2b8c8a98', part: "subtitle", class: "bs-chatbot-feedback__subtitle" }, this.computedSubtitle())), h("div", { key: '0c54cd7cfc1b14c4feac0859e1ad2dd3ee2af8a1', class: "bs-chatbot-feedback__stars", role: "radiogroup", "aria-label": "Rating" }, stars.map(value => (h("button", { type: "button", part: "star", class: "bs-chatbot-feedback__star", role: "radio", "aria-checked": (this.rating >= value).toString(), "aria-label": `${value} star${value > 1 ? 's' : ''}`, disabled: this.submitted, onClick: () => this.onStarClick(value) }, h(StarIcon, { filled: this.rating >= value }))))), !this.submitted && (h("div", { key: '4e00821d17646c1d71d9893a7459557f9fcf24d2', class: "bs-chatbot-feedback__field" }, h("label", { key: '11d31fb2ff6897e97e2ec4196ead7269d60cec7b', part: "label", class: "bs-chatbot-feedback__label", htmlFor: "bs-chatbot-feedback-comment" }, "Tell us what you think"), h("textarea", { key: 'd6228e4d737e90ab61cca91d633e36ac69f1c172', part: "textarea", id: "bs-chatbot-feedback-comment", class: "bs-chatbot-feedback__textarea", placeholder: "e.g.The response was helpful ....", value: this.comment, onInput: this.onCommentInput }))), this.submitted && this.comment && (h("p", { key: 'bb5fdd240b07a6051cb784077b3476af1e1217fb', part: "comment", class: "bs-chatbot-feedback__comment" }, this.comment))), h("div", { key: '0d262521f8f13b464f4cbfa746ce49bd330986c6', class: "bs-chatbot-feedback__actions" }, !this.submitted && (h("button", { key: 'a5e8cc2a7bdd290cc95afeefe5d1fc5a1dde86ce', type: "button", part: "submit", class: "bs-chatbot-feedback__submit", disabled: this.rating === 0, onClick: this.onSubmitClick }, h(SendIcon, { key: '163b0c11e0038ae01d7bc61ae1f8c50930b7f8f2' }), "Submit feedback")), h("button", { key: '3cf2d4b2cd6b9043d4194a991cc0e33fa09c69e4', type: "button", part: "new-chat", class: `bs-chatbot-feedback__new-chat ${this.submitted ? 'bs-chatbot-feedback__new-chat--primary' : 'bs-chatbot-feedback__new-chat--outlined'}`, onClick: this.onNewChatClick }, h(EditIcon, { key: 'a0fddede710c06b60302e4cb12b7affe9ed8afec' }), "Start new chat"))));
126
+ return (h("div", { key: '278496768d42fffdf8df4d4688ecb2a845b709f0', class: "bs-chatbot-feedback", role: "region", "aria-label": this.computedHeading() }, h("button", { key: '29507aa7b8d4047c49360eebe9705c04f5cf635a', type: "button", part: "close", class: "bs-chatbot-feedback__close", "aria-label": "Close", onClick: this.onCloseClick }, h(CloseIcon, { key: '598403a5f96cb5e3b242da19c67f888f6e5442b5' })), h("div", { key: '44de5b26f1e9dd202ba55d71c4ef831608a9b7e2', class: "bs-chatbot-feedback__top" }, h("div", { key: '2ab88191c765a53cf72b1edd3ebfe22aa5ac6bee', class: "bs-chatbot-feedback__text" }, h("p", { key: '9f60601413f81b5120516197e239ce1baf42dad4', part: "heading", class: "bs-chatbot-feedback__heading" }, this.computedHeading()), h("p", { key: 'd2a7c2b250c5ca5d9e46c52e534d38ab2efb96c5', part: "subtitle", class: "bs-chatbot-feedback__subtitle" }, this.computedSubtitle())), h("div", { key: '1c4564a3a48f483b6285ffabea8b2cd875154907', class: "bs-chatbot-feedback__stars", role: "radiogroup", "aria-label": "Rating" }, stars.map(value => (h("button", { type: "button", part: "star", class: "bs-chatbot-feedback__star", role: "radio", "aria-checked": (this.rating >= value).toString(), "aria-label": `${value} star${value > 1 ? 's' : ''}`, disabled: this.submitted, onClick: () => this.onStarClick(value) }, h(StarIcon, { filled: this.rating >= value }))))), !this.submitted && (h("div", { key: '92c3340c38bf2c4f0b54e3a9ea67403c6f4155e1', class: "bs-chatbot-feedback__field" }, h("label", { key: '87d7a0faeb236d72ddc066d2d390c8ad77a346c2', part: "label", class: "bs-chatbot-feedback__label", htmlFor: "bs-chatbot-feedback-comment" }, "Tell us what you think"), h("textarea", { key: 'd8a424d825fbac92a98475e496bfc5186a4adeb9', part: "textarea", id: "bs-chatbot-feedback-comment", class: "bs-chatbot-feedback__textarea", placeholder: "e.g.The response was helpful ....", value: this.comment, onInput: this.onCommentInput }))), this.submitted && this.comment && (h("p", { key: 'd9fda026f57448ebc537967e5a8bbab5faa96dd1', part: "comment", class: "bs-chatbot-feedback__comment" }, this.comment))), h("div", { key: '5fa34ac127e5525a0f3279c240ca57288329ce56', class: "bs-chatbot-feedback__actions" }, !this.submitted && (h("button", { key: '9165d3f98cbb39974ffdc3831c27bef0abd55b4d', type: "button", part: "submit", class: "bs-chatbot-feedback__submit", disabled: this.rating === 0, onClick: this.onSubmitClick }, h(SendIcon, { key: '69c0c8a74e7d3fbb1c06d7c05be4f9766ea141ea' }), "Submit feedback")), h("button", { key: '97634f47527312fdc6752a203fc0781a0e88c79f', type: "button", part: "new-chat", class: `bs-chatbot-feedback__new-chat ${this.submitted ? 'bs-chatbot-feedback__new-chat--primary' : 'bs-chatbot-feedback__new-chat--outlined'}`, onClick: this.onNewChatClick }, h(EditIcon, { key: '55699b3a298e25f3e0584e05d3f751f3d6bfbb9a' }), "Start new chat"))));
127
127
  }
128
128
  static get is() { return "bs-chatbot-feedback"; }
129
129
  static get encapsulation() { return "shadow"; }
@@ -74,7 +74,7 @@ export class BsChatbotHeader {
74
74
  this.bsClose.emit();
75
75
  };
76
76
  render() {
77
- return (h("div", { key: 'b1f536775af30bea47474dbcf41f444e9361fabd', class: "bs-chatbot-header", role: "banner", "aria-label": this.heading }, h("div", { key: '1e650269ff177b26e1dce30d9e04b4fab9de9698', part: "logo", class: "bs-chatbot-header__logo", role: "img", "aria-label": this.heading, innerHTML: GENIE_LOGO_SVG }), h("div", { key: '6a35a216f3bbda37ebd14ba801bf83f1f4941616', class: "bs-chatbot-header__actions" }, h("span", { key: 'af2b8a3eeafd27a946e1dd1c51c326c6f7e73531', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: '2928c845fd3737d68d672305437d9edd76d1deb3', type: "button", part: "new-chat", class: "bs-chatbot-header__button", "aria-label": "New chat", onClick: this.onNewChatClick }, h("slot", { key: 'bdab9f84e61bc92e16abcb7a9019300291690387', name: "new-chat-icon" }, h(NewChatIcon, { key: 'c61ddb8d3b8f9945f9986253cbe16e462c836f28' }))), h("bs-tooltip", { key: '3edbc3aae276ad91d2e70d21040efaffef101381', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, "New chat")), h("span", { key: 'ef3bc303486fea9088b3855ac211baf6e1acae8b', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: '60e2787be7401832a29f806723414b361c480c47', type: "button", part: "history", class: "bs-chatbot-header__button", "aria-label": "History", onClick: this.onHistoryClick }, h("slot", { key: '2bbf8e675aa150740a23d59015446e012adbcb05', name: "history-icon" }, h(HistoryIcon, { key: '55badb6fc7cf1a17abbdae74896789cf2802be01' }))), h("bs-tooltip", { key: 'd4fd6cffbff586949b9357605cf23362a09fbd86', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, "History")), h("span", { key: 'e2aa88c87d900d581b5a353cb2a4d014818b238b', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: 'aa5357f502a32b586b2d5c4837b37364f00d344a', type: "button", part: "expand", class: "bs-chatbot-header__button", "aria-label": this.expanded ? 'Collapse' : 'Expand', "aria-pressed": this.expanded ? 'true' : 'false', onClick: this.onExpandClick }, h("slot", { key: '312e8c17f49c84672533e37989c73072038ca07f', name: "expand-icon" }, h(ExpandIcon, { key: 'a0b666ae7b3660d4eb892407a82a84a0d8c8607b' }))), h("bs-tooltip", { key: '3c43e4d14ef4cdedaaecebed43927eb8f59e3391', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, this.expanded ? 'Collapse' : 'Expand')), h("span", { key: '1e252dcc382c0f2c5ae89a8dcf96e9d76c086b01', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: 'b95104b5dc629e70c43f0eb01f34fd0ba57db670', type: "button", part: "close", class: "bs-chatbot-header__button", "aria-label": "Close", onClick: this.onCloseClick }, h("slot", { key: '7c24bb86799528bc1e1bcc6419217b2048f70835', name: "close-icon" }, h(CloseIcon, { key: 'c53e2028c86264bac5082e9e145deb79eca3156d' }))), h("bs-tooltip", { key: 'f132fa96cc7942a3c4574403da1f2a0d586c0068', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, "Close")))));
77
+ return (h("div", { key: 'b67eb065f0bacc73cea6cfba97f95db26d939fef', class: "bs-chatbot-header", role: "banner", "aria-label": this.heading }, h("div", { key: '14495ee7659e6d9198799b19fe2482996acd9cb1', part: "logo", class: "bs-chatbot-header__logo", role: "img", "aria-label": this.heading, innerHTML: GENIE_LOGO_SVG }), h("div", { key: '4f90a6351c004327440e92ca32a7d5f16dc10f35', class: "bs-chatbot-header__actions" }, h("span", { key: '77a7a55d92a4844778cd2f9e968e497b6f6dc3ec', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: '5e7e9ad3beb2a74d05178fb3b847994284b84078', type: "button", part: "new-chat", class: "bs-chatbot-header__button", "aria-label": "New chat", onClick: this.onNewChatClick }, h("slot", { key: '71fdc53fdb397fdb45a1e05d4ecf4505f2ee6546', name: "new-chat-icon" }, h(NewChatIcon, { key: '1ca210d70f3a16869092cf681d737c698b136e52' }))), h("bs-tooltip", { key: 'ec6e597102a7bccfbe82f3d4cdd24f6e9939671c', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, "New chat")), h("span", { key: '5ab09f2170faa1e820ae43034e8d2c28263c8f9b', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: '457c6b31a93bc8afb9f6140283332f1e9cece997', type: "button", part: "history", class: "bs-chatbot-header__button", "aria-label": "History", onClick: this.onHistoryClick }, h("slot", { key: 'cec925b6dc90978e447ac2abe519fd39299f719d', name: "history-icon" }, h(HistoryIcon, { key: 'aec4f574f79fc80266cadb78d4db3a5e5a791af7' }))), h("bs-tooltip", { key: '76a28dd05c9648a27cb47d843a48c71b2a4736a1', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, "History")), h("span", { key: 'f77e9dfc1640fd0820f1afdc47692767307793ed', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: 'd6c09ae435f7c43141990ac411bbfdd48be2746d', type: "button", part: "expand", class: "bs-chatbot-header__button", "aria-label": this.expanded ? 'Collapse' : 'Expand', "aria-pressed": this.expanded ? 'true' : 'false', onClick: this.onExpandClick }, h("slot", { key: 'd98d678009f56c298289527c505eb9863a783155', name: "expand-icon" }, h(ExpandIcon, { key: 'b5717154a53b3d6745a20de74f2e2a51497f1718' }))), h("bs-tooltip", { key: 'ee742bdb2e8f948756ea1f9b13ee2a1c35d0597d', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, this.expanded ? 'Collapse' : 'Expand')), h("span", { key: '7a19e71b35be8052f206beff78531f17ff080dab', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: '758ddf35814919c575699bd27fdc303a80ef7307', type: "button", part: "close", class: "bs-chatbot-header__button", "aria-label": "Close", onClick: this.onCloseClick }, h("slot", { key: 'c545d1a724431ccff6593ba3047462bd9bfaefeb', name: "close-icon" }, h(CloseIcon, { key: '4ed2a585be65e2c77200ceeb2b99329afda177a3' }))), h("bs-tooltip", { key: '9ce32d5f9772d91fea7a937341a5866938d87ac5', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, "Close")))));
78
78
  }
79
79
  static get is() { return "bs-chatbot-header"; }
80
80
  static get encapsulation() { return "shadow"; }
@@ -105,7 +105,7 @@ export class BsChatbotResponseAction {
105
105
  };
106
106
  render() {
107
107
  const hasSources = !!this.sourcesCount && this.sourcesCount > 0;
108
- return (h("div", { key: 'bae036e0fce39e91ad77e048e6c169ea72ce78e4', class: "bs-chatbot-response-action" }, h("button", { key: 'aadfb92da35ba7b5b105cfdc3ad506c7a7fd78e7', type: "button", part: "like", class: "bs-chatbot-response-action__button", "aria-label": "Like", onClick: this.onLikeClick }, h("slot", { key: 'f61c62fa761d277b3ef1b6c7a1bf4b8077ac340b', name: "like-icon" }, h(ThumbsUpIcon, { key: 'a95b09db3fee703c4d2e31a5efa590feb777f3b5' }))), h("button", { key: '37bdacfab99f444ae215b0da5a7b11912562baf7', type: "button", part: "dislike", class: "bs-chatbot-response-action__button", "aria-label": "Dislike", onClick: this.onDislikeClick }, h("slot", { key: 'b948f912ce5cd82c570bfcf7fe69f01f4bf993b0', name: "dislike-icon" }, h(ThumbsDownIcon, { key: '59e901ec41273c235fb0e484e53d23e529a1f429' }))), h("button", { key: '5f0f954f0cadcfda62d0493ebbf07651dc9c43c3', type: "button", part: "copy", class: "bs-chatbot-response-action__button", "aria-label": "Copy", onClick: this.onCopyClick }, h("slot", { key: 'a965380a2c3af43ba49b735c19c7b4afb5ec9c9f', name: "copy-icon" }, h(CopyIcon, { key: 'c9e7d8ef53a14728bced9c753aba3529ac97152f' }))), h("button", { key: 'e06f0c60698dea9a17005d6b233e59e5389c2c11', type: "button", part: "regenerate", class: "bs-chatbot-response-action__button", "aria-label": "Regenerate", onClick: this.onRegenerateClick }, h("slot", { key: '9a5aad36b3f1e217b2ab1718c25d451bc4f0b326', name: "regenerate-icon" }, h(RegenerateIcon, { key: '02aa85caf9c69a84fab24fd97361fa0a2a42c784' }))), h("div", { key: '6c48442ee1c32fcdecab2521c7e7773aae413c61', class: "bs-chatbot-response-action__menu-wrapper" }, h("button", { key: '749474386109e0c6bf3d0c18396ab75514a84db5', type: "button", part: "menu", class: "bs-chatbot-response-action__button", "aria-label": "More options", "aria-haspopup": "menu", "aria-expanded": this.menuOpen ? 'true' : 'false', onClick: this.onMenuClick }, h("slot", { key: 'a48edebb1eb697e7ebb80ceee8b674ad28ae760b', name: "menu-icon" }, h(MenuIcon, { key: '3bc463d9d8882ae373221b754d234938bd47f7de' }))), this.menuOpen && (h("div", { key: 'b1217dd05886155d65b6c6e52933b23ddfbeda4e', class: "bs-chatbot-response-action__menu-popup" }, h("slot", { key: '5a22ff4ffe417bbd25dfddbf18a943862b499f24', name: "menu" })))), hasSources && (h("button", { key: '35d6be1ee305a8549ebc1bed28884c0c5dc83220', type: "button", part: "sources", class: "bs-chatbot-response-action__sources", onClick: this.onSourcesClick }, h("slot", { key: 'af5a033146160fc90eb9ad3d28eb0ecc3628347c', name: "sources-icon" }, h(SourcesIcon, { key: '908029587106b710ddcee80fe207dddc8f77723c' })), h("span", { key: 'aa64462f7f5f4d96adfdf7172a5c2ac18cb1e608', class: "bs-chatbot-response-action__sources-label" }, this.sourcesCount, " ", this.sourcesCount === 1 ? 'source' : 'sources')))));
108
+ return (h("div", { key: '7d97251380f7e6b002eaafb3699ea981d5068555', class: "bs-chatbot-response-action" }, h("button", { key: 'd05f73b0f1d1f9f03a452397ef3206a866abcefc', type: "button", part: "like", class: "bs-chatbot-response-action__button", "aria-label": "Like", onClick: this.onLikeClick }, h("slot", { key: '30b7a9da1dd2c317ac7c4ecbdda76c0f146a3495', name: "like-icon" }, h(ThumbsUpIcon, { key: 'b5bf2e9915a5c1263e18304f4b487807cc256879' }))), h("button", { key: 'f601202a175a47978595d080d938ce48be1715d8', type: "button", part: "dislike", class: "bs-chatbot-response-action__button", "aria-label": "Dislike", onClick: this.onDislikeClick }, h("slot", { key: 'c141f978f453abc6062e8274a4fdb6e1f80ac5b2', name: "dislike-icon" }, h(ThumbsDownIcon, { key: '158799c27d18b62152937e7485cec5a23598d177' }))), h("button", { key: 'cdb6b1ab5f2bb12e43ae3ab0fa73a81e24ba1f16', type: "button", part: "copy", class: "bs-chatbot-response-action__button", "aria-label": "Copy", onClick: this.onCopyClick }, h("slot", { key: '8e9387d18ed444da1b7d20f4a6b60e7c2fae32bc', name: "copy-icon" }, h(CopyIcon, { key: '7c1cfede4ef084babd7aeeb3a2a3817ca4346663' }))), h("button", { key: 'f4e190de92eb4936594f4701c406c3b2bc1f84c8', type: "button", part: "regenerate", class: "bs-chatbot-response-action__button", "aria-label": "Regenerate", onClick: this.onRegenerateClick }, h("slot", { key: 'c52e03dc83f047125a5bd1c73cafba8b71a21fed', name: "regenerate-icon" }, h(RegenerateIcon, { key: '1564599695557eea663d770779301c34e815cbf5' }))), h("div", { key: '90a6b3c75e169be71c217ac8b711bb2ca001ee49', class: "bs-chatbot-response-action__menu-wrapper" }, h("button", { key: '2d8d25c6e183638233ef9287360bc0969f2fa2ac', type: "button", part: "menu", class: "bs-chatbot-response-action__button", "aria-label": "More options", "aria-haspopup": "menu", "aria-expanded": this.menuOpen ? 'true' : 'false', onClick: this.onMenuClick }, h("slot", { key: 'f992794d9e964c830e1780078ea83abec1be471b', name: "menu-icon" }, h(MenuIcon, { key: '4b75676316bc826b3a7cd19cba8f46b8ceacf19c' }))), this.menuOpen && (h("div", { key: 'f24430ebab56eda589f19f7cb9f3f1c31d7185cb', class: "bs-chatbot-response-action__menu-popup" }, h("slot", { key: '2978dee3a0d5521e805a4496d6e33c6b31b52fc6', name: "menu" })))), hasSources && (h("button", { key: '1ab402dd2ef3c97b5b30d86e4f1e3db4f879baf9', type: "button", part: "sources", class: "bs-chatbot-response-action__sources", onClick: this.onSourcesClick }, h("slot", { key: 'f2cf31ff9311d8c888f2b8a0130a9f82161c4b8f', name: "sources-icon" }, h(SourcesIcon, { key: '333dae604a7eb80319b8e822c332067076e4a04d' })), h("span", { key: '04929996660675c23f1a02fc1d756d6735b58b8d', class: "bs-chatbot-response-action__sources-label" }, this.sourcesCount, " ", this.sourcesCount === 1 ? 'source' : 'sources')))));
109
109
  }
110
110
  static get is() { return "bs-chatbot-response-action"; }
111
111
  static get encapsulation() { return "shadow"; }
@@ -57,7 +57,7 @@ export class BsChatbotSourcesDrawer {
57
57
  };
58
58
  render() {
59
59
  const displayCount = this.count ?? this.slottedCount;
60
- return (h("div", { key: '54cb56455b630d5ed30dd2a925728f2803143b17', class: "bs-chatbot-sources-drawer", role: "region", "aria-label": this.heading }, h("div", { key: 'd24eabd0ac2c36ec4033a9b5c361aa32225fa78a', class: "bs-chatbot-sources-drawer__header" }, h("div", { key: '0bec3fb848552496e1884b4731c5e1964570c70d', class: "bs-chatbot-sources-drawer__title-group" }, h("h2", { key: '955389bd4f3ba1950c9af404e5880a6837298384', part: "heading", class: "bs-chatbot-sources-drawer__heading" }, this.heading), displayCount > 0 && (h("span", { key: '40d83288bbd257504ef814247c7bd4664df9e169', part: "count", class: "bs-chatbot-sources-drawer__count" }, displayCount))), h("button", { key: '56a15c64faea80790387d4918843c806b684268b', type: "button", part: "collapse", class: "bs-chatbot-sources-drawer__collapse", "aria-label": "Collapse sources", onClick: this.onCollapseClick }, h("slot", { key: 'c321f53482f0265357a6a29fc40e0ff3766f0b74', name: "collapse-icon" }, h(CaretRightIcon, { key: 'c3d4c17bebd2611b27c3e7f87d359e4b46c41d4f' })))), h("div", { key: 'd6c4b8e3660f765112f0c33dd72021af118332d9', part: "list", class: "bs-chatbot-sources-drawer__list" }, h("slot", { key: '19759a01d921ed2517cbca2b01ea53741a207b8b', onSlotchange: this.onSlotchange }))));
60
+ return (h("div", { key: 'e71c8b6f4856092a6fd43fd6dcd8cda04d3a103e', class: "bs-chatbot-sources-drawer", role: "region", "aria-label": this.heading }, h("div", { key: 'f46a1383d8e95aeb83541b2620647839fbe4d3f9', class: "bs-chatbot-sources-drawer__header" }, h("div", { key: '62663736cb4f9e56a5b837da27b4d7d8915c1838', class: "bs-chatbot-sources-drawer__title-group" }, h("h2", { key: '765954b929796005966efaf5aa23ca68053a894e', part: "heading", class: "bs-chatbot-sources-drawer__heading" }, this.heading), displayCount > 0 && (h("span", { key: '562cfc14be64d938879fad31ab185a2f3a441e63', part: "count", class: "bs-chatbot-sources-drawer__count" }, displayCount))), h("button", { key: '8e538aa2aa31b54c8845c9c5d8ffd581cbf1028b', type: "button", part: "collapse", class: "bs-chatbot-sources-drawer__collapse", "aria-label": "Collapse sources", onClick: this.onCollapseClick }, h("slot", { key: '53b12abc52c217d3264ece6cf26daf8c5e01f84e', name: "collapse-icon" }, h(CaretRightIcon, { key: '90b61c4694fd1d908d74e47a19124327a001ce53' })))), h("div", { key: 'a7fc0ceb5b280867237ac3ce6c3bd314c7809075', part: "list", class: "bs-chatbot-sources-drawer__list" }, h("slot", { key: 'db40db9dad7f4e24c8eb0665e2286870f0800843', onSlotchange: this.onSlotchange }))));
61
61
  }
62
62
  static get is() { return "bs-chatbot-sources-drawer"; }
63
63
  static get encapsulation() { return "shadow"; }
@@ -45,7 +45,7 @@ export class BsChatbotSuggestionButton {
45
45
  this.bsSelect.emit();
46
46
  };
47
47
  render() {
48
- return (h("button", { key: '2a5213dc81a29dd68f99717b93e6f5396db5c5da', type: "button", part: "button", class: "bs-chatbot-suggestion-button", disabled: this.disabled, onClick: this.onClick }, h("slot", { key: '28b5ac8ddcdab80fb377a897dc1af62257473385' })));
48
+ return (h("button", { key: 'ec0d9d02fe71438dc564a36d4e57bcf465b4395d', type: "button", part: "button", class: "bs-chatbot-suggestion-button", disabled: this.disabled, onClick: this.onClick }, h("slot", { key: '443a388996b21359df334af0319244f4c736e259' })));
49
49
  }
50
50
  static get is() { return "bs-chatbot-suggestion-button"; }
51
51
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,107 @@
1
+ import { render, h, describe, it, expect } from "@stencil/vitest";
2
+ describe('bs-checkbox', () => {
3
+ it('renders an unchecked native checkbox by default', async () => {
4
+ const { root } = await render(h("bs-checkbox", null));
5
+ const input = root.shadowRoot.querySelector('input');
6
+ expect(input).toEqualAttribute('type', 'checkbox');
7
+ expect(input.checked).toBe(false);
8
+ expect(root.shadowRoot.querySelector('[part="box"] [part="icon"]')).toBeNull();
9
+ });
10
+ it('reflects the checked prop to the native input and shows the check icon', async () => {
11
+ const { root } = await render(h("bs-checkbox", { checked: true }));
12
+ const input = root.shadowRoot.querySelector('input');
13
+ expect(input.checked).toBe(true);
14
+ expect(root.shadowRoot.querySelector('[part="box"]')).toHaveClass('bs-checkbox__box--selected');
15
+ expect(root.shadowRoot.querySelector('[part="icon"]')).not.toBeNull();
16
+ });
17
+ it('clicking the input toggles checked and emits bsChange with the new value', async () => {
18
+ const { root, waitForChanges, spyOnEvent } = await render(h("bs-checkbox", null));
19
+ const bsChangeSpy = spyOnEvent('bsChange');
20
+ const input = root.shadowRoot.querySelector('input');
21
+ input.click();
22
+ await waitForChanges();
23
+ expect(input.checked).toBe(true);
24
+ expect(bsChangeSpy).toHaveReceivedEventTimes(1);
25
+ expect(bsChangeSpy).toHaveReceivedEventDetail(true);
26
+ input.click();
27
+ await waitForChanges();
28
+ expect(input.checked).toBe(false);
29
+ expect(bsChangeSpy).toHaveReceivedEventTimes(2);
30
+ expect(bsChangeSpy).toHaveReceivedEventDetail(false);
31
+ });
32
+ describe('indeterminate', () => {
33
+ it('sets the native input .indeterminate JS property, not an HTML attribute', async () => {
34
+ const { root } = await render(h("bs-checkbox", { indeterminate: true }));
35
+ const input = root.shadowRoot.querySelector('input');
36
+ expect(input.indeterminate).toBe(true);
37
+ expect(input).not.toHaveAttribute('indeterminate');
38
+ });
39
+ it('takes visual precedence over checked, showing the minus icon', async () => {
40
+ const { root } = await render(h("bs-checkbox", { checked: true, indeterminate: true }));
41
+ const box = root.shadowRoot.querySelector('[part="box"]');
42
+ expect(box).toHaveClass('bs-checkbox__box--selected');
43
+ const icon = root.shadowRoot.querySelector('[part="icon"]');
44
+ expect(icon.querySelector('path')).not.toBeNull();
45
+ // Minus icon is a single horizontal line; check icon has two line segments in its path data.
46
+ expect(icon.innerHTML).toContain('M3 8H13');
47
+ });
48
+ it('updates the native .indeterminate property when the prop changes after initial render', async () => {
49
+ const { root, waitForChanges } = await render(h("bs-checkbox", null));
50
+ const input = root.shadowRoot.querySelector('input');
51
+ expect(input.indeterminate).toBe(false);
52
+ root.indeterminate = true;
53
+ await waitForChanges();
54
+ expect(input.indeterminate).toBe(true);
55
+ });
56
+ it('clears indeterminate when the user toggles the checkbox', async () => {
57
+ const { root, waitForChanges } = await render(h("bs-checkbox", { indeterminate: true }));
58
+ const input = root.shadowRoot.querySelector('input');
59
+ input.click();
60
+ await waitForChanges();
61
+ expect(input.indeterminate).toBe(false);
62
+ expect(root.indeterminate).toBe(false);
63
+ });
64
+ });
65
+ describe('disabled', () => {
66
+ it('sets the disabled attribute on the native input', async () => {
67
+ const { root } = await render(h("bs-checkbox", { disabled: true }));
68
+ const input = root.shadowRoot.querySelector('input');
69
+ expect(input).toHaveAttribute('disabled');
70
+ });
71
+ it('prevents toggling via click', async () => {
72
+ const { root, waitForChanges, spyOnEvent } = await render(h("bs-checkbox", { disabled: true }));
73
+ const bsChangeSpy = spyOnEvent('bsChange');
74
+ const input = root.shadowRoot.querySelector('input');
75
+ input.click();
76
+ await waitForChanges();
77
+ expect(input.checked).toBe(false);
78
+ expect(bsChangeSpy).toHaveReceivedEventTimes(0);
79
+ });
80
+ });
81
+ describe('error', () => {
82
+ it('applies the error class to the box', async () => {
83
+ const { root } = await render(h("bs-checkbox", { error: true }));
84
+ const box = root.shadowRoot.querySelector('[part="box"]');
85
+ expect(box).toHaveClass('bs-checkbox__box--error');
86
+ });
87
+ });
88
+ ['sm', 'md', 'lg'].forEach(size => {
89
+ it(`renders size="${size}" with the matching box modifier class`, async () => {
90
+ const { root } = await render(h("bs-checkbox", { size: size }));
91
+ const box = root.shadowRoot.querySelector('[part="box"]');
92
+ if (size === 'lg') {
93
+ expect(box).not.toHaveClass('bs-checkbox__box--sm');
94
+ expect(box).not.toHaveClass('bs-checkbox__box--md');
95
+ }
96
+ else {
97
+ expect(box).toHaveClass(`bs-checkbox__box--${size}`);
98
+ }
99
+ });
100
+ });
101
+ it('renders label slot content', async () => {
102
+ const { root } = await render(h("bs-checkbox", null, "Accept terms"));
103
+ expect(root).toHaveTextContent('Accept terms');
104
+ const label = root.shadowRoot.querySelector('[part="label"]');
105
+ expect(label.querySelector('slot')).not.toBeNull();
106
+ });
107
+ });
@@ -0,0 +1,193 @@
1
+ /**
2
+ * @prop --bs-checkbox-radius: Corner radius of the box, constant across all sizes. Aliased to --bs-border-radius-50.
3
+ * @prop --bs-checkbox-gap: Gap between the box and the label text. Aliased to --bs-spacing-100.
4
+ * @prop --bs-checkbox-size-sm: Box width/height at size="sm". Aliased to --bs-spacing-200.
5
+ * @prop --bs-checkbox-size-md: Box width/height at size="md". Aliased to --bs-spacing-250.
6
+ * @prop --bs-checkbox-size-lg: Box width/height at size="lg". Aliased to --bs-spacing-300.
7
+ * @prop --bs-checkbox-border-width-sm: Border width at size="sm".
8
+ * @prop --bs-checkbox-border-width-md: Border width at size="md".
9
+ * @prop --bs-checkbox-border-width-lg: Border width at size="lg".
10
+ * @prop --bs-checkbox-border-default: Border color, deselected/enabled. Aliased to --bs-border-default.
11
+ * @prop --bs-checkbox-bg-hover: Box background, deselected/hovered. Aliased to --bs-surface-hover.
12
+ * @prop --bs-checkbox-border-hover: Border color, deselected/hovered. Aliased to --bs-border-neutral-hover.
13
+ * @prop --bs-checkbox-bg-focus: Box background, deselected/focused. Aliased to --bs-surface-raised.
14
+ * @prop --bs-checkbox-border-focus: Border color, deselected/focused. Aliased to --bs-border-neutral-hover.
15
+ * @prop --bs-checkbox-focus-ring-color: Focus ring color, drawn outside the box. Aliased to --bs-border-neutral-focus.
16
+ * @prop --bs-checkbox-bg-disabled: Box background, disabled. Aliased to --bs-surface-action-disabled.
17
+ * @prop --bs-checkbox-border-disabled: Border color, disabled. Aliased to --bs-border-neutral-disabled.
18
+ * @prop --bs-checkbox-border-error: Border color, deselected/error. Aliased to --bs-border-error.
19
+ * @prop --bs-checkbox-bg-selected: Box background, selected or indeterminate/enabled. Aliased to --bs-color-primary-default.
20
+ * @prop --bs-checkbox-border-selected: Border color, selected or indeterminate/enabled. Aliased to --bs-color-primary-default.
21
+ * @prop --bs-checkbox-bg-selected-hover: Box background, selected or indeterminate/hovered. Aliased to --bs-color-primary-hover.
22
+ * @prop --bs-checkbox-border-selected-hover: Border color, selected or indeterminate/hovered. Aliased to --bs-color-primary-hover.
23
+ * @prop --bs-checkbox-bg-selected-error: Box background, selected or indeterminate/error. Aliased to --bs-icon-error.
24
+ * @prop --bs-checkbox-border-selected-error: Border color, selected or indeterminate/error. Aliased to --bs-icon-error.
25
+ * @prop --bs-checkbox-icon-color: Check/minus icon color. Aliased to --bs-icon-static-white.
26
+ * @prop --bs-checkbox-icon-color-disabled: Check/minus icon color, disabled. Aliased to --bs-icon-disabled.
27
+ * @prop --bs-checkbox-label-color: Label text color. Aliased to --bs-text-default.
28
+ * @prop --bs-checkbox-label-color-disabled: Label text color, disabled. Aliased to --bs-text-on-disabled.
29
+ * @prop --bs-checkbox-label-color-error: Label text color, error. Aliased to --bs-text-error.
30
+ */
31
+ :host {
32
+ display: inline-block;
33
+
34
+ --bs-checkbox-radius: var(--bs-border-radius-50);
35
+ --bs-checkbox-gap: var(--bs-spacing-100);
36
+
37
+ --bs-checkbox-size-sm: var(--bs-spacing-200);
38
+ --bs-checkbox-size-md: var(--bs-spacing-250);
39
+ --bs-checkbox-size-lg: var(--bs-spacing-300);
40
+
41
+ --bs-checkbox-border-width-sm: 1.333px;
42
+ --bs-checkbox-border-width-md: 1.667px;
43
+ --bs-checkbox-border-width-lg: 2px;
44
+
45
+ --bs-checkbox-border-default: var(--bs-border-default);
46
+ --bs-checkbox-bg-hover: var(--bs-surface-hover);
47
+ --bs-checkbox-border-hover: var(--bs-border-neutral-hover);
48
+ --bs-checkbox-bg-focus: var(--bs-surface-raised);
49
+ --bs-checkbox-border-focus: var(--bs-border-neutral-hover);
50
+ --bs-checkbox-focus-ring-color: var(--bs-border-neutral-focus);
51
+ --bs-checkbox-bg-disabled: var(--bs-surface-action-disabled);
52
+ --bs-checkbox-border-disabled: var(--bs-border-neutral-disabled);
53
+ --bs-checkbox-border-error: var(--bs-border-error);
54
+
55
+ --bs-checkbox-bg-selected: var(--bs-color-primary-default);
56
+ --bs-checkbox-border-selected: var(--bs-color-primary-default);
57
+ --bs-checkbox-bg-selected-hover: var(--bs-color-primary-hover);
58
+ --bs-checkbox-border-selected-hover: var(--bs-color-primary-hover);
59
+ --bs-checkbox-bg-selected-error: var(--bs-icon-error);
60
+ --bs-checkbox-border-selected-error: var(--bs-icon-error);
61
+
62
+ --bs-checkbox-icon-color: var(--bs-icon-static-white);
63
+ --bs-checkbox-icon-color-disabled: var(--bs-icon-disabled);
64
+
65
+ --bs-checkbox-label-color: var(--bs-text-default);
66
+ --bs-checkbox-label-color-disabled: var(--bs-text-on-disabled);
67
+ --bs-checkbox-label-color-error: var(--bs-text-error);
68
+ }
69
+
70
+ .bs-checkbox {
71
+ position: relative;
72
+ display: inline-flex;
73
+ align-items: center;
74
+ gap: var(--bs-checkbox-gap);
75
+ font-family: inherit;
76
+ cursor: pointer;
77
+ }
78
+
79
+ .bs-checkbox--disabled {
80
+ cursor: not-allowed;
81
+ }
82
+
83
+ /* The native input is visually hidden but stays in the layout/focus/keyboard chain -- opacity: 0
84
+ (not display: none) so it can still receive and show focus. */
85
+ .bs-checkbox__input {
86
+ position: absolute;
87
+ top: 0;
88
+ left: 0;
89
+ width: 100%;
90
+ height: 100%;
91
+ margin: 0;
92
+ padding: 0;
93
+ opacity: 0;
94
+ cursor: pointer;
95
+ }
96
+
97
+ .bs-checkbox__input:disabled {
98
+ cursor: not-allowed;
99
+ }
100
+
101
+ .bs-checkbox__box {
102
+ box-sizing: border-box;
103
+ position: relative;
104
+ display: flex;
105
+ align-items: center;
106
+ justify-content: center;
107
+ flex-shrink: 0;
108
+ width: var(--bs-checkbox-size-lg);
109
+ height: var(--bs-checkbox-size-lg);
110
+ border: var(--bs-checkbox-border-width-lg) solid var(--bs-checkbox-border-default);
111
+ border-radius: var(--bs-checkbox-radius);
112
+ background: transparent;
113
+ color: var(--bs-checkbox-icon-color);
114
+ }
115
+
116
+ .bs-checkbox__box--md {
117
+ width: var(--bs-checkbox-size-md);
118
+ height: var(--bs-checkbox-size-md);
119
+ border-width: var(--bs-checkbox-border-width-md);
120
+ }
121
+
122
+ .bs-checkbox__box--sm {
123
+ width: var(--bs-checkbox-size-sm);
124
+ height: var(--bs-checkbox-size-sm);
125
+ border-width: var(--bs-checkbox-border-width-sm);
126
+ }
127
+
128
+ .bs-checkbox__box--selected {
129
+ background: var(--bs-checkbox-bg-selected);
130
+ border-color: var(--bs-checkbox-border-selected);
131
+ }
132
+
133
+ /* Hover/focus -- keyed off the hidden native input's pseudo-classes, since it sits on top of and
134
+ is the same size as the box, so it always reflects the user's actual pointer/keyboard target. */
135
+ .bs-checkbox__input:hover:not(:disabled) ~ .bs-checkbox__box {
136
+ background: var(--bs-checkbox-bg-hover);
137
+ border-color: var(--bs-checkbox-border-hover);
138
+ }
139
+
140
+ .bs-checkbox__input:hover:not(:disabled) ~ .bs-checkbox__box--selected {
141
+ background: var(--bs-checkbox-bg-selected-hover);
142
+ border-color: var(--bs-checkbox-border-selected-hover);
143
+ }
144
+
145
+ .bs-checkbox__input:focus-visible ~ .bs-checkbox__box {
146
+ background: var(--bs-checkbox-bg-focus);
147
+ border-color: var(--bs-checkbox-border-focus);
148
+ outline: 2px solid var(--bs-checkbox-focus-ring-color);
149
+ outline-offset: 2px;
150
+ }
151
+
152
+ .bs-checkbox__input:focus-visible ~ .bs-checkbox__box--selected {
153
+ background: var(--bs-checkbox-bg-selected-hover);
154
+ border-color: var(--bs-checkbox-border-selected-hover);
155
+ }
156
+
157
+ .bs-checkbox__box--error {
158
+ border-color: var(--bs-checkbox-border-error);
159
+ }
160
+
161
+ .bs-checkbox__box--error.bs-checkbox__box--selected {
162
+ background: var(--bs-checkbox-bg-selected-error);
163
+ border-color: var(--bs-checkbox-border-selected-error);
164
+ }
165
+
166
+ .bs-checkbox__box--disabled {
167
+ background: var(--bs-checkbox-bg-disabled);
168
+ border-color: var(--bs-checkbox-border-disabled);
169
+ color: var(--bs-checkbox-icon-color-disabled);
170
+ }
171
+
172
+ .bs-checkbox__box--disabled.bs-checkbox__box--selected {
173
+ background: var(--bs-checkbox-bg-disabled);
174
+ border-color: var(--bs-checkbox-border-disabled);
175
+ }
176
+
177
+ .bs-checkbox__icon {
178
+ width: 80%;
179
+ height: 80%;
180
+ }
181
+
182
+ .bs-checkbox__label {
183
+ font-size: var(--bs-font-size-sm);
184
+ color: var(--bs-checkbox-label-color);
185
+ }
186
+
187
+ .bs-checkbox--disabled .bs-checkbox__label {
188
+ color: var(--bs-checkbox-label-color-disabled);
189
+ }
190
+
191
+ .bs-checkbox:not(.bs-checkbox--disabled) .bs-checkbox__box--error ~ .bs-checkbox__label {
192
+ color: var(--bs-checkbox-label-color-error);
193
+ }
@@ -0,0 +1,234 @@
1
+ import { h } from "@stencil/core";
2
+ /**
3
+ * A single checkbox with its label, for a binary choice or one item within a group of independent
4
+ * choices.
5
+ *
6
+ * ## When to use
7
+ * - A single standalone binary setting (e.g. "Remember me", "I agree to the terms").
8
+ * - One item within a set of independent, non-exclusive choices (a checkbox group/list).
9
+ * - `indeterminate` for a "select all" checkbox representing a partially-selected group.
10
+ *
11
+ * ## When not to use
12
+ * - A single mutually-exclusive choice from a set -- use a radio group instead.
13
+ * - An on/off setting that takes effect immediately (no explicit form submission) -- use `bs-switch`.
14
+ *
15
+ * @slot - Default slot: the label text.
16
+ * @part box - The visual checkbox square.
17
+ * @part icon - The check/minus icon shown inside the box when `checked` or `indeterminate`.
18
+ * @part label - The label text wrapper.
19
+ */
20
+ // Note: this component's CSS Custom Properties (--bs-checkbox-*) are documented via @prop comments
21
+ // in bs-checkbox.css, not here -- Stencil's docs generator only parses @prop out of CSS file
22
+ // comments, not the class-level JSDoc (see bs-input.tsx's equivalent note).
23
+ export class BsCheckbox {
24
+ el;
25
+ inputEl;
26
+ /** Sizing scale. Controls the box's width/height and border width; corner radius is constant
27
+ * across all sizes. */
28
+ size = 'lg';
29
+ /** Whether the checkbox is checked. Mutable so clicking the label/input toggles it directly.
30
+ * When `indeterminate` is also true, `indeterminate` wins visually (shows the minus icon)
31
+ * regardless of this value -- same as native checkboxes. */
32
+ checked = false;
33
+ /** Whether the checkbox is in the indeterminate ("partially selected") state -- shows a minus
34
+ * icon instead of a check, and takes visual precedence over `checked`. Unlike `checked`, native
35
+ * checkboxes have no `indeterminate` HTML attribute; it can only be set as a JS property on the
36
+ * element. This `@Prop` still works as an attribute for the *host* (`<bs-checkbox>`) since that's
37
+ * this component's own reflected state, not the native control's -- the native `<input>` inside
38
+ * has its `.indeterminate` property set imperatively in `componentDidLoad`/`componentDidUpdate`. */
39
+ indeterminate = false;
40
+ /** Disables the checkbox: sets the native `disabled` attribute, suppresses hover/focus styling,
41
+ * and prevents toggling. */
42
+ disabled = false;
43
+ /** Applies the error border/label-color treatment. This component's spec has no error message
44
+ * text of its own (unlike `bs-input`'s `error: string`), so it's a plain boolean. */
45
+ error = false;
46
+ /** Emitted when the checked state changes via user interaction, with the new `checked` value. */
47
+ bsChange;
48
+ /** Keeps the native input's `.indeterminate` JS property in sync -- this can't be expressed as a
49
+ * JSX attribute in Stencil, it must be set imperatively on the element. */
50
+ onIndeterminateChange() {
51
+ if (this.inputEl) {
52
+ this.inputEl.indeterminate = this.indeterminate;
53
+ }
54
+ }
55
+ componentDidLoad() {
56
+ if (this.inputEl) {
57
+ this.inputEl.indeterminate = this.indeterminate;
58
+ }
59
+ }
60
+ componentDidUpdate() {
61
+ if (this.inputEl) {
62
+ this.inputEl.indeterminate = this.indeterminate;
63
+ }
64
+ }
65
+ onChange = (ev) => {
66
+ const checked = ev.target.checked;
67
+ this.checked = checked;
68
+ // Clicking a native checkbox always clears indeterminate, regardless of what it was before --
69
+ // match that here so the visual state (icon) tracks the real native behavior.
70
+ this.indeterminate = false;
71
+ this.bsChange.emit(checked);
72
+ };
73
+ render() {
74
+ const showIcon = this.checked || this.indeterminate;
75
+ const boxClasses = [
76
+ 'bs-checkbox__box',
77
+ `bs-checkbox__box--${this.size}`,
78
+ showIcon ? 'bs-checkbox__box--selected' : '',
79
+ this.disabled ? 'bs-checkbox__box--disabled' : '',
80
+ this.error ? 'bs-checkbox__box--error' : '',
81
+ ]
82
+ .filter(Boolean)
83
+ .join(' ');
84
+ return (h("label", { key: 'a5cae53f4a82545ce4f9146891ad3a24c90ad2cf', class: `bs-checkbox ${this.disabled ? 'bs-checkbox--disabled' : ''}` }, h("input", { key: 'b9e40a9c3347bcb8517474209febd048bd853e25', ref: el => (this.inputEl = el), class: "bs-checkbox__input", type: "checkbox", checked: this.checked, disabled: this.disabled, "aria-checked": this.indeterminate ? 'mixed' : String(this.checked), onChange: this.onChange }), h("span", { key: '60af78d14456f4cb65d6e9e7aa54f4b4bce84cfe', part: "box", class: boxClasses }, showIcon && (h("svg", { key: '5c64f14f979b866a71290584931f994fc485fb70', part: "icon", class: "bs-checkbox__icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, this.indeterminate ? (h("path", { d: "M3 8H13", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })) : (h("path", { d: "M3 8.5L6.2 11.5L13 4.5", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))))), h("span", { key: 'd0993da246362d50fc924e8e6e9e9465cbec631f', part: "label", class: "bs-checkbox__label" }, h("slot", { key: '719bb1f6c842f9a482f2672490f5df1025090d87' }))));
85
+ }
86
+ static get is() { return "bs-checkbox"; }
87
+ static get encapsulation() { return "shadow"; }
88
+ static get delegatesFocus() { return true; }
89
+ static get originalStyleUrls() {
90
+ return {
91
+ "$": ["bs-checkbox.css"]
92
+ };
93
+ }
94
+ static get styleUrls() {
95
+ return {
96
+ "$": ["bs-checkbox.css"]
97
+ };
98
+ }
99
+ static get properties() {
100
+ return {
101
+ "size": {
102
+ "type": "string",
103
+ "mutable": false,
104
+ "complexType": {
105
+ "original": "BsCheckboxSize",
106
+ "resolved": "\"lg\" | \"md\" | \"sm\"",
107
+ "references": {
108
+ "BsCheckboxSize": {
109
+ "location": "local",
110
+ "path": "/Users/vivka/brandsync-web-components/src/components/bs-checkbox/bs-checkbox.tsx",
111
+ "id": "src/components/bs-checkbox/bs-checkbox.tsx::BsCheckboxSize"
112
+ }
113
+ }
114
+ },
115
+ "required": false,
116
+ "optional": false,
117
+ "docs": {
118
+ "tags": [],
119
+ "text": "Sizing scale. Controls the box's width/height and border width; corner radius is constant\nacross all sizes."
120
+ },
121
+ "getter": false,
122
+ "setter": false,
123
+ "reflect": false,
124
+ "attribute": "size",
125
+ "defaultValue": "'lg'"
126
+ },
127
+ "checked": {
128
+ "type": "boolean",
129
+ "mutable": true,
130
+ "complexType": {
131
+ "original": "boolean",
132
+ "resolved": "boolean",
133
+ "references": {}
134
+ },
135
+ "required": false,
136
+ "optional": false,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": "Whether the checkbox is checked. Mutable so clicking the label/input toggles it directly.\nWhen `indeterminate` is also true, `indeterminate` wins visually (shows the minus icon)\nregardless of this value -- same as native checkboxes."
140
+ },
141
+ "getter": false,
142
+ "setter": false,
143
+ "reflect": true,
144
+ "attribute": "checked",
145
+ "defaultValue": "false"
146
+ },
147
+ "indeterminate": {
148
+ "type": "boolean",
149
+ "mutable": true,
150
+ "complexType": {
151
+ "original": "boolean",
152
+ "resolved": "boolean",
153
+ "references": {}
154
+ },
155
+ "required": false,
156
+ "optional": false,
157
+ "docs": {
158
+ "tags": [],
159
+ "text": "Whether the checkbox is in the indeterminate (\"partially selected\") state -- shows a minus\nicon instead of a check, and takes visual precedence over `checked`. Unlike `checked`, native\ncheckboxes have no `indeterminate` HTML attribute; it can only be set as a JS property on the\nelement. This `@Prop` still works as an attribute for the *host* (`<bs-checkbox>`) since that's\nthis component's own reflected state, not the native control's -- the native `<input>` inside\nhas its `.indeterminate` property set imperatively in `componentDidLoad`/`componentDidUpdate`."
160
+ },
161
+ "getter": false,
162
+ "setter": false,
163
+ "reflect": true,
164
+ "attribute": "indeterminate",
165
+ "defaultValue": "false"
166
+ },
167
+ "disabled": {
168
+ "type": "boolean",
169
+ "mutable": false,
170
+ "complexType": {
171
+ "original": "boolean",
172
+ "resolved": "boolean",
173
+ "references": {}
174
+ },
175
+ "required": false,
176
+ "optional": false,
177
+ "docs": {
178
+ "tags": [],
179
+ "text": "Disables the checkbox: sets the native `disabled` attribute, suppresses hover/focus styling,\nand prevents toggling."
180
+ },
181
+ "getter": false,
182
+ "setter": false,
183
+ "reflect": false,
184
+ "attribute": "disabled",
185
+ "defaultValue": "false"
186
+ },
187
+ "error": {
188
+ "type": "boolean",
189
+ "mutable": false,
190
+ "complexType": {
191
+ "original": "boolean",
192
+ "resolved": "boolean",
193
+ "references": {}
194
+ },
195
+ "required": false,
196
+ "optional": false,
197
+ "docs": {
198
+ "tags": [],
199
+ "text": "Applies the error border/label-color treatment. This component's spec has no error message\ntext of its own (unlike `bs-input`'s `error: string`), so it's a plain boolean."
200
+ },
201
+ "getter": false,
202
+ "setter": false,
203
+ "reflect": false,
204
+ "attribute": "error",
205
+ "defaultValue": "false"
206
+ }
207
+ };
208
+ }
209
+ static get events() {
210
+ return [{
211
+ "method": "bsChange",
212
+ "name": "bsChange",
213
+ "bubbles": true,
214
+ "cancelable": true,
215
+ "composed": true,
216
+ "docs": {
217
+ "tags": [],
218
+ "text": "Emitted when the checked state changes via user interaction, with the new `checked` value."
219
+ },
220
+ "complexType": {
221
+ "original": "boolean",
222
+ "resolved": "boolean",
223
+ "references": {}
224
+ }
225
+ }];
226
+ }
227
+ static get elementRef() { return "el"; }
228
+ static get watchers() {
229
+ return [{
230
+ "propName": "indeterminate",
231
+ "methodName": "onIndeterminateChange"
232
+ }];
233
+ }
234
+ }