import {
  ActionMenu,
  Button,
  Dialog,
  DropdownMenu,
  Icon,
  IconButton,
  Input,
  InputWithLabel,
  Label,
  Spinner,
  Tooltip,
  buttonTokens,
  destroyAll,
  showConfirm,
  showDialog,
  showError,
  showInfo,
  showWarning
} from "./chunk-VYFBR7S4.mjs";
import "./chunk-NIH5ZMPE.mjs";

// src/card/card.tsx
import { cva } from "class-variance-authority";
import { jsx } from "react/jsx-runtime";
var cardStyles = cva("c-card", {
  variants: {
    variant: {
      default: "c-card",
      elevate: "c-card-elevate"
    }
  },
  defaultVariants: {
    variant: "default"
  }
});
function Card({ children, className, variant, ...delegated }) {
  return /* @__PURE__ */ jsx("section", {
    className: cardStyles({ variant, className }),
    ...delegated,
    children
  });
}

// src/card/index.ts
var cardToken = "c-card";

// src/avatar/avatar.tsx
import { forwardRef } from "react";
import { cva as cva2 } from "class-variance-authority";

// src/avatar/get-initials.ts
var getInitials = (name) => {
  const [first, second] = name.split(" ");
  const initials = `${first?.charAt(0) ?? ""}${second?.charAt(0) ?? ""}`;
  return initials.toUpperCase();
};

// src/avatar/avatar.tsx
import { jsx as jsx2 } from "react/jsx-runtime";
var avatarClassName = cva2(["c-avatar"], {
  variants: {
    size: {
      md: "c-avatar-md",
      lg: "c-avatar-lg",
      xl: "c-avatar-xl",
      "2xl": "c-avatar-2xl"
    }
  },
  defaultVariants: {
    size: "md"
  }
});
var Avatar = forwardRef(({ name, size, className, ...delegated }, ref) => {
  return /* @__PURE__ */ jsx2("div", {
    ref,
    ...delegated,
    title: name,
    className: avatarClassName({ size, className }),
    children: /* @__PURE__ */ jsx2("span", {
      className: "c-avatar-initials",
      children: getInitials(name)
    })
  });
});
Avatar.displayName = "Avatar";

// src/checkbox/checkbox.tsx
import { forwardRef as forwardRef2 } from "react";
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
var Checkbox = forwardRef2((props, ref) => {
  return /* @__PURE__ */ jsx3(CheckboxPrimitive.Root, {
    ...props,
    ref,
    className: "c-checkbox",
    children: /* @__PURE__ */ jsx3(CheckboxPrimitive.Indicator, {
      children: /* @__PURE__ */ jsxs("svg", {
        viewBox: "0 0 9 9",
        fill: "none",
        className: "c-checkbox__svg",
        children: [
          /* @__PURE__ */ jsx3("path", {
            className: "c-checkbox__svg-p1",
            d: "M1.12 5.51a.559.559 0 01.832-.101l2.201 1.953-.427.624a.326.326 0 01-.486.06L1.21 6.245a.559.559 0 01-.09-.734z"
          }),
          /* @__PURE__ */ jsx3("path", {
            className: "c-checkbox__svg-p2",
            d: "M7.883 1.087c.043.03.053.09.023.132L3.669 7.132l-.154-.105L7.754 1.11a.093.093 0 01.129-.023z"
          })
        ]
      })
    })
  });
});
Checkbox.displayName = "Checkbox";

