import{g as c,x as s}from"./iframe-CMPv_g6-.js";import{o as n}from"./style-map-968Ye5qo.js";import"./preload-helper-PPVm8Dsz.js";const{events:d,args:l,argTypes:o}=c("btu-badge"),g=["info","primary","error","success","warning"],b={title:"Components/Badge",component:"btu-badge",tags:["autodocs"],parameters:{docs:{subtitle:"A component for highlighting important information",description:{component:`
<h3>When to use:</h3>
<ul>
  <li>To call attention to something</li>
  <li>For presenting status</li>
  <li>For anything longer than a very short number</li>
</ul>

<h3>When not to use:</h3>
<ul>
  <li>For very short numbers. Instead use a notification</li>
  <li>For circled notifications</li>
</ul>
        `}},actions:{handles:d},controls:{expanded:!0}},args:{...l,variant:"success",dot:!1,size:"sm"},argTypes:{...o,"--badge-color-foreground":{table:{disable:!0}},"--badge-color-background":{table:{disable:!0}},"--badge-radius-size":{table:{disable:!0}},"--badge-px":{table:{disable:!0}},"--badge-py":{table:{disable:!0}},"--badge-dot-size":{table:{disable:!0}},variant:{...o.variant,control:{type:"select"},options:g},dot:{...o.dot,control:{type:"boolean"}},size:{...o.size,control:{type:"select"},options:["sm","md","lg"]},customBackgroundColor:{name:"--badge-color-background",control:{type:"color"},description:"Custom background color - overrides the theme color",table:{category:"css properties"}},customForegroundColor:{name:"--badge-color-foreground",control:{type:"color"},description:"Custom foreground (text) color - overrides the theme color",table:{category:"css properties"}},customRadiusSize:{name:"--badge-radius-size",control:{type:"text"},description:"Custom border radius size - overrides the shape default (default: 999px)",table:{category:"css properties"}},customPadX:{name:"--badge-px",control:{type:"text"},description:"Horizontal padding - overrides the size default",table:{category:"css properties"}},customPadY:{name:"--badge-py",control:{type:"text"},description:"Vertical padding - overrides the size default",table:{category:"css properties"}},customDotSize:{name:"--badge-dot-size",control:{type:"text"},description:"Size of the dot affordance (default: 6px)",table:{category:"css properties"}}},render:e=>{const a={};return e.customBackgroundColor&&(a["--badge-color-background"]=e.customBackgroundColor),e.customForegroundColor&&(a["--badge-color-foreground"]=e.customForegroundColor),e.customRadiusSize&&(a["--badge-radius-size"]=e.customRadiusSize),e.customPadX&&(a["--badge-px"]=e.customPadX),e.customPadY&&(a["--badge-py"]=e.customPadY),e.customDotSize&&(a["--badge-dot-size"]=e.customDotSize),s`<btu-badge variant="${e.variant}" ?dot="${e.dot}" size="${e.size}" style=${n(a)}
      >Badge</btu-badge
    >`}},i={args:{}},t={args:{variant:"success",size:"lg"},render:e=>s`<a href="#" class="hover:text-primary inline-flex items-center gap-2 hover:underline">
      Hover over me to see the
      <btu-badge variant="${e.variant}" size="${e.size}">Linked Badge</btu-badge>
      in action.
    </a>`,parameters:{docs:{description:{story:"Badges inside anchor elements automatically handle underlines properly. The underline uses the badge background color instead of the default link color, ensuring proper visual hierarchy when badges are used within linked elements."}}}},r={render:()=>s`<div class="flex flex-col gap-4">
      <div class="flex items-center gap-2">
        <strong>With Icon:</strong>
        <btu-badge variant="warning" size="md">
          <btu-icon symbol="triangle-alert" size="md"></btu-icon>
          Warning
        </btu-badge>
      </div>
      <div class="flex items-center gap-2">
        <strong>With Image:</strong>
        <btu-badge variant="primary" size="md">
          <div
            class="-ms-[--badge-px] aspect-square w-[20px] bg-cover bg-center bg-no-repeat [clipPath:circle(50%_at_center)]"
            style="background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjM1IDY1MCIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KPGRlZnM+DQo8ZyBpZD0idW5pb24iPg0KPHVzZSB5PSItLjIxNiIgeGxpbms6aHJlZj0iI3g0Ii8+DQo8dXNlIHhsaW5rOmhyZWY9IiN4NCIvPg0KPHVzZSB5PSIuMjE2IiB4bGluazpocmVmPSIjczYiLz4NCjwvZz4NCjxnIGlkPSJ4NCI+DQo8dXNlIHhsaW5rOmhyZWY9IiNzNiIvPg0KPHVzZSB5PSIuMDU0IiB4bGluazpocmVmPSIjczUiLz4NCjx1c2Uge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8L2RlZnM+DQo8cGF0aCBmaWxsPSIjZmZmIiBkPSJtMCwwaDEyMzV2NjUwaC0xMjM1eiIvPg0KPHVzZSB4bGluazpocmVmPSIjc3RyaXBlIi8+DQo8dXNlIHk9IjEwMCIgeGxpbms6aHJlZj0iI3N0cmlwZSIvPg0KPHVzZSB5PSIyMDAiIHhsaW5rOmhyZWY9IiNzdHJpcGUiLz4NCjx1c2UgeT0iMzAwIiB4bGluazpocmVmPSIjc3RyaXBlIi8+DQo8dXNlIHk9IjQwMCIgeGxpbms6aHJlZj0iI3N0cmlwZSIvPg0KPHVzZSB5PSI1MDAiIHhsaW5rOmhyZWY9IiNzdHJpcGUiLz4NCjx1c2UgeT0iNjAwIiB4bGluazpocmVmPSIjc3RyaXBlIi8+DQo8cGF0aCBmaWxsPSIjMDAyODY4IiBkPSJtMCwwaDQ5NHYzNTBoLTQ5NHoiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3VuaW9uIiB0cmFuc2Zvcm09Im1hdHJpeCg2NTAgMCAwIDY1MCAyNDcgMTc1KSIvPg0KPC9zdmc+DQo=')"
            aria-label="Flag"
          ></div>
          United States
        </btu-badge>
      </div>
      <div class="flex items-center gap-2">
        <strong>Rectangular Shape:</strong>
        <btu-badge variant="success" size="md" style="--badge-radius-size: 0px">Rectangle</btu-badge>
      </div>
      <div class="story-custom-colors flex items-center gap-2">
        <strong>Custom Colors:</strong>
        <btu-badge
          dot
          variant="primary"
          size="lg"
          style="--badge-color-background: oklch(70% 0.3 var(--hue)); --badge-color-foreground: oklch(95% 0.1 calc(-1 * var(--hue)));"
          >Custom Badge</btu-badge
        >
      </div>
    </div>`,parameters:{docs:{description:{story:"\nBadges support advanced customization through CSS properties and content composition:\n\n**With Icons and Images:** Place icon or image elements inside the badge along with your label text. Visual elements should always be placed before the label text. Note that the `<btu-icon>` web component can be used for icons.\n\n**Custom Shape:** The badge shape defaults to pill (rounded), but can be made rectangular by setting `--badge-radius-size: 0px`.\n\n**Custom Colors:** Override theme colors using `--badge-color-background` and `--badge-color-foreground` CSS properties. The foreground color controls the text color (and any child elements that inherit text color, such as the dot and icons). The background color controls the badge's background fill."}}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
  args: {}
}`,...i.parameters?.docs?.source}}};t.parameters={...t.parameters,docs:{...t.parameters?.docs,source:{originalSource:`{
  args: {
    variant: 'success',
    size: 'lg'
  },
  render: args => html\`<a href="#" class="hover:text-primary inline-flex items-center gap-2 hover:underline">
      Hover over me to see the
      <btu-badge variant="\${args.variant}" size="\${args.size}">Linked Badge</btu-badge>
      in action.
    </a>\`,
  parameters: {
    docs: {
      description: {
        story: \`Badges inside anchor elements automatically handle underlines properly. The underline uses the badge background color instead of the default link color, ensuring proper visual hierarchy when badges are used within linked elements.\`
      }
    }
  }
}`,...t.parameters?.docs?.source}}};r.parameters={...r.parameters,docs:{...r.parameters?.docs,source:{originalSource:`{
  render: () => html\`<div class="flex flex-col gap-4">
      <div class="flex items-center gap-2">
        <strong>With Icon:</strong>
        <btu-badge variant="warning" size="md">
          <btu-icon symbol="triangle-alert" size="md"></btu-icon>
          Warning
        </btu-badge>
      </div>
      <div class="flex items-center gap-2">
        <strong>With Image:</strong>
        <btu-badge variant="primary" size="md">
          <div
            class="-ms-[--badge-px] aspect-square w-[20px] bg-cover bg-center bg-no-repeat [clipPath:circle(50%_at_center)]"
            style="background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjM1IDY1MCIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KPGRlZnM+DQo8ZyBpZD0idW5pb24iPg0KPHVzZSB5PSItLjIxNiIgeGxpbms6aHJlZj0iI3g0Ii8+DQo8dXNlIHhsaW5rOmhyZWY9IiN4NCIvPg0KPHVzZSB5PSIuMjE2IiB4bGluazpocmVmPSIjczYiLz4NCjwvZz4NC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hbGUoLjA2MTYpIi8+DQo8cGF0aCBmaWxsPSIjYmYwYTMwIiBpZD0ic3RyaXBlIiBkPSJtMCwwaDEyMzV2NTBoLTEyMzV6Ii8+DQo8L2RlZnM+DQo8cGF0aCBmaWxsPSIjZmZmIiBkPSJtMCwwaDEyMzV2NjUwaC0xMjM1eiIvPg0KPHVzZSB4bGluazpocmVmPSIjc3RyaXBlIi8+DQo8dXNlIHk9IjEwMCIgeGxpbms6aHJlZj0iI3N0cmlwZSIvPg0KPHVzZSB5PSIyMDAiIHhsaW5rOmhyZWY9IiNzdHJpcGUiLz4NCjx1c2UgeT0iMzAwIiB4bGluazpocmVmPSIjc3RyaXBlIi8+DQo8dXNlIHk9IjQwMCIgeGxpbms6aHJlZj0iI3N0cmlwZSIvPg0KPHVzZSB5PSI1MDAiIHhsaW5rOmhyZWY9IiNzdHJpcGUiLz4NCjx1c2UgeT0iNjAwIiB4bGluazpocmVmPSIjc3RyaXBlIi8+DQo8cGF0aCBmaWxsPSIjMDAyODY4IiBkPSJtMCwwaDQ5NHYzNTBoLTQ5NHoiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3VuaW9uIiB0cmFuc2Zvcm09Im1hdHJpeCg2NTAgMCAwIDY1MCAyNDcgMTc1KSIvPg0KPC9zdmc+DQo=')"
            aria-label="Flag"
          ></div>
          United States
        </btu-badge>
      </div>
      <div class="flex items-center gap-2">
        <strong>Rectangular Shape:</strong>
        <btu-badge variant="success" size="md" style="--badge-radius-size: 0px">Rectangle</btu-badge>
      </div>
      <div class="story-custom-colors flex items-center gap-2">
        <strong>Custom Colors:</strong>
        <btu-badge
          dot
          variant="primary"
          size="lg"
          style="--badge-color-background: oklch(70% 0.3 var(--hue)); --badge-color-foreground: oklch(95% 0.1 calc(-1 * var(--hue)));"
          >Custom Badge</btu-badge
        >
      </div>
    </div>\`,
  parameters: {
    docs: {
      description: {
        story: \`
Badges support advanced customization through CSS properties and content composition:

**With Icons and Images:** Place icon or image elements inside the badge along with your label text. Visual elements should always be placed before the label text. Note that the \\\`<btu-icon>\\\` web component can be used for icons.

**Custom Shape:** The badge shape defaults to pill (rounded), but can be made rectangular by setting \\\`--badge-radius-size: 0px\\\`.

**Custom Colors:** Override theme colors using \\\`--badge-color-background\\\` and \\\`--badge-color-foreground\\\` CSS properties. The foreground color controls the text color (and any child elements that inherit text color, such as the dot and icons). The background color controls the badge's background fill.\`
      }
    }
  }
}`,...r.parameters?.docs?.source}}};const p=["Default","InsideAnchor","AdvancedUsage"];export{r as AdvancedUsage,i as Default,t as InsideAnchor,p as __namedExportsOrder,b as default};
