@brightspot/ui 1.4.1 → 1.6.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/pagination/Pagination.d.ts +109 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -0
- package/dist/components/pagination/Pagination.js +351 -0
- package/dist/components/pagination/Pagination.js.map +1 -0
- 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 +1151 -184
- package/dist/global.d.ts +5 -0
- package/dist/storybook/assets/{Avatar.stories-QxWs-YfX.js → Avatar.stories-CafEcy4T.js} +37 -32
- package/dist/storybook/assets/AvatarGroup.stories-BBkQuFKk.js +225 -0
- package/dist/storybook/assets/{Badge.stories-BpaApWbR.js → Badge.stories-mFZsls7i.js} +1 -1
- package/dist/storybook/assets/{Button.stories-C5h2usmd.js → Button.stories-CAWX17L1.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-DlPOiGja.js → CircularProgress.stories-DBVt4Cg2.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-Bb45-UOM.js → ClipboardMixin.stories-BH9E-OI6.js} +7 -7
- package/dist/storybook/assets/Color-6BZIO3FS-CVnTzq2p.js +1 -0
- package/dist/storybook/assets/{Colors.stories-DP2JKWUJ.js → Colors.stories-BFYmP0LL.js} +1 -1
- package/dist/storybook/assets/ComponentStatesMixin-Cu7YXkU8.js +1 -0
- package/dist/storybook/assets/{ComponentStatesMixin.stories-CyQ2aSTu.js → ComponentStatesMixin.stories-CAvyYt0H.js} +3 -3
- package/dist/storybook/assets/{CopyToClipboard.stories-DR7pckeV.js → CopyToClipboard.stories-DbJZsp_L.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-hkqyvqmg.js → Debounce.stories-BiFiH1K9.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-Dtw9GMer.js → DocsRenderer-LL677BLK-Bq6G4eeC.js} +6 -6
- package/dist/storybook/assets/{Events.stories-BAgDzdyl.js → Events.stories-BsDBxh8_.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-CN_fPsRf.js → Heading.stories-zGzWgHVO.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CSx_2K8V.js → Icon.stories-B4T6sSwf.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-In48DY2g.js → LinearProgress.stories-qzqmUUwY.js} +1 -1
- package/dist/storybook/assets/Pagination.stories-B6Q-7taJ.js +272 -0
- package/dist/storybook/assets/Popover.stories-CGkU0SGv.js +431 -0
- package/dist/storybook/assets/ReadyMixin-3YCzoG6W.js +1 -0
- package/dist/storybook/assets/{Rtc.stories-19d7WXe4.js → Rtc.stories-Y1MYTWAt.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-BFjracVd.js → ScrollShadow.stories-B9kSpLT1.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-DD6ydiVq.js → Throttle.stories-BgvLDrS3.js} +1 -1
- package/dist/storybook/assets/Tooltip.stories-POo1M-ew.js +143 -0
- package/dist/storybook/assets/Widget.stories--JpqVyJe.js +233 -0
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-Be1dKqOF.js → WithTooltip-65CFNBJE-DNbD9hAX.js} +2 -2
- package/dist/storybook/assets/custom-element-UsVr97OX.js +1 -0
- package/dist/storybook/assets/{formatter-EIJCOSYU-anC2P5HS.js → formatter-EIJCOSYU-Cy8KIxab.js} +1 -1
- package/dist/storybook/assets/if-defined-CngSGyRu.js +1 -0
- package/dist/storybook/assets/iframe-DiT9Iz2T.css +1 -0
- package/dist/storybook/assets/{iframe-Bl9oHz5c.js → iframe-Dz6CxatW.js} +95 -95
- package/dist/storybook/assets/{index-Cn5E5A3G.js → index-CebChkmF.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-BMDLUk0l.js → onFind.stories-nHDImx0x.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-C3FcxtYh.js → onRemove.stories-CBxYVPwd.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-B8Zyu0Th.js → onVisible.stories-D4Qewc9Y.js} +1 -1
- package/dist/storybook/assets/style-map-BgW9piaW.js +1 -0
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-BfTKsIVL.js → syntaxhighlighter-ED5Y7EFY-CROW1475.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-pagination.d.ts +2 -0
- package/dist/tailwind-plugin-pagination.d.ts.map +1 -0
- package/dist/tailwind-plugin-pagination.js +164 -0
- package/dist/tailwind-plugin-pagination.js.map +1 -0
- package/dist/tailwind-plugin-pagination.ts +179 -0
- 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/tailwind.config.d.ts +1 -4
- package/dist/tailwind.config.d.ts.map +1 -1
- package/dist/tailwind.config.js +1 -0
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.ts +1 -0
- package/dist/util/EventEmitterMixin.d.ts +20 -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/aria.d.ts.map +1 -1
- package/dist/util/aria.js +2 -1
- package/dist/util/aria.js.map +1 -1
- package/dist/util/i18n.d.ts +13 -0
- package/dist/util/i18n.d.ts.map +1 -0
- package/dist/util/i18n.js +21 -0
- package/dist/util/i18n.js.map +1 -0
- package/package.json +2 -2
- package/dist/storybook/assets/AvatarGroup.stories-Cy_Bvn7E.js +0 -211
- package/dist/storybook/assets/Color-6BZIO3FS-CcgGYVAo.js +0 -1
- package/dist/storybook/assets/ComponentStatesMixin-B7ci0thi.js +0 -1
- package/dist/storybook/assets/iframe-B4njXYq6.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as d}from"./iframe-
|
|
1
|
+
import{x as d}from"./iframe-Dz6CxatW.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-Dz6CxatW.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-Dz6CxatW.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-Dz6CxatW.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,272 @@
|
|
|
1
|
+
import{g as m,x as o}from"./iframe-Dz6CxatW.js";import{o as c}from"./style-map-BgW9piaW.js";import"./preload-helper-PPVm8Dsz.js";const{events:b,args:h,argTypes:y}=m("btu-pagination"),u=t=>{const a={};return t.customBackgroundColor&&(a["--pagination-color-background"]=t.customBackgroundColor),t.customForegroundColor&&(a["--pagination-color-foreground"]=t.customForegroundColor),a},S={title:"Components/Pagination",component:"btu-pagination",tags:["autodocs"],parameters:{docs:{subtitle:"A component for navigating through paged content",description:{component:`
|
|
2
|
+
<h3>When to use:</h3>
|
|
3
|
+
<ul>
|
|
4
|
+
<li>To navigate through large sets of data</li>
|
|
5
|
+
<li>For search results, tables, and lists</li>
|
|
6
|
+
<li>In widgets and calendar views</li>
|
|
7
|
+
</ul>
|
|
8
|
+
|
|
9
|
+
<h3>Variants:</h3>
|
|
10
|
+
<ul>
|
|
11
|
+
<li><strong>Widget</strong> (default): Page size selector + total display + navigation</li>
|
|
12
|
+
<li><strong>Search</strong>: With page jumper dropdown</li>
|
|
13
|
+
<li><strong>Widget Small</strong>: Without first/last page buttons</li>
|
|
14
|
+
<li><strong>Calendar</strong>: Custom page-size slot + jumper slot</li>
|
|
15
|
+
</ul>
|
|
16
|
+
`}},actions:{handles:b},controls:{expanded:!0}},args:{...h,"total-items":200,"boundary-buttons":!0,"hide-on-single-page":!0,"page-size-changer":!0},argTypes:{...y,"--pagination-color-background":{table:{disable:!0}},"--pagination-color-foreground":{table:{disable:!0}},customBackgroundColor:{name:"--pagination-color-background",control:{type:"color"},description:"Custom background color for buttons and select",table:{category:"CSS Properties"}},customForegroundColor:{name:"--pagination-color-foreground",control:{type:"color"},description:"Custom foreground (text/icon) color",table:{category:"CSS Properties"}}},render:t=>o`
|
|
17
|
+
<btu-pagination
|
|
18
|
+
total-items="${t["total-items"]??200}"
|
|
19
|
+
page="${t.page??1}"
|
|
20
|
+
page-size="${t["page-size"]??0}"
|
|
21
|
+
page-size-options="${t["page-size-options"]??"10, 20, 50"}"
|
|
22
|
+
?disabled="${t.disabled}"
|
|
23
|
+
?loading="${t.loading}"
|
|
24
|
+
.hideOnSinglePage=${t["hide-on-single-page"]??!0}
|
|
25
|
+
.pageSizeChanger=${t["page-size-changer"]??!0}
|
|
26
|
+
.boundaryButtons=${t["boundary-buttons"]??!0}
|
|
27
|
+
?hide-total-count=${t["hide-total-count"]}
|
|
28
|
+
style=${c(u(t))}
|
|
29
|
+
></btu-pagination>
|
|
30
|
+
`},i={args:{},parameters:{docs:{description:{story:"Default Widget variant with page size selector, total display, and full navigation controls."}}}},s={args:{"total-items":500,"page-size-options":"10, 25, 50, 100"},render:t=>o`
|
|
31
|
+
<btu-pagination
|
|
32
|
+
total-items="${t["total-items"]??500}"
|
|
33
|
+
page="${t.page??1}"
|
|
34
|
+
page-size="${t["page-size"]??0}"
|
|
35
|
+
page-size-options="${t["page-size-options"]??"10, 25, 50, 100"}"
|
|
36
|
+
?disabled="${t.disabled}"
|
|
37
|
+
?loading="${t.loading}"
|
|
38
|
+
.hideOnSinglePage=${t["hide-on-single-page"]??!0}
|
|
39
|
+
.pageSizeChanger=${t["page-size-changer"]??!0}
|
|
40
|
+
.boundaryButtons=${t["boundary-buttons"]??!0}
|
|
41
|
+
?hide-total-count=${t["hide-total-count"]}
|
|
42
|
+
style=${c(u(t))}
|
|
43
|
+
>
|
|
44
|
+
<select
|
|
45
|
+
slot="jumper"
|
|
46
|
+
class="btu-pagination-select"
|
|
47
|
+
aria-label="Go to page"
|
|
48
|
+
@change=${a=>{const e=a.target,n=e.closest("btu-pagination");n&&(n.page=parseInt(e.value,10))}}
|
|
49
|
+
>
|
|
50
|
+
${Array.from({length:50},(a,e)=>o`<option value="${e+1}">Page ${e+1}</option>`)}
|
|
51
|
+
</select>
|
|
52
|
+
</btu-pagination>
|
|
53
|
+
`,parameters:{docs:{description:{story:'Search variant with a page jumper dropdown placed via `slot="jumper"`. Allows direct navigation to a specific page.'}}}},r={args:{"total-items":100,"boundary-buttons":!1},parameters:{docs:{description:{story:"Compact widget variant without first/last page buttons. Suitable for tight spaces."}}}},l={args:{"total-items":52},render:t=>o`
|
|
54
|
+
<btu-pagination
|
|
55
|
+
total-items="${t["total-items"]??52}"
|
|
56
|
+
page="${t.page??1}"
|
|
57
|
+
page-size="1"
|
|
58
|
+
?disabled="${t.disabled}"
|
|
59
|
+
?loading="${t.loading}"
|
|
60
|
+
.hideOnSinglePage=${t["hide-on-single-page"]??!0}
|
|
61
|
+
.pageSizeChanger=${!1}
|
|
62
|
+
.boundaryButtons=${t["boundary-buttons"]??!0}
|
|
63
|
+
?hide-total-count=${t["hide-total-count"]}
|
|
64
|
+
style=${c(u(t))}
|
|
65
|
+
>
|
|
66
|
+
<select slot="page-size" class="btu-pagination-select" aria-label="View type">
|
|
67
|
+
<option value="week">Week</option>
|
|
68
|
+
<option value="month">Month</option>
|
|
69
|
+
</select>
|
|
70
|
+
<button
|
|
71
|
+
slot="jumper"
|
|
72
|
+
class="btu-button btu-button-sm"
|
|
73
|
+
@click=${a=>{const e=a.target.closest("btu-pagination");e&&(e.page=1)}}
|
|
74
|
+
>
|
|
75
|
+
Today
|
|
76
|
+
</button>
|
|
77
|
+
</btu-pagination>
|
|
78
|
+
`,parameters:{docs:{description:{story:'Calendar variant using `slot="page-size"` for a week/month selector and `slot="jumper"` for a Today button.'}}}},p={args:{"total-items":200,loading:!0},parameters:{docs:{description:{story:"Loading state shows a spinner and dims the navigation controls. The `aria-busy` attribute is set on the live region."}}}},g={args:{"total-items":200,disabled:!0,page:3},parameters:{docs:{description:{story:"Disabled state prevents all interaction. All buttons and selects receive the native `disabled` attribute."}}}},d={render:()=>{const t=a=>{const e=a.target;e.loading=!0,setTimeout(()=>{e.loading=!1},1e3)};return o`
|
|
79
|
+
<div class="flex flex-col gap-4">
|
|
80
|
+
<div class="flex items-center gap-2">
|
|
81
|
+
<label for="total-input" class="text-sm font-medium">Total Items:</label>
|
|
82
|
+
<input
|
|
83
|
+
id="total-input"
|
|
84
|
+
type="number"
|
|
85
|
+
value="200"
|
|
86
|
+
min="0"
|
|
87
|
+
class="w-24 rounded border px-2 py-1 text-sm"
|
|
88
|
+
@input=${a=>{const e=a.target,n=e.closest(".flex.flex-col")?.querySelector("btu-pagination");n&&(n.totalItems=parseInt(e.value,10)||0)}}
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
<btu-pagination
|
|
92
|
+
total-items="200"
|
|
93
|
+
@btu-pagination-change=${t}
|
|
94
|
+
@btu-pagination-page-size-change=${t}
|
|
95
|
+
></btu-pagination>
|
|
96
|
+
</div>
|
|
97
|
+
`},parameters:{docs:{description:{story:"Interactive example demonstrating dynamic `totalItems` changes at runtime. Navigation triggers a simulated 1s loading state."}}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
|
|
98
|
+
args: {},
|
|
99
|
+
parameters: {
|
|
100
|
+
docs: {
|
|
101
|
+
description: {
|
|
102
|
+
story: 'Default Widget variant with page size selector, total display, and full navigation controls.'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}`,...i.parameters?.docs?.source}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
|
|
107
|
+
args: {
|
|
108
|
+
'total-items': 500,
|
|
109
|
+
'page-size-options': '10, 25, 50, 100'
|
|
110
|
+
},
|
|
111
|
+
render: args => html\`
|
|
112
|
+
<btu-pagination
|
|
113
|
+
total-items="\${args['total-items'] ?? 500}"
|
|
114
|
+
page="\${args.page ?? 1}"
|
|
115
|
+
page-size="\${args['page-size'] ?? 0}"
|
|
116
|
+
page-size-options="\${args['page-size-options'] ?? '10, 25, 50, 100'}"
|
|
117
|
+
?disabled="\${args.disabled}"
|
|
118
|
+
?loading="\${args.loading}"
|
|
119
|
+
.hideOnSinglePage=\${args['hide-on-single-page'] ?? true}
|
|
120
|
+
.pageSizeChanger=\${args['page-size-changer'] ?? true}
|
|
121
|
+
.boundaryButtons=\${args['boundary-buttons'] ?? true}
|
|
122
|
+
?hide-total-count=\${args['hide-total-count']}
|
|
123
|
+
style=\${styleMap(paginationStyles(args))}
|
|
124
|
+
>
|
|
125
|
+
<select
|
|
126
|
+
slot="jumper"
|
|
127
|
+
class="btu-pagination-select"
|
|
128
|
+
aria-label="Go to page"
|
|
129
|
+
@change=\${(e: Event) => {
|
|
130
|
+
const select = e.target as HTMLSelectElement;
|
|
131
|
+
const pagination = select.closest('btu-pagination');
|
|
132
|
+
if (pagination) {
|
|
133
|
+
pagination.page = parseInt(select.value, 10);
|
|
134
|
+
}
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
\${Array.from({
|
|
138
|
+
length: 50
|
|
139
|
+
}, (_, i) => html\`<option value="\${i + 1}">Page \${i + 1}</option>\`)}
|
|
140
|
+
</select>
|
|
141
|
+
</btu-pagination>
|
|
142
|
+
\`,
|
|
143
|
+
parameters: {
|
|
144
|
+
docs: {
|
|
145
|
+
description: {
|
|
146
|
+
story: 'Search variant with a page jumper dropdown placed via \`slot="jumper"\`. Allows direct navigation to a specific page.'
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}`,...s.parameters?.docs?.source}}};r.parameters={...r.parameters,docs:{...r.parameters?.docs,source:{originalSource:`{
|
|
151
|
+
args: {
|
|
152
|
+
'total-items': 100,
|
|
153
|
+
'boundary-buttons': false
|
|
154
|
+
},
|
|
155
|
+
parameters: {
|
|
156
|
+
docs: {
|
|
157
|
+
description: {
|
|
158
|
+
story: 'Compact widget variant without first/last page buttons. Suitable for tight spaces.'
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}`,...r.parameters?.docs?.source}}};l.parameters={...l.parameters,docs:{...l.parameters?.docs,source:{originalSource:`{
|
|
163
|
+
args: {
|
|
164
|
+
'total-items': 52
|
|
165
|
+
},
|
|
166
|
+
render: args => html\`
|
|
167
|
+
<btu-pagination
|
|
168
|
+
total-items="\${args['total-items'] ?? 52}"
|
|
169
|
+
page="\${args.page ?? 1}"
|
|
170
|
+
page-size="1"
|
|
171
|
+
?disabled="\${args.disabled}"
|
|
172
|
+
?loading="\${args.loading}"
|
|
173
|
+
.hideOnSinglePage=\${args['hide-on-single-page'] ?? true}
|
|
174
|
+
.pageSizeChanger=\${false}
|
|
175
|
+
.boundaryButtons=\${args['boundary-buttons'] ?? true}
|
|
176
|
+
?hide-total-count=\${args['hide-total-count']}
|
|
177
|
+
style=\${styleMap(paginationStyles(args))}
|
|
178
|
+
>
|
|
179
|
+
<select slot="page-size" class="btu-pagination-select" aria-label="View type">
|
|
180
|
+
<option value="week">Week</option>
|
|
181
|
+
<option value="month">Month</option>
|
|
182
|
+
</select>
|
|
183
|
+
<button
|
|
184
|
+
slot="jumper"
|
|
185
|
+
class="btu-button btu-button-sm"
|
|
186
|
+
@click=\${(e: Event) => {
|
|
187
|
+
const pagination = (e.target as HTMLElement).closest('btu-pagination');
|
|
188
|
+
if (pagination) pagination.page = 1;
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
Today
|
|
192
|
+
</button>
|
|
193
|
+
</btu-pagination>
|
|
194
|
+
\`,
|
|
195
|
+
parameters: {
|
|
196
|
+
docs: {
|
|
197
|
+
description: {
|
|
198
|
+
story: 'Calendar variant using \`slot="page-size"\` for a week/month selector and \`slot="jumper"\` for a Today button.'
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}`,...l.parameters?.docs?.source}}};p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
|
|
203
|
+
args: {
|
|
204
|
+
'total-items': 200,
|
|
205
|
+
loading: true
|
|
206
|
+
},
|
|
207
|
+
parameters: {
|
|
208
|
+
docs: {
|
|
209
|
+
description: {
|
|
210
|
+
story: 'Loading state shows a spinner and dims the navigation controls. The \`aria-busy\` attribute is set on the live region.'
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}`,...p.parameters?.docs?.source}}};g.parameters={...g.parameters,docs:{...g.parameters?.docs,source:{originalSource:`{
|
|
215
|
+
args: {
|
|
216
|
+
'total-items': 200,
|
|
217
|
+
disabled: true,
|
|
218
|
+
page: 3
|
|
219
|
+
},
|
|
220
|
+
parameters: {
|
|
221
|
+
docs: {
|
|
222
|
+
description: {
|
|
223
|
+
story: 'Disabled state prevents all interaction. All buttons and selects receive the native \`disabled\` attribute.'
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}`,...g.parameters?.docs?.source}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
|
|
228
|
+
render: () => {
|
|
229
|
+
const simulateLoading = (e: CustomEvent) => {
|
|
230
|
+
const pagination = e.target as HTMLElement & {
|
|
231
|
+
loading: boolean;
|
|
232
|
+
};
|
|
233
|
+
pagination.loading = true;
|
|
234
|
+
setTimeout(() => {
|
|
235
|
+
pagination.loading = false;
|
|
236
|
+
}, 1000);
|
|
237
|
+
};
|
|
238
|
+
return html\`
|
|
239
|
+
<div class="flex flex-col gap-4">
|
|
240
|
+
<div class="flex items-center gap-2">
|
|
241
|
+
<label for="total-input" class="text-sm font-medium">Total Items:</label>
|
|
242
|
+
<input
|
|
243
|
+
id="total-input"
|
|
244
|
+
type="number"
|
|
245
|
+
value="200"
|
|
246
|
+
min="0"
|
|
247
|
+
class="w-24 rounded border px-2 py-1 text-sm"
|
|
248
|
+
@input=\${(e: Event) => {
|
|
249
|
+
const input = e.target as HTMLInputElement;
|
|
250
|
+
const pagination = (input.closest('.flex.flex-col') as HTMLElement)?.querySelector('btu-pagination') as HTMLElement & {
|
|
251
|
+
totalItems: number;
|
|
252
|
+
};
|
|
253
|
+
if (pagination) pagination.totalItems = parseInt(input.value, 10) || 0;
|
|
254
|
+
}}
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
<btu-pagination
|
|
258
|
+
total-items="200"
|
|
259
|
+
@btu-pagination-change=\${simulateLoading}
|
|
260
|
+
@btu-pagination-page-size-change=\${simulateLoading}
|
|
261
|
+
></btu-pagination>
|
|
262
|
+
</div>
|
|
263
|
+
\`;
|
|
264
|
+
},
|
|
265
|
+
parameters: {
|
|
266
|
+
docs: {
|
|
267
|
+
description: {
|
|
268
|
+
story: 'Interactive example demonstrating dynamic \`totalItems\` changes at runtime. Navigation triggers a simulated 1s loading state.'
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}`,...d.parameters?.docs?.source}}};const z=["Default","Search","WidgetSmall","Calendar","Loading","Disabled","DynamicTotal"];export{l as Calendar,i as Default,g as Disabled,d as DynamicTotal,p as Loading,s as Search,r as WidgetSmall,z as __namedExportsOrder,S as default};
|