@brightspot/ui 1.4.0 → 1.5.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/README.md +12 -0
- package/dist/components/avatar/Avatar.d.ts +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.js +3 -1
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/popover/Popover.d.ts +161 -0
- package/dist/components/popover/Popover.d.ts.map +1 -0
- package/dist/components/popover/Popover.js +436 -0
- package/dist/components/popover/Popover.js.map +1 -0
- package/dist/components/widget/Widget.css +104 -0
- package/dist/components/widget/Widget.d.ts +170 -0
- package/dist/components/widget/Widget.d.ts.map +1 -0
- package/dist/components/widget/Widget.js +434 -0
- package/dist/components/widget/Widget.js.map +1 -0
- package/dist/custom-elements.json +604 -101
- package/dist/global.d.ts +5 -0
- package/dist/storybook/assets/{Avatar.stories-DrhezTR1.js → Avatar.stories-CPVNxsaA.js} +37 -32
- package/dist/storybook/assets/AvatarGroup.stories-Bl65NGHl.js +225 -0
- package/dist/storybook/assets/{Badge.stories-DtJcBfOR.js → Badge.stories-Bbnc6fRy.js} +1 -1
- package/dist/storybook/assets/{Button.stories-BKUfLgSY.js → Button.stories-CRJ5n2y4.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-dpmD-XJT.js → CircularProgress.stories-D9vBj3JJ.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-C0pnQ7BY.js → ClipboardMixin.stories-Dm-Jm4yb.js} +7 -7
- package/dist/storybook/assets/Color-6BZIO3FS-BcNIJY1U.js +1 -0
- package/dist/storybook/assets/{Colors.stories-bKK25qgF.js → Colors.stories-B9_090wL.js} +1 -1
- package/dist/storybook/assets/ComponentStatesMixin-ChiFBCuo.js +1 -0
- package/dist/storybook/assets/{ComponentStatesMixin.stories-9mRp2zuB.js → ComponentStatesMixin.stories-DHv9MHmE.js} +3 -3
- package/dist/storybook/assets/{CopyToClipboard.stories-BW3oaT1i.js → CopyToClipboard.stories-gtJlTP1l.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-BXx3CKvQ.js → Debounce.stories-BBNX7mJA.js} +3 -3
- package/dist/storybook/assets/DocsRenderer-LL677BLK-D-E99pXl.js +758 -0
- package/dist/storybook/assets/{Events.stories-PBeiuWQn.js → Events.stories-DDmydlh_.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-Djkl0MoC.js → Heading.stories-BLGfko-i.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-Cam1fyud.js → Icon.stories-BHnAGcFF.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-BDNoYIJu.js → LinearProgress.stories-Dx26a0P_.js} +1 -1
- package/dist/storybook/assets/Popover.stories-CbqpY6YR.js +431 -0
- package/dist/storybook/assets/ReadyMixin-BHiHoIbr.js +1 -0
- package/dist/storybook/assets/{Rtc.stories-BrTAIAi1.js → Rtc.stories-CAjDv_Ub.js} +3 -3
- package/dist/storybook/assets/{ScrollShadow.stories-DHcKhkag.js → ScrollShadow.stories-BSV4U-tq.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-cSYT_BXu.js → Throttle.stories-kaxXQ8RZ.js} +8 -8
- package/dist/storybook/assets/Tooltip.stories-CsxXkztr.js +143 -0
- package/dist/storybook/assets/Widget.stories-DqATHnSq.js +233 -0
- package/dist/storybook/assets/WithTooltip-65CFNBJE-BtbbFYSA.js +9 -0
- package/dist/storybook/assets/custom-element-UsVr97OX.js +1 -0
- package/dist/storybook/assets/formatter-EIJCOSYU-C87Csnpu.js +1 -0
- package/dist/storybook/assets/if-defined-COHr0XBn.js +1 -0
- package/dist/storybook/assets/{iframe-BMxUFmpF.css → iframe-BkDGeDre.css} +1 -1
- package/dist/storybook/assets/iframe-CcloOV09.js +1061 -0
- package/dist/storybook/assets/index-DP7vnJf7.js +1 -0
- package/dist/storybook/assets/onFind-DqriYjEB.js +1 -0
- package/dist/storybook/assets/onFind.stories-BxvoC-Z-.js +1069 -0
- package/dist/storybook/assets/{onRemove.stories-C7W9KyRr.js → onRemove.stories-Dwoixzb0.js} +3 -3
- package/dist/storybook/assets/{onVisible.stories-CIl6R0q4.js → onVisible.stories-CinmRF9w.js} +10 -10
- package/dist/storybook/assets/syntaxhighlighter-ED5Y7EFY-BHLkDkOn.js +6 -0
- package/dist/storybook/iframe.html +57 -39
- package/dist/storybook/index.html +11 -4
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/storybook/sb-addons/docs-1/manager-bundle.js +1 -1
- package/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +112 -290
- package/dist/storybook/sb-addons/vitest-2/manager-bundle.js +3 -0
- package/dist/storybook/sb-manager/globals-runtime.js +60754 -66346
- package/dist/storybook/sb-manager/globals.js +2 -3
- package/dist/storybook/sb-manager/manager-stores.js +23 -0
- package/dist/storybook/sb-manager/runtime.js +12983 -11699
- package/dist/storybook/vite-inject-mocker-entry.js +2 -2
- package/dist/tailwind-plugin-popover.d.ts +2 -0
- package/dist/tailwind-plugin-popover.d.ts.map +1 -0
- package/dist/tailwind-plugin-popover.js +177 -0
- package/dist/tailwind-plugin-popover.js.map +1 -0
- package/dist/tailwind-plugin-popover.ts +202 -0
- package/dist/tailwind-plugin-tooltip.d.ts +2 -0
- package/dist/tailwind-plugin-tooltip.d.ts.map +1 -0
- package/dist/tailwind-plugin-tooltip.js +184 -0
- package/dist/tailwind-plugin-tooltip.js.map +1 -0
- package/dist/tailwind-plugin-tooltip.ts +209 -0
- package/dist/util/EventEmitterMixin.d.ts +11 -0
- package/dist/util/EventEmitterMixin.d.ts.map +1 -1
- package/dist/util/EventEmitterMixin.js +1 -1
- package/dist/util/EventEmitterMixin.js.map +1 -1
- package/dist/util/TooltipController.d.ts +37 -0
- package/dist/util/TooltipController.d.ts.map +1 -0
- package/dist/util/TooltipController.js +133 -0
- package/dist/util/TooltipController.js.map +1 -0
- package/dist/util/TooltipMixin.d.ts +42 -0
- package/dist/util/TooltipMixin.d.ts.map +1 -0
- package/dist/util/TooltipMixin.js +401 -0
- package/dist/util/TooltipMixin.js.map +1 -0
- package/dist/util/onFind.d.ts +1 -0
- package/dist/util/onFind.d.ts.map +1 -1
- package/dist/util/onFind.js +73 -48
- package/dist/util/onFind.js.map +1 -1
- package/dist/util/onVisible.d.ts.map +1 -1
- package/dist/util/onVisible.js +13 -2
- package/dist/util/onVisible.js.map +1 -1
- package/package.json +12 -5
- package/dist/storybook/assets/AvatarGroup.stories-DrlxT-mF.js +0 -211
- package/dist/storybook/assets/Color-64QXVMR3-Dnd9S2a1.js +0 -1
- package/dist/storybook/assets/ComponentStatesMixin-C2HZ9ZFb.js +0 -1
- package/dist/storybook/assets/WithTooltip-SK46ZJ2J-Df0E-KJO.js +0 -825
- package/dist/storybook/assets/formatter-OMEEQ6HG-DFa_WTfb.js +0 -1
- package/dist/storybook/assets/iframe-lTczLWsL.js +0 -1064
- package/dist/storybook/assets/index-yMswRDPh.js +0 -1
- package/dist/storybook/assets/onFind-C6olvKHR.js +0 -1
- package/dist/storybook/assets/onFind.stories-DfW54CDE.js +0 -284
- package/dist/storybook/assets/syntaxhighlighter-CAVLW7PM-DoI0ixeu.js +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as d}from"./iframe-
|
|
1
|
+
import{x as d}from"./iframe-CcloOV09.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-CcloOV09.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as d,x as r}from"./iframe-
|
|
1
|
+
import{g as d,x as r}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz.js";const p="0.508.0",b={version:p},l=b.version,{events:u,args:m,argTypes:t}=d("btu-icon"),g=["xs","sm","md","lg","xl"],x=["ai","error","gray","primary","purple","rose","success","teal","warning"],v={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>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as I,E as h,x as T}from"./iframe-
|
|
1
|
+
import{g as I,E as h,x as T}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz.js";const{events:D,args:V,argTypes:g}=I("btu-linear-progress"),k={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,431 @@
|
|
|
1
|
+
import{g as c,x as r}from"./iframe-CcloOV09.js";import{o as d}from"./if-defined-COHr0XBn.js";import"./preload-helper-PPVm8Dsz.js";const{events:u,args:g,argTypes:t}=c("btu-popover"),h={title:"Components/Popover",component:"btu-popover",tags:["autodocs"],parameters:{docs:{subtitle:"Rich interactive content anchored to a trigger element",description:{component:`
|
|
2
|
+
\`btu-popover\` displays rich interactive content anchored to a trigger element using CSS anchor positioning and the native Popover API.
|
|
3
|
+
|
|
4
|
+
<h3>When to use:</h3>
|
|
5
|
+
<ul>
|
|
6
|
+
<li>Confirmation dialogs anchored to a button</li>
|
|
7
|
+
<li>Rich preview cards on hover</li>
|
|
8
|
+
<li>Interactive forms or menus in a floating panel</li>
|
|
9
|
+
</ul>
|
|
10
|
+
|
|
11
|
+
<h3>When not to use:</h3>
|
|
12
|
+
<ul>
|
|
13
|
+
<li>For simple text-only hints — use <a href="?path=/docs/components-tooltip--docs">Tooltip</a> instead</li>
|
|
14
|
+
<li>For status messages or inline feedback (use alerts or toasts)</li>
|
|
15
|
+
</ul>
|
|
16
|
+
|
|
17
|
+
<h3>Accessibility</h3>
|
|
18
|
+
<ul>
|
|
19
|
+
<li><code>role="dialog"</code> on popover panel</li>
|
|
20
|
+
<li><code>aria-expanded</code> on trigger element</li>
|
|
21
|
+
<li><code>aria-controls</code> links trigger to panel</li>
|
|
22
|
+
<li>Escape key dismisses the popover</li>
|
|
23
|
+
<li>Click outside dismisses (click trigger only)</li>
|
|
24
|
+
<li>Focus restored to trigger on close</li>
|
|
25
|
+
<li>Add <code>autofocus</code> to an element inside <code>slot="content"</code> for auto-focus on open</li>
|
|
26
|
+
</ul>
|
|
27
|
+
`}},actions:{handles:u},controls:{expanded:!0}},args:{...g,position:"bottom",trigger:"click",delay:300,open:!1},argTypes:{...t,position:{...t.position,control:{type:"select"},options:["top","bottom","left","right"]},trigger:{...t.trigger,control:{type:"select"},options:["click","hover","focus"]},delay:{...t.delay,control:{type:"number"},description:"Show delay in ms (hover trigger only)"},offset:{...t.offset,control:{type:"select"},options:["sm","md","lg","xl"],description:"Gap between trigger and popover (sm=4px, md=8px, lg=12px, xl=16px)"},open:{...t.open,control:{type:"boolean"},description:"Programmatic open/close (reflected)"},customBg:{name:"--popover-color-background",description:"Background color",control:{type:"color"},table:{category:"CSS Custom Properties",defaultValue:{summary:"white"}}},customTitleColor:{name:"--popover-color-title",description:"Title text color",control:{type:"color"},table:{category:"CSS Custom Properties",defaultValue:{summary:"oklch(var(--btu-theme-gray-900))"}}},customContentColor:{name:"--popover-color-content",description:"Content text color",control:{type:"color"},table:{category:"CSS Custom Properties",defaultValue:{summary:"oklch(var(--btu-theme-gray-900))"}}},customRadius:{name:"--popover-border-radius",description:"Border radius",control:{type:"select"},options:["0px","0.125rem","0.25rem","0.375rem","0.5rem","0.75rem","1rem","1.5rem","9999px"],labels:{"0px":"none (0px)","0.125rem":"sm (0.125rem)","0.25rem":"DEFAULT (0.25rem)","0.375rem":"md (0.375rem)","0.5rem":"lg (0.5rem)","0.75rem":"xl (0.75rem)","1rem":"2xl (1rem)","1.5rem":"3xl (1.5rem)","9999px":"full (9999px)"},table:{category:"CSS Custom Properties",defaultValue:{summary:"0.5rem (lg)"}}}},render:o=>{const e=[];o.customBg&&e.push(`--popover-color-background: ${o.customBg}`),o.customTitleColor&&e.push(`--popover-color-title: ${o.customTitleColor}`),o.customContentColor&&e.push(`--popover-color-content: ${o.customContentColor}`),o.customRadius&&e.push(`--popover-border-radius: ${o.customRadius}`);const a=e.length>0?e.join("; "):"";return r`
|
|
28
|
+
<div style="display: flex; justify-content: center; padding: 6rem 2rem;">
|
|
29
|
+
<div style="${a}">
|
|
30
|
+
<btu-popover
|
|
31
|
+
position="${o.position}"
|
|
32
|
+
trigger="${o.trigger}"
|
|
33
|
+
delay="${o.delay}"
|
|
34
|
+
offset="${d(o.offset)}"
|
|
35
|
+
?no-arrow="${o.noArrow}"
|
|
36
|
+
?open="${o.open}"
|
|
37
|
+
>
|
|
38
|
+
<button class="popover-trigger" slot="trigger">
|
|
39
|
+
${o.trigger==="hover"?"Hover me":o.trigger==="focus"?"Focus me":"Click me"}
|
|
40
|
+
</button>
|
|
41
|
+
<div slot="content">
|
|
42
|
+
<div style="font-weight: 500; margin-bottom: 4px; color: var(--popover-color-title);">Popover Title</div>
|
|
43
|
+
<div style="color: var(--popover-color-content, oklch(var(--btu-theme-gray-900)));">
|
|
44
|
+
This is a popover with rich content.
|
|
45
|
+
${o.trigger==="click"?"Click outside or press Escape to dismiss.":""}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</btu-popover>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
`}},p=`
|
|
52
|
+
.popover-trigger {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
padding: 0.5rem 1rem;
|
|
57
|
+
border-radius: 0.375rem;
|
|
58
|
+
background-color: oklch(var(--btu-theme-gray-100));
|
|
59
|
+
color: oklch(var(--btu-theme-gray-700));
|
|
60
|
+
font-weight: 500;
|
|
61
|
+
font-size: 0.875rem;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
user-select: none;
|
|
64
|
+
border: 1px solid oklch(var(--btu-theme-gray-200));
|
|
65
|
+
}
|
|
66
|
+
.popover-trigger:hover {
|
|
67
|
+
background-color: oklch(var(--btu-theme-gray-200));
|
|
68
|
+
}
|
|
69
|
+
`,n={args:{noArrow:!1,offset:void 0},decorators:[o=>r`<style>
|
|
70
|
+
${p}</style
|
|
71
|
+
>${o()}`]},i={render:()=>r`
|
|
72
|
+
<style>
|
|
73
|
+
${p}
|
|
74
|
+
</style>
|
|
75
|
+
<div style="display: flex; gap: 2rem; justify-content: center; padding: 6rem 2rem; flex-wrap: wrap;">
|
|
76
|
+
<btu-popover position="top">
|
|
77
|
+
<button class="popover-trigger" slot="trigger">Top</button>
|
|
78
|
+
<div slot="content">Popover positioned above the trigger</div>
|
|
79
|
+
</btu-popover>
|
|
80
|
+
<btu-popover position="bottom">
|
|
81
|
+
<button class="popover-trigger" slot="trigger">Bottom</button>
|
|
82
|
+
<div slot="content">Popover positioned below the trigger</div>
|
|
83
|
+
</btu-popover>
|
|
84
|
+
<btu-popover position="left">
|
|
85
|
+
<button class="popover-trigger" slot="trigger">Left</button>
|
|
86
|
+
<div slot="content">Popover positioned left of the trigger</div>
|
|
87
|
+
</btu-popover>
|
|
88
|
+
<btu-popover position="right">
|
|
89
|
+
<button class="popover-trigger" slot="trigger">Right</button>
|
|
90
|
+
<div slot="content">Popover positioned right of the trigger</div>
|
|
91
|
+
</btu-popover>
|
|
92
|
+
</div>
|
|
93
|
+
`,parameters:{docs:{description:{story:"Popovers support four positions: `top`, `bottom`, `left`, and `right`. Each auto-flips if constrained by the viewport."},story:{inline:!1,iframeHeight:300}}}},s={render:()=>r`
|
|
94
|
+
<style>
|
|
95
|
+
${p} .popover-custom-content {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
gap: 12px;
|
|
99
|
+
min-width: 240px;
|
|
100
|
+
}
|
|
101
|
+
.popover-custom-content h3 {
|
|
102
|
+
margin: 0;
|
|
103
|
+
font-size: 0.9375rem;
|
|
104
|
+
font-weight: 600;
|
|
105
|
+
}
|
|
106
|
+
.popover-custom-content p {
|
|
107
|
+
margin: 0;
|
|
108
|
+
font-size: 0.8125rem;
|
|
109
|
+
color: oklch(var(--btu-theme-gray-500));
|
|
110
|
+
line-height: 1.4;
|
|
111
|
+
}
|
|
112
|
+
.popover-custom-content .actions {
|
|
113
|
+
display: flex;
|
|
114
|
+
gap: 8px;
|
|
115
|
+
justify-content: flex-end;
|
|
116
|
+
padding-top: 4px;
|
|
117
|
+
border-top: 1px solid oklch(var(--btu-theme-gray-100));
|
|
118
|
+
}
|
|
119
|
+
.legend-series {
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
gap: 2px;
|
|
123
|
+
}
|
|
124
|
+
.legend-item {
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
gap: 4px;
|
|
128
|
+
font-size: 0.75rem;
|
|
129
|
+
line-height: 1.125rem;
|
|
130
|
+
color: oklch(var(--btu-theme-gray-500));
|
|
131
|
+
}
|
|
132
|
+
.legend-dot {
|
|
133
|
+
width: 8px;
|
|
134
|
+
height: 8px;
|
|
135
|
+
border-radius: 9999px;
|
|
136
|
+
flex-shrink: 0;
|
|
137
|
+
}
|
|
138
|
+
.legend-value {
|
|
139
|
+
font-weight: 600;
|
|
140
|
+
}
|
|
141
|
+
</style>
|
|
142
|
+
<div style="display: flex; gap: 2rem; justify-content: center; padding: 6rem 2rem; flex-wrap: wrap;">
|
|
143
|
+
<btu-popover position="bottom">
|
|
144
|
+
<button class="btu-button btu-button-error" slot="trigger">Delete item</button>
|
|
145
|
+
<div slot="content">
|
|
146
|
+
<div class="popover-custom-content">
|
|
147
|
+
<h3>Confirm Delete</h3>
|
|
148
|
+
<p>Are you sure you want to delete this item? This action cannot be undone.</p>
|
|
149
|
+
<div class="actions">
|
|
150
|
+
<button class="btu-button btu-button-warning btu-button-xs">Cancel</button>
|
|
151
|
+
<button class="btu-button btu-button-error btu-button-xs btu-button-fill-none">Delete</button>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</btu-popover>
|
|
156
|
+
<btu-popover trigger="hover" delay="200" position="bottom">
|
|
157
|
+
<button class="btu-button btu-button-primary" slot="trigger">Hover for chart data</button>
|
|
158
|
+
<div slot="content">
|
|
159
|
+
<div
|
|
160
|
+
style="font-weight: 500; font-size: 0.75rem; line-height: 1.125rem; color: oklch(var(--btu-theme-gray-900)); margin-bottom: 8px;"
|
|
161
|
+
>
|
|
162
|
+
Chart Legend
|
|
163
|
+
</div>
|
|
164
|
+
<div class="legend-series">
|
|
165
|
+
<div class="legend-item">
|
|
166
|
+
<span class="legend-dot" style="background: oklch(var(--btu-theme-primary-900));"></span>
|
|
167
|
+
Series 1: <span class="legend-value">786</span>
|
|
168
|
+
</div>
|
|
169
|
+
<div class="legend-item">
|
|
170
|
+
<span class="legend-dot" style="background: oklch(var(--btu-theme-primary-700));"></span>
|
|
171
|
+
Series 2: <span class="legend-value">786</span>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="legend-item">
|
|
174
|
+
<span class="legend-dot" style="background: oklch(var(--btu-theme-primary-500));"></span>
|
|
175
|
+
Series 3: <span class="legend-value">786</span>
|
|
176
|
+
</div>
|
|
177
|
+
<div class="legend-item">
|
|
178
|
+
<span class="legend-dot" style="background: oklch(var(--btu-theme-teal-700));"></span>
|
|
179
|
+
Series 4: <span class="legend-value">786</span>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
</btu-popover>
|
|
184
|
+
</div>
|
|
185
|
+
`,parameters:{docs:{description:{story:"Two examples of rich popover content: a confirmation dialog with action buttons (click trigger), and a chart legend with colored series data (hover trigger)."},story:{inline:!1,iframeHeight:300}}}},l={render:()=>r`
|
|
186
|
+
<style>
|
|
187
|
+
${p} .custom-popover-trigger {
|
|
188
|
+
display: inline-flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: center;
|
|
191
|
+
padding: 0.5rem 1rem;
|
|
192
|
+
border-radius: 0.375rem;
|
|
193
|
+
background-color: oklch(0.35 0.1 280);
|
|
194
|
+
color: white;
|
|
195
|
+
font-weight: 500;
|
|
196
|
+
font-size: 0.875rem;
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
user-select: none;
|
|
199
|
+
border: 1px solid oklch(0.45 0.1 280);
|
|
200
|
+
}
|
|
201
|
+
.custom-popover-trigger:hover {
|
|
202
|
+
background-color: oklch(0.4 0.1 280);
|
|
203
|
+
}
|
|
204
|
+
</style>
|
|
205
|
+
<div style="display: flex; justify-content: center; padding: 6rem 2rem;">
|
|
206
|
+
<div
|
|
207
|
+
style="--popover-color-background: oklch(0.25 20.05 280); --popover-color-title: oklch(0.95 0 0); --popover-color-content: oklch(0.8 120 50); --popover-border-radius: 0px;"
|
|
208
|
+
>
|
|
209
|
+
<btu-popover position="bottom" offset="lg" no-arrow>
|
|
210
|
+
<button class="custom-popover-trigger" slot="trigger">Fully customized</button>
|
|
211
|
+
<div slot="content">
|
|
212
|
+
<div style="font-weight: 600; font-size: 1rem; margin-bottom: 8px; color: var(--popover-color-title);">
|
|
213
|
+
Custom Styled Popover
|
|
214
|
+
</div>
|
|
215
|
+
<div style="line-height: 1.5; color: var(--popover-color-content);">
|
|
216
|
+
This popover overrides all available CSS custom properties: background, title color, and border radius. It
|
|
217
|
+
also uses
|
|
218
|
+
<code style="background: oklch(0.35 0.05 280); padding: 2px 6px; border-radius: 4px;">offset="lg"</code>
|
|
219
|
+
for extra spacing and
|
|
220
|
+
<code style="background: oklch(0.35 0.05 280); padding: 2px 6px; border-radius: 4px;">no-arrow</code> for
|
|
221
|
+
a clean look.
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</btu-popover>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
`,parameters:{docs:{description:{story:"Demonstrates full customization of all CSS custom properties. Set these on a parent element or directly on the component:\n\n- `--popover-color-background` — Background color\n- `--popover-color-title` — Title text color\n- `--popover-color-content` — Content text color\n- `--popover-border-radius` — Border radius"}}}};n.parameters={...n.parameters,docs:{...n.parameters?.docs,source:{originalSource:`{
|
|
228
|
+
args: {
|
|
229
|
+
noArrow: false,
|
|
230
|
+
offset: undefined
|
|
231
|
+
},
|
|
232
|
+
decorators: [story => html\`<style>
|
|
233
|
+
\${triggerStyle}</style
|
|
234
|
+
>\${story()}\`]
|
|
235
|
+
}`,...n.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
|
|
236
|
+
render: () => html\`
|
|
237
|
+
<style>
|
|
238
|
+
\${triggerStyle}
|
|
239
|
+
</style>
|
|
240
|
+
<div style="display: flex; gap: 2rem; justify-content: center; padding: 6rem 2rem; flex-wrap: wrap;">
|
|
241
|
+
<btu-popover position="top">
|
|
242
|
+
<button class="popover-trigger" slot="trigger">Top</button>
|
|
243
|
+
<div slot="content">Popover positioned above the trigger</div>
|
|
244
|
+
</btu-popover>
|
|
245
|
+
<btu-popover position="bottom">
|
|
246
|
+
<button class="popover-trigger" slot="trigger">Bottom</button>
|
|
247
|
+
<div slot="content">Popover positioned below the trigger</div>
|
|
248
|
+
</btu-popover>
|
|
249
|
+
<btu-popover position="left">
|
|
250
|
+
<button class="popover-trigger" slot="trigger">Left</button>
|
|
251
|
+
<div slot="content">Popover positioned left of the trigger</div>
|
|
252
|
+
</btu-popover>
|
|
253
|
+
<btu-popover position="right">
|
|
254
|
+
<button class="popover-trigger" slot="trigger">Right</button>
|
|
255
|
+
<div slot="content">Popover positioned right of the trigger</div>
|
|
256
|
+
</btu-popover>
|
|
257
|
+
</div>
|
|
258
|
+
\`,
|
|
259
|
+
parameters: {
|
|
260
|
+
docs: {
|
|
261
|
+
description: {
|
|
262
|
+
story: 'Popovers support four positions: \`top\`, \`bottom\`, \`left\`, and \`right\`. Each auto-flips if constrained by the viewport.'
|
|
263
|
+
},
|
|
264
|
+
story: {
|
|
265
|
+
inline: false,
|
|
266
|
+
iframeHeight: 300
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}`,...i.parameters?.docs?.source}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
|
|
271
|
+
render: () => html\`
|
|
272
|
+
<style>
|
|
273
|
+
\${triggerStyle} .popover-custom-content {
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
gap: 12px;
|
|
277
|
+
min-width: 240px;
|
|
278
|
+
}
|
|
279
|
+
.popover-custom-content h3 {
|
|
280
|
+
margin: 0;
|
|
281
|
+
font-size: 0.9375rem;
|
|
282
|
+
font-weight: 600;
|
|
283
|
+
}
|
|
284
|
+
.popover-custom-content p {
|
|
285
|
+
margin: 0;
|
|
286
|
+
font-size: 0.8125rem;
|
|
287
|
+
color: oklch(var(--btu-theme-gray-500));
|
|
288
|
+
line-height: 1.4;
|
|
289
|
+
}
|
|
290
|
+
.popover-custom-content .actions {
|
|
291
|
+
display: flex;
|
|
292
|
+
gap: 8px;
|
|
293
|
+
justify-content: flex-end;
|
|
294
|
+
padding-top: 4px;
|
|
295
|
+
border-top: 1px solid oklch(var(--btu-theme-gray-100));
|
|
296
|
+
}
|
|
297
|
+
.legend-series {
|
|
298
|
+
display: flex;
|
|
299
|
+
flex-direction: column;
|
|
300
|
+
gap: 2px;
|
|
301
|
+
}
|
|
302
|
+
.legend-item {
|
|
303
|
+
display: flex;
|
|
304
|
+
align-items: center;
|
|
305
|
+
gap: 4px;
|
|
306
|
+
font-size: 0.75rem;
|
|
307
|
+
line-height: 1.125rem;
|
|
308
|
+
color: oklch(var(--btu-theme-gray-500));
|
|
309
|
+
}
|
|
310
|
+
.legend-dot {
|
|
311
|
+
width: 8px;
|
|
312
|
+
height: 8px;
|
|
313
|
+
border-radius: 9999px;
|
|
314
|
+
flex-shrink: 0;
|
|
315
|
+
}
|
|
316
|
+
.legend-value {
|
|
317
|
+
font-weight: 600;
|
|
318
|
+
}
|
|
319
|
+
</style>
|
|
320
|
+
<div style="display: flex; gap: 2rem; justify-content: center; padding: 6rem 2rem; flex-wrap: wrap;">
|
|
321
|
+
<btu-popover position="bottom">
|
|
322
|
+
<button class="btu-button btu-button-error" slot="trigger">Delete item</button>
|
|
323
|
+
<div slot="content">
|
|
324
|
+
<div class="popover-custom-content">
|
|
325
|
+
<h3>Confirm Delete</h3>
|
|
326
|
+
<p>Are you sure you want to delete this item? This action cannot be undone.</p>
|
|
327
|
+
<div class="actions">
|
|
328
|
+
<button class="btu-button btu-button-warning btu-button-xs">Cancel</button>
|
|
329
|
+
<button class="btu-button btu-button-error btu-button-xs btu-button-fill-none">Delete</button>
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
</btu-popover>
|
|
334
|
+
<btu-popover trigger="hover" delay="200" position="bottom">
|
|
335
|
+
<button class="btu-button btu-button-primary" slot="trigger">Hover for chart data</button>
|
|
336
|
+
<div slot="content">
|
|
337
|
+
<div
|
|
338
|
+
style="font-weight: 500; font-size: 0.75rem; line-height: 1.125rem; color: oklch(var(--btu-theme-gray-900)); margin-bottom: 8px;"
|
|
339
|
+
>
|
|
340
|
+
Chart Legend
|
|
341
|
+
</div>
|
|
342
|
+
<div class="legend-series">
|
|
343
|
+
<div class="legend-item">
|
|
344
|
+
<span class="legend-dot" style="background: oklch(var(--btu-theme-primary-900));"></span>
|
|
345
|
+
Series 1: <span class="legend-value">786</span>
|
|
346
|
+
</div>
|
|
347
|
+
<div class="legend-item">
|
|
348
|
+
<span class="legend-dot" style="background: oklch(var(--btu-theme-primary-700));"></span>
|
|
349
|
+
Series 2: <span class="legend-value">786</span>
|
|
350
|
+
</div>
|
|
351
|
+
<div class="legend-item">
|
|
352
|
+
<span class="legend-dot" style="background: oklch(var(--btu-theme-primary-500));"></span>
|
|
353
|
+
Series 3: <span class="legend-value">786</span>
|
|
354
|
+
</div>
|
|
355
|
+
<div class="legend-item">
|
|
356
|
+
<span class="legend-dot" style="background: oklch(var(--btu-theme-teal-700));"></span>
|
|
357
|
+
Series 4: <span class="legend-value">786</span>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
</btu-popover>
|
|
362
|
+
</div>
|
|
363
|
+
\`,
|
|
364
|
+
parameters: {
|
|
365
|
+
docs: {
|
|
366
|
+
description: {
|
|
367
|
+
story: 'Two examples of rich popover content: a confirmation dialog with action buttons (click trigger), and a chart legend with colored series data (hover trigger).'
|
|
368
|
+
},
|
|
369
|
+
story: {
|
|
370
|
+
inline: false,
|
|
371
|
+
iframeHeight: 300
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}`,...s.parameters?.docs?.source}}};l.parameters={...l.parameters,docs:{...l.parameters?.docs,source:{originalSource:`{
|
|
376
|
+
render: () => html\`
|
|
377
|
+
<style>
|
|
378
|
+
\${triggerStyle} .custom-popover-trigger {
|
|
379
|
+
display: inline-flex;
|
|
380
|
+
align-items: center;
|
|
381
|
+
justify-content: center;
|
|
382
|
+
padding: 0.5rem 1rem;
|
|
383
|
+
border-radius: 0.375rem;
|
|
384
|
+
background-color: oklch(0.35 0.1 280);
|
|
385
|
+
color: white;
|
|
386
|
+
font-weight: 500;
|
|
387
|
+
font-size: 0.875rem;
|
|
388
|
+
cursor: pointer;
|
|
389
|
+
user-select: none;
|
|
390
|
+
border: 1px solid oklch(0.45 0.1 280);
|
|
391
|
+
}
|
|
392
|
+
.custom-popover-trigger:hover {
|
|
393
|
+
background-color: oklch(0.4 0.1 280);
|
|
394
|
+
}
|
|
395
|
+
</style>
|
|
396
|
+
<div style="display: flex; justify-content: center; padding: 6rem 2rem;">
|
|
397
|
+
<div
|
|
398
|
+
style="--popover-color-background: oklch(0.25 20.05 280); --popover-color-title: oklch(0.95 0 0); --popover-color-content: oklch(0.8 120 50); --popover-border-radius: 0px;"
|
|
399
|
+
>
|
|
400
|
+
<btu-popover position="bottom" offset="lg" no-arrow>
|
|
401
|
+
<button class="custom-popover-trigger" slot="trigger">Fully customized</button>
|
|
402
|
+
<div slot="content">
|
|
403
|
+
<div style="font-weight: 600; font-size: 1rem; margin-bottom: 8px; color: var(--popover-color-title);">
|
|
404
|
+
Custom Styled Popover
|
|
405
|
+
</div>
|
|
406
|
+
<div style="line-height: 1.5; color: var(--popover-color-content);">
|
|
407
|
+
This popover overrides all available CSS custom properties: background, title color, and border radius. It
|
|
408
|
+
also uses
|
|
409
|
+
<code style="background: oklch(0.35 0.05 280); padding: 2px 6px; border-radius: 4px;">offset="lg"</code>
|
|
410
|
+
for extra spacing and
|
|
411
|
+
<code style="background: oklch(0.35 0.05 280); padding: 2px 6px; border-radius: 4px;">no-arrow</code> for
|
|
412
|
+
a clean look.
|
|
413
|
+
</div>
|
|
414
|
+
</div>
|
|
415
|
+
</btu-popover>
|
|
416
|
+
</div>
|
|
417
|
+
</div>
|
|
418
|
+
\`,
|
|
419
|
+
parameters: {
|
|
420
|
+
docs: {
|
|
421
|
+
description: {
|
|
422
|
+
story: \`Demonstrates full customization of all CSS custom properties. Set these on a parent element or directly on the component:
|
|
423
|
+
|
|
424
|
+
- \\\`--popover-color-background\\\` — Background color
|
|
425
|
+
- \\\`--popover-color-title\\\` — Title text color
|
|
426
|
+
- \\\`--popover-color-content\\\` — Content text color
|
|
427
|
+
- \\\`--popover-border-radius\\\` — Border radius\`
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}`,...l.parameters?.docs?.source}}};const y=["Default","Positions","RichContent","AdvancedUsage"];export{l as AdvancedUsage,n as Default,i as Positions,s as RichContent,y as __namedExportsOrder,h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./iframe-CcloOV09.js";const i=t=>{class n extends t{connectedCallback(){super.connectedCallback(),Promise.resolve().then(()=>this.emit("btu-element-connected",{}),e=>this.emit("btu-element-error",{error:e}))}disconnectedCallback(){super.disconnectedCallback(),this.emit("btu-element-disconnected")}emit(e,c){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:c}))}}return n},l=t=>{class n extends t{connectedCallback(){const e=()=>{super.connectedCallback()};document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",()=>e())}}return n};export{i as E,l as R};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as o}from"./iframe-
|
|
1
|
+
import{x as o}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz.js";const r={title:"Utilities/RTC",tags:["autodocs"],parameters:{docs:{subtitle:"The `rtc` module provides real-time communication between browser tabs and the Brightspot CMS server. Uses BroadcastChannel for cross-tab coordination with leader election, and Server-Sent Events for server communication."},controls:{expanded:!0}}},e={render:()=>o`
|
|
2
2
|
<div class="space-y-6 text-sm">
|
|
3
3
|
<div>
|
|
4
4
|
<h3 class="mb-2 font-bold">Overview</h3>
|
|
@@ -51,7 +51,7 @@ import{x as o}from"./iframe-lTczLWsL.js";import"./preload-helper-PPVm8Dsz.js";co
|
|
|
51
51
|
<h3 class="mb-2 font-bold">Receiving Broadcasts</h3>
|
|
52
52
|
<pre
|
|
53
53
|
class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
|
|
54
|
-
><code>import rtc from '@brightspot/ui/
|
|
54
|
+
><code>import rtc from '@brightspot/ui/util/rtc.js'
|
|
55
55
|
|
|
56
56
|
// Listen for content publish events
|
|
57
57
|
rtc.receive('com.psddev.cms.tool.page.content.PublishBroadcast', (data) => {
|
|
@@ -192,7 +192,7 @@ rtc.execute('com.example.MyAction', { id: '123', value: 'updated' })</code></pre
|
|
|
192
192
|
<h3 class="mb-2 font-bold">Receiving Broadcasts</h3>
|
|
193
193
|
<pre
|
|
194
194
|
class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
|
|
195
|
-
><code>import rtc from '@brightspot/ui/
|
|
195
|
+
><code>import rtc from '@brightspot/ui/util/rtc.js'
|
|
196
196
|
|
|
197
197
|
// Listen for content publish events
|
|
198
198
|
rtc.receive('com.psddev.cms.tool.page.content.PublishBroadcast', (data) => {
|
package/dist/storybook/assets/{ScrollShadow.stories-DHcKhkag.js → ScrollShadow.stories-BSV4U-tq.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as a}from"./iframe-
|
|
1
|
+
import{x as a}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz.js";const l=({theme:e="btu-scrollshadow-25"})=>{const r=new Array(100).fill(0).map((s,t)=>`Item ${t+1}`);return a`
|
|
2
2
|
<style>
|
|
3
3
|
:root {
|
|
4
4
|
--can-scroll: ;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as u}from"./iframe-
|
|
1
|
+
import{x as u}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz.js";function v(e,t){if(e<=0)return t;let n,o=0;return function(){if(n)return;const r=Date.now(),s=e-r+o;s<=0?(o=r,t.apply(this,[...arguments])):n=setTimeout(()=>{o=r,n=void 0,t.apply(this,[...arguments])},s)}}const x={title:"Utilities/Throttle",tags:["autodocs"],parameters:{docs:{subtitle:"The `throttle` utility function limits how often a function can execute, ensuring it runs at most once per specified interval. Useful for high-frequency events like scroll, resize, or mousemove."},controls:{expanded:!0}},argTypes:{interval:{control:{type:"number",min:0,max:2e3,step:50},description:"Throttle interval in milliseconds"}},args:{interval:200}},d={render:e=>{const t=`throttle-${Math.random().toString(36).substring(2,9)}`;let n=0,o=0;const r=()=>{const h=document.getElementById(`${t}-normal-count`),m=document.getElementById(`${t}-throttled-count`);h&&(h.textContent=String(n)),m&&(m.textContent=String(o))},s=v(e.interval,()=>{o++,r()}),a=()=>{n++,r()},l=()=>{a(),s()};return u`
|
|
2
2
|
<div class="space-y-4">
|
|
3
3
|
<div class="text-base">
|
|
4
4
|
<p class="mb-2">
|
|
@@ -30,7 +30,7 @@ import{x as u}from"./iframe-lTczLWsL.js";import"./preload-helper-PPVm8Dsz.js";fu
|
|
|
30
30
|
Reset Counters
|
|
31
31
|
</button>
|
|
32
32
|
</div>
|
|
33
|
-
`},parameters:{docs:{description:{story:"Interactive example showing throttle in action. Move your mouse over the box to see how throttling reduces function calls."}}}},i={render:()=>{const e=`scroll-${Math.random().toString(36).substring(2,9)}`;let t=0,n=0;const o=()=>{const
|
|
33
|
+
`},parameters:{docs:{description:{story:"Interactive example showing throttle in action. Move your mouse over the box to see how throttling reduces function calls."}}}},i={render:()=>{const e=`scroll-${Math.random().toString(36).substring(2,9)}`;let t=0,n=0;const o=()=>{const a=document.getElementById(`${e}-normal-count`),l=document.getElementById(`${e}-throttled-count`);a&&(a.textContent=String(t)),l&&(l.textContent=String(n))},r=v(300,()=>{n++,o()});return u`
|
|
34
34
|
<div class="space-y-4">
|
|
35
35
|
<div class="text-base">
|
|
36
36
|
<p class="mb-2">
|
|
@@ -41,7 +41,7 @@ import{x as u}from"./iframe-lTczLWsL.js";import"./preload-helper-PPVm8Dsz.js";fu
|
|
|
41
41
|
|
|
42
42
|
<div @scroll=${()=>{t++,o(),r()}} class="h-64 overflow-y-scroll rounded border-2 border-gray-300 bg-gray-50 p-4">
|
|
43
43
|
<div class="space-y-4">
|
|
44
|
-
${Array.from({length:50},(
|
|
44
|
+
${Array.from({length:50},(a,l)=>u` <div class="rounded border bg-white p-4">Item ${l+1}</div> `)}
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
47
|
|
|
@@ -69,7 +69,7 @@ import{x as u}from"./iframe-lTczLWsL.js";import"./preload-helper-PPVm8Dsz.js";fu
|
|
|
69
69
|
<h3 class="mb-2 font-bold">Basic Usage</h3>
|
|
70
70
|
<pre
|
|
71
71
|
class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
|
|
72
|
-
><code>import { throttle } from '@brightspot/ui/
|
|
72
|
+
><code>import { throttle } from '@brightspot/ui/util/throttle.js'
|
|
73
73
|
|
|
74
74
|
const handleScroll = throttle(200, () => {
|
|
75
75
|
console.log('Scroll handler - max once per 200ms')
|
|
@@ -109,7 +109,7 @@ window.addEventListener('scroll', handleScroll)</code></pre>
|
|
|
109
109
|
</p>
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
112
|
-
`,parameters:{docs:{description:{story:"Code examples and documentation for using the throttle utility."}}}};
|
|
112
|
+
`,parameters:{docs:{description:{story:"Code examples and documentation for using the throttle utility."}}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
|
|
113
113
|
render: args => {
|
|
114
114
|
const instanceId = \`throttle-\${Math.random().toString(36).substring(2, 9)}\`;
|
|
115
115
|
let normalCount = 0;
|
|
@@ -177,7 +177,7 @@ window.addEventListener('scroll', handleScroll)</code></pre>
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
}`,...
|
|
180
|
+
}`,...d.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
|
|
181
181
|
render: () => {
|
|
182
182
|
const instanceId = \`scroll-\${Math.random().toString(36).substring(2, 9)}\`;
|
|
183
183
|
let scrollCount = 0;
|
|
@@ -252,7 +252,7 @@ window.addEventListener('scroll', handleScroll)</code></pre>
|
|
|
252
252
|
<h3 class="mb-2 font-bold">Basic Usage</h3>
|
|
253
253
|
<pre
|
|
254
254
|
class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
|
|
255
|
-
><code>import { throttle } from '@brightspot/ui/
|
|
255
|
+
><code>import { throttle } from '@brightspot/ui/util/throttle.js'
|
|
256
256
|
|
|
257
257
|
const handleScroll = throttle(200, () => {
|
|
258
258
|
console.log('Scroll handler - max once per 200ms')
|
|
@@ -300,4 +300,4 @@ window.addEventListener('scroll', handleScroll)</code></pre>
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
}`,...c.parameters?.docs?.source}}};const y=["Interactive","ScrollExample","UsageExample"];export{
|
|
303
|
+
}`,...c.parameters?.docs?.source}}};const y=["Interactive","ScrollExample","UsageExample"];export{d as Interactive,i as ScrollExample,c as UsageExample,y as __namedExportsOrder,x as default};
|