// src/inline-radio/inline-radio.tsx
import { cx, cva as cva3 } from "class-variance-authority";
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
import { jsx as jsx4 } from "react/jsx-runtime";
var inlineRadioGroupStyles = cva3("c-inline-radio-group", {
  variants: {
    size: {
      xs: "c-inline-radio-group-xs",
      sm: "c-inline-radio-group-sm",
      md: "c-inline-radio-group-md",
      lg: "c-inline-radio-group-lg"
    }
  },
  defaultVariants: {
    size: "sm"
  }
});
function InlineRadioGroup({ size, className, ...delegated }) {
  return /* @__PURE__ */ jsx4(RadioGroupPrimitive.Root, {
    ...delegated,
    className: inlineRadioGroupStyles({ size, className })
  });
}
function InlineRadioItem({ children, className, ...delegated }) {
  return /* @__PURE__ */ jsx4(RadioGroupPrimitive.Item, {
    ...delegated,
    className: cx("c-inline-radio", className),
    children: /* @__PURE__ */ jsx4(RadioGroupPrimitive.Indicator, {
      forceMount: true,
      children
    })
  });
}
var InlineRadio = {
  Group: InlineRadioGroup,
  Item: InlineRadioItem
};

// src/progress/progress.tsx
import { cx as cx2 } from "class-variance-authority";
import * as ProgressPrimitives from "@radix-ui/react-progress";
import { jsx as jsx5 } from "react/jsx-runtime";
function Progress({ className, value }) {
  return /* @__PURE__ */ jsx5(ProgressPrimitives.Root, {
    className: cx2(className, "c-progress-root"),
    value,
    children: /* @__PURE__ */ jsx5(ProgressPrimitives.Indicator, {
      className: "c-progress-indicator",
      style: { transform: `translateX(-${100 - (value ?? 0)}%)` }
    })
  });
}

// src/radio/radio.tsx
import * as RadioGroupPrimitive2 from "@radix-ui/react-radio-group";
import { jsx as jsx6 } from "react/jsx-runtime";
function RadioGroupItem(props) {
  return /* @__PURE__ */ jsx6(RadioGroupPrimitive2.Item, {
    ...props,
    className: "c-radio-item",
    children: /* @__PURE__ */ jsx6(RadioGroupPrimitive2.Indicator, {
      className: "c-radio-indicator"
    })
  });
}
var Radio = {
  Group: RadioGroupPrimitive2.Root,
  Item: RadioGroupItem
};

// src/select/select-item.tsx
import { forwardRef as forwardRef3 } from "react";
import * as SelectPrimitives from "@radix-ui/react-select";
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
var SelectItem = forwardRef3((props, ref) => {
  const { children, ...delegated } = props;
  return /* @__PURE__ */ jsxs2(SelectPrimitives.Item, {
    className: "c-select-item",
    ref,
    ...delegated,
    children: [
      /* @__PURE__ */ jsx7(SelectPrimitives.ItemText, {
        children
      }),
      /* @__PURE__ */ jsx7(SelectPrimitives.ItemIndicator, {})
    ]
  });
});
SelectItem.displayName = "SelectItem";

// src/select/select-root.tsx
import { forwardRef as forwardRef4 } from "react";
import { cva as cva4 } from "class-variance-authority";
import * as SelectPrimitives2 from "@radix-ui/react-select";
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
var selectTriggerStyles = cva4("c-select-trigger", {
  variants: {
    size: {
      xs: "c-select-trigger-xs",
      sm: "c-select-trigger-sm",
      md: "c-select-trigger-md",
      lg: "c-select-trigger-lg"
    }
  },
  defaultVariants: {
    size: "sm"
  }
});
var SelectContainer = forwardRef4(
  ({ children, id, placeholder, disabled, size, triggerClassName, ...delegated }, ref) => {
    return /* @__PURE__ */ jsxs3(SelectPrimitives2.Root, {
      ...delegated,
      children: [
        /* @__PURE__ */ jsxs3(SelectPrimitives2.Trigger, {
          ref,
          className: selectTriggerStyles({ size, className: triggerClassName }),
          disabled,
          id,
          children: [
            /* @__PURE__ */ jsx8(SelectPrimitives2.Value, {
              placeholder: /* @__PURE__ */ jsx8("span", {
                className: "c-select-value",
                children: placeholder ?? "Select..."
              })
            }),
            /* @__PURE__ */ jsx8(Icon.Arrow, {})
          ]
        }),
        /* @__PURE__ */ jsx8(SelectPrimitives2.Portal, {
          children: /* @__PURE__ */ jsxs3(SelectPrimitives2.Content, {
            className: "c-select-content",
            children: [
              /* @__PURE__ */ jsx8(SelectPrimitives2.ScrollUpButton, {}),
              /* @__PURE__ */ jsx8(SelectPrimitives2.Viewport, {
                className: "c-select-viewport",
                children
              }),
              /* @__PURE__ */ jsx8(SelectPrimitives2.ScrollDownButton, {})
            ]
          })
        })
      ]
    });
  }
);
SelectContainer.displayName = "Select";

