index.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { cva } from "class-variance-authority";
  2. export { default as InputGroup } from "./InputGroup.vue";
  3. export { default as InputGroupAddon } from "./InputGroupAddon.vue";
  4. export { default as InputGroupButton } from "./InputGroupButton.vue";
  5. export { default as InputGroupInput } from "./InputGroupInput.vue";
  6. export { default as InputGroupText } from "./InputGroupText.vue";
  7. export { default as InputGroupTextarea } from "./InputGroupTextarea.vue";
  8. export const inputGroupAddonVariants = cva(
  9. "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
  10. {
  11. variants: {
  12. align: {
  13. "inline-start":
  14. "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
  15. "inline-end":
  16. "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
  17. "block-start":
  18. "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
  19. "block-end":
  20. "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5",
  21. },
  22. },
  23. defaultVariants: {
  24. align: "inline-start",
  25. },
  26. },
  27. );
  28. export const inputGroupButtonVariants = cva(
  29. "text-sm shadow-none flex gap-2 items-center",
  30. {
  31. variants: {
  32. size: {
  33. xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
  34. sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
  35. "icon-xs":
  36. "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
  37. "icon-sm": "size-8 p-0 has-[>svg]:p-0",
  38. },
  39. },
  40. defaultVariants: {
  41. size: "xs",
  42. },
  43. },
  44. );