@brightspot/ui 1.0.1-wc.2 → 1.0.1-wc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1 -1
- package/dist/LucideDynamicLoader.js +2 -2
- package/dist/LucideDynamicLoader.js.map +1 -1
- package/dist/LucideDynamicLoader.ts +2 -2
- package/dist/components/widget/Widget.d.ts +1 -1
- package/dist/components/widget/Widget.d.ts.map +1 -1
- package/dist/components/widget/Widget.js +10 -9
- package/dist/components/widget/Widget.js.map +1 -1
- package/dist/storybook/assets/{Badge.stories-BVaCGD8W.js → Badge.stories-cKvztBhm.js} +1 -1
- package/dist/storybook/assets/{Button.stories-C0BmUO4_.js → Button.stories-BH3fEuOH.js} +1 -1
- package/dist/storybook/assets/{Color-64QXVMR3-zezFbyuS.js → Color-64QXVMR3-BV_8WWIP.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-CYFhcW5P.js → Colors.stories-CcpJ2Txp.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-8LPqm3WW.js → Heading.stories-cqZamo-6.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CpupdzrH.js → Icon.stories-uPhO3RBG.js} +1 -1
- package/dist/storybook/assets/{Loader.stories-D0mnY_Z0.js → Loader.stories-D7Bl-LN9.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-BB4wF3c9.js → ScrollShadow.stories-CWKYDYLk.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-yw3AloF5.js → Widget.stories-CcjywoYR.js} +16 -39
- package/dist/storybook/assets/{WithTooltip-SK46ZJ2J-bOrMS36j.js → WithTooltip-SK46ZJ2J-DyavE1Bj.js} +5 -5
- package/dist/storybook/assets/formatter-OMEEQ6HG-DBJ97XaR.js +1 -0
- package/dist/storybook/assets/{iframe-C5bTYo4K.js → iframe-mIh0R_Av.js} +4 -4
- package/dist/storybook/assets/{index-BLdw66Ec.js → index-C8IjQgz6.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-CAVLW7PM-yrojVZDo.js → syntaxhighlighter-CAVLW7PM-36bUIV4n.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/tailwind-plugin-icon.js +2 -2
- package/dist/tailwind-plugin-icon.js.map +1 -1
- package/dist/tailwind-plugin-icon.ts +2 -2
- package/package.json +5 -2
- package/dist/storybook/assets/formatter-OMEEQ6HG-D2EXmNwo.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{x as r}from"./iframe-
|
|
1
|
+
import{x as r}from"./iframe-mIh0R_Av.js";import"./preload-helper-PPVm8Dsz.js";const o=()=>r` <div class=${["before:btu-loader","before:size-[--Loader-size]"].join(" ")}></div> `,d={title:"Components/Loader",component:"btu-loader",tags:["autodocs"],parameters:{docs:{subtitle:`To avoid changing the markup, btu-loaders work by assigning the "--tw-content" property of a pseudo element the SVG data as a URI for it's background image. Loaders come with light & dark styles and are extrinsically sized. If you need to reference the default loader size for your container, you can do so with: var(--Loader-size)`},controls:{expanded:!0}},render:a=>o(),argTypes:{},args:{}},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,d as default};
|
package/dist/storybook/assets/{ScrollShadow.stories-BB4wF3c9.js → ScrollShadow.stories-CWKYDYLk.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as a}from"./iframe-
|
|
1
|
+
import{x as a}from"./iframe-mIh0R_Av.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,31 +1,8 @@
|
|
|
1
|
-
import{
|
|
2
|
-
class="Widget-title ${this.invalid?"text-error-600":""} btu-heading-5 sticky top-0 z-10 cursor-pointer overflow-x-clip text-ellipsis whitespace-nowrap border-b border-b-gray-200 bg-white px-[--space] py-3.5 text-gray-900 [grid-column:fullbleed-start_/_fullbleed-end] hover:bg-gray-100 focus:ring-0"
|
|
3
|
-
@click="${()=>this.collapsed=!this.collapsed}"
|
|
4
|
-
>
|
|
5
|
-
<div
|
|
6
|
-
class="Widget-expand ${this.invalid?"after:btu-icon after:btu-icon-circle-alert after:text-error-600":""} relative inline-flex w-full items-center gap-2 focus:ring-0"
|
|
7
|
-
role="button"
|
|
8
|
-
tabindex="0"
|
|
9
|
-
aria-expanded=${!this.collapsed}
|
|
10
|
-
title=${this.collapsed?x:f}
|
|
11
|
-
@keydown=${O(e=>{e instanceof KeyboardEvent&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.collapsed=!this.collapsed)})}
|
|
12
|
-
>
|
|
13
|
-
${this.heading}
|
|
14
|
-
<ul
|
|
15
|
-
class="Widget-controls sticky top-0 z-[11] order-2 ms-auto flex items-center gap-2 border-b-0 border-b-gray-200 bg-inherit empty:hidden"
|
|
16
|
-
aria-hidden="true"
|
|
17
|
-
>
|
|
18
|
-
<li
|
|
19
|
-
class="Widget-collapse btu-button btu-button-text-hidden btu-button-fill-none btu-button-gray btu-button-sm before:btu-icon before:btu-icon-chevron-up ${this.collapsed?"before:rotate-180":""} before:transition-transform"
|
|
20
|
-
title="${this.collapsed?x:f}"
|
|
21
|
-
></li>
|
|
22
|
-
</ul>
|
|
23
|
-
</div>
|
|
24
|
-
</h2>`}render(){return this.classList.add("widget","Widget","relative","grid","bg-white"),this.classList.toggle("is-collapsible",this.collapsible),this.classList.toggle("is-collapsed",this.collapsed),this.collapsed&&this.classList.add("overflow-clip","border-b-0","pb-0"),this.classList.toggle("is-error",this.invalid),this.querySelectorAll(":scope > :not(.Widget-title, script, select)").forEach(e=>{e.toggleAttribute("hidden",this.collapsed)}),this.collapsible?(this.classList.add("h-[min-content]"),this._collapsibleTemplate()):g`<h2 class="Widget-title ${this.invalid?"text-error-600":""}">${this.heading}</h2>`}};c([p({type:Boolean})],o.prototype,"collapsible",2);c([p({type:String})],o.prototype,"heading",2);c([p({type:String})],o.prototype,"internalname",2);c([I()],o.prototype,"invalid",2);c([p({type:String})],o.prototype,"widgetid",2);c([p({type:Boolean})],o.prototype,"collapsed",1);o=c([T("btu-widget")],o);const{events:P,args:_,argTypes:B,template:q}=S("btu-widget"),N={title:"Components/Widget",component:"btu-widget",tags:["autodocs"],parameters:{actions:{handles:P}},args:{..._,heading:"Widget Title",internalname:"example",widgetid:"demo"},argTypes:B,render:e=>q(e,g`
|
|
1
|
+
import{g as u,x as o}from"./iframe-mIh0R_Av.js";import"./preload-helper-PPVm8Dsz.js";const{events:w,args:h,argTypes:v,template:y}=u("btu-widget"),E={title:"Components/Widget",component:"btu-widget",tags:["autodocs"],parameters:{actions:{handles:w}},args:{...h,heading:"Widget Title",internalname:"example",widgetid:"demo"},argTypes:v,render:e=>y(e,o`
|
|
25
2
|
<div class="p-6">
|
|
26
3
|
<p class="text-gray-700">This is the widget content. It can contain any HTML elements.</p>
|
|
27
4
|
</div>
|
|
28
|
-
`)},
|
|
5
|
+
`)},s={args:{},parameters:{docs:{description:{story:"Basic widget with a title. Non-collapsible by default, displays content statically."}}}},a={args:{collapsible:!0,heading:"Collapsible Widget"},parameters:{docs:{description:{story:"Collapsible widget with expand/collapse button. Click the title or press Enter/Space on the expand button to toggle. State persists in localStorage."}}}},r={args:{collapsible:!0,heading:"Widget with Error",internalname:"errorWidget",widgetid:"error-001"},render:e=>o`
|
|
29
6
|
<btu-widget
|
|
30
7
|
?collapsible=${e.collapsible}
|
|
31
8
|
.heading=${e.heading}
|
|
@@ -45,7 +22,7 @@ import{f as E,u as C,x as g,i as $,g as S}from"./iframe-C5bTYo4K.js";import"./pr
|
|
|
45
22
|
</div>
|
|
46
23
|
</div>
|
|
47
24
|
</btu-widget>
|
|
48
|
-
`,parameters:{docs:{description:{story:"Widget automatically expands when it contains error messages (elements with `.Message.is-error` class). The title text turns red and displays an error icon."}}}},
|
|
25
|
+
`,parameters:{docs:{description:{story:"Widget automatically expands when it contains error messages (elements with `.Message.is-error` class). The title text turns red and displays an error icon."}}}},d={args:{collapsible:!0,heading:"Publishing Tools"},render:()=>o`
|
|
49
26
|
<div class="space-y-4">
|
|
50
27
|
<btu-widget collapsible heading="Metadata" internalname="metadata" widgetid="pub-001">
|
|
51
28
|
<div class="p-6">
|
|
@@ -71,20 +48,20 @@ import{f as E,u as C,x as g,i as $,g as S}from"./iframe-C5bTYo4K.js";import"./pr
|
|
|
71
48
|
</div>
|
|
72
49
|
</btu-widget>
|
|
73
50
|
</div>
|
|
74
|
-
`,parameters:{docs:{description:{story:"Multiple collapsible widgets stacked vertically, simulating a right rail or sidebar layout. Each widget maintains independent collapse state."}}}},
|
|
51
|
+
`,parameters:{docs:{description:{story:"Multiple collapsible widgets stacked vertically, simulating a right rail or sidebar layout. Each widget maintains independent collapse state."}}}},l={args:{collapsible:!0,heading:"Widget with Event Monitoring",internalname:"eventDemo",widgetid:"events-001"},render:e=>{const g=`widget-${Math.random().toString(36).substr(2,9)}`,p=`log-${g}`,m=(n,i)=>{const t=document.getElementById(p);if(!t)return;const b=new Date().toLocaleTimeString(),c=document.createElement("div");for(c.className="border-l-4 border-primary-500 bg-primary-50 px-4 py-2 mb-2",c.innerHTML=`
|
|
75
52
|
<div class="flex items-center justify-between">
|
|
76
|
-
<span class="font-semibold text-primary-900">${
|
|
77
|
-
<span class="text-xs text-primary-700">${
|
|
53
|
+
<span class="font-semibold text-primary-900">${n}</span>
|
|
54
|
+
<span class="text-xs text-primary-700">${b}</span>
|
|
78
55
|
</div>
|
|
79
|
-
${
|
|
80
|
-
`,
|
|
56
|
+
${i?`<pre class="text-xs text-primary-800 mt-1">${JSON.stringify(i,null,2)}</pre>`:""}
|
|
57
|
+
`,t.insertBefore(c,t.firstChild);t.children.length>10;)t.removeChild(t.lastChild)};return setTimeout(()=>{const n=document.getElementById(g);n&&(n.addEventListener("btu-widget-ready",(i=>{m("btu-widget-ready",{timestamp:new Date().toISOString()})})),n.addEventListener("btu-widget-toggle",(i=>{const t=i.target;m("btu-widget-toggle",{collapsed:t.collapsed,timestamp:new Date().toISOString()})})))},0),o`
|
|
81
58
|
<div class="space-y-4">
|
|
82
59
|
<div class="rounded-lg border border-gray-200 bg-gray-50 p-4">
|
|
83
60
|
<h3 class="mb-2 text-sm font-semibold text-gray-900">Event Log</h3>
|
|
84
61
|
<p class="mb-3 text-xs text-gray-600">
|
|
85
62
|
Events emitted by the widget will appear here in real-time. Try collapsing/expanding the widget below.
|
|
86
63
|
</p>
|
|
87
|
-
<div id="${
|
|
64
|
+
<div id="${p}" class="max-h-96 space-y-2 overflow-y-auto"></div>
|
|
88
65
|
<div class="mt-3 text-xs text-gray-500">
|
|
89
66
|
<strong>Events:</strong>
|
|
90
67
|
<ul class="ml-2 mt-1 list-inside list-disc">
|
|
@@ -95,7 +72,7 @@ import{f as E,u as C,x as g,i as $,g as S}from"./iframe-C5bTYo4K.js";import"./pr
|
|
|
95
72
|
</div>
|
|
96
73
|
|
|
97
74
|
<btu-widget
|
|
98
|
-
id="${
|
|
75
|
+
id="${g}"
|
|
99
76
|
?collapsible=${e.collapsible}
|
|
100
77
|
.heading=${e.heading}
|
|
101
78
|
.internalname=${e.internalname}
|
|
@@ -123,7 +100,7 @@ Widget event emission demonstration. The widget emits two custom events:
|
|
|
123
100
|
- **btu-widget-toggle**: Fired whenever the collapse state changes (only for collapsible widgets)
|
|
124
101
|
|
|
125
102
|
All events bubble up through the DOM and can be listened to on the widget element or any parent element.
|
|
126
|
-
`}}}};
|
|
103
|
+
`}}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
|
|
127
104
|
args: {},
|
|
128
105
|
parameters: {
|
|
129
106
|
docs: {
|
|
@@ -132,7 +109,7 @@ All events bubble up through the DOM and can be listened to on the widget elemen
|
|
|
132
109
|
}
|
|
133
110
|
}
|
|
134
111
|
}
|
|
135
|
-
}`,...
|
|
112
|
+
}`,...s.parameters?.docs?.source}}};a.parameters={...a.parameters,docs:{...a.parameters?.docs,source:{originalSource:`{
|
|
136
113
|
args: {
|
|
137
114
|
collapsible: true,
|
|
138
115
|
heading: 'Collapsible Widget'
|
|
@@ -144,7 +121,7 @@ All events bubble up through the DOM and can be listened to on the widget elemen
|
|
|
144
121
|
}
|
|
145
122
|
}
|
|
146
123
|
}
|
|
147
|
-
}`,...
|
|
124
|
+
}`,...a.parameters?.docs?.source}}};r.parameters={...r.parameters,docs:{...r.parameters?.docs,source:{originalSource:`{
|
|
148
125
|
args: {
|
|
149
126
|
collapsible: true,
|
|
150
127
|
heading: 'Widget with Error',
|
|
@@ -179,7 +156,7 @@ All events bubble up through the DOM and can be listened to on the widget elemen
|
|
|
179
156
|
}
|
|
180
157
|
}
|
|
181
158
|
}
|
|
182
|
-
}`,...
|
|
159
|
+
}`,...r.parameters?.docs?.source}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
|
|
183
160
|
args: {
|
|
184
161
|
collapsible: true,
|
|
185
162
|
heading: 'Publishing Tools'
|
|
@@ -218,7 +195,7 @@ All events bubble up through the DOM and can be listened to on the widget elemen
|
|
|
218
195
|
}
|
|
219
196
|
}
|
|
220
197
|
}
|
|
221
|
-
}`,...
|
|
198
|
+
}`,...d.parameters?.docs?.source}}};l.parameters={...l.parameters,docs:{...l.parameters?.docs,source:{originalSource:`{
|
|
222
199
|
args: {
|
|
223
200
|
collapsible: true,
|
|
224
201
|
heading: 'Widget with Event Monitoring',
|
|
@@ -320,4 +297,4 @@ All events bubble up through the DOM and can be listened to on the widget elemen
|
|
|
320
297
|
}
|
|
321
298
|
}
|
|
322
299
|
}
|
|
323
|
-
}`,...
|
|
300
|
+
}`,...l.parameters?.docs?.source}}};const C=["Default","Collapsible","WithErrorMessage","MultipleWidgets","EventEmission"];export{a as Collapsible,s as Default,l as EventEmission,d as MultipleWidgets,r as WithErrorMessage,C as __namedExportsOrder,E as default};
|