@brightspot/ui 1.0.1-pr18.0 → 1.0.1-pr18.2
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/badge/Badge.d.ts +5 -13
- package/dist/components/badge/Badge.d.ts.map +1 -1
- package/dist/components/badge/Badge.js +12 -16
- package/dist/components/badge/Badge.js.map +1 -1
- package/{custom-elements.json → dist/custom-elements.json} +2 -43
- package/dist/storybook/assets/Badge.stories-BdDZDchh.js +134 -0
- package/dist/storybook/assets/{Button.stories-gjqwP9Dd.js → Button.stories-BoKbycx8.js} +1 -1
- package/dist/storybook/assets/{Color-64QXVMR3-zvVywvcs.js → Color-64QXVMR3-DLJWINcF.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-BSHTes66.js → Colors.stories-ZSvs64Nk.js} +1 -1
- package/dist/storybook/assets/Events.stories-fiOqLEev.js +108 -0
- package/dist/storybook/assets/{Heading.stories-CuxV5Ha4.js → Heading.stories-BJvBkb_o.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-ECH3sQLo.js → Icon.stories-BKlDo0TB.js} +1 -1
- package/dist/storybook/assets/{Loader.stories-C_Nt0MWZ.js → Loader.stories-DF1UeQKo.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-AVqXbAPK.js → ScrollShadow.stories-DcZQAMb6.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-SK46ZJ2J-CfHHW7CI.js → WithTooltip-SK46ZJ2J-CH4kkoEy.js} +5 -5
- package/dist/storybook/assets/formatter-OMEEQ6HG-BdP7nPDt.js +1 -0
- package/dist/storybook/assets/iframe-9mlxmT2J.css +1 -0
- package/dist/storybook/assets/{iframe-zcxd989B.js → iframe-BSmF2RM6.js} +84 -88
- package/dist/storybook/assets/{index-DCmyvMEs.js → index-MSInla--.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-CAVLW7PM-MI_0amTU.js → syntaxhighlighter-CAVLW7PM-DGPlOaQF.js} +1 -1
- package/dist/storybook/iframe.html +2 -2
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/tailwind-plugin-badge.js +9 -9
- package/dist/tailwind-plugin-badge.js.map +1 -1
- package/dist/tailwind-plugin-badge.ts +11 -11
- package/dist/utils/EventEmitterMixin.d.ts +6 -6
- package/dist/utils/EventEmitterMixin.d.ts.map +1 -1
- package/dist/utils/EventEmitterMixin.js +7 -7
- package/dist/utils/EventEmitterMixin.js.map +1 -1
- package/package.json +5 -7
- package/dist/storybook/assets/Badge.stories-DEsdluIh.js +0 -121
- package/dist/storybook/assets/formatter-OMEEQ6HG-f5NO_AKZ.js +0 -1
- package/dist/storybook/assets/iframe-ubZg9Abb.css +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import{x as d}from"./iframe-BSmF2RM6.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:"Components/Events",tags:["autodocs"],parameters:{docs:{subtitle:"Events inherited from EventEmitterMixin",description:{component:`
|
|
2
|
+
<h3>EventEmitterMixin Events</h3>
|
|
3
|
+
|
|
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>
|
|
5
|
+
|
|
6
|
+
<h4>Standard Lifecycle Events</h4>
|
|
7
|
+
|
|
8
|
+
<table>
|
|
9
|
+
<thead>
|
|
10
|
+
<tr>
|
|
11
|
+
<th>Event Name</th>
|
|
12
|
+
<th>Type</th>
|
|
13
|
+
<th>Description</th>
|
|
14
|
+
<th>Detail</th>
|
|
15
|
+
</tr>
|
|
16
|
+
</thead>
|
|
17
|
+
<tbody>
|
|
18
|
+
<tr>
|
|
19
|
+
<td><code>btu-element-connected</code></td>
|
|
20
|
+
<td>CustomEvent</td>
|
|
21
|
+
<td>Fired when element connects to DOM</td>
|
|
22
|
+
<td><code>{}</code></td>
|
|
23
|
+
</tr>
|
|
24
|
+
<tr>
|
|
25
|
+
<td><code>btu-element-disconnected</code></td>
|
|
26
|
+
<td>CustomEvent</td>
|
|
27
|
+
<td>Fired when element disconnects from DOM</td>
|
|
28
|
+
<td><code>undefined</code></td>
|
|
29
|
+
</tr>
|
|
30
|
+
<tr>
|
|
31
|
+
<td><code>btu-element-error</code></td>
|
|
32
|
+
<td>CustomEvent<{error: Error}></td>
|
|
33
|
+
<td>Fired on connection error</td>
|
|
34
|
+
<td><code>{ error: Error }</code></td>
|
|
35
|
+
</tr>
|
|
36
|
+
</tbody>
|
|
37
|
+
</table>
|
|
38
|
+
|
|
39
|
+
<h3>Event Configuration</h3>
|
|
40
|
+
|
|
41
|
+
<p>All events are dispatched with the following configuration:</p>
|
|
42
|
+
<ul>
|
|
43
|
+
<li><strong>bubbles:</strong> <code>true</code> - Event propagates up the DOM tree</li>
|
|
44
|
+
<li><strong>cancelable:</strong> <code>false</code> - Event cannot be cancelled</li>
|
|
45
|
+
<li><strong>composed:</strong> <code>true</code> - Event crosses shadow DOM boundaries</li>
|
|
46
|
+
</ul>
|
|
47
|
+
`}}}},e={render:()=>d(o||(o=s([`<div class="flex flex-col gap-4">
|
|
48
|
+
<div>
|
|
49
|
+
<h4 class="mb-2 font-bold">Example Component with Events</h4>
|
|
50
|
+
<btu-badge variant="info" size="md" id="event-demo">Event Demo</btu-badge>
|
|
51
|
+
</div>
|
|
52
|
+
<div>
|
|
53
|
+
<p class="text-sm text-gray-600">
|
|
54
|
+
Check your browser console to see events fired when this badge connects to the DOM.
|
|
55
|
+
</p>
|
|
56
|
+
</div>
|
|
57
|
+
<script>
|
|
58
|
+
;(() => {
|
|
59
|
+
const badge = document.getElementById('event-demo')
|
|
60
|
+
if (badge) {
|
|
61
|
+
badge.addEventListener('btu-element-connected', e => {
|
|
62
|
+
console.log('✅ btu-element-connected', e.detail)
|
|
63
|
+
})
|
|
64
|
+
badge.addEventListener('btu-element-disconnected', () => {
|
|
65
|
+
console.log('🔌 btu-element-disconnected')
|
|
66
|
+
})
|
|
67
|
+
badge.addEventListener('btu-element-error', e => {
|
|
68
|
+
console.error('❌ btu-element-error', e.detail.error)
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
})()
|
|
72
|
+
<\/script>
|
|
73
|
+
</div>`]))),parameters:{docs:{description:{story:"This example demonstrates the EventEmitterMixin events. Open your browser console to see the connection event fired when the badge element connects to the DOM."}}}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
|
|
74
|
+
render: () => html\`<div class="flex flex-col gap-4">
|
|
75
|
+
<div>
|
|
76
|
+
<h4 class="mb-2 font-bold">Example Component with Events</h4>
|
|
77
|
+
<btu-badge variant="info" size="md" id="event-demo">Event Demo</btu-badge>
|
|
78
|
+
</div>
|
|
79
|
+
<div>
|
|
80
|
+
<p class="text-sm text-gray-600">
|
|
81
|
+
Check your browser console to see events fired when this badge connects to the DOM.
|
|
82
|
+
</p>
|
|
83
|
+
</div>
|
|
84
|
+
<script>
|
|
85
|
+
;(() => {
|
|
86
|
+
const badge = document.getElementById('event-demo')
|
|
87
|
+
if (badge) {
|
|
88
|
+
badge.addEventListener('btu-element-connected', e => {
|
|
89
|
+
console.log('✅ btu-element-connected', e.detail)
|
|
90
|
+
})
|
|
91
|
+
badge.addEventListener('btu-element-disconnected', () => {
|
|
92
|
+
console.log('🔌 btu-element-disconnected')
|
|
93
|
+
})
|
|
94
|
+
badge.addEventListener('btu-element-error', e => {
|
|
95
|
+
console.error('❌ btu-element-error', e.detail.error)
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
})()
|
|
99
|
+
<\/script>
|
|
100
|
+
</div>\`,
|
|
101
|
+
parameters: {
|
|
102
|
+
docs: {
|
|
103
|
+
description: {
|
|
104
|
+
story: \`This example demonstrates the EventEmitterMixin events. Open your browser console to see the connection event fired when the badge element connects to the DOM.\`
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}`,...e.parameters?.docs?.source}}};const m=["EventEmitterMixin"];export{e as EventEmitterMixin,m as __namedExportsOrder,l as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{x as s}from"./iframe-
|
|
1
|
+
import{x as s}from"./iframe-BSmF2RM6.js";import"./preload-helper-PPVm8Dsz.js";const a=({size:t})=>s` <div class=${[`btu-heading-${t}`].join(" ")}>Heading</div> `,n={title:"Components/Heading",component:"btu-heading",tags:["autodocs"],parameters:{docs:{subtitle:"btu-heading"},controls:{expanded:!0}},render:t=>a(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 i=["Default"];export{e as Default,i as __namedExportsOrder,n as default};
|