@brandsync/wc 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1810 -355
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/p-0d64ea40.entry.js +1 -0
- package/dist/brandsync-wc/{p-c63d16e1.entry.js → p-1515498e.entry.js} +1 -1
- package/dist/brandsync-wc/p-16a54578.entry.js +1 -0
- package/dist/brandsync-wc/p-18af02df.entry.js +1 -0
- package/dist/brandsync-wc/p-30a0e168.entry.js +1 -0
- package/dist/brandsync-wc/p-3dacae70.entry.js +1 -0
- package/dist/brandsync-wc/p-5333bb5a.entry.js +1 -0
- package/dist/brandsync-wc/p-575ce905.entry.js +1 -0
- package/dist/brandsync-wc/{p-dd0fea0e.entry.js → p-7776b57b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-bfd09c98.entry.js → p-805644e4.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f88d9a6e.entry.js → p-8a78d6ea.entry.js} +1 -1
- package/dist/brandsync-wc/p-8d12ed96.entry.js +1 -0
- package/dist/brandsync-wc/p-94ed898a.entry.js +1 -0
- package/dist/brandsync-wc/{p-9e5d2211.entry.js → p-96f374be.entry.js} +1 -1
- package/dist/brandsync-wc/{p-ab5cc7af.entry.js → p-a34f460d.entry.js} +1 -1
- package/dist/brandsync-wc/p-bc72439a.entry.js +1 -0
- package/dist/brandsync-wc/{p-76eca100.entry.js → p-ce0914a7.entry.js} +1 -1
- package/dist/brandsync-wc/{p-5a0fe72e.entry.js → p-d682675e.entry.js} +1 -1
- package/dist/brandsync-wc/p-dad4a92c.entry.js +1 -0
- package/dist/brandsync-wc/{p-cfc3421b.entry.js → p-dd747a12.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2742ecef.entry.js → p-eb4d87f0.entry.js} +1 -1
- package/dist/cjs/brandsync-wc.cjs.js +1 -1
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +17 -0
- package/dist/cjs/bs-ai-greeting.cjs.entry.js +24 -0
- package/dist/cjs/bs-ai-thinking.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment-list.cjs.entry.js +47 -0
- package/dist/cjs/bs-attachment.cjs.entry.js +46 -0
- package/dist/cjs/bs-badge.cjs.entry.js +1 -1
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +1 -1
- 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-feedback.cjs.entry.js +94 -0
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +38 -0
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +43 -0
- package/dist/cjs/bs-composer.cjs.entry.js +16 -2
- package/dist/cjs/bs-data-table.cjs.entry.js +2 -2
- package/dist/cjs/bs-input.cjs.entry.js +270 -4
- package/dist/cjs/{bs-menu-item.cjs.entry.js → bs-menu_2.cjs.entry.js} +14 -1
- package/dist/cjs/bs-source-link.cjs.entry.js +39 -0
- package/dist/cjs/bs-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +8 -0
- package/dist/collection/components/bs-ai-chatbot/bs-ai-chatbot.stories.js +180 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.cmp.test.js +14 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.css +27 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +41 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.stories.js +15 -0
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.cmp.test.js +22 -0
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.css +53 -0
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +103 -0
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.stories.js +23 -0
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.css +31 -17
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +9 -11
- package/dist/collection/components/bs-attachment/bs-attachment.cmp.test.js +41 -0
- package/dist/collection/components/bs-attachment/bs-attachment.css +184 -0
- package/dist/collection/components/bs-attachment/bs-attachment.js +230 -0
- package/dist/collection/components/bs-attachment/bs-attachment.stories.js +58 -0
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.cmp.test.js +28 -0
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.css +56 -0
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +105 -0
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.stories.js +47 -0
- package/dist/collection/components/bs-badge/bs-badge.js +1 -1
- package/dist/collection/components/bs-button/bs-button.js +1 -1
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
- package/dist/collection/components/bs-card/bs-card.js +1 -1
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.cmp.test.js +73 -0
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.css +253 -0
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +324 -0
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.stories.js +54 -0
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.cmp.test.js +34 -0
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.css +106 -0
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +142 -0
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.stories.js +44 -0
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
- package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +12 -0
- package/dist/collection/components/bs-composer/bs-composer.css +10 -0
- package/dist/collection/components/bs-composer/bs-composer.js +25 -1
- package/dist/collection/components/bs-composer/bs-composer.stories.js +13 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.js +42 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.css +173 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +270 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.stories.js +75 -0
- package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
- package/dist/collection/components/bs-input/bs-input.cmp.test.js +296 -0
- package/dist/collection/components/bs-input/bs-input.css +333 -23
- package/dist/collection/components/bs-input/bs-input.js +647 -11
- package/dist/collection/components/bs-input/bs-input.stories.js +128 -1
- package/dist/collection/components/bs-menu/bs-menu.js +1 -1
- package/dist/collection/components/bs-menu-item/bs-menu-item.js +1 -1
- package/dist/collection/components/bs-source-link/bs-source-link.cmp.test.js +42 -0
- package/dist/collection/components/bs-source-link/bs-source-link.css +114 -0
- package/dist/collection/components/bs-source-link/bs-source-link.js +192 -0
- package/dist/collection/components/bs-source-link/bs-source-link.stories.js +33 -0
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/components/bs-ai-disclaimer.d.ts +11 -0
- package/dist/components/bs-ai-disclaimer.js +1 -0
- package/dist/components/bs-ai-greeting.d.ts +11 -0
- package/dist/components/bs-ai-greeting.js +1 -0
- package/dist/components/bs-ai-thinking.js +1 -1
- package/dist/components/bs-attachment-list.d.ts +11 -0
- package/dist/components/bs-attachment-list.js +1 -0
- package/dist/components/bs-attachment.d.ts +11 -0
- package/dist/components/bs-attachment.js +1 -0
- 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-feedback.d.ts +11 -0
- package/dist/components/bs-chatbot-feedback.js +1 -0
- package/dist/components/bs-chatbot-header.js +1 -1
- package/dist/components/bs-chatbot-response-action.js +1 -1
- package/dist/components/bs-chatbot-sources-drawer.d.ts +11 -0
- package/dist/components/bs-chatbot-sources-drawer.js +1 -0
- package/dist/components/bs-chatbot-suggestion-button.js +1 -1
- package/dist/components/bs-composer-status-banner.d.ts +11 -0
- package/dist/components/bs-composer-status-banner.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-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-source-link.d.ts +11 -0
- package/dist/components/bs-source-link.js +1 -0
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/{p-CoC4LQCI.js → p-Cz2nfz2j.js} +1 -1
- package/dist/components/p-DndQiCMP.js +1 -0
- package/dist/components/p-_vXDfB3V.js +1 -0
- package/dist/esm/brandsync-wc.js +1 -1
- package/dist/esm/bs-ai-disclaimer.entry.js +15 -0
- package/dist/esm/bs-ai-greeting.entry.js +22 -0
- package/dist/esm/bs-ai-thinking.entry.js +2 -2
- package/dist/esm/bs-attachment-list.entry.js +45 -0
- package/dist/esm/bs-attachment.entry.js +44 -0
- package/dist/esm/bs-badge.entry.js +1 -1
- package/dist/esm/bs-button-skeleton.entry.js +1 -1
- package/dist/esm/bs-button.entry.js +1 -1
- package/dist/esm/bs-card.entry.js +1 -1
- package/dist/esm/bs-chatbot-feedback.entry.js +92 -0
- package/dist/esm/bs-chatbot-header.entry.js +1 -1
- package/dist/esm/bs-chatbot-response-action.entry.js +1 -1
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +36 -0
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +1 -1
- package/dist/esm/bs-composer-status-banner.entry.js +41 -0
- package/dist/esm/bs-composer.entry.js +17 -3
- package/dist/esm/bs-data-table.entry.js +2 -2
- package/dist/esm/bs-input.entry.js +271 -5
- package/dist/esm/{bs-menu-item.entry.js → bs-menu_2.entry.js} +15 -3
- package/dist/esm/bs-source-link.entry.js +37 -0
- package/dist/esm/bs-tooltip.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/bs-ai-chatbot/bs-ai-chatbot.stories.d.ts +18 -0
- package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.d.ts +26 -0
- package/dist/types/components/bs-ai-disclaimer/bs-ai-disclaimer.stories.d.ts +8 -0
- package/dist/types/components/bs-ai-greeting/bs-ai-greeting.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-ai-greeting/bs-ai-greeting.d.ts +42 -0
- package/dist/types/components/bs-ai-greeting/bs-ai-greeting.stories.d.ts +10 -0
- package/dist/types/components/bs-ai-thinking/bs-ai-thinking.d.ts +8 -10
- package/dist/types/components/bs-attachment/bs-attachment.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-attachment/bs-attachment.d.ts +59 -0
- package/dist/types/components/bs-attachment/bs-attachment.stories.d.ts +17 -0
- package/dist/types/components/bs-attachment-list/bs-attachment-list.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-attachment-list/bs-attachment-list.d.ts +42 -0
- package/dist/types/components/bs-attachment-list/bs-attachment-list.stories.d.ts +10 -0
- package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.d.ts +90 -0
- package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.stories.d.ts +16 -0
- package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.d.ts +54 -0
- package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.stories.d.ts +10 -0
- package/dist/types/components/bs-composer/bs-composer.d.ts +14 -0
- package/dist/types/components/bs-composer/bs-composer.stories.d.ts +1 -0
- package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.d.ts +88 -0
- package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.stories.d.ts +20 -0
- package/dist/types/components/bs-input/bs-input.d.ts +139 -6
- package/dist/types/components/bs-input/bs-input.stories.d.ts +19 -0
- package/dist/types/components/bs-source-link/bs-source-link.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-source-link/bs-source-link.d.ts +51 -0
- package/dist/types/components/bs-source-link/bs-source-link.stories.d.ts +13 -0
- package/dist/types/components.d.ts +1778 -55
- package/package.json +1 -1
- package/dist/brandsync-wc/p-6abdfaf0.entry.js +0 -1
- package/dist/brandsync-wc/p-6c1fa4da.entry.js +0 -1
- package/dist/brandsync-wc/p-a12d0a60.entry.js +0 -1
- package/dist/brandsync-wc/p-f5f443e2.entry.js +0 -1
- package/dist/cjs/bs-menu.cjs.entry.js +0 -17
- package/dist/esm/bs-menu.entry.js +0 -15
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A full-width status banner for use directly above `bs-composer`, surfacing a message about the
|
|
4
|
+
* composer's current state (e.g. a send failure, an informational notice) with an optional
|
|
5
|
+
* "Continue"-style action button and an optional close button.
|
|
6
|
+
*
|
|
7
|
+
* ## When to use
|
|
8
|
+
* - A message tied to the composer itself (send failed, rate-limited, draft restored, etc.) that
|
|
9
|
+
* needs to sit directly above it, not a general-purpose alert -- see `CONVENTIONS.md` if this
|
|
10
|
+
* library gains a generic banner/alert component later, and prefer that instead once it exists.
|
|
11
|
+
*
|
|
12
|
+
* ## When not to use
|
|
13
|
+
* - A toast/snackbar notification unrelated to the composer -- this component is not
|
|
14
|
+
* self-dismissing and has no positioning of its own (it's a static block, not an overlay).
|
|
15
|
+
*
|
|
16
|
+
* @slot icon - Overrides the default leading icon. Only rendered when `showIcon` is true.
|
|
17
|
+
* @part icon - The leading icon wrapper.
|
|
18
|
+
* @part message - The message text.
|
|
19
|
+
* @part action - The optional "Continue"-style action button.
|
|
20
|
+
* @part close - The optional close button.
|
|
21
|
+
* @prop --bs-composer-status-banner-radius - Corner radius of the top-left/top-right corners
|
|
22
|
+
* (bottom corners are square, so this sits flush above `bs-composer`). Aliased to
|
|
23
|
+
* `--bs-border-radius-150`.
|
|
24
|
+
* @prop --bs-composer-status-banner-padding-x - Horizontal padding. Aliased to `--bs-spacing-150`.
|
|
25
|
+
* @prop --bs-composer-status-banner-padding-top - Top padding. Aliased to `--bs-spacing-100`.
|
|
26
|
+
* @prop --bs-composer-status-banner-padding-bottom - Bottom padding. Aliased to `--bs-spacing-200`.
|
|
27
|
+
* @prop --bs-composer-status-banner-gap - Gap between the message group and the action/close
|
|
28
|
+
* controls. Aliased to `--bs-spacing-100`.
|
|
29
|
+
* @prop --bs-composer-status-banner-icon-gap - Gap between the icon and the message text.
|
|
30
|
+
* Aliased to `--bs-spacing-75`.
|
|
31
|
+
* @prop --bs-composer-status-banner-error-bg - Background for `type="error"`. Aliased to
|
|
32
|
+
* `--bs-color-error-container`.
|
|
33
|
+
* @prop --bs-composer-status-banner-error-text - Text/icon color for `type="error"`. Aliased to
|
|
34
|
+
* `--bs-text-error`.
|
|
35
|
+
* @prop --bs-composer-status-banner-error-action-bg - Action button background for
|
|
36
|
+
* `type="error"`. Aliased to `--bs-color-error-default`.
|
|
37
|
+
* @prop --bs-composer-status-banner-error-action-bg-hover - Aliased to `--bs-color-error-hover`.
|
|
38
|
+
* @prop --bs-composer-status-banner-info-bg - Background for `type="info"`. Aliased to
|
|
39
|
+
* `--bs-color-info-container`.
|
|
40
|
+
* @prop --bs-composer-status-banner-info-text - Text/icon color for `type="info"`. Aliased to
|
|
41
|
+
* `--bs-text-info`.
|
|
42
|
+
* @prop --bs-composer-status-banner-info-action-bg - Action button background for `type="info"`.
|
|
43
|
+
* Aliased to `--bs-color-info-default`.
|
|
44
|
+
* @prop --bs-composer-status-banner-info-action-bg-hover - Aliased to `--bs-color-info-hover`.
|
|
45
|
+
* @prop --bs-composer-status-banner-neutral-bg - Background for `type="neutral"`. Aliased to
|
|
46
|
+
* `--bs-color-neutral-container`.
|
|
47
|
+
* @prop --bs-composer-status-banner-neutral-text - Text/icon color for `type="neutral"`. Aliased
|
|
48
|
+
* to `--bs-text-default`.
|
|
49
|
+
* @prop --bs-composer-status-banner-neutral-action-bg - Action button background for
|
|
50
|
+
* `type="neutral"`. Aliased to `--bs-color-neutral-container`.
|
|
51
|
+
* @prop --bs-composer-status-banner-neutral-action-bg-hover - Aliased to
|
|
52
|
+
* `--bs-color-neutral-container-hover`.
|
|
53
|
+
* @prop --bs-composer-status-banner-neutral-action-border - Action button border for
|
|
54
|
+
* `type="neutral"` (the only variant whose action button is outlined). Aliased to
|
|
55
|
+
* `--bs-border-neutral-container`.
|
|
56
|
+
* @prop --bs-composer-status-banner-warning-bg - Background for `type="warning"`. Aliased to
|
|
57
|
+
* `--bs-color-warning-container`.
|
|
58
|
+
* @prop --bs-composer-status-banner-warning-text - Text/icon color for `type="warning"`. Aliased
|
|
59
|
+
* to `--bs-text-warning`.
|
|
60
|
+
* @prop --bs-composer-status-banner-warning-action-bg - Action button background for
|
|
61
|
+
* `type="warning"`. Aliased to `--bs-color-warning-default`.
|
|
62
|
+
* @prop --bs-composer-status-banner-warning-action-bg-hover - Aliased to
|
|
63
|
+
* `--bs-color-warning-hover`.
|
|
64
|
+
* @prop --bs-composer-status-banner-close-hover-bg - Close button hover background (same across
|
|
65
|
+
* every `type`). Aliased to `--bs-color-neutral-container-hover`.
|
|
66
|
+
*/
|
|
67
|
+
export class BsComposerStatusBanner {
|
|
68
|
+
/** Which severity/style to render. Drives background, text/icon color, and the action button's color. */
|
|
69
|
+
type = 'error';
|
|
70
|
+
/** The message text. */
|
|
71
|
+
message = 'This is a message';
|
|
72
|
+
/** Whether the leading icon (default: clock) is rendered. */
|
|
73
|
+
showIcon = true;
|
|
74
|
+
/** Whether the "Continue"-style action button is rendered. */
|
|
75
|
+
showButton = false;
|
|
76
|
+
/** Label for the action button, only rendered when `showButton` is true. */
|
|
77
|
+
actionLabel = 'Continue';
|
|
78
|
+
/** Whether the close button is rendered. */
|
|
79
|
+
allowClose = true;
|
|
80
|
+
/** Fires when the action button is clicked. Only relevant when `showButton` is true. */
|
|
81
|
+
bsAction;
|
|
82
|
+
/** Fires when the close button is clicked. Only relevant when `allowClose` is true. */
|
|
83
|
+
bsClose;
|
|
84
|
+
onActionClick = () => {
|
|
85
|
+
this.bsAction.emit();
|
|
86
|
+
};
|
|
87
|
+
onCloseClick = () => {
|
|
88
|
+
this.bsClose.emit();
|
|
89
|
+
};
|
|
90
|
+
render() {
|
|
91
|
+
return (h("div", { key: 'b51067b9af0210682fc60b5340560bf6ee42d655', class: `bs-composer-status-banner bs-composer-status-banner--${this.type}` }, h("div", { key: 'a6774d57e22e1b39fe0c9add8d96ed1c349bfeae', class: "bs-composer-status-banner__message-group" }, this.showIcon && (h("span", { key: '6a2b131a63a2d2cbe33f62519d1602752bc98204', part: "icon", class: "bs-composer-status-banner__icon" }, h("slot", { key: '6123c6a61652dfb504cf2e140a012fcba27e7468', name: "icon" }, h(ClockIcon, { key: '5415d7c71e2976a552955606e7288a4b806f1dbe' })))), h("p", { key: '1580b9f2b53390c32e38763c0cef23cb5d7ffa4c', part: "message", class: "bs-composer-status-banner__message" }, this.message)), this.showButton && (h("button", { key: 'bb08fce8f48253787015308bfc66e04835069670', type: "button", part: "action", class: "bs-composer-status-banner__action", onClick: this.onActionClick }, this.actionLabel)), this.allowClose && (h("button", { key: 'b9d64c66155cb8c5b884b48a442c9e0d09be9111', type: "button", part: "close", class: "bs-composer-status-banner__close", "aria-label": "Dismiss", onClick: this.onCloseClick }, h(CloseIcon, { key: '2779b3af1d5348ee510cd1fe4978cbfbbfb33c5e' })))));
|
|
92
|
+
}
|
|
93
|
+
static get is() { return "bs-composer-status-banner"; }
|
|
94
|
+
static get encapsulation() { return "shadow"; }
|
|
95
|
+
static get originalStyleUrls() {
|
|
96
|
+
return {
|
|
97
|
+
"$": ["bs-composer-status-banner.css"]
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
static get styleUrls() {
|
|
101
|
+
return {
|
|
102
|
+
"$": ["bs-composer-status-banner.css"]
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
static get properties() {
|
|
106
|
+
return {
|
|
107
|
+
"type": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "BsComposerStatusBannerType",
|
|
112
|
+
"resolved": "\"error\" | \"info\" | \"neutral\" | \"warning\"",
|
|
113
|
+
"references": {
|
|
114
|
+
"BsComposerStatusBannerType": {
|
|
115
|
+
"location": "local",
|
|
116
|
+
"path": "/Users/vivka/brandsync-web-components/src/components/bs-composer-status-banner/bs-composer-status-banner.tsx",
|
|
117
|
+
"id": "src/components/bs-composer-status-banner/bs-composer-status-banner.tsx::BsComposerStatusBannerType"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": "Which severity/style to render. Drives background, text/icon color, and the action button's color."
|
|
126
|
+
},
|
|
127
|
+
"getter": false,
|
|
128
|
+
"setter": false,
|
|
129
|
+
"reflect": false,
|
|
130
|
+
"attribute": "type",
|
|
131
|
+
"defaultValue": "'error'"
|
|
132
|
+
},
|
|
133
|
+
"message": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"mutable": false,
|
|
136
|
+
"complexType": {
|
|
137
|
+
"original": "string",
|
|
138
|
+
"resolved": "string",
|
|
139
|
+
"references": {}
|
|
140
|
+
},
|
|
141
|
+
"required": false,
|
|
142
|
+
"optional": false,
|
|
143
|
+
"docs": {
|
|
144
|
+
"tags": [],
|
|
145
|
+
"text": "The message text."
|
|
146
|
+
},
|
|
147
|
+
"getter": false,
|
|
148
|
+
"setter": false,
|
|
149
|
+
"reflect": false,
|
|
150
|
+
"attribute": "message",
|
|
151
|
+
"defaultValue": "'This is a message'"
|
|
152
|
+
},
|
|
153
|
+
"showIcon": {
|
|
154
|
+
"type": "boolean",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "boolean",
|
|
158
|
+
"resolved": "boolean",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": false,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": "Whether the leading icon (default: clock) is rendered."
|
|
166
|
+
},
|
|
167
|
+
"getter": false,
|
|
168
|
+
"setter": false,
|
|
169
|
+
"reflect": false,
|
|
170
|
+
"attribute": "show-icon",
|
|
171
|
+
"defaultValue": "true"
|
|
172
|
+
},
|
|
173
|
+
"showButton": {
|
|
174
|
+
"type": "boolean",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "boolean",
|
|
178
|
+
"resolved": "boolean",
|
|
179
|
+
"references": {}
|
|
180
|
+
},
|
|
181
|
+
"required": false,
|
|
182
|
+
"optional": false,
|
|
183
|
+
"docs": {
|
|
184
|
+
"tags": [],
|
|
185
|
+
"text": "Whether the \"Continue\"-style action button is rendered."
|
|
186
|
+
},
|
|
187
|
+
"getter": false,
|
|
188
|
+
"setter": false,
|
|
189
|
+
"reflect": false,
|
|
190
|
+
"attribute": "show-button",
|
|
191
|
+
"defaultValue": "false"
|
|
192
|
+
},
|
|
193
|
+
"actionLabel": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"mutable": false,
|
|
196
|
+
"complexType": {
|
|
197
|
+
"original": "string",
|
|
198
|
+
"resolved": "string",
|
|
199
|
+
"references": {}
|
|
200
|
+
},
|
|
201
|
+
"required": false,
|
|
202
|
+
"optional": false,
|
|
203
|
+
"docs": {
|
|
204
|
+
"tags": [],
|
|
205
|
+
"text": "Label for the action button, only rendered when `showButton` is true."
|
|
206
|
+
},
|
|
207
|
+
"getter": false,
|
|
208
|
+
"setter": false,
|
|
209
|
+
"reflect": false,
|
|
210
|
+
"attribute": "action-label",
|
|
211
|
+
"defaultValue": "'Continue'"
|
|
212
|
+
},
|
|
213
|
+
"allowClose": {
|
|
214
|
+
"type": "boolean",
|
|
215
|
+
"mutable": false,
|
|
216
|
+
"complexType": {
|
|
217
|
+
"original": "boolean",
|
|
218
|
+
"resolved": "boolean",
|
|
219
|
+
"references": {}
|
|
220
|
+
},
|
|
221
|
+
"required": false,
|
|
222
|
+
"optional": false,
|
|
223
|
+
"docs": {
|
|
224
|
+
"tags": [],
|
|
225
|
+
"text": "Whether the close button is rendered."
|
|
226
|
+
},
|
|
227
|
+
"getter": false,
|
|
228
|
+
"setter": false,
|
|
229
|
+
"reflect": false,
|
|
230
|
+
"attribute": "allow-close",
|
|
231
|
+
"defaultValue": "true"
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
static get events() {
|
|
236
|
+
return [{
|
|
237
|
+
"method": "bsAction",
|
|
238
|
+
"name": "bsAction",
|
|
239
|
+
"bubbles": true,
|
|
240
|
+
"cancelable": true,
|
|
241
|
+
"composed": true,
|
|
242
|
+
"docs": {
|
|
243
|
+
"tags": [],
|
|
244
|
+
"text": "Fires when the action button is clicked. Only relevant when `showButton` is true."
|
|
245
|
+
},
|
|
246
|
+
"complexType": {
|
|
247
|
+
"original": "void",
|
|
248
|
+
"resolved": "void",
|
|
249
|
+
"references": {}
|
|
250
|
+
}
|
|
251
|
+
}, {
|
|
252
|
+
"method": "bsClose",
|
|
253
|
+
"name": "bsClose",
|
|
254
|
+
"bubbles": true,
|
|
255
|
+
"cancelable": true,
|
|
256
|
+
"composed": true,
|
|
257
|
+
"docs": {
|
|
258
|
+
"tags": [],
|
|
259
|
+
"text": "Fires when the close button is clicked. Only relevant when `allowClose` is true."
|
|
260
|
+
},
|
|
261
|
+
"complexType": {
|
|
262
|
+
"original": "void",
|
|
263
|
+
"resolved": "void",
|
|
264
|
+
"references": {}
|
|
265
|
+
}
|
|
266
|
+
}];
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const ClockIcon = () => (h("svg", { viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("circle", { cx: "10", cy: "10", r: "7.25", stroke: "currentColor", "stroke-width": "1.3" }), h("path", { d: "M10 5.83V10L12.5 11.67", stroke: "currentColor", "stroke-width": "1.3", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
270
|
+
const CloseIcon = () => (h("svg", { viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M15 5L5 15", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M15 15L5 5", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.stories.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { componentDescription, propDescription } from "../../stories-utils";
|
|
3
|
+
const types = ['error', 'info', 'neutral', 'warning'];
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Genie AI Components/bs-composer-status-banner',
|
|
6
|
+
parameters: { docs: { description: { component: componentDescription('bs-composer-status-banner') } } },
|
|
7
|
+
render: args => html `
|
|
8
|
+
<bs-composer-status-banner
|
|
9
|
+
type=${args.type}
|
|
10
|
+
message=${args.message}
|
|
11
|
+
?show-icon=${args.showIcon}
|
|
12
|
+
?show-button=${args.showButton}
|
|
13
|
+
action-label=${args.actionLabel}
|
|
14
|
+
?allow-close=${args.allowClose}
|
|
15
|
+
></bs-composer-status-banner>
|
|
16
|
+
`,
|
|
17
|
+
argTypes: {
|
|
18
|
+
type: { control: 'select', options: types, description: propDescription('bs-composer-status-banner', 'type') },
|
|
19
|
+
message: { control: 'text', description: propDescription('bs-composer-status-banner', 'message') },
|
|
20
|
+
showIcon: { control: 'boolean', description: propDescription('bs-composer-status-banner', 'showIcon') },
|
|
21
|
+
showButton: { control: 'boolean', description: propDescription('bs-composer-status-banner', 'showButton') },
|
|
22
|
+
actionLabel: { control: 'text', description: propDescription('bs-composer-status-banner', 'actionLabel') },
|
|
23
|
+
allowClose: { control: 'boolean', description: propDescription('bs-composer-status-banner', 'allowClose') },
|
|
24
|
+
},
|
|
25
|
+
args: {
|
|
26
|
+
type: 'error',
|
|
27
|
+
message: 'This is a message',
|
|
28
|
+
showIcon: true,
|
|
29
|
+
showButton: false,
|
|
30
|
+
actionLabel: 'Continue',
|
|
31
|
+
allowClose: true,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export default meta;
|
|
35
|
+
export const Default = {};
|
|
36
|
+
export const Info = {
|
|
37
|
+
args: { type: 'info' },
|
|
38
|
+
};
|
|
39
|
+
export const Neutral = {
|
|
40
|
+
args: { type: 'neutral' },
|
|
41
|
+
};
|
|
42
|
+
export const Warning = {
|
|
43
|
+
args: { type: 'warning' },
|
|
44
|
+
};
|
|
45
|
+
export const WithAction = {
|
|
46
|
+
name: 'With action button',
|
|
47
|
+
args: { showButton: true },
|
|
48
|
+
};
|
|
49
|
+
export const AllTypes = {
|
|
50
|
+
name: 'All types',
|
|
51
|
+
render: () => html `
|
|
52
|
+
<div style="display:flex; flex-direction:column; gap:8px; max-width: 600px;">
|
|
53
|
+
${types.map(type => html ` <bs-composer-status-banner type=${type} show-button></bs-composer-status-banner> `)}
|
|
54
|
+
</div>
|
|
55
|
+
`,
|
|
56
|
+
};
|
|
57
|
+
const SAMPLE_IMAGE = 'https://images.unsplash.com/photo-1512917774080-9991f1c4c750?w=200&h=200&fit=crop';
|
|
58
|
+
export const AboveComposer = {
|
|
59
|
+
name: 'Above bs-composer',
|
|
60
|
+
render: () => html `
|
|
61
|
+
<div style="display:flex; flex-direction:column; max-width: 420px;">
|
|
62
|
+
<bs-composer-status-banner
|
|
63
|
+
type="info"
|
|
64
|
+
message="Uploading files, please wait."
|
|
65
|
+
style="margin-bottom: calc(-1 * var(--bs-spacing-150));"
|
|
66
|
+
></bs-composer-status-banner>
|
|
67
|
+
<bs-composer aria-label="Message">
|
|
68
|
+
<bs-attachment-list slot="attachments">
|
|
69
|
+
<bs-attachment type="image" image-src=${SAMPLE_IMAGE} loading></bs-attachment>
|
|
70
|
+
<bs-attachment type="pdf" file-name="Dummy-pdf-in-here" loading></bs-attachment>
|
|
71
|
+
</bs-attachment-list>
|
|
72
|
+
</bs-composer>
|
|
73
|
+
</div>
|
|
74
|
+
`,
|
|
75
|
+
};
|
|
@@ -54,11 +54,11 @@ export class BsDataTable {
|
|
|
54
54
|
this.bsRowSelect.emit({ id: row.id, selected });
|
|
55
55
|
};
|
|
56
56
|
render() {
|
|
57
|
-
return (h("table", { key: '
|
|
57
|
+
return (h("table", { key: '9b16ade44ff85120e9629722de8e8c1738835c1b', part: "table", class: "bs-data-table" }, h("thead", { key: '644eed606e68782ada42c289bb7bfc8d6de4affb', part: "head" }, h("tr", { key: '4e4ea75018796c77f14703c1c1402022f8c8cde9' }, this.selectable && h("th", { key: '85460f7c2eab6ad0f3604f72bcd81a4aa8699c03', class: "bs-data-table__select-col" }), this.columns.map(column => {
|
|
58
58
|
const isSorted = this.sortColumn === column.key;
|
|
59
59
|
const ariaSort = column.sortable ? (isSorted ? (this.sortDirection === 'asc' ? 'ascending' : 'descending') : 'none') : undefined;
|
|
60
60
|
return (h("th", { part: "header-cell", class: "bs-data-table__header-cell", "aria-sort": ariaSort }, column.sortable ? (h("button", { type: "button", class: "bs-data-table__sort-button", onClick: () => this.onHeaderClick(column) }, column.label, isSorted && h("span", { class: "bs-data-table__sort-indicator" }, this.sortDirection === 'asc' ? ' ▲' : ' ▼'))) : (column.label)));
|
|
61
|
-
}))), h("tbody", { key: '
|
|
61
|
+
}))), h("tbody", { key: '024cb8a25cc6471e7074d119b78e6a8e22f86450', part: "body" }, this.rows.map(row => (h("tr", { part: "row", class: "bs-data-table__row" }, this.selectable && (h("td", { class: "bs-data-table__select-col" }, h("input", { type: "checkbox", checked: this.selectedIds.has(row.id), onChange: ev => this.onRowCheckboxChange(row, ev) }))), this.columns.map(column => this.cellRenderer ? (
|
|
62
62
|
// cellRenderer is a developer-supplied, trusted function (JS-property-only, never
|
|
63
63
|
// derived from untrusted input) -- its HTML output is intentionally not escaped,
|
|
64
64
|
// same trust model as React's dangerouslySetInnerHTML.
|