// src/select/select.ts
var Select = {
  Container: SelectContainer,
  Item: SelectItem
};

// src/slider/slider.tsx
import { forwardRef as forwardRef5 } from "react";
import { cx as cx3 } from "class-variance-authority";
import * as SliderPrimitive from "@radix-ui/react-slider";
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
var Slider = forwardRef5(({ className, transparentRange, ...delegated }, ref) => {
  return /* @__PURE__ */ jsxs4(SliderPrimitive.Root, {
    className: cx3("c-slider-root", className),
    ref,
    ...delegated,
    children: [
      /* @__PURE__ */ jsx9(SliderPrimitive.Track, {
        className: "c-slider-track",
        children: /* @__PURE__ */ jsx9(SliderPrimitive.Range, {
          className: `c-slider-range ${transparentRange ? "c-slider-range-transparent" : ""}`
        })
      }),
      /* @__PURE__ */ jsx9(SliderPrimitive.Thumb, {
        className: "c-slider-thumb"
      })
    ]
  });
});

// src/stack-icon/stack-icon.tsx
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
function StackIcon({ type, children, size = 18 }) {
  return /* @__PURE__ */ jsxs5("span", {
    className: "c-stack-icon",
    children: [
      type === "create" && /* @__PURE__ */ jsx10("span", {
        style: { width: size, height: size },
        className: "c-stack-icon__icon",
        children: /* @__PURE__ */ jsx10(Icon.Add, {
          width: size - 4,
          height: size - 4
        })
      }),
      children
    ]
  });
}

// src/tag/tag.tsx
import { cva as cva5 } from "class-variance-authority";
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
var tagStyles = cva5("c-tag", {
  variants: {
    variant: {
      default: "c-tag-default",
      elevate: "c-tag-elevate"
    },
    size: {
      xxs: "c-tag-xxs",
      xs: "c-tag-xs",
      sm: "c-tag-sm",
      md: "c-tag-md",
      lg: "c-tag-lg"
    }
  },
  defaultVariants: {
    variant: "default",
    size: "xs"
  }
});
function Tag({ children, className, variant, size, prepend, onRemove, ...delegated }) {
  return /* @__PURE__ */ jsxs6("div", {
    className: tagStyles({ className, variant, size }),
    ...delegated,
    children: [
      !prepend ? null : /* @__PURE__ */ jsx11("span", {
        className: "c-tag__prepend",
        children: prepend
      }),
      children,
      onRemove && /* @__PURE__ */ jsxs6("button", {
        type: "button",
        className: "c-tag__remove-button",
        onClick: (e) => {
          e.stopPropagation();
          onRemove();
        },
        children: [
          /* @__PURE__ */ jsx11(Icon.Cancel, {
            width: 12,
            height: 12
          }),
          /* @__PURE__ */ jsx11("span", {
            className: "c-tag__remove-button-text",
            children: "Remove"
          })
        ]
      })
    ]
  });
}

