@brightspot/ui 1.5.0 → 1.7.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.
Files changed (105) hide show
  1. package/dist/components/dropdown/Dropdown.d.ts +172 -0
  2. package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
  3. package/dist/components/dropdown/Dropdown.js +407 -0
  4. package/dist/components/dropdown/Dropdown.js.map +1 -0
  5. package/dist/components/dropdown/DropdownItem.d.ts +108 -0
  6. package/dist/components/dropdown/DropdownItem.d.ts.map +1 -0
  7. package/dist/components/dropdown/DropdownItem.js +210 -0
  8. package/dist/components/dropdown/DropdownItem.js.map +1 -0
  9. package/dist/components/dropdown/DropdownMenu.d.ts +117 -0
  10. package/dist/components/dropdown/DropdownMenu.d.ts.map +1 -0
  11. package/dist/components/dropdown/DropdownMenu.js +295 -0
  12. package/dist/components/dropdown/DropdownMenu.js.map +1 -0
  13. package/dist/components/pagination/Pagination.d.ts +109 -0
  14. package/dist/components/pagination/Pagination.d.ts.map +1 -0
  15. package/dist/components/pagination/Pagination.js +351 -0
  16. package/dist/components/pagination/Pagination.js.map +1 -0
  17. package/dist/custom-elements.json +1642 -182
  18. package/dist/storybook/assets/Avatar.stories-BAaSlDF7.js +213 -0
  19. package/dist/storybook/assets/AvatarGroup.stories-CgoDB4N4.js +225 -0
  20. package/dist/storybook/assets/{Badge.stories-Bbnc6fRy.js → Badge.stories-uexxdmo6.js} +3 -3
  21. package/dist/storybook/assets/{Button.stories-CRJ5n2y4.js → Button.stories-T9UJUPHI.js} +1 -1
  22. package/dist/storybook/assets/{CircularProgress.stories-D9vBj3JJ.js → CircularProgress.stories-DW-VJA5j.js} +6 -6
  23. package/dist/storybook/assets/{ClipboardMixin.stories-Dm-Jm4yb.js → ClipboardMixin.stories-DzU4vxu5.js} +1 -1
  24. package/dist/storybook/assets/{Color-6BZIO3FS-BcNIJY1U.js → Color-6BZIO3FS-DRk2xjoN.js} +1 -1
  25. package/dist/storybook/assets/{Colors.stories-B9_090wL.js → Colors.stories-_UPdvuhY.js} +1 -1
  26. package/dist/storybook/assets/{ComponentStatesMixin-ChiFBCuo.js → ComponentStatesMixin-BIu5SKeV.js} +1 -1
  27. package/dist/storybook/assets/{ComponentStatesMixin.stories-DHv9MHmE.js → ComponentStatesMixin.stories-C0FLaqLu.js} +1 -1
  28. package/dist/storybook/assets/{CopyToClipboard.stories-gtJlTP1l.js → CopyToClipboard.stories-D31zoUVI.js} +1 -1
  29. package/dist/storybook/assets/{Debounce.stories-BBNX7mJA.js → Debounce.stories-CgPPl5Ee.js} +1 -1
  30. package/dist/storybook/assets/{DocsRenderer-LL677BLK-D-E99pXl.js → DocsRenderer-LL677BLK-iwiwOzX9.js} +6 -6
  31. package/dist/storybook/assets/Dropdown.stories-CDcl6rmG.js +697 -0
  32. package/dist/storybook/assets/{Events.stories-DDmydlh_.js → Events.stories-DS6UC9dZ.js} +1 -1
  33. package/dist/storybook/assets/{Heading.stories-BLGfko-i.js → Heading.stories-CAQfEGE2.js} +1 -1
  34. package/dist/storybook/assets/{Icon.stories-BHnAGcFF.js → Icon.stories-C7msWlHs.js} +11 -11
  35. package/dist/storybook/assets/{LinearProgress.stories-Dx26a0P_.js → LinearProgress.stories-DBGJ5a2-.js} +7 -7
  36. package/dist/storybook/assets/Pagination.stories-C58bGOdf.js +272 -0
  37. package/dist/storybook/assets/{Popover.stories-CbqpY6YR.js → Popover.stories-C9zU0sEX.js} +5 -5
  38. package/dist/storybook/assets/{ReadyMixin-BHiHoIbr.js → ReadyMixin-qf8SAjMu.js} +1 -1
  39. package/dist/storybook/assets/{Rtc.stories-CAjDv_Ub.js → Rtc.stories-k9tKHNhD.js} +1 -1
  40. package/dist/storybook/assets/{ScrollShadow.stories-BSV4U-tq.js → ScrollShadow.stories-Bp42zyLH.js} +1 -1
  41. package/dist/storybook/assets/{Throttle.stories-kaxXQ8RZ.js → Throttle.stories-B5YU-Nms.js} +1 -1
  42. package/dist/storybook/assets/Tooltip.stories-COQcvOnL.js +143 -0
  43. package/dist/storybook/assets/{Widget.stories-DqATHnSq.js → Widget.stories-D3Sq5-_A.js} +13 -13
  44. package/dist/storybook/assets/{WithTooltip-65CFNBJE-BtbbFYSA.js → WithTooltip-65CFNBJE-Cox81aM_.js} +1 -1
  45. package/dist/storybook/assets/{formatter-EIJCOSYU-C87Csnpu.js → formatter-EIJCOSYU-3ErcoV9q.js} +1 -1
  46. package/dist/storybook/assets/if-defined-Bv2_qPJg.js +1 -0
  47. package/dist/storybook/assets/{iframe-CcloOV09.js → iframe-CM6gBkqA.js} +170 -170
  48. package/dist/storybook/assets/iframe-D3r2Ciu8.css +1 -0
  49. package/dist/storybook/assets/{index-DP7vnJf7.js → index-iwfnMgqg.js} +1 -1
  50. package/dist/storybook/assets/{onFind.stories-BxvoC-Z-.js → onFind.stories-CDtoTN6S.js} +1 -1
  51. package/dist/storybook/assets/{onRemove.stories-Dwoixzb0.js → onRemove.stories-CSTeFCLU.js} +1 -1
  52. package/dist/storybook/assets/{onVisible.stories-CinmRF9w.js → onVisible.stories-C-yiw9n4.js} +1 -1
  53. package/dist/storybook/assets/style-map-BJGdSb_D.js +1 -0
  54. package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-BHLkDkOn.js → syntaxhighlighter-ED5Y7EFY-BEudYlVi.js} +1 -1
  55. package/dist/storybook/iframe.html +2 -2
  56. package/dist/storybook/index.json +1 -1
  57. package/dist/storybook/project.json +1 -1
  58. package/dist/tailwind-plugin-button.js +10 -0
  59. package/dist/tailwind-plugin-button.js.map +1 -1
  60. package/dist/tailwind-plugin-button.ts +10 -0
  61. package/dist/tailwind-plugin-dropdown.d.ts +2 -0
  62. package/dist/tailwind-plugin-dropdown.d.ts.map +1 -0
  63. package/dist/tailwind-plugin-dropdown.js +223 -0
  64. package/dist/tailwind-plugin-dropdown.js.map +1 -0
  65. package/dist/tailwind-plugin-dropdown.ts +249 -0
  66. package/dist/tailwind-plugin-pagination.d.ts +2 -0
  67. package/dist/tailwind-plugin-pagination.d.ts.map +1 -0
  68. package/dist/tailwind-plugin-pagination.js +164 -0
  69. package/dist/tailwind-plugin-pagination.js.map +1 -0
  70. package/dist/tailwind-plugin-pagination.ts +179 -0
  71. package/dist/tailwind.config.d.ts +1 -4
  72. package/dist/tailwind.config.d.ts.map +1 -1
  73. package/dist/tailwind.config.js +1 -0
  74. package/dist/tailwind.config.js.map +1 -1
  75. package/dist/tailwind.config.ts +1 -0
  76. package/dist/util/EventEmitterMixin.d.ts +22 -0
  77. package/dist/util/EventEmitterMixin.d.ts.map +1 -1
  78. package/dist/util/EventEmitterMixin.js.map +1 -1
  79. package/dist/util/aria.d.ts.map +1 -1
  80. package/dist/util/aria.js +2 -1
  81. package/dist/util/aria.js.map +1 -1
  82. package/dist/util/i18n.d.ts +13 -0
  83. package/dist/util/i18n.d.ts.map +1 -0
  84. package/dist/util/i18n.js +21 -0
  85. package/dist/util/i18n.js.map +1 -0
  86. package/docs/components/Avatar.md +62 -0
  87. package/docs/components/AvatarGroup.md +52 -0
  88. package/docs/components/Badge.md +58 -0
  89. package/docs/components/CircularProgress.md +55 -0
  90. package/docs/components/CopyToClipboard.md +54 -0
  91. package/docs/components/Dropdown.md +100 -0
  92. package/docs/components/DropdownItem.md +64 -0
  93. package/docs/components/DropdownMenu.md +81 -0
  94. package/docs/components/Icon.md +61 -0
  95. package/docs/components/LinearProgress.md +40 -0
  96. package/docs/components/Pagination.md +95 -0
  97. package/docs/components/Popover.md +71 -0
  98. package/docs/components/README.md +24 -0
  99. package/docs/components/Widget.md +79 -0
  100. package/package.json +4 -3
  101. package/dist/storybook/assets/Avatar.stories-CPVNxsaA.js +0 -214
  102. package/dist/storybook/assets/AvatarGroup.stories-Bl65NGHl.js +0 -225
  103. package/dist/storybook/assets/Tooltip.stories-CsxXkztr.js +0 -143
  104. package/dist/storybook/assets/if-defined-COHr0XBn.js +0 -1
  105. package/dist/storybook/assets/iframe-BkDGeDre.css +0 -1
