@brandsync/wc 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +297 -1
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/{p-e38a9744.entry.js → p-27288299.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c2cc0d6f.entry.js → p-2742ecef.entry.js} +1 -1
- package/dist/brandsync-wc/p-4ce458bf.entry.js +1 -0
- package/dist/brandsync-wc/p-6c1fa4da.entry.js +1 -0
- package/dist/brandsync-wc/{p-da11e421.entry.js → p-880ea3f8.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2c4df28d.entry.js → p-9e5d2211.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3134f5f5.entry.js → p-ab5cc7af.entry.js} +1 -1
- package/dist/brandsync-wc/p-b24c455f.entry.js +1 -0
- package/dist/brandsync-wc/{p-5739acaf.entry.js → p-cfc3421b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-db3934d2.entry.js → p-ea705742.entry.js} +1 -1
- package/dist/brandsync-wc/{p-BOj_41o9.js → p-nLORuTUY.js} +2 -2
- package/dist/cjs/brandsync-wc.cjs.js +2 -2
- package/dist/cjs/bs-badge.cjs.entry.js +1 -1
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/bs-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-card.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +144 -0
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +66 -0
- package/dist/cjs/bs-composer.cjs.entry.js +2 -2
- package/dist/cjs/bs-data-table.cjs.entry.js +3 -3
- package/dist/cjs/bs-input.cjs.entry.js +3 -3
- package/dist/cjs/bs-modal.cjs.entry.js +1 -1
- package/dist/cjs/{index-nyOcuVbF.js → index-CVh-sqA_.js} +3 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.cmp.test.js +94 -0
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.css +81 -0
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +194 -0
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.stories.js +53 -0
- package/dist/collection/components/bs-chatbot-header/genie-logo.js +86 -0
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.cmp.test.js +133 -0
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.css +107 -0
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +216 -0
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.stories.js +33 -0
- package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +13 -0
- package/dist/collection/components/bs-composer/bs-composer.js +11 -1
- package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
- package/dist/collection/components/bs-input/bs-input.js +2 -2
- package/dist/components/bs-badge.js +1 -1
- package/dist/components/bs-button-skeleton.js +1 -1
- package/dist/components/bs-button.js +1 -1
- package/dist/components/bs-card.js +1 -1
- package/dist/components/bs-chatbot-header.d.ts +11 -0
- package/dist/components/bs-chatbot-header.js +1 -0
- package/dist/components/bs-chatbot-response-action.d.ts +11 -0
- package/dist/components/bs-chatbot-response-action.js +1 -0
- package/dist/components/bs-composer.js +1 -1
- package/dist/components/bs-data-table.js +1 -1
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-modal.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-Cu4gTknX.js → p-BpvhHQSw.js} +1 -1
- package/dist/esm/brandsync-wc.js +3 -3
- package/dist/esm/bs-badge.entry.js +1 -1
- package/dist/esm/bs-button-skeleton.entry.js +2 -2
- package/dist/esm/bs-button.entry.js +1 -1
- package/dist/esm/bs-card.entry.js +1 -1
- package/dist/esm/bs-chatbot-header.entry.js +142 -0
- package/dist/esm/bs-chatbot-response-action.entry.js +64 -0
- package/dist/esm/bs-composer.entry.js +2 -2
- package/dist/esm/bs-data-table.entry.js +3 -3
- package/dist/esm/bs-input.entry.js +3 -3
- package/dist/esm/bs-modal.entry.js +1 -1
- package/dist/esm/{index-BOj_41o9.js → index-nLORuTUY.js} +3 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/bs-chatbot-header/bs-chatbot-header.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chatbot-header/bs-chatbot-header.d.ts +59 -0
- package/dist/types/components/bs-chatbot-header/bs-chatbot-header.stories.d.ts +9 -0
- package/dist/types/components/bs-chatbot-header/genie-logo.d.ts +1 -0
- package/dist/types/components/bs-chatbot-response-action/bs-chatbot-response-action.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chatbot-response-action/bs-chatbot-response-action.d.ts +67 -0
- package/dist/types/components/bs-chatbot-response-action/bs-chatbot-response-action.stories.d.ts +10 -0
- package/dist/types/components/bs-composer/bs-composer.d.ts +10 -0
- package/dist/types/components.d.ts +335 -0
- package/package.json +2 -1
- package/readme.md +38 -0
- package/dist/brandsync-wc/p-042ad15a.entry.js +0 -1
|
@@ -123,6 +123,68 @@ export namespace Components {
|
|
|
123
123
|
*/
|
|
124
124
|
"surface": BsCardSurface;
|
|
125
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* The header bar that sits above `bs-composer` in a Genie AI chat panel: the Genie brand mark on
|
|
128
|
+
* the left and four fixed actions (new chat, history, expand, close) on the right.
|
|
129
|
+
* ## When to use
|
|
130
|
+
* - The top bar of a Genie AI chat panel, directly above a `bs-composer`.
|
|
131
|
+
* ## When not to use
|
|
132
|
+
* - A generic app/page header — this component's layout and actions are purpose-built for the
|
|
133
|
+
* Genie chat panel, not a general navigation bar.
|
|
134
|
+
* @prop --bs-chatbot-header-bg - Background of the header bar. Aliased to `--bs-surface-base`.
|
|
135
|
+
* @prop --bs-chatbot-header-border - Bottom border color. Aliased to `--bs-border-default`.
|
|
136
|
+
* @prop --bs-chatbot-header-padding-top - Aliased to `--bs-spacing-200`.
|
|
137
|
+
* @prop --bs-chatbot-header-padding-bottom - Aliased to `--bs-spacing-100`.
|
|
138
|
+
* @prop --bs-chatbot-header-padding-x - Aliased to `--bs-margin-fluid`.
|
|
139
|
+
* @prop --bs-chatbot-header-gap - Gap between the logo and the button group. Aliased to `--bs-navigation-header-gap`.
|
|
140
|
+
* @prop --bs-chatbot-header-button-size - Width/height of each icon button. Aliased to `--bs-spacing-600`.
|
|
141
|
+
* @prop --bs-chatbot-header-button-radius - Corner radius of each icon button. Aliased to `--bs-border-radius-100`.
|
|
142
|
+
* @prop --bs-chatbot-header-button-hover - Icon button background on hover. Aliased to `--bs-color-neutral-container`.
|
|
143
|
+
* @prop --bs-chatbot-header-button-pressed - Icon button background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
144
|
+
* @prop --bs-chatbot-header-icon - Icon color. Aliased to `--bs-icon-default`.
|
|
145
|
+
*/
|
|
146
|
+
interface BsChatbotHeader {
|
|
147
|
+
/**
|
|
148
|
+
* Whether the chat panel is currently expanded (e.g. to full viewport width/height). This component has no visibility into the surrounding layout, so it does not resize anything itself -- it only tracks and reflects the toggle state (via the `expanded` attribute, for CSS hooks, and `aria-pressed`/`aria-label` on the expand button) and emits `bsExpand` with the new value. The consuming app is responsible for actually resizing its own chat panel container in response to that event, since only the app knows what that container is.
|
|
149
|
+
* @default false
|
|
150
|
+
*/
|
|
151
|
+
"expanded": boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Accessible label for the header landmark, and alt text context for the logo image.
|
|
154
|
+
* @default 'Genie'
|
|
155
|
+
*/
|
|
156
|
+
"heading": string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The row of action buttons that appears below an AI response message in a Genie chat panel:
|
|
160
|
+
* like, dislike, copy, regenerate, and more-options icon buttons, plus an optional "N sources"
|
|
161
|
+
* button.
|
|
162
|
+
* ## When to use
|
|
163
|
+
* - Directly below an AI-generated response message in a Genie chat panel.
|
|
164
|
+
* ## When not to use
|
|
165
|
+
* - Below a user's own message -- these actions (regenerate, like/dislike a response, etc.) only
|
|
166
|
+
* make sense for AI-generated content.
|
|
167
|
+
* @prop --bs-chatbot-response-action-gap - Gap between all buttons in the row. Aliased to `--bs-spacing-100`.
|
|
168
|
+
* @prop --bs-chatbot-response-action-padding-top - Aliased to `--bs-spacing-150`.
|
|
169
|
+
* @prop --bs-chatbot-response-action-padding-bottom - Aliased to `--bs-spacing-50`.
|
|
170
|
+
* @prop --bs-chatbot-response-action-button-size - Width/height of each icon button. Aliased to `--bs-spacing-400`.
|
|
171
|
+
* @prop --bs-chatbot-response-action-button-radius - Corner radius of each button. Aliased to `--bs-border-radius-100`.
|
|
172
|
+
* @prop --bs-chatbot-response-action-button-hover - Button background on hover. Aliased to `--bs-color-neutral-container`.
|
|
173
|
+
* @prop --bs-chatbot-response-action-button-pressed - Button background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
174
|
+
* @prop --bs-chatbot-response-action-icon - Icon color. Aliased to `--bs-icon-neutral-default`.
|
|
175
|
+
* @prop --bs-chatbot-response-action-sources-gap - Gap between the sources icon and its label. Aliased to `--bs-spacing-50`.
|
|
176
|
+
* @prop --bs-chatbot-response-action-sources-padding-left - Aliased to `--bs-spacing-100`.
|
|
177
|
+
* @prop --bs-chatbot-response-action-sources-padding-right - Aliased to `--bs-spacing-150`.
|
|
178
|
+
* @prop --bs-chatbot-response-action-sources-color - Text color of the sources label. Aliased to `--bs-text-neutral-default`.
|
|
179
|
+
* @prop --bs-chatbot-response-action-sources-font-size - Aliased to `--bs-font-size-sm`.
|
|
180
|
+
* @prop --bs-chatbot-response-action-sources-line-height - Aliased to `--bs-line-height-body-sm`.
|
|
181
|
+
*/
|
|
182
|
+
interface BsChatbotResponseAction {
|
|
183
|
+
/**
|
|
184
|
+
* Number of sources backing the response. When set to a positive number, renders the "N sources" button (singular "1 source" / plural "N sources"). When unset or `0`, the button is not rendered at all.
|
|
185
|
+
*/
|
|
186
|
+
"sourcesCount"?: number;
|
|
187
|
+
}
|
|
126
188
|
/**
|
|
127
189
|
* A chat composer input for Genie AI-style conversational interfaces: a text field
|
|
128
190
|
* plus an attach button, a mic/voice-recording toggle, and a single primary action button whose
|
|
@@ -132,6 +194,11 @@ export namespace Components {
|
|
|
132
194
|
* ## When not to use
|
|
133
195
|
* - A general-purpose text field — use `bs-input` instead; this component's layout and states are
|
|
134
196
|
* purpose-built for a chat composer, not a generic form field.
|
|
197
|
+
* ## Focus
|
|
198
|
+
* Uses `shadow: { delegatesFocus: true }`, so calling `.focus()` on the `<bs-composer>` host
|
|
199
|
+
* element itself (not just its internal `<input>`) moves focus into the shadow-DOM text field --
|
|
200
|
+
* useful for e.g. focusing the composer after a parent view mounts, without reaching into its
|
|
201
|
+
* shadow root.
|
|
135
202
|
* @prop --bs-composer-radius - Corner radius of the container. Aliased to `--bs-border-radius-150`.
|
|
136
203
|
* @prop --bs-composer-button-radius - Corner radius of the attach/mic/action buttons. Aliased to `--bs-border-radius-100`.
|
|
137
204
|
* @prop --bs-composer-button-size - Width/height of the attach/mic/action buttons. Aliased to `--bs-spacing-600`.
|
|
@@ -264,6 +331,14 @@ export namespace Components {
|
|
|
264
331
|
"size": BsModalSize;
|
|
265
332
|
}
|
|
266
333
|
}
|
|
334
|
+
export interface BsChatbotHeaderCustomEvent<T> extends CustomEvent<T> {
|
|
335
|
+
detail: T;
|
|
336
|
+
target: HTMLBsChatbotHeaderElement;
|
|
337
|
+
}
|
|
338
|
+
export interface BsChatbotResponseActionCustomEvent<T> extends CustomEvent<T> {
|
|
339
|
+
detail: T;
|
|
340
|
+
target: HTMLBsChatbotResponseActionElement;
|
|
341
|
+
}
|
|
267
342
|
export interface BsComposerCustomEvent<T> extends CustomEvent<T> {
|
|
268
343
|
detail: T;
|
|
269
344
|
target: HTMLBsComposerElement;
|
|
@@ -360,6 +435,92 @@ declare global {
|
|
|
360
435
|
prototype: HTMLBsCardElement;
|
|
361
436
|
new (): HTMLBsCardElement;
|
|
362
437
|
};
|
|
438
|
+
interface HTMLBsChatbotHeaderElementEventMap {
|
|
439
|
+
"bsNewChat": void;
|
|
440
|
+
"bsHistory": void;
|
|
441
|
+
"bsExpand": boolean;
|
|
442
|
+
"bsClose": void;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* The header bar that sits above `bs-composer` in a Genie AI chat panel: the Genie brand mark on
|
|
446
|
+
* the left and four fixed actions (new chat, history, expand, close) on the right.
|
|
447
|
+
* ## When to use
|
|
448
|
+
* - The top bar of a Genie AI chat panel, directly above a `bs-composer`.
|
|
449
|
+
* ## When not to use
|
|
450
|
+
* - A generic app/page header — this component's layout and actions are purpose-built for the
|
|
451
|
+
* Genie chat panel, not a general navigation bar.
|
|
452
|
+
* @prop --bs-chatbot-header-bg - Background of the header bar. Aliased to `--bs-surface-base`.
|
|
453
|
+
* @prop --bs-chatbot-header-border - Bottom border color. Aliased to `--bs-border-default`.
|
|
454
|
+
* @prop --bs-chatbot-header-padding-top - Aliased to `--bs-spacing-200`.
|
|
455
|
+
* @prop --bs-chatbot-header-padding-bottom - Aliased to `--bs-spacing-100`.
|
|
456
|
+
* @prop --bs-chatbot-header-padding-x - Aliased to `--bs-margin-fluid`.
|
|
457
|
+
* @prop --bs-chatbot-header-gap - Gap between the logo and the button group. Aliased to `--bs-navigation-header-gap`.
|
|
458
|
+
* @prop --bs-chatbot-header-button-size - Width/height of each icon button. Aliased to `--bs-spacing-600`.
|
|
459
|
+
* @prop --bs-chatbot-header-button-radius - Corner radius of each icon button. Aliased to `--bs-border-radius-100`.
|
|
460
|
+
* @prop --bs-chatbot-header-button-hover - Icon button background on hover. Aliased to `--bs-color-neutral-container`.
|
|
461
|
+
* @prop --bs-chatbot-header-button-pressed - Icon button background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
462
|
+
* @prop --bs-chatbot-header-icon - Icon color. Aliased to `--bs-icon-default`.
|
|
463
|
+
*/
|
|
464
|
+
interface HTMLBsChatbotHeaderElement extends Components.BsChatbotHeader, HTMLStencilElement {
|
|
465
|
+
addEventListener<K extends keyof HTMLBsChatbotHeaderElementEventMap>(type: K, listener: (this: HTMLBsChatbotHeaderElement, ev: BsChatbotHeaderCustomEvent<HTMLBsChatbotHeaderElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
466
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
467
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
468
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
469
|
+
removeEventListener<K extends keyof HTMLBsChatbotHeaderElementEventMap>(type: K, listener: (this: HTMLBsChatbotHeaderElement, ev: BsChatbotHeaderCustomEvent<HTMLBsChatbotHeaderElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
470
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
471
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
472
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
473
|
+
}
|
|
474
|
+
var HTMLBsChatbotHeaderElement: {
|
|
475
|
+
prototype: HTMLBsChatbotHeaderElement;
|
|
476
|
+
new (): HTMLBsChatbotHeaderElement;
|
|
477
|
+
};
|
|
478
|
+
interface HTMLBsChatbotResponseActionElementEventMap {
|
|
479
|
+
"bsLike": void;
|
|
480
|
+
"bsDislike": void;
|
|
481
|
+
"bsCopy": void;
|
|
482
|
+
"bsRegenerate": void;
|
|
483
|
+
"bsMenuOpen": void;
|
|
484
|
+
"bsSourcesClick": void;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* The row of action buttons that appears below an AI response message in a Genie chat panel:
|
|
488
|
+
* like, dislike, copy, regenerate, and more-options icon buttons, plus an optional "N sources"
|
|
489
|
+
* button.
|
|
490
|
+
* ## When to use
|
|
491
|
+
* - Directly below an AI-generated response message in a Genie chat panel.
|
|
492
|
+
* ## When not to use
|
|
493
|
+
* - Below a user's own message -- these actions (regenerate, like/dislike a response, etc.) only
|
|
494
|
+
* make sense for AI-generated content.
|
|
495
|
+
* @prop --bs-chatbot-response-action-gap - Gap between all buttons in the row. Aliased to `--bs-spacing-100`.
|
|
496
|
+
* @prop --bs-chatbot-response-action-padding-top - Aliased to `--bs-spacing-150`.
|
|
497
|
+
* @prop --bs-chatbot-response-action-padding-bottom - Aliased to `--bs-spacing-50`.
|
|
498
|
+
* @prop --bs-chatbot-response-action-button-size - Width/height of each icon button. Aliased to `--bs-spacing-400`.
|
|
499
|
+
* @prop --bs-chatbot-response-action-button-radius - Corner radius of each button. Aliased to `--bs-border-radius-100`.
|
|
500
|
+
* @prop --bs-chatbot-response-action-button-hover - Button background on hover. Aliased to `--bs-color-neutral-container`.
|
|
501
|
+
* @prop --bs-chatbot-response-action-button-pressed - Button background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
502
|
+
* @prop --bs-chatbot-response-action-icon - Icon color. Aliased to `--bs-icon-neutral-default`.
|
|
503
|
+
* @prop --bs-chatbot-response-action-sources-gap - Gap between the sources icon and its label. Aliased to `--bs-spacing-50`.
|
|
504
|
+
* @prop --bs-chatbot-response-action-sources-padding-left - Aliased to `--bs-spacing-100`.
|
|
505
|
+
* @prop --bs-chatbot-response-action-sources-padding-right - Aliased to `--bs-spacing-150`.
|
|
506
|
+
* @prop --bs-chatbot-response-action-sources-color - Text color of the sources label. Aliased to `--bs-text-neutral-default`.
|
|
507
|
+
* @prop --bs-chatbot-response-action-sources-font-size - Aliased to `--bs-font-size-sm`.
|
|
508
|
+
* @prop --bs-chatbot-response-action-sources-line-height - Aliased to `--bs-line-height-body-sm`.
|
|
509
|
+
*/
|
|
510
|
+
interface HTMLBsChatbotResponseActionElement extends Components.BsChatbotResponseAction, HTMLStencilElement {
|
|
511
|
+
addEventListener<K extends keyof HTMLBsChatbotResponseActionElementEventMap>(type: K, listener: (this: HTMLBsChatbotResponseActionElement, ev: BsChatbotResponseActionCustomEvent<HTMLBsChatbotResponseActionElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
512
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
513
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
514
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
515
|
+
removeEventListener<K extends keyof HTMLBsChatbotResponseActionElementEventMap>(type: K, listener: (this: HTMLBsChatbotResponseActionElement, ev: BsChatbotResponseActionCustomEvent<HTMLBsChatbotResponseActionElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
516
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
517
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
518
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
519
|
+
}
|
|
520
|
+
var HTMLBsChatbotResponseActionElement: {
|
|
521
|
+
prototype: HTMLBsChatbotResponseActionElement;
|
|
522
|
+
new (): HTMLBsChatbotResponseActionElement;
|
|
523
|
+
};
|
|
363
524
|
interface HTMLBsComposerElementEventMap {
|
|
364
525
|
"bsInput": string;
|
|
365
526
|
"bsSubmit": void;
|
|
@@ -377,6 +538,11 @@ declare global {
|
|
|
377
538
|
* ## When not to use
|
|
378
539
|
* - A general-purpose text field — use `bs-input` instead; this component's layout and states are
|
|
379
540
|
* purpose-built for a chat composer, not a generic form field.
|
|
541
|
+
* ## Focus
|
|
542
|
+
* Uses `shadow: { delegatesFocus: true }`, so calling `.focus()` on the `<bs-composer>` host
|
|
543
|
+
* element itself (not just its internal `<input>`) moves focus into the shadow-DOM text field --
|
|
544
|
+
* useful for e.g. focusing the composer after a parent view mounts, without reaching into its
|
|
545
|
+
* shadow root.
|
|
380
546
|
* @prop --bs-composer-radius - Corner radius of the container. Aliased to `--bs-border-radius-150`.
|
|
381
547
|
* @prop --bs-composer-button-radius - Corner radius of the attach/mic/action buttons. Aliased to `--bs-border-radius-100`.
|
|
382
548
|
* @prop --bs-composer-button-size - Width/height of the attach/mic/action buttons. Aliased to `--bs-spacing-600`.
|
|
@@ -498,6 +664,8 @@ declare global {
|
|
|
498
664
|
"bs-button": HTMLBsButtonElement;
|
|
499
665
|
"bs-button-skeleton": HTMLBsButtonSkeletonElement;
|
|
500
666
|
"bs-card": HTMLBsCardElement;
|
|
667
|
+
"bs-chatbot-header": HTMLBsChatbotHeaderElement;
|
|
668
|
+
"bs-chatbot-response-action": HTMLBsChatbotResponseActionElement;
|
|
501
669
|
"bs-composer": HTMLBsComposerElement;
|
|
502
670
|
"bs-data-table": HTMLBsDataTableElement;
|
|
503
671
|
"bs-input": HTMLBsInputElement;
|
|
@@ -608,6 +776,108 @@ declare namespace LocalJSX {
|
|
|
608
776
|
*/
|
|
609
777
|
"surface"?: BsCardSurface;
|
|
610
778
|
}
|
|
779
|
+
/**
|
|
780
|
+
* The header bar that sits above `bs-composer` in a Genie AI chat panel: the Genie brand mark on
|
|
781
|
+
* the left and four fixed actions (new chat, history, expand, close) on the right.
|
|
782
|
+
* ## When to use
|
|
783
|
+
* - The top bar of a Genie AI chat panel, directly above a `bs-composer`.
|
|
784
|
+
* ## When not to use
|
|
785
|
+
* - A generic app/page header — this component's layout and actions are purpose-built for the
|
|
786
|
+
* Genie chat panel, not a general navigation bar.
|
|
787
|
+
* @prop --bs-chatbot-header-bg - Background of the header bar. Aliased to `--bs-surface-base`.
|
|
788
|
+
* @prop --bs-chatbot-header-border - Bottom border color. Aliased to `--bs-border-default`.
|
|
789
|
+
* @prop --bs-chatbot-header-padding-top - Aliased to `--bs-spacing-200`.
|
|
790
|
+
* @prop --bs-chatbot-header-padding-bottom - Aliased to `--bs-spacing-100`.
|
|
791
|
+
* @prop --bs-chatbot-header-padding-x - Aliased to `--bs-margin-fluid`.
|
|
792
|
+
* @prop --bs-chatbot-header-gap - Gap between the logo and the button group. Aliased to `--bs-navigation-header-gap`.
|
|
793
|
+
* @prop --bs-chatbot-header-button-size - Width/height of each icon button. Aliased to `--bs-spacing-600`.
|
|
794
|
+
* @prop --bs-chatbot-header-button-radius - Corner radius of each icon button. Aliased to `--bs-border-radius-100`.
|
|
795
|
+
* @prop --bs-chatbot-header-button-hover - Icon button background on hover. Aliased to `--bs-color-neutral-container`.
|
|
796
|
+
* @prop --bs-chatbot-header-button-pressed - Icon button background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
797
|
+
* @prop --bs-chatbot-header-icon - Icon color. Aliased to `--bs-icon-default`.
|
|
798
|
+
*/
|
|
799
|
+
interface BsChatbotHeader {
|
|
800
|
+
/**
|
|
801
|
+
* Whether the chat panel is currently expanded (e.g. to full viewport width/height). This component has no visibility into the surrounding layout, so it does not resize anything itself -- it only tracks and reflects the toggle state (via the `expanded` attribute, for CSS hooks, and `aria-pressed`/`aria-label` on the expand button) and emits `bsExpand` with the new value. The consuming app is responsible for actually resizing its own chat panel container in response to that event, since only the app knows what that container is.
|
|
802
|
+
* @default false
|
|
803
|
+
*/
|
|
804
|
+
"expanded"?: boolean;
|
|
805
|
+
/**
|
|
806
|
+
* Accessible label for the header landmark, and alt text context for the logo image.
|
|
807
|
+
* @default 'Genie'
|
|
808
|
+
*/
|
|
809
|
+
"heading"?: string;
|
|
810
|
+
/**
|
|
811
|
+
* Fires when the "Close" button is clicked.
|
|
812
|
+
*/
|
|
813
|
+
"onBsClose"?: (event: BsChatbotHeaderCustomEvent<void>) => void;
|
|
814
|
+
/**
|
|
815
|
+
* Fires when the "Expand"/"Collapse" button is clicked, with the new `expanded` value.
|
|
816
|
+
*/
|
|
817
|
+
"onBsExpand"?: (event: BsChatbotHeaderCustomEvent<boolean>) => void;
|
|
818
|
+
/**
|
|
819
|
+
* Fires when the "History" button is clicked.
|
|
820
|
+
*/
|
|
821
|
+
"onBsHistory"?: (event: BsChatbotHeaderCustomEvent<void>) => void;
|
|
822
|
+
/**
|
|
823
|
+
* Fires when the "New chat" button is clicked.
|
|
824
|
+
*/
|
|
825
|
+
"onBsNewChat"?: (event: BsChatbotHeaderCustomEvent<void>) => void;
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* The row of action buttons that appears below an AI response message in a Genie chat panel:
|
|
829
|
+
* like, dislike, copy, regenerate, and more-options icon buttons, plus an optional "N sources"
|
|
830
|
+
* button.
|
|
831
|
+
* ## When to use
|
|
832
|
+
* - Directly below an AI-generated response message in a Genie chat panel.
|
|
833
|
+
* ## When not to use
|
|
834
|
+
* - Below a user's own message -- these actions (regenerate, like/dislike a response, etc.) only
|
|
835
|
+
* make sense for AI-generated content.
|
|
836
|
+
* @prop --bs-chatbot-response-action-gap - Gap between all buttons in the row. Aliased to `--bs-spacing-100`.
|
|
837
|
+
* @prop --bs-chatbot-response-action-padding-top - Aliased to `--bs-spacing-150`.
|
|
838
|
+
* @prop --bs-chatbot-response-action-padding-bottom - Aliased to `--bs-spacing-50`.
|
|
839
|
+
* @prop --bs-chatbot-response-action-button-size - Width/height of each icon button. Aliased to `--bs-spacing-400`.
|
|
840
|
+
* @prop --bs-chatbot-response-action-button-radius - Corner radius of each button. Aliased to `--bs-border-radius-100`.
|
|
841
|
+
* @prop --bs-chatbot-response-action-button-hover - Button background on hover. Aliased to `--bs-color-neutral-container`.
|
|
842
|
+
* @prop --bs-chatbot-response-action-button-pressed - Button background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
843
|
+
* @prop --bs-chatbot-response-action-icon - Icon color. Aliased to `--bs-icon-neutral-default`.
|
|
844
|
+
* @prop --bs-chatbot-response-action-sources-gap - Gap between the sources icon and its label. Aliased to `--bs-spacing-50`.
|
|
845
|
+
* @prop --bs-chatbot-response-action-sources-padding-left - Aliased to `--bs-spacing-100`.
|
|
846
|
+
* @prop --bs-chatbot-response-action-sources-padding-right - Aliased to `--bs-spacing-150`.
|
|
847
|
+
* @prop --bs-chatbot-response-action-sources-color - Text color of the sources label. Aliased to `--bs-text-neutral-default`.
|
|
848
|
+
* @prop --bs-chatbot-response-action-sources-font-size - Aliased to `--bs-font-size-sm`.
|
|
849
|
+
* @prop --bs-chatbot-response-action-sources-line-height - Aliased to `--bs-line-height-body-sm`.
|
|
850
|
+
*/
|
|
851
|
+
interface BsChatbotResponseAction {
|
|
852
|
+
/**
|
|
853
|
+
* Fires when the "Copy" button is clicked.
|
|
854
|
+
*/
|
|
855
|
+
"onBsCopy"?: (event: BsChatbotResponseActionCustomEvent<void>) => void;
|
|
856
|
+
/**
|
|
857
|
+
* Fires when the "Dislike" button is clicked.
|
|
858
|
+
*/
|
|
859
|
+
"onBsDislike"?: (event: BsChatbotResponseActionCustomEvent<void>) => void;
|
|
860
|
+
/**
|
|
861
|
+
* Fires when the "Like" button is clicked.
|
|
862
|
+
*/
|
|
863
|
+
"onBsLike"?: (event: BsChatbotResponseActionCustomEvent<void>) => void;
|
|
864
|
+
/**
|
|
865
|
+
* Fires when the "More options" button is clicked.
|
|
866
|
+
*/
|
|
867
|
+
"onBsMenuOpen"?: (event: BsChatbotResponseActionCustomEvent<void>) => void;
|
|
868
|
+
/**
|
|
869
|
+
* Fires when the "Regenerate" button is clicked.
|
|
870
|
+
*/
|
|
871
|
+
"onBsRegenerate"?: (event: BsChatbotResponseActionCustomEvent<void>) => void;
|
|
872
|
+
/**
|
|
873
|
+
* Fires when the "N sources" button is clicked.
|
|
874
|
+
*/
|
|
875
|
+
"onBsSourcesClick"?: (event: BsChatbotResponseActionCustomEvent<void>) => void;
|
|
876
|
+
/**
|
|
877
|
+
* Number of sources backing the response. When set to a positive number, renders the "N sources" button (singular "1 source" / plural "N sources"). When unset or `0`, the button is not rendered at all.
|
|
878
|
+
*/
|
|
879
|
+
"sourcesCount"?: number;
|
|
880
|
+
}
|
|
611
881
|
/**
|
|
612
882
|
* A chat composer input for Genie AI-style conversational interfaces: a text field
|
|
613
883
|
* plus an attach button, a mic/voice-recording toggle, and a single primary action button whose
|
|
@@ -617,6 +887,11 @@ declare namespace LocalJSX {
|
|
|
617
887
|
* ## When not to use
|
|
618
888
|
* - A general-purpose text field — use `bs-input` instead; this component's layout and states are
|
|
619
889
|
* purpose-built for a chat composer, not a generic form field.
|
|
890
|
+
* ## Focus
|
|
891
|
+
* Uses `shadow: { delegatesFocus: true }`, so calling `.focus()` on the `<bs-composer>` host
|
|
892
|
+
* element itself (not just its internal `<input>`) moves focus into the shadow-DOM text field --
|
|
893
|
+
* useful for e.g. focusing the composer after a parent view mounts, without reaching into its
|
|
894
|
+
* shadow root.
|
|
620
895
|
* @prop --bs-composer-radius - Corner radius of the container. Aliased to `--bs-border-radius-150`.
|
|
621
896
|
* @prop --bs-composer-button-radius - Corner radius of the attach/mic/action buttons. Aliased to `--bs-border-radius-100`.
|
|
622
897
|
* @prop --bs-composer-button-size - Width/height of the attach/mic/action buttons. Aliased to `--bs-spacing-600`.
|
|
@@ -794,6 +1069,13 @@ declare namespace LocalJSX {
|
|
|
794
1069
|
interface BsCardAttributes {
|
|
795
1070
|
"surface": BsCardSurface;
|
|
796
1071
|
}
|
|
1072
|
+
interface BsChatbotHeaderAttributes {
|
|
1073
|
+
"heading": string;
|
|
1074
|
+
"expanded": boolean;
|
|
1075
|
+
}
|
|
1076
|
+
interface BsChatbotResponseActionAttributes {
|
|
1077
|
+
"sourcesCount": number;
|
|
1078
|
+
}
|
|
797
1079
|
interface BsComposerAttributes {
|
|
798
1080
|
"variant": BsComposerVariant;
|
|
799
1081
|
"placeholder": string;
|
|
@@ -826,6 +1108,8 @@ declare namespace LocalJSX {
|
|
|
826
1108
|
"bs-button": Omit<BsButton, keyof BsButtonAttributes> & { [K in keyof BsButton & keyof BsButtonAttributes]?: BsButton[K] } & { [K in keyof BsButton & keyof BsButtonAttributes as `attr:${K}`]?: BsButtonAttributes[K] } & { [K in keyof BsButton & keyof BsButtonAttributes as `prop:${K}`]?: BsButton[K] };
|
|
827
1109
|
"bs-button-skeleton": Omit<BsButtonSkeleton, keyof BsButtonSkeletonAttributes> & { [K in keyof BsButtonSkeleton & keyof BsButtonSkeletonAttributes]?: BsButtonSkeleton[K] } & { [K in keyof BsButtonSkeleton & keyof BsButtonSkeletonAttributes as `attr:${K}`]?: BsButtonSkeletonAttributes[K] } & { [K in keyof BsButtonSkeleton & keyof BsButtonSkeletonAttributes as `prop:${K}`]?: BsButtonSkeleton[K] };
|
|
828
1110
|
"bs-card": Omit<BsCard, keyof BsCardAttributes> & { [K in keyof BsCard & keyof BsCardAttributes]?: BsCard[K] } & { [K in keyof BsCard & keyof BsCardAttributes as `attr:${K}`]?: BsCardAttributes[K] } & { [K in keyof BsCard & keyof BsCardAttributes as `prop:${K}`]?: BsCard[K] };
|
|
1111
|
+
"bs-chatbot-header": Omit<BsChatbotHeader, keyof BsChatbotHeaderAttributes> & { [K in keyof BsChatbotHeader & keyof BsChatbotHeaderAttributes]?: BsChatbotHeader[K] } & { [K in keyof BsChatbotHeader & keyof BsChatbotHeaderAttributes as `attr:${K}`]?: BsChatbotHeaderAttributes[K] } & { [K in keyof BsChatbotHeader & keyof BsChatbotHeaderAttributes as `prop:${K}`]?: BsChatbotHeader[K] };
|
|
1112
|
+
"bs-chatbot-response-action": Omit<BsChatbotResponseAction, keyof BsChatbotResponseActionAttributes> & { [K in keyof BsChatbotResponseAction & keyof BsChatbotResponseActionAttributes]?: BsChatbotResponseAction[K] } & { [K in keyof BsChatbotResponseAction & keyof BsChatbotResponseActionAttributes as `attr:${K}`]?: BsChatbotResponseActionAttributes[K] } & { [K in keyof BsChatbotResponseAction & keyof BsChatbotResponseActionAttributes as `prop:${K}`]?: BsChatbotResponseAction[K] };
|
|
829
1113
|
"bs-composer": Omit<BsComposer, keyof BsComposerAttributes> & { [K in keyof BsComposer & keyof BsComposerAttributes]?: BsComposer[K] } & { [K in keyof BsComposer & keyof BsComposerAttributes as `attr:${K}`]?: BsComposerAttributes[K] } & { [K in keyof BsComposer & keyof BsComposerAttributes as `prop:${K}`]?: BsComposer[K] };
|
|
830
1114
|
"bs-data-table": Omit<BsDataTable, keyof BsDataTableAttributes> & { [K in keyof BsDataTable & keyof BsDataTableAttributes]?: BsDataTable[K] } & { [K in keyof BsDataTable & keyof BsDataTableAttributes as `attr:${K}`]?: BsDataTableAttributes[K] } & { [K in keyof BsDataTable & keyof BsDataTableAttributes as `prop:${K}`]?: BsDataTable[K] };
|
|
831
1115
|
"bs-input": Omit<BsInput, keyof BsInputAttributes> & { [K in keyof BsInput & keyof BsInputAttributes]?: BsInput[K] } & { [K in keyof BsInput & keyof BsInputAttributes as `attr:${K}`]?: BsInputAttributes[K] } & { [K in keyof BsInput & keyof BsInputAttributes as `prop:${K}`]?: BsInput[K] };
|
|
@@ -895,6 +1179,52 @@ declare module "@stencil/core" {
|
|
|
895
1179
|
* - For a dismissible/transient message — use a modal or a dedicated notification component.
|
|
896
1180
|
*/
|
|
897
1181
|
"bs-card": LocalJSX.IntrinsicElements["bs-card"] & JSXBase.HTMLAttributes<HTMLBsCardElement>;
|
|
1182
|
+
/**
|
|
1183
|
+
* The header bar that sits above `bs-composer` in a Genie AI chat panel: the Genie brand mark on
|
|
1184
|
+
* the left and four fixed actions (new chat, history, expand, close) on the right.
|
|
1185
|
+
* ## When to use
|
|
1186
|
+
* - The top bar of a Genie AI chat panel, directly above a `bs-composer`.
|
|
1187
|
+
* ## When not to use
|
|
1188
|
+
* - A generic app/page header — this component's layout and actions are purpose-built for the
|
|
1189
|
+
* Genie chat panel, not a general navigation bar.
|
|
1190
|
+
* @prop --bs-chatbot-header-bg - Background of the header bar. Aliased to `--bs-surface-base`.
|
|
1191
|
+
* @prop --bs-chatbot-header-border - Bottom border color. Aliased to `--bs-border-default`.
|
|
1192
|
+
* @prop --bs-chatbot-header-padding-top - Aliased to `--bs-spacing-200`.
|
|
1193
|
+
* @prop --bs-chatbot-header-padding-bottom - Aliased to `--bs-spacing-100`.
|
|
1194
|
+
* @prop --bs-chatbot-header-padding-x - Aliased to `--bs-margin-fluid`.
|
|
1195
|
+
* @prop --bs-chatbot-header-gap - Gap between the logo and the button group. Aliased to `--bs-navigation-header-gap`.
|
|
1196
|
+
* @prop --bs-chatbot-header-button-size - Width/height of each icon button. Aliased to `--bs-spacing-600`.
|
|
1197
|
+
* @prop --bs-chatbot-header-button-radius - Corner radius of each icon button. Aliased to `--bs-border-radius-100`.
|
|
1198
|
+
* @prop --bs-chatbot-header-button-hover - Icon button background on hover. Aliased to `--bs-color-neutral-container`.
|
|
1199
|
+
* @prop --bs-chatbot-header-button-pressed - Icon button background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
1200
|
+
* @prop --bs-chatbot-header-icon - Icon color. Aliased to `--bs-icon-default`.
|
|
1201
|
+
*/
|
|
1202
|
+
"bs-chatbot-header": LocalJSX.IntrinsicElements["bs-chatbot-header"] & JSXBase.HTMLAttributes<HTMLBsChatbotHeaderElement>;
|
|
1203
|
+
/**
|
|
1204
|
+
* The row of action buttons that appears below an AI response message in a Genie chat panel:
|
|
1205
|
+
* like, dislike, copy, regenerate, and more-options icon buttons, plus an optional "N sources"
|
|
1206
|
+
* button.
|
|
1207
|
+
* ## When to use
|
|
1208
|
+
* - Directly below an AI-generated response message in a Genie chat panel.
|
|
1209
|
+
* ## When not to use
|
|
1210
|
+
* - Below a user's own message -- these actions (regenerate, like/dislike a response, etc.) only
|
|
1211
|
+
* make sense for AI-generated content.
|
|
1212
|
+
* @prop --bs-chatbot-response-action-gap - Gap between all buttons in the row. Aliased to `--bs-spacing-100`.
|
|
1213
|
+
* @prop --bs-chatbot-response-action-padding-top - Aliased to `--bs-spacing-150`.
|
|
1214
|
+
* @prop --bs-chatbot-response-action-padding-bottom - Aliased to `--bs-spacing-50`.
|
|
1215
|
+
* @prop --bs-chatbot-response-action-button-size - Width/height of each icon button. Aliased to `--bs-spacing-400`.
|
|
1216
|
+
* @prop --bs-chatbot-response-action-button-radius - Corner radius of each button. Aliased to `--bs-border-radius-100`.
|
|
1217
|
+
* @prop --bs-chatbot-response-action-button-hover - Button background on hover. Aliased to `--bs-color-neutral-container`.
|
|
1218
|
+
* @prop --bs-chatbot-response-action-button-pressed - Button background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
1219
|
+
* @prop --bs-chatbot-response-action-icon - Icon color. Aliased to `--bs-icon-neutral-default`.
|
|
1220
|
+
* @prop --bs-chatbot-response-action-sources-gap - Gap between the sources icon and its label. Aliased to `--bs-spacing-50`.
|
|
1221
|
+
* @prop --bs-chatbot-response-action-sources-padding-left - Aliased to `--bs-spacing-100`.
|
|
1222
|
+
* @prop --bs-chatbot-response-action-sources-padding-right - Aliased to `--bs-spacing-150`.
|
|
1223
|
+
* @prop --bs-chatbot-response-action-sources-color - Text color of the sources label. Aliased to `--bs-text-neutral-default`.
|
|
1224
|
+
* @prop --bs-chatbot-response-action-sources-font-size - Aliased to `--bs-font-size-sm`.
|
|
1225
|
+
* @prop --bs-chatbot-response-action-sources-line-height - Aliased to `--bs-line-height-body-sm`.
|
|
1226
|
+
*/
|
|
1227
|
+
"bs-chatbot-response-action": LocalJSX.IntrinsicElements["bs-chatbot-response-action"] & JSXBase.HTMLAttributes<HTMLBsChatbotResponseActionElement>;
|
|
898
1228
|
/**
|
|
899
1229
|
* A chat composer input for Genie AI-style conversational interfaces: a text field
|
|
900
1230
|
* plus an attach button, a mic/voice-recording toggle, and a single primary action button whose
|
|
@@ -904,6 +1234,11 @@ declare module "@stencil/core" {
|
|
|
904
1234
|
* ## When not to use
|
|
905
1235
|
* - A general-purpose text field — use `bs-input` instead; this component's layout and states are
|
|
906
1236
|
* purpose-built for a chat composer, not a generic form field.
|
|
1237
|
+
* ## Focus
|
|
1238
|
+
* Uses `shadow: { delegatesFocus: true }`, so calling `.focus()` on the `<bs-composer>` host
|
|
1239
|
+
* element itself (not just its internal `<input>`) moves focus into the shadow-DOM text field --
|
|
1240
|
+
* useful for e.g. focusing the composer after a parent view mounts, without reaching into its
|
|
1241
|
+
* shadow root.
|
|
907
1242
|
* @prop --bs-composer-radius - Corner radius of the container. Aliased to `--bs-border-radius-150`.
|
|
908
1243
|
* @prop --bs-composer-button-radius - Corner radius of the attach/mic/action buttons. Aliased to `--bs-border-radius-100`.
|
|
909
1244
|
* @prop --bs-composer-button-size - Width/height of the attach/mic/action buttons. Aliased to `--bs-spacing-600`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brandsync/wc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@stencil/core": "^4.27.1 || ^5.0.0-0",
|
|
53
53
|
"@stencil/react-output-target": "^1.6.2",
|
|
54
54
|
"@stencil/vitest": "^1.8.3",
|
|
55
|
+
"@storybook/addon-a11y": "^10.5.8",
|
|
55
56
|
"@storybook/addon-docs": "^10.5.8",
|
|
56
57
|
"@storybook/web-components-vite": "^10.5.8",
|
|
57
58
|
"@types/node": "^22.13.5",
|
package/readme.md
CHANGED
|
@@ -46,3 +46,41 @@ import '@brandsync/wc/dist/components/bs-button.js';
|
|
|
46
46
|
|
|
47
47
|
React and Angular get auto-generated wrapper packages (`@stencil/react-output-target` /
|
|
48
48
|
`@stencil/angular-output-target`) built from the same source — see `stencil.config.ts`.
|
|
49
|
+
|
|
50
|
+
## Design tokens — required, not optional
|
|
51
|
+
|
|
52
|
+
Every component's shadow-DOM CSS is written entirely against `--bs-*` custom properties
|
|
53
|
+
(`--bs-input-bg-default`, `--bs-composer-button-size`, `--bs-spacing-150`, ...). **This package does
|
|
54
|
+
not inject those variables anywhere** -- it only *consumes* them. If the consuming app hasn't
|
|
55
|
+
defined them, every `var(--bs-something)` (none of these declarations have a fallback) resolves to
|
|
56
|
+
its CSS-invalid-at-computed-value fallback: `border: none`, `background: transparent`,
|
|
57
|
+
`width`/`height`/`padding`/`gap: 0`, browser-default `font-size`. The component still renders in
|
|
58
|
+
the DOM -- it just silently collapses (no visible border/box, buttons shrink to nothing, text
|
|
59
|
+
fields push onto their own line) with no console error or exception pointing at the missing
|
|
60
|
+
tokens, which makes it a confusing first bug to debug.
|
|
61
|
+
|
|
62
|
+
Fix: load the token stylesheet this package ships (vendored from `brandsync-tokens`) once,
|
|
63
|
+
globally, in the consuming app -- **before** any `bs-*` element renders:
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
/* e.g. src/styles.css / global.css / angular.json "styles" array */
|
|
67
|
+
@import '@brandsync/wc/dist/brandsync-wc/brandsync-wc.css';
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<!-- plain HTML/CDN consumption -->
|
|
72
|
+
<link rel="stylesheet" href="https://unpkg.com/@brandsync/wc/dist/brandsync-wc/brandsync-wc.css">
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This applies identically to the HTML/CDN path, npm+bundler path, and the React/Angular wrapper
|
|
76
|
+
packages -- none of them auto-inject it. If a consuming app already has its own differently-named
|
|
77
|
+
design tokens (e.g. `--surface-base` instead of `--bs-color-surface-base`), that app-level token
|
|
78
|
+
file does **not** satisfy this requirement even if the values match conceptually -- the shadow-DOM
|
|
79
|
+
CSS only resolves `--bs-*`-prefixed names, so the vendored stylesheet above must be loaded
|
|
80
|
+
regardless.
|
|
81
|
+
|
|
82
|
+
Known harmless noise: the vendored `brandsync-wc.css` currently contains a handful of malformed
|
|
83
|
+
token declarations from an upstream `brandsync-tokens` export step (e.g.
|
|
84
|
+
`--bs-5-brand-colors-jade-brand-700: {Brand Colors.teal.700};`), which some build tools (e.g.
|
|
85
|
+
Angular's CSS budget/lint step) warn about. These are pre-existing in the vendored dependency, not
|
|
86
|
+
introduced by this package, and don't affect any token this library actually uses.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as s,h as r}from"./p-BOj_41o9.js";const e={ai:"Ask Genie something...",human:"Message your support agent..."},t=[6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,18,14,34,22,22,10,28,18,12,24,6,20,30,14,8,26,16,32,10,22,18,12,28,8,20,14,24,10,16,30,12,22,6,18,26,8,14,32,20,10,24,6],i=class{constructor(r){o(this,r),this.bsInput=s(this,"bsInput"),this.bsSubmit=s(this,"bsSubmit"),this.bsStop=s(this,"bsStop"),this.bsVoiceConfirm=s(this,"bsVoiceConfirm"),this.bsAttach=s(this,"bsAttach"),this.bsMicToggle=s(this,"bsMicToggle")}variant="ai";placeholder;value="";state="idle";ariaLabel=null;bsInput;bsSubmit;bsStop;bsVoiceConfirm;bsAttach;bsMicToggle;onInput=o=>{this.bsInput.emit(o.target.value)};onAttachClick=()=>{this.bsAttach.emit()};onMicClick=()=>{this.bsMicToggle.emit()};onActionClick=()=>{"idle"===this.state?this.bsSubmit.emit():"generating"===this.state?this.bsStop.emit():"recording"===this.state&&this.bsVoiceConfirm.emit()};actionLabel(){return"generating"===this.state?"Stop":"recording"===this.state?"Confirm":"Send"}renderActionIcon(){return r("generating"===this.state?b:"recording"===this.state?d:n,null)}render(){const o="disabled"===this.state,s="recording"===this.state;return r("div",{key:"785b4da8ddb23f4762ac7ea379b3ecdaa9584f40",class:`bs-composer bs-composer--${this.state} bs-composer--${this.variant}`},r("div",{key:"5b470cc47221f93ce9852ebaeaf9a35d740d5df1",class:"bs-composer__text-row"},r("input",{key:"3f4093d98bc0a0ba8440da9fec1d5cb2e302b746",part:"input",class:"bs-composer__input",type:"text",value:this.value,placeholder:this.placeholder??e[this.variant],disabled:o,"aria-label":this.ariaLabel,onInput:this.onInput})),r("div",{key:"21103c8d6ac108e705487f670aeb4aaf89d45981",class:"bs-composer__controls-row"},r("button",{key:"570ef86150f5b0072008fb0215ed1f0affac7af4",type:"button",part:"attach",class:"bs-composer__attach","aria-label":"Attach",onClick:this.onAttachClick},r(a,{key:"ea030569c8b5d2bafaae3ecfe29b956a54921f34"})),s?r("span",{class:"bs-composer__waveform","aria-hidden":"true"},t.map((o=>r("span",{class:"bs-composer__waveform-bar",style:{"--bs-composer-bar-height":`${o}px`}})))):r("span",{class:"bs-composer__spacer"}),r("button",{key:"1906485b13395c9c730f7091176dab4e81ecbcb9",type:"button",part:"mic",class:"bs-composer__mic "+(s?"bs-composer__mic--recording":""),"aria-label":s?"Stop recording":"Start voice input",disabled:o,onClick:this.onMicClick},r(s?b:c,null)),r("button",{key:"3486957673a3bbf7c3dbac41fd5c19e8dbb6258a",type:"button",part:"action",class:`bs-composer__action bs-composer__action--${this.state}`,"aria-label":this.actionLabel(),disabled:o,onClick:this.onActionClick},this.renderActionIcon())))}static get delegatesFocus(){return!0}},a=()=>r("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},r("path",{d:"M8 2.5V13.5M2.5 8H13.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})),c=()=>r("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},r("path",{d:"M8 9.5C9.10457 9.5 10 8.60457 10 7.5V3.5C10 2.39543 9.10457 1.5 8 1.5C6.89543 1.5 6 2.39543 6 3.5V7.5C6 8.60457 6.89543 9.5 8 9.5Z",stroke:"currentColor","stroke-width":"1.4"}),r("path",{d:"M3.5 7V7.5C3.5 9.98528 5.51472 12 8 12C10.4853 12 12.5 9.98528 12.5 7.5V7",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"}),r("path",{d:"M8 12V14.5",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})),n=()=>r("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},r("path",{d:"M13.5 12H7.5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),r("path",{d:"M4.54594 20.745C4.4932 20.889 4.48589 21.0457 4.52499 21.1941C4.56409 21.3424 4.64771 21.4751 4.76459 21.5744C4.88147 21.6737 5.02599 21.7348 5.17866 21.7494C5.33133 21.7641 5.48482 21.7315 5.61844 21.6562L21.3684 12.6478C21.4857 12.583 21.5834 12.4879 21.6514 12.3725C21.7195 12.2571 21.7553 12.1255 21.7553 11.9916C21.7553 11.8576 21.7195 11.7261 21.6514 11.6107C21.5834 11.4952 21.4857 11.4002 21.3684 11.3353L5.61844 2.34937C5.48523 2.27487 5.33245 2.24278 5.18052 2.2574C5.02859 2.27201 4.88474 2.33264 4.76817 2.43117C4.65161 2.5297 4.56788 2.66145 4.52817 2.80882C4.48846 2.9562 4.49466 3.11218 4.54594 3.25594L7.5 12L4.54594 20.745Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),b=()=>r("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},r("rect",{x:"6",y:"6",width:"8",height:"8",rx:"1.5",fill:"currentColor"})),d=()=>r("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},r("path",{d:"M4.5 10.5L8 14L15.5 6",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"}));i.style=":host{display:block;--bs-composer-radius:var(--bs-border-radius-150);--bs-composer-button-radius:var(--bs-border-radius-100);--bs-composer-button-size:var(--bs-spacing-600);--bs-composer-bg:var(--bs-input-bg-default);--bs-composer-border:var(--bs-input-border-default);--bs-composer-border-focus:var(--bs-input-border-focus);--bs-composer-action-bg:var(--bs-color-primary-default);--bs-composer-action-bg-hover:var(--bs-color-primary-hover);--bs-composer-action-bg-pressed:var(--bs-color-primary-pressed);--bs-composer-action-bg-disabled:var(--bs-surface-action-disabled);--bs-composer-action-icon:var(--bs-text-on-action);--bs-composer-action-icon-disabled:var(--bs-text-on-disabled);--bs-composer-attach-icon:var(--bs-icon-default);--bs-composer-mic-icon:var(--bs-icon-default);--bs-composer-mic-icon-disabled:var(--bs-icon-disabled);--bs-composer-mic-recording-icon:var(--bs-icon-default);--bs-composer-subtle-hover:var(--bs-color-neutral-container);--bs-composer-subtle-pressed:var(--bs-color-neutral-container-pressed);--bs-composer-waveform-color:var(--bs-border-default)}.bs-composer{box-sizing:border-box;display:flex;flex-direction:column;border:1px solid var(--bs-composer-border);border-radius:var(--bs-composer-radius);background:var(--bs-composer-bg);font-family:inherit}.bs-composer--human{border-style:dashed}.bs-composer:focus-within{border-color:var(--bs-composer-border-focus)}.bs-composer__text-row{display:flex;align-items:center;gap:var(--bs-spacing-150);padding:var(--bs-spacing-150)}.bs-composer__input{flex:1;min-width:0;border:none;outline:none;background:transparent;color:var(--bs-input-text);font-family:inherit;font-size:var(--bs-font-size-md)}.bs-composer__input::placeholder{color:var(--bs-input-placeholder)}.bs-composer__input:disabled{color:var(--bs-input-text-disabled);cursor:not-allowed}.bs-composer__waveform{display:inline-flex;flex:1;min-width:0;align-items:center;justify-content:center;gap:3px;overflow:hidden}.bs-composer__waveform-bar{display:inline-block;flex-shrink:0;width:2.5px;border-radius:1.5px;background:var(--bs-composer-waveform-color);height:var(--bs-composer-bar-height, 6px)}.bs-composer__controls-row{display:flex;align-items:center;gap:var(--bs-spacing-200);padding:var(--bs-spacing-150)}.bs-composer__spacer{flex:1}.bs-composer__attach,.bs-composer__mic,.bs-composer__action{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:none;padding:0;cursor:pointer;font-family:inherit;border-radius:var(--bs-composer-button-radius);width:var(--bs-composer-button-size);height:var(--bs-composer-button-size);flex-shrink:0;transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-composer__attach:focus-visible,.bs-composer__mic:focus-visible,.bs-composer__action:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-composer__attach svg,.bs-composer__mic svg,.bs-composer__action svg{width:24px;height:24px}.bs-composer__attach,.bs-composer__mic{background:transparent}.bs-composer__attach:hover:not(:disabled),.bs-composer__mic:hover:not(:disabled){background:var(--bs-composer-subtle-hover)}.bs-composer__attach:active:not(:disabled),.bs-composer__mic:active:not(:disabled){background:var(--bs-composer-subtle-pressed)}.bs-composer__attach{color:var(--bs-composer-attach-icon)}.bs-composer__mic{color:var(--bs-composer-mic-icon)}.bs-composer__mic--recording{color:var(--bs-composer-mic-recording-icon)}.bs-composer__mic:disabled{color:var(--bs-composer-mic-icon-disabled);cursor:not-allowed}.bs-composer__action{background:var(--bs-composer-action-bg);color:var(--bs-composer-action-icon)}.bs-composer__action:hover:not(:disabled){background:var(--bs-composer-action-bg-hover)}.bs-composer__action:active:not(:disabled){background:var(--bs-composer-action-bg-pressed)}.bs-composer__action:disabled{background:var(--bs-composer-action-bg-disabled);color:var(--bs-composer-action-icon-disabled);cursor:not-allowed}";export{i as bs_composer}
|