// src/rich-text-editor/index.tsx
import { lazy, Suspense } from "react";
import { jsx as jsx12 } from "react/jsx-runtime";
var LazyRichTextEditor = lazy(() => import("./rich-text-editor-PXZQZRPK.mjs"));
var RichTextEditor = (props) => {
  return /* @__PURE__ */ jsx12(Suspense, {
    fallback: null,
    children: /* @__PURE__ */ jsx12(LazyRichTextEditor, {
      ...props
    })
  });
};

// src/toast/index.ts
import { Toaster } from "sonner";

// src/toast/toast.tsx
import { cva as cva6, cx as cx4 } from "class-variance-authority";
import { toast as sonnerToast } from "sonner";
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
var toastStyles = cva6("c-toast", {
  variants: {
    type: {
      info: "c-toast-info",
      error: "c-toast-error",
      success: "c-toast-success",
      warning: "c-toast-warning"
    }
  },
  defaultVariants: {
    type: "success"
  }
});
var iconMap = {
  info: Icon.Info,
  error: Icon.Error,
  success: Icon.CheckWithCircle,
  warning: Icon.Warning
};
var toast = ({ title, message, type = "success", timeout = 6e3 }) => {
  const ToastIcon = iconMap[type];
  const withMessage = !!message;
  const toastId = Date.now().toString();
  sonnerToast.custom(
    (id) => /* @__PURE__ */ jsxs7("div", {
      "data-testid": `toast-${type}`,
      className: cx4(toastStyles({ type }), withMessage ? "c-toast-with-message" : "c-toast-title-only"),
      children: [
        /* @__PURE__ */ jsx13("div", {
          children: /* @__PURE__ */ jsx13(ToastIcon, {
            width: 26,
            height: 26
          })
        }),
        /* @__PURE__ */ jsxs7("div", {
          children: [
            /* @__PURE__ */ jsx13("div", {
              className: "c-toast-title",
              children: title
            }),
            !!message && /* @__PURE__ */ jsx13("div", {
              className: "c-toast-message",
              children: message
            })
          ]
        }),
        /* @__PURE__ */ jsx13("div", {
          className: "c-toast-close",
          children: /* @__PURE__ */ jsx13(IconButton, {
            onClick: () => sonnerToast.dismiss(id),
            size: "xs",
            children: /* @__PURE__ */ jsx13(Icon.Cancel, {
              width: 12,
              height: 12
            })
          })
        })
      ]
    }),
    {
      id: toastId,
      duration: timeout,
      style: { width: "100%" }
    }
  );
  return toastId;
};
toast.dismiss = sonnerToast.dismiss;

// src/switch/switch.tsx
import { cva as cva7 } from "class-variance-authority";
import * as RadixSwitch from "@radix-ui/react-switch";
import { jsx as jsx14 } from "react/jsx-runtime";
var switchStyles = cva7(["c-switch-root"], {
  variants: {
    size: {
      xs: "c-switch-root-xs",
      sm: "c-switch-root-sm"
    }
  },
  defaultVariants: {
    size: "sm"
  }
});
function Switch({ size, ...props }) {
  return /* @__PURE__ */ jsx14(RadixSwitch.Root, {
    ...props,
    className: switchStyles({ size }),
    children: /* @__PURE__ */ jsx14(RadixSwitch.Thumb, {
      className: "c-switch-thumb"
    })
  });
}

// src/index.ts
var tokens = {
  button: buttonTokens,
  card: cardToken
};
export {
  ActionMenu,
  Avatar,
  Button,
  Card,
  Checkbox,
  Dialog,
  DropdownMenu,
  Icon,
  IconButton,
  InlineRadio,
  Input,
  InputWithLabel,
  Label,
  Progress,
  Radio,
  RichTextEditor,
  Select,
  Slider,
  Spinner,
  StackIcon,
  Switch,
  Tag,
  Toaster,
  Tooltip,
  buttonTokens,
  cardToken,
  destroyAll,
  showConfirm,
  showDialog,
  showError,
  showInfo,
  showWarning,
  toast,
  tokens
};
