@brightspot/ui 5.0.3-toggleable-fix.0 → 5.1.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/button-group/ButtonGroup.d.ts +21 -6
- package/dist/components/button-group/ButtonGroup.d.ts.map +1 -1
- package/dist/components/button-group/ButtonGroup.js +37 -20
- package/dist/components/button-group/ButtonGroup.js.map +1 -1
- package/dist/components/card/Card.css +7 -0
- package/dist/components/card/Card.d.ts +244 -0
- package/dist/components/card/Card.d.ts.map +1 -0
- package/dist/components/card/Card.js +512 -0
- package/dist/components/card/Card.js.map +1 -0
- package/dist/components/circular-progress/CircularProgress.js +2 -2
- package/dist/components/dropdown/DropdownItem.d.ts.map +1 -1
- package/dist/components/dropdown/DropdownItem.js +3 -4
- package/dist/components/dropdown/DropdownItem.js.map +1 -1
- package/dist/components/empty-state/EmptyState.d.ts +11 -2
- package/dist/components/empty-state/EmptyState.d.ts.map +1 -1
- package/dist/components/empty-state/EmptyState.js +19 -8
- package/dist/components/empty-state/EmptyState.js.map +1 -1
- package/dist/components/icon/Icon.d.ts.map +1 -1
- package/dist/components/icon/Icon.js +7 -4
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/linear-progress/LinearProgress.js +1 -1
- package/dist/components/tabs/Tab.js +1 -1
- package/dist/components/tabs/Tab.js.map +1 -1
- package/dist/components/upload/UploadItem.js +1 -1
- package/dist/components/upload/UploadItem.js.map +1 -1
- package/dist/components/widget/Widget.css +1 -1
- package/dist/components/widget/Widget.d.ts +11 -2
- package/dist/components/widget/Widget.d.ts.map +1 -1
- package/dist/components/widget/Widget.js +22 -11
- package/dist/components/widget/Widget.js.map +1 -1
- package/dist/custom-elements.json +2576 -2080
- package/dist/storybook/assets/{ActionBar.stories-CTrEOJBH.js → ActionBar.stories-D9ok2eVg.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-Cm3zQeMa.js → ActionItem.stories-DjPfYpgA.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-DSltfj-_.js → Avatar.stories-Di3s5wxK.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-BjL-l4VH.js → AvatarGroup.stories-CT7lYX_U.js} +5 -5
- package/dist/storybook/assets/{Badge.stories-DLNO3rOl.js → Badge.stories-9unZqfhH.js} +1 -1
- package/dist/storybook/assets/{Button-TUtCVpwY.js → Button-DuuAvVjP.js} +1 -1
- package/dist/storybook/assets/{Button.stories-3HjoUoaq.js → Button.stories-KDBmJ9xt.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-GF1UFxbr.js → ButtonGroup.stories-BeWYMkDy.js} +48 -48
- package/dist/storybook/assets/Card.stories-BNMJ-H5I.js +556 -0
- package/dist/storybook/assets/{Celebrate.stories-KtFU9NEQ.js → Celebrate.stories-Cue8O4hb.js} +7 -7
- package/dist/storybook/assets/{Checkbox.stories-CDg2caKU.js → Checkbox.stories-DLe4npId.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-C0OdRoxU.js → CircularProgress.stories-BHB2K82M.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-B6gIxMuH.js → ClipboardMixin.stories-mU-JGoHp.js} +2 -2
- package/dist/storybook/assets/{Color-6BZIO3FS-DDAuf4ms.js → Color-6BZIO3FS-D3GAvUXG.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-tJVgPDrl.js → Colors.stories-a83X2cLQ.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-BwrWmInr.js → CombinedEffects.stories-sLTopxBQ.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-B9_GeVBN.js → ComponentStatesMixin-CJ9pmXHc.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-BAn1JPCN.js → ComponentStatesMixin.stories-DSkFzAxR.js} +3 -3
- package/dist/storybook/assets/{CopyToClipboard.stories-YgaScv3O.js → CopyToClipboard.stories-DqMxtd4b.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-y-toLkyr.js → Debounce.stories-DV30whKw.js} +3 -3
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-BUwAiHkt.js → DocsRenderer-LL677BLK-DmVtYsJx.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-DAVkpuM5.js → Dropdown.stories-sCz8_Hkw.js} +3 -3
- package/dist/storybook/assets/{EmptyState.stories-Buexv2C4.js → EmptyState.stories-kBKfr87C.js} +15 -15
- package/dist/storybook/assets/{Events.stories-SjSVTFwA.js → Events.stories-BXdHEFJR.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-F7pp5AO4.js → Heading.stories-B2XJMBD8.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-Dt-QniLc.js → HueRipple.stories-BfzsAQYM.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-Cxknci9d.js → Icon.stories--pcHe1x-.js} +7 -7
- package/dist/storybook/assets/{IconButton.stories-C7nbDmmd.js → IconButton.stories-dbXfrgH3.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-DgP2rsiS.js → LinearProgress.stories-CApOBX0x.js} +1 -1
- package/dist/storybook/assets/OnFindMixin.stories-df6ckqw3.js +300 -0
- package/dist/storybook/assets/{Pagination.stories-DbLKeykx.js → Pagination.stories-_MiDRipW.js} +3 -3
- package/dist/storybook/assets/{Popover.stories-CbmWs7x-.js → Popover.stories-9hVZFeMx.js} +18 -18
- package/dist/storybook/assets/{ReadyMixin-BSMJuM5x.js → ReadyMixin-HHwtCrVi.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-DPojZp67.js → RovingTabindexMixin.stories-B6MPGbVh.js} +6 -6
- package/dist/storybook/assets/{Rtc.stories-BF7lM0fa.js → Rtc.stories-D3tZOSkM.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-DwVglPfj.js → ScrollShadow.stories-B1dTcJR4.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-DjjlIvXU.js → Switch.stories-Bp-Guy3z.js} +5 -5
- package/dist/storybook/assets/{Tab.stories-zUdDTEwX.js → Tab.stories-Caxi7G_1.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-yWCAVVnG.js → Tabs.stories-g5Nb7YDi.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-BrcbOwZL.js → Throttle.stories-BzWv-mzN.js} +5 -5
- package/dist/storybook/assets/{Tooltip.stories-B4sykiPz.js → Tooltip.stories-BlaTc14X.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-DHE43_Zz.js → Upload.stories-a9edmUmW.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-jqjcXP_N.js → UploadItem.stories-BOIu5j_i.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-C3rGMIU7.js → Welcome.stories-D33npbIl.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-D7rHrfAr.js → Widget.stories-D0vHPAyP.js} +12 -12
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-CYrPgwaa.js → WithTooltip-65CFNBJE-WOhnQufs.js} +1 -1
- package/dist/storybook/assets/{blocks-D8JszFZh.js → blocks-B17JEOI8.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-CGZPdVNG.js → formatter-EIJCOSYU-QKmiwKu7.js} +1 -1
- package/dist/storybook/assets/if-defined-0srVwUDm.js +1 -0
- package/dist/storybook/assets/iframe-BqpRijx3.js +1104 -0
- package/dist/storybook/assets/iframe-DfU9RLLj.css +1 -0
- package/dist/storybook/assets/{index-BZyp3DsT.js → index-CpksO7cK.js} +1 -1
- package/dist/storybook/assets/onFind-C_VPLxg8.js +1 -0
- package/dist/storybook/assets/{onFind.stories-BvaTMiWN.js → onFind.stories-BuZMC3tk.js} +38 -38
- package/dist/storybook/assets/{onRemove.stories-BPSyS2GE.js → onRemove.stories-HDkMhdmO.js} +3 -3
- package/dist/storybook/assets/{onVisible.stories-1lKUeGbt.js → onVisible.stories-CRCllRfN.js} +1 -1
- package/dist/storybook/assets/{style-map-ADugLljH.js → style-map-DukvFNCc.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-CBLos5mJ.js → syntaxhighlighter-ED5Y7EFY-BUo_WYvV.js} +1 -1
- package/dist/storybook/iframe.html +48 -2
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/tailwind-plugin-button-group.js +43 -44
- package/dist/tailwind-plugin-button-group.js.map +1 -1
- package/dist/tailwind-plugin-button-group.ts +43 -43
- package/dist/tailwind-plugin-button.js +22 -2
- package/dist/tailwind-plugin-button.js.map +1 -1
- package/dist/tailwind-plugin-button.ts +22 -2
- package/dist/tailwind-plugin-card.d.ts +2 -0
- package/dist/tailwind-plugin-card.d.ts.map +1 -0
- package/dist/tailwind-plugin-card.js +438 -0
- package/dist/tailwind-plugin-card.js.map +1 -0
- package/dist/tailwind-plugin-card.ts +515 -0
- package/dist/tailwind-plugin-dropdown.js +6 -2
- package/dist/tailwind-plugin-dropdown.js.map +1 -1
- package/dist/tailwind-plugin-dropdown.ts +6 -2
- package/dist/tailwind-plugin-pagination.js +12 -8
- package/dist/tailwind-plugin-pagination.js.map +1 -1
- package/dist/tailwind-plugin-pagination.ts +12 -8
- package/dist/tailwind-plugin-upload.js +3 -2
- package/dist/tailwind-plugin-upload.js.map +1 -1
- package/dist/tailwind-plugin-upload.ts +3 -2
- package/dist/tailwind.config.d.ts +1 -4
- package/dist/tailwind.config.d.ts.map +1 -1
- package/dist/tailwind.config.js +76 -6
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.ts +76 -6
- package/dist/util/EventEmitterMixin.d.ts +1 -0
- package/dist/util/EventEmitterMixin.d.ts.map +1 -1
- package/dist/util/EventEmitterMixin.js.map +1 -1
- package/dist/util/OnFindMixin.d.ts +55 -0
- package/dist/util/OnFindMixin.d.ts.map +1 -0
- package/dist/util/OnFindMixin.js +70 -0
- package/dist/util/OnFindMixin.js.map +1 -0
- package/dist/util/onFind.d.ts +4 -2
- package/dist/util/onFind.d.ts.map +1 -1
- package/dist/util/onFind.js +12 -0
- package/dist/util/onFind.js.map +1 -1
- package/docs/components/ButtonGroup.md +22 -15
- package/docs/components/Card.md +83 -0
- package/docs/components/EmptyState.md +10 -6
- package/docs/components/README.md +1 -0
- package/docs/components/Widget.md +18 -14
- package/package.json +4 -3
- package/src/legacy/tool-ui/src/AIInline.css +2 -2
- package/src/legacy/tool-ui/src/Admin.css +2 -2
- package/src/legacy/tool-ui/src/Base.css +1 -1
- package/src/legacy/tool-ui/src/BulkUpload.css +1 -1
- package/src/legacy/tool-ui/src/CIGCluster.css +1 -1
- package/src/legacy/tool-ui/src/Card.css +1 -1
- package/src/legacy/tool-ui/src/CodeMirror.css +4 -4
- package/src/legacy/tool-ui/src/ColorInputSpectrum.css +2 -2
- package/src/legacy/tool-ui/src/ComboInput.css +3 -3
- package/src/legacy/tool-ui/src/Compat.css +6 -4
- package/src/legacy/tool-ui/src/ContentEdit.css +12 -12
- package/src/legacy/tool-ui/src/ContentEditDrawer.css +6 -6
- package/src/legacy/tool-ui/src/ContentInputGroup.css +1 -1
- package/src/legacy/tool-ui/src/ContentReporting.css +2 -2
- package/src/legacy/tool-ui/src/ContentSelector.css +5 -5
- package/src/legacy/tool-ui/src/ContentSummary.css +1 -1
- package/src/legacy/tool-ui/src/ContentTemplatesWidget.css +1 -1
- package/src/legacy/tool-ui/src/ContentTools.css +1 -1
- package/src/legacy/tool-ui/src/Conversation.css +2 -2
- package/src/legacy/tool-ui/src/Crosslinker.css +3 -3
- package/src/legacy/tool-ui/src/DashboardWidget.css +1 -1
- package/src/legacy/tool-ui/src/Dialog.css +4 -2
- package/src/legacy/tool-ui/src/Diff.css +1 -1
- package/src/legacy/tool-ui/src/Dropdown.css +2 -2
- package/src/legacy/tool-ui/src/Enhancement.css +1 -1
- package/src/legacy/tool-ui/src/FileInput.css +2 -2
- package/src/legacy/tool-ui/src/FormFilter.css +3 -3
- package/src/legacy/tool-ui/src/FullscreenView.css +4 -4
- package/src/legacy/tool-ui/src/Guide.css +6 -6
- package/src/legacy/tool-ui/src/Hierarchy.css +4 -4
- package/src/legacy/tool-ui/src/ImageEditor.css +13 -13
- package/src/legacy/tool-ui/src/LinkCarousel.css +1 -1
- package/src/legacy/tool-ui/src/LiveBlog.css +2 -2
- package/src/legacy/tool-ui/src/LocationMap.css +1 -1
- package/src/legacy/tool-ui/src/MailPublishing.css +1 -1
- package/src/legacy/tool-ui/src/MenuView.css +4 -4
- package/src/legacy/tool-ui/src/Message.css +1 -1
- package/src/legacy/tool-ui/src/Page.css +35 -16
- package/src/legacy/tool-ui/src/Popup.css +8 -3
- package/src/legacy/tool-ui/src/ProseMirror.css +1 -1
- package/src/legacy/tool-ui/src/ProseMirrorContainer.css +1 -1
- package/src/legacy/tool-ui/src/ProseMirrorEnhancementMenu.css +2 -2
- package/src/legacy/tool-ui/src/ProseMirrorFindReplace.css +2 -2
- package/src/legacy/tool-ui/src/QueryField.css +1 -1
- package/src/legacy/tool-ui/src/RepeatableContentInputGroup.css +1 -1
- package/src/legacy/tool-ui/src/RepeatableContentSelector.css +1 -1
- package/src/legacy/tool-ui/src/RichText.css +1 -1
- package/src/legacy/tool-ui/src/SearchFields.css +3 -2
- package/src/legacy/tool-ui/src/SearchResult.css +3 -3
- package/src/legacy/tool-ui/src/SearchWidget.css +1 -1
- package/src/legacy/tool-ui/src/SearchWidget.ts +10 -1
- package/src/legacy/tool-ui/src/SearchWidgetAdvanced.css +1 -1
- package/src/legacy/tool-ui/src/StyleEmbeddedContent.css +3 -3
- package/src/legacy/tool-ui/src/TabBar.css +1 -1
- package/src/legacy/tool-ui/src/Table.css +1 -1
- package/src/legacy/tool-ui/src/Taxonomy.css +4 -4
- package/src/legacy/tool-ui/src/ThemeBundleEditor.css +1 -1
- package/src/legacy/tool-ui/src/TimedContent.css +2 -2
- package/src/legacy/tool-ui/src/ViewWatchers.css +1 -1
- package/src/legacy/tool-ui/src/Widget.css +1 -1
- package/src/legacy/tool-ui/src/Workflow.css +3 -3
- package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.945bd28778b1a3e937c7.js → RTEProseMirror.e8344eaeea387c600257.js} +12 -12
- package/src/legacy/tool-ui/src/main/webapp/dist/{v4.c5bcef50efdfa2d2e35f.js → v4.b892feb8ec199202fd18.js} +4 -4
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.86effb9bf858ae7b0640.js → v5.493c3ddf65c4fa599ff0.js} +4 -4
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.d49a759cb0b7cffd76e4.css +5 -0
- package/src/legacy/tool-ui/src/v5.ts +3 -1
- package/dist/storybook/assets/if-defined-BkzXcv-a.js +0 -1
- package/dist/storybook/assets/iframe-C3TUQi31.js +0 -1104
- package/dist/storybook/assets/iframe-D0roG0J-.css +0 -1
- package/dist/storybook/assets/onFind-9HPhEfV5.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.d6cc2743243cadb90492.css +0 -5
- /package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.945bd28778b1a3e937c7.js.LICENSE.txt → RTEProseMirror.e8344eaeea387c600257.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v4.c5bcef50efdfa2d2e35f.js.LICENSE.txt → v4.b892feb8ec199202fd18.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v5.86effb9bf858ae7b0640.js.LICENSE.txt → v5.493c3ddf65c4fa599ff0.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as S,x as t}from"./iframe-
|
|
1
|
+
import{g as S,x as t}from"./iframe-BqpRijx3.js";import{o as f}from"./style-map-DukvFNCc.js";import"./preload-helper-PPVm8Dsz.js";const{events:O,args:A,argTypes:n}=S("btu-dropdown"),B={title:"Components/Dropdown",component:"btu-dropdown",tags:["autodocs"],parameters:{docs:{subtitle:"btu-dropdown",description:{component:`
|
|
2
2
|
A dropdown menu component that renders a trigger button and manages a floating panel
|
|
3
3
|
containing a \`btu-dropdown-menu\` with \`btu-dropdown-item\` children.
|
|
4
4
|
|
|
@@ -271,7 +271,7 @@ Follows the WAI-ARIA Menu Button Pattern for keyboard navigation and accessibili
|
|
|
271
271
|
`,parameters:{docs:{description:{story:'When a menu has no focusable items, an empty state message is displayed. Customize with the `empty-message` attribute (default: "No items available").'}}}},h={render:()=>t`
|
|
272
272
|
<div style="display: flex; gap: 1rem; align-items: center;">
|
|
273
273
|
<button
|
|
274
|
-
class="btu-button
|
|
274
|
+
class="btu-button btu-button-primary btu-button-md"
|
|
275
275
|
@click=${o=>{const e=o.target.parentElement?.querySelector("btu-dropdown");e&&(e.open=!e.open)}}
|
|
276
276
|
>
|
|
277
277
|
Toggle Dropdown
|
|
@@ -657,7 +657,7 @@ Follows the WAI-ARIA Menu Button Pattern for keyboard navigation and accessibili
|
|
|
657
657
|
render: () => html\`
|
|
658
658
|
<div style="display: flex; gap: 1rem; align-items: center;">
|
|
659
659
|
<button
|
|
660
|
-
class="btu-button
|
|
660
|
+
class="btu-button btu-button-primary btu-button-md"
|
|
661
661
|
@click=\${(e: Event) => {
|
|
662
662
|
const dropdown = (e.target as HTMLElement).parentElement?.querySelector('btu-dropdown');
|
|
663
663
|
if (dropdown) dropdown.open = !dropdown.open;
|
package/dist/storybook/assets/{EmptyState.stories-Buexv2C4.js → EmptyState.stories-kBKfr87C.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as u,x as e}from"./iframe-
|
|
1
|
+
import{g as u,x as e}from"./iframe-BqpRijx3.js";import{o as m}from"./if-defined-0srVwUDm.js";import{o as h}from"./style-map-DukvFNCc.js";import"./preload-helper-PPVm8Dsz.js";const{events:b,args:g,argTypes:s}=u("btu-empty-state"),y=["sm","md","lg"],v=[1,2,3,4,5,6],k={title:"Components/Empty State",component:"btu-empty-state",tags:["autodocs"],parameters:{docs:{subtitle:"A standardized component for communicating the absence of content.",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>To communicate the absence of content in tables, lists, or search results</li>
|
|
@@ -33,8 +33,8 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
33
33
|
emphasize="pulse"
|
|
34
34
|
style="color: oklch(var(--btu-theme-primary-600))"
|
|
35
35
|
></btu-icon>
|
|
36
|
-
<button slot="actions" class="btu-button
|
|
37
|
-
<button slot="actions" class="btu-button
|
|
36
|
+
<button slot="actions" class="btu-button btu-button-gray">Clear search</button>
|
|
37
|
+
<button slot="actions" class="btu-button btu-button-primary">
|
|
38
38
|
<btu-icon symbol="plus"></btu-icon>Create new
|
|
39
39
|
</button>
|
|
40
40
|
</btu-empty-state>
|
|
@@ -56,12 +56,12 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
56
56
|
emphasize="pulse"
|
|
57
57
|
style="color: oklch(var(--btu-theme-primary-600))"
|
|
58
58
|
></btu-icon>
|
|
59
|
-
<button slot="actions" class="btu-button
|
|
59
|
+
<button slot="actions" class="btu-button btu-button-primary">Get started</button>
|
|
60
60
|
</btu-empty-state>
|
|
61
61
|
`,parameters:{docs:{description:{story:"Large variant for full-page empty states. Ideal for dashboards, landing pages, and first-run experiences where the empty state is the primary content."}}}},r={render:()=>e`
|
|
62
62
|
<btu-empty-state heading="No images uploaded" description="Upload images to see them displayed here." size="md">
|
|
63
63
|
<img slot="graphic" src="cloud-illustration.svg" alt="Cloud graphic" />
|
|
64
|
-
<button slot="actions" class="btu-button
|
|
64
|
+
<button slot="actions" class="btu-button btu-button-primary">Upload image</button>
|
|
65
65
|
</btu-empty-state>
|
|
66
66
|
`,parameters:{docs:{description:{story:"Uses a custom SVG in the graphic slot instead of a `btu-icon`. The graphic container automatically sizes `img`, `picture`, and `svg` elements larger than icons."}}}},c={render:()=>{const t=e`
|
|
67
67
|
<picture slot="graphic">
|
|
@@ -85,7 +85,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
85
85
|
<div style="width: 240px; border: 1px dashed oklch(var(--btu-theme-gray-300));">
|
|
86
86
|
<btu-empty-state heading="No results" description="Try a different query." size="sm">
|
|
87
87
|
${t}
|
|
88
|
-
<button slot="actions" class="btu-button
|
|
88
|
+
<button slot="actions" class="btu-button btu-button-gray btu-button-sm">Clear</button>
|
|
89
89
|
</btu-empty-state>
|
|
90
90
|
</div>
|
|
91
91
|
<div style="width: 360px; border: 1px dashed oklch(var(--btu-theme-gray-300));">
|
|
@@ -95,7 +95,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
95
95
|
size="md"
|
|
96
96
|
>
|
|
97
97
|
${t}
|
|
98
|
-
<button slot="actions" class="btu-button
|
|
98
|
+
<button slot="actions" class="btu-button btu-button-primary">Upload image</button>
|
|
99
99
|
</btu-empty-state>
|
|
100
100
|
</div>
|
|
101
101
|
<div style="width: 520px; border: 1px dashed oklch(var(--btu-theme-gray-300));">
|
|
@@ -105,7 +105,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
105
105
|
size="lg"
|
|
106
106
|
>
|
|
107
107
|
${t}
|
|
108
|
-
<button slot="actions" class="btu-button
|
|
108
|
+
<button slot="actions" class="btu-button btu-button-primary">Get started</button>
|
|
109
109
|
</btu-empty-state>
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
@@ -132,7 +132,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
132
132
|
emphasize="pulse"
|
|
133
133
|
style="color: oklch(var(--btu-theme-gray-500))"
|
|
134
134
|
></btu-icon>
|
|
135
|
-
<button slot="actions" class="btu-button
|
|
135
|
+
<button slot="actions" class="btu-button btu-button-success btu-button-sm">Add item</button>
|
|
136
136
|
</btu-empty-state>
|
|
137
137
|
`,parameters:{docs:{description:{story:"Empty state with heading and actions but no description. The description is omitted by not setting the `description` attribute."}}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
|
|
138
138
|
args: {
|
|
@@ -176,7 +176,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
176
176
|
emphasize="pulse"
|
|
177
177
|
style="color: oklch(var(--btu-theme-primary-600))"
|
|
178
178
|
></btu-icon>
|
|
179
|
-
<button slot="actions" class="btu-button
|
|
179
|
+
<button slot="actions" class="btu-button btu-button-primary">Get started</button>
|
|
180
180
|
</btu-empty-state>
|
|
181
181
|
\`,
|
|
182
182
|
parameters: {
|
|
@@ -190,7 +190,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
190
190
|
render: () => html\`
|
|
191
191
|
<btu-empty-state heading="No images uploaded" description="Upload images to see them displayed here." size="md">
|
|
192
192
|
<img slot="graphic" src="cloud-illustration.svg" alt="Cloud graphic" />
|
|
193
|
-
<button slot="actions" class="btu-button
|
|
193
|
+
<button slot="actions" class="btu-button btu-button-primary">Upload image</button>
|
|
194
194
|
</btu-empty-state>
|
|
195
195
|
\`,
|
|
196
196
|
parameters: {
|
|
@@ -230,7 +230,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
230
230
|
<div style="width: 240px; border: 1px dashed oklch(var(--btu-theme-gray-300));">
|
|
231
231
|
<btu-empty-state heading="No results" description="Try a different query." size="sm">
|
|
232
232
|
\${responsiveGraphic}
|
|
233
|
-
<button slot="actions" class="btu-button
|
|
233
|
+
<button slot="actions" class="btu-button btu-button-gray btu-button-sm">Clear</button>
|
|
234
234
|
</btu-empty-state>
|
|
235
235
|
</div>
|
|
236
236
|
<div style="width: 360px; border: 1px dashed oklch(var(--btu-theme-gray-300));">
|
|
@@ -240,7 +240,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
240
240
|
size="md"
|
|
241
241
|
>
|
|
242
242
|
\${responsiveGraphic}
|
|
243
|
-
<button slot="actions" class="btu-button
|
|
243
|
+
<button slot="actions" class="btu-button btu-button-primary">Upload image</button>
|
|
244
244
|
</btu-empty-state>
|
|
245
245
|
</div>
|
|
246
246
|
<div style="width: 520px; border: 1px dashed oklch(var(--btu-theme-gray-300));">
|
|
@@ -250,7 +250,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
250
250
|
size="lg"
|
|
251
251
|
>
|
|
252
252
|
\${responsiveGraphic}
|
|
253
|
-
<button slot="actions" class="btu-button
|
|
253
|
+
<button slot="actions" class="btu-button btu-button-primary">Get started</button>
|
|
254
254
|
</btu-empty-state>
|
|
255
255
|
</div>
|
|
256
256
|
</div>
|
|
@@ -305,7 +305,7 @@ import{g as u,x as e}from"./iframe-C3TUQi31.js";import{o as m}from"./if-defined-
|
|
|
305
305
|
emphasize="pulse"
|
|
306
306
|
style="color: oklch(var(--btu-theme-gray-500))"
|
|
307
307
|
></btu-icon>
|
|
308
|
-
<button slot="actions" class="btu-button
|
|
308
|
+
<button slot="actions" class="btu-button btu-button-success btu-button-sm">Add item</button>
|
|
309
309
|
</btu-empty-state>
|
|
310
310
|
\`,
|
|
311
311
|
parameters: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as d}from"./iframe-
|
|
1
|
+
import{x as d}from"./iframe-BqpRijx3.js";import"./preload-helper-PPVm8Dsz.js";var n=Object.freeze,r=Object.defineProperty,s=(t,i)=>n(r(t,"raw",{value:n(t.slice())})),o;const l={title:"Mixins/Events",tags:["autodocs"],parameters:{docs:{subtitle:"Events inherited from EventEmitterMixin",description:{component:`
|
|
2
2
|
<h3>EventEmitterMixin Events</h3>
|
|
3
3
|
|
|
4
4
|
<p>All Brightspot UI components that extend EventEmitterMixin emit the following lifecycle events in addition to those inherited from LitElement. These events use CustomEvent and bubble through the DOM with <code>composed: true</code>, meaning they cross shadow DOM boundaries.</p>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{x as s}from"./iframe-
|
|
1
|
+
import{x as s}from"./iframe-BqpRijx3.js";import"./preload-helper-PPVm8Dsz.js";const r=({size:t})=>s` <div class=${[`btu-heading-${t}`].join(" ")}>Heading</div> `,o={title:"CSS Plugins/Heading",component:"btu-heading",tags:["autodocs"],parameters:{docs:{subtitle:"This Tailwind CSS plugin provides the `.btu-heading` utility class for styling headings. It supports five different sizes, from 1 (largest) to 5 (smallest). Apply the class to `<h1>` through `<h5>` elements to style them accordingly."},controls:{expanded:!0}},render:t=>r(t),argTypes:{size:{control:{type:"range",min:1,max:5,step:1},description:"Heading size from 1 to 5, where 1 is the largest and 5 is the smallest."}},args:{size:1}},e={args:{}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
|
|
2
2
|
args: {}
|
|
3
3
|
}`,...e.parameters?.docs?.source}}};const n=["Default"];export{e as Default,n as __namedExportsOrder,o as default};
|
package/dist/storybook/assets/{HueRipple.stories-Dt-QniLc.js → HueRipple.stories-BfzsAQYM.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as i}from"./iframe-
|
|
1
|
+
import{x as i}from"./iframe-BqpRijx3.js";import{b as l}from"./ripple-DQbyyRUw.js";import{B as e}from"./Button-DuuAvVjP.js";import"./preload-helper-PPVm8Dsz.js";import"./position-CFNQy3J6.js";const m={title:"Effects/Hue Ripple",tags:["autodocs"],parameters:{docs:{subtitle:"Click anywhere to send a hue-shifting ripple across the viewport",description:{component:`
|
|
2
2
|
Uses the **View Transition API** to create an expanding ring that reveals OKLCH-shifted colors as it sweeps past each element, then they return to normal.
|
|
3
3
|
|
|
4
4
|
### Usage
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g,x as s}from"./iframe-
|
|
1
|
+
import{g,x as s}from"./iframe-BqpRijx3.js";import{o as h}from"./style-map-DukvFNCc.js";import{L as u}from"./LucideDynamicLoader-jmdq8YDM.js";import"./preload-helper-PPVm8Dsz.js";const{events:x,args:v,argTypes:i}=g("btu-icon"),b=["xs","sm","md","lg","xl"],f=["ai","error","gray","primary","purple","rose","success","teal","warning"],C={title:"Components/Icon",component:"btu-icon",tags:["autodocs"],parameters:{docs:{subtitle:"An icon component using Lucide icons with built-in support for custom colors and sizes.",description:{component:`
|
|
2
2
|
<strong>When to use:</strong>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>To visually reinforce actions, states, or categories</li>
|
|
@@ -95,7 +95,7 @@ import{g,x as s}from"./iframe-C3TUQi31.js";import{o as h}from"./style-map-ADugLl
|
|
|
95
95
|
|
|
96
96
|
<div class="flex items-center gap-2">
|
|
97
97
|
<strong>Unlabeled icon button (A11y concern!):</strong>
|
|
98
|
-
<button class="btu-button
|
|
98
|
+
<button class="btu-button btu-button-fill-none btu-button-error btu-button-sm">
|
|
99
99
|
<btu-icon symbol="trash-2" size="md" class="text-gray-900"></btu-icon>
|
|
100
100
|
</button>
|
|
101
101
|
</div>
|
|
@@ -103,7 +103,7 @@ import{g,x as s}from"./iframe-C3TUQi31.js";import{o as h}from"./style-map-ADugLl
|
|
|
103
103
|
<div class="flex items-center gap-2">
|
|
104
104
|
<strong>Labeled via <code>aria-label</code> and <code>title</code>:</strong>
|
|
105
105
|
<button
|
|
106
|
-
class="btu-button
|
|
106
|
+
class="btu-button btu-button-primary btu-button-sm"
|
|
107
107
|
aria-label="Favorite this item"
|
|
108
108
|
title="Favorite this item"
|
|
109
109
|
>
|
|
@@ -113,7 +113,7 @@ import{g,x as s}from"./iframe-C3TUQi31.js";import{o as h}from"./style-map-ADugLl
|
|
|
113
113
|
|
|
114
114
|
<div class="flex items-center gap-2">
|
|
115
115
|
<strong>Labeled via accompanying text:</strong>
|
|
116
|
-
<button class="btu-button
|
|
116
|
+
<button class="btu-button btu-button-fill-none btu-button-primary btu-button-sm">
|
|
117
117
|
<btu-icon symbol="heart" size="md"></btu-icon>
|
|
118
118
|
<span class="ml-1">Favorite</span>
|
|
119
119
|
</button>
|
|
@@ -276,7 +276,7 @@ import{g,x as s}from"./iframe-C3TUQi31.js";import{o as h}from"./style-map-ADugLl
|
|
|
276
276
|
|
|
277
277
|
<div class="flex items-center gap-2">
|
|
278
278
|
<strong>Unlabeled icon button (A11y concern!):</strong>
|
|
279
|
-
<button class="btu-button
|
|
279
|
+
<button class="btu-button btu-button-fill-none btu-button-error btu-button-sm">
|
|
280
280
|
<btu-icon symbol="trash-2" size="md" class="text-gray-900"></btu-icon>
|
|
281
281
|
</button>
|
|
282
282
|
</div>
|
|
@@ -284,7 +284,7 @@ import{g,x as s}from"./iframe-C3TUQi31.js";import{o as h}from"./style-map-ADugLl
|
|
|
284
284
|
<div class="flex items-center gap-2">
|
|
285
285
|
<strong>Labeled via <code>aria-label</code> and <code>title</code>:</strong>
|
|
286
286
|
<button
|
|
287
|
-
class="btu-button
|
|
287
|
+
class="btu-button btu-button-primary btu-button-sm"
|
|
288
288
|
aria-label="Favorite this item"
|
|
289
289
|
title="Favorite this item"
|
|
290
290
|
>
|
|
@@ -294,7 +294,7 @@ import{g,x as s}from"./iframe-C3TUQi31.js";import{o as h}from"./style-map-ADugLl
|
|
|
294
294
|
|
|
295
295
|
<div class="flex items-center gap-2">
|
|
296
296
|
<strong>Labeled via accompanying text:</strong>
|
|
297
|
-
<button class="btu-button
|
|
297
|
+
<button class="btu-button btu-button-fill-none btu-button-primary btu-button-sm">
|
|
298
298
|
<btu-icon symbol="heart" size="md"></btu-icon>
|
|
299
299
|
<span class="ml-1">Favorite</span>
|
|
300
300
|
</button>
|
package/dist/storybook/assets/{IconButton.stories-C7nbDmmd.js → IconButton.stories-dbXfrgH3.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as p,x as e}from"./iframe-
|
|
1
|
+
import{g as p,x as e}from"./iframe-BqpRijx3.js";import{o as b}from"./if-defined-0srVwUDm.js";import{L as d}from"./LucideDynamicLoader-jmdq8YDM.js";import"./preload-helper-PPVm8Dsz.js";const{events:u,args:y,argTypes:o}=p("btu-icon-button"),x={title:"Components/Icon Button",component:"btu-icon-button",tags:["autodocs"],parameters:{docs:{subtitle:"Combines button styles with the icon component along with an opinionated API",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>For actions in compact or space-constrained interfaces (toolbars, tables, cards)</li>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as D,E as h,x as T}from"./iframe-
|
|
1
|
+
import{g as D,E as h,x as T}from"./iframe-BqpRijx3.js";import{o as A}from"./style-map-DukvFNCc.js";import"./preload-helper-PPVm8Dsz.js";const{events:V,args:k,argTypes:g}=D("btu-linear-progress"),W={title:"Components/Linear Progress",component:"btu-linear-progress",tags:["autodocs"],parameters:{docs:{subtitle:"A horizontal progress bar for showing task completion",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>To show progress of a specific task with known completion percentage</li>
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import{x as h,i as v}from"./iframe-BqpRijx3.js";import{o as k}from"./onFind-C_VPLxg8.js";import"./preload-helper-PPVm8Dsz.js";const x=e=>{class n extends e{#t=[];onFindRegistration(){return null}#e(){if(this.#t.length)return;const i=this.onFindRegistration();if(!i)return;const d=Array.isArray(i)?i:[i];this.#t=d.map(c=>k(this,c.selectors,c.callback))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.#e()}firstUpdated(i){super.firstUpdated(i),this.#e()}disconnectedCallback(){super.disconnectedCallback(),this.#t.forEach(i=>i()),this.#t=[]}}return n},{expect:a,userEvent:l,waitFor:r,within:w}=__STORYBOOK_MODULE_TEST__,b="ofm-demo";if(!customElements.get(b)){class e extends x(v){onFindRegistration(){return{selectors:":scope > .ofm-item",callback:t=>t.classList.add("ring-2","ring-success-500")}}render(){return h`<slot></slot>`}}customElements.define(b,e)}const p="ofm-multi";if(!customElements.get(p)){class e extends x(v){onFindRegistration(){return[{selectors:":scope > .ofm-a",callback:t=>t.classList.add("ring-2","ring-success-500")},{selectors:":scope > .ofm-b",callback:t=>t.classList.add("ring-2","ring-primary-500")}]}render(){return h`<slot></slot>`}}customElements.define(p,e)}function g(){return globalThis[Symbol.for("brightspot.onFind")]?.callbacks?.length??0}const M={title:"Mixins/OnFind Mixin",tags:["autodocs"],parameters:{docs:{description:{component:`
|
|
2
|
+
\`OnFindMixin\` registers an \`onFind\` child-redistribution callback and
|
|
3
|
+
**tears it down on disconnect**, so a detached component is garbage-collectable
|
|
4
|
+
and stops being visited on every document mutation.
|
|
5
|
+
|
|
6
|
+
\`onFind\` is backed by a single global \`MutationObserver\` and a global list of
|
|
7
|
+
callbacks. A component that registers a callback but never removes it keeps
|
|
8
|
+
itself reachable forever and adds permanent per-mutation work. This mixin owns
|
|
9
|
+
that lifecycle so individual components don't have to hand-wire it.
|
|
10
|
+
|
|
11
|
+
<h3>What OnFindMixin Does</h3>
|
|
12
|
+
<ul>
|
|
13
|
+
<li>Registers the component's \`onFind\` callback after first render (in \`firstUpdated\`).</li>
|
|
14
|
+
<li>Disposes the registration in \`disconnectedCallback\` so a removed component can be GC'd.</li>
|
|
15
|
+
<li>Re-arms the registration on reattach — \`firstUpdated\` only fires once, so \`connectedCallback\` re-registers when \`hasUpdated\` is true.</li>
|
|
16
|
+
<li>Stays idempotent: arming while already registered is a no-op.</li>
|
|
17
|
+
</ul>
|
|
18
|
+
|
|
19
|
+
<h3>The Contract</h3>
|
|
20
|
+
<p>A component declares <b>what</b> to register by implementing
|
|
21
|
+
\`onFindRegistration()\`, which returns <code>{ selectors, callback }</code>,
|
|
22
|
+
\`null\` to skip (e.g. when required containers aren't present yet), or an
|
|
23
|
+
<b>array</b> of registrations for several independent sweeps (all disposed
|
|
24
|
+
together on disconnect). It is re-invoked on every registration, so query
|
|
25
|
+
containers <b>inside</b> it rather than capturing them once — a reattach then
|
|
26
|
+
re-binds against the current DOM.</p>
|
|
27
|
+
|
|
28
|
+
<p>The <code>callback</code> must be <b>idempotent</b>: on reattach the mixin
|
|
29
|
+
re-runs \`onFind\`'s initial sweep, so it may be called again for a child that is
|
|
30
|
+
already placed.</p>
|
|
31
|
+
|
|
32
|
+
<p>Subclasses that override \`firstUpdated\` <b>must</b> call
|
|
33
|
+
\`super.firstUpdated()\`, or the initial registration never runs.</p>
|
|
34
|
+
|
|
35
|
+
<h3>Mixin Composition</h3>
|
|
36
|
+
|
|
37
|
+
<p>Place OnFindMixin near the base, just outside ReadyMixin, so it inherits the
|
|
38
|
+
DOM-ready guarantee:</p>
|
|
39
|
+
|
|
40
|
+
<p> ✅ Correct
|
|
41
|
+
EventEmitterMixin(OnFindMixin(ReadyMixin(LitElement)))</p>
|
|
42
|
+
|
|
43
|
+
<h3>Usage</h3>
|
|
44
|
+
\`\`\`typescript
|
|
45
|
+
import { OnFindMixin } from './OnFindMixin'
|
|
46
|
+
|
|
47
|
+
class Card extends OnFindMixin(ReadyMixin(LitElement)) {
|
|
48
|
+
firstUpdated(changed) {
|
|
49
|
+
super.firstUpdated(changed) // arms onFind
|
|
50
|
+
this.emit('btu-card-ready')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
onFindRegistration() {
|
|
54
|
+
return {
|
|
55
|
+
selectors: ':scope > [slot], :scope > img, :scope > btu-badge, :scope > btu-icon',
|
|
56
|
+
callback: el => this.redistributeChild(el),
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
\`\`\`
|
|
61
|
+
`}}}},u={render:()=>{const e=`ofm-${Math.random().toString(36).slice(2,8)}`,n=g();let t=null,i=0;const d=()=>requestAnimationFrame(()=>{const s=document.getElementById(`${e}-count`);s&&(s.textContent=String(g()-n))}),c=()=>{i++;const s=document.createElement("div");return s.className="ofm-item rounded border bg-white p-3 text-sm",s.textContent=`Child ${i}`,s};return h`
|
|
62
|
+
<div class="space-y-4">
|
|
63
|
+
<p class="text-base">
|
|
64
|
+
The element below uses <code>OnFindMixin</code>. <strong>Mount</strong> registers its onFind callback;
|
|
65
|
+
<strong>Unmount</strong> disposes it (no leak); mounting again re-arms it. Watch the global callback count
|
|
66
|
+
rise to 1 on mount and fall back to 0 on unmount. <strong>Add child</strong> shows onFind still detecting and
|
|
67
|
+
highlighting children added at runtime.
|
|
68
|
+
</p>
|
|
69
|
+
|
|
70
|
+
<div class="flex gap-2">
|
|
71
|
+
<button data-testid="mount" @click=${()=>{const s=document.getElementById(`${e}-stage`);s&&(t||(t=document.createElement(b),t.append(c(),c())),t.isConnected||s.appendChild(t),d())}} class="btu-button btu-button-primary btu-button-sm">Mount</button>
|
|
72
|
+
<button data-testid="unmount" @click=${()=>{t?.remove(),d()}} class="btu-button btu-button-gray btu-button-sm">
|
|
73
|
+
Unmount
|
|
74
|
+
</button>
|
|
75
|
+
<button data-testid="add-child" @click=${()=>{t?.isConnected&&t.appendChild(c())}} class="btu-button btu-button-gray btu-button-sm">
|
|
76
|
+
Add child
|
|
77
|
+
</button>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div id="${e}-stage" class="min-h-32 space-y-2 rounded border-2 border-gray-300 bg-gray-50 p-4">
|
|
81
|
+
<div class="text-sm text-gray-500">Mount the component to see its children detected and highlighted…</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div>
|
|
85
|
+
<div class="text-xs text-gray-500">onFind callbacks registered by this demo</div>
|
|
86
|
+
<div data-testid="count" id="${e}-count" class="text-2xl font-bold text-primary-600">0</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
`},parameters:{docs:{description:{story:'Live demo of the OnFindMixin lifecycle. Mounting registers an onFind callback (count → 1), unmounting disposes it (count → 0, so the detached element is collectable), and mounting again re-arms it. "Add child" shows onFind continuing to detect and highlight children added at runtime.'}}},play:async({canvasElement:e,step:n})=>{const t=w(e);await n("Mount registers a callback",async()=>{await l.click(t.getByTestId("mount")),await r(()=>a(t.getByTestId("count")).toHaveTextContent("1"))}),await n("Unmount disposes it (no leak)",async()=>{await l.click(t.getByTestId("unmount")),await r(()=>a(t.getByTestId("count")).toHaveTextContent("0"))}),await n("Re-mount re-arms it",async()=>{await l.click(t.getByTestId("mount")),await r(()=>a(t.getByTestId("count")).toHaveTextContent("1"))})}},m={render:()=>{const e=`ofm-multi-${Math.random().toString(36).slice(2,8)}`,n=g();let t=null;const i=()=>requestAnimationFrame(()=>{const o=document.getElementById(`${e}-count`);o&&(o.textContent=String(g()-n))}),d=(o,y)=>{const s=document.createElement("div");return s.className=`${o} rounded border bg-white p-3 text-sm`,s.textContent=y,s};return h`
|
|
90
|
+
<div class="space-y-4">
|
|
91
|
+
<p class="text-base">
|
|
92
|
+
This element registers <strong>two</strong> independent onFind sweeps via an array (<code
|
|
93
|
+
>onFindRegistration</code
|
|
94
|
+
>
|
|
95
|
+
returns <code>[A, B]</code>). Mounting registers both (count → 2), unmounting disposes both together (count →
|
|
96
|
+
0), and each sweep highlights only its own child type.
|
|
97
|
+
</p>
|
|
98
|
+
|
|
99
|
+
<div class="flex gap-2">
|
|
100
|
+
<button data-testid="multi-mount" @click=${()=>{const o=document.getElementById(`${e}-stage`);o&&(t||(t=document.createElement(p),t.append(d("ofm-a","Sweep A child"),d("ofm-b","Sweep B child"))),t.isConnected||o.appendChild(t),i())}} class="btu-button btu-button-primary btu-button-sm">
|
|
101
|
+
Mount
|
|
102
|
+
</button>
|
|
103
|
+
<button data-testid="multi-unmount" @click=${()=>{t?.remove(),i()}} class="btu-button btu-button-gray btu-button-sm">
|
|
104
|
+
Unmount
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div id="${e}-stage" class="min-h-32 space-y-2 rounded border-2 border-gray-300 bg-gray-50 p-4">
|
|
109
|
+
<div class="text-sm text-gray-500">Mount to see both sweeps register and highlight their children…</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div>
|
|
113
|
+
<div class="text-xs text-gray-500">onFind callbacks registered by this demo</div>
|
|
114
|
+
<div data-testid="multi-count" id="${e}-count" class="text-2xl font-bold text-primary-600">0</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
`},parameters:{docs:{description:{story:"Exercises the array form of onFindRegistration: one element registers two independent sweeps. Mounting registers both callbacks (count → 2), each sweep highlights only its own child type, and unmounting disposes both together (count → 0)."}}},play:async({canvasElement:e,step:n})=>{const t=w(e);await n("Mount registers both sweeps",async()=>{await l.click(t.getByTestId("multi-mount")),await r(()=>a(t.getByTestId("multi-count")).toHaveTextContent("2"))}),await n("Each sweep detects its own children",async()=>{await r(()=>{a(e.querySelector(".ofm-a.ring-2")).toBeTruthy(),a(e.querySelector(".ofm-b.ring-2")).toBeTruthy()})}),await n("Unmount disposes both",async()=>{await l.click(t.getByTestId("multi-unmount")),await r(()=>a(t.getByTestId("multi-count")).toHaveTextContent("0"))}),await n("Re-mount re-arms both",async()=>{await l.click(t.getByTestId("multi-mount")),await r(()=>a(t.getByTestId("multi-count")).toHaveTextContent("2"))})}};u.parameters={...u.parameters,docs:{...u.parameters?.docs,source:{originalSource:`{
|
|
118
|
+
render: () => {
|
|
119
|
+
const id = \`ofm-\${Math.random().toString(36).slice(2, 8)}\`;
|
|
120
|
+
const baseline = onFindCallbackCount();
|
|
121
|
+
let demoEl: HTMLElement | null = null;
|
|
122
|
+
let childN = 0;
|
|
123
|
+
const refresh = () => requestAnimationFrame(() => {
|
|
124
|
+
const el = document.getElementById(\`\${id}-count\`);
|
|
125
|
+
if (el) el.textContent = String(onFindCallbackCount() - baseline);
|
|
126
|
+
});
|
|
127
|
+
const makeChild = () => {
|
|
128
|
+
childN++;
|
|
129
|
+
const c = document.createElement('div');
|
|
130
|
+
c.className = 'ofm-item rounded border bg-white p-3 text-sm';
|
|
131
|
+
c.textContent = \`Child \${childN}\`;
|
|
132
|
+
return c;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// Mount creates the element on first use, or re-attaches the same detached
|
|
136
|
+
// instance afterwards — that re-attach is what exercises the mixin's reattach
|
|
137
|
+
// re-arm path.
|
|
138
|
+
const mount = () => {
|
|
139
|
+
const stage = document.getElementById(\`\${id}-stage\`);
|
|
140
|
+
if (!stage) return;
|
|
141
|
+
if (!demoEl) {
|
|
142
|
+
demoEl = document.createElement(DEMO_TAG);
|
|
143
|
+
demoEl.append(makeChild(), makeChild());
|
|
144
|
+
}
|
|
145
|
+
if (!demoEl.isConnected) stage.appendChild(demoEl);
|
|
146
|
+
refresh();
|
|
147
|
+
};
|
|
148
|
+
const unmount = () => {
|
|
149
|
+
demoEl?.remove();
|
|
150
|
+
refresh();
|
|
151
|
+
};
|
|
152
|
+
const addChild = () => {
|
|
153
|
+
if (demoEl?.isConnected) demoEl.appendChild(makeChild());
|
|
154
|
+
};
|
|
155
|
+
return html\`
|
|
156
|
+
<div class="space-y-4">
|
|
157
|
+
<p class="text-base">
|
|
158
|
+
The element below uses <code>OnFindMixin</code>. <strong>Mount</strong> registers its onFind callback;
|
|
159
|
+
<strong>Unmount</strong> disposes it (no leak); mounting again re-arms it. Watch the global callback count
|
|
160
|
+
rise to 1 on mount and fall back to 0 on unmount. <strong>Add child</strong> shows onFind still detecting and
|
|
161
|
+
highlighting children added at runtime.
|
|
162
|
+
</p>
|
|
163
|
+
|
|
164
|
+
<div class="flex gap-2">
|
|
165
|
+
<button data-testid="mount" @click=\${mount} class="btu-button btu-button-primary btu-button-sm">Mount</button>
|
|
166
|
+
<button data-testid="unmount" @click=\${unmount} class="btu-button btu-button-gray btu-button-sm">
|
|
167
|
+
Unmount
|
|
168
|
+
</button>
|
|
169
|
+
<button data-testid="add-child" @click=\${addChild} class="btu-button btu-button-gray btu-button-sm">
|
|
170
|
+
Add child
|
|
171
|
+
</button>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div id="\${id}-stage" class="min-h-32 space-y-2 rounded border-2 border-gray-300 bg-gray-50 p-4">
|
|
175
|
+
<div class="text-sm text-gray-500">Mount the component to see its children detected and highlighted…</div>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<div>
|
|
179
|
+
<div class="text-xs text-gray-500">onFind callbacks registered by this demo</div>
|
|
180
|
+
<div data-testid="count" id="\${id}-count" class="text-2xl font-bold text-primary-600">0</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
\`;
|
|
184
|
+
},
|
|
185
|
+
parameters: {
|
|
186
|
+
docs: {
|
|
187
|
+
description: {
|
|
188
|
+
story: 'Live demo of the OnFindMixin lifecycle. Mounting registers an onFind callback (count → 1), unmounting disposes it (count → 0, so the detached element is collectable), and mounting again re-arms it. "Add child" shows onFind continuing to detect and highlight children added at runtime.'
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
play: async ({
|
|
193
|
+
canvasElement,
|
|
194
|
+
step
|
|
195
|
+
}) => {
|
|
196
|
+
const canvas = within(canvasElement);
|
|
197
|
+
await step('Mount registers a callback', async () => {
|
|
198
|
+
await userEvent.click(canvas.getByTestId('mount'));
|
|
199
|
+
await waitFor(() => expect(canvas.getByTestId('count')).toHaveTextContent('1'));
|
|
200
|
+
});
|
|
201
|
+
await step('Unmount disposes it (no leak)', async () => {
|
|
202
|
+
await userEvent.click(canvas.getByTestId('unmount'));
|
|
203
|
+
await waitFor(() => expect(canvas.getByTestId('count')).toHaveTextContent('0'));
|
|
204
|
+
});
|
|
205
|
+
await step('Re-mount re-arms it', async () => {
|
|
206
|
+
await userEvent.click(canvas.getByTestId('mount'));
|
|
207
|
+
await waitFor(() => expect(canvas.getByTestId('count')).toHaveTextContent('1'));
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}`,...u.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
|
|
211
|
+
render: () => {
|
|
212
|
+
const id = \`ofm-multi-\${Math.random().toString(36).slice(2, 8)}\`;
|
|
213
|
+
const baseline = onFindCallbackCount();
|
|
214
|
+
let demoEl: HTMLElement | null = null;
|
|
215
|
+
const refresh = () => requestAnimationFrame(() => {
|
|
216
|
+
const el = document.getElementById(\`\${id}-count\`);
|
|
217
|
+
if (el) el.textContent = String(onFindCallbackCount() - baseline);
|
|
218
|
+
});
|
|
219
|
+
const makeChild = (cls: string, label: string) => {
|
|
220
|
+
const c = document.createElement('div');
|
|
221
|
+
c.className = \`\${cls} rounded border bg-white p-3 text-sm\`;
|
|
222
|
+
c.textContent = label;
|
|
223
|
+
return c;
|
|
224
|
+
};
|
|
225
|
+
const mount = () => {
|
|
226
|
+
const stage = document.getElementById(\`\${id}-stage\`);
|
|
227
|
+
if (!stage) return;
|
|
228
|
+
if (!demoEl) {
|
|
229
|
+
demoEl = document.createElement(MULTI_TAG);
|
|
230
|
+
demoEl.append(makeChild('ofm-a', 'Sweep A child'), makeChild('ofm-b', 'Sweep B child'));
|
|
231
|
+
}
|
|
232
|
+
if (!demoEl.isConnected) stage.appendChild(demoEl);
|
|
233
|
+
refresh();
|
|
234
|
+
};
|
|
235
|
+
const unmount = () => {
|
|
236
|
+
demoEl?.remove();
|
|
237
|
+
refresh();
|
|
238
|
+
};
|
|
239
|
+
return html\`
|
|
240
|
+
<div class="space-y-4">
|
|
241
|
+
<p class="text-base">
|
|
242
|
+
This element registers <strong>two</strong> independent onFind sweeps via an array (<code
|
|
243
|
+
>onFindRegistration</code
|
|
244
|
+
>
|
|
245
|
+
returns <code>[A, B]</code>). Mounting registers both (count → 2), unmounting disposes both together (count →
|
|
246
|
+
0), and each sweep highlights only its own child type.
|
|
247
|
+
</p>
|
|
248
|
+
|
|
249
|
+
<div class="flex gap-2">
|
|
250
|
+
<button data-testid="multi-mount" @click=\${mount} class="btu-button btu-button-primary btu-button-sm">
|
|
251
|
+
Mount
|
|
252
|
+
</button>
|
|
253
|
+
<button data-testid="multi-unmount" @click=\${unmount} class="btu-button btu-button-gray btu-button-sm">
|
|
254
|
+
Unmount
|
|
255
|
+
</button>
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
<div id="\${id}-stage" class="min-h-32 space-y-2 rounded border-2 border-gray-300 bg-gray-50 p-4">
|
|
259
|
+
<div class="text-sm text-gray-500">Mount to see both sweeps register and highlight their children…</div>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<div>
|
|
263
|
+
<div class="text-xs text-gray-500">onFind callbacks registered by this demo</div>
|
|
264
|
+
<div data-testid="multi-count" id="\${id}-count" class="text-2xl font-bold text-primary-600">0</div>
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
\`;
|
|
268
|
+
},
|
|
269
|
+
parameters: {
|
|
270
|
+
docs: {
|
|
271
|
+
description: {
|
|
272
|
+
story: 'Exercises the array form of onFindRegistration: one element registers two independent sweeps. Mounting registers both callbacks (count → 2), each sweep highlights only its own child type, and unmounting disposes both together (count → 0).'
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
play: async ({
|
|
277
|
+
canvasElement,
|
|
278
|
+
step
|
|
279
|
+
}) => {
|
|
280
|
+
const canvas = within(canvasElement);
|
|
281
|
+
await step('Mount registers both sweeps', async () => {
|
|
282
|
+
await userEvent.click(canvas.getByTestId('multi-mount'));
|
|
283
|
+
await waitFor(() => expect(canvas.getByTestId('multi-count')).toHaveTextContent('2'));
|
|
284
|
+
});
|
|
285
|
+
await step('Each sweep detects its own children', async () => {
|
|
286
|
+
await waitFor(() => {
|
|
287
|
+
expect(canvasElement.querySelector('.ofm-a.ring-2')).toBeTruthy();
|
|
288
|
+
expect(canvasElement.querySelector('.ofm-b.ring-2')).toBeTruthy();
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
await step('Unmount disposes both', async () => {
|
|
292
|
+
await userEvent.click(canvas.getByTestId('multi-unmount'));
|
|
293
|
+
await waitFor(() => expect(canvas.getByTestId('multi-count')).toHaveTextContent('0'));
|
|
294
|
+
});
|
|
295
|
+
await step('Re-mount re-arms both', async () => {
|
|
296
|
+
await userEvent.click(canvas.getByTestId('multi-mount'));
|
|
297
|
+
await waitFor(() => expect(canvas.getByTestId('multi-count')).toHaveTextContent('2'));
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}`,...m.parameters?.docs?.source}}};const T=["Demo","MultipleSweeps"];export{u as Demo,m as MultipleSweeps,T as __namedExportsOrder,M as default};
|
package/dist/storybook/assets/{Pagination.stories-DbLKeykx.js → Pagination.stories-_MiDRipW.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as m,x as u}from"./iframe-
|
|
1
|
+
import{g as m,x as u}from"./iframe-BqpRijx3.js";import{o as g}from"./style-map-DukvFNCc.js";import"./preload-helper-PPVm8Dsz.js";const{events:b,args:h,argTypes:y}=m("btu-pagination"),c=e=>{const t={};return e.customBackgroundColor&&(t["--pagination-color-background"]=e.customBackgroundColor),e.customForegroundColor&&(t["--pagination-color-foreground"]=e.customForegroundColor),t},$={title:"Components/Pagination",component:"btu-pagination",tags:["autodocs"],parameters:{docs:{subtitle:"A component for navigating through paged content",description:{component:`
|
|
2
2
|
<h3>When to use:</h3>
|
|
3
3
|
<ul>
|
|
4
4
|
<li>To navigate through large sets of data</li>
|
|
@@ -62,7 +62,7 @@ import{g as m,x as u}from"./iframe-C3TUQi31.js";import{o as g}from"./style-map-A
|
|
|
62
62
|
</btu-dropdown>
|
|
63
63
|
<button
|
|
64
64
|
slot="jumper"
|
|
65
|
-
class="btu-button
|
|
65
|
+
class="btu-button btu-button-sm"
|
|
66
66
|
@click=${t=>{const n=t.target.closest("btu-pagination");n&&(n.page=1)}}
|
|
67
67
|
>
|
|
68
68
|
Today
|
|
@@ -162,7 +162,7 @@ import{g as m,x as u}from"./iframe-C3TUQi31.js";import{o as g}from"./style-map-A
|
|
|
162
162
|
</btu-dropdown>
|
|
163
163
|
<button
|
|
164
164
|
slot="jumper"
|
|
165
|
-
class="btu-button
|
|
165
|
+
class="btu-button btu-button-sm"
|
|
166
166
|
@click=\${(e: Event) => {
|
|
167
167
|
const pagination = (e.target as HTMLElement).closest('btu-pagination');
|
|
168
168
|
if (pagination) pagination.page = 1;
|