@brightspot/ui 5.3.2 → 5.4.0
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/dist/components/banner/Banner.css +32 -0
- package/dist/components/banner/Banner.d.ts +56 -0
- package/dist/components/banner/Banner.d.ts.map +1 -0
- package/dist/components/banner/Banner.js +94 -0
- package/dist/components/banner/Banner.js.map +1 -0
- package/dist/components/banner/Message.css +4 -0
- package/dist/components/banner/Message.d.ts +103 -0
- package/dist/components/banner/Message.d.ts.map +1 -0
- package/dist/components/banner/Message.js +235 -0
- package/dist/components/banner/Message.js.map +1 -0
- package/dist/custom-elements.json +319 -0
- package/dist/storybook/assets/{ActionBar.stories-1Iqfy4PV.js → ActionBar.stories-BJcrfF0X.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-DjKyE7m_.js → ActionItem.stories-xLR-VN2Q.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-Dy36fKQN.js → Avatar.stories-Cj5Q2yEp.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-Bh8TY9-P.js → AvatarGroup.stories-DLWAQHFa.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-Bn0aBHka.js → Badge.stories-DGSKAf9D.js} +1 -1
- package/dist/storybook/assets/Banner.stories-BZ3LLa4I.js +203 -0
- package/dist/storybook/assets/{Button-D8Sr8A-v.js → Button-ffu9dnxC.js} +1 -1
- package/dist/storybook/assets/{Button.stories-CtRBI4gv.js → Button.stories-DB-uDcVu.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-CVjQWgMD.js → ButtonGroup.stories-eGya8Uts.js} +1 -1
- package/dist/storybook/assets/{Card.stories-DXTqqbXb.js → Card.stories-B_hhKmQB.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-DwQeQ1VN.js → Celebrate.stories-DqKwiwly.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-D4AyVy-V.js → Checkbox.stories-Bly8OVzf.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-D6dHpD70.js → CircularProgress.stories-BZUNNkMK.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-CvYj7bwY.js → ClipboardMixin.stories-D2XMhwIg.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-o6fp9dCO.js → Color-6BZIO3FS-BPcC43iH.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-Bg-Xuo05.js → Colors.stories-DveV04we.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-C4SNTP9M.js → CombinedEffects.stories-Dl_MhHhl.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-Dj1V-e8c.js → ComponentStatesMixin-CmZnizKN.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-CUoagWLT.js → ComponentStatesMixin.stories-BrAFoGDu.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-ynkFni9d.js → CopyToClipboard.stories-CiKbtpBJ.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-xAZ6AOUR.js → Debounce.stories-BQ7W_yTX.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-DeoiTMLA.js → DocsRenderer-LL677BLK-DiDzi0rZ.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-BQzwsyHE.js → Dropdown.stories-LYd0-ypG.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-CrckJlBX.js → EmptyState.stories-DjKyE0h3.js} +1 -1
- package/dist/storybook/assets/{EscaAvatar.stories-BikckAep.js → EscaAvatar.stories-D3v91UKv.js} +1 -1
- package/dist/storybook/assets/{Events.stories-DC0XMBhF.js → Events.stories-CTe5eZa6.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-7YtY0gNK.js → Heading.stories-DKt-wgRB.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-hRstwRnF.js → HueRipple.stories-B3SVSdL8.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-4-2N4UlX.js → Icon.stories-B5tDsd--.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-ClpNoAT9.js → IconButton.stories-DOV4zFAP.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-BlH24bsJ.js → LinearProgress.stories-ai3UD-xw.js} +1 -1
- package/dist/storybook/assets/Message.stories-CzqIe49h.js +432 -0
- package/dist/storybook/assets/{OnFindMixin.stories-CKoPIaks.js → OnFindMixin.stories-CUaE6pX1.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-CER9zwKW.js → Pagination.stories-CXCbChNW.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-CO7t4Pl8.js → Popover.stories-DyptvVL3.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-C_H-s0cp.js → ReadyMixin-BUpBkgED.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-0Sny7BQc.js → RovingTabindexMixin.stories-DzEH38Tn.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-Ci7CnFM6.js → Rtc.stories-DxQWkudF.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-CSbM9xdE.js → ScrollShadow.stories-DbMdNLKA.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-D-SGY0dL.js → Switch.stories-CvSwuR0Z.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-DXeloL5R.js → Tab.stories-CI6m8NXD.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-KGjrQHnj.js → Tabs.stories-BMat3ubI.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-SjszmCVX.js → Throttle.stories-PEUZoXfI.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-DZty4zmq.js → Tooltip.stories-kDJ5PbGO.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-CoM7bgt1.js → Upload.stories-Bb5KBlh7.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-CRrp-ZTV.js → UploadItem.stories-VZVWc52f.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-lQ_IWtd1.js → Welcome.stories-BgzaFbT1.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-rY-A2yAZ.js → Widget.stories-Bbczy09Q.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-asVkTqyz.js → WithTooltip-65CFNBJE-BoKgPPcr.js} +1 -1
- package/dist/storybook/assets/{blocks-D-cAwpi5.js → blocks-j0yzxuDk.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-CaSK-GPg.js → formatter-EIJCOSYU-B5-4vV2C.js} +1 -1
- package/dist/storybook/assets/if-defined-DBQP12ek.js +1 -0
- package/dist/storybook/assets/iframe-Ce3XRnL4.css +1 -0
- package/dist/storybook/assets/{iframe-DpPeZoRd.js → iframe-DUmd7GbF.js} +86 -86
- package/dist/storybook/assets/{index-Eb_LP-gw.js → index-ACSvfrQi.js} +1 -1
- package/dist/storybook/assets/{onFind-D8gPkhwL.js → onFind-t_5Bmfio.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-C_2tTxBq.js → onFind.stories-CQWcRPFY.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-D-gjr3kA.js → onRemove.stories-B9_DDB2B.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-DGfzNLoX.js → onVisible.stories-G0qjGum_.js} +1 -1
- package/dist/storybook/assets/{style-map-WEdc6AkA.js → style-map-D_jXmlQ4.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-CCM2wmJ3.js → syntaxhighlighter-ED5Y7EFY-7_fYNYDB.js} +1 -1
- package/dist/storybook/iframe.html +2 -2
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/tailwind-plugin-message.d.ts +2 -0
- package/dist/tailwind-plugin-message.d.ts.map +1 -0
- package/dist/tailwind-plugin-message.js +168 -0
- package/dist/tailwind-plugin-message.js.map +1 -0
- package/dist/tailwind-plugin-message.ts +226 -0
- package/dist/tailwind.config.d.ts.map +1 -1
- package/dist/tailwind.config.js +2 -0
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.ts +2 -0
- package/dist/util/EventEmitterMixin.d.ts +3 -0
- package/dist/util/EventEmitterMixin.d.ts.map +1 -1
- package/dist/util/EventEmitterMixin.js.map +1 -1
- package/docs/components/Banner.md +49 -0
- package/docs/components/Message.md +75 -0
- package/docs/components/README.md +2 -0
- package/package.json +1 -1
- package/src/legacy/tool-ui/src/ContentInputGroup.css +4 -0
- package/src/legacy/tool-ui/src/Hierarchy.css +4 -11
- package/src/legacy/tool-ui/src/Page.css +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{v4.da15ce3ce45e85b4880a.js → v4.84f71eb0a38ed97f7d3a.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.8491d982a282935a3058.js → v5.060e8a546f81da35c4de.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.ac655d942db92fdcddfc.css +5 -0
- package/dist/storybook/assets/if-defined-aps73Iby.js +0 -1
- package/dist/storybook/assets/iframe-1F7Ef_8q.css +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.9b40c96064a0f8a10b53.css +0 -5
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v4.da15ce3ce45e85b4880a.js.LICENSE.txt → v4.84f71eb0a38ed97f7d3a.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v5.8491d982a282935a3058.js.LICENSE.txt → v5.060e8a546f81da35c4de.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* The base `.btu-banner` rules (display, width, position:relative, z-index) live in
|
|
2
|
+
tailwind-plugin-message.ts so they apply to static/Tailwind markup too. This file
|
|
3
|
+
holds only custom-element upgrade + auto-pagination behavior — the pager overlay
|
|
4
|
+
below relies on the plugin's `position: relative`. */
|
|
5
|
+
|
|
6
|
+
/* FOUC prevention: lay out as a full-width block before the component upgrades
|
|
7
|
+
so the wrapped message doesn't shift when the banner takes over. */
|
|
8
|
+
btu-banner:not(:defined) {
|
|
9
|
+
@apply w-full blokk;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Auto-pagination. Until the banner has paginated, show only the first message so the
|
|
13
|
+
rest don't flash stacked before `_paginate()` hides them. */
|
|
14
|
+
btu-banner:not([data-paginated]) > btu-message:not(:first-of-type) {
|
|
15
|
+
@apply hidden;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Once paginated, the pager overlays the right of the active message strip (kept on the
|
|
19
|
+
banner so it never reparents). The message reserves room equal to the pager's width
|
|
20
|
+
plus its inset so content doesn't run under it — keep this in sync with the pager's
|
|
21
|
+
`inset-inline-end` below. */
|
|
22
|
+
btu-banner[data-paginated] > btu-message {
|
|
23
|
+
padding-inline-end: 5rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
btu-banner[data-paginated] > btu-pagination {
|
|
27
|
+
position: absolute;
|
|
28
|
+
inset-block: 0;
|
|
29
|
+
inset-inline-end: 1rem;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '../pagination/Pagination.js';
|
|
3
|
+
import './Banner.css';
|
|
4
|
+
import './Message.js';
|
|
5
|
+
declare const Banner_base: (new (...args: any[]) => import("../../util/EventEmitterMixin.js").EventEmitterMixinInterface) & (new (...args: any[]) => import("../../util/ReadyMixin.js").ReadyMixinInterface) & typeof LitElement;
|
|
6
|
+
/**
|
|
7
|
+
* A full-width container that pins a `<btu-message>` to the top of the CMS or a
|
|
8
|
+
* content edit page. The banner has no content API of its own — compose a
|
|
9
|
+
* `<btu-message>` inside it (or several, e.g. for a paginated banner) and the banner
|
|
10
|
+
* spans each to 100% of the host, rendering it full-bleed (edge-to-edge, bottom
|
|
11
|
+
* border only, no corner rounding).
|
|
12
|
+
*
|
|
13
|
+
* Set the content (variant, label, symbol, dismissible, badge/description/actions
|
|
14
|
+
* slots) on the message itself. The full-width treatment lives on this wrapper, so
|
|
15
|
+
* the message has no `full-width` attribute — the banner owns that.
|
|
16
|
+
*
|
|
17
|
+
* @element btu-banner
|
|
18
|
+
*
|
|
19
|
+
* @slot - One or more `<btu-message>` elements, full-bleed to the host width. With more
|
|
20
|
+
* than one, the banner auto-creates a `<btu-pagination>` and shows one at a time.
|
|
21
|
+
*
|
|
22
|
+
* @fires {CustomEvent} btu-banner-ready - Fired after the banner is first rendered and initialized
|
|
23
|
+
*
|
|
24
|
+
* @cssprop --banner-z-index - Stack order for the banner (default: 100). The banner is
|
|
25
|
+
* `position: relative`, so this always applies; set `position: sticky` to also pin it to the viewport.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```html
|
|
29
|
+
* <btu-banner>
|
|
30
|
+
* <btu-message variant="warning" label="API rate limits were updated">
|
|
31
|
+
* <span slot="description">Review your usage dashboard to stay within the new limits.</span>
|
|
32
|
+
* <button slot="actions" type="button">Learn more</button>
|
|
33
|
+
* </btu-message>
|
|
34
|
+
* </btu-banner>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export default class Banner extends Banner_base {
|
|
38
|
+
createRenderRoot(): this;
|
|
39
|
+
connectedCallback(): void;
|
|
40
|
+
firstUpdated(): void;
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* Create a `<btu-pagination>` on the banner and show one message at a time, toggling
|
|
44
|
+
* `hidden` on page change. Reflects the messages present at first render (not
|
|
45
|
+
* re-evaluated on later add/remove).
|
|
46
|
+
*/
|
|
47
|
+
private _paginate;
|
|
48
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
49
|
+
}
|
|
50
|
+
declare global {
|
|
51
|
+
interface HTMLElementTagNameMap {
|
|
52
|
+
'btu-banner': Banner;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=Banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../src/components/banner/Banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAA;AAGtC,OAAO,6BAA6B,CAAA;AACpC,OAAO,cAAc,CAAA;AACrB,OAAO,cAAc,CAAA;;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAyC;IAC3E,gBAAgB;IAIhB,iBAAiB,IAAI,IAAI;IAKzB,YAAY,IAAI,IAAI;IAUpB;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IA6BjB,MAAM;CAGP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,MAAM,CAAA;KACrB;CACF"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { LitElement, html } from 'lit';
|
|
2
|
+
import { EventEmitterMixin } from '../../util/EventEmitterMixin.js';
|
|
3
|
+
import { ReadyMixin } from '../../util/ReadyMixin.js';
|
|
4
|
+
import '../pagination/Pagination.js';
|
|
5
|
+
import './Banner.css';
|
|
6
|
+
import './Message.js';
|
|
7
|
+
/**
|
|
8
|
+
* A full-width container that pins a `<btu-message>` to the top of the CMS or a
|
|
9
|
+
* content edit page. The banner has no content API of its own — compose a
|
|
10
|
+
* `<btu-message>` inside it (or several, e.g. for a paginated banner) and the banner
|
|
11
|
+
* spans each to 100% of the host, rendering it full-bleed (edge-to-edge, bottom
|
|
12
|
+
* border only, no corner rounding).
|
|
13
|
+
*
|
|
14
|
+
* Set the content (variant, label, symbol, dismissible, badge/description/actions
|
|
15
|
+
* slots) on the message itself. The full-width treatment lives on this wrapper, so
|
|
16
|
+
* the message has no `full-width` attribute — the banner owns that.
|
|
17
|
+
*
|
|
18
|
+
* @element btu-banner
|
|
19
|
+
*
|
|
20
|
+
* @slot - One or more `<btu-message>` elements, full-bleed to the host width. With more
|
|
21
|
+
* than one, the banner auto-creates a `<btu-pagination>` and shows one at a time.
|
|
22
|
+
*
|
|
23
|
+
* @fires {CustomEvent} btu-banner-ready - Fired after the banner is first rendered and initialized
|
|
24
|
+
*
|
|
25
|
+
* @cssprop --banner-z-index - Stack order for the banner (default: 100). The banner is
|
|
26
|
+
* `position: relative`, so this always applies; set `position: sticky` to also pin it to the viewport.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```html
|
|
30
|
+
* <btu-banner>
|
|
31
|
+
* <btu-message variant="warning" label="API rate limits were updated">
|
|
32
|
+
* <span slot="description">Review your usage dashboard to stay within the new limits.</span>
|
|
33
|
+
* <button slot="actions" type="button">Learn more</button>
|
|
34
|
+
* </btu-message>
|
|
35
|
+
* </btu-banner>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export default class Banner extends EventEmitterMixin(ReadyMixin(LitElement)) {
|
|
39
|
+
createRenderRoot() {
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
connectedCallback() {
|
|
43
|
+
super.connectedCallback();
|
|
44
|
+
this.classList.add('btu-banner');
|
|
45
|
+
}
|
|
46
|
+
firstUpdated() {
|
|
47
|
+
const messages = Array.from(this.querySelectorAll(':scope > btu-message'));
|
|
48
|
+
if (messages.length === 0) {
|
|
49
|
+
console.warn('[btu-banner] Expected at least one <btu-message> child.', this);
|
|
50
|
+
}
|
|
51
|
+
else if (messages.length > 1) {
|
|
52
|
+
this._paginate(messages);
|
|
53
|
+
}
|
|
54
|
+
this.emit('btu-banner-ready');
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
* Create a `<btu-pagination>` on the banner and show one message at a time, toggling
|
|
59
|
+
* `hidden` on page change. Reflects the messages present at first render (not
|
|
60
|
+
* re-evaluated on later add/remove).
|
|
61
|
+
*/
|
|
62
|
+
_paginate(messages) {
|
|
63
|
+
const pager = document.createElement('btu-pagination');
|
|
64
|
+
pager.totalItems = messages.length;
|
|
65
|
+
pager.pageSize = 1;
|
|
66
|
+
// pageSize must be a valid option or the component resets it to the first default.
|
|
67
|
+
pager.pageSizeOptions = '1';
|
|
68
|
+
pager.hideTotalCount = true;
|
|
69
|
+
pager.pageSizeChanger = false;
|
|
70
|
+
pager.boundaryButtons = false;
|
|
71
|
+
const showPage = (page) => {
|
|
72
|
+
messages.forEach((message, i) => {
|
|
73
|
+
message.hidden = i !== page - 1;
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
pager.addEventListener('btu-pagination-change', e => {
|
|
77
|
+
showPage(e.detail.page);
|
|
78
|
+
});
|
|
79
|
+
showPage(1);
|
|
80
|
+
// Keep the pager on the banner (a stable host) so navigation never reparents it
|
|
81
|
+
// (no reconnect churn, no focus loss). `data-paginated` flips the banner from the
|
|
82
|
+
// pre-init FOUC guard to the paginated layout (both in Banner.css).
|
|
83
|
+
this.dataset.paginated = '';
|
|
84
|
+
this.append(pager);
|
|
85
|
+
}
|
|
86
|
+
// Light DOM: the messages render themselves; the banner only frames them.
|
|
87
|
+
render() {
|
|
88
|
+
return html ``;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (!customElements.get('btu-banner')) {
|
|
92
|
+
customElements.define('btu-banner', Banner);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=Banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../src/components/banner/Banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,6BAA6B,CAAA;AACpC,OAAO,cAAc,CAAA;AACrB,OAAO,cAAc,CAAA;AAErB;;;;;;;;;;;;;;;;;;;;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CAAC,MAAM,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,CAAA;YACjC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA;QAED,KAAK,CAAC,gBAAgB,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAE;YAClD,QAAQ,CAAE,CAAmC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC5D,CAAC,CAAC,CAAA;QAEF,QAAQ,CAAC,CAAC,CAAC,CAAA;QACX,gFAAgF;QAChF,kFAAkF;QAClF,oEAAoE;QACpE,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,EAAE,CAAA;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACpB,CAAC;IAED,0EAA0E;IAC1E,MAAM;QACJ,OAAO,IAAI,CAAA,EAAE,CAAA;IACf,CAAC;CACF;AAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;IACtC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;AAC7C,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
import '../icon-button/IconButton.js';
|
|
3
|
+
import '../icon/Icon.js';
|
|
4
|
+
import './Message.css';
|
|
5
|
+
export type MessageVariant = 'primary' | 'info' | 'warning' | 'error' | 'success';
|
|
6
|
+
declare const Message_base: (new (...args: any[]) => import("../../util/EventEmitterMixin.js").EventEmitterMixinInterface) & (new (...args: any[]) => import("../../util/ReadyMixin.js").ReadyMixinInterface) & typeof LitElement;
|
|
7
|
+
/**
|
|
8
|
+
* A message for communicating high-visibility content that is not tied to the
|
|
9
|
+
* user's current task — alerts, breaking news, and persistent status. Use it on
|
|
10
|
+
* its own as a contained, bordered card, or place it inside a `<btu-banner>` to
|
|
11
|
+
* span the full width of the page (e.g., pinned above the CMS content area).
|
|
12
|
+
*
|
|
13
|
+
* Messages render a leading icon, an optional badge, a label, an optional
|
|
14
|
+
* description, and an optional dismiss control. The label and description
|
|
15
|
+
* stack vertically in a text column; everything else sits on the same row.
|
|
16
|
+
*
|
|
17
|
+
* @element btu-message
|
|
18
|
+
*
|
|
19
|
+
* @slot badge - Pseudo-slot for a leading status/version tag, typically a
|
|
20
|
+
* `<btu-badge>`. The slotted child is moved into the header row, before the
|
|
21
|
+
* label.
|
|
22
|
+
* @slot description - Pseudo-slot for supporting text rendered directly beneath
|
|
23
|
+
* the label. Slot a single inline element (e.g., `<span slot="description">`)
|
|
24
|
+
* or a block element to enable rich content (links, emphasis).
|
|
25
|
+
* @slot actions - Pseudo-slot for CTA buttons, links, or a `<btu-pagination>`.
|
|
26
|
+
* Children with `slot="actions"` are moved into an internal container on the
|
|
27
|
+
* trailing edge of the body. `.btu-button` children inherit the message's
|
|
28
|
+
* foreground color across all states. The message does not emit an
|
|
29
|
+
* action-click event — attach handlers to your own elements.
|
|
30
|
+
*
|
|
31
|
+
* @fires {CustomEvent} btu-message-ready - Fired after the message is first rendered and initialized
|
|
32
|
+
* @fires {CustomEvent} btu-message-dismiss - Fired when the user clicks the close/dismiss button.
|
|
33
|
+
* Cancelable: the message hides itself (sets `hidden`) unless the listener calls `preventDefault()`.
|
|
34
|
+
*
|
|
35
|
+
* @cssprop --message-color-background - Overrides the background color for the message
|
|
36
|
+
* @cssprop --message-color-foreground - Overrides the text and icon color
|
|
37
|
+
* @cssprop --message-color-border - Overrides the border color (defaults to the variant's 300 shade)
|
|
38
|
+
* @cssprop --message-padding - Overrides the internal padding (default: 1rem)
|
|
39
|
+
* @cssprop --message-border-radius - Overrides the corner rounding (default: 8px)
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```html
|
|
43
|
+
* <btu-message variant="info" label="New feature available" dismissible></btu-message>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```html
|
|
48
|
+
* <btu-message variant="error" label="Something went wrong" dismissible>
|
|
49
|
+
* <span slot="description">We couldn't save your changes. Please try again in a moment.</span>
|
|
50
|
+
* </btu-message>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```html
|
|
55
|
+
* <btu-message variant="info" label="New feature available" dismissible>
|
|
56
|
+
* <btu-badge slot="badge" variant="info" size="sm">v2.4</btu-badge>
|
|
57
|
+
* <span slot="description">The redesigned editor is now available.</span>
|
|
58
|
+
* <button slot="actions" type="button">Learn more</button>
|
|
59
|
+
* </btu-message>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export default class Message extends Message_base {
|
|
63
|
+
/**
|
|
64
|
+
* Visual style and semantic meaning of the message.
|
|
65
|
+
* @attr
|
|
66
|
+
*/
|
|
67
|
+
variant: MessageVariant;
|
|
68
|
+
/**
|
|
69
|
+
* The primary message or title text displayed.
|
|
70
|
+
* @attr
|
|
71
|
+
*/
|
|
72
|
+
label: string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Name of the Lucide icon to display. Defaults to a sensible icon per variant.
|
|
75
|
+
* @attr
|
|
76
|
+
*/
|
|
77
|
+
symbol: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* If true, a close icon is provided to allow the user to hide the message.
|
|
80
|
+
* @attr
|
|
81
|
+
*/
|
|
82
|
+
dismissible: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
* Safe, validated variant used for rendering and styling. If the consumer
|
|
86
|
+
* sets an unknown value on `this.variant`, we fall back to `info` here
|
|
87
|
+
* without overwriting the original user input on the element.
|
|
88
|
+
*/
|
|
89
|
+
private _safeVariant;
|
|
90
|
+
createRenderRoot(): this;
|
|
91
|
+
connectedCallback(): void;
|
|
92
|
+
willUpdate(changedProperties: PropertyValues<this>): void;
|
|
93
|
+
firstUpdated(): void;
|
|
94
|
+
private _handleDismiss;
|
|
95
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
96
|
+
}
|
|
97
|
+
declare global {
|
|
98
|
+
interface HTMLElementTagNameMap {
|
|
99
|
+
'btu-message': Message;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=Message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/components/banner/Message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAMpE,OAAO,8BAA8B,CAAA;AACrC,OAAO,iBAAiB,CAAA;AACxB,OAAO,eAAe,CAAA;AAEtB,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;;AAqBjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,YAAyC;IAC5E;;;OAGG;IAEH,OAAO,EAAE,cAAc,CAAS;IAEhC;;;OAGG;IAEH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IAEzB;;;OAGG;IAEH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAE1B;;;OAGG;IAEH,WAAW,UAAQ;IAEnB;;;;;OAKG;IACH,OAAO,CAAC,YAAY,CAAyB;IAE7C,gBAAgB;IAIhB,iBAAiB,IAAI,IAAI;IAOzB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAwBzD,YAAY,IAAI,IAAI;IAuCpB,OAAO,CAAC,cAAc;IActB,MAAM;CAkCP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,OAAO,CAAA;KACvB;CACF"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, nothing } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { EventEmitterMixin } from '../../util/EventEmitterMixin.js';
|
|
10
|
+
import { l10n } from '../../util/i18n.js';
|
|
11
|
+
import onFind from '../../util/onFind.js';
|
|
12
|
+
import { ReadyMixin } from '../../util/ReadyMixin.js';
|
|
13
|
+
import '../icon-button/IconButton.js';
|
|
14
|
+
import '../icon/Icon.js';
|
|
15
|
+
import './Message.css';
|
|
16
|
+
const DEFAULT_ICONS = {
|
|
17
|
+
primary: 'info',
|
|
18
|
+
info: 'info',
|
|
19
|
+
warning: 'triangle-alert',
|
|
20
|
+
error: 'circle-alert',
|
|
21
|
+
success: 'circle-check',
|
|
22
|
+
};
|
|
23
|
+
// Tailwind content scanning requires complete class names (no template literals),
|
|
24
|
+
// so the variant class is looked up from this map instead of being built via
|
|
25
|
+
// string interpolation at runtime.
|
|
26
|
+
const VARIANT_CLASS = {
|
|
27
|
+
primary: 'btu-message-primary',
|
|
28
|
+
info: 'btu-message-info',
|
|
29
|
+
warning: 'btu-message-warning',
|
|
30
|
+
error: 'btu-message-error',
|
|
31
|
+
success: 'btu-message-success',
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A message for communicating high-visibility content that is not tied to the
|
|
35
|
+
* user's current task — alerts, breaking news, and persistent status. Use it on
|
|
36
|
+
* its own as a contained, bordered card, or place it inside a `<btu-banner>` to
|
|
37
|
+
* span the full width of the page (e.g., pinned above the CMS content area).
|
|
38
|
+
*
|
|
39
|
+
* Messages render a leading icon, an optional badge, a label, an optional
|
|
40
|
+
* description, and an optional dismiss control. The label and description
|
|
41
|
+
* stack vertically in a text column; everything else sits on the same row.
|
|
42
|
+
*
|
|
43
|
+
* @element btu-message
|
|
44
|
+
*
|
|
45
|
+
* @slot badge - Pseudo-slot for a leading status/version tag, typically a
|
|
46
|
+
* `<btu-badge>`. The slotted child is moved into the header row, before the
|
|
47
|
+
* label.
|
|
48
|
+
* @slot description - Pseudo-slot for supporting text rendered directly beneath
|
|
49
|
+
* the label. Slot a single inline element (e.g., `<span slot="description">`)
|
|
50
|
+
* or a block element to enable rich content (links, emphasis).
|
|
51
|
+
* @slot actions - Pseudo-slot for CTA buttons, links, or a `<btu-pagination>`.
|
|
52
|
+
* Children with `slot="actions"` are moved into an internal container on the
|
|
53
|
+
* trailing edge of the body. `.btu-button` children inherit the message's
|
|
54
|
+
* foreground color across all states. The message does not emit an
|
|
55
|
+
* action-click event — attach handlers to your own elements.
|
|
56
|
+
*
|
|
57
|
+
* @fires {CustomEvent} btu-message-ready - Fired after the message is first rendered and initialized
|
|
58
|
+
* @fires {CustomEvent} btu-message-dismiss - Fired when the user clicks the close/dismiss button.
|
|
59
|
+
* Cancelable: the message hides itself (sets `hidden`) unless the listener calls `preventDefault()`.
|
|
60
|
+
*
|
|
61
|
+
* @cssprop --message-color-background - Overrides the background color for the message
|
|
62
|
+
* @cssprop --message-color-foreground - Overrides the text and icon color
|
|
63
|
+
* @cssprop --message-color-border - Overrides the border color (defaults to the variant's 300 shade)
|
|
64
|
+
* @cssprop --message-padding - Overrides the internal padding (default: 1rem)
|
|
65
|
+
* @cssprop --message-border-radius - Overrides the corner rounding (default: 8px)
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```html
|
|
69
|
+
* <btu-message variant="info" label="New feature available" dismissible></btu-message>
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```html
|
|
74
|
+
* <btu-message variant="error" label="Something went wrong" dismissible>
|
|
75
|
+
* <span slot="description">We couldn't save your changes. Please try again in a moment.</span>
|
|
76
|
+
* </btu-message>
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```html
|
|
81
|
+
* <btu-message variant="info" label="New feature available" dismissible>
|
|
82
|
+
* <btu-badge slot="badge" variant="info" size="sm">v2.4</btu-badge>
|
|
83
|
+
* <span slot="description">The redesigned editor is now available.</span>
|
|
84
|
+
* <button slot="actions" type="button">Learn more</button>
|
|
85
|
+
* </btu-message>
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export default class Message extends EventEmitterMixin(ReadyMixin(LitElement)) {
|
|
89
|
+
constructor() {
|
|
90
|
+
super(...arguments);
|
|
91
|
+
/**
|
|
92
|
+
* Visual style and semantic meaning of the message.
|
|
93
|
+
* @attr
|
|
94
|
+
*/
|
|
95
|
+
this.variant = 'info';
|
|
96
|
+
/**
|
|
97
|
+
* If true, a close icon is provided to allow the user to hide the message.
|
|
98
|
+
* @attr
|
|
99
|
+
*/
|
|
100
|
+
this.dismissible = false;
|
|
101
|
+
/**
|
|
102
|
+
* @internal
|
|
103
|
+
* Safe, validated variant used for rendering and styling. If the consumer
|
|
104
|
+
* sets an unknown value on `this.variant`, we fall back to `info` here
|
|
105
|
+
* without overwriting the original user input on the element.
|
|
106
|
+
*/
|
|
107
|
+
this._safeVariant = 'info';
|
|
108
|
+
}
|
|
109
|
+
createRenderRoot() {
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
connectedCallback() {
|
|
113
|
+
super.connectedCallback();
|
|
114
|
+
// classList (not a full className rewrite) preserves consumer-added classes.
|
|
115
|
+
this.classList.add('btu-message');
|
|
116
|
+
this.setAttribute('aria-atomic', 'true');
|
|
117
|
+
}
|
|
118
|
+
willUpdate(changedProperties) {
|
|
119
|
+
super.willUpdate(changedProperties);
|
|
120
|
+
if (changedProperties.has('variant')) {
|
|
121
|
+
this._safeVariant = this.variant in VARIANT_CLASS ? this.variant : 'info';
|
|
122
|
+
if (this._safeVariant !== this.variant) {
|
|
123
|
+
console.warn(`[btu-message] Unrecognized variant: "${this.variant}". Falling back to "info".`, this);
|
|
124
|
+
}
|
|
125
|
+
// Re-setting aria-live on every render can re-announce the content in some
|
|
126
|
+
// screen readers, so only update it when the variant changes. error/primary
|
|
127
|
+
// are urgent (assertive); other variants are polite.
|
|
128
|
+
const isAssertive = this._safeVariant === 'error' || this._safeVariant === 'primary';
|
|
129
|
+
this.setAttribute('role', isAssertive ? 'alert' : 'status');
|
|
130
|
+
this.setAttribute('aria-live', isAssertive ? 'assertive' : 'polite');
|
|
131
|
+
// Swap only the variant class; leave all other classes untouched.
|
|
132
|
+
const variantClass = VARIANT_CLASS[this._safeVariant];
|
|
133
|
+
for (const cls of Object.values(VARIANT_CLASS)) {
|
|
134
|
+
if (cls !== variantClass)
|
|
135
|
+
this.classList.remove(cls);
|
|
136
|
+
}
|
|
137
|
+
this.classList.add(variantClass);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
firstUpdated() {
|
|
141
|
+
const hasDescription = !!this.querySelector(':scope > [slot="description"]');
|
|
142
|
+
if (!this.label?.trim() && !hasDescription) {
|
|
143
|
+
console.warn('[btu-message] No label or description provided.', this);
|
|
144
|
+
}
|
|
145
|
+
// Guard the containers instead of asserting non-null, so a future conditional
|
|
146
|
+
// wrapper can't null-deref.
|
|
147
|
+
const badgeContainer = this.querySelector('.btu-message-badge');
|
|
148
|
+
const descriptionContainer = this.querySelector('.btu-message-description');
|
|
149
|
+
const actionsContainer = this.querySelector('.btu-message-actions');
|
|
150
|
+
if (badgeContainer && descriptionContainer && actionsContainer) {
|
|
151
|
+
onFind(this, ':scope > :not([data-message-internal])', el => {
|
|
152
|
+
const slot = el.getAttribute('slot');
|
|
153
|
+
if (slot === 'badge') {
|
|
154
|
+
badgeContainer.appendChild(el);
|
|
155
|
+
}
|
|
156
|
+
else if (slot === 'description') {
|
|
157
|
+
descriptionContainer.appendChild(el);
|
|
158
|
+
this.classList.add('btu-message-has-description');
|
|
159
|
+
}
|
|
160
|
+
else if (slot === 'actions') {
|
|
161
|
+
actionsContainer.appendChild(el);
|
|
162
|
+
}
|
|
163
|
+
else if (slot) {
|
|
164
|
+
console.warn(`[btu-message] Unrecognized slot="${slot}". Valid slots are "badge", "description", and "actions".`, el);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
console.warn('[btu-message] Child element has no slot attribute. Use slot="badge", "description", or "actions".', el);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
this.emit('btu-message-ready');
|
|
172
|
+
}
|
|
173
|
+
_handleDismiss() {
|
|
174
|
+
// Dispatch directly (rather than via `emit`) so the event is cancelable —
|
|
175
|
+
// the default action is to hide the message; consumers can call
|
|
176
|
+
// `preventDefault()` to keep it visible and manage dismissal themselves.
|
|
177
|
+
const event = new CustomEvent('btu-message-dismiss', {
|
|
178
|
+
bubbles: true,
|
|
179
|
+
cancelable: true,
|
|
180
|
+
composed: true,
|
|
181
|
+
});
|
|
182
|
+
if (this.dispatchEvent(event)) {
|
|
183
|
+
this.hidden = true;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
render() {
|
|
187
|
+
const iconName = this.symbol ?? DEFAULT_ICONS[this._safeVariant];
|
|
188
|
+
return html `
|
|
189
|
+
<btu-icon
|
|
190
|
+
class="btu-message-icon"
|
|
191
|
+
symbol="${iconName}"
|
|
192
|
+
size="md"
|
|
193
|
+
aria-hidden="true"
|
|
194
|
+
data-message-internal
|
|
195
|
+
></btu-icon>
|
|
196
|
+
<div class="btu-message-body" data-message-internal>
|
|
197
|
+
<div class="btu-message-text">
|
|
198
|
+
<div class="btu-message-header">
|
|
199
|
+
<div class="btu-message-badge"></div>
|
|
200
|
+
${this.label ? html `<span class="btu-message-label">${this.label}</span>` : nothing}
|
|
201
|
+
</div>
|
|
202
|
+
<div class="btu-message-description"></div>
|
|
203
|
+
</div>
|
|
204
|
+
<div class="btu-message-actions"></div>
|
|
205
|
+
</div>
|
|
206
|
+
${this.dismissible
|
|
207
|
+
? html `<btu-icon-button
|
|
208
|
+
class="btu-message-dismiss"
|
|
209
|
+
symbol="x"
|
|
210
|
+
type="tertiary-clear"
|
|
211
|
+
size="sm"
|
|
212
|
+
aria-label="${l10n('message', 'dismiss', 'Dismiss')}"
|
|
213
|
+
@click=${this._handleDismiss}
|
|
214
|
+
data-message-internal
|
|
215
|
+
></btu-icon-button>`
|
|
216
|
+
: nothing}
|
|
217
|
+
`;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
__decorate([
|
|
221
|
+
property({ type: String, reflect: true })
|
|
222
|
+
], Message.prototype, "variant", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
property({ type: String })
|
|
225
|
+
], Message.prototype, "label", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ type: String })
|
|
228
|
+
], Message.prototype, "symbol", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property({ type: Boolean, reflect: true })
|
|
231
|
+
], Message.prototype, "dismissible", void 0);
|
|
232
|
+
if (!customElements.get('btu-message')) {
|
|
233
|
+
customElements.define('btu-message', Message);
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=Message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../../src/components/banner/Message.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,MAAM,MAAM,sBAAsB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,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