@brandsync/wc 0.0.4 → 0.0.6
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 +203 -2
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/p-1dc6d7f5.entry.js +1 -0
- package/dist/brandsync-wc/{p-ea705742.entry.js → p-4a0da8e9.entry.js} +1 -1
- package/dist/brandsync-wc/p-4d999a8d.entry.js +1 -0
- package/dist/brandsync-wc/p-518b02bf.entry.js +1 -0
- package/dist/brandsync-wc/p-6648d251.entry.js +1 -0
- package/dist/cjs/brandsync-wc.cjs.js +1 -1
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +30 -4
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +25 -0
- package/dist/cjs/bs-input.cjs.entry.js +2 -2
- package/dist/cjs/bs-menu-item.cjs.entry.js +29 -0
- package/dist/cjs/bs-menu.cjs.entry.js +17 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.cmp.test.js +43 -2
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.css +13 -0
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +70 -6
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.stories.js +96 -0
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.cmp.test.js +24 -0
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.css +57 -0
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +104 -0
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.stories.js +30 -0
- package/dist/collection/components/bs-input/bs-input.js +2 -2
- package/dist/collection/components/bs-menu/bs-menu.cmp.test.js +18 -0
- package/dist/collection/components/bs-menu/bs-menu.css +20 -0
- package/dist/collection/components/bs-menu/bs-menu.js +39 -0
- package/dist/collection/components/bs-menu/bs-menu.stories.js +15 -0
- package/dist/collection/components/bs-menu-item/bs-menu-item.cmp.test.js +33 -0
- package/dist/collection/components/bs-menu-item/bs-menu-item.css +68 -0
- package/dist/collection/components/bs-menu-item/bs-menu-item.js +79 -0
- package/dist/collection/components/bs-menu-item/bs-menu-item.stories.js +37 -0
- package/dist/components/bs-chatbot-response-action.js +1 -1
- package/dist/components/bs-chatbot-suggestion-button.d.ts +11 -0
- package/dist/components/bs-chatbot-suggestion-button.js +1 -0
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-menu-item.d.ts +11 -0
- package/dist/components/bs-menu-item.js +1 -0
- package/dist/components/bs-menu.d.ts +11 -0
- package/dist/components/bs-menu.js +1 -0
- package/dist/esm/brandsync-wc.js +1 -1
- package/dist/esm/bs-chatbot-response-action.entry.js +31 -5
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +23 -0
- package/dist/esm/bs-input.entry.js +2 -2
- package/dist/esm/bs-menu-item.entry.js +27 -0
- package/dist/esm/bs-menu.entry.js +15 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/bs-chatbot-response-action/bs-chatbot-response-action.d.ts +16 -2
- package/dist/types/components/bs-chatbot-response-action/bs-chatbot-response-action.stories.d.ts +1 -0
- package/dist/types/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.d.ts +46 -0
- package/dist/types/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.stories.d.ts +10 -0
- package/dist/types/components/bs-menu/bs-menu.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-menu/bs-menu.d.ts +24 -0
- package/dist/types/components/bs-menu/bs-menu.stories.d.ts +5 -0
- package/dist/types/components/bs-menu-item/bs-menu-item.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-menu-item/bs-menu-item.d.ts +38 -0
- package/dist/types/components/bs-menu-item/bs-menu-item.stories.d.ts +7 -0
- package/dist/types/components.d.ts +364 -3
- package/package.json +2 -1
- package/dist/brandsync-wc/p-4ce458bf.entry.js +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-nLORuTUY.js';
|
|
2
|
+
|
|
3
|
+
const bsMenuCss = () => `:host{display:block;--bs-menu-bg:var(--bs-surface-raised);--bs-menu-radius:var(--bs-border-radius-100);--bs-menu-padding-y:var(--bs-spacing-50);--bs-menu-gap:var(--bs-spacing-50);--bs-menu-shadow:var(--bs-shadow-sm)}.bs-menu{box-sizing:border-box;display:flex;flex-direction:column;gap:var(--bs-menu-gap);background:var(--bs-menu-bg);border-radius:var(--bs-menu-radius);padding:var(--bs-menu-padding-y) 0;box-shadow:var(--bs-menu-shadow);font-family:inherit}`;
|
|
4
|
+
|
|
5
|
+
const BsMenu = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h("div", { key: 'e5008951228aa528404f810fe9ce90a5ee7298b1', part: "list", class: "bs-menu", role: "menu" }, h("slot", { key: 'd2e590cf51f626bd22dce58535fbea81291f9068' })));
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
BsMenu.style = bsMenuCss();
|
|
14
|
+
|
|
15
|
+
export { BsMenu as bs_menu };
|
package/dist/esm/loader.js
CHANGED
|
@@ -4,7 +4,7 @@ export { s as setNonce } from './index-nLORuTUY.js';
|
|
|
4
4
|
const defineCustomElements = async (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
6
|
await globalScripts();
|
|
7
|
-
return bootstrapLazy([["bs-badge",[[769,"bs-badge",{"variant":[1]}]]],["bs-button",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-header",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-chatbot-response-action",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"]}]]],["bs-composer",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"]}]]],["bs-data-table",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-input",[[529,"bs-input",{"value":[1],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4]}]]],["bs-modal",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]]], options);
|
|
7
|
+
return bootstrapLazy([["bs-badge",[[769,"bs-badge",{"variant":[1]}]]],["bs-button",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-header",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-chatbot-response-action",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"],"menuOpen":[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["bs-chatbot-suggestion-button",[[769,"bs-chatbot-suggestion-button",{"disabled":[4]}]]],["bs-composer",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"]}]]],["bs-data-table",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-input",[[529,"bs-input",{"value":[1],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4]}]]],["bs-menu",[[257,"bs-menu"]]],["bs-menu-item",[[769,"bs-menu-item",{"hasIcon":[32]}]]],["bs-modal",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]]], options);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { defineCustomElements };
|
|
@@ -16,6 +16,8 @@ import { EventEmitter } from '../../stencil-public-runtime';
|
|
|
16
16
|
* @slot copy-icon - Overrides the default "Copy" button icon.
|
|
17
17
|
* @slot regenerate-icon - Overrides the default "Regenerate" button icon.
|
|
18
18
|
* @slot menu-icon - Overrides the default "More options" button icon.
|
|
19
|
+
* @slot menu - A `bs-menu` (or other content) rendered in a popup positioned below the "More
|
|
20
|
+
* options" button, shown only while `menuOpen` is `true`.
|
|
19
21
|
* @slot sources-icon - Overrides the default icon in the "N sources" button.
|
|
20
22
|
* @part like - The "Like" icon button.
|
|
21
23
|
* @part dislike - The "Dislike" icon button.
|
|
@@ -39,12 +41,20 @@ import { EventEmitter } from '../../stencil-public-runtime';
|
|
|
39
41
|
* @prop --bs-chatbot-response-action-sources-line-height - Aliased to `--bs-line-height-body-sm`.
|
|
40
42
|
*/
|
|
41
43
|
export declare class BsChatbotResponseAction {
|
|
44
|
+
host: HTMLElement;
|
|
42
45
|
/**
|
|
43
46
|
* Number of sources backing the response. When set to a positive number, renders the "N
|
|
44
47
|
* sources" button (singular "1 source" / plural "N sources"). When unset or `0`, the button is
|
|
45
48
|
* not rendered at all.
|
|
46
49
|
*/
|
|
47
50
|
sourcesCount?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the "more options" popup menu (the `menu` slot) is currently open. Mutable + reflected
|
|
53
|
+
* so the component can track/close itself (kebab click, click outside, Escape) the same way
|
|
54
|
+
* `bs-chatbot-header`'s `expanded` prop tracks its own toggle state, while still emitting
|
|
55
|
+
* `bsMenuOpen` for the consumer to react to.
|
|
56
|
+
*/
|
|
57
|
+
menuOpen: boolean;
|
|
48
58
|
/** Fires when the "Like" button is clicked. */
|
|
49
59
|
bsLike: EventEmitter<void>;
|
|
50
60
|
/** Fires when the "Dislike" button is clicked. */
|
|
@@ -53,8 +63,9 @@ export declare class BsChatbotResponseAction {
|
|
|
53
63
|
bsCopy: EventEmitter<void>;
|
|
54
64
|
/** Fires when the "Regenerate" button is clicked. */
|
|
55
65
|
bsRegenerate: EventEmitter<void>;
|
|
56
|
-
/** Fires when the "More options" button is clicked
|
|
57
|
-
|
|
66
|
+
/** Fires when the "More options" button is clicked or the menu is closed (click outside,
|
|
67
|
+
* Escape), with the new `menuOpen` value. */
|
|
68
|
+
bsMenuOpen: EventEmitter<boolean>;
|
|
58
69
|
/** Fires when the "N sources" button is clicked. */
|
|
59
70
|
bsSourcesClick: EventEmitter<void>;
|
|
60
71
|
private onLikeClick;
|
|
@@ -62,6 +73,9 @@ export declare class BsChatbotResponseAction {
|
|
|
62
73
|
private onCopyClick;
|
|
63
74
|
private onRegenerateClick;
|
|
64
75
|
private onMenuClick;
|
|
76
|
+
private closeMenu;
|
|
77
|
+
onDocumentClick(ev: MouseEvent): void;
|
|
78
|
+
onKeydown(ev: KeyboardEvent): void;
|
|
65
79
|
private onSourcesClick;
|
|
66
80
|
render(): any;
|
|
67
81
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* A pill-shaped clickable suggestion chip for a Genie AI chat panel (e.g. "How can I help you?").
|
|
4
|
+
*
|
|
5
|
+
* One instance renders one chip -- to show several suggestion prompts side by side, render
|
|
6
|
+
* multiple `bs-chatbot-suggestion-button` elements inside a plain flex-wrap container; this
|
|
7
|
+
* library doesn't ship a separate list/group component for that since a `<div>` with
|
|
8
|
+
* `flex-wrap: wrap` is sufficient.
|
|
9
|
+
*
|
|
10
|
+
* ## When to use
|
|
11
|
+
* - Quick-reply/starter prompts shown above or alongside `bs-composer` in a Genie AI chat panel.
|
|
12
|
+
*
|
|
13
|
+
* ## When not to use
|
|
14
|
+
* - As a general-purpose button -- use `bs-button` instead, this component's pill shape and
|
|
15
|
+
* tonal color treatment are specific to Genie chat suggestion prompts.
|
|
16
|
+
*
|
|
17
|
+
* @slot - Default slot: the suggestion's label text.
|
|
18
|
+
* @part button - The button element.
|
|
19
|
+
* @prop --bs-chatbot-suggestion-button-radius - Corner radius. Aliased to `--bs-border-radius-full`.
|
|
20
|
+
* @prop --bs-chatbot-suggestion-button-border-color - Border color. Aliased to `--bs-border-primary`.
|
|
21
|
+
* @prop --bs-chatbot-suggestion-button-bg-default - Background in the default (enabled) state.
|
|
22
|
+
* Aliased to `--bs-color-primary-container`.
|
|
23
|
+
* @prop --bs-chatbot-suggestion-button-bg-hover - Background on hover. Aliased to
|
|
24
|
+
* `--bs-color-primary-container-hover`.
|
|
25
|
+
* @prop --bs-chatbot-suggestion-button-bg-pressed - Background when pressed. Aliased directly to
|
|
26
|
+
* the primitive `--bs-brand-200` -- there's no pre-built semantic "container-pressed" token
|
|
27
|
+
* matching this tonal button's lighter pressed shade progression (50 -> 100 -> 200), so this
|
|
28
|
+
* component aliases one locally (same situation `bs-button.css` documents for its
|
|
29
|
+
* subtle/outlined/success/warning/info variants).
|
|
30
|
+
* @prop --bs-chatbot-suggestion-button-bg-focus - Background when focused. Aliased to
|
|
31
|
+
* `--bs-color-primary-container-hover` (same as hover).
|
|
32
|
+
* @prop --bs-chatbot-suggestion-button-text-default - Text color in the default state. Aliased to
|
|
33
|
+
* `--bs-text-action`.
|
|
34
|
+
* @prop --bs-chatbot-suggestion-button-text-hover - Text color on hover, pressed, and focus.
|
|
35
|
+
* Aliased to `--bs-text-action-hover`.
|
|
36
|
+
* @prop --bs-chatbot-suggestion-button-focus-ring-color - Focus ring color. Aliased to
|
|
37
|
+
* `--bs-border-primary-focus`.
|
|
38
|
+
*/
|
|
39
|
+
export declare class BsChatbotSuggestionButton {
|
|
40
|
+
/** Disables the button and applies a reduced-opacity treatment. */
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
/** Fires when the button is clicked. */
|
|
43
|
+
bsSelect: EventEmitter<void>;
|
|
44
|
+
private onClick;
|
|
45
|
+
render(): any;
|
|
46
|
+
}
|
package/dist/types/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.stories.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
interface BsChatbotSuggestionButtonArgs {
|
|
3
|
+
label: string;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const meta: Meta<BsChatbotSuggestionButtonArgs>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<BsChatbotSuggestionButtonArgs>;
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
export declare const SuggestionRow: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A generic dropdown/popup menu container: a rounded, elevated list of items (typically
|
|
3
|
+
* `bs-menu-item` elements).
|
|
4
|
+
*
|
|
5
|
+
* ## When to use
|
|
6
|
+
* - A popup list of actions/options triggered by another control (e.g. a "more options" kebab
|
|
7
|
+
* button), such as `bs-chatbot-response-action`'s `menu` slot.
|
|
8
|
+
*
|
|
9
|
+
* ## When not to use
|
|
10
|
+
* - A persistent, always-visible list of options -- this component is purpose-built as a popup
|
|
11
|
+
* surface (rounded corners, elevation shadow), not a plain list.
|
|
12
|
+
*
|
|
13
|
+
* @slot - Default slot: the menu's items (typically `bs-menu-item` elements, though anything can
|
|
14
|
+
* be slotted in -- this component doesn't restrict slot content via JS).
|
|
15
|
+
* @part list - The rounded, elevated box wrapping the slotted items.
|
|
16
|
+
* @prop --bs-menu-bg - Background of the menu box. Aliased to `--bs-surface-raised`.
|
|
17
|
+
* @prop --bs-menu-radius - Corner radius of the menu box. Aliased to `--bs-border-radius-100`.
|
|
18
|
+
* @prop --bs-menu-padding-y - Top/bottom padding of the menu box. Aliased to `--bs-spacing-50`.
|
|
19
|
+
* @prop --bs-menu-gap - Gap between slotted items. Aliased to `--bs-spacing-50`.
|
|
20
|
+
* @prop --bs-menu-shadow - Elevation shadow of the menu box. Aliased to `--bs-shadow-sm`.
|
|
21
|
+
*/
|
|
22
|
+
export declare class BsMenu {
|
|
23
|
+
render(): any;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* A single selectable row inside a `bs-menu`: an optional icon plus a text label, rendered as a
|
|
4
|
+
* real `<button>` for correct keyboard/click semantics.
|
|
5
|
+
*
|
|
6
|
+
* ## When to use
|
|
7
|
+
* - As a child of `bs-menu`, one per selectable action/option.
|
|
8
|
+
*
|
|
9
|
+
* ## When not to use
|
|
10
|
+
* - Outside of `bs-menu` -- this component's sizing/hover treatment is designed to sit inside the
|
|
11
|
+
* menu's rounded, padded list box.
|
|
12
|
+
*
|
|
13
|
+
* @slot icon - Optional leading icon (24x24). When left empty, no icon space is reserved.
|
|
14
|
+
* @slot - Default slot: the item's text label.
|
|
15
|
+
* @part item - The button element.
|
|
16
|
+
* @part icon - The icon wrapper.
|
|
17
|
+
* @part label - The label wrapper.
|
|
18
|
+
* @prop --bs-menu-item-radius - Corner radius of the row. Aliased to `--bs-border-radius-100`.
|
|
19
|
+
* @prop --bs-menu-item-padding-y - Top/bottom padding. Aliased to `--bs-spacing-100`.
|
|
20
|
+
* @prop --bs-menu-item-padding-x - Left/right padding. Aliased to `--bs-spacing-150`.
|
|
21
|
+
* @prop --bs-menu-item-gap - Gap between icon and label. Aliased to `--bs-spacing-100`.
|
|
22
|
+
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container`.
|
|
23
|
+
* @prop --bs-menu-item-pressed - Background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
24
|
+
* @prop --bs-menu-item-icon-color - Icon color. Aliased to `--bs-icon-default`.
|
|
25
|
+
* @prop --bs-menu-item-color - Label text color. Aliased to `--bs-text-muted`.
|
|
26
|
+
* @prop --bs-menu-item-font-size - Aliased to `--bs-font-size-md`.
|
|
27
|
+
* @prop --bs-menu-item-line-height - Aliased to `--bs-line-height-body-md`.
|
|
28
|
+
*/
|
|
29
|
+
export declare class BsMenuItem {
|
|
30
|
+
/** Tracks whether the `icon` slot has assigned content, so the icon wrapper (and its gap) only
|
|
31
|
+
* renders when there's actually an icon to show. */
|
|
32
|
+
hasIcon: boolean;
|
|
33
|
+
/** Fires when the item is clicked. */
|
|
34
|
+
bsSelect: EventEmitter<void>;
|
|
35
|
+
private onIconSlotchange;
|
|
36
|
+
private onClick;
|
|
37
|
+
render(): any;
|
|
38
|
+
}
|