@@ -1,4 +1,4 @@
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:`
1
+ import{x as d}from"./iframe-CM6gBkqA.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-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:`{
1
+ import{x as s}from"./iframe-CM6gBkqA.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-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:`
1
+ import{g as c,x as a}from"./iframe-CM6gBkqA.js";import{o as d}from"./style-map-BJGdSb_D.js";import"./preload-helper-PPVm8Dsz.js";const p="0.508.0",b={version:p},l=b.version,{events:u,args:m,argTypes:t}=c("btu-icon"),g=["xs","sm","md","lg","xl"],x=["ai","error","gray","primary","purple","rose","success","teal","warning"],h={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>
@@ -15,18 +15,18 @@ import{g as d,x as r}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz
15
15
 
16
16
  <h3>Icon Library:</h3>
17
17
  <p>All icons are from <a href="https://lucide.dev/icons/" target="_blank">Lucide</a>. Note that the Lucide library is updated regularly, but the Brightspot UI library uses <strong>Lucide v${l}</strong>. Keep this in mind when choosing icons for your project, as icon names and styles may differ between versions.</p>
18
- `}},actions:{handles:u},controls:{expanded:!0}},args:{...m,symbol:"heart",size:"md"},argTypes:{...t,"--Icon-size":{table:{disable:!0}},"--Icon-fill":{table:{disable:!0}},"--Icon-svg":{table:{disable:!0}},symbol:{...t.symbol,control:{type:"text"},description:'<a href="https://lucide.dev/icons/" target="_blank">Lucide</a> icon name. Note that only icons available in Lucide v'+l+" are supported.",table:{...t.symbol?.table,type:{summary:"string"}}},size:{...t.size,control:{type:"select"},options:g,description:"Icon size preset"},gradient:{...t.gradient,control:{type:"select"},options:x,description:"Gradient theme icon fill. When not set, icon inherits parent text color."},customSize:{name:"--Icon-size",control:{type:"text"},description:'Custom icon size - overrides the size preset (e.g., "3rem", "48px")',table:{category:"CSS Properties"}},customFill:{name:"--Icon-fill",control:{type:"text"},description:'An advanced option for creating filled-in icons via built-in CSS SVG styling. Works best with simple icons like "heart" or "star".',table:{category:"CSS Properties"}}},render:e=>{const s=[];e.customSize&&s.push(`--Icon-size: ${e.customSize}`),e.customFill&&s.push(`--Icon-fill: ${e.customFill}`);const c=s.length>0?s.join("; "):"";return r`<btu-icon
18
+ `}},actions:{handles:u},controls:{expanded:!0}},args:{...m,symbol:"heart",size:"md"},argTypes:{...t,"--Icon-size":{table:{disable:!0}},"--Icon-fill":{table:{disable:!0}},"--Icon-svg":{table:{disable:!0}},symbol:{...t.symbol,control:{type:"text"},description:'<a href="https://lucide.dev/icons/" target="_blank">Lucide</a> icon name. Note that only icons available in Lucide v'+l+" are supported.",table:{...t.symbol?.table,type:{summary:"string"}}},size:{...t.size,control:{type:"select"},options:g,description:"Icon size preset"},gradient:{...t.gradient,control:{type:"select"},options:x,description:"Gradient theme icon fill. When not set, icon inherits parent text color."},customSize:{name:"--Icon-size",control:{type:"text"},description:'Custom icon size - overrides the size preset (e.g., "3rem", "48px")',table:{category:"CSS Properties"}},customFill:{name:"--Icon-fill",control:{type:"text"},description:'An advanced option for creating filled-in icons via built-in CSS SVG styling. Works best with simple icons like "heart" or "star".',table:{category:"CSS Properties"}}},render:e=>{const r={};return e.customSize&&(r["--Icon-size"]=e.customSize),e.customFill&&(r["--Icon-fill"]=e.customFill),a`<btu-icon
19
19
  symbol="${e.symbol}"
20
20
  size="${e.size}"
21
21
  gradient="${e.gradient||""}"
22
- style="${c}"
23
- ></btu-icon>`}},n={args:{}},i={render:()=>r`<div class="flex items-center gap-4">
22
+ style=${d(r)}
23
+ ></btu-icon>`}},s={args:{}},n={render:()=>a`<div class="flex items-center gap-4">
24
24
  <btu-icon symbol="heart" size="xs"></btu-icon>
25
25
  <btu-icon symbol="heart" size="sm"></btu-icon>
26
26
  <btu-icon symbol="heart" size="md"></btu-icon>
27
27
  <btu-icon symbol="heart" size="lg"></btu-icon>
28
28
  <btu-icon symbol="heart" size="xl"></btu-icon>
29
- </div>`,parameters:{docs:{description:{story:"Icons come in five preset sizes: xs, sm, md, lg, and xl. Choose the size that best fits your design context."}}}},o={render:()=>r`<div class="flex flex-wrap items-center justify-between gap-4 px-4">
29
+ </div>`,parameters:{docs:{description:{story:"Icons come in five preset sizes: xs, sm, md, lg, and xl. Choose the size that best fits your design context."}}}},i={render:()=>a`<div class="flex flex-wrap items-center justify-between gap-4 px-4">
30
30
  <div class="flex flex-col items-center gap-2">
31
31
  <btu-icon symbol="zap" size="xl" gradient="primary"></btu-icon>
32
32
  <span class="text-xs font-bold">primary</span>
@@ -59,7 +59,7 @@ import{g as d,x as r}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz
59
59
  <btu-icon symbol="flower" size="xl" gradient="rose"></btu-icon>
60
60
  <span class="text-xs font-bold">rose</span>
61
61
  </div>
62
- </div>`,parameters:{docs:{description:{story:"Icons support gradient fills using the following theme colors. Set the `gradient` attribute to one of the theme colors and watch the icon's color come to life! Note that gradient icons use mask-based rendering for smooth color transitions."}}}},a={render:()=>r`<div class="flex flex-col gap-6">
62
+ </div>`,parameters:{docs:{description:{story:"Icons support gradient fills using the following theme colors. Set the `gradient` attribute to one of the theme colors and watch the icon's color come to life! Note that gradient icons use mask-based rendering for smooth color transitions."}}}},o={render:()=>a`<div class="flex flex-col gap-6">
63
63
  <div class="flex items-center gap-2">
64
64
  <strong>Custom sizing:</strong>
65
65
  <btu-icon symbol="trophy" size="md" style="--Icon-size: 4rem" class="text-warning-500"></btu-icon>
@@ -112,9 +112,9 @@ import{g as d,x as r}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz
112
112
  <span class="ml-1">Favorite</span>
113
113
  </button>
114
114
  </div>
115
- </div>`,parameters:{docs:{description:{story:'\n- **Custom sizing** is available via the `--Icon-size` CSS property for precise control. \n- You can create **filled icons** by setting the `--Icon-fill: currentColor` CSS property. Note that this works best with simple icons like "heart" or "star".\n\n- **RTL language support:** Directional icons can be flipped for right-to-left languages using Tailwind\'s `rtl:-scale-x-100` utility class. This ensures icons like panels, arrows, and navigation elements point in the correct direction.\n\n**Accessibility best practices:**\n- If an icon conveys information and there is no visible text to accompany it (e.g., a delete button with only a trash can icon), add an `aria-label` attribute to the component to help users using screen readers understand its purpose.\n- If an icon is purely decorative (e.g. a sparkle icon, accompanying text that already conveys meaning), add `aria-hidden="true"` to the icon to hide it from screen readers.\n- You may consider adding a tooltip (via `title` attribute) to icon buttons for better discoverability.'}}}};n.parameters={...n.parameters,docs:{...n.parameters?.docs,source:{originalSource:`{
115
+ </div>`,parameters:{docs:{description:{story:'\n- **Custom sizing** is available via the `--Icon-size` CSS property for precise control. \n- You can create **filled icons** by setting the `--Icon-fill: currentColor` CSS property. Note that this works best with simple icons like "heart" or "star".\n\n- **RTL language support:** Directional icons can be flipped for right-to-left languages using Tailwind\'s `rtl:-scale-x-100` utility class. This ensures icons like panels, arrows, and navigation elements point in the correct direction.\n\n**Accessibility best practices:**\n- If an icon conveys information and there is no visible text to accompany it (e.g., a delete button with only a trash can icon), add an `aria-label` attribute to the component to help users using screen readers understand its purpose.\n- If an icon is purely decorative (e.g. a sparkle icon, accompanying text that already conveys meaning), add `aria-hidden="true"` to the icon to hide it from screen readers.\n- You may consider adding a tooltip (via `title` attribute) to icon buttons for better discoverability.'}}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
116
116
  args: {}
117
- }`,...n.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
117
+ }`,...s.parameters?.docs?.source}}};n.parameters={...n.parameters,docs:{...n.parameters?.docs,source:{originalSource:`{
118
118
  render: () => html\`<div class="flex items-center gap-4">
119
119
  <btu-icon symbol="heart" size="xs"></btu-icon>
120
120
  <btu-icon symbol="heart" size="sm"></btu-icon>
@@ -129,7 +129,7 @@ import{g as d,x as r}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz
129
129
  }
130
130
  }
131
131
  }
132
- }`,...i.parameters?.docs?.source}}};o.parameters={...o.parameters,docs:{...o.parameters?.docs,source:{originalSource:`{
132
+ }`,...n.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
133
133
  render: () => html\`<div class="flex flex-wrap items-center justify-between gap-4 px-4">
134
134
  <div class="flex flex-col items-center gap-2">
135
135
  <btu-icon symbol="zap" size="xl" gradient="primary"></btu-icon>
@@ -171,7 +171,7 @@ import{g as d,x as r}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz
171
171
  }
172
172
  }
173
173
  }
174
- }`,...o.parameters?.docs?.source}}};a.parameters={...a.parameters,docs:{...a.parameters?.docs,source:{originalSource:`{
174
+ }`,...i.parameters?.docs?.source}}};o.parameters={...o.parameters,docs:{...o.parameters?.docs,source:{originalSource:`{
175
175
  render: () => html\`<div class="flex flex-col gap-6">
176
176
  <div class="flex items-center gap-2">
177
177
  <strong>Custom sizing:</strong>
@@ -242,4 +242,4 @@ import{g as d,x as r}from"./iframe-CcloOV09.js";import"./preload-helper-PPVm8Dsz
242
242
  }
243
243
  }
244
244
  }
245
- }`,...a.parameters?.docs?.source}}};const h=["Default","Sizes","GradientIcons","AdvancedUsage"];export{a as AdvancedUsage,n as Default,o as GradientIcons,i as Sizes,h as __namedExportsOrder,v as default};
245
+ }`,...o.parameters?.docs?.source}}};const z=["Default","Sizes","GradientIcons","AdvancedUsage"];export{o as AdvancedUsage,s as Default,i as GradientIcons,n as Sizes,z as __namedExportsOrder,h as default};
@@ -1,11 +1,11 @@
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:`
1
+ import{g as D,E as h,x as T}from"./iframe-CM6gBkqA.js";import{o as A}from"./style-map-BJGdSb_D.js";import"./preload-helper-PPVm8Dsz.js";const{events:V,args:P,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>
5
5
  <li>For file uploads, downloads, or processing steps</li>
6
6
  <li>When progress needs to be communicated numerically</li>
7
7
  </ul>
8
- `}},actions:{handles:D},controls:{expanded:!0}},args:{...V,color:"primary",thickness:8,progress:0,initialAnimation:!0},argTypes:{...g,"--progress-color":{table:{disable:!0}},"--track-color":{table:{disable:!0}},size:{table:{disable:!0}},customSize:{table:{disable:!0}},color:{...g.color,control:{type:"select"},options:["black","white","primary","teal","gray","purple","rose","error","warning","success"],description:"Theme color of the progress bar.",table:{category:"Attributes",defaultValue:{summary:"primary"}}},thickness:{...g.thickness,control:{type:"number",min:1,max:10},description:"Height of the progress bar.",table:{category:"Attributes",defaultValue:{summary:"8"}}},progress:{...g.progress,control:{type:"range",min:0,max:100,step:1},description:"Progress value between 0 and 100.",table:{category:"Attributes",defaultValue:{summary:"0"}}},label:{...g.label,control:{type:"text"},description:"Optional label text to display to the right of the progress bar.",table:{category:"Attributes",defaultValue:{summary:"undefined"}}},initialAnimation:{...g.initialAnimation,control:{type:"boolean"},description:"Whether to animate progress from 0 to target value when component first becomes visible in viewport. Defaults to true.",table:{category:"Attributes",defaultValue:{summary:"true"}}},ariaLabel:{...g.ariaLabel,control:{type:"text"},description:'Optional aria-label attribute for screen readers. Describes what the progress indicator represents (e.g., "File upload progress").',table:{category:"Attributes",defaultValue:{summary:"undefined"}}},ariaLabelledBy:{...g.ariaLabelledBy,control:{type:"text"},description:"Optional aria-labelledby attribute for screen readers. References the ID of an element that labels the progress indicator.",table:{category:"Attributes",defaultValue:{summary:"undefined"}}},ariaValueText:{...g.ariaValueText,control:{type:"text"},description:"Optional aria-valuetext attribute for screen readers. Provides human-readable text alternative for the progress value.",table:{category:"Attributes",defaultValue:{summary:"undefined"}}},completionAnnouncement:{...g.completionAnnouncement,control:{type:"text"},description:"Optional message to announce to screen readers when progress reaches 100%. If not provided, no announcement will be made on completion.",table:{category:"Attributes",defaultValue:{summary:"undefined"}}},customColor:{name:"--progress-color",control:{type:"color"},description:"Custom progress bar color - overrides the theme color",table:{category:"CSS Properties"}},customTrackColor:{name:"--track-color",control:{type:"color"},description:"Custom track/background color - overrides default gray-100",table:{category:"CSS Properties"}}},render:e=>{const t=[];e.customColor&&t.push(`--progress-color: ${e.customColor}`),e.customTrackColor&&t.push(`--track-color: ${e.customTrackColor}`);const r=t.length>0?t.join("; "):"";return T`<btu-linear-progress
8
+ `}},actions:{handles:V},controls:{expanded:!0}},args:{...P,color:"primary",thickness:8,progress:0,"initial-animation":!0},argTypes:{...g,"--progress-color":{table:{disable:!0}},"--track-color":{table:{disable:!0}},size:{table:{disable:!0}},customSize:{table:{disable:!0}},color:{...g.color,control:{type:"select"},options:["black","white","primary","teal","gray","purple","rose","error","warning","success"],description:"Theme color of the progress bar.",table:{category:"Attributes",defaultValue:{summary:"primary"}}},thickness:{...g.thickness,control:{type:"number",min:1,max:10},description:"Height of the progress bar.",table:{category:"Attributes",defaultValue:{summary:"8"}}},progress:{...g.progress,control:{type:"range",min:0,max:100,step:1},description:"Progress value between 0 and 100.",table:{category:"Attributes",defaultValue:{summary:"0"}}},label:{...g.label,control:{type:"text"},description:"Optional label text to display to the right of the progress bar.",table:{category:"Attributes",defaultValue:{summary:"undefined"}}},"initial-animation":{...g["initial-animation"],control:{type:"boolean"},description:"Whether to animate progress from 0 to target value when component first becomes visible in viewport. Defaults to true.",table:{category:"Attributes",defaultValue:{summary:"true"}}},ariaLabel:{...g.ariaLabel,control:{type:"text"},description:'Optional aria-label attribute for screen readers. Describes what the progress indicator represents (e.g., "File upload progress").',table:{category:"Attributes",defaultValue:{summary:"undefined"}}},ariaLabelledBy:{...g.ariaLabelledBy,control:{type:"text"},description:"Optional aria-labelledby attribute for screen readers. References the ID of an element that labels the progress indicator.",table:{category:"Attributes",defaultValue:{summary:"undefined"}}},ariaValueText:{...g.ariaValueText,control:{type:"text"},description:"Optional aria-valuetext attribute for screen readers. Provides human-readable text alternative for the progress value.",table:{category:"Attributes",defaultValue:{summary:"undefined"}}},completionAnnouncement:{...g.completionAnnouncement,control:{type:"text"},description:"Optional message to announce to screen readers when progress reaches 100%. If not provided, no announcement will be made on completion.",table:{category:"Attributes",defaultValue:{summary:"undefined"}}},customColor:{name:"--progress-color",control:{type:"color"},description:"Custom progress bar color - overrides the theme color",table:{category:"CSS Properties"}},customTrackColor:{name:"--track-color",control:{type:"color"},description:"Custom track/background color - overrides default gray-100",table:{category:"CSS Properties"}}},render:e=>{const t={};return e.customColor&&(t["--progress-color"]=e.customColor),e.customTrackColor&&(t["--track-color"]=e.customTrackColor),T`<btu-linear-progress
9
9
  color="${e.color}"
10
10
  thickness="${e.thickness}"
11
11
  progress="${e.progress}"
@@ -14,19 +14,19 @@ import{g as I,E as h,x as T}from"./iframe-CcloOV09.js";import"./preload-helper-P
14
14
  aria-labelledby="${e.ariaLabelledBy||h}"
15
15
  aria-valuetext="${e.ariaValueText||h}"
16
16
  completion-announcement="${e.completionAnnouncement||h}"
17
- ?initial-animation="${e.initialAnimation}"
18
- style="${r}"
17
+ ?initial-animation="${e["initial-animation"]}"
18
+ style=${A(t)}
19
19
  ></btu-linear-progress>`}},v={args:{progress:25},parameters:{docs:{description:{story:"Default horizontal progress bar with primary color. Width fills the container (100%)."}}}},f={render:()=>T`<div class="flex flex-col gap-4">
20
20
  <btu-linear-progress progress="25" color="primary"></btu-linear-progress>
21
21
  <btu-linear-progress progress="50" color="teal"></btu-linear-progress>
22
22
  <btu-linear-progress progress="75" color="warning"></btu-linear-progress>
23
23
  <btu-linear-progress progress="100" color="success"></btu-linear-progress>
24
- </div>`,parameters:{docs:{description:{story:"Progress bars at various completion levels (25%, 50%, 75%, 100%) with different colors. Each bar fills the container width."}}}},x={render:()=>{const e=document.createElement("div");e.className="flex flex-col gap-8";let t=0;const r=document.createElement("btu-linear-progress");r.progress=0,r.color="primary",r.label="0%";const o=setInterval(()=>{t=(t+1)%101,r.progress=t,r.label=`${t}%`,t===100&&setTimeout(()=>{t=0},1e3)},100);let s=0;const n=document.createElement("btu-linear-progress");n.progress=0,n.color="teal",n.label="0/5 files",n.ariaValueText="0 of 5 files uploaded";const l=setInterval(()=>{s=(s+1)%6,n.progress=s*20,n.label=`${s}/5 files`,n.ariaValueText=`${s} of 5 files uploaded`,s===5&&setTimeout(()=>{s=0},3e3)},3e3),a=new MutationObserver(i=>{i.forEach(p=>{p.removedNodes.forEach(d=>{(d===e||d.contains(e))&&(clearInterval(o),clearInterval(l),a.disconnect())})})});return setTimeout(()=>{e.parentNode&&a.observe(e.parentNode,{childList:!0})},0),e.appendChild(r),e.appendChild(n),e},parameters:{docs:{description:{story:`
24
+ </div>`,parameters:{docs:{description:{story:"Progress bars at various completion levels (25%, 50%, 75%, 100%) with different colors. Each bar fills the container width."}}}},x={render:()=>{const e=document.createElement("div");e.className="flex flex-col gap-8";let t=0;const n=document.createElement("btu-linear-progress");n.progress=0,n.color="primary",n.label="0%";const o=setInterval(()=>{t=(t+1)%101,n.progress=t,n.label=`${t}%`,t===100&&setTimeout(()=>{t=0},1e3)},100);let s=0;const r=document.createElement("btu-linear-progress");r.progress=0,r.color="teal",r.label="0/5 files",r.ariaValueText="0 of 5 files uploaded";const l=setInterval(()=>{s=(s+1)%6,r.progress=s*20,r.label=`${s}/5 files`,r.ariaValueText=`${s} of 5 files uploaded`,s===5&&setTimeout(()=>{s=0},3e3)},3e3),a=new MutationObserver(i=>{i.forEach(p=>{p.removedNodes.forEach(d=>{(d===e||d.contains(e))&&(clearInterval(o),clearInterval(l),a.disconnect())})})});return setTimeout(()=>{e.parentNode&&a.observe(e.parentNode,{childList:!0})},0),e.appendChild(n),e.appendChild(r),e},parameters:{docs:{description:{story:`
25
25
  Animated progress bars.
26
26
 
27
27
  Top: continuous percentage increments.
28
28
 
29
- Bottom: step-based progress with 20% increments every 3 seconds and \`aria-valuetext\` for accessibility (e.g., "3 of 5 files uploaded").`}}}},y={render:()=>{let e;const t=()=>{const r=document.createElement("div"),o=document.createElement("div");o.className="flex flex-col mb-4 items-center";const s=document.createElement("h3");s.className="text-lg font-semibold mb-2",s.textContent="Scroll within the container to see progress bars animate in";const n=document.createElement("button");n.textContent="Reset",n.className="px-4 py-2 bg-primary-500 text-white rounded hover:bg-primary-600",n.onclick=()=>{e.innerHTML="",e.appendChild(t())},o.appendChild(s),o.appendChild(n),r.appendChild(o);const l=document.createElement("div");l.style.height="150px",l.style.overflowY="auto",l.style.border="1px solid #e5e7eb",l.style.borderRadius="4px",l.style.padding="1rem";const a=document.createElement("div");a.className="flex flex-col gap-8",a.style.minHeight="150vh";const i=document.createElement("btu-linear-progress");i.progress=30,i.color="primary",i.label="30%",a.appendChild(i);const p=document.createElement("div");p.style.marginTop="30vh";const d=document.createElement("btu-linear-progress");d.progress=50,d.color="teal",d.label="50%",p.appendChild(d),a.appendChild(p);const b=document.createElement("div");b.style.marginTop="30vh";const m=document.createElement("btu-linear-progress");m.progress=75,m.color="purple",m.label="75%",b.appendChild(m),a.appendChild(b);const u=document.createElement("div");u.style.marginTop="30vh";const c=document.createElement("btu-linear-progress");return c.progress=100,c.color="success",c.label="100%",u.appendChild(c),a.appendChild(u),l.appendChild(a),r.appendChild(l),r};return e=t(),e},parameters:{docs:{description:{story:'Demonstrates the viewport animation - progress bars animate from 0 to their target value when they become visible. Scroll within the container to see each progress bar animate in. Click "Reset" to restart.'}}}},C={render:()=>{const e=document.createElement("div");e.className="flex flex-col items-start gap-4";let t=0;const r=document.createElement("btu-linear-progress");r.progress=0,r.color="primary",r.label="0%";const o=document.createElement("div");o.className="text-sm text-gray-600",o.textContent="Status: In Progress...";const s=document.createElement("div");s.className="text-xs text-gray-500 mt-2",s.textContent="Event Log: (waiting for completion)",r.addEventListener("btu-progress-complete",()=>{o.textContent="Status: Complete! ✓",o.className="text-sm text-green-600 font-semibold",s.textContent=`Event Log: btu-progress-complete fired at ${new Date().toLocaleTimeString()}`,s.className="text-xs text-green-600 mt-2"});let n=!1;const l=setInterval(()=>{n||(t=t+1,r.progress=t,r.label=`${t}%`,t<100&&(o.textContent="Status: In Progress...",o.className="text-sm text-gray-600"),t===100&&(n=!0,setTimeout(()=>{t=0,n=!1},3e3)))},50),a=new MutationObserver(i=>{i.forEach(p=>{p.removedNodes.forEach(d=>{(d===e||d.contains(e))&&(clearInterval(l),a.disconnect())})})});return setTimeout(()=>{e.parentNode&&a.observe(e.parentNode,{childList:!0})},0),e.appendChild(r),e.appendChild(o),e.appendChild(s),e},parameters:{docs:{description:{story:"Demonstrates the btu-progress-complete event that fires when progress reaches 100%. The event fires each time progress completes a cycle."}}}},E={render:()=>{const e=document.createElement("div");e.className="flex flex-col gap-8";const t=document.createElement("div");t.className="flex flex-col gap-2";const r=document.createElement("h4");r.className="text-sm font-semibold text-gray-900",r.textContent="Progress bar with aria-label";const o=document.createElement("p");o.className="text-xs text-gray-600 mb-2",o.textContent='Screen readers announce: "Page loading progress"';const s=document.createElement("btu-linear-progress");s.progress=40,s.color="primary",s.ariaLabel="Page loading progress",t.appendChild(r),t.appendChild(o),t.appendChild(s);const n=document.createElement("div");n.className="flex flex-col gap-2";const l=document.createElement("h4");l.className="text-sm font-semibold text-gray-900",l.textContent="With custom aria-valuetext";const a=document.createElement("p");a.className="text-xs text-gray-600 mb-2",a.textContent='Screen readers announce: "File upload progress, 3 of 5 files uploaded"';const i=document.createElement("btu-linear-progress");i.progress=60,i.color="teal",i.label="3/5 files",i.ariaLabel="File upload progress",i.ariaValueText="3 of 5 files uploaded",n.appendChild(l),n.appendChild(a),n.appendChild(i);const p=document.createElement("div");p.className="flex flex-col gap-2";const d=document.createElement("h4");d.className="text-sm font-semibold text-gray-900",d.textContent="With completion announcement";const b=document.createElement("p");b.className="text-xs text-gray-600 mb-2",b.textContent='Screen readers auto-announce when complete: "Installation complete!"';const m=document.createElement("div");m.className="text-xs text-gray-500 mt-2",m.textContent="Announcement status: (waiting...)";let u=0;const c=document.createElement("btu-linear-progress");c.progress=0,c.color="success",c.label="0%",c.ariaLabel="Installation progress",c.completionAnnouncement="Installation complete!",c.addEventListener("btu-progress-complete",()=>{m.textContent='Announcement status: "Installation complete!" announced at '+new Date().toLocaleTimeString(),m.className="text-xs text-green-600 mt-2"});const w=setInterval(()=>{u<100?(u+=2,c.progress=u,c.label=`${u}%`,c.ariaValueText=`${u} percent complete`):clearInterval(w)},100);p.appendChild(d),p.appendChild(b),p.appendChild(c),p.appendChild(m);const N=new MutationObserver(S=>{S.forEach(A=>{A.removedNodes.forEach(L=>{(L===e||L.contains(e))&&(clearInterval(w),N.disconnect())})})});return setTimeout(()=>{e.parentNode&&N.observe(e.parentNode,{childList:!0})},0),e.appendChild(t),e.appendChild(n),e.appendChild(p),e},parameters:{docs:{description:{story:`
29
+ Bottom: step-based progress with 20% increments every 3 seconds and \`aria-valuetext\` for accessibility (e.g., "3 of 5 files uploaded").`}}}},y={render:()=>{let e;const t=()=>{const n=document.createElement("div"),o=document.createElement("div");o.className="flex flex-col mb-4 items-center";const s=document.createElement("h3");s.className="text-lg font-semibold mb-2",s.textContent="Scroll within the container to see progress bars animate in";const r=document.createElement("button");r.textContent="Reset",r.className="px-4 py-2 bg-primary-500 text-white rounded hover:bg-primary-600",r.onclick=()=>{e.innerHTML="",e.appendChild(t())},o.appendChild(s),o.appendChild(r),n.appendChild(o);const l=document.createElement("div");l.style.height="150px",l.style.overflowY="auto",l.style.border="1px solid #e5e7eb",l.style.borderRadius="4px",l.style.padding="1rem";const a=document.createElement("div");a.className="flex flex-col gap-8",a.style.minHeight="150vh";const i=document.createElement("btu-linear-progress");i.progress=30,i.color="primary",i.label="30%",a.appendChild(i);const p=document.createElement("div");p.style.marginTop="30vh";const d=document.createElement("btu-linear-progress");d.progress=50,d.color="teal",d.label="50%",p.appendChild(d),a.appendChild(p);const b=document.createElement("div");b.style.marginTop="30vh";const m=document.createElement("btu-linear-progress");m.progress=75,m.color="purple",m.label="75%",b.appendChild(m),a.appendChild(b);const u=document.createElement("div");u.style.marginTop="30vh";const c=document.createElement("btu-linear-progress");return c.progress=100,c.color="success",c.label="100%",u.appendChild(c),a.appendChild(u),l.appendChild(a),n.appendChild(l),n};return e=t(),e},parameters:{docs:{description:{story:'Demonstrates the viewport animation - progress bars animate from 0 to their target value when they become visible. Scroll within the container to see each progress bar animate in. Click "Reset" to restart.'}}}},C={render:()=>{const e=document.createElement("div");e.className="flex flex-col items-start gap-4";let t=0;const n=document.createElement("btu-linear-progress");n.progress=0,n.color="primary",n.label="0%";const o=document.createElement("div");o.className="text-sm text-gray-600",o.textContent="Status: In Progress...";const s=document.createElement("div");s.className="text-xs text-gray-500 mt-2",s.textContent="Event Log: (waiting for completion)",n.addEventListener("btu-progress-complete",()=>{o.textContent="Status: Complete! ✓",o.className="text-sm text-green-600 font-semibold",s.textContent=`Event Log: btu-progress-complete fired at ${new Date().toLocaleTimeString()}`,s.className="text-xs text-green-600 mt-2"});let r=!1;const l=setInterval(()=>{r||(t=t+1,n.progress=t,n.label=`${t}%`,t<100&&(o.textContent="Status: In Progress...",o.className="text-sm text-gray-600"),t===100&&(r=!0,setTimeout(()=>{t=0,r=!1},3e3)))},50),a=new MutationObserver(i=>{i.forEach(p=>{p.removedNodes.forEach(d=>{(d===e||d.contains(e))&&(clearInterval(l),a.disconnect())})})});return setTimeout(()=>{e.parentNode&&a.observe(e.parentNode,{childList:!0})},0),e.appendChild(n),e.appendChild(o),e.appendChild(s),e},parameters:{docs:{description:{story:"Demonstrates the btu-progress-complete event that fires when progress reaches 100%. The event fires each time progress completes a cycle."}}}},E={render:()=>{const e=document.createElement("div");e.className="flex flex-col gap-8";const t=document.createElement("div");t.className="flex flex-col gap-2";const n=document.createElement("h4");n.className="text-sm font-semibold text-gray-900",n.textContent="Progress bar with aria-label";const o=document.createElement("p");o.className="text-xs text-gray-600 mb-2",o.textContent='Screen readers announce: "Page loading progress"';const s=document.createElement("btu-linear-progress");s.progress=40,s.color="primary",s.ariaLabel="Page loading progress",t.appendChild(n),t.appendChild(o),t.appendChild(s);const r=document.createElement("div");r.className="flex flex-col gap-2";const l=document.createElement("h4");l.className="text-sm font-semibold text-gray-900",l.textContent="With custom aria-valuetext";const a=document.createElement("p");a.className="text-xs text-gray-600 mb-2",a.textContent='Screen readers announce: "File upload progress, 3 of 5 files uploaded"';const i=document.createElement("btu-linear-progress");i.progress=60,i.color="teal",i.label="3/5 files",i.ariaLabel="File upload progress",i.ariaValueText="3 of 5 files uploaded",r.appendChild(l),r.appendChild(a),r.appendChild(i);const p=document.createElement("div");p.className="flex flex-col gap-2";const d=document.createElement("h4");d.className="text-sm font-semibold text-gray-900",d.textContent="With completion announcement";const b=document.createElement("p");b.className="text-xs text-gray-600 mb-2",b.textContent='Screen readers auto-announce when complete: "Installation complete!"';const m=document.createElement("div");m.className="text-xs text-gray-500 mt-2",m.textContent="Announcement status: (waiting...)";let u=0;const c=document.createElement("btu-linear-progress");c.progress=0,c.color="success",c.label="0%",c.ariaLabel="Installation progress",c.completionAnnouncement="Installation complete!",c.addEventListener("btu-progress-complete",()=>{m.textContent='Announcement status: "Installation complete!" announced at '+new Date().toLocaleTimeString(),m.className="text-xs text-green-600 mt-2"});const w=setInterval(()=>{u<100?(u+=2,c.progress=u,c.label=`${u}%`,c.ariaValueText=`${u} percent complete`):clearInterval(w)},100);p.appendChild(d),p.appendChild(b),p.appendChild(c),p.appendChild(m);const N=new MutationObserver(S=>{S.forEach(I=>{I.removedNodes.forEach(L=>{(L===e||L.contains(e))&&(clearInterval(w),N.disconnect())})})});return setTimeout(()=>{e.parentNode&&N.observe(e.parentNode,{childList:!0})},0),e.appendChild(t),e.appendChild(r),e.appendChild(p),e},parameters:{docs:{description:{story:`
30
30
  Demonstrates accessibility best practices for screen reader users:
31
31
 
32
32
  **1. Basic usage:** Set \`ariaLabel\` to describe what's progressing.
@@ -394,4 +394,4 @@ Demonstrates accessibility best practices for screen reader users:
394
394
  }
395
395
  }
396
396
  }
397
- }`,...E.parameters?.docs?.source}}};const B=["Default","DeterminateProgress","AnimatedProgress","InitialAnimation","CompletionEvent","Accessibility"];export{E as Accessibility,x as AnimatedProgress,C as CompletionEvent,v as Default,f as DeterminateProgress,y as InitialAnimation,B as __namedExportsOrder,k as default};
397
+ }`,...E.parameters?.docs?.source}}};const O=["Default","DeterminateProgress","AnimatedProgress","InitialAnimation","CompletionEvent","Accessibility"];export{E as Accessibility,x as AnimatedProgress,C as CompletionEvent,v as Default,f as DeterminateProgress,y as InitialAnimation,O as __namedExportsOrder,W as default};
@@ -0,0 +1,272 @@
1
+ import{g as m,x as o}from"./iframe-CM6gBkqA.js";import{o as c}from"./style-map-BJGdSb_D.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};
@@ -1,4 +1,4 @@
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:`
1
+ import{g as a,x as r}from"./iframe-CM6gBkqA.js";import{o as c}from"./if-defined-Bv2_qPJg.js";import{o as d}from"./style-map-BJGdSb_D.js";import"./preload-helper-PPVm8Dsz.js";const{events:u,args:g,argTypes:e}=a("btu-popover"),y={title:"Components/Popover",component:"btu-popover",tags:["autodocs"],parameters:{docs:{subtitle:"Rich interactive content anchored to a trigger element",description:{component:`
2
2
  \`btu-popover\` displays rich interactive content anchored to a trigger element using CSS anchor positioning and the native Popover API.
3
3
 
4
4
  <h3>When to use:</h3>
@@ -24,14 +24,14 @@ import{g as c,x as r}from"./iframe-CcloOV09.js";import{o as d}from"./if-defined-
24
24
  <li>Focus restored to trigger on close</li>
25
25
  <li>Add <code>autofocus</code> to an element inside <code>slot="content"</code> for auto-focus on open</li>
26
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`
27
+ `}},actions:{handles:u},controls:{expanded:!0}},args:{...g,position:"bottom",trigger:"click",delay:300,open:!1},argTypes:{...e,position:{...e.position,control:{type:"select"},options:["top","bottom","left","right"]},trigger:{...e.trigger,control:{type:"select"},options:["click","hover","focus"]},delay:{...e.delay,control:{type:"number"},description:"Show delay in ms (hover trigger only)"},offset:{...e.offset,control:{type:"select"},options:["sm","md","lg","xl"],description:"Gap between trigger and popover (sm=4px, md=8px, lg=12px, xl=16px)"},open:{...e.open,control:{type:"boolean"},description:"Programmatic open/close (reflected)"},customBg:{name:"--popover-color-background",description:"Background color",control:{type:"color"},table:{category:"CSS Properties",defaultValue:{summary:"white"}}},customTitleColor:{name:"--popover-color-title",description:"Title text color",control:{type:"color"},table:{category:"CSS Properties",defaultValue:{summary:"oklch(var(--btu-theme-gray-900))"}}},customContentColor:{name:"--popover-color-content",description:"Content text color",control:{type:"color"},table:{category:"CSS 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 Properties",defaultValue:{summary:"0.5rem (lg)"}}}},render:o=>{const t={};return o.customBg&&(t["--popover-color-background"]=o.customBg),o.customTitleColor&&(t["--popover-color-title"]=o.customTitleColor),o.customContentColor&&(t["--popover-color-content"]=o.customContentColor),o.customRadius&&(t["--popover-border-radius"]=o.customRadius),r`
28
28
  <div style="display: flex; justify-content: center; padding: 6rem 2rem;">
29
- <div style="${a}">
29
+ <div style=${d(t)}>
30
30
  <btu-popover
31
31
  position="${o.position}"
32
32
  trigger="${o.trigger}"
33
33
  delay="${o.delay}"
34
- offset="${d(o.offset)}"
34
+ offset="${c(o.offset)}"
35
35
  ?no-arrow="${o.noArrow}"
36
36
  ?open="${o.open}"
37
37
  >
@@ -428,4 +428,4 @@ import{g as c,x as r}from"./iframe-CcloOV09.js";import{o as d}from"./if-defined-
428
428
  }
429
429
  }
430
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};
431
+ }`,...l.parameters?.docs?.source}}};const f=["Default","Positions","RichContent","AdvancedUsage"];export{l as AdvancedUsage,n as Default,i as Positions,s as RichContent,f as __namedExportsOrder,y as default};
@@ -1 +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
+ import"./iframe-CM6gBkqA.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-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`
1
+ import{x as o}from"./iframe-CM6gBkqA.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>
@@ -1,4 +1,4 @@
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`
1
+ import{x as a}from"./iframe-CM6gBkqA.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-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`
1
+ import{x as u}from"./iframe-CM6gBkqA.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">